void gpSaveTheRecordedGame(char *name, featom *atom) { char filename[300]; if ((gpTextEntryName != NULL) && (strlen(gpTextEntryName) > 0)) { if (strlen(gpTextEntryName) < 2) { GeneralMessageBox(strGetString(strErrorInSaveGameName),strGetString(strAtLeast2Chars)); return; } strcpy(filename,SavedGamesPath); strcat(filename,gpTextEntryName); if (fileExists(filename,0)) { overwriteRecGame = TRUE; strcpy(overwritefilename,filename); feScreenStart(ghMainRegion, "OverwriteGamePopup"); return; } recPackInGameStartCB(filename); feScreenDisappear(NULL, NULL); if (!multiPlayerGame) { universePause = FALSE; // unpause game } return; } if (gpNumberGames > 0) { gpDonePicking(name, atom); dbgAssertOrIgnore(gpCurrentSelected < gpNumberGames); strcpy(filename,SavedGamesPath); strcat(filename,gpGames[gpCurrentSelected].title); if (fileExists(filename,0)) { overwriteRecGame = TRUE; strcpy(overwritefilename,filename); feScreenStart(ghMainRegion, "OverwriteGamePopup"); return; } recPackInGameStartCB(filename); feScreenDisappear(NULL, NULL); if (!multiPlayerGame) { universePause = FALSE; // unpause game } return; } GeneralMessageBox(strGetString(strErrorInSaveGameName),strGetString(strAtLeast2Chars)); }
void horseRaceInit() { udword i; horseGetNumBars(&horseBarInfo); //initialize current bar to the 0th bar localbar=0; for(i=0;i<MAX_MULTIPLAYER_PLAYERS;i++) { horseracestatus.barnum[i] = 0; horseracestatus.percent[i] = 0; horseracestatus.hrstatusstr[i][0] = 0; if (autodownloadmapRequired()) TTimerStart(&hrPlayerDropoutTimers[i],HorseRacePlayerDropoutTime*2.0f); // give double time for autodownloads else TTimerStart(&hrPlayerDropoutTimers[i],HorseRacePlayerDropoutTime); PlayersAlreadyDrawnDropped[i] = FALSE; } for (i=0;i<NUM_CHAT_LINES;i++) { chathistory[i].message[0] = 0; } listInit(&horseCrapRegion.cutouts); JustInit = TRUE; if (!hrScreensHandle) { feCallbackAddMultiple(hrCallBack); feDrawCallbackAddMultiple(hrDrawCallback); hrScreensHandle = feScreensLoad(HR_FIBFile); } if (!ShouldHaveMousePtr) mouseCursorHide(); if (singlePlayerGame) { hrBaseRegion = feScreenStart(&horseCrapRegion, HR_SingleRaceScreen); } else { hrBaseRegion = feScreenStart(&horseCrapRegion, (multiPlayerGame) ? HR_RaceScreen : HR_RaceScreenNotNetwork); } playernamefont = frFontRegister(HR_PlayerNameFont); hrRunning=TRUE; if (RGLtype == SWtype && feShouldSaveMouseCursor()) { rglFeature(RGL_SAVEBUFFER_ON); } hrBackgroundDirty = (RGLtype == SWtype) ? 10000 : 3; hrBackgroundReinit = FALSE; }
/*----------------------------------------------------------------------------- Name : gcChatEntryStart Description : starts up the chat text entry system. Inputs : Outputs : Return : void ----------------------------------------------------------------------------*/ void gcChatEntryStart(bool toAllies) { InChatMode = TRUE; if (toAllies) { MessageToAllies = GC_ChatToAllies; feScreenStart(ghMainRegion,"Allies_Chatting_Screen"); } else { MessageToAllies = GC_ChatToAll; feScreenStart(ghMainRegion,"Say_Chatting_Screen"); } }
/*----------------------------------------------------------------------------- Name : gcRUTransferStart Description : starts up the text entry box for an RU transfer. Inputs : Outputs : Return : void ----------------------------------------------------------------------------*/ void gcRUTransferStart(uword playertosendto) { InChatMode = TRUE; MessageToAllies = GC_RUTransfer; RUTransferToPlayer = playertosendto; feScreenStart(ghMainRegion,"Allies_Chatting_Screen"); }
void gpAcceptBackToInGameEscapeMenu(char* name, featom* atom) { void opInGameOptionsAccept(char* name, featom* atom); opInGameOptionsAccept(name, atom); feScreenStart(ghMainRegion, "In_game_esc_menu"); }
/*----------------------------------------------------------------------------- Name : spScenarioPick Description : Starts the scenario picker Inputs : dest - where to store file name of destiation file. Will be "" if nothing (yet) chosen. Outputs : Starts the scenario picker screen. When chosen, the name will be stored in dest. Return : void ----------------------------------------------------------------------------*/ void spScenarioPick(char *dest) { feCallbackAddMultiple(spCallbacks); feScreenStart(ghMainRegion, SCP_ScreenName); spNewItem(); spPickerStarted = TRUE; }
/*----------------------------------------------------------------------------- Name : gpGamePick Description : Starts the game picker Inputs : dest - where to store file name of destiation file. Will be "" if nothing (yet) chosen. Outputs : Starts the game picker screen. When chosen, the name will be stored in dest. Return : void ----------------------------------------------------------------------------*/ void gpGamePick(char *dest) { if (dest[0] == 'S') { gpLoadSinglePlayerGame = TRUE; } else { gpLoadSinglePlayerGame = FALSE; } SavedGamesPath = (gpLoadSinglePlayerGame) ? SinglePlayerSavedGamesPath : MultiPlayerSavedGamesPath; feScreenStart(ghMainRegion, GP_ScreenName); }
void gpBackToInGameEscapeMenu(char *name, featom *atom) { feScreenDisappear(NULL, NULL); #if defined(HW_GAME_DEMO) if ((singlePlayerGame) && (!(utyCreditsSequence|utyPlugScreens)) && (universe.quittime > 0.0f) && (universe.totaltimeelapsed >= universe.quittime)) #else if ((singlePlayerGame) && (!(utyCreditsSequence)) && (universe.quittime > 0.0f) && (universe.totaltimeelapsed >= universe.quittime)) #endif { feScreenStart(ghMainRegion, "SP_Game_Over"); return; } switch (escapemenu) { case ESCAPE_DEFAULT: feScreenStart(ghMainRegion, "In_game_esc_menu"); break; case ESCAPE_SINGLE: feScreenStart(ghMainRegion, "In_game_esc_menu2"); break; case ESCAPE_RECORDING: feScreenStart(ghMainRegion, "In_game_esc_menu_recording"); break; case ESCAPE_PLAYING: feScreenStart(ghMainRegion, "In_game_esc_menu_playing"); break; case ESCAPE_TUTORIAL: feScreenStart(ghMainRegion, "In_game_esc_menu_tutorial"); break; case ESCAPE_DEFAULT_NOSAVE: feScreenStart(ghMainRegion, "In_game_esc_menu_nosave"); break; case ESCAPE_RECORDING_NOSAVE: feScreenStart(ghMainRegion, "In_game_esc_menu_nosave_recording"); break; } }
void horseRaceRender() { SDL_Event e; regRenderEventIndex = 0; //special-case code for double-clicks /* if (keyIsHit(LMOUSE_DOUBLE)) { keyPressUp(LMOUSE_DOUBLE); utyDoubleClick(); } if (demDemoRecording) { memcpy((ubyte *)&keyScanCode[0], (ubyte *)&keySaveScan[0], sizeof(keyScanCode));//freeze a snapshot of the key state demStateSave(); } else if (demDemoPlaying) { demStateLoad(); }*/ if (hrBackgroundReinit) { if (hrBackgroundTexture != 0) { glDeleteTextures(1, &hrBackgroundTexture); hrBackgroundTexture = 0; } hrBackgroundReinit = FALSE; hrBackgroundDirty = 3; hrBackgroundInitFrame = 0; } // Make sure the Homeworld text gets drawn on the correct frames if (hrBackgroundDirty) { regRecursiveSetDirty(&horseCrapRegion); hrDecRegion = NULL; } else { regionhandle reg; // "Clean" the region with the homeworld logo // in it so it doesn't re-draw all the time reg = horseCrapRegion.child; if (reg) { reg = reg->child; } while (reg && reg->drawFunction != &ferDrawDecorative) { reg = reg->next; } if (reg) { void regNULLRenderFunction(regionhandle region); hrDecRegion = reg; reg->drawFunction = regNULLRenderFunction; } } if (TitanActive) titanPumpEngine(); SDL_Delay(0); if (!SDL_PollEvent(0)) { regProcessingRegions = TRUE; regRegionProcess(horseCrapRegion.child, 0xffffffff); regProcessingRegions = FALSE; if (ChatTextEntryBox!=NULL) { bitSet(ChatTextEntryBox->reg.status,RSF_KeyCapture); keyBufferClear(); } } else { regRegionProcess(horseCrapRegion.child, 0xffffffff); while (SDL_PollEvent(0)) { if (SDL_WaitEvent(&e)) { HandleEvent(&e); if (multiPlayerGame) { if (keyIsStuck(ESCKEY)) { keyClearSticky(ESCKEY); //clear the sticky bit if (!hrAbortLoadConfirm) { if (!hrAbortLoadingGame) // if not already aborting { hrAbortLoadConfirm = feScreenStart(&horseCrapRegion, "AbortLoadConfirm"); } } else { feScreenDelete(hrAbortLoadConfirm); hrAbortLoadConfirm = NULL; } } } regProcessingRegions = TRUE; if (hrAbortLoadConfirm!=NULL) { ; } else if (ChatTextEntryBox!=NULL) { regRegionProcess(&ChatTextEntryBox->reg, 0xffffffff); } regProcessingRegions = FALSE; } if (ChatTextEntryBox!=NULL) { bitSet(ChatTextEntryBox->reg.status,RSF_KeyCapture); keyBufferClear(); } if (TitanActive) titanPumpEngine(); SDL_Delay(0); } } // All of the hacked stuff from the render task //glColor3ub(colRed(RND_StarColor), colGreen(RND_StarColor), colBlue(RND_StarColor)); if (ShouldHaveMousePtr) { if (!feShouldSaveMouseCursor()) { rndClearToBlack(); glClear(GL_DEPTH_BUFFER_BIT); } } // primErrorMessagePrint(); //default rendering scheme is primitives on any //functions which want it off should set it back on when done // I know this looks weird, but it's correct if(hrBackgroundInitFrame == 1) { hrInitBackground(); } // When there's no background loaded yet, it fills the screen with black if (hrBackgroundDirty) { hrDrawBackground(); } else { if (hrBackgroundTexture != 0) { glDeleteTextures(1, &hrBackgroundTexture); hrBackgroundTexture = 0; } } regFunctionsDraw(); //render all regions primErrorMessagePrint(); hrUncleanDecorative(); // We want the init code to be called on the 2nd pass. That way, the screen erases, // Then we incur the delay of loading the background. // For two frames -after that- we'll draw the background, // then just draw the progress bars. if(hrBackgroundDirty && hrBackgroundInitFrame) { if (hrBackgroundDirty > 0) { hrBackgroundDirty--; } } hrBackgroundInitFrame++; if (ShouldHaveMousePtr) { // set the cursor type, reset the variables then draw the mouse cursor mouseSelectCursorSetting(); mouseSetCursorSetting(); if (feShouldSaveMouseCursor()) { mouseStoreCursorUnder(); } mousePoll(); mouseDraw(); //draw mouse atop everything if (demDemoPlaying) { rndShamelessPlug(); } } rndFlush(); if (ShouldHaveMousePtr) { if (feShouldSaveMouseCursor()) { mouseRestoreCursorUnder(); } } primErrorMessagePrint(); }
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); }