From b940ca0510cef9aa5b96cf46fcf35c6a437dfa5a Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 28 Feb 2015 19:36:01 +0000 Subject: [PATCH] Use array<> for bogus_data --- common/main/piggy.h | 2 +- similar/main/dumpmine.cpp | 2 +- similar/main/piggy.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/main/piggy.h b/common/main/piggy.h index aecd58cf4..294c25cb1 100644 --- a/common/main/piggy.h +++ b/common/main/piggy.h @@ -82,7 +82,7 @@ extern int PCSharePig; extern grs_bitmap bogus_bitmap; #endif -extern ubyte bogus_data[64 * 64]; +extern array bogus_data; int properties_init(); void piggy_close(); diff --git a/similar/main/dumpmine.cpp b/similar/main/dumpmine.cpp index cee0725d0..d1fede731 100644 --- a/similar/main/dumpmine.cpp +++ b/similar/main/dumpmine.cpp @@ -918,7 +918,7 @@ static void say_unused_tmaps(PHYSFS_file *my_file, int *tb) #endif for (i=0; i < bound; i++) if (!tb[i]) { - if (GameBitmaps[Textures[i].index].bm_data == bogus_data) + if (GameBitmaps[Textures[i].index].bm_data == bogus_data.data()) PHYSFSX_printf(my_file, "U"); else PHYSFSX_printf(my_file, " "); diff --git a/similar/main/piggy.cpp b/similar/main/piggy.cpp index da2136f9f..b8e7bb884 100644 --- a/similar/main/piggy.cpp +++ b/similar/main/piggy.cpp @@ -146,8 +146,8 @@ int piggy_page_flushed = 0; static RAIIPHYSFS_File Piggy_fp; -ubyte bogus_data[64*64]; ubyte bogus_bitmap_initialized=0; +array bogus_data; digi_sound bogus_sound; #if defined(DXX_BUILD_DESCENT_I) @@ -442,21 +442,21 @@ int properties_init() ubyte c; bogus_bitmap_initialized = 1; c = gr_find_closest_color( 0, 0, 63 ); - for (i=0; i<4096; i++ ) bogus_data[i] = c; + bogus_data.fill(c); c = gr_find_closest_color( 63, 0, 0 ); // Make a big red X ! for (i=0; i<64; i++ ) { bogus_data[i*64+i] = c; bogus_data[i*64+(63-i)] = c; } - gr_init_bitmap(bogus_bitmap, 0, 0, 0, 64, 64, 64, bogus_data); + gr_init_bitmap(bogus_bitmap, 0, 0, 0, 64, 64, 64, bogus_data.data()); piggy_register_bitmap( &bogus_bitmap, "bogus", 1 ); #ifdef ALLEGRO bogus_sound.len = 64*64; #else bogus_sound.length = 64*64; #endif - bogus_sound.data = bogus_data; + bogus_sound.data = bogus_data.data(); //added on 11/13/99 by Victor Rachels to ready for changing freq bogus_sound.freq = 11025; bogus_sound.bits = 8; @@ -1124,17 +1124,17 @@ int properties_init(void) bogus_bitmap_initialized = 1; c = gr_find_closest_color( 0, 0, 63 ); - for (i=0; i<4096; i++ ) bogus_data[i] = c; + bogus_data.fill(c); c = gr_find_closest_color( 63, 0, 0 ); // Make a big red X ! for (i=0; i<64; i++ ) { bogus_data[i*64+i] = c; bogus_data[i*64+(63-i)] = c; } - gr_init_bitmap(GameBitmaps[Num_bitmap_files], 0, 0, 0, 64, 64, 64, bogus_data); + gr_init_bitmap(GameBitmaps[Num_bitmap_files], 0, 0, 0, 64, 64, 64, bogus_data.data()); piggy_register_bitmap(&GameBitmaps[Num_bitmap_files], "bogus", 1); bogus_sound.length = 64*64; - bogus_sound.data = bogus_data; + bogus_sound.data = bogus_data.data(); GameBitmapOffset[0] = 0; }