MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RunGameFromEditor

Function RunGameFromEditor

editor/gameeditor.cpp:571–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569// ---------------------------------------------------------------------------
570
571void RunGameFromEditor() {
572 int game_mode = GetFunctionMode(); // save the mode we're going to (menu or editor_game)
573 renderer_type old_rend = PreferredRenderer;
574
575 // Run the damn game
576 mprintf(0, "Entering the game...\n");
577
578 Editor_active = false;
579 PROGRAM(editor) = 0;
580 if (PROGRAM(windowed))
581 PreferredRenderer = RENDERER_OPENGL;
582
583 EditorToGame();
584 MainLoop();
585 GameToEditor(game_mode == EDITOR_GAME_MODE); // if was playing from editor, copy player pos to viewer
586 PROGRAM(editor) = 1;
587 PreferredRenderer = old_rend;
588 Editor_active = true;
589 SetFunctionMode(EDITOR_MODE); // ASSERT WE ARE IN EDITOR MODE!
590
591 mprintf(0, "Returning to editor...\n");
592}
593
594// Vars for getting the viewer position back from the game to the editor
595vector editor_player_pos;

Callers 2

OnFilePlayin640x480Method · 0.85
OnFileLeaveEditorMethod · 0.85

Calls 5

GetFunctionModeFunction · 0.85
EditorToGameFunction · 0.85
MainLoopFunction · 0.85
GameToEditorFunction · 0.85
SetFunctionModeFunction · 0.85

Tested by

no test coverage detected