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 upLarger/smaller and offset tile sprites [WIP] #14397
Conversation
sparr
added some commits
Dec 12, 2015
sparr
changed the title
Offset tile sprites [WIP]
Larger/smaller and fffset tile sprites [WIP]
Dec 12, 2015
sparr
changed the title
Larger/smaller and fffset tile sprites [WIP]
Larger/smaller and offset tile sprites [WIP]
Dec 12, 2015
This comment has been minimized.
This comment has been minimized.
|
One big change in this patch is the rendering order. With potentially overlapping sprites, we can't render all of each tile at once. Instead, I loop through all the tiles and do vision checking and draw infrared vision for monsters, and assemble a list of points to draw on future passes. Then I go through the list multiple times, drawing layers back to front. |
sparr
reviewed
Dec 12, 2015
src/cata_tiles.cpp
Outdated
| } | ||
| } | ||
|
|
||
| for(auto f: {&cata_tiles::draw_furniture,&cata_tiles::draw_trap,&cata_tiles::draw_field_or_item,&cata_tiles::draw_vpart,&cata_tiles::draw_critter_at}) { | ||
| for(auto &p: draw_points) {(this->*f)( p, ch.visibility_cache[p.x][p.y] ); } |
This comment has been minimized.
This comment has been minimized.
sparr
Dec 12, 2015
Author
Member
I know this is badly formatted. Will fix in a cleanup/commenting pass.
This comment has been minimized.
This comment has been minimized.
|
the rendering order in this patch is wrong for isometric mode |
sparr
referenced this pull request
Dec 23, 2015
Merged
Allow sprites to offset later sprites drawn on the same tile #14568
kevingranade
merged commit fde4260
into
CleverRaven:master
Jan 16, 2016
1 check failed
default
Unmergeable pull request.
sparr
deleted the
sparr:offset_tile_sprites
branch
Jan 18, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
sparr commentedDec 12, 2015
This patch allows tileset authors to define one or more of their sprite sheets has having larger (or smaller!) sprites than the tile size. For each sprite file an x/y offset can be given from the normal tile placement. Also included is a test tileset which is a clone of RetroDays10px with the fire sprites replaced with a 16x16 sprite with a -3,-6 offset (bottom aligned, horizontally centered on the 10x10 grid).
I'd like some feedback from tileset authors on functionality and usability here. I'll remove the retrodays test tileset once there's a real updated tileset to push here (probably from @Chezzo)