From 4faab2beb80e6e0992bacee3fb605d242600b922 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Jan 2017 11:21:36 +0000 Subject: [PATCH] SW: Fix some vec2_t stuff I missed. git-svn-id: https://svn.eduke32.com/eduke32@6049 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sw/src/mclip.c | 33 +++++++++++++------------ polymer/eduke32/source/sw/src/mclip.h | 2 +- polymer/eduke32/source/sw/src/rotator.c | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/polymer/eduke32/source/sw/src/mclip.c b/polymer/eduke32/source/sw/src/mclip.c index 858953697..012fad66e 100644 --- a/polymer/eduke32/source/sw/src/mclip.c +++ b/polymer/eduke32/source/sw/src/mclip.c @@ -403,7 +403,7 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist) return TRUE; } -int testquadinsect(int *point_num, int qx[], int qy[], short sectnum) +int testquadinsect(int *point_num, vec2_t const * q, short sectnum) { int i,next_i; @@ -411,7 +411,7 @@ int testquadinsect(int *point_num, int qx[], int qy[], short sectnum) for (i=0; i < 4; i++) { - if (!inside(qx[i], qy[i], sectnum)) + if (!inside(q[i].x, q[i].y, sectnum)) { ////DSPRINTF(ds,"inside %ld failed",i); //MONO_PRINT(ds); @@ -425,10 +425,10 @@ int testquadinsect(int *point_num, int qx[], int qy[], short sectnum) for (i=0; i<4; i++) { next_i = MOD4(i+1); - if (!cansee(qx[i], qy[i],0x3fffffff, sectnum, - qx[next_i], qy[next_i],0x3fffffff, sectnum)) + if (!cansee(q[i].x, q[i].y,0x3fffffff, sectnum, + q[next_i].x, q[next_i].y,0x3fffffff, sectnum)) { - DSPRINTF(ds,"cansee %ld failed, x1 %d, y1 %d, x2 %d, y2 %d, sectnum %d",i, qx[i], qy[i], qx[next_i], qy[next_i], sectnum); + DSPRINTF(ds,"cansee %ld failed, x1 %d, y1 %d, x2 %d, y2 %d, sectnum %d",i, q[i].x, q[i].y, q[next_i].x, q[next_i].y, sectnum); MONO_PRINT(ds); return FALSE; @@ -446,18 +446,19 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) SECTOR_OBJECTp sop = pp->sop; WALLp wp; int count=0; - int i, x[4], y[4]; + int i; + vec2_t xy[4]; short startwall,endwall; int point_num; for (i = 0; i < 4; i++) { - x[i] = qx[i] + (pp->xvect>>14); - y[i] = qy[i] + (pp->yvect>>14); + xy[i].x = qx[i] + (pp->xvect>>14); + xy[i].y = qy[i] + (pp->yvect>>14); } //Given the 4 points: x[4], y[4] - if (testquadinsect(&point_num, x, y, pp->cursectnum)) + if (testquadinsect(&point_num, xy, pp->cursectnum)) { pp->posx += (pp->xvect>>14); pp->posy += (pp->yvect>>14); @@ -471,10 +472,10 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) { for (i = 0; i < 4; i++) { - x[i] = qx[i] - (pp->yvect>>15); - y[i] = qy[i] + (pp->xvect>>15); + xy[i].x = qx[i] - (pp->yvect>>15); + xy[i].y = qy[i] + (pp->xvect>>15); } - if (testquadinsect(&point_num, x, y, pp->cursectnum)) + if (testquadinsect(&point_num, xy, pp->cursectnum)) { pp->posx -= (pp->yvect>>15); pp->posy += (pp->xvect>>15); @@ -487,10 +488,10 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) { for (i = 0; i < 4; i++) { - x[i] = qx[i] + (pp->yvect>>15); - y[i] = qy[i] - (pp->xvect>>15); + xy[i].x = qx[i] + (pp->yvect>>15); + xy[i].y = qy[i] - (pp->xvect>>15); } - if (testquadinsect(&point_num, x, y, pp->cursectnum)) + if (testquadinsect(&point_num, xy, pp->cursectnum)) { pp->posx += (pp->yvect>>15); pp->posy -= (pp->xvect>>15); @@ -543,7 +544,7 @@ short RectClipTurn(PLAYERp pp, short new_ang, int *qx, int *qy, int *ox, int *oy } //Given the 4 points: x[4], y[4] - if (testquadinsect(&point_num, x, y, pp->cursectnum)) + if (testquadinsect(&point_num, xy, pp->cursectnum)) { // move to new pos for (i = 0; i < 4; i++) diff --git a/polymer/eduke32/source/sw/src/mclip.h b/polymer/eduke32/source/sw/src/mclip.h index 18bc45472..c8544144f 100644 --- a/polymer/eduke32/source/sw/src/mclip.h +++ b/polymer/eduke32/source/sw/src/mclip.h @@ -28,7 +28,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms int MultiClipMove(PLAYERp pp, int z, int floor_dist); short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist); -int testquadinsect(int *point_num, int *qx, int *qy, short sectnum); +int testquadinsect(int *point_num, vec2_t const * q, short sectnum); int RectClipMove(PLAYERp pp, int *qx, int *qy); int testpointinquad(int x, int y, int *qx, int *qy); //short RectClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist, int *qx, int *qy); diff --git a/polymer/eduke32/source/sw/src/rotator.c b/polymer/eduke32/source/sw/src/rotator.c index 578f52558..84fb7633c 100644 --- a/polymer/eduke32/source/sw/src/rotator.c +++ b/polymer/eduke32/source/sw/src/rotator.c @@ -411,7 +411,7 @@ int DoRotatorMove(short SpriteNum) vec2_t const orig = { r->origx[ndx], r->origy[ndx] }; rotatepoint(*(vec2_t *)&pivot->x, orig, r->pos, &nxy); - dragpoint(w, nx, ny, 0); + dragpoint(w, nxy.x, nxy.y, 0); ndx++; }