From 5fa1b8a84764e91e21db4132937febaee210c508 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 3 Jan 2024 20:56:06 +0000 Subject: [PATCH] Cleanup old code --- src/Localelizer.zig | 1 - src/Locales/english.zig | 1 - src/Locales/french.zig | 1 - src/Locales/spanish.zig | 1 - src/Shared.zig | 1 - src/ViewLocator.zig | 1 - src/ViewModels/GameplayIntroViewModel.zig | 23 ----------------------- src/ViewModels/MenuViewModel.zig | 4 ---- src/Views/MenuView.zig | 3 --- src/Views/SettingsView.zig | 19 ------------------- 10 files changed, 55 deletions(-) delete mode 100644 src/ViewModels/GameplayIntroViewModel.zig delete mode 100644 src/Views/SettingsView.zig diff --git a/src/Localelizer.zig b/src/Localelizer.zig index b079de9..851a216 100644 --- a/src/Localelizer.zig +++ b/src/Localelizer.zig @@ -24,7 +24,6 @@ pub const Locale = struct { Dylan_Splash_Text: [:0]const u8, Title: [:0]const u8, Menu_StartGame: [:0]const u8, - Menu_Settings: [:0]const u8, Menu_Quit: [:0]const u8, Paused: [:0]const u8, Continue: [:0]const u8, diff --git a/src/Locales/english.zig b/src/Locales/english.zig index f0cb8d5..72b8417 100644 --- a/src/Locales/english.zig +++ b/src/Locales/english.zig @@ -4,7 +4,6 @@ pub const english = Locale{ .Dylan_Splash_Text = "DylanLangston Games", .Title = "Asteroid Arena", .Menu_StartGame = "Press Fire to Start", - .Menu_Settings = "Settings", .Menu_Quit = "Exit", .Paused = "Paused", .Continue = "Continue", diff --git a/src/Locales/french.zig b/src/Locales/french.zig index 7b73b42..6d9fba3 100644 --- a/src/Locales/french.zig +++ b/src/Locales/french.zig @@ -4,7 +4,6 @@ pub const french = Locale{ .Dylan_Splash_Text = "Jeux DylanLangston", .Title = "Arene d'asteroides", .Menu_StartGame = "Appuyez sur le feu pour demarrer", - .Menu_Settings = "Parametres", .Menu_Quit = "Quitter", .Paused = "En pause", .Continue = "Continuer", diff --git a/src/Locales/spanish.zig b/src/Locales/spanish.zig index 6e178d7..992452c 100644 --- a/src/Locales/spanish.zig +++ b/src/Locales/spanish.zig @@ -4,7 +4,6 @@ pub const spanish = Locale{ .Dylan_Splash_Text = "DylanLangston Juegos", .Title = "Arena de asteroides", .Menu_StartGame = "Presione Disparar para comenzar", - .Menu_Settings = "Configuracion", .Menu_Quit = "Salir", .Paused = "Pausado", .Continue = "Continuar", diff --git a/src/Shared.zig b/src/Shared.zig index 04d8c6d..4708ad7 100644 --- a/src/Shared.zig +++ b/src/Shared.zig @@ -11,7 +11,6 @@ const Inputs = @import("Inputs.zig").Inputs; const Logger = @import("Logger.zig").Logger; const PausedViewModel = @import("./ViewModels/PausedViewModel.zig").PausedViewModel; const GameOverViewModel = @import("./ViewModels/GameOverViewModel.zig").GameOverViewModel; -const GameplayIntroViewModel = @import("./ViewModels/GameplayIntroViewModel.zig").GameplayIntroViewModel; const vl = @import("ViewLocator.zig"); const Views = @import("ViewLocator.zig").Views; const V = @import("./Views/View.zig").View; diff --git a/src/ViewLocator.zig b/src/ViewLocator.zig index 01598a8..9915391 100644 --- a/src/ViewLocator.zig +++ b/src/ViewLocator.zig @@ -12,7 +12,6 @@ pub const ViewLocator = struct { @import("./Views/PausedView.zig").PausedView, @import("./Views/AsteroidsView.zig").AsteroidsView, @import("./Views/MenuView.zig").MenuView, - @import("./Views/SettingsView.zig").SettingsView, @import("./Views/GameOverView.zig").GameOverView, }; diff --git a/src/ViewModels/GameplayIntroViewModel.zig b/src/ViewModels/GameplayIntroViewModel.zig deleted file mode 100644 index 28e8456..0000000 --- a/src/ViewModels/GameplayIntroViewModel.zig +++ /dev/null @@ -1,23 +0,0 @@ -const std = @import("std"); -const Shared = @import("../Shared.zig").Shared; -const raylib = @import("raylib"); - -pub const GameplayIntroViewModel = Shared.View.ViewModel.Create( - struct { - pub var BackgroundTexture: ?raylib.Texture = null; - - pub inline fn GameIntro() void { - raylib.endDrawing(); - const img = raylib.loadImageFromScreen(); - defer img.unload(); - BackgroundTexture = img.toTexture(); - raylib.setTextureFilter( - BackgroundTexture.?, - @intFromEnum(raylib.TextureFilter.texture_filter_trilinear), - ); - } - }, - .{ - .BypassDeinit = true, - }, -); diff --git a/src/ViewModels/MenuViewModel.zig b/src/ViewModels/MenuViewModel.zig index 3d9b213..f92ca67 100644 --- a/src/ViewModels/MenuViewModel.zig +++ b/src/ViewModels/MenuViewModel.zig @@ -11,7 +11,6 @@ const Shoot = @import("../Models/Shoot.zig").Shoot; pub const Selection = enum { Start, - Settings, Quit, None, }; @@ -76,9 +75,6 @@ pub const MenuViewModel = Shared.View.ViewModel.Create( Selection.Start => { return locale.Menu_StartGame; }, - Selection.Settings => { - return locale.Menu_Settings; - }, Selection.Quit => { return locale.Menu_Quit; }, diff --git a/src/Views/MenuView.zig b/src/Views/MenuView.zig index a0ce08b..13fde3c 100644 --- a/src/Views/MenuView.zig +++ b/src/Views/MenuView.zig @@ -176,9 +176,6 @@ inline fn GetSelection() Shared.View.Views { Selection.Start => { return .AsteroidsView; }, - Selection.Settings => { - return .SettingsView; - }, Selection.Quit => { return .Unknown; }, diff --git a/src/Views/SettingsView.zig b/src/Views/SettingsView.zig deleted file mode 100644 index 51e362d..0000000 --- a/src/Views/SettingsView.zig +++ /dev/null @@ -1,19 +0,0 @@ -const std = @import("std"); -const raylib = @import("raylib"); -const raygui = @import("raygui"); -const Shared = @import("../Shared.zig").Shared; - -pub fn DrawFunction() Shared.View.Views { - raylib.clearBackground(Shared.Color.Yellow.Base); - - if (Shared.Input.A_Pressed()) { - return .MenuView; - } - - return .SettingsView; -} - -pub const SettingsView = Shared.View.View{ - .Key = .SettingsView, - .DrawRoutine = &DrawFunction, -};