static char program_version_string[32];
sprintf(program_version_string, "%d.%d.%d.%d%s",
- PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH,
- PROGRAM_VERSION_BUILD, PROGRAM_VERSION_EXTRA);
+ PROGRAM_VERSION_SUPER, PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR,
+ PROGRAM_VERSION_PATCH, PROGRAM_VERSION_EXTRA);
return program_version_string;
}
/* functions for version handling */
#define MM_VERSION_IDENT(x,y,z) VERSION_IDENT(x,y,z,0)
-#define MM_VERSION_MAJOR(x) VERSION_MAJOR(x)
-#define MM_VERSION_MINOR(x) VERSION_MINOR(x)
-#define MM_VERSION_PATCH(x) VERSION_PATCH(x)
+#define MM_VERSION_MAJOR(x) VERSION_PART_1(x)
+#define MM_VERSION_MINOR(x) VERSION_PART_2(x)
+#define MM_VERSION_PATCH(x) VERSION_PART_3(x)
/* file version numbers for resource files (levels, score, setup, etc.)
** currently supported/known file version numbers:
int getFileVersion(File *file)
{
+ int version_super = getByteFromFile(file);
int version_major = getByteFromFile(file);
int version_minor = getByteFromFile(file);
int version_patch = getByteFromFile(file);
- int version_build = getByteFromFile(file);
- return VERSION_IDENT(version_major, version_minor, version_patch,
- version_build);
+ return VERSION_IDENT(version_super, version_major, version_minor,
+ version_patch);
}
int putFileVersion(FILE *file, int version)
{
if (file != NULL)
{
+ int version_super = VERSION_SUPER(version);
int version_major = VERSION_MAJOR(version);
int version_minor = VERSION_MINOR(version);
int version_patch = VERSION_PATCH(version);
- int version_build = VERSION_BUILD(version);
+ fputc(version_super, file);
fputc(version_major, file);
fputc(version_minor, file);
fputc(version_patch, file);
- fputc(version_build, file);
}
return 4;
sprintf(cookie, "%s_%s_FILE_VERSION_%d.%d",
program.cookie_prefix, file_type,
- program.version_major, program.version_minor);
+ program.version_super, program.version_major);
return cookie;
}
const int len_pattern1 = strlen(pattern1);
const int len_pattern2 = strlen(pattern2);
const int len_pattern = len_pattern1 + len_pattern2;
- int version_major, version_minor;
+ int version_super, version_major;
if (len_cookie <= len_pattern)
return -1;
ptr_cookie2[2] < '0' || ptr_cookie2[2] > '9')
return -1;
- version_major = ptr_cookie2[0] - '0';
- version_minor = ptr_cookie2[2] - '0';
+ version_super = ptr_cookie2[0] - '0';
+ version_major = ptr_cookie2[2] - '0';
- return VERSION_IDENT(version_major, version_minor, 0, 0);
+ return VERSION_IDENT(version_super, version_major, 0, 0);
}
boolean checkCookieString(const char *cookie, const char *template)
program.cookie_prefix = cookie_prefix;
+ program.version_super = VERSION_SUPER(program_version);
program.version_major = VERSION_MAJOR(program_version);
program.version_minor = VERSION_MINOR(program_version);
program.version_patch = VERSION_PATCH(program_version);
- program.version_build = VERSION_BUILD(program_version);
program.version_ident = program_version;
program.version_string = program_version_string;
/* macros for version handling */
-#define VERSION_MAJOR(x) ((x) / 1000000)
-#define VERSION_MINOR(x) (((x) % 1000000) / 10000)
-#define VERSION_PATCH(x) (((x) % 10000) / 100)
-#define VERSION_BUILD(x) ((x) % 100)
+#define VERSION_PART_1(x) ((x) / 1000000)
+#define VERSION_PART_2(x) (((x) % 1000000) / 10000)
+#define VERSION_PART_3(x) (((x) % 10000) / 100)
+#define VERSION_PART_4(x) ((x) % 100)
+
+#define VERSION_SUPER(x) VERSION_PART_1(x)
+#define VERSION_MAJOR(x) VERSION_PART_2(x)
+#define VERSION_MINOR(x) VERSION_PART_3(x)
+#define VERSION_PATCH(x) VERSION_PART_4(x)
#define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d))
FILE *log_file[NUM_LOGS]; /* log file handles for out/err files */
FILE *log_file_default[NUM_LOGS]; /* default log file handles (out/err) */
+ int version_super;
int version_major;
int version_minor;
int version_patch;
- int version_build;
int version_ident;
char *version_string;
{
Print(" (%s %d.%d.%d.%d%s)",
PROGRAM_TITLE_STRING,
+ PROGRAM_VERSION_SUPER,
PROGRAM_VERSION_MAJOR,
PROGRAM_VERSION_MINOR,
PROGRAM_VERSION_PATCH,
- PROGRAM_VERSION_BUILD,
PROGRAM_VERSION_EXTRA);
}
/* program information and versioning definitions */
-#define PROGRAM_VERSION_MAJOR 4
-#define PROGRAM_VERSION_MINOR 1
-#define PROGRAM_VERSION_PATCH 0
-#define PROGRAM_VERSION_BUILD 1
+#define PROGRAM_VERSION_SUPER 4
+#define PROGRAM_VERSION_MAJOR 1
+#define PROGRAM_VERSION_MINOR 0
+#define PROGRAM_VERSION_PATCH 1
#define PROGRAM_VERSION_EXTRA ""
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define GAME_VERSION_2_0 FILE_VERSION_2_0
#define GAME_VERSION_3_0 FILE_VERSION_3_0
-#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
+#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_SUPER, \
+ PROGRAM_VERSION_MAJOR, \
PROGRAM_VERSION_MINOR, \
- PROGRAM_VERSION_PATCH, \
- PROGRAM_VERSION_BUILD)
+ PROGRAM_VERSION_PATCH)
/* values for game_emulation */
#define EMU_NONE 0