X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDScrollBuffer.c;h=de24a9218fde06bdce81bf428f65f67add1f610b;hb=abe44529b439ad39b4d8dbf19cbd67c9b9844279;hp=fa5f081415329070ff8a705a1a1ea2d434fd33e1;hpb=1d3eff06cde10309320341fa92abec5b14f1c6f6;p=rocksndiamonds.git diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index fa5f0814..de24a921 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -7,14 +7,14 @@ #include -long mScrollX, mScrollY; -long mScrollX_last, mScrollY_last; +int mScrollX, mScrollY; +int mScrollX_last, mScrollY_last; #if 1 -long ScreenBuffer[2 + MAX_PLAYFIELD_WIDTH + 2][2 + MAX_PLAYFIELD_HEIGHT + 2]; +int ScreenBuffer[2 + MAX_PLAYFIELD_WIDTH + 2][2 + MAX_PLAYFIELD_HEIGHT + 2]; boolean redraw[2 + MAX_PLAYFIELD_WIDTH + 2][2 + MAX_PLAYFIELD_HEIGHT + 2]; #else -long ScreenBuffer[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; +int ScreenBuffer[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; #endif @@ -91,9 +91,9 @@ static void ScrollPlayfield(int dx, int dy) int sx = x - x1; int sy = y - y1; int tsi = GetSI(x, y); - long id = ((PlayField16[tsi]) | - (PlayField8[tsi] << 16) | - (DisPlayField[tsi] << 24)); + int id = ((PlayField16[tsi]) | + (PlayField8[tsi] << 16) | + (DisPlayField[tsi] << 24)); if ((dx == -1 && x == x2) || (dx == +1 && x == x1) || @@ -331,7 +331,8 @@ void BackToFront_SP(void) SyncDisplay(); - if (redraw_tiles > REDRAWTILES_THRESHOLD || scrolling || scrolling_last || + if (0 || + redraw_tiles > REDRAWTILES_THRESHOLD || scrolling || scrolling_last || ExplosionShakeMurphy != 0 || ExplosionShakeMurphy_last != 0) { BlitScreenToBitmap_SP(window); @@ -349,10 +350,23 @@ void BackToFront_SP(void) int full_xsize = (FieldWidth - (menBorder ? 0 : 1)) * TILEX; int full_ysize = (FieldHeight - (menBorder ? 0 : 1)) * TILEY; #endif +#if 1 + int xsize = SXSIZE; + int ysize = SYSIZE; + int sxsize = (full_xsize < xsize ? full_xsize : xsize); + int sysize = (full_ysize < ysize ? full_ysize : ysize); + int sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); + int sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); +#else int sx = SX + (full_xsize < SXSIZE ? (SXSIZE - full_xsize) / 2 : 0); int sy = SY + (full_ysize < SYSIZE ? (SYSIZE - full_ysize) / 2 : 0); +#endif +#if 1 + InitGfxClipRegion(TRUE, sx, sy, sxsize, sysize); +#else InitGfxClipRegion(TRUE, SX, SY, SXSIZE, SYSIZE); +#endif #if NEW_TILESIZE scroll_xoffset = scroll_xoffset * TILESIZE_VAR / TILESIZE; @@ -440,12 +454,15 @@ void DDScrollBuffer_ScrollTowards(int X, int Y, double Step) ScrollPlayfieldIfNeeded(); } -void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS) +void DDScrollBuffer_SoftScrollTo(int X, int Y, int TimeMS, int FPS) { double dx, dY; - long dT, StepCount; +#if 0 + int dT; +#endif + int StepCount; double T, tStep; - long oldX, oldY, maxD; + int oldX, oldY, maxD; static boolean AlreadyRunning = False; if (NoDisplayFlag) @@ -467,7 +484,9 @@ void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS) if (StepCount == 0) StepCount = 1; +#if 0 dT = 1000 / FPS; +#endif tStep = (double)1 / StepCount; oldX = mScrollX; oldY = mScrollY;