At long last

Published March 08, 2021
Advertisement

I have definitely solved the display issue.

My hunch about letting the GameScreen know what the current GL origin is was correct. SRP does not I think mean that the gamescreen should exclusively deal with Skia coordinates. It would in fact be quite useless to me if it did. My work around up until this point had been to delegate translation between game logic and skia coordinates to the ScrollBox class. Except I had done so clumsily, and the extra abstraction was confusing. The Scrollbox stays roughly centered in the screen, so it was difficult to try to translate coordinates based on one of its corners.

What helped me through this was removing complexity. GameScreen still has a scrollbox, I'll need that to scroll. But now instead of invoking the box's functions it has its own internal .ToGL() and .ToSkia() functions. I've verified they work correctly on a debug run. Had a brief scare where they were dropping the Z information and stuff was getting drawn in the wrong order, always helps when you pass a non-zero value to Z. Bob is no longer floating 64 pixels above the ground. I can finally move on. Hell, I can see the way towards scrolling now. I may try to fix that one before finally getting back to collision. I will be very very happy to merge and then delete this branch when that day comes.

That'll do, Bob. That'll do.
Previous Entry SRP
Next Entry Hello again
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement