change exe to console subsystem and print launch info.

This commit is contained in:
IntelOrca 2014-05-23 00:53:52 +01:00
parent 3de0d80477
commit b3c852a074
4 changed files with 39 additions and 5 deletions

Binary file not shown.

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <setjmp.h>
#include <time.h>
#include <windows.h>
#include <shlobj.h>
#include <SDL.h>
@ -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;

View File

@ -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 {

View File

@ -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);
}