From: Holger Schemel Date: Mon, 20 Feb 2017 07:34:04 +0000 (+0100) Subject: fixed dumping tiles for (not yet centered) MM levels (partially) X-Git-Tag: 4.1.0.0~207 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=82b9deb54afc1abf0929ef81d276dcd514ba6aa5;p=rocksndiamonds.git fixed dumping tiles for (not yet centered) MM levels (partially) --- diff --git a/src/tools.c b/src/tools.c index 36545249..8d26fe44 100644 --- a/src/tools.c +++ b/src/tools.c @@ -360,10 +360,12 @@ static int getLevelFromScreenY_SP(int sy) static int getLevelFromScreenX_MM(int sx) { +#if 0 int level_xsize = level.native_mm_level->fieldx; int full_xsize = level_xsize * TILESIZE_VAR; sx -= (full_xsize < SXSIZE ? (SXSIZE - full_xsize) / 2 : 0); +#endif int px = sx - SX; int lx = px / TILESIZE_VAR; @@ -373,10 +375,12 @@ static int getLevelFromScreenX_MM(int sx) static int getLevelFromScreenY_MM(int sy) { +#if 0 int level_ysize = level.native_mm_level->fieldy; int full_ysize = level_ysize * TILESIZE_VAR; sy -= (full_ysize < SYSIZE ? (SYSIZE - full_ysize) / 2 : 0); +#endif int py = sy - SY; int ly = py / TILESIZE_VAR; @@ -412,6 +416,7 @@ void DumpTile(int x, int y) { int sx = SCREENX(x); int sy = SCREENY(y); + char *token_name; printf_line("-", 79); printf("Field Info: SCREEN(%d, %d), LEVEL(%d, %d)\n", sx, sy, x, y); @@ -425,8 +430,9 @@ void DumpTile(int x, int y) return; } - printf(" Feld: %d\t['%s']\n", Feld[x][y], - element_info[Feld[x][y]].token_name); + token_name = element_info[Feld[x][y]].token_name; + + printf(" Feld: %d\t['%s']\n", Feld[x][y], token_name); printf(" Back: %s\n", print_if_not_empty(Back[x][y])); printf(" Store: %s\n", print_if_not_empty(Store[x][y])); printf(" Store2: %s\n", print_if_not_empty(Store2[x][y]));