{ "graphic_7", UNDEFINED_FILENAME },
{ "graphic_8", UNDEFINED_FILENAME },
+ // game graphics template for level-specific colors for native BD levels
+ { "bd_game_graphics_color_template", UNDEFINED_FILENAME },
+
#include "conf_chr.c" // include auto-generated data structure definitions
#include "conf_cus.c" // include auto-generated data structure definitions
#include "conf_grp.c" // include auto-generated data structure definitions
// graphic info for game objects/frames and players/actions/frames
struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8];
+// graphic info for game graphics template for level-specific colors
+struct GraphicInfo_BD graphic_info_bd_color_template;
static inline int c64_png_colors(int r, int g, int b, int a)
{
extern struct GameInfo_BD game_bd;
extern struct LevelInfo_BD native_bd_level;
extern struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8];
+extern struct GraphicInfo_BD graphic_info_bd_color_template;
extern struct EngineSnapshotInfo_BD engine_snapshot_bd;
void bd_open_all(void);
static void PrepareGameTileBitmap_BD(void)
{
- struct GraphicInfo_BD *g = &graphic_info_bd_object[O_STONE][0];
+ struct GraphicInfo_BD *g_template = &graphic_info_bd_color_template;
+ struct GraphicInfo_BD *g_default = &graphic_info_bd_object[O_STONE][0];
- gd_prepare_tile_bitmap(native_bd_level.cave, g->bitmap, 1);
+ gd_prepare_tile_bitmap(native_bd_level.cave, g_template->bitmap, 1);
+ gd_set_tile_bitmap_reference(g_default->bitmap);
}
void PreparePreviewTileBitmap_BD(Bitmap *bitmap, int scale_down_factor)
"graphic",
"-"
},
+ {
+ "bd_game_graphics_color_template",
+ "-",
+ "-"
+ },
{
"internal_clipboard_custom",
"internal",
#define EL_GRAPHIC_6 (EL_FIRST_DUMMY + 34)
#define EL_GRAPHIC_7 (EL_FIRST_DUMMY + 35)
#define EL_GRAPHIC_8 (EL_FIRST_DUMMY + 36)
+#define EL_BD_GAME_GRAPHICS_COLOR_TEMPLATE (EL_FIRST_DUMMY + 37)
// internal elements (only used for internal purposes like copying)
-#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 37)
+#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 38)
#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0)
#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1)
int scale_down_factor = original_tilesize / preview.tile_size;
Bitmap *src_bitmap;
int src_x, src_y;
- int element = EL_BD_ROCK;
- int graphic = el2preimg(element);
+ int element_template = EL_BD_GAME_GRAPHICS_COLOR_TEMPLATE;
+ int graphic_template = el2preimg(element_template);
+ int element_default = EL_BD_ROCK;
+ int graphic_default = el2preimg(element_default);
// create special preview bitmap and scale it down to preview tile size
- getSizedGraphicSource(graphic, 0, original_tilesize, &src_bitmap, &src_x, &src_y);
+ getSizedGraphicSource(graphic_template, 0, original_tilesize, &src_bitmap, &src_x, &src_y);
PreparePreviewTileBitmap_BD(src_bitmap, scale_down_factor);
// force using special preview bitmap to replace original preview bitmap
- getSizedGraphicSource(graphic, 0, preview.tile_size, &src_bitmap, &src_x, &src_y);
+ getSizedGraphicSource(graphic_default, 0, preview.tile_size, &src_bitmap, &src_x, &src_y);
SetPreviewTileBitmapReference_BD(src_bitmap);
}
g_bd->height = TILEY;
}
}
+
+ // game graphics template for level-specific colors for native BD levels
+ int graphic = IMG_BD_GAME_GRAPHICS_COLOR_TEMPLATE;
+ struct GraphicInfo_BD *g_bd = &graphic_info_bd_color_template;
+ Bitmap *src_bitmap;
+ int src_x, src_y;
+
+ getGraphicSourceExt(graphic, 0, &src_bitmap, &src_x, &src_y, FALSE);
+
+ g_bd->bitmap = src_bitmap;
+ g_bd->src_x = src_x;
+ g_bd->src_y = src_y;
+ g_bd->width = TILEX;
+ g_bd->height = TILEY;
}
void InitGraphicInfo_EM(void)