From 125e7ba9ab0403fe3156b8c377d7b7e2d07d7709 Mon Sep 17 00:00:00 2001 From: Cyp Date: Fri, 8 Oct 2010 11:04:32 +0200 Subject: [PATCH] Convert pie_MatRot[XYZ] to use uint16_t instead of float. --- lib/ivis_opengl/piematrix.c | 22 ++++++------- lib/ivis_opengl/piematrix.h | 6 ++-- src/atmos.c | 8 ++--- src/bucket3d.c | 6 ++-- src/component.c | 50 +++++++++++++++--------------- src/display3d.c | 62 ++++++++++++++++++------------------- src/droid.c | 10 +++--- src/effects.c | 34 ++++++++++---------- src/mapdisplay.c | 2 +- src/projectile.c | 6 ++-- src/radar.c | 2 +- src/structure.c | 10 +++--- 12 files changed, 109 insertions(+), 109 deletions(-) diff --git a/lib/ivis_opengl/piematrix.c b/lib/ivis_opengl/piematrix.c index 3670c2763..c2e0eb002 100644 --- a/lib/ivis_opengl/piematrix.c +++ b/lib/ivis_opengl/piematrix.c @@ -180,7 +180,7 @@ void pie_MatScale(float scale) //* //****** -void pie_MatRotY(float y) +void pie_MatRotY(uint16_t y) { /* * a := angle @@ -194,10 +194,10 @@ void pie_MatRotY(float y) * curMatrix = curMatrix . [ -s 0 c 0 ] * [ 0 0 0 1 ] */ - if (y != 0.f) + if (y != 0) { int t; - int64_t cra = iCos(DEG(y)), sra = iSin(DEG(y)); + int64_t cra = iCos(y), sra = iSin(y); t = (cra*psMatrix->a - sra*psMatrix->g)>>16; psMatrix->g = (sra*psMatrix->a + cra*psMatrix->g)>>16; @@ -211,7 +211,7 @@ void pie_MatRotY(float y) psMatrix->i = (sra*psMatrix->c + cra*psMatrix->i)>>16; psMatrix->c = t; - glRotatef(y, 0.0f, 1.0f, 0.0f); + glRotatef(UNDEG(y), 0.0f, 1.0f, 0.0f); } } @@ -221,7 +221,7 @@ void pie_MatRotY(float y) //* //****** -void pie_MatRotZ(float z) +void pie_MatRotZ(uint16_t z) { /* * a := angle @@ -235,10 +235,10 @@ void pie_MatRotZ(float z) * curMatrix = curMatrix . [ 0 0 1 0 ] * [ 0 0 0 1 ] */ - if (z != 0.f) + if (z != 0) { int t; - int64_t cra = iCos(DEG(z)), sra = iSin(DEG(z)); + int64_t cra = iCos(z), sra = iSin(z); t = (cra*psMatrix->a + sra*psMatrix->d)>>16; psMatrix->d = (cra*psMatrix->d - sra*psMatrix->a)>>16; @@ -252,7 +252,7 @@ void pie_MatRotZ(float z) psMatrix->f = (cra*psMatrix->f - sra*psMatrix->c)>>16; psMatrix->c = t; - glRotatef(z, 0.0f, 0.0f, 1.0f); + glRotatef(UNDEG(z), 0.0f, 0.0f, 1.0f); } } @@ -262,7 +262,7 @@ void pie_MatRotZ(float z) //* //****** -void pie_MatRotX(float x) +void pie_MatRotX(uint16_t x) { /* * a := angle @@ -279,7 +279,7 @@ void pie_MatRotX(float x) if (x != 0.f) { int t; - int64_t cra = iCos(DEG(x)), sra = iSin(DEG(x)); + int64_t cra = iCos(x), sra = iSin(x); t = (cra*psMatrix->d + sra*psMatrix->g)>>16; psMatrix->g = (cra*psMatrix->g - sra*psMatrix->d)>>16; @@ -293,7 +293,7 @@ void pie_MatRotX(float x) psMatrix->i = (cra*psMatrix->i - sra*psMatrix->f)>>16; psMatrix->f = t; - glRotatef(x, 1.0f, 0.0f, 0.0f); + glRotatef(UNDEG(x), 1.0f, 0.0f, 0.0f); } } diff --git a/lib/ivis_opengl/piematrix.h b/lib/ivis_opengl/piematrix.h index 201f7c05d..3c2782437 100644 --- a/lib/ivis_opengl/piematrix.h +++ b/lib/ivis_opengl/piematrix.h @@ -91,9 +91,9 @@ extern void pie_MatEnd(void); extern void pie_MATTRANS(float x, float y, float z); extern void pie_TRANSLATE(float x, float y, float z); extern void pie_MatScale(float scale); -extern void pie_MatRotX(float x); -extern void pie_MatRotY(float y); -extern void pie_MatRotZ(float z); +extern void pie_MatRotX(uint16_t x); +extern void pie_MatRotY(uint16_t y); +extern void pie_MatRotZ(uint16_t z); extern int32_t pie_RotateProject(const Vector3i *src, Vector2i *dest); //************************************************************************* diff --git a/src/atmos.c b/src/atmos.c index 440db86a1..5fe8b45db 100644 --- a/src/atmos.c +++ b/src/atmos.c @@ -352,14 +352,14 @@ void renderParticle( ATPART *psPart ) dv.x = ((UDWORD)x - player.p.x) - terrainMidX * TILE_UNITS; dv.y = (UDWORD)y; dv.z = terrainMidY * TILE_UNITS - ((UDWORD)z - player.p.z); - pie_MatBegin(); /* Push the indentity matrix */ + pie_MatBegin(); /* Push the identity matrix */ pie_TRANSLATE(dv.x,dv.y,dv.z); rx = map_round(player.p.x); /* Get the x,z translation components */ rz = map_round(player.p.z); - pie_TRANSLATE(rx,0,-rz); /* Translate */ + pie_TRANSLATE(rx,0,-rz); /* Translate */ /* Make it face camera */ - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotY(-player.r.x); /* Scale it... */ pie_MatScale(psPart->size / 100.f); /* Draw it... */ diff --git a/src/bucket3d.c b/src/bucket3d.c index 43f3a7878..582236465 100644 --- a/src/bucket3d.c +++ b/src/bucket3d.c @@ -246,9 +246,9 @@ static SDWORD bucketCalculateZ(RENDER_TYPE objectType, void* pObject) psCompObj->position.y ); /* object (animation) rotations */ - pie_MatRotY(UNDEG(-psCompObj->orientation.z)); - pie_MatRotZ(UNDEG(-psCompObj->orientation.y)); - pie_MatRotX(UNDEG(-psCompObj->orientation.x)); + pie_MatRotY(-psCompObj->orientation.z); + pie_MatRotZ(-psCompObj->orientation.y); + pie_MatRotX(-psCompObj->orientation.x); z = pie_RotateProject(&position,&pixel); diff --git a/src/component.c b/src/component.c index 97037f2dd..8b0ae68e7 100644 --- a/src/component.c +++ b/src/component.c @@ -74,13 +74,13 @@ static void setMatrix(Vector3i *Position, Vector3i *Rotation, BOOL RotXYZ) pie_TRANSLATE(Position->x,Position->y,Position->z); if(RotXYZ) { - pie_MatRotX(Rotation->x); - pie_MatRotY(Rotation->y); - pie_MatRotZ(Rotation->z); + pie_MatRotX(DEG(Rotation->x)); + pie_MatRotY(DEG(Rotation->y)); + pie_MatRotZ(DEG(Rotation->z)); } else { - pie_MatRotY(Rotation->y); - pie_MatRotX(Rotation->x); - pie_MatRotZ(Rotation->z); + pie_MatRotY(DEG(Rotation->y)); + pie_MatRotX(DEG(Rotation->x)); + pie_MatRotZ(DEG(Rotation->z)); } } @@ -265,7 +265,7 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *rotation, Vector3i pie_MatBegin(); pie_TRANSLATE(strImd->connectors[i].x,strImd->connectors[i].z,strImd->connectors[i].y); - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); if (mountImd[i] != NULL) { pie_Draw3DShape(mountImd[i], 0, getPlayerColour(selectedPlayer), WZCOL_WHITE, WZCOL_BLACK, pie_BUTTON, 0); @@ -274,7 +274,7 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *rotation, Vector3i pie_TRANSLATE(mountImd[i]->connectors->x,mountImd[i]->connectors->z,mountImd[i]->connectors->y); } } - pie_MatRotX(UNDEG(rot.pitch)); + pie_MatRotX(rot.pitch); pie_Draw3DShape(weaponImd[i], 0, getPlayerColour(selectedPlayer), WZCOL_WHITE, WZCOL_BLACK, pie_BUTTON, 0); //we have a droid weapon so do we draw a muzzle flash pie_MatEnd(); @@ -715,12 +715,12 @@ static void displayCompObj(DROID *psDroid, BOOL bButton) psShapeTemp->connectors[iConnector + i].y ); } - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); /* vtol weapons inverted */ if ( iConnector >= VTOL_CONNECTOR_START ) { - pie_MatRotZ(180.f);//this might affect gun rotation + pie_MatRotZ(65536/2); //this might affect gun rotation } /* Get the mount graphic */ @@ -746,12 +746,12 @@ static void displayCompObj(DROID *psDroid, BOOL bButton) if ( iConnector >= VTOL_CONNECTOR_START ) { //pitch the barrel down - pie_MatRotX(UNDEG(-rot.pitch)); + pie_MatRotX(-rot.pitch); } else { //pitch the barrel up - pie_MatRotX(UNDEG(rot.pitch)); + pie_MatRotX(rot.pitch); } /* Get the weapon (gun?) graphic */ @@ -856,14 +856,14 @@ static void displayCompObj(DROID *psDroid, BOOL bButton) /* vtol weapons inverted */ if ( iConnector >= VTOL_CONNECTOR_START ) { - pie_MatRotZ(180.f);//this might affect gun rotation + pie_MatRotZ(65536/2); //this might affect gun rotation } pie_TRANSLATE( psShapeTemp->connectors[0].x, psShapeTemp->connectors[0].z, psShapeTemp->connectors[0].y ); - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); /* Draw it */ if (psMountShape) { @@ -898,21 +898,21 @@ static void displayCompObj(DROID *psDroid, BOOL bButton) psShape = getImdFromIndex(MI_FLAME); /* Rotate for droid */ - pie_MatRotY(UNDEG(st.rot.direction)); - pie_MatRotX(UNDEG(-st.rot.pitch)); - pie_MatRotZ(UNDEG(-st.rot.roll)); + pie_MatRotY(st.rot.direction); + pie_MatRotX(-st.rot.pitch); + pie_MatRotZ(-st.rot.roll); //rotate Y - pie_MatRotY(UNDEG(rot.direction)); + pie_MatRotY(rot.direction); - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); /* Dither on software */ pie_Draw3DShape(psShape, getModularScaledGraphicsTime(100, psShape->numFrames), 0, brightness, WZCOL_BLACK, pie_ADDITIVE, 140); /* Dither off software */ - pie_MatRotX(UNDEG(player.r.x)); - pie_MatRotY(UNDEG(player.r.y)); + pie_MatRotX(player.r.x); + pie_MatRotY(player.r.y); } } /* Pop Matrix */ @@ -1062,9 +1062,9 @@ void displayComponentObject(DROID *psDroid) pie_TRANSLATE(position.x,position.y,position.z); /* Rotate for droid */ - pie_MatRotY(UNDEG(rotation.y)); - pie_MatRotX(UNDEG(rotation.x)); - pie_MatRotZ(UNDEG(rotation.z)); + pie_MatRotY(rotation.y); + pie_MatRotX(rotation.x); + pie_MatRotZ(rotation.z); if( (gameTime-psDroid->timeLastHit < GAME_TICKS_PER_SEC) && psDroid->lastHitWeapon == WSC_ELECTRONIC) { diff --git a/src/display3d.c b/src/display3d.c index 55666fefb..452eba5c3 100644 --- a/src/display3d.c +++ b/src/display3d.c @@ -858,9 +858,9 @@ static void drawTiles(iView *player) pie_MATTRANS(0, 0, distance); /* Rotate for the player */ - pie_MatRotZ(UNDEG(player->r.z)); - pie_MatRotX(UNDEG(player->r.x)); - pie_MatRotY(UNDEG(player->r.y)); + pie_MatRotZ(player->r.z); + pie_MatRotX(player->r.x); + pie_MatRotY(player->r.y); /* Translate */ pie_TRANSLATE(-rx, -player->p.y, rz); @@ -1210,11 +1210,11 @@ void renderProjectile(PROJECTILE *psCurr) /* Rotate it to the direction it's facing */ imdRot2.y = st.rot.direction; - pie_MatRotY(UNDEG(-imdRot2.y)); + pie_MatRotY(-imdRot2.y); /* pitch it */ imdRot2.x = st.rot.pitch; - pie_MatRotX(UNDEG(imdRot2.x)); + pie_MatRotX(imdRot2.x); if (psStats->weaponSubClass == WSC_ROCKET || psStats->weaponSubClass == WSC_MISSILE || psStats->weaponSubClass == WSC_SLOWROCKET || psStats->weaponSubClass == WSC_SLOWMISSILE) @@ -1278,9 +1278,9 @@ void renderAnimComponent( const COMPONENT_OBJECT *psObj ) /* parent object rotations */ imdRot2.y = spacetime.rot.direction; - pie_MatRotY(UNDEG(-imdRot2.y)); + pie_MatRotY(-imdRot2.y); imdRot2.x = spacetime.rot.pitch; - pie_MatRotX(UNDEG(imdRot2.x)); + pie_MatRotX(imdRot2.x); /* Set frame numbers - look into this later?? FIXME!!!!!!!! */ if( psParentObj->type == OBJ_DROID ) @@ -1330,9 +1330,9 @@ void renderAnimComponent( const COMPONENT_OBJECT *psObj ) // object (animation) translations - ivis z and y flipped pie_TRANSLATE(psObj->position.x, psObj->position.z, psObj->position.y); // object (animation) rotations - pie_MatRotY(UNDEG(-psObj->orientation.z)); - pie_MatRotZ(UNDEG(-psObj->orientation.y)); - pie_MatRotX(UNDEG(-psObj->orientation.x)); + pie_MatRotY(-psObj->orientation.z); + pie_MatRotZ(-psObj->orientation.y); + pie_MatRotX(-psObj->orientation.x); pie_Draw3DShape(psObj->psShape, 0, iPlayer, brightness, WZCOL_BLACK, pie_STATIC_SHADOW, 0); @@ -1896,7 +1896,7 @@ void renderFeature(FEATURE *psFeature) pie_TRANSLATE(rx,0,-rz); rotation = psFeature->rot.direction; - pie_MatRotY(UNDEG(-rotation)); + pie_MatRotY(-rotation); brightness = pal_SetBrightness(200); //? HUH? @@ -2050,8 +2050,8 @@ void renderProximityMsg(PROXIMITY_DISPLAY *psProxDisp) } } - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); pie_Draw3DShape(proxImd, getModularScaledGraphicsTime(1000, 4), 0, WZCOL_WHITE, WZCOL_BLACK, pie_ADDITIVE, 192); @@ -2176,7 +2176,7 @@ void renderStructure(STRUCTURE *psStructure) * buildings in other words are NOT made up of components - much quicker! */ rotation = psStructure->rot.direction; - pie_MatRotY(UNDEG(-rotation)); + pie_MatRotY(-rotation); if (!defensive && gameTime2-psStructure->timeLastHit < ELEC_DAMAGE_DURATION && psStructure->lastHitWeapon == WSC_ELECTRONIC ) @@ -2315,7 +2315,7 @@ void renderStructure(STRUCTURE *psStructure) { pie_MatBegin(); pie_TRANSLATE(strImd->connectors[i].x, strImd->connectors[i].z, strImd->connectors[i].y); - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); if (mountImd[i] != NULL) { pie_TRANSLATE(0, 0, psStructure->asWeaps[i].recoilValue / 3); @@ -2326,7 +2326,7 @@ void renderStructure(STRUCTURE *psStructure) pie_TRANSLATE(mountImd[i]->connectors->x, mountImd[i]->connectors->z, mountImd[i]->connectors->y); } } - pie_MatRotX(UNDEG(rot.pitch)); + pie_MatRotX(rot.pitch); pie_TRANSLATE(0, 0, psStructure->asWeaps[i].recoilValue); pie_Draw3DShape(weaponImd[i], 0, colour, buildingBrightness, WZCOL_BLACK, pieFlag, pieFlagData); @@ -2350,15 +2350,15 @@ void renderStructure(STRUCTURE *psStructure) pie_TRANSLATE(weaponImd[i]->connectors->x,weaponImd[i]->connectors->z-12,weaponImd[i]->connectors->y); pRepImd = getImdFromIndex(MI_FLAME); - pie_MatRotY(UNDEG(rot.direction)); + pie_MatRotY(rot.direction); - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); pie_Draw3DShape(pRepImd, getModularScaledGraphicsTime(100, pRepImd->numFrames), colour, buildingBrightness, WZCOL_BLACK, pie_ADDITIVE, 192); - pie_MatRotX(UNDEG(player.r.x)); - pie_MatRotY(UNDEG(player.r.y)); - pie_MatRotY(UNDEG(rot.direction)); + pie_MatRotX(player.r.x); + pie_MatRotY(player.r.y); + pie_MatRotY(rot.direction); } } } @@ -2420,16 +2420,16 @@ void renderStructure(STRUCTURE *psStructure) if (strImd->max.y > 80) // babatower { pie_TRANSLATE(0, 80, 0); - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); pie_TRANSLATE(0, 0, -20); } else//baba bunker { pie_TRANSLATE(0, 10, 0); - pie_MatRotY(UNDEG(-rot.direction)); + pie_MatRotY(-rot.direction); pie_TRANSLATE(0, 0, -40); } - pie_MatRotX(UNDEG(rot.pitch)); + pie_MatRotX(rot.pitch); // draw the muzzle flash? if (psStructure && psStructure->visible[selectedPlayer] > UBYTE_MAX / 2) { @@ -2633,7 +2633,7 @@ static BOOL renderWallSection(STRUCTURE *psStructure) pie_TRANSLATE(rx, 0, -rz); rotation = psStructure->rot.direction; - pie_MatRotY(UNDEG(-rotation)); + pie_MatRotY(-rotation); if(imd != NULL) { @@ -2728,7 +2728,7 @@ void renderShadow( DROID *psDroid, iIMDShape *psShadowIMD ) if(psDroid->droidType == DROID_TRANSPORTER) { - pie_MatRotY(UNDEG(-psDroid->rot.direction)); + pie_MatRotY(-psDroid->rot.direction); } pVecTemp = psShadowIMD->points; @@ -2740,9 +2740,9 @@ void renderShadow( DROID *psDroid, iIMDShape *psShadowIMD ) } else { - pie_MatRotY(UNDEG(-psDroid->rot.direction)); - pie_MatRotX(UNDEG(psDroid->rot.pitch)); - pie_MatRotZ(UNDEG(psDroid->rot.roll)); + pie_MatRotY(-psDroid->rot.direction); + pie_MatRotX(psDroid->rot.pitch); + pie_MatRotZ(psDroid->rot.roll); } pie_Draw3DShape(psShadowIMD, 0, 0, WZCOL_WHITE, WZCOL_BLACK, pie_TRANSLUCENT, 128); @@ -3700,7 +3700,7 @@ static void renderSurroundings(void) pie_MATTRANS(0, 0, distance); // rotate it - pie_MatRotY(wind); + pie_MatRotY(DEG(wind)); // move it somewhat below ground level for the blending effect pie_TRANSLATE(0, -skybox_scale/8, 0); diff --git a/src/droid.c b/src/droid.c index c948db9db..84c21fe1d 100644 --- a/src/droid.c +++ b/src/droid.c @@ -3069,14 +3069,14 @@ BOOL calcDroidMuzzleLocation(DROID *psDroid, Vector3f *muzzle, int weapon_slot) pie_TRANSLATE(psDroid->pos.x, -psDroid->pos.z, psDroid->pos.y); //matrix = the center of droid - pie_MatRotY(UNDEG(psDroid->rot.direction)); - pie_MatRotX(UNDEG(psDroid->rot.pitch)); - pie_MatRotZ(UNDEG(-psDroid->rot.roll)); + pie_MatRotY(psDroid->rot.direction); + pie_MatRotX(psDroid->rot.pitch); + pie_MatRotZ(-psDroid->rot.roll); pie_TRANSLATE(psBodyImd->connectors[weapon_slot].x, -psBodyImd->connectors[weapon_slot].z, -psBodyImd->connectors[weapon_slot].y);//note y and z flipped //matrix = the weapon[slot] mount on the body - pie_MatRotY(UNDEG(psDroid->asWeaps[weapon_slot].rot.direction)); // +ve anticlockwise + pie_MatRotY(psDroid->asWeaps[weapon_slot].rot.direction); // +ve anticlockwise // process turret mount if (psMountImd && psMountImd->nconnectors) @@ -3085,7 +3085,7 @@ BOOL calcDroidMuzzleLocation(DROID *psDroid, Vector3f *muzzle, int weapon_slot) } //matrix = the turret connector for the gun - pie_MatRotX(UNDEG(psDroid->asWeaps[weapon_slot].rot.pitch)); // +ve up + pie_MatRotX(psDroid->asWeaps[weapon_slot].rot.pitch); // +ve up //process the gun if (psWeaponImd && psWeaponImd->nconnectors) diff --git a/src/effects.c b/src/effects.c index a17d9246e..f06ef0e23 100644 --- a/src/effects.c +++ b/src/effects.c @@ -1626,12 +1626,12 @@ static void renderFirework(const EFFECT *psEffect) positionEffect(psEffect); - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); pie_MatScale(psEffect->size / 100.f); pie_Draw3DShape(psEffect->imd, psEffect->frameNumber, 0, WZCOL_WHITE, WZCOL_BLACK, pie_ADDITIVE, EFFECT_EXPLOSION_ADDITIVE); - pie_MatEnd(); + pie_MatEnd(); } /** drawing func for blood. */ @@ -1639,8 +1639,8 @@ static void renderBloodEffect(const EFFECT *psEffect) { positionEffect(psEffect); - pie_MatRotY(UNDEG(-player.r.y)); - pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); pie_MatScale(psEffect->size / 100.f); pie_Draw3DShape(getImdFromIndex(MI_BLOOD), psEffect->frameNumber, 0, WZCOL_WHITE, WZCOL_BLACK, pie_TRANSLUCENT, EFFECT_BLOOD_TRANSPARENCY); @@ -1668,9 +1668,9 @@ static void renderDestructionEffect(const EFFECT *psEffect) if(!gamePaused()) { - pie_MatRotX(UNDEG(SKY_SHIMMY)); - pie_MatRotY(UNDEG(SKY_SHIMMY)); - pie_MatRotZ(UNDEG(SKY_SHIMMY)); + pie_MatRotX(SKY_SHIMMY); + pie_MatRotY(SKY_SHIMMY); + pie_MatRotZ(SKY_SHIMMY); } pie_Draw3DShape(psEffect->imd, 0, 0, WZCOL_WHITE, WZCOL_BLACK, pie_RAISE, percent); @@ -1722,8 +1722,8 @@ static void renderExplosionEffect(const EFFECT *psEffect) if(TEST_FACING(psEffect)) { /* Always face the viewer! */ -/* TEST_FLIPPED_Y(psEffect) ? pie_MatRotY(UNDEG(-player.r.y+iV_DEG(180))) :*/ pie_MatRotY(UNDEG(-player.r.y)); -/* TEST_FLIPPED_X(psEffect) ? pie_MatRotX(UNDEG(-player.r.x+iV_DEG(180))) :*/ pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); } /* Tesla explosions diminish in size */ @@ -1767,9 +1767,9 @@ static void renderGravitonEffect(const EFFECT *psEffect) positionEffect(psEffect); - pie_MatRotX(UNDEG(psEffect->rotation.x)); - pie_MatRotY(UNDEG(psEffect->rotation.y)); - pie_MatRotZ(UNDEG(psEffect->rotation.z)); + pie_MatRotX(psEffect->rotation.x); + pie_MatRotY(psEffect->rotation.y); + pie_MatRotZ(psEffect->rotation.z); /* Buildings emitted by gravitons are chunkier */ if(psEffect->type == GRAVITON_TYPE_EMITTING_ST) @@ -1800,8 +1800,8 @@ static void renderConstructionEffect(const EFFECT *psEffect) /* Bit in comments doesn't quite work yet? */ if(TEST_FACING(psEffect)) { -/* TEST_FLIPPED_Y(psEffect) ? pie_MatRotY(UNDEG(-player.r.y+iV_DEG(180))) :*/ pie_MatRotY(UNDEG(-player.r.y)); -/* TEST_FLIPPED_X(psEffect) ? pie_MatRotX(UNDEG(-player.r.x+iV_DEG(180))) :*/ pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); } /* Scale size according to age */ @@ -1841,8 +1841,8 @@ static void renderSmokeEffect(const EFFECT *psEffect) if(TEST_FACING(psEffect)) { /* Always face the viewer! */ -/* TEST_FLIPPED_Y(psEffect) ? pie_MatRotY(UNDEG(-player.r.y+iV_DEG(180))) : */pie_MatRotY(UNDEG(-player.r.y)); -/* TEST_FLIPPED_X(psEffect) ? pie_MatRotX(UNDEG(-player.r.x+iV_DEG(180))) : */pie_MatRotX(UNDEG(-player.r.x)); + pie_MatRotY(-player.r.y); + pie_MatRotX(-player.r.x); } /* Small smoke - used for the droids */ diff --git a/src/mapdisplay.c b/src/mapdisplay.c index 97c0bbeab..45ddef8a6 100644 --- a/src/mapdisplay.c +++ b/src/mapdisplay.c @@ -55,7 +55,7 @@ void renderResearchToBuffer(RESEARCH *psResearch, pie_SetGeometricOffset(OriginX+10,OriginY+10); // Pitch down a bit - //pie_MatRotX(-30); + //pie_MatRotX(-65536/12); // Rotate round // full rotation once every 2 seconds.. diff --git a/src/projectile.c b/src/projectile.c index eb16b9986..324bccd82 100644 --- a/src/projectile.c +++ b/src/projectile.c @@ -1860,9 +1860,9 @@ void objectShimmy(BASE_OBJECT *psObj) { if(justBeenHitByEW(psObj)) { - pie_MatRotX(UNDEG(SKY_SHIMMY)); - pie_MatRotY(UNDEG(SKY_SHIMMY)); - pie_MatRotZ(UNDEG(SKY_SHIMMY)); + pie_MatRotX(SKY_SHIMMY); + pie_MatRotY(SKY_SHIMMY); + pie_MatRotZ(SKY_SHIMMY); if(psObj->type == OBJ_DROID) { pie_TRANSLATE(1-rand()%3,0,1-rand()%3); diff --git a/src/radar.c b/src/radar.c index 4963e5c27..19f4020ec 100644 --- a/src/radar.c +++ b/src/radar.c @@ -292,7 +292,7 @@ void drawRadar(void) if (rotateRadar) { // rotate the map - pie_MatRotZ(UNDEG(player.r.y)); + pie_MatRotZ(player.r.y); DrawNorth(); } // draw the box at the dimensions of the map diff --git a/src/structure.c b/src/structure.c index 41a8bcc7c..daf9022bc 100644 --- a/src/structure.c +++ b/src/structure.c @@ -5632,14 +5632,14 @@ BOOL calcStructureMuzzleLocation(STRUCTURE *psStructure, Vector3f *muzzle, int w pie_TRANSLATE(psStructure->pos.x, -psStructure->pos.z, psStructure->pos.y); //matrix = the center of droid - pie_MatRotY(UNDEG(psStructure->rot.direction)); - pie_MatRotX(UNDEG(psStructure->rot.pitch)); - pie_MatRotZ(UNDEG(-psStructure->rot.roll)); + pie_MatRotY(psStructure->rot.direction); + pie_MatRotX(psStructure->rot.pitch); + pie_MatRotZ(-psStructure->rot.roll); pie_TRANSLATE( psShape->connectors[weapon_slot].x, -psShape->connectors[weapon_slot].z, -psShape->connectors[weapon_slot].y);//note y and z flipped //matrix = the weapon[slot] mount on the body - pie_MatRotY(UNDEG(psStructure->asWeaps[weapon_slot].rot.direction)); // +ve anticlockwise + pie_MatRotY(psStructure->asWeaps[weapon_slot].rot.direction); // +ve anticlockwise // process turret mount if (psMountImd && psMountImd->nconnectors) @@ -5648,7 +5648,7 @@ BOOL calcStructureMuzzleLocation(STRUCTURE *psStructure, Vector3f *muzzle, int w } //matrix = the turret connector for the gun - pie_MatRotX(UNDEG(psStructure->asWeaps[weapon_slot].rot.pitch)); // +ve up + pie_MatRotX(psStructure->asWeaps[weapon_slot].rot.pitch); // +ve up //process the gun if (psWeaponImd && psWeaponImd->nconnectors)