#define PATCH_XML_PATH "Data/patch/patch.xml"
#define STATS_XML_PATH "Data/MachineProfile/Stats.xml"
-// these should be defined in verstub.cpp across all platforms
-extern const bool VersionSVN;
-extern const char *const VersionDate;
-extern unsigned long VersionNumber;
-
/* /stats/ is mounted to Data for arcade builds, so this should be okay. */
int DiagnosticsUtil::GetNumCrashLogs()
{
CString DiagnosticsUtil::GetProductName()
{
- if( VersionSVN )
- return CString(PRODUCT_NAME_VER) + " " + ssprintf( "r%lu", VersionNumber);
-
- return CString(PRODUCT_NAME_VER);
+ return CString(ProductInfo::getFullVersionString());
}
CString DiagnosticsUtil::GetProductVer()
{
- return CString(PRODUCT_VER);
+ return CString(ProductInfo::getVersion());
}
namespace
* from verstub. */
CString GenerateDebugSerial()
{
- char system, type;
-
- // set the compilation OS
- #if defined(WIN32)
- system = 'W'; /* Windows */
- #elif defined(LINUX)
- if( VersionSVN )
- system = 'S'; /*nix, with SVN */
- else
- system = 'L'; /*nix, no SVN */
- #elif defined(DARWIN)
- system = 'M'; /* Mac OS */
- #else
- system = 'U'; /* unknown */
- #endif
-
- // set the compilation arcade type
- #ifdef ITG_ARCADE
- type = 'A';
- #else
- type = 'P';
- #endif
-
- // if SVN, display revision: "OITG-W-20090409-600-P"
- // if no SVN, display build in hex: "OITG-W-20090409-08A-P"
- if( VersionSVN )
- return ssprintf( "OITG-%c-%s-%03lu-%c", system,
- VersionDate, VersionNumber, type );
- else
- return ssprintf( "OITG-%c-%s-%03lX-%c", system,
- VersionDate, VersionNumber, type );
+ return CString(ProductInfo::getSerial());
}
}
void SetProgramGlobals( lua_State* L )
{
LUA->SetGlobal( "OPENITG", true );
- LUA->SetGlobal( "OPENITG_VERSION", PRODUCT_TOKEN );
+ LUA->SetGlobal( "OPENITG_VERSION", ProductInfo::getVersion() );
}
REGISTER_WITH_LUA_FUNCTION( SetProgramGlobals );
LIBS += -nodefaultlibs -Wl,-Bstatic -lstdc++ $(LUA_LIBS) -lXrandr -lXrender -lmad -lgcc -lgcc_eh -Wl,-Bdynamic -lpthread -lusb -lc
endif
-.PHONY: build_version
-
-all: build_version
-
-build_version: $(srcdir)/libresample/libresample.a $(srcdir)/crypto561/libcryptopp.a
- $(CC) -O2 archutils/Unix/verinc.c -o archutils/Unix/verinc
- chmod +x archutils/Unix/verinc
- archutils/Unix/verinc `svnversion`
- $(CXX) -c verstub.cpp
-
-verstub.cpp:
- $(MAKE) build_version
+all: $(srcdir)/libresample/libresample.a $(srcdir)/crypto561/libcryptopp.a
clean-local: clean_libresample
StatsManager.cpp StatsManager.h \
ThemeManager.cpp ThemeManager.h \
UnlockManager.cpp UnlockManager.h \
-UserPackManager.cpp UserPackManager.h
+UserPackManager.cpp UserPackManager.h \
+ProductInfo.cpp ProductInfo.h
if !WITHOUT_NETWORKING
# Compile NetworkSyncManager even if networking is disabled; it'll stub itself.
$(srcdir)/libresample/libresample.a \
$(srcdir)/crypto561/libcryptopp.a
-nodist_openitg_SOURCES = verstub.cpp
openitg_SOURCES = $(main_SOURCES)
openitg_LDADD = $(main_LDADD) \
$(srcdir)/ffmpeg/lib/libavformat.a $(srcdir)/ffmpeg/lib/libavcodec.a
m_packet.Write1(NETPROTOCOLVERSION);
- m_packet.WriteNT(CString(PRODUCT_NAME_VER));
+ m_packet.WriteNT(ProductInfo::getFullVersionString());
//Block until responce is received
//Move mode to blocking in order to give CPU back to the
m_iEndlessBreakLength ( "EndlessBreakLength", 5 ),
m_bDisableScreenSaver ( "DisableScreenSaver", true ),
m_sLanguage ( "Language", "" ), // ThemeManager will deal with this invalid language
- m_sMemoryCardProfileSubdir ( "MemoryCardProfileSubdir", PRODUCT_NAME ),
+ m_sMemoryCardProfileSubdir ( "MemoryCardProfileSubdir", ProductInfo::getName()),
m_iProductID ( "ProductID", 1 ),
m_sDefaultLocalProfileIDP1 ( "DefaultLocalProfileIDP1", "" ),
m_sDefaultLocalProfileIDP2 ( "DefaultLocalProfileIDP2", "" ),
--- /dev/null
+#include "StdString.h"
+#include "ProductInfo.h"
+
+CString ProductInfo::getName() {
+ return CString("OpenITG");
+}
+
+CString ProductInfo::getVersion() {
+ return CString(OITG_VERSION);
+}
+
+CString ProductInfo::getDate() {
+ return CString(OITG_DATE);
+}
+
+CString ProductInfo::getPlatform() {
+#if defined(ITG_ARCADE)
+ return CString("AC");
+#elif defined(XBOX)
+ return CString("CS");
+#else
+ return CString("PC");
+#endif
+}
+
+CString ProductInfo::getCrashReportUrl() {
+ return CString("http://wush.net/bugzilla/terabyte/");
+}
+
+CString ProductInfo::getFullVersionString() {
+ return getVersion() + CString("-") + getPlatform();
+}
+
+CString ProductInfo::getSerial() {
+ return CString("OITG-") + getVersion() + CString("-") + getPlatform();
+}
#undef OFFICIAL_RELEASE
//#define OFFICIAL_RELEASE 1
-/* (x?)xyy - x is release type, y is release version */
-/* 101 - beta 1, 102 - beta 1.1, 103 - beta 2, 104 - beta 3 */
-#define PRODUCT_TOKEN 104
-
-/* The name of the build and its current version */
-#define PRODUCT_NAME "OpenITG"
-#define PRODUCT_VER "beta 3"
-
-#if defined(ITG_ARCADE)
-#define PRODUCT_PLATFORM "AC"
-#elif defined(XBOX)
-#define PRODUCT_PLATFORM "CS"
-#else
-#define PRODUCT_PLATFORM "PC"
-#endif
-
-#ifndef OFFICIAL_RELEASE
-#define PRODUCT_NAME_VER PRODUCT_NAME " " PRODUCT_PLATFORM " " PRODUCT_VER " DEV"
-#else
-#define PRODUCT_NAME_VER PRODUCT_NAME " " PRODUCT_PLATFORM " " PRODUCT_VER
-#endif
-
-/* A central location from which we can update crash handler data... */
-#define CRASH_REPORT_URL "https://sourceforge.net/tracker2/?atid=1110556&group_id=239714"
+#include "StdString.h"
+#include "../version.h"
+
+class ProductInfo {
+
+ public:
+ static CString getName();
+ static CString getVersion();
+ static CString getDate();
+ static CString getPlatform();
+ static CString getCrashReportUrl();
+ static CString getFullVersionString();
+ static CString getSerial();
+};
#endif
+; TODO - delete this file? this stuff is no longer up to date.
; Included by the NSIS installer script
; Don't forget to also change ProductInfo.h!
#include "CommonMetrics.h"
#include "Game.h"
#include "ScreenOptionsMasterPrefs.h"
+#include "ProductInfo.h"
#define MAX_STAGES_TEXT THEME->GetMetric (m_sName,"MaxStagesText")
#define COIN_MODE_CHANGE_SCREEN THEME->GetMetric (m_sName,"CoinModeChangeScreen")
m_textVersion.LoadFromFont( THEME->GetPathF("Common","normal") );
m_textVersion.SetName( "Version" );
/* easier debugging, plus product placement ;D */
- m_textVersion.SetText( PRODUCT_NAME_VER );
+ m_textVersion.SetText( ProductInfo::getName() );
this->AddChild( &m_textVersion );
SET_XY_AND_ON_COMMAND( m_textVersion );
}
}
-extern const bool VersionSVN;
-extern unsigned long VersionNumber;
-extern const char *const VersionTime;
-
static void WriteLogHeader()
{
- LOG->Info( PRODUCT_NAME_VER );
- LOG->Info( "Compiled %s (%s %lu)", VersionTime,
- VersionSVN ? "revision" : "build", VersionNumber );
+ LOG->Info( ProductInfo::getFullVersionString());
+ LOG->Info( "Compiled %s (build %lu)", ProductInfo::getDate(), ProductInfo::getVersion() );
time_t cur_time;
time(&cur_time);
#include "archutils/Darwin/Crash.h"
#endif
-#if defined(HAVE_VERSION_INFO)
-extern const unsigned version_num;
-#endif
-
const char *g_pCrashHandlerArgv0 = NULL;
exit(1);
}
- fprintf(CrashDump, "%s crash report", PRODUCT_NAME_VER );
+ fprintf(CrashDump, "%s crash report", ProductInfo::getFullVersionString() );
#if defined(HAVE_VERSION_INFO)
- fprintf(CrashDump, " (build %u)", version_num);
+ fprintf(CrashDump, " (build %u)", ProductInfo::getVersion());
#endif
fprintf(CrashDump, "\n");
fprintf(CrashDump, "--------------------------------------\n");
tty = stderr;
fprintf(tty,
- "\n"
- PRODUCT_NAME " has crashed. Debug information has been output to\n"
+ "\n"
+ + CString(ProductInfo::getName())
+ + " has crashed. Debug information has been output to\n"
"\n"
" " + sCrashInfoPath + "\n"
"\n"
"Please report a bug at:\n"
"\n"
- " " CRASH_REPORT_URL "\n"
+ " " + ProductInfo::getCrashReportUrl() + "\n"
"\n"
);