| 569 | // --------------------------------------------------------------------------- |
| 570 | |
| 571 | void 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 |
| 595 | vector editor_player_pos; |
no test coverage detected