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

Larger/smaller and offset tile sprites [WIP] #14397

Merged
merged 3 commits into from Jan 16, 2016

Conversation

Projects
None yet
2 participants
@sparr
Copy link
Member

commented Dec 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)

screenshot

@sparr sparr changed the title Offset tile sprites [WIP] Larger/smaller and fffset tile sprites [WIP] Dec 12, 2015

@sparr sparr changed the title Larger/smaller and fffset tile sprites [WIP] Larger/smaller and offset tile sprites [WIP] Dec 12, 2015

@sparr

This comment has been minimized.

Copy link
Member Author

commented Dec 12, 2015

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.

}
}

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.

Copy link
@sparr

sparr Dec 12, 2015

Author Member

I know this is badly formatted. Will fix in a cleanup/commenting pass.

@sparr

This comment has been minimized.

Copy link
Member Author

commented Dec 23, 2015

the rendering order in this patch is wrong for isometric mode

@kevingranade kevingranade merged commit fde4260 into CleverRaven:master Jan 16, 2016

1 check failed

default Unmergeable pull request.

@sparr 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
You can’t perform that action at this time.