Replace #pragma once with include guards

This commit is contained in:
Zac 2023-12-02 23:12:15 +00:00 committed by GitHub
parent 0f216c7338
commit 36d129078a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 257 additions and 55 deletions

13
.gitignore vendored
View File

@ -1,5 +1,11 @@
## Ignore project-specific files
*[Ss][Cc][Uu][Ss]*
*971*98*
build*/
*build/
ProDGPs2usrLocalSceFiles.zip
usr/
sce/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
@ -390,13 +396,8 @@ healthchecksdb
## Local
## Local
.idea/
build*/
## Prevent someone accidentally posting game bin
*[Ss][Cc][Uu][Ss]*
*971*98*

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for actor segments.
*/
#pragma once
#ifndef ACTSEG_H
#define ACTSEG_H
#include <vec.h>
#include <util.h>
@ -24,3 +26,5 @@ struct ACTLA
struct CLQ clqTiltToTilt;
struct LM lmTilt;
};
#endif // ACTSEG_H

View File

@ -3,4 +3,8 @@
*
* @brief Declarations for the alarm system.
*/
#pragma once
#ifndef ALARM_H
#define ALARM_H
#endif // ALARM_H

View File

@ -1,7 +1,9 @@
/**
* @file alo.h
*/
#pragma once
#ifndef ALO_H
#define ALO_H
struct ALO {
//LO field0_0x0;
@ -59,3 +61,5 @@ struct ALO {
//DLR* pdlrFirst;
//ACK ackRot;
};
#endif // ALO_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for animation segments.
*/
#pragma once
#ifndef ASEG_H
#define ASEG_H
#include <util.h>
#include <game.h>
@ -39,3 +41,5 @@ struct ASEG
int coidSearchRoot;
OID* aoidSearchRoot;
};
#endif // ASEG_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the binary async stream.
*/
#pragma once
#ifndef BAS_H
#define BAS_H
#include <stdint.h>
#include <util.h>
@ -54,3 +56,5 @@ public:
void Close();
};
#endif // BAS_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the BASIC struct.
*/
#pragma once
#ifndef BASIC_H
#define BASIC_H
struct BASIC
{
@ -170,3 +172,5 @@ struct BASIC
struct VTCM* pvtcm;
struct CSidebag* psidebag;
};
#endif // BASIC_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the binary input stream.
*/
#pragma once
#ifndef BIS_H
#define BIS_H
#include <bas.h>
#include <cat.h>
#include <prog.h>
@ -263,3 +265,5 @@ public:
// Global variables
static uint32_t g_fCdAvailable; // Is the CD available for reading?
#endif // BIS_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the byte queue class.
*/
#pragma once
#ifndef BQ_H
#define BQ_H
typedef unsigned char BYTE; //todo mode to util header
@ -22,3 +24,5 @@ class CByteQueue {
// todo: class methods
};
#endif // BQ_H

View File

@ -3,6 +3,9 @@
*
* @brief Declarations for interaction with binary resource archives.
*/
#ifndef BRX_H
#define BRX_H
#include <alo.h>
#include <game.h>
#include <sw.h>
@ -28,3 +31,5 @@ SW* PloNew(CID cid, SW* csw, ALO* paloParent, OID oid, int isplice);
* @return The level object index.
*/
int IploFromStockOid(int oid);
#endif // BRX_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for working with WAC and WAL catalogs.
*/
#pragma once
#ifndef CAT_H
#define CAT_H
#include <iostream>
typedef unsigned int uint; //todo move to util header
@ -165,3 +167,5 @@ public:
*/
int FDefaultWorld(char* pchzResult, CFileLocation* pflResult);
};
#endif // CAT_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the checkpoint system.
*/
#pragma once
#ifndef CHKPNT_H
#define CHKPNT_H
#include <util.h>
#include <game.h>
#include <vec.h>
@ -37,3 +39,5 @@ struct CHKMGR
* @param pchkmgr Pointer to the checkpoint manager.
*/
void ResetChkmgrCheckpoints(CHKMGR* pchkmgr);
#endif // CHKPNT_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the game clock.
*/
#pragma once
#ifndef CLOCK_H
#define CLOCK_H
typedef unsigned long long TICK;
@ -86,3 +88,5 @@ TICK TickNow();
* @todo Implement this function.
*/
//void SetClockDebugRate(int nParam);
#endif // CLOCK_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the game camera.
*/
#pragma once
#ifndef CM_H
#define CM_H
/**
* @brief Game Camera
@ -24,3 +26,5 @@ extern CM* g_pcm; // Pointer to the main game camera
* @param pcm Pointer to the camera.
*/
void SetupCm(CM* pcm);
#endif // CM_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for coin interaction/events.
*/
#pragma once
#ifndef COIN_H
#define COIN_H
/**
* @brief Coin prize
@ -51,3 +53,5 @@ void OnCoinSmack(COIN* pcoin);
* @todo Implement this function.
*/
//void UpdateCoin(Coin* pcoin, float dt);
#endif // COIN_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the dialog system.
*/
#pragma once
#ifndef DIALOG_H
#define DIALOG_H
#include <iostream>
#include <game.h>
#include <util.h>
@ -56,3 +58,5 @@ struct DIALOG
int fDefault;
int fCrucial;
};
#endif // DIALOG_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the difficulty scaling system.
*/
#pragma once
#ifndef DIFFICULTY_H
#define DIFFICULTY_H
#include <util.h>
#include <chkpnt.h>
@ -150,3 +152,5 @@ void ChangeSuck(float nParam, DIFFICULTY* pdifficulty);
//void ResetSuckChkpnts(int nParam);
//void SetSuckChkpnts(int nParam);
#endif // DIFFICULTY_H

View File

@ -1,7 +1,9 @@
/**
* @file dl.h
*/
#pragma once
#ifndef DL_H
#define DL_H
/**
* @brief Unknown, needs more research
@ -197,3 +199,5 @@ struct DLE
struct MGCO* pmgcoPrev;
struct JMT* pjmtPrev;
};
#endif // DL_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the font system.
*/
#pragma once
#ifndef FONT_H
#define FONT_H
#include <util.h>
/**
@ -130,3 +132,5 @@ public:
*/
void SetVerticalJust(JV jv);
};
#endif // FONT_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the frame system.
*/
#pragma once
#ifndef FRM_H
#define FRM_H
/**
* @brief Frame
@ -36,3 +38,5 @@ void CloseFrame();
* @param pfrm Pointer to the frame.
*/
void ClearPendingFrame(FRM* pfrm);
#endif // FRM_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations related to the game world and game objects.
*/
#pragma once
#ifndef GAME_H
#define GAME_H
#include <gs.h>
/**
@ -388,3 +390,5 @@ void OnGameLoad(GAME* pgame);
* @return The max charm count.
*/
int CcharmMost();
#endif // GAME_H

View File

@ -1,7 +1,9 @@
/**
* @file gc.h
*/
#pragma once
#ifndef GC_H
#define GC_H
#include <ref.h>
/**
@ -11,3 +13,5 @@ struct SBB {
int n;
struct CRef ref;
};
#endif // GC_H

View File

@ -5,7 +5,9 @@
*
* @note Not to be confused with Graphics Synthesizer, which is also abbreviated GS.
*/
#pragma once
#ifndef GS_H
#define GS_H
/**
* @brief Game State Flags
@ -183,3 +185,5 @@ int FGameCompletion();
* @return Percent completion as an integer out of 100.
*/
int CalculatePercentCompletion(GS* pgs);
#endif // GS_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for joypad interactions.
*/
#pragma once
#ifndef JOY_H
#define JOY_H
#include <util.h>
#include <iostream>
@ -273,3 +275,5 @@ void AddGrfusr(int mask);
* @todo Implement rendering the string on the screen.
*/
void CheatActivateChetkido();
#endif // JOY_H

View File

@ -1,7 +1,9 @@
/**
* @file keyhole.h
*/
#pragma once
#ifndef KEYHOLE_H
#define KEYHOLE_H
#include <iostream>
/**
@ -12,3 +14,5 @@ struct KEYHOLE
// todo
// ...
};
#endif // KEYHOLE_H

View File

@ -3,7 +3,9 @@
*
* @brief Light and shadow system.
*/
#pragma once
#ifndef LIGHT_H
#define LIGHT_H
/**
* @brief Light shadow & midtone
@ -13,3 +15,5 @@ struct LSM
float uShadow;
float uMidtone;
};
#endif // LIGHT_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares Level Object struct.
*/
#pragma once
#ifndef LO_H
#define LO_H
#include <basic.h>
#include <game.h>
#include <dl.h>
@ -25,3 +27,5 @@ struct LO {
struct PXR* ppxr;
unsigned long dtickPerf;
};
#endif // LO_H

View File

@ -1,4 +1,6 @@
#pragma once
#ifndef MAIN_H
#define MAIN_H
static int g_chpzArgs;
static char** g_aphzArgs;
@ -26,3 +28,5 @@ void Startup();
* @note This function is not in the game and is only used for testing.
*/
void MainDebug();
#endif // MAIN_H

View File

@ -3,7 +3,9 @@
*
* @brief Defines 4x4 and 3x3 matrix types.
*/
#pragma once
#ifndef MAT_H
#define MAT_H
typedef struct MATRIX4 GRFDP;
@ -22,3 +24,5 @@ struct MATRIX3
{
float mat[3][3];
};
#endif // MAT_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the MPEG system.
*/
#pragma once
#ifndef MPEG_H
#define MPEG_H
#include <bis.h>
#include <bq.h>
#include <clock.h>
@ -142,3 +144,5 @@ public:
// Global variables
static CMpeg g_mpeg; // Current MPEG
#endif // MPEG_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the phase system.
*/
#pragma once
#ifndef PHASEMEM_H
#define PHASEMEM_H
/**
* @brief Game Phase
@ -31,3 +33,5 @@ void SetPhase(PHASE phase);
* @brief Clears the current game phase.
*/
void ClearPhase(PHASE phase = PHASE_None);
#endif // PHASEMEM_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the prog class.
*/
#pragma once
#ifndef PROG_H
#define PROG_H
#include <game.h>
#include <font.h>
@ -30,3 +32,5 @@ public:
void Draw();
void End();
};
#endif // PROG_H

View File

@ -3,7 +3,9 @@
*
* @brief
*/
#pragma once
#ifndef REF_H
#define REF_H
/**
* @brief Unknown, needs more research
@ -15,3 +17,5 @@ class CRef
public:
//todo
};
#endif // REF_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the render system.
*/
#pragma once
#ifndef RENDER_H
#define RENDER_H
#include <sw.h>
#include <cm.h>
@ -26,3 +28,5 @@ void RenderSw(SW* psw, CM* pcm);
* @todo Implement this function.
*/
void DrawSw(SW* psw, CM* pcm);
#endif // RENDER_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the screen blot system.
*/
#pragma once
#ifndef SCREEN_H
#define SCREEN_H
/**
* @brief Blot State
@ -51,3 +53,5 @@ void RenderBlots();
* @todo Implement this function.
*/
void DrawBlots();
#endif // SCREEN_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the sensor system.
*/
#pragma once
#ifndef SENSOR_H
#define SENSOR_H
#include <util.h>
typedef unsigned char byte;
@ -58,3 +60,5 @@ struct SENSOR
undefined4 field_0x5f8;
float svtRestore;
};
#endif // SENSOR_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the CSidebag class.
*/
#pragma once
#ifndef SIDEBAG_H
#define SIDEBAG_H
#include <gc.h>
/**
@ -19,3 +21,5 @@ struct CSidebag {
int m_csbb;
struct SBB m_asbb[16];
};
#endif // SIDEBAG_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the slotheap and slot structs.
*/
#pragma once
#ifndef SLOTHEAP_H
#define SLOTHEAP_H
typedef unsigned char byte; //todo move to util header
@ -30,3 +32,5 @@ struct SLOTHEAP {
struct SLOT {
struct SLOT* pslotNext; // pointer to the next slot in the free list
};
#endif // SLOTHEAP_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for scene objects.
*/
#pragma once
#ifndef SO_H
#define SO_H
#include <zap.h>
#include <util.h>
#include <iostream>
@ -105,3 +107,5 @@ struct SO
SO* psoPhysHook;
//struct GEOM_153 geomCameraLocal;
};
#endif // SO_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the sound system.
*/
#pragma once
#ifndef SOUND_H
#define SOUND_H
#include <util.h>
#include <cstdint>
@ -508,3 +510,5 @@ struct ISI {
struct LM lmRepeat;
struct LM lmRepDist;
};
#endif // SOUND_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the speaker system.
*/
#pragma once
#ifndef SPEAKER_H
#define SPEAKER_H
#include <game.h>
#include <joy.h>
#include <mat.h>
@ -56,3 +58,5 @@ struct DP
struct ASEGA* pasegaLipsync;
float tPauseMin;
};
#endif // SPEAKER_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares the scene world and related classes.
*/
#pragma once
#ifndef SW_H
#define SW_H
#include <bis.h>
#include <dl.h>
#include <light.h>
@ -158,3 +160,5 @@ void LoadSwFromBrx(SW* psw, CBinaryInputStream* pbis);
* @todo Implement this function.
*/
void DeleteSw(SW* psw);
#endif // SW_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the transition system.
*/
#pragma once
#ifndef TRANSITION_H
#define TRANSITION_H
#include <bis.h>
#include <brx.h>
#include <cat.h>
@ -92,3 +94,5 @@ public:
// Global variables
static CTransition g_transition; // Current transition
#endif // TRANSITION_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the user interface.
*/
#pragma once
#ifndef UI_H
#define UI_H
/**
* @brief UI state
@ -63,3 +65,5 @@ void DrawUi();
* @brief Calls RenderBlots to render the UI.
*/
void RenderUi();
#endif // UI_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for functions that update game elements.
*/
#pragma once
#ifndef UPDATE_H
#define UPDATE_H
#include <sw.h>
/**
@ -13,3 +15,5 @@
* @param dt Delta time
*/
void UpdateSwObjects(SW* psw, float dt);
#endif // UPDATE_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for utility functions.
*/
#pragma once
#ifndef UTIL_H
#define UTIL_H
typedef bool BOOL;
typedef unsigned int uint;
@ -203,3 +205,5 @@ void Force(void* pv);
//void ExtendRange(PFNGG pfn, void* pv, float g, float dg, float gMax, float* pgMic, float* pgMac);
//int NRoundG(float g);
//void SmoothMulti(int c, float dt, float r);
#endif // UTIL_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares VECTOR and other related classes/functions.
*/
#pragma once
#ifndef VEC_H
#define VEC_H
#include <iostream>
#include <so.h>
#include <util.h>
@ -195,3 +197,5 @@ void SetVectorSphere(float z, float y, float x, VECTOR* pvec);
* @return Scalar projection of vec1 onto vec2
*/
float SProjectVector(VECTOR* pvec1, VECTOR* pvec2);
#endif // VEC_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the wipe system.
*/
#pragma once
#ifndef WIPE_H
#define WIPE_H
#include <dialog.h>
#include <game.h>
#include <joy.h>
@ -132,3 +134,5 @@ void SetWipeButtonTrans(WIPE* pwipe, TRANS* ptrans, WIPEK wipek);
* @param wipesNew New wipe state
*/
int FCatchWipeButtonTrans(WIPE* pwipe, JOY* pjoy, WIPES wipesNew);
#endif // WIPE_H

View File

@ -1,7 +1,9 @@
/**
* @file wm.h
*/
#pragma once
#ifndef WM_H
#define WM_H
#include <iostream>
/**
@ -32,3 +34,5 @@ enum WMS
* @param pwms Pointer to the WM state
*/
void SetWmWms(WM* pwm, WMS wms);
#endif // WM_H

View File

@ -3,7 +3,9 @@
*
* @brief Declares EXITs for moving between levels.
*/
#pragma once
#ifndef XFORM_H
#define XFORM_H
#include <game.h>
#include <aseg.h>
#include <wipe.h>
@ -61,3 +63,5 @@ struct EXIT
* @param exits EXIT state
*/
void SetExitExits(EXIT* pexit, EXITS exits);
#endif // XFORM_H

View File

@ -3,7 +3,9 @@
*
* @brief Declarations for the zap (damage) system.
*/
#pragma once
#ifndef ZAP_H
#define ZAP_H
#include <iostream>
#include <game.h>
#include <gs.h>
@ -33,3 +35,5 @@ enum ZOK
ZOK_ZapAndIgnore = 4,
ZOK_Max = 5
};
#endif // ZAP_H