From: Holger Schemel Date: Wed, 30 Jun 2010 21:36:25 +0000 (+0200) Subject: rnd-20100630-1-src X-Git-Tag: 3.3.1.0^2~15 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=42ffe4ef1bde9f93619d259af377083cdcd96da6;p=rocksndiamonds.git rnd-20100630-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 11e5c4fc..0d45bca7 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-06-28 20:54" +#define COMPILE_DATE_STRING "2010-06-30 23:35" diff --git a/src/game.c b/src/game.c index a88b3f04..5a0a70b7 100644 --- a/src/game.c +++ b/src/game.c @@ -4354,6 +4354,16 @@ void InitGame() SBY_Lower = lev_fieldy - SCR_FIELDY + 1; } +#if NEW_TILESIZE +#if 1 + if (TILESIZE_VAR < TILESIZE && EVEN(SCR_FIELDX)) + { + // SBX_Left--; + SBX_Right++; + } +#endif +#endif + if (lev_fieldx + (SBX_Left == -1 ? 2 : 0) <= SCR_FIELDX) SBX_Left = SBX_Right = -1 * (SCR_FIELDX - lev_fieldx) / 2; diff --git a/src/main.h b/src/main.h index 0c16dce6..3fd8c915 100644 --- a/src/main.h +++ b/src/main.h @@ -32,7 +32,7 @@ #define NEW_TILESIZE 1 -#define NEW_SCROLL 0 +#define NEW_SCROLL 1 #define IMG_UNDEFINED (-1) #define IMG_EMPTY IMG_EMPTY_SPACE diff --git a/src/tools.c b/src/tools.c index 9fa29564..176b56f6 100644 --- a/src/tools.c +++ b/src/tools.c @@ -407,16 +407,60 @@ void BackToFront() int dx = (ScreenMovDir & (MV_LEFT | MV_RIGHT) ? ScreenGfxPos : 0); int dy = (ScreenMovDir & (MV_UP | MV_DOWN) ? ScreenGfxPos : 0); - fx += dx * TILESIZE_VAR / TILESIZE; - fy += dy * TILESIZE_VAR / TILESIZE; + int bx1, bx2, ffx, ffy; + + // fx += dx * TILESIZE_VAR / TILESIZE; + // fy += dy * TILESIZE_VAR / TILESIZE; #else fx += (ScreenMovDir & (MV_LEFT | MV_RIGHT) ? ScreenGfxPos : 0); fy += (ScreenMovDir & (MV_UP | MV_DOWN) ? ScreenGfxPos : 0); #endif +#if 1 + #if 0 - printf("::: %d, %d [%d, %d] [%d, %d]\n", - fx, fy, FX, FY, ScreenMovDir, ScreenGfxPos); + bx1 = SBX_Left * TILEX_VAR + TILEX_VAR / 2; + // bx1 = SBX_Left * TILEX_VAR; + bx2 = SBX_Right * TILEX_VAR - TILEX_VAR / 2; + ffx = scroll_x * TILEX_VAR + dx * TILESIZE_VAR / TILESIZE; + + if (ffx > bx1) // && ffx < bx2) + fx += dx * TILESIZE_VAR / TILESIZE; + + // fx += TILEX_VAR - (ffx - bx1) % TILEX_VAR; + + printf("::: %d (%d, %d) (%d)\n", ffx, bx1, bx2, dx); + +#if 0 + if (ffx > SBX_Left * TILEX_VAR) + fx -= MIN(ffx, TILEX_VAR / 2); + if (ffx > SBX_Left * TILEX_VAR && ffx < (SBX_Right + 1) * TILEX_VAR) + fx -= MIN(ffx, TILEX_VAR / 2); +#endif + +#else + ffx = (scroll_x - SBX_Left) * TILEX_VAR + dx * TILESIZE_VAR / TILESIZE; + + if (EVEN(SCR_FIELDX)) + { + if (ffx < SBX_Right * TILEX_VAR + TILEX_VAR / 2) + fx = fx + dx * TILESIZE_VAR / TILESIZE - MIN(ffx, TILEX_VAR / 2); + else + fx = fx - (dx <= 0 ? TILEX_VAR : 0); + + printf("::: %d (%d, %d) [%d] [%d] => %d\n", + ffx, SBX_Left * TILEX_VAR, SBX_Right * TILEX_VAR, dx, FX, fx); + } +#endif + +#if 0 + printf("::: %d, %d [%d, %d] [%d, %d] [%d, %d] [%d] [%d, %d]\n", + fx, fy, FX, FY, ScreenMovDir, ScreenGfxPos, + scroll_x, scroll_y, + ffx, + SBX_Left, SBX_Right); +#endif + #endif #if 0