projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20030220-1-src
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index e6f0753e4914aecfa85760c32b675388f93a0944..6cf2d9e6cb55fbbb54ba5b8c815d8f49d34d5463 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-254,7
+254,7
@@
void BackToFront()
MICROLEV_XPOS, MICROLEV_YPOS, MICROLEV_XSIZE, MICROLEV_YSIZE,
MICROLEV_XPOS, MICROLEV_YPOS);
BlitBitmap(backbuffer, window,
MICROLEV_XPOS, MICROLEV_YPOS, MICROLEV_XSIZE, MICROLEV_YSIZE,
MICROLEV_XPOS, MICROLEV_YPOS);
BlitBitmap(backbuffer, window,
- SX, MICROLABEL_YPOS, SXSIZE,
FONT4_YSIZE
,
+ SX, MICROLABEL_YPOS, SXSIZE,
getFontHeight(FONT_SPECIAL_GAME)
,
SX, MICROLABEL_YPOS);
redraw_mask &= ~REDRAW_MICROLEVEL;
}
SX, MICROLABEL_YPOS);
redraw_mask &= ~REDRAW_MICROLEVEL;
}
@@
-279,7
+279,7
@@
void BackToFront()
info1[0] = '\0';
sprintf(text, "%.1f fps%s", global.frames_per_second, info1);
info1[0] = '\0';
sprintf(text, "%.1f fps%s", global.frames_per_second, info1);
- DrawTextExt(window, SX, SY, text, F
S_SMALL, FC_YELLOW
, FONT_OPAQUE);
+ DrawTextExt(window, SX, SY, text, F
ONT_DEFAULT_SMALL
, FONT_OPAQUE);
}
FlushDisplay();
}
FlushDisplay();
@@
-367,7
+367,7
@@
void SetMainBackgroundImage(int graphic)
SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
graphic_info[graphic].bitmap ?
graphic_info[graphic].bitmap :
SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
graphic_info[graphic].bitmap ?
graphic_info[graphic].bitmap :
- graphic_info[IMG_BACKGROUND
_DEFAULT
].bitmap);
+ graphic_info[IMG_BACKGROUND].bitmap);
}
void SetDoorBackgroundImage(int graphic)
}
void SetDoorBackgroundImage(int graphic)
@@
-375,7
+375,7
@@
void SetDoorBackgroundImage(int graphic)
SetDoorBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
graphic_info[graphic].bitmap ?
graphic_info[graphic].bitmap :
SetDoorBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
graphic_info[graphic].bitmap ?
graphic_info[graphic].bitmap :
- graphic_info[IMG_BACKGROUND
_DEFAULT
].bitmap);
+ graphic_info[IMG_BACKGROUND].bitmap);
}
void DrawBackground(int dest_x, int dest_y, int width, int height)
}
void DrawBackground(int dest_x, int dest_y, int width, int height)
@@
-426,7
+426,7
@@
void SetBorderElement()
{
for(x=0; x<lev_fieldx; x++)
{
{
for(x=0; x<lev_fieldx; x++)
{
- if (!IS_
MASSIV
E(Feld[x][y]))
+ if (!IS_
INDESTRUCTIBL
E(Feld[x][y]))
BorderElement = EL_STEELWALL;
if (y != 0 && y != lev_fieldy - 1 && x != lev_fieldx - 1)
BorderElement = EL_STEELWALL;
if (y != 0 && y != lev_fieldy - 1 && x != lev_fieldx - 1)
@@
-609,7
+609,7
@@
void DrawPlayer(struct PlayerInfo *player)
/* draw player himself */
/* draw player himself */
- if (
game.emulation == EMU_SUPAPLEX
)
+ if (
player->use_murphy_graphic
)
{
static int last_dir = MV_LEFT;
int action = (player->programmed_action ? player->programmed_action :
{
static int last_dir = MV_LEFT;
int action = (player->programmed_action ? player->programmed_action :
@@
-666,19
+666,27
@@
void DrawPlayer(struct PlayerInfo *player)
{
if (player->MovDir == MV_LEFT)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_LEFT :
{
if (player->MovDir == MV_LEFT)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_LEFT :
+ player->is_digging ? IMG_PLAYER1_DIGGING_LEFT :
player->is_moving ? IMG_PLAYER1_MOVING_LEFT :
player->is_moving ? IMG_PLAYER1_MOVING_LEFT :
+ player->snapped ? IMG_PLAYER1_SNAPPING_LEFT :
IMG_PLAYER1_LEFT);
else if (player->MovDir == MV_RIGHT)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_RIGHT :
IMG_PLAYER1_LEFT);
else if (player->MovDir == MV_RIGHT)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_RIGHT :
+ player->is_digging ? IMG_PLAYER1_DIGGING_RIGHT :
player->is_moving ? IMG_PLAYER1_MOVING_RIGHT :
player->is_moving ? IMG_PLAYER1_MOVING_RIGHT :
+ player->snapped ? IMG_PLAYER1_SNAPPING_RIGHT :
IMG_PLAYER1_RIGHT);
else if (player->MovDir == MV_UP)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_UP :
IMG_PLAYER1_RIGHT);
else if (player->MovDir == MV_UP)
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_UP :
+ player->is_digging ? IMG_PLAYER1_DIGGING_UP :
player->is_moving ? IMG_PLAYER1_MOVING_UP :
player->is_moving ? IMG_PLAYER1_MOVING_UP :
+ player->snapped ? IMG_PLAYER1_SNAPPING_UP :
IMG_PLAYER1_UP);
else /* MV_DOWN || MV_NO_MOVING */
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_DOWN :
IMG_PLAYER1_UP);
else /* MV_DOWN || MV_NO_MOVING */
graphic = (player->Pushing ? IMG_PLAYER1_PUSHING_DOWN :
+ player->is_digging ? IMG_PLAYER1_DIGGING_DOWN :
player->is_moving ? IMG_PLAYER1_MOVING_DOWN :
player->is_moving ? IMG_PLAYER1_MOVING_DOWN :
+ player->snapped ? IMG_PLAYER1_SNAPPING_DOWN :
IMG_PLAYER1_DOWN);
graphic = PLAYER_NR_GFX(graphic, player->index_nr);
IMG_PLAYER1_DOWN);
graphic = PLAYER_NR_GFX(graphic, player->index_nr);
@@
-959,16
+967,22
@@
void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
int src_x = mini_startx + graphic_info[graphic].src_x / 2;
int src_y = mini_starty + graphic_info[graphic].src_y / 2;
int src_x = mini_startx + graphic_info[graphic].src_x / 2;
int src_y = mini_starty + graphic_info[graphic].src_y / 2;
+#if 0
+ /* !!! not needed anymore, because of automatically created mini graphics */
if (src_x + MINI_TILEX > src_bitmap->width ||
src_y + MINI_TILEY > src_bitmap->height)
{
/* graphic of desired size seems not to be contained in this image;
dirty workaround: get it from the middle of the normal sized image */
if (src_x + MINI_TILEX > src_bitmap->width ||
src_y + MINI_TILEY > src_bitmap->height)
{
/* graphic of desired size seems not to be contained in this image;
dirty workaround: get it from the middle of the normal sized image */
+ printf("::: using dirty workaround for %d (%d, %d)\n",
+ graphic, src_bitmap->width, src_bitmap->height);
+
getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
src_x += (TILEX / 2 - MINI_TILEX / 2);
src_y += (TILEY / 2 - MINI_TILEY / 2);
}
getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
src_x += (TILEX / 2 - MINI_TILEX / 2);
src_y += (TILEY / 2 - MINI_TILEY / 2);
}
+#endif
*bitmap = src_bitmap;
*x = src_x;
*bitmap = src_bitmap;
*x = src_x;
@@
-1615,13
+1629,12
@@
static void DrawMicroLevelExt(int xpos, int ypos, int from_x, int from_y)
#define MICROLABEL_IMPORTED_FROM 4
#define MICROLABEL_LEVEL_IMPORT_INFO 5
#define MICROLABEL_IMPORTED_FROM 4
#define MICROLABEL_LEVEL_IMPORT_INFO 5
-#define MAX_MICROLABEL_SIZE (SXSIZE / FONT4_XSIZE)
-
static void DrawMicroLevelLabelExt(int mode)
{
static void DrawMicroLevelLabelExt(int mode)
{
- char label_text[MAX_MICROLABEL_SIZE + 1];
+ char label_text[MAX_OUTPUT_LINESIZE + 1];
+ int max_len_label_text = SXSIZE / getFontWidth(FONT_SPECIAL_GAME);
- DrawBackground(SX, MICROLABEL_YPOS, SXSIZE,
FONT4_YSIZE
);
+ DrawBackground(SX, MICROLABEL_YPOS, SXSIZE,
getFontHeight(FONT_SPECIAL_GAME)
);
strncpy(label_text, (mode == MICROLABEL_LEVEL_NAME ? level.name :
mode == MICROLABEL_CREATED_BY ? "created by" :
strncpy(label_text, (mode == MICROLABEL_LEVEL_NAME ? level.name :
mode == MICROLABEL_CREATED_BY ? "created by" :
@@
-1629,15
+1642,16
@@
static void DrawMicroLevelLabelExt(int mode)
mode == MICROLABEL_IMPORTED_FROM ? "imported from" :
mode == MICROLABEL_LEVEL_IMPORT_INFO ?
leveldir_current->imported_from : ""),
mode == MICROLABEL_IMPORTED_FROM ? "imported from" :
mode == MICROLABEL_LEVEL_IMPORT_INFO ?
leveldir_current->imported_from : ""),
-
MAX_MICROLABEL_SIZE
);
- label_text[
MAX_MICROLABEL_SIZE
] = '\0';
+
max_len_label_text
);
+ label_text[
max_len_label_text
] = '\0';
if (strlen(label_text) > 0)
{
if (strlen(label_text) > 0)
{
- int lxpos = SX + (SXSIZE - strlen(label_text) * FONT4_XSIZE) / 2;
+ int text_width = strlen(label_text) * getFontWidth(FONT_SPECIAL_GAME);
+ int lxpos = SX + (SXSIZE - text_width) / 2;
int lypos = MICROLABEL_YPOS;
int lypos = MICROLABEL_YPOS;
- DrawText(lxpos, lypos, label_text, F
S_SMALL, FC_SPECIAL2
);
+ DrawText(lxpos, lypos, label_text, F
ONT_SPECIAL_GAME
);
}
redraw_mask |= REDRAW_MICROLEVEL;
}
redraw_mask |= REDRAW_MICROLEVEL;
@@
-1805,7
+1819,7
@@
boolean Request(char *text, unsigned int req_state)
text_line[tl] = 0;
DrawText(DX + 50 - (tl * 14)/2, DY + 8 + ty * 16,
text_line[tl] = 0;
DrawText(DX + 50 - (tl * 14)/2, DY + 8 + ty * 16,
- text_line, F
S_SMALL, FC_YELLOW
);
+ text_line, F
ONT_DEFAULT_SMALL
);
text += tl + (tc == ' ' ? 1 : 0);
}
text += tl + (tc == ' ' ? 1 : 0);
}