-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
phase: allocate arguments on the heap
- Loading branch information
Showing
17 changed files
with
114 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#include "game/phase/phase.h" | ||
#include "game/phase/phase_inventory.h" | ||
#include "global/types.h" | ||
|
||
#include <stdint.h> | ||
#include <libtrx/memory.h> | ||
|
||
GAMEFLOW_COMMAND Game_MainMenu(void) | ||
{ | ||
Phase_Set(PHASE_INVENTORY, (void *)(intptr_t)INV_TITLE_MODE); | ||
PHASE_INVENTORY_ARGS *const args = | ||
Memory_Alloc(sizeof(PHASE_INVENTORY_ARGS)); | ||
args->mode = INV_TITLE_MODE; | ||
Phase_Set(PHASE_INVENTORY, args); | ||
return Phase_Run(); | ||
} |
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
#include "game/inventory/inventory_vars.h" | ||
#include "game/phase/phase.h" | ||
#include "game/phase/phase_inventory.h" | ||
#include "global/types.h" | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <libtrx/memory.h> | ||
|
||
bool Inv_Display(const INV_MODE inv_mode) | ||
{ | ||
if (inv_mode == INV_KEYS_MODE && !g_InvKeysObjects) { | ||
return false; | ||
} | ||
Phase_Set(PHASE_INVENTORY, (void *)(intptr_t)inv_mode); | ||
PHASE_INVENTORY_ARGS *const args = | ||
Memory_Alloc(sizeof(PHASE_INVENTORY_ARGS)); | ||
args->mode = inv_mode; | ||
Phase_Set(PHASE_INVENTORY, args); | ||
return true; | ||
} |
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 |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
|
||
typedef struct { | ||
int32_t level_num; | ||
} PHASE_CUTSCENE_DATA; | ||
} PHASE_CUTSCENE_ARGS; | ||
|
||
extern PHASER g_CutscenePhaser; |
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
Oops, something went wrong.