-#define COMPILE_DATE_STRING "[2003-02-23 18:14]"
+#define COMPILE_DATE_STRING "[2003-02-23 18:48]"
#define CONFIG_TOKEN_FONT_INITIAL "font.initial"
-struct FontInfo font_info_initial[NUM_INITIAL_FONTS];
+struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS];
static void InitGlobal();
static void InitSetup();
strncmp(image_config[i].token, font_token, len_font_token) == 0)
{
if (strcmp(&image_config[i].token[len_font_token], ".x") == 0)
- font_info_initial[j].src_x = atoi(image_config[i].value);
+ font_initial[j].src_x = atoi(image_config[i].value);
else if (strcmp(&image_config[i].token[len_font_token], ".y") == 0)
- font_info_initial[j].src_y = atoi(image_config[i].value);
+ font_initial[j].src_y = atoi(image_config[i].value);
else if (strcmp(&image_config[i].token[len_font_token], ".width") == 0)
- font_info_initial[j].width = atoi(image_config[i].value);
+ font_initial[j].width = atoi(image_config[i].value);
else if (strcmp(&image_config[i].token[len_font_token],".height") == 0)
- font_info_initial[j].height = atoi(image_config[i].value);
+ font_initial[j].height = atoi(image_config[i].value);
}
}
}
bitmap_font_initial = LoadCustomImage(filename_font_initial);
for (j=0; j < NUM_INITIAL_FONTS; j++)
- font_info_initial[j].bitmap = bitmap_font_initial;
+ font_initial[j].bitmap = bitmap_font_initial;
InitFontGraphicInfo();
void InitFontGraphicInfo()
{
- static struct FontInfo font_info[NUM_IMG_FONTS];
+ static struct FontBitmapInfo font_bitmap_info[NUM_IMG_FONTS];
int num_fonts = NUM_IMG_FONTS;
int i;
for (i=0; i < num_fonts; i++)
{
if (i < NUM_INITIAL_FONTS)
- font_info[i] = font_info_initial[i];
+ font_bitmap_info[i] = font_initial[i];
else
{
/* copy font relevant information from graphics information */
- font_info[i].bitmap = graphic_info[FIRST_IMG_FONT + i].bitmap;
- font_info[i].src_x = graphic_info[FIRST_IMG_FONT + i].src_x;
- font_info[i].src_y = graphic_info[FIRST_IMG_FONT + i].src_y;
- font_info[i].width = graphic_info[FIRST_IMG_FONT + i].width;
- font_info[i].height = graphic_info[FIRST_IMG_FONT + i].height;
- font_info[i].draw_x = graphic_info[FIRST_IMG_FONT + i].draw_x;
- font_info[i].draw_y = graphic_info[FIRST_IMG_FONT + i].draw_y;
+ font_bitmap_info[i].bitmap = graphic_info[FIRST_IMG_FONT + i].bitmap;
+ font_bitmap_info[i].src_x = graphic_info[FIRST_IMG_FONT + i].src_x;
+ font_bitmap_info[i].src_y = graphic_info[FIRST_IMG_FONT + i].src_y;
+ font_bitmap_info[i].width = graphic_info[FIRST_IMG_FONT + i].width;
+ font_bitmap_info[i].height = graphic_info[FIRST_IMG_FONT + i].height;
+ font_bitmap_info[i].draw_x = graphic_info[FIRST_IMG_FONT + i].draw_x;
+ font_bitmap_info[i].draw_y = graphic_info[FIRST_IMG_FONT + i].draw_y;
}
}
- InitFontInfo(font_info, num_fonts);
+ InitFontInfo(font_bitmap_info, num_fonts);
}
void InitElementGraphicInfo()
struct VideoSystemInfo video;
struct AudioSystemInfo audio;
struct GfxInfo gfx;
-struct AnimInfo anim;
struct ArtworkInfo artwork;
struct JoystickInfo joystick;
struct SetupInfo setup;
int first_sound_channel;
};
-struct FontInfo
+struct FontBitmapInfo
{
Bitmap *bitmap;
int src_x, src_y; /* start position of animation frames */
boolean menu_main_hide_static_text;
int num_fonts;
- struct FontInfo *font;
-};
+ struct FontBitmapInfo *font;
-struct AnimInfo
-{
- int random_frame;
+ int anim_random_frame;
};
struct JoystickInfo
}
#endif /* TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND */
-void InitFontInfo(struct FontInfo *font_info, int num_fonts)
+void InitFontInfo(struct FontBitmapInfo *font_info, int num_fonts)
{
gfx.num_fonts = num_fonts;
gfx.font = font_info;
void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text,
int font_nr, int mask_mode)
{
- struct FontInfo *font = &gfx.font[font_nr];
+ struct FontBitmapInfo *font = &gfx.font[font_nr];
boolean print_inverse = FALSE;
if (font->bitmap == NULL)
/* font structure definitions */
-#if 1
-void InitFontInfo(struct FontInfo *, int);
+void InitFontInfo(struct FontBitmapInfo *, int);
int getFontWidth(int);
int getFontHeight(int);
void DrawInitText(char *, int, int);
void DrawTextFCentered(int, int, char *, ...);
void DrawText(int, int, char *, int);
void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
-#else
-void InitFontInfo(Bitmap *, Bitmap *, Bitmap *, Bitmap *, Bitmap *);
-int getFontWidth(int, int);
-int getFontHeight(int, int);
-void DrawInitText(char *, int, int);
-void DrawTextF(int, int, int, char *, ...);
-void DrawTextFCentered(int, int, char *, ...);
-void DrawText(int, int, char *, int, int);
-void DrawTextExt(DrawBuffer *, int, int, char *, int, int, int);
-#endif
#endif /* TEXT_H */
{
/* note: expect different frames for the same delay cycle! */
- if (anim.random_frame < 0)
+ if (gfx.anim_random_frame < 0)
frame = SimpleRND(num_frames);
else
- frame = anim.random_frame % num_frames;
+ frame = gfx.anim_random_frame % num_frames;
}
if (mode & ANIM_REVERSE) /* use reverse animation direction */
int graphic[NUM_ACTIONS]; /* default graphics for several actions */
- /* special graphics for left/right/up/down */
int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
+ /* special graphics for left/right/up/down */
- /* special graphics for certain screens */
int special_graphic[NUM_SPECIAL_GFX_ARGS];
+ /* special graphics for certain screens */
int editor_graphic; /* graphic displayed in level editor */
int preview_graphic; /* graphic displayed in level preview */
int sound[NUM_ACTIONS]; /* default sounds for several actions */
};
+#if 0
+struct FontInfo
+{
+ int graphic; /* default graphic for this font */
+
+ int special_graphic[NUM_SPECIAL_GFX_ARGS];
+ /* special graphics for certain screens */
+};
+#endif
+
struct GraphicInfo
{
Bitmap *bitmap;
void SetRandomAnimationValue(int x, int y)
{
- anim.random_frame = GfxRandom[x][y];
+ gfx.anim_random_frame = GfxRandom[x][y];
}
inline int getGraphicAnimationFrame(int graphic, int sync_frame)