mirror of
https://github.com/nmlgc/ReC98.git
synced 2025-02-26 20:55:09 +00:00

So many things named `score_*`, so many things named `hiscore_*`… Let's go with `scoredat_*`, which clearly indicates that this stuff is saved into a file, while still being only 8 characters. Part of P0063, funded by -Tom-.
21 lines
573 B
C
21 lines
573 B
C
/* ReC98
|
|
* -----
|
|
* TH02 high score pre-save encoding
|
|
*/
|
|
|
|
#define SCOREDAT_ENCODE() \
|
|
int i; \
|
|
hi.score.points_sum = 0; \
|
|
hi.score.g_name_first_sum = 0; \
|
|
hi.score.stage_sum = 0; \
|
|
hi.score_sum = 0; \
|
|
for(i = 0; i < SCOREDAT_PLACES; i++) { \
|
|
hi.score.points_sum += hi.score.points[i]; \
|
|
hi.score.g_name_first_sum += hi.score.g_name[i][0]; \
|
|
hi.score.stage_sum += hi.score.stage[i]; \
|
|
} \
|
|
for(i = 0; i < sizeof(hi.score); i++) { \
|
|
hi.score_sum += *((unsigned char*)(&hi.score) + i); \
|
|
*((unsigned char*)(&hi.score) + i) += 0x12; \
|
|
}
|