From 423263330ca6d5419019644842db4880eb01f905 Mon Sep 17 00:00:00 2001 From: plagman Date: Mon, 28 Feb 2011 03:56:37 +0000 Subject: [PATCH] Add Polymer support to rotatesprite, which hooks up highpal amongst other things. git-svn-id: https://svn.eduke32.com/eduke32@1812 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/polymer.h | 3 ++- polymer/eduke32/build/src/engine.c | 3 --- polymer/eduke32/build/src/polymer.c | 27 ++++++++++++------------- polymer/eduke32/build/src/polymost.c | 11 ++++++++++ 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index 60b52404c..43785112d 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -289,7 +289,8 @@ void polymer_loadboard(void); void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int32_t dahoriz, int16_t dacursectnum); void polymer_drawmasks(void); void polymer_editorpick(void); -void polymer_rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2); +void polymer_inb4rotatesprite(int16_t tilenum, char pal, int8_t shade); +void polymer_postrotatesprite(void); void polymer_drawmaskwall(int32_t damaskwallcnt); void polymer_drawsprite(int32_t snum); void polymer_setanimatesprites(animatespritesptr animatesprites, int32_t x, int32_t y, int32_t a, int32_t smoothratio); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 5b2c65ff4..6fde208ae 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -5149,9 +5149,6 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t //============================================================================= //POLYMOST BEGINS #ifdef POLYMOST if (rendmode >= 3 && qsetmode == 200) { polymost_dorotatesprite(sx,sy,z,a,picnum,dashade,dapalnum,dastat,cx1,cy1,cx2,cy2,uniqid); return; } -# ifdef POLYMER - if (rendmode == 4 && qsetmode == 200) { polymer_rotatesprite(sx,sy,z,a,picnum,dashade,dapalnum,dastat,cx1,cy1,cx2,cy2); return; } -#endif #endif //============================================================================= //POLYMOST ENDS diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index a396ee636..47d718cd9 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -585,6 +585,8 @@ _prprograminfo prprograms[1 << PR_BIT_COUNT]; int32_t overridematerial; int32_t globaloldoverridematerial; +int32_t rotatespritematerialbits; + // RENDER TARGETS _prrt *prrts; @@ -1199,21 +1201,18 @@ void polymer_editorpick(void) searchit = 0; } -void polymer_rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, - char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2) +void polymer_inb4rotatesprite(int16_t tilenum, char pal, int8_t shade) { - UNREFERENCED_PARAMETER(sx); - UNREFERENCED_PARAMETER(sy); - UNREFERENCED_PARAMETER(z); - UNREFERENCED_PARAMETER(a); - UNREFERENCED_PARAMETER(picnum); - UNREFERENCED_PARAMETER(dashade); - UNREFERENCED_PARAMETER(dapalnum); - UNREFERENCED_PARAMETER(dastat); - UNREFERENCED_PARAMETER(cx1); - UNREFERENCED_PARAMETER(cy1); - UNREFERENCED_PARAMETER(cx2); - UNREFERENCED_PARAMETER(cy2); + _prmaterial rotatespritematerial; + + polymer_getbuildmaterial(&rotatespritematerial, tilenum, pal, shade, 4); + + rotatespritematerialbits = polymer_bindmaterial(rotatespritematerial, NULL, 0); +} + +void polymer_postrotatesprite(void) +{ + polymer_unbindmaterial(rotatespritematerialbits); } void polymer_drawmaskwall(int32_t damaskwallcnt) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index e445ce63d..468e6039b 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -5454,6 +5454,12 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 bglDisable(GL_DEPTH_TEST); bglDisable(GL_ALPHA_TEST); bglEnable(GL_TEXTURE_2D); + +# ifdef POLYMER + if (rendmode >= 4) { + polymer_inb4rotatesprite(picnum, dapalnum, dashade); + } +# endif } #endif @@ -5607,6 +5613,11 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 #ifdef USE_OPENGL if (rendmode >= 3) { +# ifdef POLYMER + if (rendmode >= 4) { + polymer_postrotatesprite(); + } +# endif bglMatrixMode(GL_PROJECTION); bglPopMatrix(); bglMatrixMode(GL_MODELVIEW); bglPopMatrix(); }