-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Revamp Assets #306
Revamp Assets #306
Conversation
if image_name not in self.resources: | ||
self.register_renderable(game_object) | ||
if isinstance(image, str): | ||
logger.warn(f"Using string resources is deprecated, use ppb.Image instead. Got {image!r}") |
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.
👍
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.
Only thing about this is that it's extremely verbose (every frame).
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.
Could throw in a tracking variable and only throw it once? (Or once per object?) Would lru_cache
wrapped around a print statement make it run once per object passed?
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.
Yeah, all of those things. It's just annoying, though?
import io | ||
|
||
|
||
class Image(Asset): |
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.
Dunno on adding new things to systems.__init__
. If we're making changes to the renderer and adding new things they should move to its own file.
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.
Yeah, I was wondering if we wanted to move the renderer to its own module.
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.
It's one of the places we deal with pygame, so probably needs to go to systems.pg
. (There's even argument for making pg.py into a subpackage of its own, but uh. . . not right now.)
This still needs tests. |
@pathunstrom I think this is ready for review & merge. |
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.
This works just fine. We definitely need a "how to" for it, but not going to block the work on that. Going to open that as an issue.
bors r+ |
Build succeeded
|
316: Move things, break loops r=pathunstrom a=astronouth7303 Grab a u-haul! 🚚 Generally moving things and reducing imports to improve the import loop situation * Break up "the machinery implementing a thing" and "a pile of things that use the thing" * Prefer module imports to individual imports, so any unavoidable loops don't wreck everything. Depends on #306 because I didn't feel like dealing with the merge conflict. No docs changes because this doesn't touch anything publicly documented. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
316: Move things, break loops r=pathunstrom a=astronouth7303 Grab a u-haul! 🚚 Generally moving things and reducing imports to improve the import loop situation * Break up "the machinery implementing a thing" and "a pile of things that use the thing" * Prefer module imports to individual imports, so any unavoidable loops don't wreck everything. Depends on #306 because I didn't feel like dealing with the merge conflict. No docs changes because this doesn't touch anything publicly documented. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
316: Move things, break loops r=pathunstrom a=astronouth7303 Grab a u-haul! 🚚 Generally moving things and reducing imports to improve the import loop situation * Break up "the machinery implementing a thing" and "a pile of things that use the thing" * Prefer module imports to individual imports, so any unavoidable loops don't wreck everything. Depends on #306 because I didn't feel like dealing with the merge conflict. No docs changes because this doesn't touch anything publicly documented. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
316: Move things, break loops r=pathunstrom a=astronouth7303 Grab a u-haul! 🚚 Generally moving things and reducing imports to improve the import loop situation * Break up "the machinery implementing a thing" and "a pile of things that use the thing" * Prefer module imports to individual imports, so any unavoidable loops don't wreck everything. Depends on #306 because I didn't feel like dealing with the merge conflict. No docs changes because this doesn't touch anything publicly documented. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
316: Move things, break loops r=pathunstrom a=astronouth7303 Grab a u-haul! 🚚 Generally moving things and reducing imports to improve the import loop situation * Break up "the machinery implementing a thing" and "a pile of things that use the thing" * Prefer module imports to individual imports, so any unavoidable loops don't wreck everything. Depends on #306 because I didn't feel like dealing with the merge conflict. No docs changes because this doesn't touch anything publicly documented. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
Totally revamp how PPB handles assets.
Depends on #313 because life was just easier that way.
Part of #147