Skip to content

Commit

Permalink
Display version info
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Feb 7, 2023
1 parent 8ecd22f commit 6e467c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/graphics.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// graphics.c

#include <stdlib.h>
#include "version.h"
#include "SDLU.h"
#include "main.h"
#include "players.h"
Expand Down Expand Up @@ -164,8 +165,19 @@ void ShowTitle( void )
RetrieveResources( );

MTicks time = MTickCount() + 120;

SDLU_AcquireSurface( g_frontSurface );
DrawPICTInSurface( g_frontSurface, picTitle );

SkittlesFontPtr font = GetFont(picTinyFont);
MPoint dPoint;
dPoint.v = (widescreen ? 420 : 480) - 16;
dPoint.h = 4;
for (const char* scan = "Source port v" PROJECT_VERSION; *scan; scan++)
{
SurfaceBlitCharacter(font, *scan, &dPoint, 50, 50, 50, 1);
}
SDLU_ReleaseSurface( g_frontSurface );

while( time > MTickCount() && !SDLU_Button() )
{
SDLU_Present();
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
//

#include "SDLU.h"
#include "version.h"

#include "main.h"

Expand Down Expand Up @@ -570,7 +571,7 @@ void ReserveMonitor( void )
SDL_CreateWindowAndRenderer(resW*scale, resH*scale, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI, &g_window, &g_renderer);

SDL_RenderSetLogicalSize(g_renderer, resW, resH);
SDL_SetWindowTitle(g_window, "Candy Crisis");
SDL_SetWindowTitle(g_window, "Candy Crisis (source port v" PROJECT_VERSION ")");

SDL_SetRenderDrawColor(g_renderer, 0, 0, 0, 255);
SDL_RenderClear(g_renderer);
Expand Down

0 comments on commit 6e467c1

Please sign in to comment.