use C++ style structs everywhere

This commit is contained in:
RSDuck 2021-01-02 11:38:06 +01:00
parent e2c61b28e0
commit 7d448d911d
10 changed files with 28 additions and 39 deletions

View File

@ -23,23 +23,21 @@
#include "types.h"
typedef struct
struct ARCode
{
char Name[128];
bool Enabled;
u32 CodeLen;
u32 Code[2*64];
} ARCode;
};
typedef std::list<ARCode> ARCodeList;
typedef struct
struct ARCodeCat
{
char Name[128];
ARCodeList Codes;
} ARCodeCat;
};
typedef std::list<ARCodeCat> ARCodeCatList;

View File

@ -26,7 +26,7 @@
namespace Config
{
typedef struct
struct ConfigEntry
{
char Name[32];
int Type;
@ -34,8 +34,7 @@ typedef struct
int DefaultInt;
const char* DefaultStr;
int StrLength; // should be set to actual array length minus one
} ConfigEntry;
};
FILE* GetConfigFile(const char* fileName, const char* permissions);
bool HasConfigFile(const char* fileName);

View File

@ -150,14 +150,13 @@ void SyncDirtyFlags();
extern u32 OAMDirty;
extern u32 PaletteDirty;
typedef struct
struct RenderSettings
{
bool Soft_Threaded;
int GL_ScaleFactor;
bool GL_BetterPolygons;
} RenderSettings;
};
bool Init();

View File

@ -25,7 +25,7 @@
namespace GPU3D
{
typedef struct
struct Vertex
{
s32 Position[4];
s32 Color[3];
@ -43,9 +43,9 @@ typedef struct
// TODO maybe: hi-res color? (that survives clipping)
s32 HiresPosition[2];
} Vertex;
};
typedef struct
struct Polygon
{
Vertex* Vertices[10];
u32 NumVertices;
@ -74,7 +74,7 @@ typedef struct
u32 SortKey;
} Polygon;
};
extern u32 RenderDispCnt;
extern u8 RenderAlphaRef;

View File

@ -70,7 +70,7 @@ struct
GLuint ShaderConfigUBO;
typedef struct
struct RendererPolygon
{
Polygon* PolyData;
@ -82,8 +82,7 @@ typedef struct
u32 EdgeIndicesOffset;
u32 RenderKey;
} RendererPolygon;
};
RendererPolygon PolygonList[2048];
int NumFinalPolys, NumOpaqueFinalPolys;

View File

@ -538,7 +538,7 @@ private:
s32 ycoverage, ycov_incr;
};
typedef struct
struct RendererPolygon
{
Polygon* PolyData;
@ -548,7 +548,7 @@ typedef struct
u32 CurVL, CurVR;
u32 NextVL, NextVR;
} RendererPolygon;
};
RendererPolygon PolygonList[2048];

View File

@ -54,13 +54,12 @@ enum
Event_MAX
};
typedef struct
struct SchedEvent
{
void (*Func)(u32 param);
u64 Timestamp;
u32 Param;
} SchedEvent;
};
enum
{
@ -121,21 +120,19 @@ enum
IRQ2_DSi_MicExt
};
typedef struct
struct Timer
{
u16 Reload;
u16 Cnt;
u32 Counter;
u32 CycleShift;
};
} Timer;
typedef struct
struct MemRegion
{
u8* Mem;
u32 Mask;
} MemRegion;
};
extern int ConsoleType;
extern int CurCPU;

View File

@ -19,13 +19,12 @@
#ifndef ROMLIST_H
#define ROMLIST_H
typedef struct
struct ROMListEntry
{
u32 GameCode;
u32 ROMSize;
u32 SaveMemType;
} ROMListEntry;
};
ROMListEntry ROMList[] =

View File

@ -55,7 +55,7 @@ u16 RFData1;
u16 RFData2;
u32 RFRegs[0x40];
typedef struct
struct TXSlot
{
u16 Addr;
u16 Length;
@ -63,8 +63,7 @@ typedef struct
u8 CurPhase;
u32 CurPhaseTime;
u32 HalfwordTimeMask;
} TXSlot;
};
TXSlot TXSlots[6];

View File

@ -24,7 +24,7 @@
namespace LAN_PCap
{
typedef struct
struct AdapterData
{
char DeviceName[128];
char FriendlyName[128];
@ -34,8 +34,7 @@ typedef struct
u8 IP_v4[4];
void* Internal;
} AdapterData;
};
extern AdapterData* Adapters;