1
0
mirror of https://github.com/Tha14/toxic.git synced 2026-01-25 01:33:14 +01:00

Refactor game window sizing

- Add large square and rectangle window types
- Remove forced small windows
- Fit game of life to largest possible window type
- Hide cursor in game of life when game is running
This commit is contained in:
jfreegman
2021-06-03 01:19:49 -04:00
parent 5e67571908
commit 4514ecd839
9 changed files with 108 additions and 91 deletions

View File

@@ -29,8 +29,8 @@
#include "game_snake.h"
#include "misc_tools.h"
#define SNAKE_MAX_SNAKE_LENGTH (GAME_MAX_SQUARE_X * GAME_MAX_SQUARE_Y)
#define SNAKE_AGENT_MAX_LIST_SIZE (GAME_MAX_SQUARE_X * GAME_MAX_SQUARE_Y)
#define SNAKE_MAX_SNAKE_LENGTH (GAME_MAX_SQUARE_X_DEFAULT * GAME_MAX_SQUARE_Y_DEFAULT)
#define SNAKE_AGENT_MAX_LIST_SIZE (GAME_MAX_SQUARE_X_DEFAULT * GAME_MAX_SQUARE_Y_DEFAULT)
#define SNAKE_DEFAULT_SNAKE_SPEED 6
#define SNAKE_DEFAULT_AGENT_SPEED 1
@@ -850,6 +850,7 @@ static void snake_initialize_snake_head(const GameData *game, Snake *snake)
int snake_initialize(GameData *game)
{
// note: if this changes we must update SNAKE_MAX_SNAKE_LENGTH and SNAKE_AGENT_MAX_LIST_SIZE
if (game_set_window_shape(game, GW_ShapeSquare) == -1) {
return -1;
}