From baf9d63f5b9704afc6894bbda3dd7373e8fef45b Mon Sep 17 00:00:00 2001 From: Stuart George Date: Fri, 12 Jan 2007 02:31:04 +0000 Subject: Fixed version number printing in alt-d dialogue box svn-id: r25070 --- engines/agi/agi.cpp | 3 ++- engines/agi/agi.h | 1 - engines/agi/op_cmd.cpp | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 877777ddf0..b4ca386b37 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -30,6 +30,7 @@ #include "common/config-manager.h" #include "base/plugins.h" +#include "base/version.h" #include "graphics/cursorman.h" @@ -656,7 +657,7 @@ int AgiEngine::init() { int AgiEngine::go() { CursorMan.showMouse(true); - report(" \nAGI engine " VERSION " is ready.\n"); + report(" \nAGI engine %s is ready.\n", gScummVMVersion); if (game.state < STATE_LOADED) { do { main_cycle(); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 7c159b9a23..fc245618a6 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -44,7 +44,6 @@ typedef signed int Err; /* * Version and other definitions */ -#define VERSION __DATE__ " " __TIME__ #define USE_IIGS_SOUND diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 65464bf422..8fa0f3762c 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -23,6 +23,7 @@ */ #include "common/stdafx.h" +#include "base/version.h" #include "agi/agi.h" #include "agi/sprite.h" @@ -892,11 +893,11 @@ cmd(set_menu_item) { } cmd(version) { - char ver_msg[] = TITLE " v" VERSION; + char ver_msg[64]; char ver2_msg[] = "\n" - " \n\n" - "Emulating Sierra AGI v%x.%03x\n"; + " \n\n" + " Emulating Sierra AGI v%x.%03x\n"; char ver3_msg[] = "\n" " \n\n" @@ -905,6 +906,10 @@ cmd(version) { char *r, *q; int ver, maj, min; char msg[256]; + int gap; + int len; + + sprintf(ver_msg, TITLE " v%s", gScummVMVersion); ver = g_agi->agiGetRelease(); maj = (ver >> 12) & 0xf; @@ -913,7 +918,15 @@ cmd(version) { q = maj == 2 ? ver2_msg : ver3_msg; r = strchr(q + 1, '\n'); - strncpy(q + 1 + ((r - q > 0 ? r - q : 1) / 4), ver_msg, strlen(ver_msg)); + /* insert our version into the other version */ + len = strlen(ver_msg); + gap = r - q; + if(gap < 0) + gap = 0; + else + gap = (gap - len) / 2; + + strncpy(q + 1 + gap, ver_msg, strlen(ver_msg)); sprintf(msg, q, maj, min); g_agi->message_box(msg); } -- cgit v1.2.3