summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-07-26 17:31:48 +0300
committerKyren223 <Kyren223@proton.me>2025-07-26 17:31:48 +0300
commit3d8626a46bde61d2c88b3f686944d025719383fb (patch)
tree34e05ea9f382a938daa4f85de4b5a459832057d0 /src
parent59dfb4a25705254d0d1aad0aceae69d5db0f6037 (diff)
CPU now visually shows cores
Diffstat (limited to 'src')
-rw-r--r--src/main.zig17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index 996d081..8de166e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -232,9 +232,9 @@ const Cpu = struct {
// TODO: only for debug (change this once ready for play testing)
0...2 => 1,
3...4 => 2,
- 5...6 => 3,
- 7...8 => 4,
- else => 5,
+ 5...6 => 4,
+ 7...8 => 8,
+ else => 16,
// 0...9 => 1,
// 10...24 => 2,
// 25...49 => 3,
@@ -995,9 +995,16 @@ const ScreenBattle = struct {
rl.Color.white,
);
},
- .cpu => {
+ .cpu => |cpu| {
const texture = game.texture_map.get(.cpu).?;
- rl.drawTexture(texture, @intCast(x * cell_size), @intCast(y * cell_size), rl.Color.white);
+
+ const offset: f32 = @floatFromInt(cpu.cores() - 1);
+ rl.drawTextureRec(
+ texture,
+ .{ .x = offset * cell_size, .y = 0, .width = cell_size, .height = cell_size },
+ .{ .x = @floatFromInt(x * cell_size), .y = @floatFromInt(y * cell_size) },
+ rl.Color.white,
+ );
},
.ai => {
const texture = game.texture_map.get(.ai).?;