forked from LostArtefacts/TRX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include "game/phase/phase_photo_mode.h" | ||
|
||
#include "game/camera.h" | ||
#include "game/game.h" | ||
#include "game/input.h" | ||
#include "game/interpolation.h" | ||
#include "game/music.h" | ||
#include "game/overlay.h" | ||
#include "game/sound.h" | ||
#include "game/text.h" | ||
#include "global/vars.h" | ||
|
||
static TEXTSTRING *m_PhotoText = NULL; | ||
|
||
static void M_Start(void *arg); | ||
static void M_End(void); | ||
static PHASE_CONTROL M_Control(int32_t nframes); | ||
static void M_Draw(void); | ||
|
||
static void M_Start(void *arg) | ||
{ | ||
g_OldInputDB = g_Input; | ||
|
||
Overlay_HideGameInfo(); | ||
Music_Pause(); | ||
Sound_PauseAll(); | ||
} | ||
|
||
static void M_End(void) | ||
{ | ||
g_Input = g_OldInputDB; | ||
|
||
Text_Remove(m_PhotoText); | ||
m_PhotoText = NULL; | ||
} | ||
|
||
static void M_UpdateText(void) | ||
{ | ||
if (m_PhotoText != NULL) { | ||
return; | ||
} | ||
|
||
m_PhotoText = Text_Create(0, -24, "Photo Mode"); | ||
Text_CentreH(m_PhotoText, 1); | ||
Text_AlignBottom(m_PhotoText, 1); | ||
} | ||
|
||
static PHASE_CONTROL M_Control(int32_t nframes) | ||
{ | ||
Input_Update(); | ||
Camera_Update(); | ||
M_UpdateText(); | ||
|
||
if (g_InputDB.toggle_photo_mode) { | ||
Music_Unpause(); | ||
Sound_UnpauseAll(); | ||
Phase_Set(PHASE_GAME, NULL); | ||
} | ||
|
||
return (PHASE_CONTROL) { .end = false }; | ||
} | ||
|
||
static void M_Draw(void) | ||
{ | ||
Interpolation_Disable(); | ||
Game_DrawScene(false); | ||
Interpolation_Enable(); | ||
Text_Draw(); | ||
} | ||
|
||
PHASER g_PhotoModePhaser = { | ||
.start = M_Start, | ||
.end = M_End, | ||
.control = M_Control, | ||
.draw = M_Draw, | ||
.wait = NULL, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include "game/phase/phase.h" | ||
|
||
extern PHASER g_PhotoModePhaser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters