diff --git a/REDALERT/CONQUER.CPP b/REDALERT/CONQUER.CPP
index 5dffdd9..e6a2738 100644
--- a/REDALERT/CONQUER.CPP
+++ b/REDALERT/CONQUER.CPP
@@ -2539,6 +2539,8 @@ void Go_Editor(bool flag)
*/
if (flag) {
AudMix_SetMusicState(false); // jmarshall: disable music if we are in editor mode
+ Hide_Mouse();
+ ShowCursor(TRUE);
Debug_Map = true;
Debug_Unshroud = true;
@@ -2570,6 +2572,9 @@ void Go_Editor(bool flag)
} else {
AudMix_SetMusicState(true); // jmarshall: enable music if we are going back into editor mode.
+ Show_Mouse();
+ ShowCursor(FALSE);
+
/*
** Go into normal game mode
*/
diff --git a/REDALERT/RedAlert.vcxproj b/REDALERT/RedAlert.vcxproj
index ec33684..8e7a341 100644
--- a/REDALERT/RedAlert.vcxproj
+++ b/REDALERT/RedAlert.vcxproj
@@ -172,7 +172,7 @@
-
+
@@ -488,7 +488,7 @@
-
+
diff --git a/REDALERT/RedAlert.vcxproj.filters b/REDALERT/RedAlert.vcxproj.filters
index 1045b1b..56b6a57 100644
--- a/REDALERT/RedAlert.vcxproj.filters
+++ b/REDALERT/RedAlert.vcxproj.filters
@@ -951,9 +951,6 @@
Source Files\imgui
-
- Source Files\imgui
-
Source Files\imgui
@@ -963,6 +960,9 @@
Source Files\imgui
+
+ Source Files\imgui
+
@@ -1865,9 +1865,6 @@
Source Files\imgui
-
- Source Files\imgui
-
Source Files\imgui
@@ -1886,6 +1883,9 @@
Source Files\imgui
+
+ Source Files\imgui
+
diff --git a/REDALERT/STARTUP.CPP b/REDALERT/STARTUP.CPP
index 710aec7..afb0545 100644
--- a/REDALERT/STARTUP.CPP
+++ b/REDALERT/STARTUP.CPP
@@ -37,11 +37,12 @@
// jmarshall - imgui
#include "imgui.h"
-#include "examples/imgui_impl_win32.h"
+#include "examples/imgui_impl_sdl.h"
#include "examples/imgui_impl_dx9.h"
#include
extern LPDIRECT3DDEVICE9 globald3d9Device;
+extern SDL_Window* game_window;
// jmarshall end
@@ -574,7 +575,7 @@ int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char * command_line , int
//ImGui::StyleColorsClassic();
// Setup Platform/Renderer bindings
- ImGui_ImplWin32_Init(MainWindow);
+ ImGui_ImplSDL2_InitForD3D(game_window);
ImGui_ImplDX9_Init(globald3d9Device);
io.Fonts->AddFontFromFileTTF("code/fonts/Roboto-Medium.ttf", 16.0f);
diff --git a/REDALERT/WIN32LIB/MOUSEWW.CPP b/REDALERT/WIN32LIB/MOUSEWW.CPP
index 5143df1..0e170f4 100644
--- a/REDALERT/WIN32LIB/MOUSEWW.CPP
+++ b/REDALERT/WIN32LIB/MOUSEWW.CPP
@@ -318,6 +318,10 @@ void WWMouseClass::Hide_Mouse()
void WWMouseClass::Low_Show_Mouse(int x, int y)
{
+ extern bool Debug_Map;
+ if (Debug_Map)
+ return;
+
//
// If the mouse is completely visible then draw it at its current
// position.
diff --git a/REDALERT/WINSTUB.CPP b/REDALERT/WINSTUB.CPP
index 70db209..fddb46c 100644
--- a/REDALERT/WINSTUB.CPP
+++ b/REDALERT/WINSTUB.CPP
@@ -41,9 +41,11 @@
* Focus_Loss -- this function is called when a library function detects focus loss *
* Memory_Error_Handler -- Handle a possibly fatal failure to allocate memory *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
+#include "imgui.h"
+#include "examples/imgui_impl_sdl.h"
#include "function.h"
+
#ifdef WINSOCK_IPX
#include "WSProto.h"
#else //WINSOCK_IPX
@@ -755,6 +757,9 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags) {
Keyboard->Put_Element(event.key.keysym.sym);
break;
}
+
+ if (Debug_Map)
+ ImGui_ImplSDL2_ProcessEvent(&event);
}
if (!leftMouseProcessed && numFramesLMouse != 0)
diff --git a/ddraw/ddrawwrapper/DirectDrawWrapper.cpp b/ddraw/ddrawwrapper/DirectDrawWrapper.cpp
index fd33186..5f37059 100644
--- a/ddraw/ddrawwrapper/DirectDrawWrapper.cpp
+++ b/ddraw/ddrawwrapper/DirectDrawWrapper.cpp
@@ -1,10 +1,11 @@
#define UNICODE
#include "DirectDrawWrapper.h"
#include "imgui.h"
-#include "examples/imgui_impl_win32.h"
+#include "examples/imgui_impl_sdl.h"
#include "examples/imgui_impl_dx9.h"
//#include "resource.h"
LPDIRECT3DDEVICE9 globald3d9Device;
+extern SDL_Window* game_window;
/*******************
**IUnknown methods**
@@ -1324,10 +1325,12 @@ HRESULT IDirectDrawWrapper::Present()
if (Imgui_Dialog_Function) {
ImGuiIO& io = ImGui::GetIO();
- io.DisplaySize = ImVec2(displayWidth, displayHeight);
+ io.DisplaySize = ImVec2(displayWidth, displayHeight);
ImGui_ImplDX9_NewFrame();
ImGui::NewFrame();
+ ImGui_ImplSDL2_NewFrame(game_window);
+
Imgui_Dialog_Function();
ImGui::Render();