Skip to content

Commit

Permalink
Bump GL back to 1.5; rework movie player to not hijack application loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Nov 4, 2024
1 parent 2903498 commit 811316d
Show file tree
Hide file tree
Showing 25 changed files with 360 additions and 901 deletions.
375 changes: 4 additions & 371 deletions libraries/glad/include/glad/glad.h

Large diffs are not rendered by default.

206 changes: 7 additions & 199 deletions libraries/glad/src/glad.c

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions source_files/edge/con_con.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "hu_stuff.h"
#include "hu_style.h"
#include "i_defs_gl.h"
#include "i_movie.h"
#include "i_system.h"
#include "m_argv.h"
#include "n_network.h"
Expand Down Expand Up @@ -1536,6 +1537,9 @@ bool ConsoleResponder(InputEvent *ev)

void ConsoleTicker(void)
{
if (playing_movie)
return;

console_cursor = (console_cursor + 1) & 31;

if (console_visible != kConsoleVisibilityNotVisible)
Expand Down
2 changes: 1 addition & 1 deletion source_files/edge/dm_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum GameState
kGameStateTitleScreen,
kGameStateLevel,
kGameStateIntermission,
kGameStateFinale,
kGameStateFinale
};

//
Expand Down
4 changes: 4 additions & 0 deletions source_files/edge/e_input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "epi_sdl.h"
#include "epi_str_util.h"
#include "hu_stuff.h"
#include "i_movie.h"
#include "m_math.h"
#include "m_misc.h"
#include "r_misc.h"
Expand Down Expand Up @@ -682,6 +683,9 @@ void ProcessInputEvents(void)
{
ev = &events[event_tail];

if (MovieResponder(ev))
continue;

if (ConsoleResponder(ev))
continue; // Console ate the event

Expand Down
103 changes: 55 additions & 48 deletions source_files/edge/e_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,73 +605,79 @@ void EdgeDisplay(void)

HUDFrameSetup();

switch (game_state)
if (!playing_movie)
{
case kGameStateLevel:
PaletteTicker();
switch (game_state)
{
case kGameStateLevel:
PaletteTicker();

if (LuaUseLuaHUD())
LuaRunHUD();
else
COALRunHUD();
if (LuaUseLuaHUD())
LuaRunHUD();
else
COALRunHUD();

if (need_save_screenshot)
{
CreateSaveScreenshot();
need_save_screenshot = false;
}
if (need_save_screenshot)
{
CreateSaveScreenshot();
need_save_screenshot = false;
}

HUDDrawer();
ScriptDrawer();
break;
HUDDrawer();
ScriptDrawer();
break;

case kGameStateIntermission:
IntermissionDrawer();
break;
case kGameStateIntermission:
IntermissionDrawer();
break;

case kGameStateFinale:
FinaleDrawer();
break;
case kGameStateFinale:
FinaleDrawer();
break;

case kGameStateTitleScreen:
TitleDrawer();
break;
case kGameStateTitleScreen:
TitleDrawer();
break;

case kGameStateNothing:
break;
}
case kGameStateNothing:
break;
}

if (wipe_gl_active)
{
// -AJA- Wipe code for GL. Sorry for all this ugliness, but it just
// didn't fit into the existing wipe framework.
//
if (DoWipe())
if (wipe_gl_active)
{
StopWipe();
wipe_gl_active = false;
// -AJA- Wipe code for GL. Sorry for all this ugliness, but it just
// didn't fit into the existing wipe framework.
//
if (DoWipe())
{
StopWipe();
wipe_gl_active = false;
}
}
}

// save the current screen if about to wipe
if (need_wipe)
{
need_wipe = false;
wipe_gl_active = true;
// save the current screen if about to wipe
if (need_wipe)
{
need_wipe = false;
wipe_gl_active = true;

InitializeWipe(wipe_method);
}
InitializeWipe(wipe_method);
}

if (paused)
DisplayPauseImage();
if (paused)
DisplayPauseImage();

// menus go directly to the screen
MenuDrawer(); // menu is drawn even on top of everything (except console)
// menus go directly to the screen
MenuDrawer(); // menu is drawn even on top of everything (except console)
}
else
MovieDrawer();

// process mouse and keyboard events
NetworkUpdate();

ConsoleDrawer();
if (!playing_movie)
ConsoleDrawer();

if (!hud_overlays.at(video_overlay.d_).empty())
{
Expand Down Expand Up @@ -2447,6 +2453,7 @@ void EdgeTicker(void)
GameTicker();

// user interface stuff (skull anim, etc)
MovieTicker();
ConsoleTicker();
MenuTicker();
SoundTicker();
Expand Down
7 changes: 7 additions & 0 deletions source_files/edge/g_game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "epi_str_util.h"
#include "f_finale.h"
#include "f_interm.h"
#include "i_movie.h"
#include "i_system.h"
#include "m_cheat.h"
#include "m_menu.h"
Expand Down Expand Up @@ -417,6 +418,9 @@ static void CheckPlayersReborn(void)

void DoBigGameStuff(void)
{
if (playing_movie)
return;

// do things to change the game state
while (game_action != kGameActionNothing)
{
Expand Down Expand Up @@ -466,6 +470,9 @@ void DoBigGameStuff(void)

void GameTicker(void)
{
if (playing_movie)
return;

// ANIMATE FLATS AND TEXTURES GLOBALLY
AnimationTicker();

Expand Down
Loading

0 comments on commit 811316d

Please sign in to comment.