Quote from: Crimson Wizard on Sun 26/07/2020 21:41:08
Cassiebsg, you probably confuse "drawing surface" and "dynamic sprite".
DrawingSurface can be deleted (by calling Release) freely as it's merely an interface to access some object. When you release Drawing Surface, the object stays changed. In fact, Releasing a surface is a must because with Direct3D and OpenGL renderers it signals to update the video texture.
Drawing on room background does not stay and gets lost when you leave the room. This is probably made intentionally, to not increase size of saved games.
The solution is to create a global DynamicSprite, draw on that sprite instead, and either assign that sprite to the room object, or paint that sprite to room background whenever player enters the room.
In your case things are little more complicated as, it seems, you can draw anywhere, so object will be inconvenient. Perhaps do this:
* create a global DynamicSprite.
* when entering a room, if that sprite already exists, then paste it on room background.
* when drawing, draw both on that sprite AND room background. Dynamic sprite will work as a reserved image for restoring room background later.
So... It's been a while, but I still haven't managed to make it work. I'm struggling understanding how to store and load/paste the previously drawn surface onto the Room when I enter. I understand the solution, but I'm currently not able to code it propoerly. could anyone be so kind to help me out with this? Thanks!