Initialize grs_main_bitmap at construction
This commit is contained in:
parent
fc12995d89
commit
8c706a88bd
|
@ -222,7 +222,10 @@ struct grs_subcanvas : grs_canvas {};
|
|||
class grs_main_bitmap : public grs_bitmap
|
||||
{
|
||||
public:
|
||||
grs_main_bitmap() = default;
|
||||
grs_main_bitmap()
|
||||
{
|
||||
gr_init_bitmap_data(*this);
|
||||
}
|
||||
grs_main_bitmap(const grs_main_bitmap &) = delete;
|
||||
grs_main_bitmap &operator=(const grs_main_bitmap &) = delete;
|
||||
grs_main_bitmap(grs_main_bitmap &&r) :
|
||||
|
|
|
@ -1037,7 +1037,6 @@ void do_automap()
|
|||
|
||||
// ZICO - code from above to show frame in OGL correctly. Redundant, but better readable.
|
||||
// KREATOR - Now applies to all platforms so double buffering is supported
|
||||
gr_init_bitmap_data(am->automap_background);
|
||||
pcx_error = pcx_read_bitmap(MAP_BACKGROUND_FILENAME, am->automap_background, pal);
|
||||
if (pcx_error != PCX_ERROR_NONE)
|
||||
Error("File %s - PCX error: %s", MAP_BACKGROUND_FILENAME, pcx_errormsg(pcx_error));
|
||||
|
|
|
@ -1033,11 +1033,10 @@ static int draw_endlevel_background(newmenu *,const d_event &event, grs_bitmap *
|
|||
static void do_screen_message(const char *msg) __attribute_nonnull();
|
||||
static void do_screen_message(const char *msg)
|
||||
{
|
||||
grs_main_bitmap background;
|
||||
|
||||
if (Game_mode & GM_MULTI)
|
||||
return;
|
||||
gr_init_bitmap_data(background);
|
||||
grs_main_bitmap background;
|
||||
if (pcx_read_bitmap(GLITZ_BACKGROUND, background, gr_palette) != PCX_ERROR_NONE)
|
||||
return;
|
||||
|
||||
|
|
|
@ -945,7 +945,6 @@ int iff_read_animbrush(const char *ifilename,array<std::unique_ptr<grs_main_bitm
|
|||
|
||||
auto &n = bm_list[*n_bitmaps];
|
||||
n = make_unique<grs_main_bitmap>();
|
||||
gr_init_bitmap_data(*n.get());
|
||||
|
||||
ret = iff_parse_bitmap(ifile, *n.get(), form_type, *n_bitmaps > 0 ? nullptr : &palette, prev_bm);
|
||||
|
||||
|
|
|
@ -385,7 +385,6 @@ static window_event_result kmatrix_handler(window *, const d_event &event, kmatr
|
|||
kmatrix_result kmatrix_view(int network)
|
||||
{
|
||||
kmatrix_screen km;
|
||||
gr_init_bitmap_data(km.background);
|
||||
if (pcx_read_bitmap(STARS_BACKGROUND, km.background, gr_palette) != PCX_ERROR_NONE)
|
||||
{
|
||||
return kmatrix_result::abort;
|
||||
|
|
|
@ -172,7 +172,6 @@ static void show_title_screen(const char * filename, int allow_keys, int from_ho
|
|||
|
||||
strcat(new_filename,filename);
|
||||
filename = new_filename;
|
||||
gr_init_bitmap_data(ts->title_bm);
|
||||
if ((pcx_error=pcx_read_bitmap( filename, ts->title_bm, gr_palette ))!=PCX_ERROR_NONE) {
|
||||
Error( "Error loading briefing screen <%s>, PCX load error: %s (%i)\n",filename, pcx_errormsg(pcx_error), pcx_error);
|
||||
}
|
||||
|
@ -511,7 +510,6 @@ static void briefing_init(briefing *br, short level_num)
|
|||
br->level_num = 0; // for start of game stuff
|
||||
|
||||
br->cur_screen = 0;
|
||||
gr_init_bitmap_data(br->background);
|
||||
strncpy(br->background_name, DEFAULT_BRIEFING_BKG, sizeof(br->background_name));
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
br->robot_playing = 0;
|
||||
|
|
Loading…
Reference in a new issue