Get the game running again

master
Louis Pearson 2022-08-04 18:07:23 -06:00
parent 280d73ae59
commit d799830ad9
2 changed files with 7 additions and 12 deletions

View File

@ -144,7 +144,7 @@ var fba_buf: [4096]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&fba_buf);
var alloc = fba.allocator();
var frame_fba_buf: [4096]u8 = undefined;
var frame_fba_buf: [8192]u8 = undefined;
var frame_fba = std.heap.FixedBufferAllocator.init(&frame_fba_buf);
var frame_alloc = frame_fba.allocator();
@ -194,11 +194,6 @@ const playerAnim = pac: {
break :pac animArr.slice();
};
fn showErr(msg: []const u8) noreturn {
w4.traceNoF(msg);
unreachable;
}
pub fn start() !void {
particles = try ParticleSystem.init();
@ -619,10 +614,10 @@ fn updateCircuit() !void {
(circuit.isEnabled(cellEnd) and end.pinned)) wire.enabled = true;
}
// map.reset(&assets.solid);
const enabledDoors = try circuit.enabledDoors(frame_alloc);
for (enabledDoors.items) |door| {
try map.set_cell(door, 0);
}
// const enabledDoors = try circuit.enabledDoors(frame_alloc);
// for (enabledDoors.items) |door| {
// try map.set_cell(door, 0);
// }
}
fn wirePhysicsProcess(dt: f32, wire: *Wire) !void {

View File

@ -29,7 +29,7 @@ export fn update() void {
.Menu => menu.update(),
.Game => game.update(time) catch |e| switch (e) {
error.Overflow => showErr(@errorName(e)),
error.OutOfBounds => showErr(@errorName(e)),
// error.OutOfBounds => showErr(@errorName(e)),
// error.EndOfStream => showErr(@errorName(e)),
error.OutOfMemory => showErr(@errorName(e)),
},
@ -40,7 +40,7 @@ export fn update() void {
.Menu => menu.start(),
.Game => game.start() catch |e| switch (e) {
error.Overflow => showErr(@errorName(e)),
error.OutOfBounds => showErr(@errorName(e)),
// error.OutOfBounds => showErr(@errorName(e)),
error.EndOfStream => showErr(@errorName(e)),
error.OutOfMemory => showErr(@errorName(e)),
error.NullTiles => showErr(@errorName(e)),