various: add admin build; various layout improvements
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ieaa99fa0a32b42b1e97aada611d809b96a6a6964
This commit is contained in:
parent
d8b49054d5
commit
514a9560a2
9 changed files with 856 additions and 201 deletions
|
|
@ -42,44 +42,67 @@ void paint_wall_tile(Tileset *ts, int id, int variant) {
|
|||
|
||||
BeginTextureMode(ts->render_target);
|
||||
|
||||
// Base color is much darker for better contrast against floor
|
||||
Color base = variant == 0 ? (Color){45, 42, 38, 255} : (Color){35, 32, 28, 255};
|
||||
DrawRectangle((int)off.x, (int)off.y, w, h, base);
|
||||
int ox = (int)off.x;
|
||||
int oy = (int)off.y;
|
||||
Color base = variant == 0 ? (Color){38, 37, 39, 255} : (Color){33, 32, 35, 255};
|
||||
Color edge = variant == 0 ? (Color){48, 46, 46, 255} : (Color){42, 40, 41, 255};
|
||||
Color shadow = variant == 0 ? (Color){24, 23, 25, 255} : (Color){20, 19, 21, 255};
|
||||
Color highlight = variant == 0 ? (Color){56, 54, 52, 255} : (Color){49, 47, 46, 255};
|
||||
Color moss = variant == 0 ? (Color){38, 58, 42, 255} : (Color){28, 45, 34, 255};
|
||||
|
||||
// Brick pattern
|
||||
int brick_h = h / 3;
|
||||
int brick_w = w / 2;
|
||||
Color mortar = (Color){25, 22, 18, 255};
|
||||
Color brick_light = variant == 0 ? (Color){70, 65, 60, 255} : (Color){50, 47, 43, 255};
|
||||
Color brick_dark = variant == 0 ? (Color){40, 37, 33, 255} : (Color){30, 27, 24, 255};
|
||||
DrawRectangle(ox, oy, w, h, base);
|
||||
lcg_srand((unsigned int)(variant * 4099 + id * 9176));
|
||||
|
||||
int row_y = 0;
|
||||
for (int row = 0; row < 3; row++) {
|
||||
int y = (int)off.y + row * brick_h;
|
||||
int offset_x = (row % 2 == 0) ? 0 : brick_w / 2;
|
||||
for (int col = -1; col < 3; col++) {
|
||||
int x = (int)off.x + offset_x + col * brick_w;
|
||||
if (x >= (int)off.x + w)
|
||||
break;
|
||||
if (x + brick_w <= (int)off.x)
|
||||
continue;
|
||||
|
||||
// Clip to tile bounds
|
||||
int draw_x = x < (int)off.x ? (int)off.x : x;
|
||||
int draw_w = brick_w;
|
||||
if (draw_x + draw_w > (int)off.x + w)
|
||||
draw_w = (int)off.x + w - draw_x;
|
||||
|
||||
Color c = ((col + row) % 2 == 0) ? brick_light : brick_dark;
|
||||
DrawRectangle(draw_x, y, draw_w, brick_h - 1, c);
|
||||
int block_h = row == 2 ? h - row_y : lcg_rand_range(5, 6);
|
||||
int x = 0;
|
||||
int stagger = (row % 2) ? lcg_rand_range(-4, 0) : lcg_rand_range(-1, 2);
|
||||
while (x < w) {
|
||||
int block_w = lcg_rand_range(7, 12);
|
||||
int bx = ox + x + stagger;
|
||||
int by = oy + row_y;
|
||||
int bw = block_w;
|
||||
if (bx < ox) {
|
||||
bw -= ox - bx;
|
||||
bx = ox;
|
||||
}
|
||||
if (bx + bw > ox + w)
|
||||
bw = ox + w - bx;
|
||||
if (bw > 0) {
|
||||
Color face = ((x + row + variant) % 3 == 0) ? edge : base;
|
||||
DrawRectangle(bx, by, bw, block_h, face);
|
||||
if (row == 0)
|
||||
DrawLine(bx, by, bx + bw - 1, by, highlight);
|
||||
DrawLine(bx, by + block_h - 1, bx + bw - 1, by + block_h - 1, shadow);
|
||||
if (bw > 5 && block_h > 4 && lcg_rand_range(0, 99) < 18)
|
||||
DrawPixel(bx + lcg_rand_range(1, bw - 2), by + lcg_rand_range(1, block_h - 2), shadow);
|
||||
}
|
||||
x += block_w;
|
||||
}
|
||||
row_y += block_h;
|
||||
}
|
||||
|
||||
// Mortar lines
|
||||
for (int row = 1; row < 3; row++) {
|
||||
int y = (int)off.y + row * brick_h;
|
||||
DrawLine((int)off.x, y, (int)off.x + w - 1, y, mortar);
|
||||
for (int i = 0; i < 3 + variant; i++) {
|
||||
int px = ox + lcg_rand_range(1, w - 2);
|
||||
int py = oy + lcg_rand_range(1, h - 2);
|
||||
DrawPixel(px, py, lcg_rand_range(0, 1) ? highlight : shadow);
|
||||
}
|
||||
|
||||
if (variant == 1) {
|
||||
DrawLine(ox + 3, oy + 1, ox + 5, oy + 5, shadow);
|
||||
DrawLine(ox + 5, oy + 5, ox + 4, oy + 8, shadow);
|
||||
DrawLine(ox + 11, oy + 4, ox + 8, oy + 7, shadow);
|
||||
} else {
|
||||
DrawLine(ox + 9, oy + 2, ox + 12, oy + 5, shadow);
|
||||
DrawLine(ox + 12, oy + 5, ox + 10, oy + 9, shadow);
|
||||
DrawPixel(ox + 3, oy + 13, moss);
|
||||
DrawPixel(ox + 4, oy + 13, moss);
|
||||
DrawPixel(ox + 4, oy + 14, moss);
|
||||
}
|
||||
|
||||
DrawRectangle(ox, oy + h - 2, w, 2, (Color){16, 15, 17, 255});
|
||||
|
||||
EndTextureMode();
|
||||
}
|
||||
|
||||
|
|
@ -95,42 +118,44 @@ void paint_floor_tile(Tileset *ts, int id, int variant) {
|
|||
|
||||
BeginTextureMode(ts->render_target);
|
||||
|
||||
// Base stone color - lighter than walls for contrast
|
||||
Color base = (Color){75, 72, 68, 255};
|
||||
DrawRectangle((int)off.x, (int)off.y, w, h, base);
|
||||
int ox = (int)off.x;
|
||||
int oy = (int)off.y;
|
||||
Color base = variant == 0 ? (Color){61, 58, 55, 255}
|
||||
: variant == 1 ? (Color){67, 63, 58, 255}
|
||||
: variant == 2 ? (Color){56, 55, 58, 255}
|
||||
: (Color){64, 59, 53, 255};
|
||||
Color bevel = (Color){86, 82, 75, 255};
|
||||
Color seam = (Color){34, 32, 31, 255};
|
||||
Color chip = (Color){43, 41, 40, 255};
|
||||
|
||||
// Seeded noise based on variant
|
||||
DrawRectangle(ox, oy, w, h, base);
|
||||
lcg_srand((unsigned int)(variant * 7919 + id * 104729));
|
||||
|
||||
// Dithered noise dots - lighter shades
|
||||
int num_dots = 8 + variant * 4;
|
||||
int split_x = lcg_rand_range(6, 10);
|
||||
int split_y = lcg_rand_range(6, 10);
|
||||
DrawLine(ox + split_x, oy + 1, ox + split_x, oy + h - 2, seam);
|
||||
DrawLine(ox + 1, oy + split_y, ox + w - 2, oy + split_y, seam);
|
||||
DrawLine(ox + 1, oy + 1, ox + w - 2, oy + 1, bevel);
|
||||
DrawLine(ox + 1, oy + 1, ox + 1, oy + h - 2, bevel);
|
||||
DrawLine(ox + 1, oy + h - 2, ox + w - 2, oy + h - 2, seam);
|
||||
DrawLine(ox + w - 2, oy + 1, ox + w - 2, oy + h - 2, seam);
|
||||
|
||||
int num_dots = 14 + variant * 5;
|
||||
for (int i = 0; i < num_dots; i++) {
|
||||
int px = (int)off.x + lcg_rand_range(1, w - 2);
|
||||
int py = (int)off.y + lcg_rand_range(1, h - 2);
|
||||
int shade = lcg_rand_range(0, 3);
|
||||
Color c;
|
||||
if (shade == 0)
|
||||
c = (Color){85, 82, 78, 255};
|
||||
else if (shade == 1)
|
||||
c = (Color){65, 62, 58, 255};
|
||||
else
|
||||
c = (Color){90, 87, 83, 255};
|
||||
int px = ox + lcg_rand_range(1, w - 2);
|
||||
int py = oy + lcg_rand_range(1, h - 2);
|
||||
Color c = lcg_rand_range(0, 2) == 0 ? bevel : chip;
|
||||
DrawPixel(px, py, c);
|
||||
}
|
||||
|
||||
// Occasional crack line
|
||||
if (variant >= 2) {
|
||||
int crack_x = (int)off.x + lcg_rand_range(2, w - 3);
|
||||
int crack_y = (int)off.y + lcg_rand_range(2, h - 3);
|
||||
int crack_len = lcg_rand_range(2, 4);
|
||||
int crack_dir = lcg_rand_range(0, 1); // 0 = horizontal, 1 = vertical
|
||||
Color crack_color = (Color){55, 52, 48, 255};
|
||||
for (int i = 0; i < crack_len; i++) {
|
||||
if (crack_dir == 0)
|
||||
DrawPixel(crack_x + i, crack_y, crack_color);
|
||||
else
|
||||
DrawPixel(crack_x, crack_y + i, crack_color);
|
||||
}
|
||||
if (variant >= 1) {
|
||||
int crack_x = ox + lcg_rand_range(3, w - 4);
|
||||
int crack_y = oy + lcg_rand_range(3, h - 4);
|
||||
DrawPixel(crack_x, crack_y, seam);
|
||||
DrawPixel(crack_x + 1, crack_y, seam);
|
||||
DrawPixel(crack_x + 1, crack_y + 1, seam);
|
||||
if (variant >= 2)
|
||||
DrawPixel(crack_x + 2, crack_y + 2, seam);
|
||||
}
|
||||
|
||||
EndTextureMode();
|
||||
|
|
@ -148,32 +173,25 @@ void paint_stairs_tile(Tileset *ts, int id) {
|
|||
|
||||
BeginTextureMode(ts->render_target);
|
||||
|
||||
// Dark stone background
|
||||
DrawRectangle((int)off.x, (int)off.y, w, h, (Color){40, 38, 35, 255});
|
||||
int ox = (int)off.x;
|
||||
int oy = (int)off.y;
|
||||
DrawRectangle(ox, oy, w, h, (Color){31, 29, 27, 255});
|
||||
|
||||
// Stair steps (3 steps)
|
||||
int step_h = h / 4;
|
||||
Color step_light = (Color){100, 95, 90, 255};
|
||||
Color step_dark = (Color){60, 57, 53, 255};
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
int y = (int)off.y + h - (i + 1) * step_h;
|
||||
int inset = i * 2;
|
||||
int x = (int)off.x + inset;
|
||||
DrawRectangle(x, y, w - inset * 2, step_h - 1, step_light);
|
||||
DrawLine(x, y + step_h - 1, x + w - inset * 2 - 1, y + step_h - 1, step_dark);
|
||||
Color face = (Color){82, 76, 68, 255};
|
||||
Color lip = (Color){118, 106, 84, 255};
|
||||
Color drop = (Color){28, 25, 23, 255};
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int y = oy + 3 + i * 3;
|
||||
int inset = i + 1;
|
||||
DrawRectangle(ox + inset, y, w - inset * 2, 2, face);
|
||||
DrawLine(ox + inset, y, ox + w - inset - 1, y, lip);
|
||||
DrawLine(ox + inset, y + 2, ox + w - inset - 1, y + 2, drop);
|
||||
}
|
||||
|
||||
// ">" symbol on top step
|
||||
int top_y = (int)off.y + 2;
|
||||
int cx = (int)off.x + w / 2;
|
||||
Color arrow = (Color){180, 175, 170, 255};
|
||||
DrawPixel(cx, top_y, arrow);
|
||||
DrawPixel(cx - 1, top_y + 1, arrow);
|
||||
DrawPixel(cx + 1, top_y + 1, arrow);
|
||||
DrawPixel(cx - 2, top_y + 2, arrow);
|
||||
DrawPixel(cx + 2, top_y + 2, arrow);
|
||||
DrawPixel(cx, top_y + 3, arrow);
|
||||
DrawLine(ox + 4, oy + 2, ox + 11, oy + 2, (Color){120, 111, 93, 255});
|
||||
DrawPixel(ox + 7, oy + 1, (Color){142, 134, 114, 255});
|
||||
DrawPixel(ox + 8, oy + 1, (Color){142, 134, 114, 255});
|
||||
DrawRectangle(ox + 6, oy + 13, 4, 1, (Color){12, 10, 9, 255});
|
||||
|
||||
EndTextureMode();
|
||||
}
|
||||
|
|
@ -634,23 +652,22 @@ void paint_door_closed_tile(Tileset *ts, int id) {
|
|||
|
||||
BeginTextureMode(ts->render_target);
|
||||
|
||||
// Wooden door frame
|
||||
Color wood_dark = (Color){100, 70, 40, 255};
|
||||
Color wood_light = (Color){140, 100, 60, 255};
|
||||
Color wood_mid = (Color){120, 85, 50, 255};
|
||||
Color iron = (Color){35, 32, 30, 255};
|
||||
Color wood_dark = (Color){72, 47, 30, 255};
|
||||
Color wood_mid = (Color){111, 73, 42, 255};
|
||||
Color wood_light = (Color){151, 103, 58, 255};
|
||||
|
||||
// Frame
|
||||
DrawRectangle(ox, oy, w, h, wood_dark);
|
||||
// Panels
|
||||
DrawRectangle(ox + 2, oy + 2, w - 4, h - 4, wood_mid);
|
||||
// Inner panel
|
||||
DrawRectangle(ox + 4, oy + 4, w - 8, h - 8, wood_light);
|
||||
// Cross pattern
|
||||
DrawRectangle(ox + 7, oy + 2, 2, h - 4, wood_dark);
|
||||
DrawRectangle(ox + 2, oy + 7, w - 4, 2, wood_dark);
|
||||
// Handle
|
||||
DrawPixel(ox + 12, oy + 8, (Color){200, 180, 50, 255});
|
||||
DrawPixel(ox + 12, oy + 9, (Color){200, 180, 50, 255});
|
||||
DrawRectangle(ox, oy, w, h, iron);
|
||||
DrawRectangle(ox + 2, oy + 1, w - 4, h - 2, wood_dark);
|
||||
DrawRectangle(ox + 3, oy + 2, 3, h - 4, wood_mid);
|
||||
DrawRectangle(ox + 7, oy + 2, 3, h - 4, wood_light);
|
||||
DrawRectangle(ox + 11, oy + 2, 2, h - 4, wood_mid);
|
||||
DrawRectangle(ox + 2, oy + 5, w - 4, 2, iron);
|
||||
DrawRectangle(ox + 2, oy + 11, w - 4, 2, iron);
|
||||
DrawPixel(ox + 4, oy + 3, (Color){180, 129, 72, 255});
|
||||
DrawPixel(ox + 8, oy + 9, (Color){84, 53, 32, 255});
|
||||
DrawPixel(ox + 12, oy + 8, (Color){208, 169, 69, 255});
|
||||
DrawPixel(ox + 12, oy + 9, (Color){166, 124, 51, 255});
|
||||
|
||||
EndTextureMode();
|
||||
}
|
||||
|
|
@ -669,17 +686,19 @@ void paint_door_open_tile(Tileset *ts, int id) {
|
|||
|
||||
BeginTextureMode(ts->render_target);
|
||||
|
||||
// Open door - shows floor with door frame on sides
|
||||
Color floor = (Color){75, 72, 68, 255};
|
||||
Color wood_dark = (Color){100, 70, 40, 255};
|
||||
Color floor = (Color){58, 55, 52, 255};
|
||||
Color seam = (Color){32, 30, 29, 255};
|
||||
Color wood_dark = (Color){72, 47, 30, 255};
|
||||
Color wood_light = (Color){131, 88, 49, 255};
|
||||
|
||||
// Floor
|
||||
DrawRectangle(ox, oy, w, h, floor);
|
||||
// Door frame on left side (open)
|
||||
DrawLine(ox + 7, oy + 1, ox + 7, oy + h - 2, seam);
|
||||
DrawLine(ox + 1, oy + 8, ox + w - 2, oy + 8, seam);
|
||||
DrawRectangle(ox, oy, 3, h, wood_dark);
|
||||
// Hinges
|
||||
DrawPixel(ox + 1, oy + 4, (Color){80, 80, 80, 255});
|
||||
DrawPixel(ox + 1, oy + 12, (Color){80, 80, 80, 255});
|
||||
DrawRectangle(ox + 2, oy + 2, 2, h - 4, wood_light);
|
||||
DrawPixel(ox + 1, oy + 4, (Color){72, 72, 72, 255});
|
||||
DrawPixel(ox + 1, oy + 11, (Color){72, 72, 72, 255});
|
||||
DrawRectangle(ox + 4, oy + 13, 6, 1, (Color){25, 20, 17, 255});
|
||||
|
||||
EndTextureMode();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue