-#define COMPILE_DATE_STRING "2010-06-24 20:41"
+#define COMPILE_DATE_STRING "2010-06-28 18:25"
#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 23
#define SETUP_TOKEN_GAME_FRAME_DELAY 24
#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS 25
-#define SETUP_TOKEN_GRAPHICS_SET 26
-#define SETUP_TOKEN_SOUNDS_SET 27
-#define SETUP_TOKEN_MUSIC_SET 28
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 29
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 30
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 31
+#define SETUP_TOKEN_SMALL_GAME_GRAPHICS 26
+#define SETUP_TOKEN_GRAPHICS_SET 27
+#define SETUP_TOKEN_SOUNDS_SET 28
+#define SETUP_TOKEN_MUSIC_SET 29
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 30
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 31
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 32
-#define NUM_GLOBAL_SETUP_TOKENS 32
+#define NUM_GLOBAL_SETUP_TOKENS 33
/* editor setup */
#define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0
{ TYPE_SWITCH, &si.prefer_aga_graphics, "prefer_aga_graphics" },
{ TYPE_INTEGER,&si.game_frame_delay, "game_frame_delay" },
{ TYPE_SWITCH, &si.sp_show_border_elements, "sp_show_border_elements" },
+ { TYPE_SWITCH, &si.small_game_graphics, "small_game_graphics" },
{ TYPE_STRING, &si.graphics_set, "graphics_set" },
{ TYPE_STRING, &si.sounds_set, "sounds_set" },
{ TYPE_STRING, &si.music_set, "music_set" },
si->prefer_aga_graphics = TRUE;
si->game_frame_delay = GAME_FRAME_DELAY;
si->sp_show_border_elements = FALSE;
+ si->small_game_graphics = FALSE;
si->graphics_set = getStringCopy(GFX_DEFAULT_SUBDIR);
si->sounds_set = getStringCopy(SND_DEFAULT_SUBDIR);
{
int x = screen_x % (MAX_BUF_XSIZE * TILEX);
int y = screen_y % (MAX_BUF_YSIZE * TILEY);
+ int sx, sy, sxsize, sysize;
+ int xsize = SXSIZE;
+ int ysize = SYSIZE;
+ int full_xsize = lev.width * TILEX;
+ int full_ysize = lev.height * TILEY;
+
+ sxsize = (full_xsize < xsize ? full_xsize : xsize);
+ sysize = (full_ysize < ysize ? full_ysize : ysize);
+ sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0);
+ sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0);
#if 0
printf("::: %d, %d\n", screenBitmap->width, screenBitmap->height);
return;
#endif
+#if 1
+ if (x < 2 * TILEX && y < 2 * TILEY)
+ {
+ BlitBitmap(screenBitmap, target_bitmap, x, y,
+ sxsize, sysize, sx, sy);
+ }
+ else if (x < 2 * TILEX && y >= 2 * TILEY)
+ {
+ BlitBitmap(screenBitmap, target_bitmap, x, y,
+ sxsize, MAX_BUF_YSIZE * TILEY - y,
+ sx, sy);
+ BlitBitmap(screenBitmap, target_bitmap, x, 0,
+ sxsize, y - 2 * TILEY,
+ sx, sy + MAX_BUF_YSIZE * TILEY - y);
+ }
+ else if (x >= 2 * TILEX && y < 2 * TILEY)
+ {
+ BlitBitmap(screenBitmap, target_bitmap, x, y,
+ MAX_BUF_XSIZE * TILEX - x, sysize,
+ sx, sy);
+ BlitBitmap(screenBitmap, target_bitmap, 0, y,
+ x - 2 * TILEX, sysize,
+ sx + MAX_BUF_XSIZE * TILEX - x, sy);
+ }
+ else
+ {
+ BlitBitmap(screenBitmap, target_bitmap, x, y,
+ MAX_BUF_XSIZE * TILEX - x, MAX_BUF_YSIZE * TILEY - y,
+ sx, sy);
+ BlitBitmap(screenBitmap, target_bitmap, 0, y,
+ x - 2 * TILEX, MAX_BUF_YSIZE * TILEY - y,
+ sx + MAX_BUF_XSIZE * TILEX - x, sy);
+ BlitBitmap(screenBitmap, target_bitmap, x, 0,
+ MAX_BUF_XSIZE * TILEX - x, y - 2 * TILEY,
+ sx, sy + MAX_BUF_YSIZE * TILEY - y);
+ BlitBitmap(screenBitmap, target_bitmap, 0, 0,
+ x - 2 * TILEX, y - 2 * TILEY,
+ sx + MAX_BUF_XSIZE * TILEX - x, sy + MAX_BUF_YSIZE * TILEY - y);
+ }
+#else
if (x < 2 * TILEX && y < 2 * TILEY)
{
BlitBitmap(screenBitmap, target_bitmap, x, y,
x - 2 * TILEX, y - 2 * TILEY,
SX + MAX_BUF_XSIZE * TILEX - x, SY + MAX_BUF_YSIZE * TILEY - y);
}
+#endif
}
void BackToFront_EM(void)
boolean half_shifted_y = (EVEN(SCR_FIELDY) && screen_y % TILEY != 0);
#endif
+ int sx, sy, sxsize, sysize;
+ int xsize = SXSIZE;
+ int ysize = SYSIZE;
+ int full_xsize = lev.width * TILEX;
+ int full_ysize = lev.height * TILEY;
+
+ sxsize = (full_xsize < xsize ? full_xsize : xsize);
+ sysize = (full_ysize < ysize ? full_ysize : ysize);
+ sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0);
+ sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0);
+
#if 0
#if 1
printf("::: %d, %d\n", EVEN(SCR_FIELDX), screen_x);
if (redraw[xx][yy])
BlitBitmap(screenBitmap, window,
xx * TILEX, yy * TILEY, TILEX, TILEY,
- SX + x * TILEX - scroll_xoffset,
- SY + y * TILEY - scroll_yoffset);
+ sx + x * TILEX - scroll_xoffset,
+ sy + y * TILEY - scroll_yoffset);
}
}
static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY)
{
#if NEW_TILESIZE
+#if 0
int pseudo_sxsize = SXSIZE * TILESIZE / TILESIZE_VAR;
int pseudo_sysize = SYSIZE * TILESIZE / TILESIZE_VAR;
+#endif
#endif
int scx = (mScrollX_last < 0 ? 0 : mScrollX_last);
int scy = (mScrollY_last < 0 ? 0 : mScrollY_last);
int sx1 = scx - 2 * TILEX;
int sy1 = scy - 2 * TILEY;
#if NEW_TILESIZE
+#if 1
+ int sx2 = scx + (SCR_FIELDX + 1) * TILEX;
+ int sy2 = scy + (SCR_FIELDY + 1) * TILEY;
+#else
int sx2 = scx + pseudo_sxsize + 1 * TILEX;
int sy2 = scy + pseudo_sysize + 1 * TILEY;
+#endif
#else
int sx2 = scx + SXSIZE + 1 * TILEX;
int sy2 = scy + SYSIZE + 1 * TILEY;
void SetScrollEdges()
{
#if NEW_TILESIZE
+#if 0
int pseudo_sxsize = SXSIZE * TILESIZE / TILESIZE_VAR;
int pseudo_sysize = SYSIZE * TILESIZE / TILESIZE_VAR;
+#endif
#endif
int border1_offset = (menBorder ? 1 : 2);
int border2_offset = (menBorder ? 0 : TILESIZE / 2);
ScrollMinX = 0;
ScrollMinY = 0;
#if NEW_TILESIZE
+#if 1
+ ScrollMaxX = (DisplayMaxX + border1_offset - SCR_FIELDX) * TILEX;
+ ScrollMaxY = (DisplayMaxY + border1_offset - SCR_FIELDY) * TILEY;
+#else
ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - pseudo_sxsize;
ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - pseudo_sysize;
+#endif
#else
ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - SXSIZE;
ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - SYSIZE;
boolean prefer_aga_graphics;
int game_frame_delay;
boolean sp_show_border_elements;
+ boolean small_game_graphics;
char *graphics_set;
char *sounds_set;
int SYSIZE = 17 * TILEY; /* SCR_FIELDY * TILEY */
int FULL_SXSIZE = 2 + 17 * TILEX + 2; /* 2 + SXSIZE + 2 */
int FULL_SYSIZE = 2 + 17 * TILEY + 2; /* 2 + SYSIZE + 2 */
-int TILESIZE_VAR = TILESIZE / 2;
+int TILESIZE_VAR = TILESIZE;
#if 1
int FX, FY;
{ TYPE_SWITCH, &setup.toons, "Show Toons:" },
{ TYPE_ECS_AGA, &setup.prefer_aga_graphics,"EMC graphics preference:" },
{ TYPE_SWITCH, &setup.sp_show_border_elements,"Supaplex Border Elements:" },
+ { TYPE_SWITCH, &setup.small_game_graphics, "Small Game Graphics:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
int border_size = vp_playfield->border_size;
int new_sx = vp_playfield->x + border_size;
int new_sy = vp_playfield->y + border_size;
- int tilesize = (gfx_game_mode == GAME_MODE_PLAYING ? TILESIZE_VAR :
- gfx_game_mode == GAME_MODE_EDITOR ? MINI_TILESIZE : TILESIZE);
int new_sxsize = vp_playfield->width - 2 * border_size;
int new_sysize = vp_playfield->height - 2 * border_size;
+ int new_real_sx = vp_playfield->x;
+ int new_real_sy = vp_playfield->y;
+ int new_full_sxsize = vp_playfield->width;
+ int new_full_sysize = vp_playfield->height;
#if NEW_TILESIZE
+ int new_tilesize_var = TILESIZE / (setup.small_game_graphics ? 2 : 1);
+ int tilesize = (gfx_game_mode == GAME_MODE_PLAYING ? new_tilesize_var :
+ gfx_game_mode == GAME_MODE_EDITOR ? MINI_TILESIZE : TILESIZE);
int new_scr_fieldx = new_sxsize / tilesize;
int new_scr_fieldy = new_sysize / tilesize;
+ int new_scr_fieldx_buffers = new_sxsize / new_tilesize_var;
+ int new_scr_fieldy_buffers = new_sysize / new_tilesize_var;
#else
int new_scr_fieldx = (vp_playfield->width - 2 * border_size) / TILESIZE;
int new_scr_fieldy = (vp_playfield->height - 2 * border_size) / TILESIZE;
#endif
+ boolean init_gfx_buffers = FALSE;
+ boolean init_video_buffer = FALSE;
+ boolean init_gadgets_and_toons = FALSE;
#if 0
/* !!! TEST ONLY !!! */
WIN_XSIZE = viewport.window.width;
WIN_YSIZE = viewport.window.height;
+#if 1
+ init_video_buffer = TRUE;
+ init_gfx_buffers = TRUE;
+#else
InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
InitGfxBuffers();
// RedrawBackground();
#endif
+#endif
+
+ // printf("::: video: init_video_buffer, init_gfx_buffers\n");
}
if (new_scr_fieldx != SCR_FIELDX ||
- new_scr_fieldy != SCR_FIELDY ||
- new_sx != SX ||
+ new_scr_fieldy != SCR_FIELDY)
+ {
+ /* this always toggles between MAIN and GAME when using small tile size */
+
+ SCR_FIELDX = new_scr_fieldx;
+ SCR_FIELDY = new_scr_fieldy;
+
+ // printf("::: new_scr_fieldx != SCR_FIELDX ...\n");
+ }
+
+#if 0
+ if (new_tilesize_var != TILESIZE_VAR &&
+ gfx_game_mode == GAME_MODE_PLAYING)
+ {
+ /* doing this outside GAME_MODE_PLAYING would give wrong playfield size */
+
+ TILESIZE_VAR = new_tilesize_var;
+
+ init_gfx_buffers = TRUE;
+
+ // printf("::: tilesize: init_gfx_buffers\n");
+ }
+#endif
+
+ if (new_sx != SX ||
new_sy != SY ||
- vp_playfield->x != REAL_SX ||
- vp_playfield->y != REAL_SY ||
+ new_sxsize != SXSIZE ||
+ new_sysize != SYSIZE ||
+ new_real_sx != REAL_SX ||
+ new_real_sy != REAL_SY ||
+ new_full_sxsize != FULL_SXSIZE ||
+ new_full_sysize != FULL_SYSIZE ||
+ new_tilesize_var != TILESIZE_VAR ||
vp_door_1->x != *door_1_x ||
vp_door_1->y != *door_1_y ||
vp_door_2->x != *door_2_x ||
vp_door_2->y != *door_2_y)
{
- SCR_FIELDX = new_scr_fieldx;
- SCR_FIELDY = new_scr_fieldy;
SX = new_sx;
SY = new_sy;
- REAL_SX = vp_playfield->x;
- REAL_SY = vp_playfield->y;
-
SXSIZE = new_sxsize;
SYSIZE = new_sysize;
- FULL_SXSIZE = vp_playfield->width;
- FULL_SYSIZE = vp_playfield->width;
+ REAL_SX = new_real_sx;
+ REAL_SY = new_real_sy;
+ FULL_SXSIZE = new_full_sxsize;
+ FULL_SYSIZE = new_full_sysize;
+ TILESIZE_VAR = new_tilesize_var;
+
+#if 0
+ printf("::: %d, %d, %d [%d]\n",
+ SCR_FIELDX, SCR_FIELDY, TILESIZE_VAR,
+ setup.small_game_graphics);
+#endif
*door_1_x = vp_door_1->x;
*door_1_y = vp_door_1->y;
*door_2_x = vp_door_2->x;
*door_2_y = vp_door_2->y;
+#if 1
+ init_gfx_buffers = TRUE;
+
+ // printf("::: viewports: init_gfx_buffers\n");
+#else
InitGfxBuffers();
+#endif
if (gfx_game_mode == GAME_MODE_MAIN)
{
+#if 1
+ init_gadgets_and_toons = TRUE;
+
+ // printf("::: viewports: init_gadgets_and_toons\n");
+#else
InitGadgets();
InitToons();
+#endif
}
}
+ if (init_gfx_buffers)
+ {
+ // printf("::: init_gfx_buffers\n");
+
+ SCR_FIELDX = new_scr_fieldx_buffers;
+ SCR_FIELDY = new_scr_fieldy_buffers;
+
+ InitGfxBuffers();
+
+ SCR_FIELDX = new_scr_fieldx;
+ SCR_FIELDY = new_scr_fieldy;
+ }
+
+ if (init_video_buffer)
+ {
+ // printf("::: init_video_buffer\n");
+
+ InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
+
+ SetDrawDeactivationMask(REDRAW_NONE);
+ SetDrawBackgroundMask(REDRAW_FIELD);
+ }
+
+ if (init_gadgets_and_toons)
+ {
+ // printf("::: init_gadgets_and_toons\n");
+
+ InitGadgets();
+ InitToons();
+ }
+
#if 0
printf("::: %d, %d / %d, %d [%d]\n", VX, VY, EX, EY, game_status);
#endif