I was trying to complile lander 2.5 but I get the following error. I don\'t know
ID: 3654880 • Letter: I
Question
I was trying to complile lander 2.5 but I get the following error. I don't know what to do. Can somebody explain me how to fix it. I am using codeblocks and DUMB library for music. Thanks
THIS IS JUST PART OF THE CODE. I THINK THE ERROR IS THERE( Chegg is not letting post full code)
int main (int argc, char *argv[])
{
allegro_init();
atexit (&dumb_exit);
dumb_register_stdfiles ();
install_keyboard();
install_mouse();
install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL);
// Determine what sort of screen we're displaying this on
get_video_info();
// Read configuration file
//set_config_file("lander.ini");
//int fullscreen = get_config_int("window","fullscreen",FALSE);
// load the config settings
config = new Configuration();
config_backup = config;
Logfile::log("config is at address 0x%x. ", config);
config->setFullscreen(setup_screen(config->isFullscreen()?TRUE:FALSE));
set_window_title("Lander! v" VERSION_STRING);
//set_close_button_callback
Logfile::log("Initializing DUMB. ");
atexit(&dumb_exit);
dumb_register_dat_s3m_quick(DUMB_DAT_S3M);
// Load data file -- I finally got rid of that dumb password
packfile_password(NULL);
data_idx = create_datafile_index("lander.dat");
if(!data_idx)
{
allegro_exit();
allegro_message("Error loading datafile! Please reinstall the software.");
exit(1);
}
set_color_conversion(COLORCONV_EXPAND_256 | COLORCONV_KEEP_TRANS);
// Is there a better way to load data files without having to manually
// convert all 8-bit bitmaps? I suppose not, as we need to know the palettes.
//
// Then again, if I loaded it into memory as an 8-bit image and applied the
// palette at drawing time, it would save memory. But it requires extra
// processing. Hmmm.
// Level backgrounds
int i;
for(i=0; i<9; i++) {
data[P_1 + i] = load_datafile_object_indexed(data_idx, P_1 + i);
set_palette((RGB*)data[P_1 + i]->dat);
data[B_BG_1 + i] = load_datafile_object_indexed(data_idx, B_BG_1 + i);
}
// Company logo
data[P_COMPANY_LOGO] = load_datafile_object_indexed(data_idx, P_COMPANY_LOGO);
set_palette((RGB*)data[P_COMPANY_LOGO]->dat);
data[B_COMPANY_LOGO] = load_datafile_object_indexed(data_idx, B_COMPANY_LOGO);
// Standard palette bitmaps
data[P_STD] = load_datafile_object_indexed(data_idx, P_STD);
set_palette((RGB*)data[P_STD]->dat);
data[B_ADVANCE] = load_datafile_object_indexed(data_idx, B_ADVANCE);
data[B_ARROW] = load_datafile_object_indexed(data_idx, B_ARROW);
data[B_LANDER] = load_datafile_object_indexed(data_idx, B_LANDER);
// Titlescreen
data[P_TITLESCREEN] = load_datafile_object_indexed(data_idx, P_TITLESCREEN);
set_palette_range((RGB*)data[P_TITLESCREEN]->dat,0,223,TRUE);
data[B_TITLE_LANDER] = load_datafile_object_indexed(data_idx, B_TITLE_LANDER);
set_palette((RGB*)data[P_TITLESCREEN]->dat);
data[B_TITLESCREEN] = load_datafile_object_indexed(data_idx, B_TITLESCREEN);
// Brand
data[P_BRAND] = load_datafile_object_indexed(data_idx, P_BRAND);
set_palette((RGB*)data[P_BRAND]->dat);
data[B_BRAND] = load_datafile_object_indexed(data_idx, B_BRAND);
// Labels
data[P_LABEL] = load_datafile_object_indexed(data_idx, P_LABEL);
set_palette((RGB*)data[P_LABEL]->dat);
data[B_LABEL2] = load_datafile_object_indexed(data_idx, B_LABEL2);
data[B_LABEL5] = load_datafile_object_indexed(data_idx, B_LABEL5);
data[B_LABEL10] = load_datafile_object_indexed(data_idx, B_LABEL10);
// The fonts and extra stuff
data[F_HUGE_0] = load_datafile_object_indexed(data_idx, F_HUGE_0);
data[F_SMALL_0] = load_datafile_object_indexed(data_idx, F_SMALL_0);
data[P_FLAMES] = load_datafile_object_indexed(data_idx, P_FLAMES);
// Load all samples
data[S_ROCKET] = load_datafile_object_indexed(data_idx, S_ROCKET);
data[S_SCORE] = load_datafile_object_indexed(data_idx, S_SCORE);
data[S_CRASH] = load_datafile_object_indexed(data_idx, S_CRASH);
// Once upon a time I thought it was a good idea to keep the entire
// game loop in a constructor. Dumb idea in hindsight.
TheGame *game = new TheGame(0);
if(game) delete game;
Logfile::log("config points to: 0x%x. ", config);
if(config) {
delete config;
config = 0;
}
flush_config_file();
for(i=0; i<NUM_DATA_ELEMENTS; i++) if(data[i]) unload_datafile_object(data[i]);
return 0;
}
END_OF_MAIN();
Explanation / Answer
such a complex question,difficult to solve
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.