Skip to content

Commit 90bf414

Browse files
committed
use std int types
1 parent 2fb8ebb commit 90bf414

27 files changed

+158
-158
lines changed

examples/logo/logo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ void DrawMesh(const void* header)
536536
#define RTEX_FORMAT_RGBA8 1
537537
#define RTEX_FORMAT_INDEX8 2 // 256 colour palette
538538

539-
#include "ps2s/types.h" // for tU128
539+
#include "ps2s/types.h" // for uint128_t
540540

541541
void reorderClut(unsigned int* clut)
542542
{
543-
tU128 buffer, *entries_1, *entries_2;
544-
entries_1 = (tU128*)clut + 2;
543+
uint128_t buffer, *entries_1, *entries_2;
544+
entries_1 = (uint128_t*)clut + 2;
545545
entries_2 = entries_1 + 2;
546546
unsigned int i;
547547
for (i = 0; i < 8; i++) {

examples/performance/performance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ void display(void)
566566

567567
// float *material = (float*)Core::MemMappings::VU1Data + kMaterialEmission * 4;
568568
// Utils::QwordFloatDump( material, 4 );
569-
// tU32 *output = (tU32*)Core::MemMappings::VU1Data + kDoubleBufBase*4 + kOutputStart*4;
569+
// uint32_t *output = (uint32_t*)Core::MemMappings::VU1Data + kDoubleBufBase*4 + kOutputStart*4;
570570
// Utils::QwordHexDump( output, 7 );
571571
// printf("\n");
572572

examples/tricked_out/billboard_renderer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ CBillboardRenderer::Register()
6060

6161
pglRegisterCustomPrimType(kBillboardPrimType, // the prim type we will pass to ps2gl (glBegin...)
6262
kBillboardPrimTypeFlag, // the corresponding renderer requirement
63-
~(tU64)0xffffffff, // we only care about the custom stuff (upper 32 bits)
63+
~(uint64_t)0xffffffff, // we only care about the custom stuff (upper 32 bits)
6464
true); // ok to merge multiple calls when possible
6565

6666
return renderer;
@@ -99,7 +99,7 @@ void CBillboardRenderer::DrawLinearArrays(CGeometryBlock& block)
9999
DrawBlock(packet, block, maxVertsPerBuffer);
100100
}
101101

102-
void CBillboardRenderer::InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged)
102+
void CBillboardRenderer::InitContext(GLenum primType, uint32_t rcChanges, bool userRcChanged)
103103
{
104104
CGLContext& glContext = *pGLContext;
105105
CVifSCDmaPacket& packet = glContext.GetVif1Packet();
@@ -115,7 +115,7 @@ void CBillboardRenderer::InitContext(GLenum primType, tU32 rcChanges, bool userR
115115
bool alpha = drawContext.GetBlendEnabled();
116116
bool useTexture = glContext.GetTexManager().GetTexEnabled();
117117
GS::tPrim prim = { prim_type : 6, iip : 0, tme : useTexture, fge : 0, abe : alpha, aa1 : 0, fst : 0, ctxt : 0, fix : 0 };
118-
tGifTag giftag = { NLOOP : 0, EOP : 1, pad0 : 0, id : 0, PRE : 1, PRIM : *(tU64*)&prim, FLG : 0, NREG : 4, REGS0 : 2, REGS1 : 4, REGS2 : 2, REGS3 : 4 };
118+
tGifTag giftag = { NLOOP : 0, EOP : 1, pad0 : 0, id : 0, PRE : 1, PRIM : *(uint64_t*)&prim, FLG : 0, NREG : 4, REGS0 : 2, REGS1 : 4, REGS2 : 2, REGS3 : 4 };
119119

120120
packet.Pad96();
121121
packet.OpenUnpack(Vifs::UnpackModes::v4_32, kGifTag, Packet::kSingleBuff);

examples/tricked_out/billboard_renderer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include "ps2gl/linear_renderer.h"
1616
#include "ps2gl/renderer.h"
1717

18-
#define kBillboardPrimType (((tU32)1 << 31) | 1)
19-
#define kBillboardPrimTypeFlag ((tU64)1 << 32)
18+
#define kBillboardPrimType (((uint32_t)1 << 31) | 1)
19+
#define kBillboardPrimTypeFlag ((uint64_t)1 << 32)
2020

2121
class CBillboardRenderer : public CLinearRenderer {
2222
static void* Microcode;
@@ -26,7 +26,7 @@ class CBillboardRenderer : public CLinearRenderer {
2626

2727
static CBillboardRenderer* Register();
2828

29-
virtual void InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged);
29+
virtual void InitContext(GLenum primType, uint32_t rcChanges, bool userRcChanged);
3030
virtual void DrawLinearArrays(CGeometryBlock& block);
3131
};
3232

glut/src/pads.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bool CPad::Open(void)
102102

103103
void CPad::Read(void)
104104
{
105-
t32 padState = padGetState(kPort0, kSlot0);
105+
int32_t padState = padGetState(kPort0, kSlot0);
106106
if (padState != PAD_STATE_STABLE)
107107
return;
108108

@@ -121,7 +121,7 @@ void CPad::Read(void)
121121
padStatus.leftStick = CurStatus.leftStick;
122122
CurStatus = padStatus;
123123

124-
// t32 id = padInfoMode( uiPort, kSlot0, PAD_MODECURID, 0 );
124+
// int32_t id = padInfoMode( uiPort, kSlot0, PAD_MODECURID, 0 );
125125
// if ( id == kPadModeStandard || id == kPadModeAnalog ) {
126126
// // flip the sense of the bit field (1 = pressed)
127127
// CurStatus.buttons ^= 0xffff;
@@ -144,7 +144,7 @@ void CPad::Read(void)
144144

145145
bool CPad::UpdateStick(tStickData* stickCur, tStickData* stickLast)
146146
{
147-
t8 temp;
147+
int8_t temp;
148148
bool isChanged = false;
149149

150150
using namespace Math;

glut/src/pads.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,52 +63,52 @@ class CPad {
6363

6464
private:
6565
typedef struct {
66-
tU16 select : 1;
67-
tU16 i : 1;
68-
tU16 j : 1;
69-
tU16 start : 1;
70-
71-
tU16 leftUp : 1;
72-
tU16 leftRight : 1;
73-
tU16 leftDown : 1;
74-
tU16 leftLeft : 1;
75-
76-
tU16 l2 : 1;
77-
tU16 r2 : 1;
78-
tU16 l1 : 1;
79-
tU16 r1 : 1;
80-
81-
tU16 rightUp : 1;
82-
tU16 rightRight : 1;
83-
tU16 rightDown : 1;
84-
tU16 rightLeft : 1;
66+
uint16_t select : 1;
67+
uint16_t i : 1;
68+
uint16_t j : 1;
69+
uint16_t start : 1;
70+
71+
uint16_t leftUp : 1;
72+
uint16_t leftRight : 1;
73+
uint16_t leftDown : 1;
74+
uint16_t leftLeft : 1;
75+
76+
uint16_t l2 : 1;
77+
uint16_t r2 : 1;
78+
uint16_t l1 : 1;
79+
uint16_t r1 : 1;
80+
81+
uint16_t rightUp : 1;
82+
uint16_t rightRight : 1;
83+
uint16_t rightDown : 1;
84+
uint16_t rightLeft : 1;
8585
} tButtonsPressed;
8686

8787
typedef struct {
88-
tU8 xVal, yVal;
89-
tU8 xCenter, yCenter;
88+
uint8_t xVal, yVal;
89+
uint8_t xCenter, yCenter;
9090
float xPos, yPos;
9191
bool isCentered;
9292
} tStickData;
9393

9494
typedef struct {
95-
tU8 success;
96-
tU8 statLen;
97-
tU16 buttons; /* 16 buttons */
98-
tU8 r3h;
99-
tU8 r3v;
100-
tU8 l3h;
101-
tU8 l3v;
102-
tU8 kanAtsu[12]; // deal with this crap later
103-
tU8 whoKnows[12]; // make the structure 32 bytes long
95+
uint8_t success;
96+
uint8_t statLen;
97+
uint16_t buttons; /* 16 buttons */
98+
uint8_t r3h;
99+
uint8_t r3v;
100+
uint8_t l3h;
101+
uint8_t l3v;
102+
uint8_t kanAtsu[12]; // deal with this crap later
103+
uint8_t whoKnows[12]; // make the structure 32 bytes long
104104
tStickData rightStick, leftStick;
105105
} tPadStatus;
106106

107107
bool IsDown(tPadStatus status, unsigned int button);
108108
bool IsUp(tPadStatus status, unsigned int button);
109109
bool UpdateStick(tStickData* stickCur, tStickData* stickLast);
110110

111-
tU128 DmaBuffer[scePadDmaBufferMax] __attribute__((aligned(64)));
111+
uint128_t DmaBuffer[scePadDmaBufferMax] __attribute__((aligned(64)));
112112
tPadStatus CurStatus __attribute__((aligned(16)));
113113
tPadStatus LastStatus __attribute__((aligned(16)));
114114
unsigned int uiPort;

include/ps2gl/base_renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class CBaseRenderer : public CRenderer {
9898
// used by XferBlock
9999
void XferVectors(CVifSCDmaPacket& packet, unsigned int* dataStart,
100100
int startOffset, int numVectors, int wordsPerVec,
101-
Vifs::tMask unpackMask, tU32 unpackMode,
101+
Vifs::tMask unpackMask, uint32_t unpackMode,
102102
int vu1MemOffset);
103103

104104
// used by InitContext

include/ps2gl/dlgmanager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class CDListGeomManager : public CGeomManager {
3838

3939
// user state
4040

41-
void EnableCustom(tU64 flag);
42-
void DisableCustom(tU64 flag);
41+
void EnableCustom(uint64_t flag);
42+
void DisableCustom(uint64_t flag);
4343

4444
void SetUserRenderContextChanged() { mError("not implemented yet"); }
4545

include/ps2gl/glcontext.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ class CGLContext {
108108

109109
// state changes
110110

111-
tU32 RendererContextChanged, SavedRendererContextChanges;
112-
tU32 GsContextChanged, SavedGsContextChanges;
113-
tU32 RendererPropsChanged, SavedRendererPropsChanges;
111+
uint32_t RendererContextChanged, SavedRendererContextChanges;
112+
uint32_t GsContextChanged, SavedGsContextChanges;
113+
uint32_t RendererPropsChanged, SavedRendererPropsChanges;
114114
bool StateChangesArePushed;
115115

116116
inline void PushStateChanges()
@@ -162,7 +162,7 @@ class CGLContext {
162162

163163
/// this value will be written to the signal register as the last
164164
/// item in the dma chain. The method to query its value is below.
165-
static const tU64 Ps2glSignalId = 0xffffffff00000000 | (tU32)'G' << 24 | (tU32)'L' << 16;
165+
static const uint64_t Ps2glSignalId = 0xffffffff00000000 | (uint32_t)'G' << 24 | (uint32_t)'L' << 16;
166166

167167
/// Semaphores signaled by the gs int handler
168168
static int RenderingFinishedSemaId, ImmediateRenderingFinishedSemaId, VsyncSemaId;
@@ -234,7 +234,7 @@ class CGLContext {
234234
* This is the upper 16 bits of the 32-bit values written to the signal
235235
* register by ps2gl. (The lower 16 bits are used to differentiate signals.)
236236
*/
237-
static tU16 GetPs2glSignalId() { return (tU16)(Ps2glSignalId >> 16); }
237+
static uint16_t GetPs2glSignalId() { return (uint16_t)(Ps2glSignalId >> 16); }
238238

239239
/**
240240
* util - add a block of memory to a list to be freed at the end of the
@@ -374,19 +374,19 @@ class CGLContext {
374374

375375
// ps2 rendering
376376

377-
inline tU32 GetRendererContextChanged() const { return RendererContextChanged; }
377+
inline uint32_t GetRendererContextChanged() const { return RendererContextChanged; }
378378
inline void SetRendererContextChanged(bool changed)
379379
{
380380
RendererContextChanged = (changed) ? 0xff : 0;
381381
}
382382

383-
inline tU32 GetGsContextChanged() const { return GsContextChanged; }
383+
inline uint32_t GetGsContextChanged() const { return GsContextChanged; }
384384
inline void SetGsContextChanged(bool changed)
385385
{
386386
GsContextChanged = (changed) ? 0xff : 0;
387387
}
388388

389-
inline tU32 GetRendererPropsChanged() const { return RendererPropsChanged; }
389+
inline uint32_t GetRendererPropsChanged() const { return RendererPropsChanged; }
390390
inline void SetRendererPropsChanged(bool changed)
391391
{
392392
RendererPropsChanged = (changed) ? 0xff : 0;

include/ps2gl/gmanager.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class CVertArray {
8080
*/
8181

8282
typedef struct {
83-
tU64 requirements;
84-
tU64 rendererReqMask;
83+
uint64_t requirements;
84+
uint64_t rendererReqMask;
8585
bool mergeContiguous;
8686
} tUserPrimEntry;
8787

@@ -132,8 +132,8 @@ class CGeomManager {
132132
static inline bool IsUserPrimType(unsigned int prim) { return (prim & 0x80000000); }
133133

134134
static inline void RegisterUserPrimType(GLenum prim,
135-
tU64 requirements,
136-
tU64 rendererReqMask,
135+
uint64_t requirements,
136+
uint64_t rendererReqMask,
137137
bool mergeContiguous)
138138
{
139139
CheckPrimAccess(prim);
@@ -143,7 +143,7 @@ class CGeomManager {
143143
UserPrimTypes[prim].mergeContiguous = mergeContiguous;
144144
}
145145

146-
static inline tU64 GetUserPrimRequirements(GLenum prim)
146+
static inline uint64_t GetUserPrimRequirements(GLenum prim)
147147
{
148148
CheckPrimAccess(prim);
149149
prim &= 0x7fffffff;
@@ -157,7 +157,7 @@ class CGeomManager {
157157
return UserPrimTypes[prim].mergeContiguous;
158158
}
159159

160-
static inline tU64 GetUserPrimReqMask(GLenum prim)
160+
static inline uint64_t GetUserPrimReqMask(GLenum prim)
161161
{
162162
CheckPrimAccess(prim);
163163
prim &= 0x7fffffff;
@@ -185,8 +185,8 @@ class CGeomManager {
185185

186186
// user state
187187

188-
virtual void EnableCustom(tU64 flag) = 0;
189-
virtual void DisableCustom(tU64 flag) = 0;
188+
virtual void EnableCustom(uint64_t flag) = 0;
189+
virtual void DisableCustom(uint64_t flag) = 0;
190190

191191
// rendering interface
192192

include/ps2gl/immgmanager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class CImmGeomManager : public CGeomManager {
6464

6565
// user state
6666

67-
void EnableCustom(tU64 flag) { RendererManager.EnableCustom(flag); }
68-
void DisableCustom(tU64 flag) { RendererManager.DisableCustom(flag); }
67+
void EnableCustom(uint64_t flag) { RendererManager.EnableCustom(flag); }
68+
void DisableCustom(uint64_t flag) { RendererManager.DisableCustom(flag); }
6969

7070
// geometry specification
7171

include/ps2gl/indexed_renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CIndexedRenderer : public CBaseRenderer {
1818
int inQuadsPerVert, int outQuadsPerVert,
1919
const char* name);
2020

21-
virtual void InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged);
21+
virtual void InitContext(GLenum primType, uint32_t rcChanges, bool userRcChanged);
2222
virtual void DrawIndexedArrays(CGeometryBlock& block);
2323
virtual int GetPacketQwordSize(const CGeometryBlock& geometry);
2424
virtual CRendererProps GetRenderContextDeps();

include/ps2gl/linear_renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CLinearRenderer : public CBaseRenderer {
5757
{
5858
}
5959

60-
virtual void InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged);
60+
virtual void InitContext(GLenum primType, uint32_t rcChanges, bool userRcChanged);
6161
virtual void DrawLinearArrays(CGeometryBlock& block);
6262
virtual int GetPacketQwordSize(const CGeometryBlock& geometry);
6363
virtual CRendererProps GetRenderContextDeps();

0 commit comments

Comments
 (0)