Open Vankata453 opened 5 months ago
My train of thought to test this was to load the game, and remove an image. If it works then it should display a missing texture, because the images are no longer there, which resulted in this:
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:84 Image '/res/industrial/gfx-enemy/duker/duker-body.png' doesn't exist. Attempting to load ".deprecated" version.
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:439 Couldn't load texture '/res/industrial/gfx-enemy/duker/duker-body.png' (now using dummy texture): Couldn't open '/res/industrial/gfx-enemy/duker/duker-body.deprecated.png': not found
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:84 Image '/res/industrial/gfx-enemy/duker/duker-end.png' doesn't exist. Attempting to load ".deprecated" version.
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:439 Couldn't load texture '/res/industrial/gfx-enemy/duker/duker-end.png' (now using dummy texture): Couldn't open '/res/industrial/gfx-enemy/duker/duker-end.deprecated.png': not found
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:84 Image '/res/industrial/gfx-enemy/duker/duker-head.png' doesn't exist. Attempting to load ".deprecated" version.
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:439 Couldn't load texture '/res/industrial/gfx-enemy/duker/duker-head.png' (now using dummy texture): Couldn't open '/res/industrial/gfx-enemy/duker/duker-head.deprecated.png': not found
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:84 Image '/res/industrial/gfx-enemy/duker/duker-head.png' doesn't exist. Attempting to load ".deprecated" version.
[WARNING] /home/tylerandari12/STcompilation/supertux/src/video/texture_manager.cpp:376 Couldn't load texture '/res/industrial/gfx-enemy/duker/duker-head.png' (now using dummy texture): Couldn't open '/res/industrial/gfx-enemy/duker/duker-head.deprecated.png': not found
[FATAL] /home/tylerandari12/STcompilation/supertux/src/supertux/main.cpp:745 Unexpected exception: Cannot load image.
(The game closed after this was printed.)
duker-body.png
, duker-end.png
, and duker-head.png
are the three images I removed so i could test. duker-head.png
was the only image on a scripted object. Im not sure why the other two also tried to load.
I found another thing, which Im not sure if its related directly to this PR, but I might as well mention it. When this happened I thought "Well that sucks, but if I open the game again I should be able to add the images back in after opening and hit reload resources to make them appear.", but when I opened the level again, the scripted object which had the image was not there at all. I closed the game, added the images back in, and reopened the level, and the scripted object was back again.
duker-body.png
,duker-end.png
, andduker-head.png
are the three images I removed so i could test.duker-head.png
was the only image on a scripted object. Im not sure why the other two also tried to load.
It reloads everything loaded since the start of the game.
I found another thing, which Im not sure if its related directly to this PR, but I might as well mention it. When this happened I thought "Well that sucks, but if I open the game again I should be able to add the images back in after opening and hit reload resources to make them appear.", but when I opened the level again, the scripted object which had the image was not there at all. I closed the game, added the images back in, and reopened the level, and the scripted object was back again.
Doesn't matter where the script object is, the resource is loaded into the game separately in its own manager.
It's not, because it's supposed to do that too. Will look into it.
TTF fonts now properly reload.
The new "Reload Resources" option in the "Debug" menu allows for reloading all fonts, textures, sprites and tilesets.
Additionally:
name
field for sprites. I honestly didn't know it existed before, and don't know what the point of it is, considering it's not referenced anywhere in the code, other than in logs, where a filename can be used instead.Closes #2901.