Skip to content
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

Replace missing sprites with solid color rects as an optional flag #74

Open
ShamblesSM opened this issue Oct 5, 2022 · 3 comments
Open
Labels
D: Feature Request A feature that may be implemented in a future version.

Comments

@ShamblesSM
Copy link
Contributor

If it's possible to add flags to the executable, something like no-crash-on-missing-texture would work. I'm not too sure what use this would be but it would probably be too annoying when experimenting with the framework.

The flag should only be exclusive to OpenSMCE and not when releasing a game. Missing textures should be still logged in the console (and maybe show the nonexistent path when hovered).

@jakubg1 jakubg1 added D: Feature Request A feature that may be implemented in a future version. A: Code labels Oct 5, 2022
@jakubg1
Copy link
Owner

jakubg1 commented Oct 5, 2022

Yes, it's possible to add flags to the executable.
The problem with missing sprites is that we don't know their size - most objects in the engine which are rendered by sprites have an undefined size and are rendered with their natural size, defined in their sprite or inferred from the image size. Thus, we don't really know how big the rectangle should be in order to be drawn on the screen. It can be as small as a single sphere, or as big as an UI dialog background.
I like the idea of logging missing assets instead of crashing - this way, we can pinpoint multiple problems in a single launch, rather than dealing with problems one by one. In far future, there are plans to make a tool which would check the integrity of game files and log all paths to missing stuff, errors in files, unused assets, etc. These are far plans, though.
For now, due to the aforementioned problem, I have no immediate solution to this problem. Will however consider adding it in the future.

@ShamblesSM
Copy link
Contributor Author

...most objects in the engine which are rendered by sprites have an undefined size and are rendered with their natural size, defined in their sprite or inferred from the image size. Thus, we don't really know how big the rectangle should be in order to be drawn on the screen. It can be as small as a single sphere, or as big as an UI dialog background.

They could be a 32x32 px rect. It could also be a placeholder checkerboard texture even.

@jakubg1
Copy link
Owner

jakubg1 commented Oct 7, 2022

Alright, works for me if it's going to be just a marker which is like "if you see me, you have a serious problem to deal with, check log". I think ResourceManager could handle stuff like that, but the exact implementation is up to discussion.

@jakubg1 jakubg1 removed the A: Code label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D: Feature Request A feature that may be implemented in a future version.
Projects
None yet
Development

No branches or pull requests

2 participants