Browse Source

Simplified toggle behavior for button inputs, and added an option to toggle texturing with the circle button.

unrollquadloop
Nico de Poel 3 years ago
parent
commit
989ec0bafb
  1. 1
      display.c
  2. 1
      display.h
  3. 25
      input.c
  4. 2
      world.c

1
display.c

@ -45,6 +45,7 @@ u_long *curOT;
VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE }; VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE };
u_short polyCount; u_short polyCount;
u_char enableTexturing = 1;
void display_init() void display_init()
{ {

1
display.h

@ -11,6 +11,7 @@ extern MATRIX vp_matrix;
extern u_long *curOT; extern u_long *curOT;
extern u_short polyCount; extern u_short polyCount;
extern u_char enableTexturing;
void display_init(); void display_init();
void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScreenHeight); void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScreenHeight);

25
input.c

@ -6,15 +6,14 @@
#include <psxpad.h> #include <psxpad.h>
static u_char padBuffer[2][34]; static u_char padBuffer[2][34];
static u_short prevButtons = 0xFFFF;
static const int moveSpeed = 1024; static const int moveSpeed = 1024;
static const short rotSpeed = 1024; static const short rotSpeed = 1024;
static const char deadZone = 0x30; static const char deadZone = 0x30;
static u_char dispmode = 0; static u_char dispmode = 0;
static u_char dispmode_held = 0;
static u_char widescreen = 0; static u_char widescreen = 0;
static u_char widescreen_held = 0;
void input_init() void input_init()
{ {
@ -96,33 +95,21 @@ void input_process()
// Look up // Look up
cam_rot.vx += rotInterval; cam_rot.vx += rotInterval;
} }
if (!(buttons & PAD_SELECT))
if (!(buttons & PAD_SELECT) && (prevButtons & PAD_SELECT))
{ {
// Switch display mode // Switch display mode
if (!dispmode_held)
{
dispmode_held = 1;
//dispmode = (dispmode + 1) & 0x3; //dispmode = (dispmode + 1) & 0x3;
//display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL); //display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL);
display_reset(!GetVideoMode(), 0, widescreen, NULL); display_reset(!GetVideoMode(), 0, widescreen, NULL);
} }
}
else
{
dispmode_held = 0;
}
if (!(buttons & PAD_START))
if (!(buttons & PAD_START) && (prevButtons & PAD_START))
{ {
if (!widescreen_held)
{
widescreen_held = 1;
widescreen = !widescreen; widescreen = !widescreen;
display_reset(GetVideoMode(), 0, widescreen, NULL); display_reset(GetVideoMode(), 0, widescreen, NULL);
} }
}
else
if (!(buttons & PAD_CIRCLE) && (prevButtons & PAD_CIRCLE))
{ {
widescreen_held = 0;
enableTexturing = !enableTexturing;
} }
// Check for analog controller // Check for analog controller
@ -153,4 +140,6 @@ void input_process()
// Look up/down // Look up/down
cam_rot.vx -= (rightJoyY * rotInterval) >> 7; cam_rot.vx -= (rightJoyY * rotInterval) >> 7;
} }
prevButtons = buttons;
} }

2
world.c

@ -304,7 +304,7 @@ static void world_drawface(const world_t *world, const ps1bsp_face_t *face)
if ((dot >= 0) ^ face->side) if ((dot >= 0) ^ face->side)
return; return;
if (0)
if (!enableTexturing)
{ {
// Draw untextured, vertex colored polygons // Draw untextured, vertex colored polygons
SVECTOR *vecs = (SVECTOR*)(scratchpad + 256); SVECTOR *vecs = (SVECTOR*)(scratchpad + 256);

Loading…
Cancel
Save