-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qol shortcuts #382
Qol shortcuts #382
Changes from 5 commits
c599e2a
5cac048
3010dc7
eb2c9ed
28c72c8
ae3a380
76e007c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,15 @@ pub var window = GuiWindow { | |
|
||
const padding: f32 = 8; | ||
|
||
fn exitGame(_:usize) void { | ||
main.Window.deinit(); | ||
} | ||
pub fn onOpen() void { | ||
const list = VerticalList.init(.{padding, 16 + padding}, 300, 16); | ||
list.add(Button.initText(.{0, 0}, 128, "Singleplayer", gui.openWindowCallback("save_selection"))); | ||
list.add(Button.initText(.{0, 0}, 128, "Multiplayer", gui.openWindowCallback("multiplayer"))); | ||
list.add(Button.initText(.{0, 0}, 128, "Settings", gui.openWindowCallback("settings"))); | ||
list.add(Button.initText(.{0, 0}, 128, "Exit TODO", .{})); | ||
list.add(Button.initText(.{0, 0}, 128, "TODO", .{.callback = &exitGame})); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the wrong word xD |
||
list.finish(.center); | ||
window.rootComponent = list.toComponent(); | ||
window.contentSize = window.rootComponent.?.pos() + window.rootComponent.?.size() + @as(Vec2f, @splat(padding)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,27 +85,27 @@ pub fn deinit() void { | |
for(mapStorageLists) |mapStorageList| { | ||
main.globalAllocator.destroy(mapStorageList); | ||
} | ||
|
||
for(updatableList.items) |mesh| { | ||
mesh.decreaseRefCount(); | ||
} | ||
updatableList.deinit(); | ||
updatableList.clearAndFree(); | ||
for(mapUpdatableList.items) |map| { | ||
map.decreaseRefCount(); | ||
} | ||
mapUpdatableList.deinit(); | ||
mapUpdatableList.clearAndFree(); | ||
for(priorityMeshUpdateList.items) |mesh| { | ||
mesh.decreaseRefCount(); | ||
} | ||
priorityMeshUpdateList.deinit(); | ||
blockUpdateList.deinit(); | ||
meshList.deinit(); | ||
priorityMeshUpdateList.clearAndFree(); | ||
blockUpdateList.clearAndFree(); | ||
meshList.clearAndFree(); | ||
for(clearList.items) |mesh| { | ||
mesh.deinit(); | ||
main.globalAllocator.destroy(mesh); | ||
} | ||
clearList.deinit(); | ||
clearList.clearAndFree(); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unintended line removal? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an empty line, does it matter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, just looked like it was unintentionally removed. If you made this change intentionally then I would like to know the intention though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah i remember, that was when i made the "reset" function, but then we decided to just make the already existing deinit function use clearAndFree() , thus removing the need for the reset function |
||
fn getNodePointer(pos: chunk.ChunkPosition) *ChunkMeshNode { | ||
const lod = std.math.log2_int(u31, pos.voxelSize); | ||
var xIndex = pos.wx >> lod+chunk.chunkShift; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution does not seem to work.
When I press the exit button it crashes with:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah oops, didnt see the segfault under all of the thread sanitizers stuff.