Skip to content

Commit

Permalink
refactoring more....
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Mar 20, 2024
1 parent 6c974c4 commit 4e868f9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 116 deletions.
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub fn build(b: *std.Build) !void {
stb_truetype.addIncludePath(.{ .path = root_path ++ "libs/stb" });

const zigimg_module = b.dependency("zigimg", .{}).module("zigimg");
const zini_module = b.dependency("zini", .{}).module("zini");
const app = try mach_core.App.init(b, .{
.name = "ztyping",
.src = "game/app.zig",
Expand All @@ -40,6 +41,10 @@ pub fn build(b: *std.Build) !void {
.name = "zigimg",
.module = zigimg_module,
},
.{
.name = "zini",
.module = zini_module,
},
.{
.name = "bass",
.module = zig_bass,
Expand Down
8 changes: 6 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
.hash = "1220ba5472217ef81455b19d540967049bbfaf768b30d04534865707e907ee1c4aec",
},
.zigimg = .{
.url = "https://github.com/zigimg/zigimg/archive/8873f29fc449e1b63400e9f4ad86d3c76204f962.tar.gz",
.url = "git+https://github.com/zigimg/zigimg#8873f29fc449e1b63400e9f4ad86d3c76204f962",
.hash = "122019f6439545235af116d0d8eb81fde1ff05fdb070da57c723772c557f84c5bf39",
},
.clap = .{
.url = "https://github.com/Hejsil/zig-clap/archive/0f2db7700b05356ebb1ccddbbf1797048925f072.tar.gz",
.url = "git+https://github.com/Hejsil/zig-clap#0f2db7700b05356ebb1ccddbbf1797048925f072",
.hash = "12203896de6eedec14712f4f1eaac8b646939cfed213c56accf231a0abb05f9dbb77",
},
.zini = .{
.url = "git+https://github.com/Beyley/zini#aaeba1ad81742d52d3af086cb3c89c515ce5e728",
.hash = "1220b322b8ec9b10bc79e9da8def6cc3a49c9ffccf87d2e7577fc6e522bd0893173b",
},
},
.paths = .{
"game/",
Expand Down
12 changes: 1 addition & 11 deletions game/app.zig
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ random: std.rand.DefaultPrng = std.rand.DefaultPrng.init(35698752),
///The name of the user, this is owned by the main menu instance at the bottom of the screen stack
name: []const u8,

///Our main texture atlas
gfx: Gfx,
///Our main texture atlas
texture: Gfx.Texture,
renderer: Renderer,
fontstash: Fontstash,
Expand Down Expand Up @@ -193,16 +193,6 @@ pub fn update(app: *App) !bool {
.app = app,
});

// if (builtin.mode == .Debug) {
// var open = false;
// _ = c.igBegin("fps", &open, 0);
// c.igText("%fms %dfps", state.delta_time * 1000, @as(usize, @intFromFloat(1 / state.delta_time)));
// c.igEnd();
// }

// c.igRender();
// c.ImGui_ImplWGPU_RenderDrawData(c.igGetDrawData(), render_pass_encoder.c);

render_pass_encoder.end();
render_pass_encoder.release();

Expand Down
2 changes: 1 addition & 1 deletion game/config.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

const Ini = @import("ini.zig").Ini(std.fs.File.Reader, 256, 0);
const Ini = @import("zini").IniReader(std.fs.File.Reader, 256, 0);

const Self = @This();

Expand Down
87 changes: 0 additions & 87 deletions game/ini.zig

This file was deleted.

14 changes: 0 additions & 14 deletions game/screens/song_select.zig
Original file line number Diff line number Diff line change
Expand Up @@ -420,20 +420,6 @@ pub const h_music_info_sub = 6 + h_comment + 4 + h_play_data + 6;
pub fn renderScreen(self: *Screen, render_state: RenderState) anyerror!void {
var data = self.getData(SongSelectData);

// var open = true;

// // if (builtin.mode == .Debug) {
// // _ = c.igBegin("Test", &open, c.ImGuiWindowFlags_AlwaysVerticalScrollbar);

// // for (data.draw_info.add_height) |height| {
// // c.igText("height: %f", height);
// // }
// // c.igText("wait: %f", data.draw_info.add_height_wait);
// // c.igText("ranking pos: %d", data.draw_info.ranking_pos);

// // c.igEnd();
// // }

try render_state.renderer.begin();
try render_state.fontstash.renderer.begin();

Expand Down
2 changes: 1 addition & 1 deletion libs/zig-bass
Submodule zig-bass updated 1 files
+1 −0 build.zig.zon

0 comments on commit 4e868f9

Please sign in to comment.