-
Notifications
You must be signed in to change notification settings - Fork 28
Move from SDL_Surface* to abstract RGBA storage class #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Untested, incomplete. This was the idea: > Across the codebase, move from SDLSurface* as storage for RGBA data to an abstract RGBA storage class which can be subclassed to either contain an SDLSurface or an OpenGL texture, while also containing the RGBA data. Move Sprite* and other classes to use that. --- Update the codebase to use an abstract RGBA storage class instead of SDL_Surface* for RGBA data storage. * Add `rgba_storage.h` to define an abstract class `RGBAStorage` with subclasses `SDLSurfaceStorage` and `OpenGLTextureStorage`. * Modify `sprite.h` and `sprite.cpp` to replace `SDL_Surface*` with `std::shared_ptr<RGBAStorage>` and update methods accordingly. * Modify `spritesdl.cpp` to use `RGBAStorage` methods for accessing RGBA data. * Modify `spritegl.h` and `spritegl.cpp` to use `std::shared_ptr<RGBAStorage>` for RGBA data storage. * Modify `automap.cpp` to use `std::shared_ptr<RGBAStorage>` for RGBA data storage. * Modify `engine.cpp` to use `std::shared_ptr<RGBAStorage>` for RGBA data storage. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/opentibia/yatc?shareId=XXXX-XXXX-XXXX-XXXX).
ivucica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a bit more work
|
|
||
| m_screen = NULL; | ||
| m_screen = nullptr; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary use of C++-style name for the same thing. No need to modify existing code like this.
ivucica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to give approval
| @@ -121,12 +121,12 @@ bool MiniMapArea::load() | |||
| //Create the sprite | |||
| // FIXME (nfries88): OpenGL does not work well when SDL is being used on the screen. | |||
| // this operation must be changed for GL engine to work. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test
Untested, incomplete. This was the idea:
Update the codebase to use an abstract RGBA storage class instead of SDL_Surface* for RGBA data storage.
rgba_storage.hto define an abstract classRGBAStoragewith subclassesSDLSurfaceStorageandOpenGLTextureStorage.sprite.handsprite.cppto replaceSDL_Surface*withstd::shared_ptr<RGBAStorage>and update methods accordingly.spritesdl.cppto useRGBAStoragemethods for accessing RGBA data.spritegl.handspritegl.cppto usestd::shared_ptr<RGBAStorage>for RGBA data storage.automap.cppto usestd::shared_ptr<RGBAStorage>for RGBA data storage.engine.cppto usestd::shared_ptr<RGBAStorage>for RGBA data storage.For more details, open the Copilot Workspace session.