this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

added hex sprite index to the sprite editor

nesbox e7ebc15a f6803297

+24 -6
+23 -6
src/studio/editors/sprite.c
··· 522 522 else 523 523 { 524 524 char buf[sizeof "#9999"]; 525 - sprintf(buf, "#%i", sprite->index + tic_blit_calc_index(&sprite->blit)); 525 + s32 index = sprite->index + tic_blit_calc_index(&sprite->blit); 526 + sprintf(buf, sprite->hexindex ? "0x%02X" : "#%i", index); 527 + 528 + s32 w = CANVAS_SIZE - strlen(buf) * TIC_FONT_WIDTH; 529 + const tic_rect rect = {x + w / 2, TIC_SPRITESIZE + 2, w, TIC_FONT_HEIGHT}; 526 530 527 - s32 ix = x + (CANVAS_SIZE - strlen(buf) * TIC_FONT_WIDTH) / 2; 528 - s32 iy = TIC_SPRITESIZE + 2; 529 - tic_api_print(tic, buf, ix, iy+1, tic_color_black, true, 1, false); 530 - tic_api_print(tic, buf, ix, iy, tic_color_white, true, 1, false); 531 + if(checkMousePos(sprite->studio, &rect)) 532 + { 533 + setCursor(sprite->studio, tic_cursor_hand); 534 + 535 + if(checkMouseClick(sprite->studio, &rect, tic_mouse_left)) 536 + { 537 + sprite->hexindex = !sprite->hexindex; 538 + } 539 + } 540 + 541 + tic_api_print(tic, buf, rect.x, rect.y + 1, tic_color_black, true, 1, false); 542 + tic_api_print(tic, buf, rect.x, rect.y, tic_color_white, true, 1, false); 531 543 } 532 544 } 533 545 ··· 792 804 { 793 805 setCursor(sprite->studio, tic_cursor_hand); 794 806 807 + showTooltip(sprite->studio, "flags hex value"); 808 + 795 809 if(checkMouseClick(sprite->studio, &rect, tic_mouse_left)) 796 810 { 797 811 sprite->flags.edit = true; ··· 814 828 char buf[sizeof "FF"]; 815 829 sprintf(buf, "%02X", and); 816 830 817 - tic_api_print(tic, buf, rect.x + 1, rect.y + 1, sprite->flags.edit ? tic_color_white : tic_color_light_grey, false, 1, true); 831 + if(!sprite->flags.edit) 832 + tic_api_print(tic, buf, rect.x + 1, rect.y + 2, tic_color_black, false, 1, true); 833 + 834 + tic_api_print(tic, buf, rect.x + 1, rect.y + 1, tic_color_white, false, 1, true); 818 835 } 819 836 } 820 837
+1
src/studio/editors/sprite.h
··· 50 50 u8 brushSize; 51 51 u16 x,y; 52 52 bool advanced; 53 + bool hexindex; 53 54 54 55 tic_blit blit; 55 56