Skip to content

Commit 3b3dcde

Browse files
authored
Merge pull request #283 from sblondon/remove-unused-macros
Remove unused macros and magical values
2 parents 3af3247 + 79ac3b7 commit 3b3dcde

File tree

20 files changed

+30
-51
lines changed

20 files changed

+30
-51
lines changed

src/samples/gu/beginobject/beginobject.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ typedef struct VERT {
3737
#define SCR_HEIGHT (272)
3838
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
3939
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
40-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
4140

4241
#define TORUS_SLICES 24 // numc
4342
#define TORUS_ROWS 24 // numt
@@ -126,8 +125,8 @@ int main(int argc, char* argv[]) {
126125

127126
sceGuStart(GU_DIRECT,list);
128127
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
129-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
130-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
128+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
129+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
131130
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
132131
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
133132
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/celshading/celshading.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ typedef struct Vx_v32f {
4545
#define SCR_HEIGHT (272)
4646
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
4747
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
48-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
4948

5049
#define TORUS_SLICES 48 // numc
5150
#define TORUS_ROWS 48 // numt
@@ -118,8 +117,8 @@ int main(int argc, char* argv[]) {
118117

119118
sceGuStart(GU_DIRECT,list);
120119
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
121-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
122-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
120+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
121+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
123122
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
124123
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
125124
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/clut/clut.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ int SetupCallbacks();
3636
#define SCR_HEIGHT (272)
3737
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
3838
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
39-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
4039

4140
unsigned int colors[8] =
4241
{

src/samples/gu/envmap/envmap.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ extern unsigned char env0_start[];
3535
#define SCR_WIDTH (480)
3636
#define SCR_HEIGHT (272)
3737
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
38-
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
39-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
4038

4139
#define TORUS_SLICES 48 // numc
4240
#define TORUS_ROWS 48 // numt

src/samples/gu/integerdrawing/integerdrawing.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static const unsigned int __attribute__((aligned(16))) texture[256] = {
9696
#define SCR_HEIGHT (272)
9797
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
9898
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
99-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
10099

101100
typedef struct {
102101
float s, t;
@@ -189,8 +188,8 @@ int main(int argc, char* argv[]) {
189188

190189
sceGuStart(GU_DIRECT,list);
191190
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
192-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
193-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
191+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
192+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
194193
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
195194
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
196195
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/morph/morph.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ int SetupCallbacks();
4848
#define SCR_HEIGHT (272)
4949
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
5050
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
51-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
5251

5352
#define ROWS (64)
5453
#define COLS (64)
@@ -112,8 +111,8 @@ int main(int argc, char* argv[])
112111

113112
sceGuStart(GU_DIRECT,list);
114113
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
115-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
116-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
114+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
115+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
117116
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
118117
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
119118
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/morphskin/morphskin.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void genSkinnedMonsterCylinder( unsigned slices, unsigned rows, float length, fl
6767
#define SCR_HEIGHT (272)
6868
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
6969
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
70-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
7170

7271
#define HIERARCHY_SIZE (WEIGHTS_PER_VERTEX)
7372

@@ -89,8 +88,8 @@ int main(int argc, char* argv[])
8988

9089
sceGuStart(GU_DIRECT,list);
9190
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
92-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
93-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
91+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
92+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
9493
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
9594
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
9695
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/reflection/reflection.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ int SetupCallbacks();
106106
#define SCR_HEIGHT (272)
107107
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
108108
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
109-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
110109

111110
int main(int argc, char* argv[])
112111
{
@@ -118,8 +117,8 @@ int main(int argc, char* argv[])
118117

119118
sceGuStart(GU_DIRECT,list);
120119
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
121-
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
122-
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
120+
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)FRAME_SIZE,BUF_WIDTH);
121+
sceGuDepthBuffer((void*)(FRAME_SIZE*2),BUF_WIDTH);
123122
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
124123
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
125124
sceGuDepthRange(0xc350,0x2710);

src/samples/gu/rendertarget/rendertarget.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ void genTorus( unsigned slices, unsigned rows, float radius, float thickness,
126126
#define SCR_HEIGHT (272)
127127
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
128128
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
129-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
130129

131130
void drawCube( Texture* texture, int val )
132131
{

src/samples/gu/shadowprojection/shadowprojection.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void genTorus( unsigned slices, unsigned rows, float radius, float thickness,
7878
#define SCR_HEIGHT (272)
7979
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
8080
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
81-
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
8281

8382
typedef struct Geometry
8483
{

0 commit comments

Comments
 (0)