# HG changeset patch
# User Ritor1
# Date 1386066957 -21600
# Node ID a290d9fbdc95e38e0919dad0e6f29c4fecfdb5bd
# Parent 2e08496c40c2953751c36efd48f33f728647c800
ODM_GetFloorLevel small fix
diff -r 2e08496c40c2 -r a290d9fbdc95 Build/Visual Studio 2010/World of Might and Magic.vcxproj
--- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj Tue Dec 03 09:22:28 2013 +0600
+++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj Tue Dec 03 16:35:57 2013 +0600
@@ -186,6 +186,9 @@
+
+ true
+
@@ -387,6 +390,7 @@
%(Filename)_wrap.cxx
+
diff -r 2e08496c40c2 -r a290d9fbdc95 Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters
--- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Tue Dec 03 09:22:28 2013 +0600
+++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Tue Dec 03 16:35:57 2013 +0600
@@ -335,6 +335,7 @@
lib\swig\swigwin-2.0.11
+
@@ -607,6 +608,7 @@
+
diff -r 2e08496c40c2 -r a290d9fbdc95 Events.cpp
--- a/Events.cpp Tue Dec 03 09:22:28 2013 +0600
+++ b/Events.cpp Tue Dec 03 16:35:57 2013 +0600
@@ -433,6 +433,7 @@
{
if (!lua->DoFile("out01.lua"))
Log::Warning(L"Error opening out01.lua\n");
+ Log::Warning(L"being tested that well\n");
return;
}
if ( !uEventID )
diff -r 2e08496c40c2 -r a290d9fbdc95 Outdoor.cpp
--- a/Outdoor.cpp Tue Dec 03 09:22:28 2013 +0600
+++ b/Outdoor.cpp Tue Dec 03 16:35:57 2013 +0600
@@ -3164,10 +3164,10 @@
int v39; // [sp+20h] [bp-20h]@9
signed int pBModelNum; // [sp+28h] [bp-18h]@1
int pFaceNum; // [sp+2Ch] [bp-14h]@8
- bool v43; // [sp+30h] [bp-10h]@22
- bool v44; // [sp+34h] [bp-Ch]@24
+ bool current_vertices_Y; // [sp+30h] [bp-10h]@22
+ bool next_vertices_Y; // [sp+34h] [bp-Ch]@24
signed int v46; // [sp+3Ch] [bp-4h]@1
- signed int v48; // [sp+58h] [bp+18h]@22
+ signed int number_hits; // [sp+58h] [bp+18h]@22
signed int v49; // [sp+58h] [bp+18h]@43
v46 = 1;
@@ -3195,44 +3195,45 @@
for ( uint i = 0; i < pFace->uNumVertices; ++i)
{
- word_721040[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].x;
- word_720F70[2 * i] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].y;
- word_721040[2 * i + 1] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x;
- word_720F70[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y;
+ FloorFaceVertCoord_X[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].x;
+ FloorFaceVertCoord_Y[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].y;
+ FloorFaceVertCoord_X[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x;
+ FloorFaceVertCoord_Y[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y;
}
- word_721040[2 * pFace->uNumVertices] = word_721040[0];
- word_720F70[2 * pFace->uNumVertices] = word_720F70[0];
- v43 = word_720F70[0] >= Y;
- v48 = 0;
+ FloorFaceVertCoord_X[2 * pFace->uNumVertices] = FloorFaceVertCoord_X[0];
+ FloorFaceVertCoord_Y[2 * pFace->uNumVertices] = FloorFaceVertCoord_Y[0];
+
+ current_vertices_Y = FloorFaceVertCoord_Y[0] >= Y;
+ number_hits = 0;
if ( 2 * pFace->uNumVertices > 0 )
{
for ( int i = 0; i < 2 * pFace->uNumVertices; ++i )
{
- if ( v48 >= 2 )
+ if ( number_hits >= 2 )
break;
- v36 = word_720F70[i + 1];
- v44 = word_720F70[i + 1] >= Y;
- if ( v43 != v44 )
+ v36 = FloorFaceVertCoord_Y[i + 1];
+ next_vertices_Y = FloorFaceVertCoord_Y[i + 1] >= Y;
+ if ( current_vertices_Y != next_vertices_Y )//проверка по Y
{
- v18 = word_721040[i + 1] >= X ? 0 : 2;
- v19 = v18 | (word_721040[i] < X);
+ v18 = FloorFaceVertCoord_X[i + 1] >= X ? 0 : 2;
+ v19 = v18 | (FloorFaceVertCoord_X[i] < X);
if ( v19 != 3 )
{
if ( !v19 )
- ++v48;
+ ++number_hits;
else
{
- LODWORD(v23) = (Y - word_720F70[i]) << 16;
- HIDWORD(v23) = (Y - word_720F70[i]) >> 16;
- v22 = ((((word_721040[i + 1] - word_721040[i]) * v23 / (v36 - word_720F70[i])) >> 16) + word_721040[i]);
+ LODWORD(v23) = (Y - FloorFaceVertCoord_Y[i]) << 16;
+ HIDWORD(v23) = (Y - FloorFaceVertCoord_Y[i]) >> 16;
+ v22 = ((((FloorFaceVertCoord_X[i + 1] - FloorFaceVertCoord_X[i]) * v23 / (v36 - FloorFaceVertCoord_Y[i])) >> 16) + FloorFaceVertCoord_X[i]);
if ( v22 >= X)
- ++v48;
+ ++number_hits;
}
}
}
- v43 = v44;
+ current_vertices_Y = next_vertices_Y;
}
- if ( v48 == 1 )
+ if ( number_hits == 1 )
{
if ( v46 >= 20 )
break;
diff -r 2e08496c40c2 -r a290d9fbdc95 Player.cpp
--- a/Player.cpp Tue Dec 03 09:22:28 2013 +0600
+++ b/Player.cpp Tue Dec 03 16:35:57 2013 +0600
@@ -3675,17 +3675,21 @@
{
if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) )
{
- PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)GetNthEquippedIndexItem(i)->GetPlayerSkillType();
- int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType);
- if ( currentItemSkillType == PLAYER_SKILL_BOW )
+ ItemGen* currItemPtr = GetNthEquippedIndexItem(i);
+ if ( currItemPtr->GetItemEquipType() == EQUIP_TWO_HANDED || currItemPtr->GetItemEquipType() == EQUIP_SINGLE_HANDED )
{
- int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 1, 1);
- return multiplier * (currentItemSkillLevel & 0x3F);
- }
- else if ( currentItemSkillType == PLAYER_SKILL_BLASTER )
- {
- int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5);
- return multiplier * (currentItemSkillLevel & 0x3F);
+ PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)GetNthEquippedIndexItem(i)->GetPlayerSkillType();
+ int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType);
+ if ( currentItemSkillType == PLAYER_SKILL_BOW )
+ {
+ int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 1, 1);
+ return multiplier * (currentItemSkillLevel & 0x3F);
+ }
+ else if ( currentItemSkillType == PLAYER_SKILL_BLASTER )
+ {
+ int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5);
+ return multiplier * (currentItemSkillLevel & 0x3F);
+ }
}
}
}
diff -r 2e08496c40c2 -r a290d9fbdc95 SpriteObject.cpp
--- a/SpriteObject.cpp Tue Dec 03 09:22:28 2013 +0600
+++ b/SpriteObject.cpp Tue Dec 03 16:35:57 2013 +0600
@@ -206,8 +206,8 @@
//----- (00471C03) --------------------------------------------------------
void SpriteObject::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
{
- SpriteObject *v1; // esi@1
- ObjectDesc *v2; // ebx@1
+ //SpriteObject *v1; // esi@1
+ ObjectDesc *object; // ebx@1
signed int v3; // edx@1
int v4; // ecx@1
int v5; // ST04_4@1
@@ -268,26 +268,26 @@
int v60; // [sp+A4h] [bp-4h]@11
uLayingItemID_ = uLayingItemID;
- v1 = &pSpriteObjects[uLayingItemID];
+ //v1 = &pSpriteObjects[uLayingItemID];
v58 = 0;
- v2 = &pObjectList->pObjects[v1->uObjectDescID];
- v57 = IsTerrainSlopeTooHigh(v1->vPosition.x, v1->vPosition.y);
- v3 = v1->vPosition.y;
- v4 = v1->vPosition.x;
- v5 = v2->uHeight;
+ object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID];
+ v57 = IsTerrainSlopeTooHigh(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y);
+ v3 = pSpriteObjects[uLayingItemID].vPosition.y;
+ v4 = pSpriteObjects[uLayingItemID].vPosition.x;
+ v5 = object->uHeight;
v55 = 0;
- v6 = ODM_GetFloorLevel(v4, v3, v1->vPosition.z, v5, &on_water, &v55, 0);
+ v6 = ODM_GetFloorLevel(v4, v3, pSpriteObjects[uLayingItemID].vPosition.z, v5, &on_water, &v55, 0);
v7 = v6;
v54 = v6;
v8 = v6 + 1;
- if ( v1->vPosition.z <= v6 + 1 )
+ if ( pSpriteObjects[uLayingItemID].vPosition.z <= v6 + 1 )
{
if ( on_water )
{
v9 = v6 + 60;
if ( v55 )
v9 = v7 + 30;
- sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
+ sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v9);
SpriteObject::OnInteraction(uLayingItemID_);
}
}
@@ -295,60 +295,59 @@
{
v58 = 1;
}
- v10 = v2->uFlags;
- if ( !(v2->uFlags & OBJECT_DESC_NO_GRAVITY) )
+ v10 = object->uFlags;
+ if ( !(object->uFlags & OBJECT_DESC_NO_GRAVITY) )
{
if ( v58 )
{
- v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
+ pSpriteObjects[uLayingItemID].vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
goto LABEL_13;
}
if ( v57 )
{
- v11 = v1->vPosition.y;
- v12 = v1->vPosition.x;
- v1->vPosition.z = v8;
+ v11 = pSpriteObjects[uLayingItemID].vPosition.y;
+ v12 = pSpriteObjects[uLayingItemID].vPosition.x;
+ pSpriteObjects[uLayingItemID].vPosition.z = v8;
ODM_GetTerrainNormalAt(v12, v11, &v51);
- v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
- v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16;
+ pSpriteObjects[uLayingItemID].vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
+ v56 = abs(v51.y * pSpriteObjects[uLayingItemID].vVelocity.y + v51.z * pSpriteObjects[uLayingItemID].vVelocity.z + v51.x * pSpriteObjects[uLayingItemID].vVelocity.x) >> 16;
//v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
- v1->vVelocity.x += fixpoint_mul(v56, v51.x);
+ pSpriteObjects[uLayingItemID].vVelocity.x += fixpoint_mul(v56, v51.x);
//v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
- v1->vVelocity.y += fixpoint_mul(v56, v51.y);
+ pSpriteObjects[uLayingItemID].vVelocity.y += fixpoint_mul(v56, v51.y);
//v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
- v1->vVelocity.z += fixpoint_mul(v56, v51.z);
-LABEL_12:
+ pSpriteObjects[uLayingItemID].vVelocity.z += fixpoint_mul(v56, v51.z);
v7 = v54;
goto LABEL_13;
}
if ( v10 & 0x40 )
{
- if ( v1->vPosition.z < v7 )
- v1->vPosition.z = v8;
+ if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 )
+ pSpriteObjects[uLayingItemID].vPosition.z = v8;
if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
return;
}
- v1->vPosition.z = v8;
- if ( !(v2->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
- v1->vVelocity.z = 0;
+ pSpriteObjects[uLayingItemID].vPosition.z = v8;
+ if ( !(object->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -pSpriteObjects[uLayingItemID].vVelocity.z >> 1, pSpriteObjects[uLayingItemID].vVelocity.z = v21, (signed __int16)v21 < 10) )
+ pSpriteObjects[uLayingItemID].vVelocity.z = 0;
- v1->vVelocity.x = fixpoint_mul(58500, v1->vVelocity.x);
- v1->vVelocity.y = fixpoint_mul(58500, v1->vVelocity.y);
- v1->vVelocity.z = fixpoint_mul(58500, v1->vVelocity.z);
+ pSpriteObjects[uLayingItemID].vVelocity.x = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.x);
+ pSpriteObjects[uLayingItemID].vVelocity.y = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.y);
+ pSpriteObjects[uLayingItemID].vVelocity.z = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.z);
- if ( (v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x) < 400 )
+ if ( (pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x) < 400 )
{
- v1->vVelocity.y = 0;
- v1->vVelocity.x = 0;
+ pSpriteObjects[uLayingItemID].vVelocity.y = 0;
+ pSpriteObjects[uLayingItemID].vVelocity.x = 0;
memset(&Dst, 0, 0x68u);
- Dst.x = (double)v1->vPosition.x;
- Dst.y = (double)v1->vPosition.y;
- Dst.z = (double)v1->vPosition.z;
+ Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x;
+ Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y;
+ Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z;
Dst.r = 0.0;
Dst.g = 0.0;
Dst.b = 0.0;
- if (v2->uFlags & OBJECT_DESC_TRIAL_FIRE )
+ if (object->uFlags & OBJECT_DESC_TRIAL_FIRE )
{
Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
Dst.uDiffuse = 0xFF3C1E;
@@ -357,7 +356,7 @@
Dst.flt_28 = 1.0;
pGame->pParticleEngine->AddParticle(&Dst);
}
- else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE)
+ else if ( object->uFlags & OBJECT_DESC_TRIAL_LINE)
{
Dst.type = ParticleType_Line;
@@ -367,7 +366,7 @@
Dst.flt_28 = 1.0;
pGame->pParticleEngine->AddParticle(&Dst);
}
- else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE )
+ else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE )
{
Dst.type = ParticleType_Bitmap | ParticleType_8;
Dst.uDiffuse = rand();
@@ -380,49 +379,49 @@
}
}
LABEL_13:
- if ( v1->vPosition.z > v7
- && (v13 = v1->vPosition.x, v13 >= -0x8000)
+ if ( pSpriteObjects[uLayingItemID].vPosition.z > v7
+ && (v13 = pSpriteObjects[uLayingItemID].vPosition.x, v13 >= -0x8000)
&& v13 <= 0x8000
- && (v14 = v1->vPosition.y, v14 >= -0x8000)
+ && (v14 = pSpriteObjects[uLayingItemID].vPosition.y, v14 >= -0x8000)
&& v14 <= 0x8000
- && v1->vPosition.z <= 13000
- || !(v2->uFlags & OBJECT_DESC_INTERACTABLE) )
+ && pSpriteObjects[uLayingItemID].vPosition.z <= 13000
+ || !(object->uFlags & OBJECT_DESC_INTERACTABLE) )
goto LABEL_92;
- if ( v1->vPosition.z < v7 )
- v1->vPosition.z = v8;
+ if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 )
+ pSpriteObjects[uLayingItemID].vPosition.z = v8;
if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
{
LABEL_92:
stru_721530.field_0 = 0;
v55 = 0;
- stru_721530.prolly_normal_d = v2->uRadius;
- stru_721530.height = v2->uHeight;
+ stru_721530.prolly_normal_d = object->uRadius;
+ stru_721530.height = object->uHeight;
stru_721530.field_8_radius = 0;
stru_721530.field_70 = 0;
while ( 1 )
{
- stru_721530.position.x = v1->vPosition.x;
+ stru_721530.position.x = pSpriteObjects[uLayingItemID].vPosition.x;
stru_721530.normal.x = stru_721530.position.x;
- v15 = v1->vPosition.y;
+ v15 = pSpriteObjects[uLayingItemID].vPosition.y;
stru_721530.uSectorID = 0;
stru_721530.position.y = v15;
stru_721530.normal.y = v15;
- stru_721530.position.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
+ stru_721530.position.z = pSpriteObjects[uLayingItemID].vPosition.z + stru_721530.prolly_normal_d + 1;
stru_721530.normal.z = stru_721530.position.z;
- stru_721530.velocity.x = v1->vVelocity.x;
- stru_721530.velocity.y = v1->vVelocity.y;
- stru_721530.velocity.z = v1->vVelocity.z;
+ stru_721530.velocity.x = pSpriteObjects[uLayingItemID].vVelocity.x;
+ stru_721530.velocity.y = pSpriteObjects[uLayingItemID].vVelocity.y;
+ stru_721530.velocity.z = pSpriteObjects[uLayingItemID].vVelocity.z;
if ( stru_721530._47050A(0) )
return;
_46E889_collide_against_bmodels(0);
- v16 = WorldPosToGridCellZ(v1->vPosition.y);
- v18 = WorldPosToGridCellX(v1->vPosition.x);
+ v16 = WorldPosToGridCellZ(pSpriteObjects[uLayingItemID].vPosition.y);
+ v18 = WorldPosToGridCellX(pSpriteObjects[uLayingItemID].vPosition.x);
_46E26D_collide_against_sprites(v18, v16);
- if (PID_TYPE(v1->spell_caster_pid) != OBJECT_Player)
+ if (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player)
_46EF01_collision_chech_player(0);
- if (PID_TYPE(v1->spell_caster_pid) == OBJECT_Actor)
+ if (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Actor)
{
- v19 = PID_ID(v1->spell_caster_pid);
+ v19 = PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid);
if (( v19 >= 0 )&&( v19 < (signed int)(uNumActors - 1) ))
{
@@ -441,38 +440,32 @@
Actor::_46DF1A_collide_against_actor(i, 0);
}
v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
- v27 = ODM_GetFloorLevel(
- stru_721530.normal2.x,
- stru_721530.normal2.y,
- stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
- v2->uHeight,
- &v49,
- &v50,
- 0);
+ v27 = ODM_GetFloorLevel( stru_721530.normal2.x, stru_721530.normal2.y, stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
+ object->uHeight, &v49, &v50, 0);
if ( on_water && v26 < v27 + 60 )
{
if ( v50 )
v44 = v27 + 30;
else
v44 = v54 + 60;
- sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
+ sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v44);
SpriteObject::OnInteraction(uLayingItemID_);
return;
}
if ( stru_721530.field_7C >= stru_721530.field_6C )
{
- v1->vPosition.x = stru_721530.normal2.x;
- v1->vPosition.y = stru_721530.normal2.y;
- v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
- v1->uSectorID = LOWORD(stru_721530.uSectorID);
+ pSpriteObjects[uLayingItemID].vPosition.x = stru_721530.normal2.x;
+ pSpriteObjects[uLayingItemID].vPosition.y = stru_721530.normal2.y;
+ pSpriteObjects[uLayingItemID].vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
+ pSpriteObjects[uLayingItemID].uSectorID = LOWORD(stru_721530.uSectorID);
memset(&Dst, 0, 0x68u);
- Dst.x = (double)v1->vPosition.x;
- Dst.y = (double)v1->vPosition.y;
- Dst.z = (double)v1->vPosition.z;
+ Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x;
+ Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y;
+ Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z;
Dst.r = 0.0;
Dst.g = 0.0;
Dst.b = 0.0;
- if ( v2->uFlags & OBJECT_DESC_TRIAL_FIRE )
+ if ( object->uFlags & OBJECT_DESC_TRIAL_FIRE )
{
Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
Dst.uDiffuse = 0xFF3C1E;
@@ -482,7 +475,7 @@
pGame->pParticleEngine->AddParticle(&Dst);
return;
}
- else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE )
+ else if ( object->uFlags & OBJECT_DESC_TRIAL_LINE )
{
Dst.type = ParticleType_Line;
Dst.uTextureID = 0;
@@ -492,31 +485,31 @@
pGame->pParticleEngine->AddParticle(&Dst);
return;
}
- else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE)
- {
- Dst.type = ParticleType_Bitmap | ParticleType_8;
- Dst.uDiffuse = rand();
- Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128;
- Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
- Dst.flt_28 = 1.0;
- pGame->pParticleEngine->AddParticle(&Dst);
- }
+ else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE)
+ {
+ Dst.type = ParticleType_Bitmap | ParticleType_8;
+ Dst.uDiffuse = rand();
+ Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128;
+ Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
+ Dst.flt_28 = 1.0;
+ pGame->pParticleEngine->AddParticle(&Dst);
+ }
return;
}
//v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16);
- v1->vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x);
+ pSpriteObjects[uLayingItemID].vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x);
//v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16);
- v1->vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y);
+ pSpriteObjects[uLayingItemID].vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y);
//v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16);
v28 = LOWORD(stru_721530.uSectorID);
- v1->vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z);
- v29 = v1->vPosition.z;
- v1->uSectorID = v28;
+ pSpriteObjects[uLayingItemID].vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z);
+ v29 = pSpriteObjects[uLayingItemID].vPosition.z;
+ pSpriteObjects[uLayingItemID].uSectorID = v28;
stru_721530.field_70 += stru_721530.field_7C;
- if ( v2->uFlags & OBJECT_DESC_INTERACTABLE )
+ if ( object->uFlags & OBJECT_DESC_INTERACTABLE )
{
if ( v29 < v54 )
- v1->vPosition.z = v54 + 1;
+ pSpriteObjects[uLayingItemID].vPosition.z = v54 + 1;
if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
return;
}
@@ -529,8 +522,8 @@
v32 = &v31->pFaces[v30 & 0x3F];
if ( v32->uPolygonType != 3 )
{
- v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
- + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
+ v56 = abs(v32->pFacePlane.vNormal.z * pSpriteObjects[uLayingItemID].vVelocity.z + v32->pFacePlane.vNormal.y * pSpriteObjects[uLayingItemID].vVelocity.y
+ + v32->pFacePlane.vNormal.x * pSpriteObjects[uLayingItemID].vVelocity.x) >> 16;
if ( (stru_721530.speed >> 3) > v56 )
v56 = stru_721530.speed >> 3;
v57 = v32->pFacePlane.vNormal.x;
@@ -538,8 +531,8 @@
v58 = v32->pFacePlane.vNormal.y;
v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
v60 = ((unsigned __int64)(v56 * (signed __int64)v32->pFacePlane.vNormal.z) >> 16);
- v1->vVelocity.x += 2 * v57;
- v1->vVelocity.y += 2 * v58;
+ pSpriteObjects[uLayingItemID].vVelocity.x += 2 * v57;
+ pSpriteObjects[uLayingItemID].vVelocity.y += 2 * v58;
if ( v32->pFacePlane.vNormal.z <= 32000 )
{
v37 = 2 * (short)v60;
@@ -547,30 +540,33 @@
else
{
v36 = v60;
- v1->vVelocity.z += (signed __int16)v60;
+ pSpriteObjects[uLayingItemID].vVelocity.z += (signed __int16)v60;
v58 = (unsigned __int64)(32000 * (signed __int64)(signed int)v36) >> 16;
v37 = (unsigned int)(32000 * v36) >> 16;
}
- v1->vVelocity.z += v37;
-LABEL_70:
+ pSpriteObjects[uLayingItemID].vVelocity.z += v37;
if ( BYTE3(v32->uAttributes) & 0x10 )
EventProcessor(v32->sCogTriggeredID, 0, 1);
goto LABEL_74;
}
v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
- v34 = v1->vVelocity.x;
- v1->vPosition.z = v33 + 1;
- if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
- goto LABEL_70;
+ v34 = pSpriteObjects[uLayingItemID].vVelocity.x;
+ pSpriteObjects[uLayingItemID].vPosition.z = v33 + 1;
+ if ( pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + v34 * v34 >= 400 )
+ {
+ if ( BYTE3(v32->uAttributes) & 0x10 )
+ EventProcessor(v32->sCogTriggeredID, 0, 1);
+ goto LABEL_74;
+ }
LOWORD(v35) = 0;
- v1->vVelocity.z = 0;
- v1->vVelocity.x = 0;
- goto LABEL_73;
+ pSpriteObjects[uLayingItemID].vVelocity.z = 0;
+ pSpriteObjects[uLayingItemID].vVelocity.x = 0;
+ pSpriteObjects[uLayingItemID].vVelocity.y = v35;
}
LABEL_74:
- v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16);
- v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16);
- v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16);
+ pSpriteObjects[uLayingItemID].vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.x) >> 16);
+ pSpriteObjects[uLayingItemID].vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.y) >> 16);
+ pSpriteObjects[uLayingItemID].vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)pSpriteObjects[uLayingItemID].vVelocity.z) >> 16);
++v55;
//v43 = __OFSUB__(v55, 100);
@@ -578,22 +574,19 @@
if (v55>=100 )//!(v42 ^ v43)
return;
}
- v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
- v38 = stru_5C6E00->Atan2(
- v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
- v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
+ v57 = integer_sqrt(pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y + pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x);
+ v38 = stru_5C6E00->Atan2(pSpriteObjects[uLayingItemID].vPosition.x - pLevelDecorations[v30].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y - pLevelDecorations[v30].vPosition.y);
v56 = v38;
v39 = stru_5C6E00->Cos(v38);
// v60 = v39;
v40 = v39 * (signed __int64)v57;
v58 = v40 >> 16;
- v1->vVelocity.x = WORD1(v40);
+ pSpriteObjects[uLayingItemID].vVelocity.x = WORD1(v40);
v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi);
// v60 = v41;
v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
v58 = v35;
-LABEL_73:
- v1->vVelocity.y = v35;
+ pSpriteObjects[uLayingItemID].vVelocity.y = v35;
goto LABEL_74;
}
}
diff -r 2e08496c40c2 -r a290d9fbdc95 mm7_data.cpp
--- a/mm7_data.cpp Tue Dec 03 09:22:28 2013 +0600
+++ b/mm7_data.cpp Tue Dec 03 16:35:57 2013 +0600
@@ -1234,8 +1234,8 @@
std::array dword_720E80;
std::array dword_720ED0;
std::array ceiling_height_level;
-std::array<__int16, 777> word_720F70; // idb
-std::array<__int16, 777> word_721040; // idb
+std::array<__int16, 777> FloorFaceVertCoord_Y; // idb
+std::array<__int16, 777> FloorFaceVertCoord_X; // idb
std::array dword_721110; // idb
std::array dword_721160; // idb
std::array odm_floor_level; // idb
diff -r 2e08496c40c2 -r a290d9fbdc95 mm7_data.h
--- a/mm7_data.h Tue Dec 03 09:22:28 2013 +0600
+++ b/mm7_data.h Tue Dec 03 16:35:57 2013 +0600
@@ -908,8 +908,8 @@
extern std::array dword_720E80;
extern std::array dword_720ED0;
extern std::array ceiling_height_level;
-extern std::array<__int16, 777> word_720F70; // idb
-extern std::array<__int16, 777> word_721040; // idb
+extern std::array<__int16, 777> FloorFaceVertCoord_Y; // idb
+extern std::array<__int16, 777> FloorFaceVertCoord_X; // idb
extern std::array dword_721110; // idb
extern std::array dword_721160; // idb
extern std::array odm_floor_level; // idb dword_7211B0