From 103ee7a40b9430dd35050d15de4befdea273b9f2 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 4 Feb 2012 21:35:00 +0000 Subject: [PATCH] rotatesprite(..., windowx1,windowy1,windowx2,windowy2) --> rotatesprite_win git-svn-id: https://svn.eduke32.com/eduke32@2318 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 5 +++ polymer/eduke32/source/astub.c | 16 ++++---- polymer/eduke32/source/game.c | 57 +++++++++++++-------------- polymer/eduke32/source/player.c | 16 ++++---- 4 files changed, 48 insertions(+), 46 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 28727c9bd..2370a1c45 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -602,6 +602,11 @@ static inline void rotatesprite_fs(int32_t sx, int32_t sy, int32_t z, int16_t a, rotatesprite(sx, sy, z, a, picnum, dashade, dapalnum, dastat, 0,0,xdim-1,ydim-1); } +static inline void rotatesprite_win(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat) +{ + rotatesprite(sx, sy, z, a, picnum, dashade, dapalnum, dastat, windowx1,windowy1,windowx2,windowy2); +} + void bfirst_search_init(int16_t *list, uint8_t *bitmap, int32_t *eltnumptr, int32_t maxnum, int16_t firstelt); void bfirst_search_try(int16_t *list, uint8_t *bitmap, int32_t *eltnumptr, int16_t elt); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 9dd79092b..fd85195db 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9389,7 +9389,7 @@ static int32_t registerosdcommands(void) #define DUKEOSD #ifdef DUKEOSD -#if 0 +# if 0 void GAME_drawosdchar(int32_t x, int32_t y, char ch, int32_t shade, int32_t pal) { int32_t ac; @@ -9420,14 +9420,14 @@ void GAME_drawosdstr(int32_t x, int32_t y, char *ch, int32_t len, int32_t shade, else x += tilesizx[ac]; } } -#endif +# endif static int32_t GetTime(void) { return totalclock; } -#if 0 +# if 0 void GAME_drawosdcursor(int32_t x, int32_t y, int32_t type, int32_t lastkeypress) { int32_t ac; @@ -9448,7 +9448,7 @@ int32_t GAME_getrowheight(int32_t w) { return w>>3; } -#endif +# endif //#define BGTILE 311 //#define BGTILE 1156 @@ -9463,7 +9463,7 @@ void GAME_clearbackground(int32_t numcols, int32_t numrows) { UNREFERENCED_PARAMETER(numcols); -#ifdef USE_OPENGL +# ifdef USE_OPENGL // if (getrendermode() < 3) bits = BITS; // else if (rendmode>=3 && qsetmode==200) @@ -9497,7 +9497,7 @@ void GAME_clearbackground(int32_t numcols, int32_t numrows) return; } -#endif +# endif CLEARLINES2D(0, min(ydim, numrows*8+8), editorcolors[16]); } @@ -9518,9 +9518,7 @@ static void m32_osdsetfunctions(void) NULL ); } - - -#endif +#endif // defined DUKEOSD enum { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 9fe2ac8e3..2155d6748 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -679,8 +679,8 @@ void G_DrawTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t or if (orientation&4) a = 1024; - rotatesprite((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), - 65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), + 65536L,a,tilenum,shade,p,2|orientation); } void G_DrawTilePal(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p) @@ -690,8 +690,8 @@ void G_DrawTilePal(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t if (orientation&4) a = 1024; - rotatesprite((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), - 65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), + 65536L,a,tilenum,shade,p,2|orientation); } void G_DrawTileSmall(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation) @@ -701,8 +701,8 @@ void G_DrawTileSmall(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32 if (orientation&4) a = 1024; - rotatesprite((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), - 32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), + 32768L,a,tilenum,shade,p,2|orientation); } void G_DrawTilePalSmall(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p) @@ -712,8 +712,8 @@ void G_DrawTilePalSmall(int32_t x, int32_t y, int32_t tilenum, int32_t shade, in if (orientation&4) a = 1024; - rotatesprite((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), - 32768L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((orientation&ROTATESPRITE_MAX)?x:(x<<16),(orientation&ROTATESPRITE_MAX)?y:(y<<16), + 32768L,a,tilenum,shade,p,2|orientation); } #define POLYMOSTTRANS (1) @@ -1044,32 +1044,32 @@ static void G_DrawInventory(DukePlayer_t *p) switch (n&(1<inven_icon == j+1) - rotatesprite((xoff-2)<<16,(y+19)<<16,65536L,1024,ARROW,-32,0,2+16,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((xoff-2)<<16,(y+19)<<16,65536L,1024,ARROW,-32,0,2+16); } j++; @@ -2449,9 +2449,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 if (j < 22000) j = 22000; else if (j > (65536<<1)) j = (65536<<1); - rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j,daang,i,sprite[g_player[p].ps->i].shade, - (g_player[p].ps->cursectnum > -1)?sector[g_player[p].ps->cursectnum].floorpal:0, - 0,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j,daang,i,sprite[g_player[p].ps->i].shade, + (g_player[p].ps->cursectnum > -1)?sector[g_player[p].ps->cursectnum].floorpal:0, 0); } } } @@ -2865,8 +2864,8 @@ void G_DisplayRest(int32_t smoothratio) if (apScriptGameEvent[EVENT_DISPLAYCROSSHAIR]) VM_OnEvent(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, -1); if (aGameVars[g_iReturnVarID].val.lValue == 0) - rotatesprite((160L-(g_player[myconnectindex].ps->look_ang>>1))<<16,100L<<16,scale(65536,ud.crosshairscale,100), - 0,CROSSHAIR,0,CROSSHAIR_PAL,2+1,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((160L-(g_player[myconnectindex].ps->look_ang>>1))<<16,100L<<16,scale(65536,ud.crosshairscale,100), + 0,CROSSHAIR,0, CROSSHAIR_PAL,2+1); } #if 0 if (GametypeFlags[ud.coop] & GAMETYPE_TDM) @@ -2877,7 +2876,7 @@ void G_DisplayRest(int32_t smoothratio) { j = min(max((G_GetAngleDelta(getangle(g_player[i].ps->pos.x-g_player[myconnectindex].ps->pos.x, g_player[i].ps->pos.y-g_player[myconnectindex].ps->pos.y),g_player[myconnectindex].ps->ang))>>1,-160),160); - rotatesprite((160-j)<<16,100L<<16,65536L,0,DUKEICON,0,0,2+1,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win((160-j)<<16,100L<<16,65536L,0,DUKEICON,0,0,2+1); } } } @@ -3673,7 +3672,7 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) i = sintable[i+512]*8 + sintable[i]*5; if ((1-ud.detail) == 0) i >>= 1; i>>=(tiltcs-1); // JBF 20030807 - rotatesprite(160<<16,100<<16,i,tang+512,TILE_TILT,0,0,4+2+64,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(160<<16,100<<16,i,tang+512,TILE_TILT,0,0,4+2+64); walock[TILE_TILT] = 199; } } @@ -11673,19 +11672,19 @@ static void G_DrawCameraText(int16_t i) if (!T1) { - rotatesprite(24<<16,33<<16,65536L,0,CAMCORNER,0,0,2,windowx1,windowy1,windowx2,windowy2); - rotatesprite((320-26)<<16,34<<16,65536L,0,CAMCORNER+1,0,0,2,windowx1,windowy1,windowx2,windowy2); - rotatesprite(22<<16,163<<16,65536L,512,CAMCORNER+1,0,0,2+4,windowx1,windowy1,windowx2,windowy2); - rotatesprite((310-10)<<16,163<<16,65536L,512,CAMCORNER+1,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(24<<16,33<<16,65536L,0,CAMCORNER,0,0,2); + rotatesprite_win((320-26)<<16,34<<16,65536L,0,CAMCORNER+1,0,0,2); + rotatesprite_win(22<<16,163<<16,65536L,512,CAMCORNER+1,0,0,2+4); + rotatesprite_win((310-10)<<16,163<<16,65536L,512,CAMCORNER+1,0,0,2); if (totalclock&16) - rotatesprite(46<<16,32<<16,65536L,0,CAMLIGHT,0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(46<<16,32<<16,65536L,0,CAMLIGHT,0,0,2); } else { flipbits = (totalclock<<1)&48; for (x=0; x<394; x+=64) for (y=0; y<200; y+=64) - rotatesprite(x<<16,y<<16,65536L,0,STATIC,0,0,2+flipbits,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(x<<16,y<<16,65536L,0,STATIC,0,0,2+flipbits); } } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index bfc8d74c2..15b67e539 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2016,9 +2016,9 @@ static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shad if (getrendermode() >= 3 && usemodels && md_tilehasmodel(tilenum,p) > 0) y += (224-weapsc(224)); #endif - rotatesprite(weapsc((orientation&1024)?x:(x<<16))+((xoff-weapsc(xoff))<<16), - weapsc((orientation&1024)?y:(y<<16))+((200-weapsc(200))<<16), - weapsc(65536L),a,tilenum,shade,p,(2|orientation),windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(weapsc((orientation&1024)?x:(x<<16))+((xoff-weapsc(xoff))<<16), + weapsc((orientation&1024)?y:(y<<16))+((200-weapsc(200))<<16), + weapsc(65536L),a,tilenum,shade,p,(2|orientation)); } static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p, uint8_t slot) @@ -2067,9 +2067,9 @@ static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shad case HANDREMOTE_WEAPON: case HANDBOMB_WEAPON: case SHOTGUN_WEAPON: - rotatesprite(160<<16,(180+(g_player[screenpeek].ps->weapon_pos*g_player[screenpeek].ps->weapon_pos))<<16, - scale(65536,ud.statusbarscale,100),0,g_currentweapon==GROW_WEAPON?GROWSPRITEICON:WeaponPickupSprites[g_currentweapon], - 0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(160<<16,(180+(g_player[screenpeek].ps->weapon_pos*g_player[screenpeek].ps->weapon_pos))<<16, + scale(65536,ud.statusbarscale,100),0,g_currentweapon==GROW_WEAPON?GROWSPRITEICON:WeaponPickupSprites[g_currentweapon], + 0,0,2); return; default: return; @@ -2225,8 +2225,8 @@ void P_DisplayScuba(int32_t snum) if (g_player[snum].ps->scuba_on) { - rotatesprite(43<<16,(200-tilesizy[SCUBAMASK])<<16,65536,0,SCUBAMASK,0,p,2+16,windowx1,windowy1,windowx2,windowy2); - rotatesprite((320-43)<<16,(200-tilesizy[SCUBAMASK])<<16,65536,1024,SCUBAMASK,0,p,2+4+16,windowx1,windowy1,windowx2,windowy2); + rotatesprite_win(43<<16,(200-tilesizy[SCUBAMASK])<<16,65536,0,SCUBAMASK,0,p,2+16); + rotatesprite_win((320-43)<<16,(200-tilesizy[SCUBAMASK])<<16,65536,1024,SCUBAMASK,0,p,2+4+16); } }