diff Game.cpp @ 791:346f7069676a

Indoor::GetSector and various stuff
author Nomad
date Mon, 25 Mar 2013 05:27:18 +0200
parents b27dd658ea77
children 4a00901e063c d2deab4991fa
line wrap: on
line diff
--- a/Game.cpp	Sun Mar 24 23:45:50 2013 +0200
+++ b/Game.cpp	Mon Mar 25 05:27:18 2013 +0200
@@ -22,6 +22,7 @@
 #include "Arcomage.h"
 #include "texts.h"
 #include "Actor.h"
+#include "GUIFont.h"
 #include "Log.h"
 
 //#include "MM7.h"
@@ -119,6 +120,11 @@
   }
   pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
 LABEL_22:
+
+  //DEBUG: force redraw gui
+  viewparams->bRedrawGameUI = true;
+
+
   pRenderer->BeginScene();
   if (pRenderer->pRenderD3D)
     pMouse->DrawCursorToTarget();
@@ -166,12 +172,35 @@
     pOtherOverlayList->DrawTurnBasedIcon(v4);
     GameUI_DrawTorchlightAndWizardEye();
   }
+
+  if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
+  {
+    sprintf(pTmpBuf, "Party Sector ID:        %u/%u\n", pBLVRenderParams->uPartySectorID, pIndoor->uNumSectors);
+    pPrimaryWindow->DrawText(pFontArrus, 16, 16, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF);
+  }
+  sprintf(pTmpBuf, "Party Position:         % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
+  pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF);
+  
+  if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
+  {
+    uint uFaceID;
+    auto floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, pBLVRenderParams->uPartySectorID, &uFaceID);
+    sprintf(pTmpBuf, "BLV_GetFloorLevel: %d   face_id %d\n", floor_level, uFaceID);
+  }
+  else
+  {
+    int on_water, _a6;
+    auto floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false);
+    sprintf(pTmpBuf, "ODM_GetFloorLevel: %d   on_water: %s    a6 = %d\n", floor_level, on_water ? "true" : "false", _a6);
+  }
+  pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF);
+
   GUI_UpdateWindows();
   pParty->UpdatePlayersAndHirelingsEmotions();
   ++stru_51076C.field_8;
   _unused_5B5924_is_travel_ui_drawn = false;
   if (v4)
-    pMouse->field_14 = 1;
+    pMouse->bRedraw = true;
   pMouse->_469EA4();
   pMouse->DrawCursor();
   pMouse->_469E1C();