AUI_ERRCODE spnewgamerandomcustomscreen_Cleanup()
{
#define mycleanup(mypointer) if(mypointer) { delete mypointer; mypointer = NULL; };

	if ( !s_spNewGameRandomCustomScreen  ) return AUI_ERRCODE_OK;

	g_c3ui->RemoveWindow( s_spNewGameRandomCustomScreen->Id() );
	keypress_RemoveHandler(s_spNewGameRandomCustomScreen);

	for (sint32 i = 0;i < k_NUM_RANDOMCUSTOMBOXES;i++ ) {
		mycleanup( s_checkBox[i] );
	}

	mycleanup( s_group );




	delete s_spNewGameRandomCustomScreen;
	s_spNewGameRandomCustomScreen = NULL;

	return AUI_ERRCODE_OK;

#undef mycleanup
}
Пример #2
0
void graphicsscreen_Cleanup()
{
	if (g_c3ui && s_graphicsWindow)
    {
    	g_c3ui->RemoveWindow(s_graphicsWindow->Id());
	    keypress_RemoveHandler(s_graphicsWindow);
    }

#define mycleanup(mypointer) { delete mypointer; mypointer = NULL; };
	mycleanup(s_walk);
	mycleanup(s_trade);
	mycleanup(s_wonder);
	mycleanup(s_cityInfluence);
	mycleanup(s_grid);
	mycleanup(s_politicalBorders);
	mycleanup(s_tradeRoutes);
	mycleanup(s_cityNames);
	mycleanup(s_resScreenButton);
	mycleanup(s_unitSpeed);
	mycleanup(s_unitSpeedN);
	mycleanup(s_graphicsWindow);
	mycleanup(s_armyNames);
	mycleanup(s_civflags);
	mycleanup(s_smooth);
	mycleanup(s_goodAnims);
	mycleanup(s_cityProd);
#undef mycleanup
}
sint32 spnewgamemapsizescreen_removeMyWindow(uint32 action)
{
	if ( action != (uint32)AUI_BUTTON_ACTION_EXECUTE ) return 0;

	uint32 id = s_group->WhichIsSelected();

	if ( id ) {
		for ( sint32 i = 0;i < k_NUM_MAPSIZEBOXES;i ++ ) {
			if ( id == s_checkBox[i]->Id() ) {
				spnewgamemapsizescreen_setMapSizeIndex( i );
			}
		}
	}

	AUI_ERRCODE auiErr;

	auiErr = g_c3ui->RemoveWindow( s_spNewGameMapSizeScreen->Id() );
	keypress_RemoveHandler(s_spNewGameMapSizeScreen);

	Assert( auiErr == AUI_ERRCODE_OK );

	if ( s_useMode == 1 ) {
		spnewgamemapshapescreen_displayMyWindow( FALSE, 1 );
	}

	spnewgamescreen_update();

	return 1;
}
Пример #4
0
sint32 graphicsscreen_removeMyWindow(uint32 action)
{
	if ( action != (uint32)AUI_BUTTON_ACTION_EXECUTE ) return 0;

	AUI_ERRCODE auiErr = g_c3ui->RemoveWindow( s_graphicsWindow->Id() );
	Assert( auiErr == AUI_ERRCODE_OK );
	keypress_RemoveHandler(s_graphicsWindow);

	return 1;
}
sint32 spnewgamerandomcustomscreen_removeMyWindow(uint32 action)
{
	if ( action != (uint32)AUI_BUTTON_ACTION_EXECUTE ) return 0;

	AUI_ERRCODE auiErr;

	auiErr = g_c3ui->RemoveWindow( s_spNewGameRandomCustomScreen->Id() );
	keypress_RemoveHandler(s_spNewGameRandomCustomScreen);

	Assert( auiErr == AUI_ERRCODE_OK );

	return 1;
}
Пример #6
0
void loadsavescreen_Cleanup()
{
	if (g_loadsaveWindow)
    {
        if (g_c3ui)
        {
	        g_c3ui->RemoveWindow(g_loadsaveWindow->Id());
        }
	    keypress_RemoveHandler(g_loadsaveWindow);

        allocated::clear(g_loadsaveWindow);
    }
}
Пример #7
0
sint32 spnewgamediffscreen_removeMyWindow(uint32 action)
{
	if ( action != (uint32)AUI_BUTTON_ACTION_EXECUTE ) return 0;

	spnewgamediffscreen_setDifficulty1(s_diffListBox->GetSelectedItemIndex());
	spnewgamediffscreen_setDifficulty2(s_riskListBox->GetSelectedItemIndex());

	AUI_ERRCODE auiErr = g_c3ui->RemoveWindow( s_spNewGameDiffScreen->Id() );
	keypress_RemoveHandler(s_spNewGameDiffScreen);

	Assert( auiErr == AUI_ERRCODE_OK );

	spnewgamescreen_update();

	return 1;
}
Пример #8
0
//----------------------------------------------------------------------------
//
// Name       : spnewgamediffscreen_Cleanup
//
// Description: Release the memory of the screen.
//
// Parameters : -
//
// Globals    : s_spNewGameDiffScreen
//              s_barbarianThreat
//              s_riskBox
//              s_skillLevel
//              s_diffListBox
//              s_riskListBox
//
// Returns    : AUI_ERRCODE : always AUI_ERRCODE_OK
//
// Remark(s)  : -
//
//----------------------------------------------------------------------------
AUI_ERRCODE spnewgamediffscreen_Cleanup()
{
	if (s_spNewGameDiffScreen)
	{
		g_c3ui->RemoveWindow(s_spNewGameDiffScreen->Id());
		keypress_RemoveHandler(s_spNewGameDiffScreen);

#define mycleanup(mypointer) { delete mypointer; mypointer = NULL; }
		mycleanup(s_diffListBox);
		mycleanup(s_riskListBox);
		mycleanup(s_skillLevel);
		mycleanup(s_barbarianThreat);
		mycleanup(s_spNewGameDiffScreen);
#undef mycleanup
	}

	return AUI_ERRCODE_OK;
}
AUI_ERRCODE spnewgamemapsizescreen_Cleanup()
{
	if (s_spNewGameMapSizeScreen)
	{
		g_c3ui->RemoveWindow(s_spNewGameMapSizeScreen->Id());
		keypress_RemoveHandler(s_spNewGameMapSizeScreen);

		for (sint32 i = 0; i < k_NUM_MAPSIZEBOXES; ++i)
		{
			delete s_checkBox[i];
			// NULLing unnecessary: deleting container next
		}
		delete [] s_checkBox;
		s_checkBox = NULL;

#define mycleanup(mypointer) { delete mypointer; mypointer = NULL; }
		mycleanup(s_group);
		mycleanup(s_spNewGameMapSizeScreen);
#undef mycleanup
	}

	return AUI_ERRCODE_OK;
}