- Llevats els colors roig i blau, queden rarunos

- Reajustat el pintat dels comptadors.
- Els comptadors canvien de color segón el color de l'habitació
- [FIX] print2 pintava mal el número
This commit is contained in:
2024-07-02 11:18:04 +02:00
parent 96c6677a87
commit 77df278568
6 changed files with 20 additions and 15 deletions

View File

@@ -1090,8 +1090,8 @@ namespace actor
if (act->next) act->next->prev = act->prev;
if (act==selected) selected = nullptr;
picked = act;
picked->pos.x=36;
picked->pos.y=82;
picked->pos.x=26;
picked->pos.y=84;
picked->inner_x = 148-act->bmp_offset.x + act->pos.x*2 - act->pos.y*2;
picked->inner_y = 91-act->bmp_offset.y + act->pos.x + act->pos.y - act->pos.z*2;

View File

@@ -402,7 +402,7 @@ namespace draw
void print2(const int num, const int positions, const int x, const int y, const uint8_t color, const int zoom)
{
char buffer[positions];
char buffer[positions+1];
int digit = positions-1;
int value = num;
while (digit>=0)
@@ -411,6 +411,7 @@ namespace draw
value = value/10;
digit--;
}
buffer[positions]=0;
print2(buffer, x, y, color, zoom);
}

View File

@@ -372,13 +372,17 @@ bool game::loop()
room::draw2();
draw::swapcol(1, WHITE+LIGHT);
actor::draw(actor::getPicked(), false);
draw::print2("a", 4, 24, YELLOW, FONT_ZOOM_NONE);
draw::print2("b", 7, 24, LIGHT+TEAL, FONT_ZOOM_NONE);
draw::print2("c", 10, 24, LIGHT+PURPLE, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostJump(), 2, 3, 26, LIGHT+PURPLE, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostGod()/2, 2, 6, 26, YELLOW, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostRun()/2, 2, 9, 26, LIGHT+TEAL, FONT_ZOOM_NONE);
const int col1 = 7+(room::getColor()-6)%5;
const int col2 = 7+(room::getColor()-5)%5;
const int col3 = 7+(room::getColor()-4)%5;
draw::print2("a", 4, 26, col1, FONT_ZOOM_NONE);
draw::print2("b", 7, 26, col2, FONT_ZOOM_NONE);
draw::print2("c", 10, 26, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostJump(), 2, 3, 28, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostGod()/2, 2, 6, 28, col1, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostRun()/2, 2, 9, 28, col2, FONT_ZOOM_NONE);
//print(10, 200, actor::hero::getBoostJump());
//print(30, 200, actor::hero::getBoostGod()/2);
@@ -579,7 +583,7 @@ switch (section)
ui::label("TEXTURES", 2, line, 96, 11, GRAY); line+=10;
changed |= btn_opt("COLOR", 2, line, room::editor::refColor(), {5, 6, 7, 8, 9, 10, 11}, {"BLUE", "RED", "PURPLE", "GREEN", "CYAN", "YELLOW", "WHITE"}, 47); //ui::label("COLOR", 2, line, 64, 11);
changed |= btn_opt("COLOR", 2, line, room::editor::refColor(), {7, 8, 9, 10, 11}, {"PURPLE", "GREEN", "CYAN", "YELLOW", "WHITE"}, 47); //ui::label("COLOR", 2, line, 64, 11);
//changed |= btn_small(64, line, room::editor::refColor(), 5, 11);
line += 10;
ui::label("FLOOR", 2, line, 48, 11);

View File

@@ -148,7 +148,7 @@ namespace room
door_height[YN] = SDL_clamp(val, -1, 5);
} else if (util::strcomp(key, "color:")) {
color = util::stringToInt(file::readString(&buffer), {"blue", "red", "purple", "green", "cyan", "yellow", "white"}, {5, 6, 7, 8, 9, 10, 11});
color = util::stringToInt(file::readString(&buffer), {"purple", "green", "cyan", "yellow", "white"}, {7, 8, 9, 10, 11});
} else if (util::strcomp(key, "floor-texture:")) {
floor_type = file::readInt(&buffer);
@@ -446,8 +446,8 @@ namespace room
const char *numToColor(uint8_t value)
{
const char* colors[7] = {"BLUE", "RED", "PURPLE", "GREEN", "CYAN", "YELLOW", "WHITE"};
return colors[value-5];
const char* colors[5] = {"PURPLE", "GREEN", "CYAN", "YELLOW", "WHITE"};
return colors[value-7];
}
void modify() { modified = true; }