diff options
| author | nathan <nathansmith@disroot.org> | 2025-11-24 08:04:49 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-11-24 08:04:49 +0000 |
| commit | a0d31fa794cb4d805b83f52495dfb4cb8a0ae861 (patch) | |
| tree | acb099e427e974d2ca97e30147329f058f2fb868 /src/game.c | |
| parent | 52a58016c7217942ab06988cc9adacc6e76689ca (diff) | |
| download | FindThings-a0d31fa794cb4d805b83f52495dfb4cb8a0ae861.tar.gz FindThings-a0d31fa794cb4d805b83f52495dfb4cb8a0ae861.tar.bz2 FindThings-a0d31fa794cb4d805b83f52495dfb4cb8a0ae861.zip | |
Ditching windowed ui
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 59 |
1 files changed, 7 insertions, 52 deletions
@@ -45,35 +45,13 @@ void resetScreenScale(Game* game) } } -FocusCommand testFloatingWindowCallback(FloatingWindow* window, Game* game) -{ - float x = window->rect.x + window->scroll.x; - float y = window->rect.y + window->scroll.y; - - DrawText("test", x + 10, y + 10 + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, 15, - BLUE); - - // Content size test. - if (window->contentSize.x != 0.0) - { - DrawText("content size test", x + 150.0, y + 150.0, 20, RED); - } - - // Button test. - if (GuiButton((Rectangle){x + 10.0, y + 50.0, 40.0, 20.0}, "A")) - { - puts("hi"); - } - - return NO_FOCUS_ACTION; -} - void initGame(Game* game) { game->sceneId = GAME_SCENE; // Settings. game->settings = defaultSettings(); + game->isCrossHairEnabled = game->settings.isCrossHairEnabledDefault; // Window. InitWindow(game->settings.windowWidth, game->settings.windowHeight, @@ -104,31 +82,6 @@ void initGame(Game* game) game->player.camera.fovy = game->settings.fov; game->player.position = Vector3Scale(game->world.size, 0.5); - // Window manager. - initWindowManager(&game->wm); - - FloatingWindow window = createFloatingWindow("test1", - (Rectangle){0.0, 0.0, - 100.0, 100.0}); - addWindowToWindowManager(&game->wm, window); - - window = createFloatingWindow("test2",\ - (Rectangle){200.0, 200.0, 100.0, 100.0}); - window.callback = testFloatingWindowCallback; - addWindowToWindowManager(&game->wm, window); - - window = createFloatingWindow("test3", - (Rectangle){300.0, 300.0, 100.0, 100.0}); - window.callback = testFloatingWindowCallback; - window.contentSize = (Vector2){500.0, 500.0}; - addWindowToWindowManager(&game->wm, window); - - window = createFloatingWindow("test4", - (Rectangle){400.0, 400.0, 100.0, 100.0}); - window.callback = testFloatingWindowCallback; - window.contentSize = (Vector2){500.0, 500.0}; - addWindowToWindowManager(&game->wm, window); - disableGameCursor(game); } @@ -229,9 +182,13 @@ void updateGameScene(Game* game) drawGameScreen(game); - updateWindowManager(&game->wm, game); + // Cross hair. + if (IsKeyPressed(game->settings.toggleCrossHairKey)) + { + game->isCrossHairEnabled = !game->isCrossHairEnabled; + } - if (!game->isCursorEnabled) + if (game->isCrossHairEnabled) { drawCrosshair(game->settings.crossHairSize, game->settings.crossHairThickness, @@ -284,12 +241,10 @@ void enableGameCursor(Game* game) { game->isCursorEnabled = true; EnableCursor(); - enableWindowManager(&game->wm); } void disableGameCursor(Game* game) { game->isCursorEnabled = false; DisableCursor(); - disableWindowManager(&game->wm); } |
