Beispiel #1
0
void Tutor::deinit()
{
	if( init_flag )
	{
		mem_del(tutor_info_array);
      tutor_info_array = NULL;

		mem_del(text_block_array);
		text_block_array = NULL;

		if( tutor_text_buf )
		{
			mem_del(tutor_text_buf);
			tutor_text_buf = NULL;
		}

		if( tutor_intro_buf )
		{
			mem_del(tutor_intro_buf);
			tutor_intro_buf = NULL;
		}

		res_tutor_text.deinit();
		res_tutor_intro.deinit();

		init_flag=0;
	}
}
Beispiel #2
0
void HillRes::deinit()
{
	if( init_flag )
	{
		mem_del(first_block_index);
		mem_del(hill_block_info_array);
		init_flag=0;
	}
}
Beispiel #3
0
// ------- Begin of function SnowRes::deinit ------//
void SnowRes::deinit()
{
	if( init_flag )
	{
		mem_del( snow_info_array );
		mem_del( root_info_array );
		init_flag = 0;
	}
}
Beispiel #4
0
void WallRes::deinit()
{
	if( init_flag )
	{
		mem_del(wall_info_array);
		mem_del(wall_index);
		init_flag=0;
	}
}
Beispiel #5
0
//---------- Begin of function Database::close -------//
//!
//! Database::close()
//!
void Database::close() {
    if( rec_buf ) {
	mem_del(rec_buf);
	rec_buf = NULL;
    }

    if( dbf_buf && dbf_buf_allocated ) {
	mem_del( dbf_buf );
	dbf_buf = NULL;
    }
}
Beispiel #6
0
void RaceRes::deinit()
{
	if( init_flag )
	{
		mem_del(race_info_array);
		mem_del(name_array);
		mem_del(name_used_array);

		init_flag=0;
	}
}
Beispiel #7
0
void FirmDieRes::deinit()
{
	if(init_flag)
	{
		mem_del(firm_build_array);
		mem_del(firm_bitmap_array);

		res_bitmap.deinit();

		init_flag = 0;
	}
}
Beispiel #8
0
Jpeg::~Jpeg()
{
	// Step 8: Release JPEG decompression object
	// This is an important step since it will release a good deal of memory

	if( !error_flag )
		jpeg_destroy_decompress(cinfo);
	else
		jpeg_abort_decompress(cinfo);

	mem_del(jerr);
	mem_del(cinfo);
}
Beispiel #9
0
void Help::deinit()
{
   if( help_info_array )
   {
		mem_del( help_info_array );
		help_info_array = NULL;
   }

	if( help_text_buf )
	{
		mem_del( help_text_buf );
		help_text_buf = NULL;
	}
}
Beispiel #10
0
OptionMenu::~OptionMenu()
{
	if( color_remap_table )
	{
		mem_del( color_remap_table );
		color_remap_table = NULL;
	}

	if( background_bitmap )
	{
		mem_del( background_bitmap );
		background_bitmap = NULL;
	}
}
Beispiel #11
0
// Ho ## 1127
// for purpose of transparency buttons
//----------- Begin of function Button::~Button -----------//
//!
void Button::deinit() {
    if(button_bk_bitmap!=NULL) {
	mem_del(button_bk_bitmap);
	button_bk_bitmap=NULL;
    }
    if(button_up_bitmap!=NULL) {
	mem_del(button_up_bitmap);
	button_up_bitmap=NULL;
    }
    if(button_dn_bitmap!=NULL) {
	mem_del(button_dn_bitmap);
	button_dn_bitmap=NULL;
    }
}
Beispiel #12
0
void Help::deinit() {
    long_save_buf.deinit();
    short_front_buf.deinit();
    short_back_buf.deinit();

    if( help_info_array ) {
	mem_del( help_info_array );
	help_info_array = NULL;
    }

    if( help_text_buf ) {
	mem_del( help_text_buf );
	help_text_buf = NULL;
    }
}
Beispiel #13
0
//---------- Begin of function TerrainRes::deinit -----------//
void TerrainRes::deinit()
{
	if( init_flag )
	{
		for( int i = terrain_count-1; i >= 0; --i)
		{
			if( terrain_info_array[i].anim_frames > 0 )
				mem_del(terrain_info_array[i].anim_bitmap_ptr);
		}
		mem_del(terrain_info_array);
		mem_del(ter_sub_array);
		mem_del(ter_sub_index);
		init_flag=0;
	}
}
Beispiel #14
0
// ------------ begin of function RockRes::deinit -----------//
void RockRes::deinit()
{
	if(init_flag)
	{
		mem_del(rock_info_array);
		mem_del(rock_bitmap_array);
		rock_info_count = 0;
		rock_bitmap_count = 0;

		res_pal.deinit();
		res_bitmap.deinit();

		init_flag = 0;
	}
}
Beispiel #15
0
FirmBuild::~FirmBuild()
{
	res_bitmap.deinit();
	if (palw_ptr)
		mem_del(palw_ptr);
	palw_ptr = NULL;
}
Beispiel #16
0
// ----- begin of function WorldScanTraverser::~WorldScanTraverser -------//
//
WorldScanTraverser::~WorldScanTraverser()
{
	if( unit_recno_array != default_recno_array )
	{
		mem_del(unit_recno_array);
	}
}
Beispiel #17
0
//-------- begin of function StateArray::deinit ----------//
//
void StateArray::deinit()
{
	if(init_flag)
	{
		mem_del(loc_matrix);
		loc_matrix = NULL;

		if( state_info_array )
		{
			mem_del( state_info_array );
			state_info_array = NULL;
		}

		init_flag = 0;
	}
}
Beispiel #18
0
//----------- Start of function Font::deinit ---------//
//
void Font::deinit()
{
	if( font_info_array )
	{
		mem_del( font_info_array );
		font_info_array = NULL;
	}

	if( font_bitmap_buf )
	{
		mem_del( font_bitmap_buf );
		font_bitmap_buf = NULL;
	}

	init_flag = 0;
}
Beispiel #19
0
void sarm_del (simarm_t *sim)
{
	if (sim == NULL) {
		return;
	}

	pci_ata_free (&sim->pciata);
	pci_ixp_del (sim->pci);

	dsks_del (sim->dsks);

	ser_del (sim->serport[1]);
	ser_del (sim->serport[0]);

	tmr_del (sim->timer);
	ict_del (sim->intc);

	arm_del (sim->cpu);

	mem_del (sim->mem);

	bps_free (&sim->bps);

	free (sim);
}
Beispiel #20
0
//-------- Begin of function SeekPathReuse::is_leader_path_valid ---------//
// return 1 leader path is valid
// return 0 otherwise
//
int SeekPathReuse::is_leader_path_valid()
{
	if(leader_path_num<0 || reuse_leader_path_node_num<2)
	{
		//---------------------------------------------------------------//
		// if no leader path of if the number of node in the leader path < 2.
		// A new one will be chosed to be the leader-path.
		//---------------------------------------------------------------//
		if(reuse_leader_path_backup!=NULL)
		{
			mem_del(reuse_leader_path_backup);
			reuse_leader_path_backup = NULL;
		}

		err_when(reuse_leader_path_backup!=NULL);

		//start_x_offset	= start_y_offset = dest_x_offset = dest_y_offset = 0;
		leader_path_start_x = start_x;
		leader_path_start_y = start_y;
		leader_path_dest_x = dest_x;
		leader_path_dest_y = dest_y;

		leader_path_num = cur_path_num;	// set leader path number
		if(is_node_avail_empty())
		{
			incomplete_search++;
			reuse_path_status = REUSE_PATH_INCOMPLETE_SEARCH;
			return 0;
		}

		path_reuse_result_node_ptr = call_seek(start_x, start_y, vir_dest_x, vir_dest_y, cur_group_id, mobile_type,
															SEARCH_MODE_IN_A_GROUP, num_of_result_node);

		//------------------------------------------------------------------------//
		// checking for incomplete searching
		//------------------------------------------------------------------------//
		if(!path_reuse_result_node_ptr || !num_of_result_node)
		{
			incomplete_search = 1;
			reuse_path_status = REUSE_PATH_INCOMPLETE_SEARCH;
			return 0;
		}

		err_when(!path_reuse_result_node_ptr || !num_of_result_node);
		ResultNode *lastNodePtr = path_reuse_result_node_ptr + num_of_result_node - 1;
		if(lastNodePtr->node_x!=vir_dest_x || lastNodePtr->node_y!=vir_dest_y)
		{
			err_when(unit_size!=1);
			if(seek_path.path_status==PATH_NODE_USED_UP)
			{
				incomplete_search++;
				reuse_path_status = REUSE_PATH_INCOMPLETE_SEARCH;
			}
		}

		return 0;
	}

	return 1;
}
Beispiel #21
0
void OptionMenu::clear_active()
{
	if( background_bitmap )
	{
		mem_del( background_bitmap );
		background_bitmap = NULL;
	}

	if( color_remap_table )
	{
		mem_del( color_remap_table );
		color_remap_table = NULL;
	}

	active_flag = 0;
}
Beispiel #22
0
//-------- Begin of function TxtList::deinit -------//
//!
void TxtList::deinit() {
    res_txt .deinit();

    res_pict.deinit();
    if(txtlist_refresh_bitmap)
	mem_del(txtlist_refresh_bitmap);
    txtlist_refresh_bitmap=NULL;
}
Beispiel #23
0
//-------- Begin of function PieChart::deinit ------------//
//!
void PieChart::deinit() {
    if (piechart_bitmap) {
	mem_del(piechart_bitmap);
	piechart_bitmap = NULL;
    }

    init_flag = 0;
}
Beispiel #24
0
// ---------- begin of function ColorTable::deinit ----------//
void ColorTable::deinit()
{
	if( remap_table )
	{
		mem_del( remap_table );
		remap_table = NULL;
	}
}
Beispiel #25
0
//-------- Begin of function Info::deinit --------//
//
void Info::deinit()
{
	if( info_background_bitmap )
	{
		mem_del( info_background_bitmap );
		info_background_bitmap = NULL;
	}
}
Beispiel #26
0
//------- Begin of function Crime::deinit ---------------//
//!
void Crime::deinit() {
    crime_index.deinit();
    financial_spinner_budget1.deinit();
    financial_button_group.deinit_buttons();

    for( int i = 0; i < 3; ++i ) {
	if( financial_button_up_bitmap[i] ) {
	    mem_del(financial_button_up_bitmap[i]);
	    financial_button_up_bitmap[i] = NULL;
	}
	if( financial_button_down_bitmap[i] ) {
	    mem_del(financial_button_down_bitmap[i]);
	    financial_button_down_bitmap[i] = NULL;
	}
    }
    crime_init_flag = 0;
}
Beispiel #27
0
// ------ begin of function SerialRepository::deinit --------//
//
void SerialRepository::deinit()
{
	if( history_array )
	{
		mem_del(history_array);
		history_array = NULL;
	}
}
Beispiel #28
0
//-------- Begin of function Remote::free_msg ---------//
//
// Free a RemoteMsg previously allocated by remote_msg().
//
// Data structure:
//
// <short> size of RemoteMsg + <RemoteMsg> RemoteMsg body
// ^                           ^
// | Allocate starts here      | return variable here to the client function
//
void Remote::free_msg(RemoteMsg* remoteMsgPtr)
{
   char* memPtr = (char *)remoteMsgPtr - sizeof(short);
	// include size of message, sizeof MPMSG_FREE_MSG

   if( memPtr != common_msg_buf )      // the real allocation block start 2 bytes before remoteMsgPtr
      mem_del( memPtr );
}
Beispiel #29
0
void MonsterRes::deinit()
{
   if( init_flag )
   {
      mem_del(monster_info_array);
      init_flag=0;
   }
}
Beispiel #30
0
void GameSet::deinit()
{
	if( init_flag )
	{
		mem_del(set_info_array);

		init_flag = 0;
	}
}