diff --git a/source/build/include/build.h b/source/build/include/build.h index 6203bebaa..0074c6016 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -510,7 +510,7 @@ EXTERN char *palookup[MAXPALOOKUPS]; extern uint8_t *basepaltable[MAXBASEPALS]; EXTERN uint8_t paletteloaded; EXTERN char *blendtable[MAXBLENDTABS]; -EXTERN uint8_t whitecol, redcol; +EXTERN uint8_t whitecol, redcol, blackcol; EXTERN int32_t maxspritesonscreen; @@ -866,6 +866,7 @@ static FORCE_INLINE void rotatesprite_win(int32_t sx, int32_t sy, int32_t z, int void getzrange(const vec3_t *pos, int16_t sectnum, int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit, int32_t walldist, uint32_t cliptype) ATTRIBUTE((nonnull(1,3,4,5,6))); +extern vec2_t hitscangoal; int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, hitdata_t *hitinfo, uint32_t cliptype) ATTRIBUTE((nonnull(1,6))); void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, diff --git a/source/build/include/common.h b/source/build/include/common.h index 12c7546ca..669660d74 100644 --- a/source/build/include/common.h +++ b/source/build/include/common.h @@ -78,11 +78,8 @@ static inline int32_t sepldist(const int32_t dx, const int32_t dy) { vec2_t d = { klabs(dx), klabs(dy) }; - if (playing_rr) - { - if (!d.y) return d.x; - if (!d.x) return d.y; - } + if (!d.y) return d.x; + if (!d.x) return d.y; if (d.x < d.y) swaplong(&d.x, &d.y); diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 7b3192d46..ce07b885b 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -6796,16 +6796,13 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da int32_t zoomsc, sx=*sxptr, sy=*syptr; int32_t ouryxaspect = yxaspect, ourxyaspect = xyaspect; - if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK) - sx += NEGATE_ON_CONDITION(scale(120<<16,xdim,ydim) - (160<<16), !(dastat & RS_ALIGN_R)); - sy += rotatesprite_y_offset; - // screen center to s[xy], 320<<16 coords. - const int32_t normxofs = sx-(320<<15), normyofs = sy-(200<<15); - if (!(dastat & RS_STRETCH) && 4*ydim <= 3*xdim) { + if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK) + sx += NEGATE_ON_CONDITION(scale(120<<16,xdim,ydim) - (160<<16), !(dastat & RS_ALIGN_R)); + if ((dastat & RS_ALIGN_MASK) == RS_ALIGN_MASK) ydim = scale(xdim, 3, 4); else @@ -6818,6 +6815,9 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da ouryxaspect = mulscale16(ouryxaspect, rotatesprite_yxaspect); ourxyaspect = divscale16(ourxyaspect, rotatesprite_yxaspect); + // screen center to s[xy], 320<<16 coords. + const int32_t normxofs = sx-(320<<15), normyofs = sy-(200<<15); + // nasty hacks go here if (!(dastat & RS_NOCLIP)) { @@ -7150,7 +7150,7 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t if (d4 >= u4) vlineasm4(d4-u4+1, (char *)(ylookup[u4]+p)); - i = p+ylookup[d4+1]; + intptr_t i = p+ylookup[d4+1]; if (y2ve[0] > d4) prevlineasm1(vince[0],palookupoffse[0],y2ve[0]-d4-1,vplce[0],bufplce[0],i+0); if (y2ve[1] > d4) prevlineasm1(vince[1],palookupoffse[1],y2ve[1]-d4-1,vplce[1],bufplce[1],i+1); if (y2ve[2] > d4) prevlineasm1(vince[2],palookupoffse[2],y2ve[2]-d4-1,vplce[2],bufplce[2],i+2); @@ -7174,7 +7174,7 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t if (d4 >= u4) mvlineasm4(d4-u4+1, (char *)(ylookup[u4]+p)); - i = p+ylookup[d4+1]; + intptr_t i = p+ylookup[d4+1]; if (y2ve[0] > d4) mvlineasm1(vince[0],palookupoffse[0],y2ve[0]-d4-1,vplce[0],bufplce[0],i+0); if (y2ve[1] > d4) mvlineasm1(vince[1],palookupoffse[1],y2ve[1]-d4-1,vplce[1],bufplce[1],i+1); if (y2ve[2] > d4) mvlineasm1(vince[2],palookupoffse[2],y2ve[2]-d4-1,vplce[2],bufplce[2],i+2); diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index 49944fc74..569ffef40 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -28,7 +28,6 @@ palette_t curpalette[256]; // the current palette, unadjusted for brightness o palette_t curpalettefaded[256]; // the current palette, adjusted for brightness and tint (ie. what gets sent to the card) palette_t palfadergb = { 0, 0, 0, 0 }; char palfadedelta = 0; -uint8_t blackcol; int32_t realmaxshade; float frealmaxshade; @@ -266,13 +265,15 @@ void paletteLoadFromDisk(void) // Read the entries above and on the diagonal, if the table is // thought as being row-major. - if (read_and_test(fil, &transluc[256*i + i], 256-i-1)) + if (read_and_test(fil, &transluc[256*i + i + 1], 255-i)) return; // Duplicate the entries below the diagonal. - for (bssize_t j=0; j