# HG changeset patch # User Nomad # Date 1360532608 -7200 # Node ID fe0e317c0de00fd9686fbd5e7b103e8150ca0e33 # Parent be3c07c988613f52e03f409265cb684b066812e1 Camera rotation fixed. Sorta diff -r be3c07c98861 -r fe0e317c0de0 Game.cpp --- a/Game.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/Game.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -58,8 +58,10 @@ uFlags2 |= 2u; pIndoorCamera->sRotationX = pParty->sRotationX; pIndoorCamera->sRotationY = pParty->sRotationY; - pIndoorCamera->pos.x = pParty->vPosition.x - pParty->field_18 * (stru_5C6E00->SinCos(pIndoorCamera->sRotationY) / 2048.0);//12552 - pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * (stru_5C6E00->SinCos(pIndoorCamera->sRotationY) / 2048.0);//800 + //pIndoorCamera->pos.x = pParty->vPosition.x - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//12552 + //pIndoorCamera->pos.y = pParty->vPosition.y - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//800 + pIndoorCamera->pos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0); + pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0); pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353 pIndoorCamera->Initialize2(); pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); diff -r be3c07c98861 -r fe0e317c0de0 Indoor.cpp --- a/Indoor.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/Indoor.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -373,9 +373,9 @@ _this.uFlags = v0; _this.vPosition.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) - * (signed __int64)pParty->field_18) >> 16); + * (signed __int64)pParty->y_rotation_granularity) >> 16); v2 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); - v3 = (unsigned __int64)(v2 * (signed __int64)pParty->field_18) >> 16; + v3 = (unsigned __int64)(v2 * (signed __int64)pParty->y_rotation_granularity) >> 16; _this.field_1C_mb_fov = 65; _this.vPosition.y = pParty->vPosition.y - v3; _this.sRotationY = pParty->sRotationY; diff -r be3c07c98861 -r fe0e317c0de0 Outdoor.cpp --- a/Outdoor.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/Outdoor.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -60,10 +60,10 @@ pIndoorCamera->sRotationY = pParty->sRotationY; pIndoorCamera->pos.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) - * (signed __int64)pParty->field_18) >> 16); + * (signed __int64)pParty->y_rotation_granularity) >> 16); //v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); pIndoorCamera->field_4C = v1; - pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); + pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; if ( v2 || pRenderer->pRenderD3D ) { diff -r be3c07c98861 -r fe0e317c0de0 Party.cpp --- a/Party.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/Party.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -828,7 +828,7 @@ this->field_28 = 0; this->uDefaultPartyHeight = 120; this->field_14 = 37; - this->field_18 = 25; + this->y_rotation_granularity = 25; this->uWalkSpeed = 384; this->field_20_prolly_turn_speed = 90; this->field_24 = 5; diff -r be3c07c98861 -r fe0e317c0de0 Party.h --- a/Party.h Sun Feb 10 23:14:42 2013 +0200 +++ b/Party.h Sun Feb 10 23:43:28 2013 +0200 @@ -127,6 +127,8 @@ field_6FC = 0; field_764 = 0; + + y_rotation_granularity = 1; } void _4909F4(); @@ -164,7 +166,7 @@ int sEyelevel; unsigned int uDefaultEyelevel; int field_14; - int field_18; + int y_rotation_granularity; unsigned int uWalkSpeed; int field_20_prolly_turn_speed; int field_24; diff -r be3c07c98861 -r fe0e317c0de0 mm7_2.cpp --- a/mm7_2.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/mm7_2.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -13758,7 +13758,7 @@ } else { - uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64; + uTurnSpeed = (unsigned int)uCPUSpeed < 0xC7 ? 128 : 64; // adjust turn speed to estimated fps } return true; } diff -r be3c07c98861 -r fe0e317c0de0 mm7_3.cpp --- a/mm7_3.cpp Sun Feb 10 23:14:42 2013 +0200 +++ b/mm7_3.cpp Sun Feb 10 23:43:28 2013 +0200 @@ -8038,7 +8038,7 @@ stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0); v62._48607B(&stru_8019C8); v62.uTileBitmapID = pFace->uBitmapID; - v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0); + v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? &pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0); if ( !v62.pTexture ) return; v8 = pBLVRenderParams->sPartyRotX;