Mercurial > mm7
comparison mm7_2.cpp @ 1214:0d6c7ff3cddd
simplified stru193_math constructor and class definition
GAME_STATE_3 to GAME_STATE_LOADING_GAME
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 16:06:12 +0200 |
parents | 8c02e6f74b29 |
children | 68655becb94b |
comparison
equal
deleted
inserted
replaced
1213:8192b25d356c | 1214:0d6c7ff3cddd |
---|---|
3767 } | 3767 } |
3768 | 3768 |
3769 //----- (00452969) -------------------------------------------------------- | 3769 //----- (00452969) -------------------------------------------------------- |
3770 stru193_math::stru193_math() | 3770 stru193_math::stru193_math() |
3771 { | 3771 { |
3772 stru193_math *v1; // esi@1 | |
3773 char *v2; // edi@1 | |
3774 double v3; // ST18_8@2 | 3772 double v3; // ST18_8@2 |
3775 signed int v4; // edx@3 | 3773 |
3776 int v5; // eax@4 | |
3777 int v6; // ecx@4 | |
3778 signed int v7; // [sp+20h] [bp-4h]@1 | |
3779 | |
3780 v1 = this; | |
3781 this->uIntegerDoublePi = 2048; | |
3782 this->uIntegerPi = 1024; | |
3783 this->uIntegerHalfPi = 512; | |
3784 this->uDoublePiMask = 2047; | |
3785 this->uPiMask = 1023; | |
3786 this->uHalfPiMask = 511; | |
3787 this->pTanTable[0] = 0; | 3774 this->pTanTable[0] = 0; |
3788 this->pCosTable[0] = 65536; | 3775 this->pCosTable[0] = 65536; |
3789 this->pInvCosTable[0] = 65536; | 3776 this->pInvCosTable[0] = 65536; |
3790 v7 = 1; | 3777 for(int i = 1; i < (signed int)this->uIntegerHalfPi; i++) |
3791 v2 = (char *)&this->pInvCosTable[1]; | 3778 { |
3792 do | 3779 v3 = (double)i * 3.141592653589793 / (double)uIntegerPi; |
3793 { | 3780 pTanTable[i] = (signed __int64)(tan(v3) * (double)this->pCosTable[0] + 0.5); |
3794 v3 = (double)v7 * 3.141592653589793 * 0.0009765625; | 3781 pCosTable[i] = (signed __int64)(cos(v3) * (double)this->pCosTable[0] + 0.5); |
3795 *((int *)v2 - 1040) = (signed __int64)(tan(v3) * (double)v1->pCosTable[0] + 0.5); | 3782 pInvCosTable[i] = (signed __int64)(1.0 / cos(v3) * (double)this->pCosTable[0] + 0.5); |
3796 *((int *)v2 - 520) = (signed __int64)(cos(v3) * (double)v1->pCosTable[0] + 0.5); | 3783 } |
3797 ++v7; | 3784 for(int i = this->uIntegerHalfPi; i < 520; i++) |
3798 *(int *)v2 = (signed __int64)(1.0 / cos(v3) * (double)v1->pCosTable[0] + 0.5); | 3785 { |
3799 v2 += 4; | 3786 this->pTanTable[i] = 0xEFFFFFFFu; |
3800 } | 3787 this->pCosTable[i] = 0; |
3801 while ( v7 < (signed int)v1->uIntegerHalfPi ); | 3788 this->pInvCosTable[i] = 0xEFFFFFFFu; |
3802 v4 = v1->uIntegerHalfPi; | |
3803 if ( v4 < 520 ) | |
3804 { | |
3805 v5 = (int)&v1->pCosTable[v4]; | |
3806 v6 = 520 - v4; | |
3807 do | |
3808 { | |
3809 *(int *)v5 = 0; | |
3810 *(int *)(v5 + 2080) = 0xEFFFFFFFu; | |
3811 *(int *)(v5 - 2080) = 0xEFFFFFFFu; | |
3812 v5 += 4; | |
3813 --v6; | |
3814 } | |
3815 while ( v6 ); | |
3816 } | 3789 } |
3817 } | 3790 } |
3818 | 3791 |
3819 //----- (00452A9E) -------------------------------------------------------- | 3792 //----- (00452A9E) -------------------------------------------------------- |
3820 int integer_sqrt(int val) | 3793 int integer_sqrt(int val) |
8216 pMouse->Activate(1); | 8189 pMouse->Activate(1); |
8217 } | 8190 } |
8218 //LABEL_48: | 8191 //LABEL_48: |
8219 pGame->Loop(); | 8192 pGame->Loop(); |
8220 LABEL_49: | 8193 LABEL_49: |
8221 if ( uGameState == GAME_STATE_3 ) | 8194 if ( uGameState == GAME_STATE_LOADING_GAME ) |
8222 { | 8195 { |
8223 SetCurrentMenuID(MENU_5); | 8196 SetCurrentMenuID(MENU_5); |
8224 uGameState = GAME_STATE_PLAYING; | 8197 uGameState = GAME_STATE_PLAYING; |
8225 continue; | 8198 continue; |
8226 } | 8199 } |