From 2e56e6b8bfee523f1b69bb729b56783ce75b1fea Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 6 Sep 2022 14:59:09 +0200 Subject: [PATCH] Made screen width and height into predefined constants. --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 2fbcb65..8cc9612 100644 --- a/main.c +++ b/main.c @@ -27,6 +27,9 @@ #define OTLEN 256 +#define SCREENWIDTH 320 +#define SCREENHEIGHT 240 + #define NUMVERTEXNORMALS 162 static int anorms[NUMVERTEXNORMALS][3] = { #include "ps1anorms.h" @@ -93,12 +96,12 @@ void init(void) ResetGraph(0); // Define display environments, first on top and second on bottom - SetDefDispEnv(&disp[0], 0, 0, 320, 240); - SetDefDispEnv(&disp[1], 0, 240, 320, 240); + SetDefDispEnv(&disp[0], 0, 0, SCREENWIDTH, SCREENHEIGHT); + SetDefDispEnv(&disp[1], 0, SCREENHEIGHT, SCREENWIDTH, SCREENHEIGHT); // Define drawing environments, first on bottom and second on top - SetDefDrawEnv(&draw[0], 0, 240, 320, 240); - SetDefDrawEnv(&draw[1], 0, 0, 320, 240); + SetDefDrawEnv(&draw[0], 0, SCREENHEIGHT, SCREENWIDTH, SCREENHEIGHT); + SetDefDrawEnv(&draw[1], 0, 0, SCREENWIDTH, SCREENHEIGHT); // Set and enable clear color setRGB0(&draw[0], 96, 0, 96);