Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upRestructure tileset loading and storing. #22579
Conversation
BevapDin
added some commits
Dec 3, 2017
This comment has been minimized.
This comment has been minimized.
|
What happens if texture size exceeds the max size specified by SDL? I mean, is the extra portion silently dropped or what? |
BevapDin
added some commits
Dec 7, 2017
BevapDin
added some commits
Dec 3, 2017
BevapDin
force-pushed the
BevapDin:jtr
branch
Dec 9, 2017
This comment has been minimized.
This comment has been minimized.
It's split into several textures. |
BevapDin
added some commits
Dec 8, 2017
BevapDin
force-pushed the
BevapDin:jtr
branch
to
18e472a
Dec 10, 2017
This comment has been minimized.
This comment has been minimized.
|
This looks odd, have fun :) Core was generated by `tests/cata_test'. |
This comment has been minimized.
This comment has been minimized.
|
It's a bit more mundane than it looked at first, the change to init.cpp pulled tileset loading into the execution path for the test application, but the test application does not initialize SDL, so regardless of this particular failure, I wouldn't expect it to complete successfully. The test application isn't making assertions about interactions with SDL, so there's no reason to have it do anything with it. Options include adjusting the test application to satisfy whatever requirements the tilecontext and friends have, or subverting the options to put the app into ascii mode. |
kevingranade
merged commit 17d3f46
into
CleverRaven:master
Dec 12, 2017
BevapDin
deleted the
BevapDin:jtr
branch
Dec 12, 2017
ZhilkinSerg
referenced this pull request
Dec 13, 2017
Closed
Game started crashing after experimental build 7002 #22596
This comment has been minimized.
This comment has been minimized.
Proxiehunter
commented
Dec 13, 2017
|
Game crash persists in build 7005 |
This comment has been minimized.
This comment has been minimized.
|
I suspect there's a glitch in here somewhere. Relative hardware performance has improved compared to software(due to not having to constantly bind/unbind textures), but the overall drawing performance has decreased dramatically. I'm running an Intel integrated, but it wasn't affected by #21317. The issue affects both Windows(OpenGL and Direct3D backends) and Linux builds, as well as my Android devices I've tested on. Is there a logic error here causing unnecessary drawing, perhaps? Edit: I'm asking because if there is, I'm not seeing it. Also, the Android port UI elements are broken by this PR, which should not be the case as they're handled directly. My gut says the screen is being redrawn excessively. |
This comment has been minimized.
This comment has been minimized.
|
@Graywolfe813
The change to drawing is this: Previously each tile was stored in its own texture instance. The drawing code would draw the whole texture at once. |
BevapDin commentedDec 9, 2017
Moves storing the loaded tileset data (the textures and the id-to-texture map) into a separate class
tileset.Mostly done to reduce the size of
cata_tilesand to allow const-access to the loaded tileset data.Moves loading the tileset into a separate class
tileset_loader.Mostly done to avoid forwarding all the meta data (used only during loading) via function parameters.
The behavior should be the same as before, except this:
Tile textures are stored as one (or more) large instance of
SDL_Texture, instead of having one instance of that per tile. This is a bit more efficient, it only requires storing the offset and dimension of the tile along with the (shared) pointer toSDL_Texturefor each tile.The texture size respects the maximal supported texture size as reported by SDL. This may fix issue #21317.
Loading the tileset is now done during loading the game data (but not if it was already loaded). This makes the game executable start a bit faster.
If this is too large, I can split it.