From b3c852a074d4f861674381d54832a54c20dc5042 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 23 May 2014 00:53:52 +0100 Subject: [PATCH] change exe to console subsystem and print launch info. --- openrct2.exe | Bin 6750208 -> 6750208 bytes src/rct2.c | 25 +++++++++++++++++++++++++ src/rct2.h | 6 ++++++ src/title.c | 13 ++++++++----- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/openrct2.exe b/openrct2.exe index 6ef4570ba6a4612c79503a568ada1228e56abce8..05cc265b46e3085a7fbac3287eb1c0f3b8c6e0c8 100644 GIT binary patch delta 426 zcmWl|MNR_&006)&ixj80Q{3I%-Jy%Sy<-y&e1acv;l}R>!z2^OpJD8GItaq|DENqi z{~3m6nq{^*Cd@U@drWKCef|Cc-QC@t{kU5lKjA67Ny?h{FGb zNz+U>!%VZxHpg7^%(uWoi!8RpQp+s2!b+>Gw#HiPthd2Nn{2klR@-d1!%n;Gw#Q!k z?03LHha7gqQO6v2!bzu`cE(xfoOi)Rmt1zmRo7g1!%er`cE?@!-1opkk39CoQ&UEs ddG3XmUU}_}x88a0gO5J>?2E5IQF#0M{R88WbBq80 diff --git a/src/rct2.c b/src/rct2.c index 11d2b38081..52b4f666ff 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include "track.h" #include "viewport.h" +void print_launch_information(); void rct2_init_directories(); void rct2_startup_checks(); @@ -64,6 +66,9 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { + print_launch_information(); + + // Begin RCT2 RCT2_GLOBAL(0x01423A08, HINSTANCE) = hInstance; RCT2_GLOBAL(RCT2_ADDRESS_CMDLINE, LPSTR) = lpCmdLine; get_system_info(); @@ -78,6 +83,26 @@ __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInsta return 0; } +void print_launch_information() +{ + // Print version information + printf("Starting %s v%s\n", OPENRCT2_NAME, OPENRCT2_VERSION); + printf(" %s (%s)\n", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); + printf(" %s\n\n", OPENRCT2_TIMESTAMP); + + // Print current time + time_t timer; + char buffer[32]; + struct tm* tm_info; + + time(&timer); + tm_info = localtime(&timer); + strftime(buffer, 25, "%Y/%m/%d %H:%M:%S", tm_info); + printf("Time: %s\n", buffer); + + // TODO Print other potential information (e.g. user, hardware) +} + void rct2_loop() { int last_tick = 0; diff --git a/src/rct2.h b/src/rct2.h index 175dd78361..a379e74a2b 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -58,6 +58,12 @@ typedef unsigned long long uint64; #pragma pack(1) #endif +#define OPENRCT2_NAME "OpenRCT2" +#define OPENRCT2_VERSION "0.0.1" +#define OPENRCT2_ARCHITECTURE "x86" +#define OPENRCT2_PLATFORM "Windows" +#define OPENRCT2_TIMESTAMP __DATE__ " " __TIME__ + void rct2_finish(); enum { diff --git a/src/title.c b/src/title.c index d351270bc9..bdd623692d 100644 --- a/src/title.c +++ b/src/title.c @@ -237,16 +237,19 @@ static void title_update_showcase() static void DrawOpenRCT2(int x, int y) { - char buffer[] = " OpenRCT2, v0.0.1"; + char buffer[256]; rct_drawpixelinfo *dpi = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo); - // Background + // Draw background gfx_fill_rect_inset(dpi, x, y, x + 128, y + 20, 0x80 | 12, 0x8); - // Text - buffer[0] = FORMAT_MEDIUMFONT; - buffer[1] = FORMAT_BLACK; + // Format text (name and version) + sprintf(buffer, "%c%c%s, v%s", FORMAT_MEDIUMFONT, FORMAT_BLACK, OPENRCT2_NAME, OPENRCT2_VERSION); + + // Draw shadow gfx_draw_string(dpi, buffer, 0, x + 5, y + 5); + + // Draw text buffer[1] = FORMAT_WHITE; gfx_draw_string(dpi, buffer, 0, x + 4, y + 4); }