static void print_version() { char buffer[256]; openrct2_write_full_version_info(buffer, sizeof(buffer)); printf("%s\n", buffer); printf("%s (%s)\n", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); }
static void window_about_openrct2_paint(rct_window *w, rct_drawpixelinfo *dpi) { window_draw_widgets(w, dpi); window_about_openrct2_common_paint(w, dpi); sint32 x, y, width; rct_size16 logoSize; x = w->x + (w->width / 2); y = w->y + w->widgets[WIDX_PAGE_BACKGROUND].top + 10; width = w->width - 20; utf8 buffer[256]; utf8 *ch = buffer; openrct2_write_full_version_info(ch, sizeof(buffer) - (ch - buffer)); y += gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION, w->colours[2]) + 10; logoSize = gfx_get_sprite_size(SPR_G2_LOGO); gfx_draw_sprite(dpi, SPR_G2_LOGO, x - (logoSize.width / 2), y, 0); y += logoSize.height + 20; y += gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION_2, w->colours[2]) + 15; gfx_draw_string_centred_wrapped(dpi, NULL, x, y, width, STR_ABOUT_OPENRCT2_DESCRIPTION_3, w->colours[2]); gfx_draw_string_centred_wrapped(dpi, &ch, x, w->y + WH - 25, width, STR_STRING, w->colours[2]); }
static void PrintLaunchInformation() { char buffer[256]; time_t timer; struct tm * tmInfo; // Print name and version information openrct2_write_full_version_info(buffer, sizeof(buffer)); Console::WriteFormat("%s", buffer); Console::WriteLine(); Console::WriteFormat("%s (%s)", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); Console::WriteLine(); Console::WriteFormat("@ %s", OPENRCT2_TIMESTAMP); Console::WriteLine(); Console::WriteLine(); // Print current time time(&timer); tmInfo = localtime(&timer); strftime(buffer, sizeof(buffer), "%Y/%m/%d %H:%M:%S", tmInfo); Console::WriteFormat("VERBOSE: time is %s", buffer); Console::WriteLine(); // TODO Print other potential information (e.g. user, hardware) }
static void PrintVersion() { char buffer[256]; openrct2_write_full_version_info(buffer, sizeof(buffer)); Console::WriteLine(buffer); Console::WriteFormat("%s (%s)", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); #ifdef NO_RCT2 Console::Write(" (NO_RCT2)"); #endif Console::WriteLine(); }
void Assert_VA(bool expression, const char * message, va_list args) { if (expression) return; if (message != nullptr) { Console::Error::WriteLine("Assertion failed:"); Console::Error::WriteLine_VA(message, args); } #ifdef DEBUG Debug::Break(); #endif #ifdef __WINDOWS__ char version[128]; openrct2_write_full_version_info(version, sizeof(version)); char buffer[512]; strcpy(buffer, "An assertion failed, please report this to the OpenRCT2 developers.\r\n\r\nVersion: "); strcat(buffer, version); if (message != nullptr) { strcat(buffer, "\r\n"); char *bufend = (char *)strchr(buffer, 0); vsnprintf(bufend, sizeof(buffer) - (bufend - buffer), message, args); } #ifdef __TEST__ // Abort if we are building for testing abort(); #else // Show message box if we are not building for testing sint32 result = MessageBoxA(nullptr, buffer, OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); if (result == IDABORT) { #ifdef USE_BREAKPAD // Force a crash that breakpad will handle allowing us to get a dump *((void**)0) = 0; #else assert(false); #endif } #endif #else assert(false); #endif }
static void print_launch_information() { char buffer[256]; time_t timer; tm_t* tmInfo; // Print name and version information openrct2_write_full_version_info(buffer, sizeof(buffer)); printf("%s\n", buffer); printf("%s (%s)\n", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); printf("@ %s\n\n", OPENRCT2_TIMESTAMP); // Print current time time(&timer); tmInfo = localtime(&timer); strftime(buffer, sizeof(buffer), "%Y/%m/%d %H:%M:%S", tmInfo); printf("VERBOSE: time is %s\n", buffer); // TODO Print other potential information (e.g. user, hardware) }