use lookup instead of hardcoding texpos

develop
Myk Taylor 2023-01-03 12:08:09 -08:00
parent 1b1bfc40e7
commit 898e23d6a5
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 4 additions and 1 deletions

@ -33,6 +33,9 @@ static void paintScreen(df::coord target, bool skip_unrevealed = false) {
bool use_graphics = Screen::inGraphicsMode(); bool use_graphics = Screen::inGraphicsMode();
int selected_tile_texpos = 0;
Screen::findGraphicsTile("CURSORS", 4, 3, &selected_tile_texpos);
auto dims = Gui::getDwarfmodeViewDims().map(); auto dims = Gui::getDwarfmodeViewDims().map();
for (int y = dims.first.y; y <= dims.second.y; ++y) { for (int y = dims.first.y; y <= dims.second.y; ++y) {
for (int x = dims.first.x; x <= dims.second.x; ++x) { for (int x = dims.first.x; x <= dims.second.x; ++x) {
@ -70,7 +73,7 @@ static void paintScreen(df::coord target, bool skip_unrevealed = false) {
if (use_graphics) { if (use_graphics) {
if (map_pos == target) { if (map_pos == target) {
cur_tile.tile = 100711; // highlighted selection cur_tile.tile = selected_tile_texpos;
} else{ } else{
cur_tile.tile = can_walk ? 779 : 782; cur_tile.tile = can_walk ? 779 : 782;
} }