changeset 2083:69af571f793b

Merge
author Ritor1
date Fri, 06 Dec 2013 23:35:50 +0600
parents c15871e2d743 (diff) 70c45d12d9ca (current diff)
children 48b790721bdc
files
diffstat 11 files changed, 135 insertions(+), 113 deletions(-) [+]
line wrap: on
line diff
--- a/Bink_Smacker.h	Wed Dec 04 00:45:18 2013 +0600
+++ b/Bink_Smacker.h	Fri Dec 06 23:35:50 2013 +0600
@@ -144,6 +144,23 @@
         HDC lastdc;
 };
 
+#define SMACKNEEDPAN    0x00020L // Will be setting the pan
+#define SMACKNEEDVOLUME 0x00040L // Will be setting the volume
+#define SMACKFRAMERATE  0x00080L // Override fr (call SmackFrameRate first)
+#define SMACKLOADEXTRA  0x00100L // Load the extra buffer during SmackOpen
+#define SMACKPRELOADALL 0x00200L // Preload the entire animation
+#define SMACKNOSKIP     0x00400L // Don't skip frames if falling behind
+#define SMACKSIMULATE   0x00800L // Simulate the speed (call SmackSim first)
+#define SMACKFILEHANDLE 0x01000L // Use when passing in a file handle
+#define SMACKTRACK1     0x02000L // Play audio track 1
+#define SMACKTRACK2     0x04000L // Play audio track 2
+#define SMACKTRACK3     0x08000L // Play audio track 3
+#define SMACKTRACK4     0x10000L // Play audio track 4
+#define SMACKTRACK5     0x20000L // Play audio track 5
+#define SMACKTRACK6     0x40000L // Play audio track 6
+#define SMACKTRACK7     0x80000L // Play audio track 7
+
+
 #define SMACKBUFFER555      0x80000000
 #define SMACKBUFFER565      0xC0000000
 
--- a/GUIFont.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/GUIFont.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -192,7 +192,7 @@
             if ( char_pxl )
                 {
                 if ( char_pxl == 1 )
-                    *draw_buff = pFontPalette[1];         
+                    *draw_buff = pFontPalette[1];     
                 else         
                     *draw_buff = draw_color;         
                 }
--- a/Indoor.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/Indoor.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -3944,8 +3944,8 @@
   static int blv_floor_id[50]; // 00721200
   static int blv_floor_level[50]; // 007212C8
 
-  static __int16 word_721390_ys[104]; // idb
-  static __int16 word_721460_xs[104]; // idb
+  static __int16 blv_floor_face_vert_coord_Y[104]; // word_721390_ys
+  static __int16 blv_floor_face_vert_coord_X[104]; // word_721460_xs
 
   BLVSector* pSector = &pIndoor->pSectors[uSectorID];
   v55 = 0;
@@ -3961,15 +3961,15 @@
     {
       for (uint j = 0; j < pFloor->uNumVertices; ++j)
       {
-        word_721460_xs[2 * j] =     pFloor->pXInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j]].x;
-        word_721460_xs[2 * j + 1] = pFloor->pXInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].x;
-        word_721390_ys[2 * j] =     pFloor->pYInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j]].y;
-        word_721390_ys[2 * j + 1] = pFloor->pYInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].y;
+        blv_floor_face_vert_coord_X[2 * j] =     pFloor->pXInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j]].x;
+        blv_floor_face_vert_coord_X[2 * j + 1] = pFloor->pXInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].x;
+        blv_floor_face_vert_coord_Y[2 * j] =     pFloor->pYInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j]].y;
+        blv_floor_face_vert_coord_Y[2 * j + 1] = pFloor->pYInterceptDisplacements[j] + pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].y;
       }
-      word_721460_xs[2 * pFloor->uNumVertices] = word_721460_xs[0];
-      word_721390_ys[2 * pFloor->uNumVertices] = word_721390_ys[0];
-
-      v50 = word_721390_ys[0] >= y;
+      blv_floor_face_vert_coord_X[2 * pFloor->uNumVertices] = blv_floor_face_vert_coord_X[0];
+      blv_floor_face_vert_coord_Y[2 * pFloor->uNumVertices] = blv_floor_face_vert_coord_Y[0];
+
+      v50 = blv_floor_face_vert_coord_Y[0] >= y;
       v53 = 0;
 
       for (uint j = 0; j < 2 * pFloor->uNumVertices; ++j)
@@ -3978,25 +3978,25 @@
           break;
 
         v48 = v50;
-        v50 = word_721390_ys[j + 1] >= y;
-
-          v13 = i;
-          if (v48 == v50)
-            continue;
-
-            v14 = word_721460_xs[j + 1] >= x ? 0 : 2;
-            v15 = v14 | (word_721460_xs[j] < x);
-
-          if (v15 == 3)
-            continue;
-          else if (!v15)
-            ++v53;
-          else
-          {
-            long long a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
-            long long res = fixpoint_mul((signed int)word_721460_xs[j + 1] - (signed int)word_721460_xs[j], a_div_b);
-
-            if (res + word_721460_xs[j] >= x)
+        v50 = blv_floor_face_vert_coord_Y[j + 1] >= y;
+
+        v13 = i;
+        if (v48 == v50)
+          continue;
+
+        v14 = blv_floor_face_vert_coord_X[j + 1] >= x ? 0 : 2;
+        v15 = v14 | (blv_floor_face_vert_coord_X[j] < x);
+
+        if (v15 == 3)
+          continue;
+        else if (!v15)
+          ++v53;
+        else
+        {
+          long long a_div_b = fixpoint_div(y - blv_floor_face_vert_coord_Y[j], blv_floor_face_vert_coord_Y[j + 1] - blv_floor_face_vert_coord_Y[j]);
+          long long res = fixpoint_mul((signed int)blv_floor_face_vert_coord_X[j + 1] - (signed int)blv_floor_face_vert_coord_X[j], a_div_b);
+
+            if (res + blv_floor_face_vert_coord_X[j] >= x)
                 ++v53;
           }
       }
@@ -4038,35 +4038,35 @@
       {
         for (uint j = 0; j < portal->uNumVertices; ++j)
         {
-          word_721460_xs[2 * j] =     portal->pXInterceptDisplacements[j] + pIndoor->pVertices[portal->pVertexIDs[j]].x;
-          word_721460_xs[2 * j + 1] = portal->pXInterceptDisplacements[j + 1] + pIndoor->pVertices[portal->pVertexIDs[j + 1]].x;
-          word_721390_ys[2 * j] =     portal->pYInterceptDisplacements[j] + pIndoor->pVertices[portal->pVertexIDs[j]].y;
-          word_721390_ys[2 * j + 1] = portal->pYInterceptDisplacements[j + 1] + pIndoor->pVertices[portal->pVertexIDs[j + 1]].y;
+          blv_floor_face_vert_coord_X[2 * j] =     portal->pXInterceptDisplacements[j] + pIndoor->pVertices[portal->pVertexIDs[j]].x;
+          blv_floor_face_vert_coord_X[2 * j + 1] = portal->pXInterceptDisplacements[j + 1] + pIndoor->pVertices[portal->pVertexIDs[j + 1]].x;
+          blv_floor_face_vert_coord_Y[2 * j] =     portal->pYInterceptDisplacements[j] + pIndoor->pVertices[portal->pVertexIDs[j]].y;
+          blv_floor_face_vert_coord_Y[2 * j + 1] = portal->pYInterceptDisplacements[j + 1] + pIndoor->pVertices[portal->pVertexIDs[j + 1]].y;
         }
-        word_721460_xs[2 * portal->uNumVertices] = word_721460_xs[0];
-        word_721390_ys[2 * portal->uNumVertices] = word_721390_ys[0];
+        blv_floor_face_vert_coord_X[2 * portal->uNumVertices] = blv_floor_face_vert_coord_X[0];
+        blv_floor_face_vert_coord_Y[2 * portal->uNumVertices] = blv_floor_face_vert_coord_Y[0];
         v54 = 0;
-        v47 = word_721390_ys[0] >= y;
+        v47 = blv_floor_face_vert_coord_Y[0] >= y;
 
           for (uint j = 0; j < 2 * portal->uNumVertices; ++j)
           {
             v49 = v47;
             if ( v54 >= 2 )
               break;
-            v47 = word_721390_ys[j + 1] >= y;
+            v47 = blv_floor_face_vert_coord_Y[j + 1] >= y;
             if ( v49 != v47 )
             {
-              v28 = word_721460_xs[j + 1] >= x ? 0 : 2;
-              v29 = v28 | (word_721460_xs[j] < x);
+              v28 = blv_floor_face_vert_coord_X[j + 1] >= x ? 0 : 2;
+              v29 = v28 | (blv_floor_face_vert_coord_X[j] < x);
               if ( v29 != 3 )
               {
                 if ( !v29 )
                   ++v54;
                 else
                 {
-                  long long a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
-                  long long res = fixpoint_mul(word_721460_xs[j + 1] - word_721460_xs[j], a_div_b);
-                  if (res + word_721460_xs[j] >= x)
+                  long long a_div_b = fixpoint_div(y - blv_floor_face_vert_coord_Y[j], blv_floor_face_vert_coord_Y[j + 1] - blv_floor_face_vert_coord_Y[j]);
+                  long long res = fixpoint_mul(blv_floor_face_vert_coord_X[j + 1] - blv_floor_face_vert_coord_X[j], a_div_b);
+                  if (res + blv_floor_face_vert_coord_X[j] >= x)
                     ++v54;
                 }
               }
--- a/Outdoor.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/Outdoor.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -3152,12 +3152,11 @@
   int v24; // eax@36
   signed int v25; // ecx@38
   int result; // eax@42
-  signed int v27; // ecx@43
+  signed int current_floor_level; // ecx@43
   int v28; // edi@44
   signed int v29; // edx@44
   int v30; // esi@45
   int v31; // eax@45
-  ODMFace *v32; // eax@57
   int v33; // ecx@59
   int v36; // [sp+14h] [bp-2Ch]@24
   int v38; // [sp+1Ch] [bp-24h]@2
@@ -3168,7 +3167,7 @@
   bool next_vertices_Y; // [sp+34h] [bp-Ch]@24
   signed int v46; // [sp+3Ch] [bp-4h]@1
   signed int number_hits; // [sp+58h] [bp+18h]@22
-  signed int v49; // [sp+58h] [bp+18h]@43
+  signed int next_floor_level; // [sp+58h] [bp+18h]@43
 
   v46 = 1;
   dword_721160[0] = -1;
@@ -3187,23 +3186,24 @@
         for ( pFaceNum = 0; pFaceNum < pBModel->uNumFaces; ++pFaceNum )
         {
           pFace = &pBModel->pFaces[pFaceNum];
+          if ( pFace->Ethereal() )
+            continue;
           if ( (pFace->uPolygonType == POLYGON_Floor || pFace->uPolygonType == POLYGON_InBetweenFloorAndWall)
-            && !(pFace->uAttributes & 0x20000000)
             && X <= pFace->pBoundingBox.x2 && X >= pFace->pBoundingBox.x1
             && Y <= pFace->pBoundingBox.y2 && Y >= pFace->pBoundingBox.y1 )
           {
             
               for ( uint i = 0; i < pFace->uNumVertices; ++i)
               {
-                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;
+                odm_floor_face_vert_coord_X[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].x;
+                odm_floor_face_vert_coord_Y[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].y;
+                odm_floor_face_vert_coord_X[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x;
+                odm_floor_face_vert_coord_Y[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y;
               }
-            FloorFaceVertCoord_X[2 * pFace->uNumVertices] = FloorFaceVertCoord_X[0];
-            FloorFaceVertCoord_Y[2 * pFace->uNumVertices] = FloorFaceVertCoord_Y[0];
-
-            current_vertices_Y = FloorFaceVertCoord_Y[0] >= Y;
+            odm_floor_face_vert_coord_X[2 * pFace->uNumVertices] = odm_floor_face_vert_coord_X[0];
+            odm_floor_face_vert_coord_Y[2 * pFace->uNumVertices] = odm_floor_face_vert_coord_Y[0];
+
+            current_vertices_Y = odm_floor_face_vert_coord_Y[0] >= Y;
             number_hits = 0;
             if ( 2 * pFace->uNumVertices > 0 )
             {
@@ -3211,21 +3211,22 @@
               {
                 if ( number_hits >= 2 )
                   break;
-                v36 = FloorFaceVertCoord_Y[i + 1];
-                next_vertices_Y = FloorFaceVertCoord_Y[i + 1] >= Y;
+                //v36 = odm_floor_face_vert_coord_Y[i + 1];
+                next_vertices_Y = odm_floor_face_vert_coord_Y[i + 1] >= Y;
                 if ( current_vertices_Y != next_vertices_Y )//проверка по Y
                 {
-                  v18 = FloorFaceVertCoord_X[i + 1] >= X ? 0 : 2;
-                  v19 = v18 | (FloorFaceVertCoord_X[i] < X);
+                  v18 = odm_floor_face_vert_coord_X[i + 1] >= X ? 0 : 2;
+                  v19 = v18 | (odm_floor_face_vert_coord_X[i] < X);
                   if ( v19 != 3 )
                   {
                     if ( !v19 )
                       ++number_hits;
                     else
                     {
-                      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]);
+                      LODWORD(v23) = (Y - odm_floor_face_vert_coord_Y[i]) << 16;
+                      HIDWORD(v23) = (Y - odm_floor_face_vert_coord_Y[i]) >> 16;
+                      v22 = ((((odm_floor_face_vert_coord_X[i + 1] - odm_floor_face_vert_coord_X[i]) * v23 / (odm_floor_face_vert_coord_Y[i + 1]
+                              - odm_floor_face_vert_coord_Y[i])) >> 16) + odm_floor_face_vert_coord_X[i]);
                       if ( v22 >= X) 
                         ++number_hits;
                     }
@@ -3259,51 +3260,43 @@
     *bmodel_pid = 0;
     return odm_floor_level[0];
   }
-  v27 = 0;
+  current_floor_level = 0;
+  v29 = 0;
   if ( v46 <= 1 )
     *bmodel_pid = 0;
   else
   {
-    //v29 = 1;
-    for ( v49 = 1; v49 < v46; ++v49 )
+    current_floor_level = odm_floor_level[0];
+    for ( uint i = 1; i < v46; ++i )
     {
-      if ( odm_floor_level[v49] == odm_floor_level[0] )
-      {
-        v27 = v49;
-        //++v29;
-        break;
-      }
-      if ( odm_floor_level[0] > Z + 5 )
+      next_floor_level = odm_floor_level[i];
+      if ( current_floor_level <= Z + 5 )
       {
-        if ( odm_floor_level[v49] >= odm_floor_level[0] )
+        if ( next_floor_level > current_floor_level && next_floor_level <= Z + 5 )
         {
-          //++v29;
-          break;
+          current_floor_level = next_floor_level;
+          v29 = i;
         }
-        v27 = v49;
-        //++v29;
-        break;
       }
-      if ( odm_floor_level[v49] > odm_floor_level[0] && odm_floor_level[v49] <= Z + 5 )
+      else if ( next_floor_level < current_floor_level )
       {
-        v27 = v49;
-        //++v29;
+        current_floor_level = next_floor_level;
+        v29 = i;
       }
     }
-    if ( !v27 )
+    if ( !v29 )
       *bmodel_pid = 0;
     else
-      *bmodel_pid = dword_721110[v27] | (dword_721160[v27] << 6);
+      *bmodel_pid = dword_721110[v29] | (dword_721160[v29] << 6);
   }
-  if ( v27 )
+  if ( v29 )
   {
-    v32 = &pOutdoor->pBModels[dword_721160[v27]].pFaces[dword_721110[v27]];
     *pIsOnWater = false;
-    if ( v32->Fluid())
+    if ( pOutdoor->pBModels[dword_721160[v29]].pFaces[dword_721110[v29]].Fluid())
       *pIsOnWater = true;
   }
-  if ( odm_floor_level[v27] >= odm_floor_level[0] )
-    odm_floor_level[0] = odm_floor_level[v27];
+  if ( odm_floor_level[v29] >= odm_floor_level[0] )
+    odm_floor_level[0] = odm_floor_level[v29];
   return odm_floor_level[0];
 }
 
@@ -4518,12 +4511,13 @@
 
   if ( bWalkSound && pParty->walk_sound_timer <= 0 )
   {
+    pAudioPlayer->_4AA258(804);
     v122 = abs(pParty->vPosition.x - pX);
     v126 = abs(pParty->vPosition.y - pY);
     v62 = abs(pParty->vPosition.z - pZ);
-    if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) >= 8 )
+    if ( party_running_flag && (!hovering || high_fall_flag) )
     {
-      if ( party_running_flag && (!hovering || !high_fall_flag) )
+      if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) >= 16 )
       {
         if ( !is_not_on_bmodel
            && !(BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20) )
@@ -4533,8 +4527,12 @@
           v87 = pOutdoor->GetSoundIdByPosition(WorldPosToGridCellX(pParty->vPosition.x), WorldPosToGridCellZ(pParty->vPosition.y) - 1, 1);
           pAudioPlayer->PlaySound((SoundID)v87, 804, 1, -1, 0, 0, 0, 0);//бег по земле
         }
+        pParty->walk_sound_timer = 96;
       }
-      else if ( party_walking_flag && (!hovering || !high_fall_flag) )
+    }
+    else if( party_walking_flag && (!hovering || high_fall_flag) )
+    {
+      if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) >= 8 )
       {
         if ( is_not_on_bmodel
           || BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20 )
@@ -4544,13 +4542,14 @@
         }
         else
           pAudioPlayer->PlaySound(SOUND_WalkAlong3DModel, 804, 1, -1, 0, 0, 0, 0);// хождение на 3D Modelи
+        pParty->walk_sound_timer = 64;
       }
     }
-    else
-    {
-      pAudioPlayer->_4AA258(804);
-      pParty->walk_sound_timer = 64;
-    }
+    //else
+    //{
+      //pAudioPlayer->_4AA258(804);
+      //pParty->walk_sound_timer = 64;
+    //}
   }
 
   if ( !hovering || !high_fall_flag )
--- a/Outdoor.h	Wed Dec 04 00:45:18 2013 +0600
+++ b/Outdoor.h	Fri Dec 06 23:35:50 2013 +0600
@@ -89,6 +89,7 @@
   inline bool Portal() const    {return (uAttributes & FACE_PORTAL) != 0;}
   inline bool Fluid() const     {return (uAttributes & FACE_FLUID) != 0;}
   inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;}
+  inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;}
 
   struct Plane_int_ pFacePlane;
   int zCalc1;
--- a/Render.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/Render.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -1215,7 +1215,7 @@
     {
       v2 = 1;
 LABEL_6:
-      memcpy(Dst, Src, 0x20u);
+      memcpy(Dst, Src, sizeof(DDPIXELFORMAT));
       return v2;
     }
   }
@@ -6745,7 +6745,7 @@
   unsigned int g = ((c >> 5) & 63) * 4;
   unsigned int r = ((c >> 11) & 31) * 8;
 
-  return 0xFF000000 | (r << 16) | (g << 8) | b;
+  return  (r << 16) | (g << 8) | b;//
 }
 
 //----- (0040DEF3) --------------------------------------------------------
@@ -7105,7 +7105,7 @@
     void *pDst = (char *)pTargetSurface + (FORCE_16_BITS ? 2 : 4) * (uX + (y + uY) * uTargetSurfacePitch);
 
     memset32(pDst,
-             FORCE_16_BITS ? twoColors : Color32(uColor16),  // two colors per int (16bit) or 1 (32bit)
+             FORCE_16_BITS ? twoColors : 0xFF000000 |Color32(uColor16),  // two colors per int (16bit) or 1 (32bit)
              uWidth / (FORCE_16_BITS ? 2 : 1));                      // two pixels per int (16bit) or 1 (32bit)
 
     if (FORCE_16_BITS && uWidth & 1) // we may miss one pixel for 16bit
@@ -7114,7 +7114,9 @@
 }
 
 //----- (004A6C4F) --------------------------------------------------------
-void Render::DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor)
+void Render::DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, 
+                       unsigned int uCharHeight, unsigned __int16 *pFontPalette, 
+                       unsigned __int16 uFaceColor, unsigned __int16 uShadowColor)
 {
   unsigned int v9; // edi@2
   unsigned int v10; // esi@2
@@ -7195,10 +7197,11 @@
           v22 = uShadowColor;
           if ( *v24 != 1 )
             v22 = uFaceColor;
-          WritePixel16(clipped_out_x + x, clipped_out_y + y, v22);
+           WritePixel16(clipped_out_x + x, clipped_out_y + y, v22);
         }
-      }
-        v24 += uCharWidth - v9;
+        ++v24;
+      } 
+      v24 += uCharWidth - v9;
         //v23 = uOutXa-- == 1;
         //v11 += this->uTargetSurfacePitch - v9;
     }
@@ -7313,8 +7316,9 @@
               WritePixel16(clipped_out_x + dx, clipped_out_y + dy, v24);
               //*v10 = v24;
               //++v10;
-              //++v11;
+              ++v11;
               //--v27;
+
         }
           v11 += a5 - v8;
       }
@@ -7353,10 +7357,11 @@
       {
         for (int dx = 0; dx < v8; ++dx)
         {
+            if ( *v11 )       
               WritePixel16(clipped_out_x + dx, clipped_out_y + dy, pPalette[*v11]);
               //*v10 = v24;
               //++v10;
-              //++v11;
+              ++v11;
               //--v27;
         }
           v11 += a5 - v8;
--- a/UI/UiGame.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/UI/UiGame.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -31,7 +31,7 @@
 #include "..\texts.h"
 #include "UIHouses.h"
 #include "..\BSPModel.h"
-#include "OurMath.h"
+#include "..\OurMath.h"
 #include "..\Level/Decoration.h"
 
 
--- a/VideoPlayer.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/VideoPlayer.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -939,7 +939,7 @@
       if ( !_stricmp(this->pMightVideoHeaders[i].pVideoName, pFilename) )
       {
         SetFilePointer(this->hMightVid, this->pMightVideoHeaders[i].uFileOffset, 0, 0);
-        return SmackOpen(this->hMightVid, 0x7140, -1);
+        return SmackOpen(this->hMightVid, SMACKTRACK2|SMACKTRACK1|SMACKFILEHANDLE|SMACKLOADEXTRA|SMACKNEEDVOLUME, -1);//0x7140,
       }
     }
   }
@@ -950,7 +950,7 @@
       if ( !_stricmp(this->pMagicVideoHeaders[i].pVideoName, pFilename) )
       {
         SetFilePointer(this->hMagicVid, this->pMagicVideoHeaders[i].uFileOffset, 0, 0);
-        return SmackOpen(this->hMagicVid, 0x7140, -1);
+        return SmackOpen(this->hMagicVid, SMACKTRACK2|SMACKTRACK1|SMACKFILEHANDLE|SMACKLOADEXTRA|SMACKNEEDVOLUME, -1);
       }
     }
   }
--- a/mm7_2.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/mm7_2.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -4305,7 +4305,7 @@
 bool debug_information = false;
 bool show_picked_face = false;
 bool draw_debug_line = false;
-bool new_speed = true;
+bool new_speed = false;
 int max_flight_height = 4000;
 
 
--- a/mm7_data.cpp	Wed Dec 04 00:45:18 2013 +0600
+++ b/mm7_data.cpp	Fri Dec 06 23:35:50 2013 +0600
@@ -1234,8 +1234,8 @@
 std::array<int, 20> dword_720E80;
 std::array<int, 20> dword_720ED0;
 std::array<int, 20> ceiling_height_level;
-std::array<__int16, 777> FloorFaceVertCoord_Y; // idb
-std::array<__int16, 777> FloorFaceVertCoord_X; // idb
+std::array<__int16, 104> odm_floor_face_vert_coord_Y; // word_720F70
+std::array<__int16, 104> odm_floor_face_vert_coord_X; // word_721040
 std::array<int, 777> dword_721110; // idb
 std::array<int, 777> dword_721160; // idb
 std::array<int, 20> odm_floor_level; // idb
--- a/mm7_data.h	Wed Dec 04 00:45:18 2013 +0600
+++ b/mm7_data.h	Fri Dec 06 23:35:50 2013 +0600
@@ -907,8 +907,8 @@
 extern std::array<int, 20> dword_720E80;
 extern std::array<int, 20> dword_720ED0;
 extern std::array<int, 20> ceiling_height_level;
-extern std::array<__int16, 777> FloorFaceVertCoord_Y; // idb
-extern std::array<__int16, 777> FloorFaceVertCoord_X; // idb
+extern std::array<__int16, 104> odm_floor_face_vert_coord_Y; // word_720F70
+extern std::array<__int16, 104> odm_floor_face_vert_coord_X; // word_721040
 extern std::array<int, 777> dword_721110; // idb
 extern std::array<int, 777> dword_721160; // idb
 extern std::array<int, 20> odm_floor_level; // idb dword_7211B0