/*----------------------------------------------------------------------------- Name : spStartup Description : Inputs : Outputs : Registers some callbacks for buttons and user regions. Return : ----------------------------------------------------------------------------*/ void spStartup(void) { feDrawCallbackAddMultiple(spDrawCallbacks); spListFont = frFontRegister(SCP_ListFont); spNameFont = frFontRegister(SCP_NameFont); spScenarios = memAlloc(spScenarioListLength * sizeof(spscenario), "spScenarios", NonVolatile); spTitleListLoad(); if (spCurrentSelected >= spNumberScenarios) { spCurrentSelected = spScenarioFind(DefaultScenario); } }
sdword tmTradeBegin(regionhandle region, sdword ID, udword event, udword data) { sdword status = 0; sdword i; //if disabled, just return if ((tmTradeDisabled) || (playPackets) || (universePause) || (tmTradeActive)) { return 0; } // disbale rendering of main screen mrRenderMainScreen = FALSE; // clear the screen rndClear(); tmTradeActive = TRUE; tmTechListFont = frFontRegister(TM_TechListFont); tmFont = frFontRegister(TM_Font); tmCurrentSelect = 0; tmDialogPhrase = DialogWelcome; if (piePointSpecMode != PSM_Idle) { piePointModeOnOff(); } if (!tmScreensHandle) { feCallbackAddMultiple(tmCallback); //add in the callbacks feDrawCallbackAddMultiple(tmDrawCallback); tmScreensHandle = feScreensLoad(TM_FIBFile); //load in the screen } soundEventStopSFX(0.5f); /* play the intro sound */ soundEvent(NULL, UI_ManagerIntro); /* play the build manager ambient */ soundEvent(NULL, UI_Trading); tmBaseRegion = feScreenStart(region, TM_TradeScreen);//add new regions as siblings of current one tmIoSaveState = ioDisable(); tmTechSelected = -1; for (i = 0; i < TM_NUM_TECHS; i++) { if (tmTechForSale[i] == TM_TECH_IS_FOR_SALE) { tmTechSelected = i; tmtechinfo = i; tmDirtyTechInfo(); break; } } mouseCursorShow(); bitSet(tbDisable,TBDISABLE_TRADEMGR_USE); return(status); }