Skip to content

Commit

Permalink
New title pic
Browse files Browse the repository at this point in the history
  • Loading branch information
necromyhan committed Nov 24, 2023
1 parent 1ab890b commit dcf8eae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Binary file modified assets/title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions src/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

static SDL_Texture* gStartMenuPic = NULL;

enum
{
TitleWidth = 256,
TitleHeight = 144
};

MENU*
CreateMenu(
int Count,
Expand Down Expand Up @@ -131,15 +137,15 @@ StartMenuRender(GAME* Game)
if (status) { goto exit; }

SDL_FRect picRect = {
(w - (Game->Field.WidthInCells - 1) * Game->Field.CellSize) / 2,
(w - 3 * TitleWidth) / 2,
0,
(Game->Field.WidthInCells - 1) * Game->Field.CellSize,
(Game->Field.WidthInCells - 1) * Game->Field.CellSize };
TitleWidth * 3,
TitleHeight * 3};
SDL_RenderTexture(Game->Renderer, gStartMenuPic, NULL, &picRect);
if (status) { goto exit; }

int posX = Game->Field.CellSize;
int posY = Game->Field.CellSize;
int posY = 0 + TitleHeight * 3;
for (int i = 0; i < Game->StartMenu->Count; ++i)
{
status = PrintFontToRenderer(
Expand Down

0 comments on commit dcf8eae

Please sign in to comment.