changeset 227:bcd55744c2f4

Clicking background in MainMenu fix
author Nomad
date Sun, 17 Feb 2013 15:09:31 +0200
parents c2f2d2644304
children 46ae2602aceb
files CShow.h Game.cpp Outdoor.h VideoPlayer.cpp Vis.cpp mm7_data.cpp mm7_data.h
diffstat 7 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/CShow.h	Sun Feb 17 11:40:10 2013 +0100
+++ b/CShow.h	Sun Feb 17 15:09:31 2013 +0200
@@ -36,7 +36,7 @@
   //std::string v5; // [sp-18h] [bp-24h]@4
   //signed int v6; // [sp-Ch] [bp-18h]@10
   int ScreenSizeFlag; // [sp-8h] [bp-14h]@4
-  int v8; // [sp-4h] [bp-10h]@4
+  //int v8; // [sp-4h] [bp-10h]@4
   //char v9; // [sp+0h] [bp-Ch]@14
   //char v10; // [sp+4h] [bp-8h]@4
   //int a3; // [sp+Bh] [bp-1h]@14
@@ -49,53 +49,46 @@
       MessageBoxW(nullptr, L"No movie", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Show.cpp:40", 0);
       break;
     case MOVIE_3DOLogo:
-      v8 = 1;
       ScreenSizeFlag = 0;
       v3 = 0;
       Name = "3dologo";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_NWCLogo:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 0;
       Name = "new world logo";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_JVC:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 0;
       Name = "jvc";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_Intro:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 0;
       Name = "Intro";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_Emerald:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 0;
       Name = "Intro Post";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_Death:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 2;
       Name = "losegame";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     case MOVIE_Outro:
-      v8 = 1;
       ScreenSizeFlag = 1;
       v3 = 20;
       Name = "end_seq1";
-      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8);
+      VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1);
       break;
     default:
       MessageBoxW(nullptr, L"Invalid movie requested in CShow::Run()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Show.cpp:72", 0);
--- a/Game.cpp	Sun Feb 17 11:40:10 2013 +0100
+++ b/Game.cpp	Sun Feb 17 15:09:31 2013 +0200
@@ -1024,7 +1024,7 @@
 //----- (0044EA5E) --------------------------------------------------------
 bool Game::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
 {
-  if (pCurrentScreen || !pRenderer->pRenderD3D)
+  if (pCurrentScreen != SCREEN_GAME|| !pRenderer->pRenderD3D)
     return false;
 
   if (!pVisInstance)
--- a/Outdoor.h	Sun Feb 17 11:40:10 2013 +0100
+++ b/Outdoor.h	Sun Feb 17 15:09:31 2013 +0200
@@ -124,6 +124,9 @@
   {
     subconstuctor();
     uLastSunlightUpdateMinute = 0;
+
+    uNumBModels = 0;
+    pBModels = nullptr;
   }
   //----- (004626CD) --------------------------------------------------------
   void subconstuctor()
--- a/VideoPlayer.cpp	Sun Feb 17 11:40:10 2013 +0100
+++ b/VideoPlayer.cpp	Sun Feb 17 15:09:31 2013 +0200
@@ -334,7 +334,7 @@
 
 
 //----- (004BE70E) --------------------------------------------------------
-void __fastcall VideoPlayer::MovieLoop(const char *pMovieName, int a2, int ScreenSizeFlag, int uGameState)
+void __fastcall VideoPlayer::MovieLoop(const char *pMovieName, int a2, int ScreenSizeFlag, int a4)
 {
   int v4; // ebp@1
   const char *pName; // edi@1
@@ -418,7 +418,7 @@
         }
       }
     }
-    if ( uGameState == GAME_FINISHED )
+    if (a4 == 1)
       pCurrentScreen = SCREEN_GAME;
     pVideoPlayer->bPlayingMovie = 0;
     ShowCursor(1);
--- a/Vis.cpp	Sun Feb 17 11:40:10 2013 +0100
+++ b/Vis.cpp	Sun Feb 17 15:09:31 2013 +0200
@@ -6,6 +6,7 @@
 #include "Actor.h"
 #include "IndoorCamera.h"
 #include "Viewport.h"
+#include "Log.h"
 
 #include "mm7_data.h"
 //#include "MM7.h"
@@ -1482,8 +1483,13 @@
   PickBillboards_Mouse(fDepth, fMouseX, fMouseY, &default_list, sprite_filter);
   if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
     PickIndoorFaces_Mouse(fDepth, pMouseRay, &default_list, face_filter);
+  else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
+    PickOutdoorFaces_Mouse(fDepth, pMouseRay, &default_list, face_filter, false);
   else
-    PickOutdoorFaces_Mouse(fDepth, pMouseRay, &default_list, face_filter, false);
+  {
+    Log::Warning(L"Picking mouse in undefined level"); // picking in main menu is default (buggy) game behavious. should've returned false in Game::PickMouse
+    return false;
+  }
   default_list.create_object_pointers(Vis_SelectionList::All);
   sort_object_pointers(default_list.object_pointers, 0, default_list.uNumPointers - 1);
 
--- a/mm7_data.cpp	Sun Feb 17 11:40:10 2013 +0100
+++ b/mm7_data.cpp	Sun Feb 17 15:09:31 2013 +0200
@@ -2,6 +2,7 @@
 
 #include "NPC.h"
 #include "Actor.h"
+#include "GUIWindow.h"
 
 
 
@@ -477,7 +478,7 @@
 char aS100110D[777]; // idb
 char aS100110DS[777]; // idb
 char aS100110D02dSS[777]; // idb
-int pCurrentScreen; // weak
+int pCurrentScreen = SCREEN_VIDEO; // 004E28F8
 char byte_4E28FC; // weak
 unsigned int uGammaPos;
 int dword_4E2910[777]; // weak
--- a/mm7_data.h	Sun Feb 17 11:40:10 2013 +0100
+++ b/mm7_data.h	Sun Feb 17 15:09:31 2013 +0200
@@ -456,7 +456,7 @@
 extern char aS100110D[]; // idb
 extern char aS100110DS[]; // idb
 extern char aS100110D02dSS[]; // idb
-extern int pCurrentScreen; // weak
+extern int pCurrentScreen; // 004E28F8
 extern char byte_4E28FC; // weak
 extern unsigned int uGammaPos;
 extern int dword_4E2910[]; // weak