diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 5b7f46589..194f34dee 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -49,6 +49,9 @@ include(GNUInstallDirs OPTIONAL RESULT_VARIABLE GNUINSTALLDIRS) option(CORE "Build the core" ON) option(BASE "Build the base game code" ON) option(D3XP "Build the d3xp game code" ON) +if(MSVC) + option(TOOLS "Build the tools game code (Windows+Visual Studio+SDL2 only)" OFF) +endif() option(DEDICATED "Build the dedicated server" OFF) option(ONATIVE "Optimize for the host CPU" OFF) option(SDL2 "Use SDL2 instead of SDL1.2" ON) @@ -149,6 +152,16 @@ else() set(CURL_LIBRARY "") endif() +if(MSVC) + # This is required for tools on windows. + find_package(MFC) + + if(TOOLS AND NOT MFC_FOUND) + message(SEND_ERROR "MFC ('Microsoft Foundation Classes for C++') couldn't be found, but is needed for TOOLS!") + message(FATAL_ERROR "If you're using VS2013, you'll also need the 'Multibyte MFC Library for Visual Studio 2013': https://www.microsoft.com/en-us/download/details.aspx?id=40770 (VS2015 and 2017 include that in the default MFC package)") + endif() +endif() + # compiler specific flags if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options(-pipe) @@ -231,7 +244,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") set(sys_libs ${sys_libs} ${EXECINFO_LIBRARIES}) endif() elseif(MSVC) + add_definitions(/MP) # parallel build (use all cores, or as many as configured in VS) + add_compile_options(/W4) + add_compile_options(/we4840) # treat as error when passing a class to a vararg-function (probably printf-like) add_compile_options(/wd4100) # unreferenced formal parameter add_compile_options(/wd4127) # conditional expression is constant add_compile_options(/wd4244) # possible loss of data @@ -509,12 +525,6 @@ set(src_ui add_globbed_headers(src_ui "ui") -set(src_tools - tools/guied/GEWindowWrapper_stub.cpp -) - -# TODO: add_globbed_headers(src_tools "tools/guied") - set(src_idlib idlib/bv/Bounds.cpp idlib/bv/Frustum.cpp @@ -734,6 +744,80 @@ set(src_core set(src_stub_openal sys/stub/openal_stub.cpp) set(src_stub_gl sys/stub/stub_gl.cpp) + +set(src_tools + tools/guied/GEWindowWrapper_stub.cpp +) + +# TODO: add_globbed_headers(src_tools "tools/guied") + +# Begin normal tools code +if (TOOLS AND MFC_FOUND AND MSVC) + set(ALLOWRESOURCES ON) + # Common files. + file(GLOB src_comafx "tools/comafx/*.cpp") + add_globbed_headers(src_comafx "tools/comafx") + file(GLOB_RECURSE src_tools_common "tools/common/*.cpp") + add_globbed_headers(src_tools_common "tools/common") + + #Compilers. + # DG: this is always added, why add it again? file(GLOB src_compiler_renderbump "neo/tools/compilers/renderbump/*.cpp") + file(GLOB src_compiler_roqvq "tools/compilers/roqvq/*.cpp") # FIXME: some of those were added before + add_globbed_headers(src_compiler_roqvq "tools/compilers/roqvq") + #tools + # Articulated Frame editor. + file(GLOB src_afeditor "tools/af/*.cpp") + add_globbed_headers(src_afeditor "tools/af") + # Declaration editor + file(GLOB src_decleditor "tools/decl/*.cpp") + add_globbed_headers(src_decleditor "tools/decl") + # GUI Editor. + file(GLOB src_gui_editor "tools/guied/*.cpp") + add_globbed_headers(src_gui_editor "tools/guied") + # Material editor + file(GLOB src_materialeditor "tools/materialeditor/*.cpp") + add_globbed_headers(src_materialeditor "tools/materialeditor") + # Particle Editor + file(GLOB src_particleeditor "tools/particle/*.cpp") + add_globbed_headers(src_particleeditor "tools/particle") + # PDA editor + file(GLOB src_pdaeditor "tools/pda/*.cpp") + add_globbed_headers(src_pdaeditor "tools/pda") + # Radiant ( Map editor ) + file(GLOB src_map_editor "tools/radiant/*.cpp") + add_globbed_headers(src_map_editor "tools/radiant") + # Script editor + file(GLOB src_script_editor "tools/script/*.cpp") + add_globbed_headers(src_script_editor "tools/script") + # sound editor? + file(GLOB src_sound_editor "tools/sound/*.cpp") + add_globbed_headers(src_sound_editor "tools/sound") + + + # The numerous tools in a nice list. + list(APPEND src_editor_tools + ${src_comafx} + ${src_tools_common} + ${src_compiler_renderbump} + ${src_afeditor} + ${src_decleditor} + ${src_gui_editor} + ${src_materialeditor} + ${src_particleeditor} + ${src_pdaeditor} + ${src_map_editor} + ${src_script_editor} + ${src_sound_editor} + "tools/edit_public.h" + "tools/edit_gui_common.h" + ) + SET(CMAKE_MFC_FLAG 2) + set(TOOLS_DEFINES "ID_ALLOW_TOOLS;__AFXDLL") +else() + set(src_editor_tools "tools/edit_stub.cpp" "tools/edit_public.h") +endif() + + if(AROS) set(DHEWM3BINARY "ADoom3") set(sys_libs ${sys_libs} dll) @@ -783,9 +867,6 @@ elseif(APPLE) ${OSX_RESOURCE_FILES} ) elseif(WIN32) - set(WIN32_RESOURCE_FILES - "${CMAKE_SOURCE_DIR}/sys/win32/rc/dhewm3.rc" - ) set(src_sys_base sys/cpu.cpp @@ -799,7 +880,7 @@ elseif(WIN32) sys/win32/win_syscon.cpp sys/win32/SDL_win32_main.c ) - + # adding the few relevant headers in sys/ manually.. set(src_sys_base ${src_sys_base} sys/platform.h @@ -810,8 +891,16 @@ elseif(WIN32) set(src_sys_core sys/glimp.cpp - ${WIN32_RESOURCE_FILES} ) + + if(TOOLS) + set(src_sys_core ${src_sys_core} "sys/win32/rc/doom.rc") + else() + # adding both .rc files breaks the build, but I think it only contains the icon + # and doom.rc also contains that (+icons for editor etc, AFAIK), so this is fine + set(src_sys_core ${src_sys_core} "${CMAKE_SOURCE_DIR}/sys/win32/rc/dhewm3.rc" ) + endif() + else() set(src_sys_base sys/cpu.cpp @@ -852,11 +941,12 @@ if(CORE) ${src_core} ${src_sys_base} ${src_sys_core} + ${src_editor_tools} ) - source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core}) + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core} ${src_editor_tools}) - set_target_properties(${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "__DOOM_DLL__") + set_target_properties(${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "__DOOM_DLL__;${TOOLS_DEFINES}") set_target_properties(${DHEWM3BINARY} PROPERTIES LINK_FLAGS "${ldflags}") set_target_properties(${DHEWM3BINARY} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/sys/osx/Info.plist) diff --git a/neo/framework/BuildDefines.h b/neo/framework/BuildDefines.h index 67cbf7c49..79a6cb9d9 100644 --- a/neo/framework/BuildDefines.h +++ b/neo/framework/BuildDefines.h @@ -70,8 +70,8 @@ If you have questions concerning this license or the applicable additional terms // compiled out. //#define ID_DEDICATED -// don't define ID_ALLOW_TOOLS when we don't want tool code in the executable. -#if defined( _WIN32 ) && defined(_MFC_VER) && !defined( ID_DEDICATED ) +// don't define ID_ALLOW_TOOLS when we don't want tool code in the executable. - DG: defined in cmake now +#if 0 // defined( _WIN32 ) && defined(_MFC_VER) && !defined( ID_DEDICATED ) #define ID_ALLOW_TOOLS #endif diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index 842c81e79..37648c907 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -48,6 +48,7 @@ If you have questions concerning this license or the applicable additional terms #include "renderer/RenderSystem.h" #include "tools/compilers/compiler_public.h" #include "tools/compilers/aas/AASFileManager.h" +#include "tools/edit_public.h" #include "framework/Common.h" diff --git a/neo/framework/Console.cpp b/neo/framework/Console.cpp index 7b81b2c28..769d9978d 100644 --- a/neo/framework/Console.cpp +++ b/neo/framework/Console.cpp @@ -40,6 +40,8 @@ If you have questions concerning this license or the applicable additional terms #include "framework/Console.h" +#include "tools/edit_public.h" + void SCR_DrawTextLeftAlign( float &y, const char *text, ... ) id_attribute((format(printf,2,3))); void SCR_DrawTextRightAlign( float &y, const char *text, ... ) id_attribute((format(printf,2,3))); diff --git a/neo/framework/FileSystem.h b/neo/framework/FileSystem.h index 529ed5bd5..ad1a8de23 100644 --- a/neo/framework/FileSystem.h +++ b/neo/framework/FileSystem.h @@ -57,6 +57,8 @@ If you have questions concerning this license or the applicable additional terms =============================================================================== */ +// FIXME: DG: this assumes 32bit time_t, but it's 64bit now, at least on some platforms incl. Win32 in modern VS +// => change it (to -1?) or does that break anything? static const ID_TIME_T FILE_NOT_FOUND_TIMESTAMP = 0xFFFFFFFF; static const int MAX_PURE_PAKS = 128; static const int MAX_OSPATH = FILENAME_MAX; diff --git a/neo/idlib/math/Matrix.h b/neo/idlib/math/Matrix.h index 785ac8f6a..381f294d2 100644 --- a/neo/idlib/math/Matrix.h +++ b/neo/idlib/math/Matrix.h @@ -34,6 +34,11 @@ If you have questions concerning this license or the applicable additional terms #include #endif +#ifdef _MSC_VER // DG: I don't care if matrix code has some unused r variable only used for assertions, shut up VS +#pragma warning( push ) +#pragma warning( disable : 4189 ) +#endif + /* =============================================================================== @@ -2946,4 +2951,8 @@ ID_INLINE float *idMatX::ToFloatPtr( void ) { return mat; } +#ifdef _MSC_VER // DG: re-enable warning 4189 +#pragma warning( pop ) +#endif + #endif /* !__MATH_MATRIX_H__ */ diff --git a/neo/renderer/Image_files.cpp b/neo/renderer/Image_files.cpp index 24436c806..6d62e4e7f 100644 --- a/neo/renderer/Image_files.cpp +++ b/neo/renderer/Image_files.cpp @@ -957,7 +957,7 @@ void R_LoadImage( const char *cname, byte **pic, int *width, int *height, ID_TIM *pic = NULL; } if ( timestamp ) { - *timestamp = 0xFFFFFFFF; + *timestamp = FILE_NOT_FOUND_TIMESTAMP; } if ( width ) { *width = 0; @@ -978,7 +978,7 @@ void R_LoadImage( const char *cname, byte **pic, int *width, int *height, ID_TIM if ( ext == "tga" ) { LoadTGA( name.c_str(), pic, width, height, timestamp ); // try tga first - if ( ( pic && *pic == 0 ) || ( timestamp && *timestamp == -1 ) ) { + if ( ( pic && *pic == 0 ) || ( timestamp && *timestamp == FILE_NOT_FOUND_TIMESTAMP ) ) { name.StripFileExtension(); name.DefaultFileExtension( ".jpg" ); LoadJPG( name.c_str(), pic, width, height, timestamp ); diff --git a/neo/renderer/Image_program.cpp b/neo/renderer/Image_program.cpp index e7ec7eeb6..1a02b8729 100644 --- a/neo/renderer/Image_program.cpp +++ b/neo/renderer/Image_program.cpp @@ -403,7 +403,7 @@ static bool R_ParseImageProgram_r( idLexer &src, byte **pic, int *width, int *he } if ( !token.Icmp( "addnormals" ) ) { - byte *pic2; + byte *pic2 = NULL; int width2, height2; MatchAndAppendToken( src, "(" ); @@ -454,7 +454,7 @@ static bool R_ParseImageProgram_r( idLexer &src, byte **pic, int *width, int *he } if ( !token.Icmp( "add" ) ) { - byte *pic2; + byte *pic2 = NULL; int width2, height2; MatchAndAppendToken( src, "(" ); @@ -589,7 +589,7 @@ static bool R_ParseImageProgram_r( idLexer &src, byte **pic, int *width, int *he // load it as an image R_LoadImage( token.c_str(), pic, width, height, ×tamp, true ); - if ( timestamp == -1 ) { + if ( timestamp == FILE_NOT_FOUND_TIMESTAMP ) { return false; } diff --git a/neo/renderer/RenderSystem.cpp b/neo/renderer/RenderSystem.cpp index aa7182050..0a9629c35 100644 --- a/neo/renderer/RenderSystem.cpp +++ b/neo/renderer/RenderSystem.cpp @@ -610,6 +610,13 @@ void idRenderSystemLocal::BeginFrame( int windowWidth, int windowHeight ) { windowHeight = tiledViewport[1]; } + // DG: FIXME: WTF?! this is *not* reset in EndFrame() and next time + // idSessionLocal::UpdateScreen() calls this function to render a proper frame, + // passing renderSystem->GetScreenWidth()/Height() WHICH JUST RETURN glConfig.vidWidth/Height + // will render the whole frame in that resolution (in a corner of the window), unless someone + // resets glConfig.vid* manually... this is quite fragile, I wonder how many (more) bugs + // (esp. in Editor code) will turn up because of this, but right now I don't dare to change + // the behavior either, in case "fixing" it breaks other things glConfig.vidWidth = windowWidth; glConfig.vidHeight = windowHeight; diff --git a/neo/renderer/qgl.h b/neo/renderer/qgl.h index 68b020e63..7480774e9 100644 --- a/neo/renderer/qgl.h +++ b/neo/renderer/qgl.h @@ -112,4 +112,37 @@ extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC qglProgramLocalParameter4fvARB; // GL_EXT_depth_bounds_test extern PFNGLDEPTHBOUNDSEXTPROC qglDepthBoundsEXT; +#if defined( _WIN32 ) && defined(ID_ALLOW_TOOLS) + +extern int (WINAPI * qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *); +extern int (WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +extern int (WINAPI * qwglGetPixelFormat)(HDC); +extern BOOL(WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); +extern BOOL(WINAPI * qwglSwapBuffers)(HDC); + +extern BOOL(WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); +extern HGLRC(WINAPI * qwglCreateContext)(HDC); +extern HGLRC(WINAPI * qwglCreateLayerContext)(HDC, int); +extern BOOL(WINAPI * qwglDeleteContext)(HGLRC); +extern HGLRC(WINAPI * qwglGetCurrentContext)(VOID); +extern HDC(WINAPI * qwglGetCurrentDC)(VOID); +extern PROC(WINAPI * qwglGetProcAddress)(LPCSTR); +extern BOOL(WINAPI * qwglMakeCurrent)(HDC, HGLRC); +extern BOOL(WINAPI * qwglShareLists)(HGLRC, HGLRC); +extern BOOL(WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD); + +extern BOOL(WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +extern BOOL(WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT, + LPLAYERPLANEDESCRIPTOR); +extern int (WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int, + CONST COLORREF *); +extern int (WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int, + COLORREF *); +extern BOOL(WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL); +extern BOOL(WINAPI * qwglSwapLayerBuffers)(HDC, UINT); + +#endif // _WIN32 && ID_ALLOW_TOOLS + #endif diff --git a/neo/sys/glimp.cpp b/neo/sys/glimp.cpp index 8b19b526a..91b1e0658 100644 --- a/neo/sys/glimp.cpp +++ b/neo/sys/glimp.cpp @@ -33,6 +33,11 @@ If you have questions concerning this license or the applicable additional terms #include "renderer/tr_local.h" +#if defined(_WIN32) && defined(ID_ALLOW_TOOLS) +#include "sys/win32/win_local.h" +#include +#endif + idCVar in_nograb("in_nograb", "0", CVAR_SYSTEM | CVAR_NOCHEAT, "prevents input grabbing"); idCVar r_waylandcompat("r_waylandcompat", "0", CVAR_SYSTEM | CVAR_NOCHEAT | CVAR_ARCHIVE, "wayland compatible framebuffer"); @@ -216,6 +221,55 @@ bool GLimp_Init(glimpParms_t parms) { glConfig.isFullscreen = (window->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN; #endif +#if defined(_WIN32) && defined(ID_ALLOW_TOOLS) + +#ifndef SDL_VERSION_ATLEAST(2, 0, 0) + #error "dhewm3 only supports the tools with SDL2, not SDL1!" +#endif + + // The tools are Win32 specific. If building the tools + // then we know we are win32 and we have to include this + // config to get the editors to work. + + // Get the HWND for later use. + SDL_SysWMinfo sdlinfo; + SDL_version sdlver; + SDL_VERSION(&sdlver); + sdlinfo.version = sdlver; + if (SDL_GetWindowWMInfo(window, &sdlinfo) && sdlinfo.subsystem == SDL_SYSWM_WINDOWS) { + win32.hWnd = sdlinfo.info.win.window; + win32.hDC = sdlinfo.info.win.hdc; + // NOTE: hInstance is set in main() + win32.hGLRC = qwglGetCurrentContext(); + + PIXELFORMATDESCRIPTOR src = + { + sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd + 1, // version number + PFD_DRAW_TO_WINDOW | // support window + PFD_SUPPORT_OPENGL | // support OpenGL + PFD_DOUBLEBUFFER, // double buffered + PFD_TYPE_RGBA, // RGBA type + 32, // 32-bit color depth + 0, 0, 0, 0, 0, 0, // color bits ignored + 8, // 8 bit destination alpha + 0, // shift bit ignored + 0, // no accumulation buffer + 0, 0, 0, 0, // accum bits ignored + 24, // 24-bit z-buffer + 8, // 8-bit stencil buffer + 0, // no auxiliary buffer + PFD_MAIN_PLANE, // main layer + 0, // reserved + 0, 0, 0 // layer masks ignored + }; + memcpy(&win32.pfd, &src, sizeof(PIXELFORMATDESCRIPTOR)); + } else { + // TODO: can we just disable them? + common->Error("SDL_GetWindowWMInfo(), which is needed for Tools to work, failed!"); + } +#endif // defined(_WIN32) && defined(ID_ALLOW_TOOLS) + common->Printf("Using %d color bits, %d depth, %d stencil display\n", channelcolorbits, tdepthbits, tstencilbits); diff --git a/neo/sys/win32/rc/Radiant_resource.h b/neo/sys/win32/rc/Radiant_resource.h index c2540fe10..3b725e754 100644 --- a/neo/sys/win32/rc/Radiant_resource.h +++ b/neo/sys/win32/rc/Radiant_resource.h @@ -872,6 +872,11 @@ If you have questions concerning this license or the applicable additional terms #define ID_SELECTION_VIEW_WIREFRAMEOFF 30403 #define ID_SELECTION_VIEW_VISIBLEON 30404 #define ID_SELECTION_VIEW_VISIBLEOFF 30405 +/* Begin SS2 changes */ +#define ID_SET_VIEW_TOP 30406 +#define ID_SET_VIEW_SIDE 30407 +#define ID_SET_VIEW_FRONT 30408 +/* End changes */ #define ID_ENTITY_START 40000 #define ID_ENTITY_END 45000 diff --git a/neo/sys/win32/win_local.h b/neo/sys/win32/win_local.h index 409543605..637336dd6 100644 --- a/neo/sys/win32/win_local.h +++ b/neo/sys/win32/win_local.h @@ -61,6 +61,12 @@ struct Win32Vars_t { OSVERSIONINFOEX osversion; +#ifdef ID_ALLOW_TOOLS + HDC hDC; // handle to device + HGLRC hGLRC; // handle to GL rendering context + PIXELFORMATDESCRIPTOR pfd; +#endif + static idCVar win_outputDebugString; static idCVar win_outputEditString; static idCVar win_viewlog; diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index b47c7baef..747b29ea5 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -51,6 +51,8 @@ If you have questions concerning this license or the applicable additional terms #include #endif +#include "tools/edit_public.h" + #include idCVar Win32Vars_t::win_outputDebugString( "win_outputDebugString", "0", CVAR_SYSTEM | CVAR_BOOL, "" ); @@ -59,6 +61,66 @@ idCVar Win32Vars_t::win_viewlog( "win_viewlog", "0", CVAR_SYSTEM | CVAR_INTEGER, Win32Vars_t win32; +#ifdef ID_ALLOW_TOOLS +/* These are required for tools (DG: taken from SteelStorm2) */ + +static HMODULE hOpenGL_DLL; + +typedef int (WINAPI * PWGLCHOOSEPIXELFORMAT) (HDC, CONST PIXELFORMATDESCRIPTOR *); +typedef int (WINAPI * PWGLDESCRIBEPIXELFORMAT) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +typedef int (WINAPI * PWGLGETPIXELFORMAT)(HDC); +typedef BOOL(WINAPI * PWGLSETPIXELFORMAT)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); +typedef BOOL(WINAPI * PWGLSWAPBUFFERS)(HDC); + +PWGLCHOOSEPIXELFORMAT qwglChoosePixelFormat; +PWGLDESCRIBEPIXELFORMAT qwglDescribePixelFormat; +PWGLGETPIXELFORMAT qwglGetPixelFormat; +PWGLSETPIXELFORMAT qwglSetPixelFormat; +PWGLSWAPBUFFERS qwglSwapBuffers; + +typedef BOOL(WINAPI * PWGLCOPYCONTEXT)(HGLRC, HGLRC, UINT); +typedef HGLRC(WINAPI * PWGLCREATECONTEXT)(HDC); +typedef HGLRC(WINAPI * PWGLCREATELAYERCONTEXT)(HDC, int); +typedef BOOL(WINAPI * PWGLDELETECONTEXT)(HGLRC); +typedef HGLRC(WINAPI * PWGLGETCURRENTCONTEXT)(VOID); +typedef HDC(WINAPI * PWGLGETCURRENTDC)(VOID); +typedef PROC(WINAPI * PWGLGETPROCADDRESS)(LPCSTR); +typedef BOOL(WINAPI * PWGLMAKECURRENT)(HDC, HGLRC); +typedef BOOL(WINAPI * PWGLSHARELISTS)(HGLRC, HGLRC); +typedef BOOL(WINAPI * PWGLUSEFONTBITMAPS)(HDC, DWORD, DWORD, DWORD); + + +PWGLCOPYCONTEXT qwglCopyContext; +PWGLCREATECONTEXT qwglCreateContext; +PWGLCREATELAYERCONTEXT qwglCreateLayerContext; +PWGLDELETECONTEXT qwglDeleteContext; +PWGLGETCURRENTCONTEXT qwglGetCurrentContext; +PWGLGETCURRENTDC qwglGetCurrentDC; +PWGLGETPROCADDRESS qwglGetProcAddress; +PWGLMAKECURRENT qwglMakeCurrent; +PWGLSHARELISTS qwglShareLists; +PWGLUSEFONTBITMAPS qwglUseFontBitmaps; + +typedef BOOL(WINAPI * PWGLUSEFONTOUTLINES)(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); +typedef BOOL(WINAPI * PWGLDESCRIBELAYERPLANE)(HDC, int, int, UINT, + LPLAYERPLANEDESCRIPTOR); +typedef int (WINAPI * PWGLSETLAYERPALETTEENTRIES)(HDC, int, int, int, + CONST COLORREF *); +typedef int (WINAPI * PWGLGETLAYERPALETTEENTRIES)(HDC, int, int, int, + COLORREF *); +typedef BOOL(WINAPI * PWGLREALIZELAYERPALETTE)(HDC, int, BOOL); +typedef BOOL(WINAPI * PWGLSWAPLAYERBUFFERS)(HDC, UINT); + +PWGLUSEFONTOUTLINES qwglUseFontOutlines; +PWGLDESCRIBELAYERPLANE qwglDescribeLayerPlane; +PWGLSETLAYERPALETTEENTRIES qwglSetLayerPaletteEntries; +PWGLGETLAYERPALETTEENTRIES qwglGetLayerPaletteEntries; +PWGLREALIZELAYERPALETTE qwglRealizeLayerPalette; +PWGLSWAPLAYERBUFFERS qwglSwapLayerBuffers; + +#endif /* End stuff required for tools */ + /* ============= Sys_Error @@ -109,6 +171,14 @@ Sys_Quit ============== */ void Sys_Quit( void ) { +#ifdef ID_ALLOW_TOOLS + // Free OpenGL DLL. + if (hOpenGL_DLL) + { + FreeLibrary(hOpenGL_DLL); + } +#endif + timeEndPeriod( 1 ); Sys_ShutdownInput(); Sys_DestroyConsole(); @@ -617,6 +687,30 @@ Sys_Shutdown ================ */ void Sys_Shutdown( void ) { +#ifdef ID_ALLOW_TOOLS + qwglCopyContext = NULL; + qwglCreateContext = NULL; + qwglCreateLayerContext = NULL; + qwglDeleteContext = NULL; + qwglDescribeLayerPlane = NULL; + qwglGetCurrentContext = NULL; + qwglGetCurrentDC = NULL; + qwglGetLayerPaletteEntries = NULL; + qwglGetProcAddress = NULL; + qwglMakeCurrent = NULL; + qwglRealizeLayerPalette = NULL; + qwglSetLayerPaletteEntries = NULL; + qwglShareLists = NULL; + qwglSwapLayerBuffers = NULL; + qwglUseFontBitmaps = NULL; + qwglUseFontOutlines = NULL; + qwglChoosePixelFormat = NULL; + qwglDescribePixelFormat = NULL; + qwglGetPixelFormat = NULL; + qwglSetPixelFormat = NULL; + qwglSwapBuffers = NULL; +#endif // ID_ALLOW_TOOLS + CoUninitialize(); } @@ -683,6 +777,54 @@ static void setHighDPIMode(void) } } +#ifdef ID_ALLOW_TOOLS +static void loadWGLpointers() { + if (hOpenGL_DLL == NULL) + { + // Load OpenGL DLL. + hOpenGL_DLL = LoadLibrary("opengl32.dll"); + if (hOpenGL_DLL == NULL) { + Sys_Error(GAME_NAME " Cannot Load opengl32.dll - Disabling TOOLS"); + return; + } + } + // opengl32.dll found... grab the addresses. + + qwglGetProcAddress = (PWGLGETPROCADDRESS)GetProcAddress(hOpenGL_DLL, "wglGetProcAddress"); + + // Context controls + qwglCopyContext = (PWGLCOPYCONTEXT)GetProcAddress(hOpenGL_DLL, "wglCopyContext"); + qwglCreateContext = (PWGLCREATECONTEXT)GetProcAddress(hOpenGL_DLL, "wglCreateContext"); + qwglCreateLayerContext = (PWGLCREATELAYERCONTEXT)GetProcAddress(hOpenGL_DLL, "wglCreateLayerContext"); + qwglDeleteContext = (PWGLDELETECONTEXT)GetProcAddress(hOpenGL_DLL, "wglDeleteContext"); + qwglGetCurrentContext = (PWGLGETCURRENTCONTEXT)GetProcAddress(hOpenGL_DLL, "wglGetCurrentContext"); + qwglGetCurrentDC = (PWGLGETCURRENTDC)GetProcAddress(hOpenGL_DLL, "wglGetCurrentDC"); + qwglMakeCurrent = (PWGLMAKECURRENT)GetProcAddress(hOpenGL_DLL, "wglMakeCurrent"); + qwglShareLists = (PWGLSHARELISTS)GetProcAddress(hOpenGL_DLL, "wglShareLists"); + + // Fonts + qwglUseFontBitmaps = (PWGLUSEFONTBITMAPS)GetProcAddress(hOpenGL_DLL, "wglUseFontBitmapsA"); + qwglUseFontOutlines = (PWGLUSEFONTOUTLINES)GetProcAddress(hOpenGL_DLL, "wglUseFontOutlinesA"); + + // Layers. + qwglDescribeLayerPlane = (PWGLDESCRIBELAYERPLANE)GetProcAddress(hOpenGL_DLL, "wglDescribeLayerPlane"); + qwglSwapLayerBuffers = (PWGLSWAPLAYERBUFFERS)GetProcAddress(hOpenGL_DLL, "wglSwapLayerBuffers"); + + // Palette controls + qwglGetLayerPaletteEntries = (PWGLGETLAYERPALETTEENTRIES)GetProcAddress(hOpenGL_DLL, "wglGetLayerPaletteEntries"); + qwglRealizeLayerPalette = (PWGLREALIZELAYERPALETTE)GetProcAddress(hOpenGL_DLL, "wglRealizeLayerPalette"); + qwglSetLayerPaletteEntries = (PWGLSETLAYERPALETTEENTRIES)GetProcAddress(hOpenGL_DLL, "wglSetLayerPaletteEntries"); + + + // These by default exist in windows + qwglChoosePixelFormat = ChoosePixelFormat; + qwglDescribePixelFormat = DescribePixelFormat; + qwglGetPixelFormat = GetPixelFormat; + qwglSetPixelFormat = SetPixelFormat; + qwglSwapBuffers = SwapBuffers; +} +#endif + /* ================== WinMain @@ -713,6 +855,10 @@ int main(int argc, char *argv[]) { _CrtSetDbgFlag( 0 ); #endif +#ifdef ID_ALLOW_TOOLS + loadWGLpointers(); +#endif + if ( argc > 1 ) { common->Init( argc-1, &argv[1] ); } else { diff --git a/neo/tools/af/DialogAF.cpp b/neo/tools/af/DialogAF.cpp index 1a43a6104..d9a579369 100644 --- a/neo/tools/af/DialogAF.cpp +++ b/neo/tools/af/DialogAF.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAF.h b/neo/tools/af/DialogAF.h index cafcc799c..3c9fa85d0 100644 --- a/neo/tools/af/DialogAF.h +++ b/neo/tools/af/DialogAF.h @@ -27,6 +27,8 @@ If you have questions concerning this license or the applicable additional terms */ #pragma once +#include "tools/edit_gui_common.h" + class idDeclAF; class DialogAFView; diff --git a/neo/tools/af/DialogAFBody.cpp b/neo/tools/af/DialogAFBody.cpp index ee3848e08..a15156a0c 100644 --- a/neo/tools/af/DialogAFBody.cpp +++ b/neo/tools/af/DialogAFBody.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraint.cpp b/neo/tools/af/DialogAFConstraint.cpp index f471d43ec..67c41225b 100644 --- a/neo/tools/af/DialogAFConstraint.cpp +++ b/neo/tools/af/DialogAFConstraint.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp index 88680cbfc..1568499a4 100644 --- a/neo/tools/af/DialogAFConstraintBallAndSocket.cpp +++ b/neo/tools/af/DialogAFConstraintBallAndSocket.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintFixed.cpp b/neo/tools/af/DialogAFConstraintFixed.cpp index 9ca96e838..849716c79 100644 --- a/neo/tools/af/DialogAFConstraintFixed.cpp +++ b/neo/tools/af/DialogAFConstraintFixed.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintHinge.cpp b/neo/tools/af/DialogAFConstraintHinge.cpp index 5bf51b016..dd0031a7f 100644 --- a/neo/tools/af/DialogAFConstraintHinge.cpp +++ b/neo/tools/af/DialogAFConstraintHinge.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintSlider.cpp b/neo/tools/af/DialogAFConstraintSlider.cpp index d726c9676..77e318646 100644 --- a/neo/tools/af/DialogAFConstraintSlider.cpp +++ b/neo/tools/af/DialogAFConstraintSlider.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintSpring.cpp b/neo/tools/af/DialogAFConstraintSpring.cpp index 436eb7906..b3428fd55 100644 --- a/neo/tools/af/DialogAFConstraintSpring.cpp +++ b/neo/tools/af/DialogAFConstraintSpring.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFConstraintUniversal.cpp b/neo/tools/af/DialogAFConstraintUniversal.cpp index 933a3799d..613b71147 100644 --- a/neo/tools/af/DialogAFConstraintUniversal.cpp +++ b/neo/tools/af/DialogAFConstraintUniversal.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFName.cpp b/neo/tools/af/DialogAFName.cpp index 0a409a0f0..78bca238e 100644 --- a/neo/tools/af/DialogAFName.cpp +++ b/neo/tools/af/DialogAFName.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFProperties.cpp b/neo/tools/af/DialogAFProperties.cpp index 0b22c329b..be6232c73 100644 --- a/neo/tools/af/DialogAFProperties.cpp +++ b/neo/tools/af/DialogAFProperties.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/af/DialogAFView.cpp b/neo/tools/af/DialogAFView.cpp index 97939f528..652a6f275 100644 --- a/neo/tools/af/DialogAFView.cpp +++ b/neo/tools/af/DialogAFView.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/AFEditor_resource.h" diff --git a/neo/tools/comafx/CDIB.cpp b/neo/tools/comafx/CDIB.cpp index d1c290cd5..0bfd3b006 100644 --- a/neo/tools/comafx/CDIB.cpp +++ b/neo/tools/comafx/CDIB.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #ifdef ID_DEBUG_MEMORY #undef new diff --git a/neo/tools/comafx/CPathTreeCtrl.cpp b/neo/tools/comafx/CPathTreeCtrl.cpp index bb862f575..cb580a385 100644 --- a/neo/tools/comafx/CPathTreeCtrl.cpp +++ b/neo/tools/comafx/CPathTreeCtrl.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "CPathTreeCtrl.h" diff --git a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp index 2cfcc1531..0315d695d 100644 --- a/neo/tools/comafx/CSyntaxRichEditCtrl.cpp +++ b/neo/tools/comafx/CSyntaxRichEditCtrl.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "CSyntaxRichEditCtrl.h" diff --git a/neo/tools/comafx/DialogColorPicker.cpp b/neo/tools/comafx/DialogColorPicker.cpp index cbf693e57..c92570b20 100644 --- a/neo/tools/comafx/DialogColorPicker.cpp +++ b/neo/tools/comafx/DialogColorPicker.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/Radiant_resource.h" #include "DialogColorPicker.h" diff --git a/neo/tools/comafx/DialogGoToLine.cpp b/neo/tools/comafx/DialogGoToLine.cpp index 0a999e53d..5a3fcce28 100644 --- a/neo/tools/comafx/DialogGoToLine.cpp +++ b/neo/tools/comafx/DialogGoToLine.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/Common_resource.h" diff --git a/neo/tools/comafx/DialogName.cpp b/neo/tools/comafx/DialogName.cpp index bec4f3770..48102270e 100644 --- a/neo/tools/comafx/DialogName.cpp +++ b/neo/tools/comafx/DialogName.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/common_resource.h" #include "DialogName.h" diff --git a/neo/tools/comafx/StdAfx.cpp b/neo/tools/comafx/StdAfx.cpp index 5767fa212..5a9773cfa 100644 --- a/neo/tools/comafx/StdAfx.cpp +++ b/neo/tools/comafx/StdAfx.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" diff --git a/neo/tools/comafx/VectorCtl.cpp b/neo/tools/comafx/VectorCtl.cpp index a582fb5ee..613677c19 100644 --- a/neo/tools/comafx/VectorCtl.cpp +++ b/neo/tools/comafx/VectorCtl.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "VectorCtl.h" diff --git a/neo/tools/common/AlphaPopup.cpp b/neo/tools/common/AlphaPopup.cpp index 3f11685b1..68eb557f7 100644 --- a/neo/tools/common/AlphaPopup.cpp +++ b/neo/tools/common/AlphaPopup.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" #include "ColorButton.h" diff --git a/neo/tools/common/ColorButton.cpp b/neo/tools/common/ColorButton.cpp index 20d2f6cfb..044e31fd6 100644 --- a/neo/tools/common/ColorButton.cpp +++ b/neo/tools/common/ColorButton.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "ColorButton.h" diff --git a/neo/tools/common/MaskEdit.cpp b/neo/tools/common/MaskEdit.cpp index fb5641c45..c49703560 100644 --- a/neo/tools/common/MaskEdit.cpp +++ b/neo/tools/common/MaskEdit.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #define MASKEDIT_MAXINVALID 1024 typedef struct diff --git a/neo/tools/common/OpenFileDialog.cpp b/neo/tools/common/OpenFileDialog.cpp index 2d1c62868..4927dc058 100644 --- a/neo/tools/common/OpenFileDialog.cpp +++ b/neo/tools/common/OpenFileDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" #include "../../sys/win32/rc/common_resource.h" diff --git a/neo/tools/common/PropTree/PropTree.cpp b/neo/tools/common/PropTree/PropTree.cpp index e9a42cccd..6df285732 100644 --- a/neo/tools/common/PropTree/PropTree.cpp +++ b/neo/tools/common/PropTree/PropTree.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" diff --git a/neo/tools/common/PropTree/PropTreeInfo.cpp b/neo/tools/common/PropTree/PropTreeInfo.cpp index d5223c2c1..7feded048 100644 --- a/neo/tools/common/PropTree/PropTreeInfo.cpp +++ b/neo/tools/common/PropTree/PropTreeInfo.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" #include "../../../sys/win32/rc/proptree_Resource.h" diff --git a/neo/tools/common/PropTree/PropTreeItem.cpp b/neo/tools/common/PropTree/PropTreeItem.cpp index 90761e92c..f99fd6d26 100644 --- a/neo/tools/common/PropTree/PropTreeItem.cpp +++ b/neo/tools/common/PropTree/PropTreeItem.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" diff --git a/neo/tools/common/PropTree/PropTreeItemButton.cpp b/neo/tools/common/PropTree/PropTreeItemButton.cpp index ea7e10217..68562943d 100644 --- a/neo/tools/common/PropTree/PropTreeItemButton.cpp +++ b/neo/tools/common/PropTree/PropTreeItemButton.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "proptree.h" #include "PropTreeItemButton.h" diff --git a/neo/tools/common/PropTree/PropTreeItemCheck.cpp b/neo/tools/common/PropTree/PropTreeItemCheck.cpp index 256c2c39e..94776543f 100644 --- a/neo/tools/common/PropTree/PropTreeItemCheck.cpp +++ b/neo/tools/common/PropTree/PropTreeItemCheck.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "proptree.h" #include "PropTreeItemCheck.h" diff --git a/neo/tools/common/PropTree/PropTreeItemColor.cpp b/neo/tools/common/PropTree/PropTreeItemColor.cpp index 26b167ed8..527e62016 100644 --- a/neo/tools/common/PropTree/PropTreeItemColor.cpp +++ b/neo/tools/common/PropTree/PropTreeItemColor.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" #include "../../../sys/win32/rc/proptree_Resource.h" diff --git a/neo/tools/common/PropTree/PropTreeItemCombo.cpp b/neo/tools/common/PropTree/PropTreeItemCombo.cpp index 0816a7dc6..7313862ff 100644 --- a/neo/tools/common/PropTree/PropTreeItemCombo.cpp +++ b/neo/tools/common/PropTree/PropTreeItemCombo.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" #include "../../../sys/win32/rc/proptree_Resource.h" diff --git a/neo/tools/common/PropTree/PropTreeItemEdit.cpp b/neo/tools/common/PropTree/PropTreeItemEdit.cpp index bc04e464b..1049cc863 100644 --- a/neo/tools/common/PropTree/PropTreeItemEdit.cpp +++ b/neo/tools/common/PropTree/PropTreeItemEdit.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "proptree.h" #include "PropTreeItemEdit.h" diff --git a/neo/tools/common/PropTree/PropTreeItemEditButton.cpp b/neo/tools/common/PropTree/PropTreeItemEditButton.cpp index bd07d41cc..3f95462b3 100644 --- a/neo/tools/common/PropTree/PropTreeItemEditButton.cpp +++ b/neo/tools/common/PropTree/PropTreeItemEditButton.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "proptree.h" #include "PropTreeItemEditButton.h" diff --git a/neo/tools/common/PropTree/PropTreeItemFileEdit.cpp b/neo/tools/common/PropTree/PropTreeItemFileEdit.cpp index dda056dba..391c1c617 100644 --- a/neo/tools/common/PropTree/PropTreeItemFileEdit.cpp +++ b/neo/tools/common/PropTree/PropTreeItemFileEdit.cpp @@ -2,8 +2,8 @@ //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "proptree.h" #include "PropTreeItemFileEdit.h" diff --git a/neo/tools/common/PropTree/PropTreeItemStatic.cpp b/neo/tools/common/PropTree/PropTreeItemStatic.cpp index b13d7c4a4..b71b3fba4 100644 --- a/neo/tools/common/PropTree/PropTreeItemStatic.cpp +++ b/neo/tools/common/PropTree/PropTreeItemStatic.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" diff --git a/neo/tools/common/PropTree/PropTreeList.cpp b/neo/tools/common/PropTree/PropTreeList.cpp index 042231d07..10c5a2b19 100644 --- a/neo/tools/common/PropTree/PropTreeList.cpp +++ b/neo/tools/common/PropTree/PropTreeList.cpp @@ -17,8 +17,8 @@ // useful. //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTree.h" #include "../../../sys/win32/rc/proptree_Resource.h" diff --git a/neo/tools/common/PropTree/PropTreeView.cpp b/neo/tools/common/PropTree/PropTreeView.cpp index 882522059..4a79acf08 100644 --- a/neo/tools/common/PropTree/PropTreeView.cpp +++ b/neo/tools/common/PropTree/PropTreeView.cpp @@ -2,8 +2,8 @@ // //#include "stdafx.h" -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "PropTreeView.h" diff --git a/neo/tools/common/PropertyGrid.cpp b/neo/tools/common/PropertyGrid.cpp index efb3bba4f..efe870747 100644 --- a/neo/tools/common/PropertyGrid.cpp +++ b/neo/tools/common/PropertyGrid.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" #include "PropertyGrid.h" diff --git a/neo/tools/common/RegistryOptions.cpp b/neo/tools/common/RegistryOptions.cpp index fcf0902f9..4ca80691b 100644 --- a/neo/tools/common/RegistryOptions.cpp +++ b/neo/tools/common/RegistryOptions.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "RegistryOptions.h" diff --git a/neo/tools/common/RenderBumpFlatDialog.cpp b/neo/tools/common/RenderBumpFlatDialog.cpp index d105271d1..4fd5ae74d 100644 --- a/neo/tools/common/RenderBumpFlatDialog.cpp +++ b/neo/tools/common/RenderBumpFlatDialog.cpp @@ -26,10 +26,11 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" -#include "../../sys/win32/common_resource.h" + +#include "sys/win32/rc/Common_resource.h" +// FIXME: SteelStorm2 has this whole file commented out idCVar rbfg_DefaultWidth( "rbfg_DefaultWidth", "0", 0, "" ); idCVar rbfg_DefaultHeight( "rbfg_DefaultHeight", "0", 0, "" ); @@ -51,7 +52,9 @@ static bool CheckPow2(int Num) return true; } -extern void Com_WriteConfigToFile( const char *filename ); +static void Com_WriteConfigToFile(const char *filename) { + common->Warning("Some renderbump code called Com_WriteConfigTiFile(\"%s\") which is not implemented!\n", filename); +} static BOOL CALLBACK RBFProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { diff --git a/neo/tools/common/RollupPanel.cpp b/neo/tools/common/RollupPanel.cpp index 85cbe3d8e..09407fd5b 100644 --- a/neo/tools/common/RollupPanel.cpp +++ b/neo/tools/common/RollupPanel.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" #include "RollupPanel.h" diff --git a/neo/tools/common/SpinButton.cpp b/neo/tools/common/SpinButton.cpp index f2b78fb47..8520bf419 100644 --- a/neo/tools/common/SpinButton.cpp +++ b/neo/tools/common/SpinButton.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "SpinButton.h" diff --git a/neo/tools/compilers/aas/AASFile.h b/neo/tools/compilers/aas/AASFile.h index 9ae001c31..d5286ab13 100644 --- a/neo/tools/compilers/aas/AASFile.h +++ b/neo/tools/compilers/aas/AASFile.h @@ -88,7 +88,7 @@ If you have questions concerning this license or the applicable additional terms // bits for different bboxes #define AREACONTENTS_BBOX_BIT 24 -#define MAX_REACH_PER_AREA 256 +#define MAX_REACH_PER_AREA 256 // FIXME: SteelStorm2 has this increased to 512 #define MAX_AAS_TREE_DEPTH 128 #define MAX_AAS_BOUNDING_BOXES 4 diff --git a/neo/tools/compilers/renderbump/renderbump.cpp b/neo/tools/compilers/renderbump/renderbump.cpp index 8997835ed..d18f902ab 100644 --- a/neo/tools/compilers/renderbump/renderbump.cpp +++ b/neo/tools/compilers/renderbump/renderbump.cpp @@ -123,7 +123,7 @@ ResizeWindow =============== */ static void ResizeWindow( int width, int height ) { -#if 0 // FIXME +#if defined(WIN32) && defined(ID_ALLOW_TOOLS) int winWidth, winHeight; if ( glConfig.isFullscreen ) { winWidth = width; @@ -144,7 +144,7 @@ static void ResizeWindow( int width, int height ) { } SetWindowPos( win32.hWnd, HWND_TOP, 0, 0, winWidth, winHeight, SWP_SHOWWINDOW ); - qwglMakeCurrent( win32.hDC, win32.hGLRC ); + // FIXME: ??? qwglMakeCurrent( win32.hDC, win32.hGLRC ); #endif } @@ -154,7 +154,7 @@ RestoreWindow =============== */ static void RestoreWindow( void ) { -#if 0 // FIXME +#if defined(WIN32) && defined(ID_ALLOW_TOOLS) int winWidth, winHeight; if ( glConfig.isFullscreen ) { winWidth = oldWidth; diff --git a/neo/tools/debugger/DebuggerApp.cpp b/neo/tools/debugger/DebuggerApp.cpp index cace97474..82aacaa16 100644 --- a/neo/tools/debugger/DebuggerApp.cpp +++ b/neo/tools/debugger/DebuggerApp.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/debugger_resource.h" #include "DebuggerApp.h" diff --git a/neo/tools/debugger/DebuggerBreakpoint.cpp b/neo/tools/debugger/DebuggerBreakpoint.cpp index 312ff85e3..975f2eb20 100644 --- a/neo/tools/debugger/DebuggerBreakpoint.cpp +++ b/neo/tools/debugger/DebuggerBreakpoint.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "DebuggerApp.h" #include "DebuggerBreakpoint.h" diff --git a/neo/tools/debugger/DebuggerClient.cpp b/neo/tools/debugger/DebuggerClient.cpp index 4ce9766b9..6ce672550 100644 --- a/neo/tools/debugger/DebuggerClient.cpp +++ b/neo/tools/debugger/DebuggerClient.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "DebuggerApp.h" diff --git a/neo/tools/debugger/DebuggerFindDlg.cpp b/neo/tools/debugger/DebuggerFindDlg.cpp index 074bc3a02..59ce96c63 100644 --- a/neo/tools/debugger/DebuggerFindDlg.cpp +++ b/neo/tools/debugger/DebuggerFindDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/debugger_resource.h" #include "DebuggerApp.h" diff --git a/neo/tools/debugger/DebuggerQuickWatchDlg.cpp b/neo/tools/debugger/DebuggerQuickWatchDlg.cpp index c7cbf8274..7cf18fe39 100644 --- a/neo/tools/debugger/DebuggerQuickWatchDlg.cpp +++ b/neo/tools/debugger/DebuggerQuickWatchDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/debugger_resource.h" #include "DebuggerApp.h" diff --git a/neo/tools/debugger/DebuggerScript.cpp b/neo/tools/debugger/DebuggerScript.cpp index 3b5a1834c..fc15dfacf 100644 --- a/neo/tools/debugger/DebuggerScript.cpp +++ b/neo/tools/debugger/DebuggerScript.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "DebuggerApp.h" #include "DebuggerScript.h" diff --git a/neo/tools/debugger/DebuggerServer.cpp b/neo/tools/debugger/DebuggerServer.cpp index f328b9914..9606b19a3 100644 --- a/neo/tools/debugger/DebuggerServer.cpp +++ b/neo/tools/debugger/DebuggerServer.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../game/gamesys/Event.h" #include "../../game/gamesys/Class.h" diff --git a/neo/tools/debugger/DebuggerWindow.cpp b/neo/tools/debugger/DebuggerWindow.cpp index 8d8266d32..fbf33e792 100644 --- a/neo/tools/debugger/DebuggerWindow.cpp +++ b/neo/tools/debugger/DebuggerWindow.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/debugger_resource.h" #include "DebuggerApp.h" diff --git a/neo/tools/debugger/debugger.cpp b/neo/tools/debugger/debugger.cpp index 67e654b65..4e5d5f6e0 100644 --- a/neo/tools/debugger/debugger.cpp +++ b/neo/tools/debugger/debugger.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/debugger_resource.h" #include "DebuggerApp.h" diff --git a/neo/tools/decl/DialogDeclBrowser.cpp b/neo/tools/decl/DialogDeclBrowser.cpp index d06e5e817..7186ca356 100644 --- a/neo/tools/decl/DialogDeclBrowser.cpp +++ b/neo/tools/decl/DialogDeclBrowser.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/DeclEditor_resource.h" #include "../../sys/win32/rc/ScriptEditor_resource.h" diff --git a/neo/tools/decl/DialogDeclEditor.cpp b/neo/tools/decl/DialogDeclEditor.cpp index 43e67ce26..b20a72d58 100644 --- a/neo/tools/decl/DialogDeclEditor.cpp +++ b/neo/tools/decl/DialogDeclEditor.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/Common_resource.h" #include "../../sys/win32/rc/DeclEditor_resource.h" diff --git a/neo/tools/decl/DialogDeclNew.cpp b/neo/tools/decl/DialogDeclNew.cpp index ccd654a53..bfc520583 100644 --- a/neo/tools/decl/DialogDeclNew.cpp +++ b/neo/tools/decl/DialogDeclNew.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/DeclEditor_resource.h" @@ -200,6 +200,7 @@ void DialogDeclNew::OnBnClickedFile() { } switch( type ) { + // FIXME: SteelStorm2 has a _v1 suffix for materials, def and fx - why? case DECL_TABLE: folder = "materials"; ext = "(*.mtr)|*.mtr|(*.*)|*.*||"; break; case DECL_MATERIAL: folder = "materials"; ext = "(*.mtr)|*.mtr|(*.*)|*.*||"; break; case DECL_SKIN: folder = "skins"; ext = "(*.skin)|*.skin|(*.*)|*.*||"; break; diff --git a/neo/tools/decl/DialogEntityDefEditor.cpp b/neo/tools/decl/DialogEntityDefEditor.cpp index 2eb4d5a3d..8aeac31d4 100644 --- a/neo/tools/decl/DialogEntityDefEditor.cpp +++ b/neo/tools/decl/DialogEntityDefEditor.cpp @@ -26,8 +26,10 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#if 0 // TODO: FIX this. - DG: from SteelStorm2 + +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/Common_resource.h" #include "../../sys/win32/rc/DeclEditor_resource.h" @@ -858,3 +860,5 @@ void DialogEntityDefEditor::OnBnClickedDelete() { MessageBox("Cannot delete an inherited value"); } } +#endif + diff --git a/neo/tools/edit_gui_common.h b/neo/tools/edit_gui_common.h new file mode 100644 index 000000000..48b43c1bd --- /dev/null +++ b/neo/tools/edit_gui_common.h @@ -0,0 +1,182 @@ +// header that includes all the other needed headers, replacement for precompiled.h (only used by tools) + +#ifndef TOOLS_EDIT_GUI_COMMON_H +#define TOOLS_EDIT_GUI_COMMON_H + +#if !defined(_WIN32) || !defined(_MSC_VER) || !defined(ID_ALLOW_TOOLS) +#error "This header should only be included in the Win-only Visual-Studio-only MFC tools code" +#endif + +// (hopefully) suppress "warning C4996: 'MBCS_Support_Deprecated_In_MFC': +// MBCS support in MFC is deprecated and may be removed in a future version of MFC." +#define NO_WARN_MBCS_MFC_DEPRECATION + +#include + +#if defined(_MFC_VER) && !defined(_D3SDK) && !defined(GAME_DLL) +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // prevent auto literal to string conversion +#include "tools/comafx/StdAfx.h" +#endif + +#include "edit_public.h" + +#include "framework/Game.h" + +// non-portable system services +#include "sys/platform.h" +#include "sys/sys_public.h" + +// id lib +#include "idlib/Lib.h" + +// memory management and arrays +#include "idlib/Heap.h" +#include "idlib/containers/List.h" + +// math +#include "idlib/math/Simd.h" +#include "idlib/math/Math.h" +#include "idlib/math/Random.h" +#include "idlib/math/Complex.h" +#include "idlib/math/Vector.h" +#include "idlib/math/Matrix.h" +#include "idlib/math/Angles.h" +#include "idlib/math/Quat.h" +#include "idlib/math/Rotation.h" +#include "idlib/math/Plane.h" +#include "idlib/math/Pluecker.h" +#include "idlib/math/Polynomial.h" +#include "idlib/math/Extrapolate.h" +#include "idlib/math/Interpolate.h" +#include "idlib/math/Curve.h" +#include "idlib/math/Ode.h" +#include "idlib/math/Lcp.h" + +// bounding volumes +#include "idlib/bv/Sphere.h" +#include "idlib/bv/Bounds.h" +#include "idlib/bv/Box.h" +#include "idlib/bv/Frustum.h" + +// geometry +#include "idlib/geometry/DrawVert.h" +#include "idlib/geometry/JointTransform.h" +#include "idlib/geometry/Winding.h" +#include "idlib/geometry/Winding2D.h" +#include "idlib/geometry/Surface.h" +#include "idlib/geometry/Surface_Patch.h" +#include "idlib/geometry/Surface_Polytope.h" +#include "idlib/geometry/Surface_SweptSpline.h" +#include "idlib/geometry/TraceModel.h" + +// text manipulation +#include "idlib/Str.h" +#include "idlib/Token.h" +#include "idlib/Lexer.h" +#include "idlib/Parser.h" +#include "idlib/Base64.h" +#include "idlib/CmdArgs.h" + +// containers +#include "idlib/containers/BTree.h" +#include "idlib/containers/BinSearch.h" +#include "idlib/containers/HashIndex.h" +#include "idlib/containers/HashTable.h" +#include "idlib/containers/StaticList.h" +#include "idlib/containers/LinkList.h" +#include "idlib/containers/Hierarchy.h" +#include "idlib/containers/Queue.h" +#include "idlib/containers/Stack.h" +#include "idlib/containers/StrList.h" +#include "idlib/containers/StrPool.h" +#include "idlib/containers/VectorSet.h" +#include "idlib/containers/PlaneSet.h" + +// hashing +#include "idlib/hashing/CRC32.h" +#include "idlib/hashing/MD4.h" +#include "idlib/hashing/MD5.h" + +// misc +#include "idlib/Dict.h" +#include "idlib/LangDict.h" +#include "idlib/BitMsg.h" +#include "idlib/MapFile.h" +#include "idlib/Timer.h" + +// framework +#include "framework/BuildVersion.h" +#include "framework/Licensee.h" +#include "framework/CmdSystem.h" +#include "framework/CVarSystem.h" +#include "framework/Common.h" +#include "framework/File.h" +#include "framework/FileSystem.h" +#include "framework/UsercmdGen.h" + +// decls +#include "framework/DeclManager.h" +#include "framework/DeclTable.h" +#include "framework/DeclSkin.h" +#include "framework/DeclEntityDef.h" +#include "framework/DeclFX.h" +#include "framework/DeclParticle.h" +#include "framework/DeclAF.h" +#include "framework/DeclPDA.h" + +// We have expression parsing and evaluation code in multiple places: +// materials, sound shaders, and guis. We should unify them. + +// renderer +#include "renderer/qgl.h" +#include "renderer/Cinematic.h" +#include "renderer/Material.h" +#include "renderer/Model.h" +#include "renderer/ModelManager.h" +#include "renderer/RenderSystem.h" +#include "renderer/RenderWorld.h" + +// sound engine +#include "sound/sound.h" + +// asynchronous networking +#include "framework/async/NetworkSystem.h" + +// user interfaces +#include "ui/ListGUI.h" +#include "ui/UserInterface.h" + +// collision detection system +#include "cm/CollisionModel.h" + +// AAS files and manager +#include "tools/compilers/aas/AASFile.h" +#include "tools/compilers/aas/AASFileManager.h" + +// game interface +#include "framework/Game.h" + +//----------------------------------------------------- + +#include "framework/DemoChecksum.h" + +// framework +#include "framework/Compressor.h" +#include "framework/EventLoop.h" +#include "framework/KeyInput.h" +#include "framework/EditField.h" +#include "framework/Console.h" +#include "framework/DemoFile.h" +#include "framework/Session.h" + +// asynchronous networking +#include "framework/async/AsyncNetwork.h" + +// The editor entry points are always declared, but may just be +// stubbed out on non-windows platforms. +#include "tools/edit_public.h" + +// Compilers for map, model, video etc. processing. +#include "tools/compilers/compiler_public.h" + +#endif // TOOLS_EDIT_GUI_COMMON_H diff --git a/neo/tools/edit_public.h b/neo/tools/edit_public.h index 4beb585bd..be36df30a 100644 --- a/neo/tools/edit_public.h +++ b/neo/tools/edit_public.h @@ -29,6 +29,9 @@ If you have questions concerning this license or the applicable additional terms #ifndef __EDIT_PUBLIC_H__ #define __EDIT_PUBLIC_H__ +#include "idlib/math/Vector.h" +#include "idlib/Dict.h" + /* =============================================================================== diff --git a/neo/tools/edit_stub.cpp b/neo/tools/edit_stub.cpp index b5a9d3f5a..79c2c887d 100644 --- a/neo/tools/edit_stub.cpp +++ b/neo/tools/edit_stub.cpp @@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms #include "sys/platform.h" #include "framework/Common.h" - +#include "edit_public.h" void RadiantInit( void ) { common->Printf( "The level editor Radiant only runs on Win32\n" ); } void RadiantShutdown( void ) {} void RadiantRun( void ) {} diff --git a/neo/tools/guied/GEApp.cpp b/neo/tools/guied/GEApp.cpp index 70c943635..440d307b1 100644 --- a/neo/tools/guied/GEApp.cpp +++ b/neo/tools/guied/GEApp.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include diff --git a/neo/tools/guied/GECheckInDlg.cpp b/neo/tools/guied/GECheckInDlg.cpp index 6b53efe04..1fd627be5 100644 --- a/neo/tools/guied/GECheckInDlg.cpp +++ b/neo/tools/guied/GECheckInDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" diff --git a/neo/tools/guied/GEDeleteModifier.cpp b/neo/tools/guied/GEDeleteModifier.cpp index 95c9dc3e9..9c9676485 100644 --- a/neo/tools/guied/GEDeleteModifier.cpp +++ b/neo/tools/guied/GEDeleteModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEDeleteModifier.h" diff --git a/neo/tools/guied/GEHideModifier.cpp b/neo/tools/guied/GEHideModifier.cpp index a51ce92cf..23a353ec3 100644 --- a/neo/tools/guied/GEHideModifier.cpp +++ b/neo/tools/guied/GEHideModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEHideModifier.h" diff --git a/neo/tools/guied/GEInsertModifier.cpp b/neo/tools/guied/GEInsertModifier.cpp index 73d8851e7..1e35578f6 100644 --- a/neo/tools/guied/GEInsertModifier.cpp +++ b/neo/tools/guied/GEInsertModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEInsertModifier.h" diff --git a/neo/tools/guied/GEItemPropsDlg.cpp b/neo/tools/guied/GEItemPropsDlg.cpp index cde38c889..b717f6764 100644 --- a/neo/tools/guied/GEItemPropsDlg.cpp +++ b/neo/tools/guied/GEItemPropsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" #include "../common/ColorButton.h" diff --git a/neo/tools/guied/GEItemScriptsDlg.cpp b/neo/tools/guied/GEItemScriptsDlg.cpp index 062e039dc..e5832d579 100644 --- a/neo/tools/guied/GEItemScriptsDlg.cpp +++ b/neo/tools/guied/GEItemScriptsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" diff --git a/neo/tools/guied/GEKeyValueModifier.cpp b/neo/tools/guied/GEKeyValueModifier.cpp index c864e98ab..39ceaeacb 100644 --- a/neo/tools/guied/GEKeyValueModifier.cpp +++ b/neo/tools/guied/GEKeyValueModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEKeyValueModifier.h" diff --git a/neo/tools/guied/GEModifier.cpp b/neo/tools/guied/GEModifier.cpp index 41ac976eb..aa68759b4 100644 --- a/neo/tools/guied/GEModifier.cpp +++ b/neo/tools/guied/GEModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" diff --git a/neo/tools/guied/GEModifierGroup.cpp b/neo/tools/guied/GEModifierGroup.cpp index 52310d0b1..dfecc8aa0 100644 --- a/neo/tools/guied/GEModifierGroup.cpp +++ b/neo/tools/guied/GEModifierGroup.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEModifierGroup.h" diff --git a/neo/tools/guied/GEModifierStack.cpp b/neo/tools/guied/GEModifierStack.cpp index a13ac362e..bddaffccd 100644 --- a/neo/tools/guied/GEModifierStack.cpp +++ b/neo/tools/guied/GEModifierStack.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEModifierStack.h" diff --git a/neo/tools/guied/GEMoveModifier.cpp b/neo/tools/guied/GEMoveModifier.cpp index 08b93b341..4a1aa3ba8 100644 --- a/neo/tools/guied/GEMoveModifier.cpp +++ b/neo/tools/guied/GEMoveModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEMoveModifier.h" diff --git a/neo/tools/guied/GENavigator.cpp b/neo/tools/guied/GENavigator.cpp index 5baeeacb0..342c25e72 100644 --- a/neo/tools/guied/GENavigator.cpp +++ b/neo/tools/guied/GENavigator.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" diff --git a/neo/tools/guied/GEOptions.cpp b/neo/tools/guied/GEOptions.cpp index 64178f173..42068395b 100644 --- a/neo/tools/guied/GEOptions.cpp +++ b/neo/tools/guied/GEOptions.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../ui/Window.h" #include "../../ui/UserInterfaceLocal.h" diff --git a/neo/tools/guied/GEOptionsDlg.cpp b/neo/tools/guied/GEOptionsDlg.cpp index 22b6b5472..1afb6663b 100644 --- a/neo/tools/guied/GEOptionsDlg.cpp +++ b/neo/tools/guied/GEOptionsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" #include "../common/ColorButton.h" diff --git a/neo/tools/guied/GEProperties.cpp b/neo/tools/guied/GEProperties.cpp index ded3d1d0e..a15718674 100644 --- a/neo/tools/guied/GEProperties.cpp +++ b/neo/tools/guied/GEProperties.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" diff --git a/neo/tools/guied/GEPropertyPage.cpp b/neo/tools/guied/GEPropertyPage.cpp index 1405e1235..f937d8eaa 100644 --- a/neo/tools/guied/GEPropertyPage.cpp +++ b/neo/tools/guied/GEPropertyPage.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../common/ColorButton.h" #include "GEApp.h" diff --git a/neo/tools/guied/GESelectionMgr.cpp b/neo/tools/guied/GESelectionMgr.cpp index 3867bf751..12679ceaa 100644 --- a/neo/tools/guied/GESelectionMgr.cpp +++ b/neo/tools/guied/GESelectionMgr.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../renderer/tr_local.h" #include "../../sys/win32/win_local.h" diff --git a/neo/tools/guied/GESizeModifier.cpp b/neo/tools/guied/GESizeModifier.cpp index af421ff2e..ec63a1772 100644 --- a/neo/tools/guied/GESizeModifier.cpp +++ b/neo/tools/guied/GESizeModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GESizeModifier.h" diff --git a/neo/tools/guied/GEStateModifier.cpp b/neo/tools/guied/GEStateModifier.cpp index fcb3f45d4..6a65598fd 100644 --- a/neo/tools/guied/GEStateModifier.cpp +++ b/neo/tools/guied/GEStateModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEStateModifier.h" diff --git a/neo/tools/guied/GEStatusBar.cpp b/neo/tools/guied/GEStatusBar.cpp index 712710ef2..fefc41f39 100644 --- a/neo/tools/guied/GEStatusBar.cpp +++ b/neo/tools/guied/GEStatusBar.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" diff --git a/neo/tools/guied/GETransformer.cpp b/neo/tools/guied/GETransformer.cpp index 417e34056..cb93567d4 100644 --- a/neo/tools/guied/GETransformer.cpp +++ b/neo/tools/guied/GETransformer.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" diff --git a/neo/tools/guied/GEViewer.cpp b/neo/tools/guied/GEViewer.cpp index 276c3be6b..f7c16d74d 100644 --- a/neo/tools/guied/GEViewer.cpp +++ b/neo/tools/guied/GEViewer.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" #include "../../renderer/tr_local.h" @@ -125,7 +125,8 @@ bool rvGEViewer::OpenFile ( const char* filename ) tempfile.StripPath (); tempfile.StripFileExtension ( ); tempfile = va("guis/temp.guied", tempfile.c_str() ); - ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); + //ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); DG: change from SteelStorm2 + ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_savepath" ); // Make sure the gui directory exists idStr createDir = ospath; @@ -505,11 +506,11 @@ void rvGEViewer::Render ( HDC dc ) qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Render the workspace below - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity(); qglOrtho(0,mWindowWidth, mWindowHeight, 0, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + qglMatrixMode(GL_MODELVIEW); + qglLoadIdentity(); if ( mInterface ) { diff --git a/neo/tools/guied/GEWindowWrapper.cpp b/neo/tools/guied/GEWindowWrapper.cpp index 2b994412c..9f1133891 100644 --- a/neo/tools/guied/GEWindowWrapper.cpp +++ b/neo/tools/guied/GEWindowWrapper.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" #include "../../renderer/tr_local.h" diff --git a/neo/tools/guied/GEWindowWrapper_stub.cpp b/neo/tools/guied/GEWindowWrapper_stub.cpp index 3d928b1c1..92ed982d1 100644 --- a/neo/tools/guied/GEWindowWrapper_stub.cpp +++ b/neo/tools/guied/GEWindowWrapper_stub.cpp @@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms #include "ui/ChoiceWindow.h" #include "tools/guied/GEWindowWrapper.h" - +#if !defined(ID_ALLOW_TOOLS) static rvGEWindowWrapper stub_wrap( NULL, rvGEWindowWrapper::WT_UNKNOWN ); rvGEWindowWrapper::rvGEWindowWrapper( idWindow* window, EWindowType type ) { } @@ -44,3 +44,4 @@ rvGEWindowWrapper* rvGEWindowWrapper::GetWrapper ( idWindow* window ) { return & void rvGEWindowWrapper::SetStateKey( const char*, const char*, bool ) { } void rvGEWindowWrapper::Finish() { } +#endif diff --git a/neo/tools/guied/GEWorkspace.cpp b/neo/tools/guied/GEWorkspace.cpp index cf3574e79..8c98427b1 100644 --- a/neo/tools/guied/GEWorkspace.cpp +++ b/neo/tools/guied/GEWorkspace.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/guied_resource.h" #include "../../renderer/tr_local.h" @@ -289,11 +289,11 @@ void rvGEWorkspace::Render ( HDC hdc ) qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Render the workspace below - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity(); qglOrtho(0,mWindowWidth, mWindowHeight, 0, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + qglMatrixMode(GL_MODELVIEW); + qglLoadIdentity(); qglColor3f ( mApplication->GetOptions().GetWorkspaceColor()[0], mApplication->GetOptions().GetWorkspaceColor()[1], mApplication->GetOptions().GetWorkspaceColor()[2] ); qglBegin ( GL_QUADS ); @@ -337,11 +337,11 @@ void rvGEWorkspace::Render ( HDC hdc ) qglViewport(0, 0, mWindowWidth, mWindowHeight ); qglScissor(0, 0, mWindowWidth, mWindowHeight ); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity(); qglOrtho(0,mWindowWidth, mWindowHeight, 0, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + qglMatrixMode(GL_MODELVIEW); + qglLoadIdentity(); RenderGrid ( ); diff --git a/neo/tools/guied/GEWorkspaceFile.cpp b/neo/tools/guied/GEWorkspaceFile.cpp index 725f96cf6..de1e37ae7 100644 --- a/neo/tools/guied/GEWorkspaceFile.cpp +++ b/neo/tools/guied/GEWorkspaceFile.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" @@ -54,7 +54,8 @@ bool rvGEWorkspace::SaveFile ( const char* filename ) idStr ospath; tempfile = "guis/temp.guied"; - ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); + //ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); DG: change from SteelStorm2 + ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_savepath" ); // Open the output file for write if ( !(file = fileSystem->OpenFileWrite ( tempfile ) ) ) @@ -249,7 +250,8 @@ bool rvGEWorkspace::NewFile ( void ) // Make a temporary file with nothing in it so we can just use // load to do all the work - ospath = fileSystem->RelativePathToOSPath ( "guis/Untitled.guiednew", "fs_basepath" ); + //ospath = fileSystem->RelativePathToOSPath ( "guis/Untitled.guiednew", "fs_basepath" ); DG: change from SteelStorm2 + ospath = fileSystem->RelativePathToOSPath ( "guis/Untitled.guiednew", "fs_savepath" ); DeleteFile ( ospath ); file = fileSystem->OpenFileWrite ( "guis/Untitled.guiednew" ); @@ -300,7 +302,8 @@ bool rvGEWorkspace::LoadFile ( const char* filename, idStr* error ) bool result; tempfile = "guis/temp.guied"; - ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); + //ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); DG: change from SteelStorm2 + ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_savepath" ); // Make sure the gui directory exists idStr createDir = ospath; diff --git a/neo/tools/guied/GEZOrderModifier.cpp b/neo/tools/guied/GEZOrderModifier.cpp index 5ca9a07bd..485427abc 100644 --- a/neo/tools/guied/GEZOrderModifier.cpp +++ b/neo/tools/guied/GEZOrderModifier.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "GEApp.h" #include "GEZOrderModifier.h" diff --git a/neo/tools/guied/guied.cpp b/neo/tools/guied/guied.cpp index 50d4e929f..2953882f3 100644 --- a/neo/tools/guied/guied.cpp +++ b/neo/tools/guied/guied.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../renderer/tr_local.h" #include "../../sys/win32/win_local.h" @@ -84,6 +84,7 @@ GUIEditorRun Run a frame ================ */ +static int sysMsgTime = 0; // DG: only used by GUIEditorRun(); no reason to put this into Win32Vars_t void GUIEditorRun() { MSG msg; @@ -97,12 +98,12 @@ void GUIEditorRun() } // save the msg time, because wndprocs don't have access to the timestamp - if ( win32.sysMsgTime && win32.sysMsgTime > (int)msg.time ) + if ( sysMsgTime && sysMsgTime > (int)msg.time ) { } else { - win32.sysMsgTime = msg.time; + sysMsgTime = msg.time; } if ( gApp.TranslateAccelerator ( &msg ) ) diff --git a/neo/tools/materialeditor/ConsoleView.cpp b/neo/tools/materialeditor/ConsoleView.cpp index cb6333241..bd2a0e2d1 100644 --- a/neo/tools/materialeditor/ConsoleView.cpp +++ b/neo/tools/materialeditor/ConsoleView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "ConsoleView.h" diff --git a/neo/tools/materialeditor/FindDialog.cpp b/neo/tools/materialeditor/FindDialog.cpp index 331785850..315a7192c 100644 --- a/neo/tools/materialeditor/FindDialog.cpp +++ b/neo/tools/materialeditor/FindDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "FindDialog.h" diff --git a/neo/tools/materialeditor/MEMainFrame.cpp b/neo/tools/materialeditor/MEMainFrame.cpp index c628c2b4f..a8f4a6a4a 100644 --- a/neo/tools/materialeditor/MEMainFrame.cpp +++ b/neo/tools/materialeditor/MEMainFrame.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialEditor.h" #include "MEMainFrame.h" diff --git a/neo/tools/materialeditor/MEOptions.cpp b/neo/tools/materialeditor/MEOptions.cpp index e3b24fdd7..4c2f5fbf9 100644 --- a/neo/tools/materialeditor/MEOptions.cpp +++ b/neo/tools/materialeditor/MEOptions.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MEOptions.h" diff --git a/neo/tools/materialeditor/MaterialDef.cpp b/neo/tools/materialeditor/MaterialDef.cpp index 3fe26ac11..e6a36e75e 100644 --- a/neo/tools/materialeditor/MaterialDef.cpp +++ b/neo/tools/materialeditor/MaterialDef.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialDef.h" diff --git a/neo/tools/materialeditor/MaterialDoc.cpp b/neo/tools/materialeditor/MaterialDoc.cpp index 4005ddea3..479c902d2 100644 --- a/neo/tools/materialeditor/MaterialDoc.cpp +++ b/neo/tools/materialeditor/MaterialDoc.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialDoc.h" #include "MaterialView.h" diff --git a/neo/tools/materialeditor/MaterialDocManager.cpp b/neo/tools/materialeditor/MaterialDocManager.cpp index 5dfb0ffd2..325a9e528 100644 --- a/neo/tools/materialeditor/MaterialDocManager.cpp +++ b/neo/tools/materialeditor/MaterialDocManager.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialDocManager.h" #include "MaterialView.h" diff --git a/neo/tools/materialeditor/MaterialEditView.cpp b/neo/tools/materialeditor/MaterialEditView.cpp index 8d78d3d89..e830730bd 100644 --- a/neo/tools/materialeditor/MaterialEditView.cpp +++ b/neo/tools/materialeditor/MaterialEditView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialEditView.h" diff --git a/neo/tools/materialeditor/MaterialEditor.cpp b/neo/tools/materialeditor/MaterialEditor.cpp index 6f6e3c0da..3065aca8f 100644 --- a/neo/tools/materialeditor/MaterialEditor.cpp +++ b/neo/tools/materialeditor/MaterialEditor.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/win_local.h" diff --git a/neo/tools/materialeditor/MaterialModifier.cpp b/neo/tools/materialeditor/MaterialModifier.cpp index 35fb6c1ae..07d11aa15 100644 --- a/neo/tools/materialeditor/MaterialModifier.cpp +++ b/neo/tools/materialeditor/MaterialModifier.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialModifier.h" #include "MaterialDocManager.h" diff --git a/neo/tools/materialeditor/MaterialPreviewPropView.cpp b/neo/tools/materialeditor/MaterialPreviewPropView.cpp index 04b3e3f03..c000fd97b 100644 --- a/neo/tools/materialeditor/MaterialPreviewPropView.cpp +++ b/neo/tools/materialeditor/MaterialPreviewPropView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialPreviewPropView.h" diff --git a/neo/tools/materialeditor/MaterialPreviewView.cpp b/neo/tools/materialeditor/MaterialPreviewView.cpp index be4534697..8e1d54ec0 100644 --- a/neo/tools/materialeditor/MaterialPreviewView.cpp +++ b/neo/tools/materialeditor/MaterialPreviewView.cpp @@ -27,8 +27,8 @@ If you have questions concerning this license or the applicable additional terms */ -#include "../../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../radiant/QE3.H" #include "MaterialPreviewView.h" diff --git a/neo/tools/materialeditor/MaterialPropTreeView.cpp b/neo/tools/materialeditor/MaterialPropTreeView.cpp index a8be58888..0ae5fec0c 100644 --- a/neo/tools/materialeditor/MaterialPropTreeView.cpp +++ b/neo/tools/materialeditor/MaterialPropTreeView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialPropTreeView.h" diff --git a/neo/tools/materialeditor/MaterialTreeView.cpp b/neo/tools/materialeditor/MaterialTreeView.cpp index 921a4d5ca..2a204e89d 100644 --- a/neo/tools/materialeditor/MaterialTreeView.cpp +++ b/neo/tools/materialeditor/MaterialTreeView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "MaterialTreeView.h" @@ -968,9 +968,9 @@ void MaterialTreeView::OnMouseMove(UINT nFlags, CPoint point) { if(item && (TVHT_ONITEM & flags)) { if(item != hoverItem) { hoverItem = item; - hoverStartTime = timeGetTime(); + hoverStartTime = Sys_Milliseconds(); } else { - DWORD currentTime = timeGetTime(); + DWORD currentTime = Sys_Milliseconds(); if(currentTime - hoverStartTime > HOVER_EXPAND_DELAY) { UINT state = tree.GetItemState(hoverItem, TVIS_EXPANDED); diff --git a/neo/tools/materialeditor/MaterialView.cpp b/neo/tools/materialeditor/MaterialView.cpp index 0659a2b93..86db1acd8 100644 --- a/neo/tools/materialeditor/MaterialView.cpp +++ b/neo/tools/materialeditor/MaterialView.cpp @@ -25,7 +25,7 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "materialview.h" diff --git a/neo/tools/materialeditor/StageView.cpp b/neo/tools/materialeditor/StageView.cpp index 2d619cbf9..eb58fb531 100644 --- a/neo/tools/materialeditor/StageView.cpp +++ b/neo/tools/materialeditor/StageView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "StageView.h" diff --git a/neo/tools/materialeditor/ToggleListView.cpp b/neo/tools/materialeditor/ToggleListView.cpp index 97c4ca661..5f718a399 100644 --- a/neo/tools/materialeditor/ToggleListView.cpp +++ b/neo/tools/materialeditor/ToggleListView.cpp @@ -25,8 +25,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "ToggleListView.h" diff --git a/neo/tools/particle/DialogParticleEditor.cpp b/neo/tools/particle/DialogParticleEditor.cpp index 1b71ed501..f5a524e8b 100644 --- a/neo/tools/particle/DialogParticleEditor.cpp +++ b/neo/tools/particle/DialogParticleEditor.cpp @@ -26,10 +26,9 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + -#include "../../game/game.h" #include "../../sys/win32/win_local.h" #include "../../sys/win32/rc/common_resource.h" #include "../../sys/win32/rc/Radiant_resource.h" @@ -1273,7 +1272,16 @@ BOOL CDialogParticleEditor::OnInitDialog() { void CDialogParticleEditor::OnHScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar ) { CDialog::OnHScroll( nSBCode, nPos, pScrollBar ); - CSliderCtrl *ctrl = dynamic_cast< CSliderCtrl* >( pScrollBar ); + + // DG: from SteelStorm2: + // Something funky is going on with the RTTI. The dynamic_cast even to a CRangeSlider* + // was not happening correctly. Whatever is getting to this callback from the CRangeSlider + // must not be one of the basic slider types or even a CRangeSlider. What is weird is the + // objects coming in have the same addresses as the various CRangeSliders on the dlg, so they + // should cast correctly. Turns out it does not matter because once the addresses matche up + // this code just uses the dlg member reference so all I need is for the address check to + // go through correctly. + CRangeSlider* ctrl = (CRangeSlider*)pScrollBar; if ( !ctrl ) { return; } diff --git a/neo/tools/pda/DialogPDAEditor.cpp b/neo/tools/pda/DialogPDAEditor.cpp index 3e06c30a7..a2061e6f5 100644 --- a/neo/tools/pda/DialogPDAEditor.cpp +++ b/neo/tools/pda/DialogPDAEditor.cpp @@ -26,10 +26,9 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + -#include "../../game/game.h" #include "../../sys/win32/win_local.h" #include "../../sys/win32/rc/common_resource.h" #include "../../sys/win32/rc/PDAEditor_resource.h" diff --git a/neo/tools/radiant/CSG.CPP b/neo/tools/radiant/CSG.CPP index 2fd3c748c..ac511847f 100644 --- a/neo/tools/radiant/CSG.CPP +++ b/neo/tools/radiant/CSG.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 425d73e6b..bd1b4066e 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -39,6 +39,9 @@ If you have questions concerning this license or the applicable additional terms #include "../../renderer/tr_local.h" #include "../../renderer/model_local.h" // for idRenderModelMD5 + +// TODO: DG: could merge SteelStorm2 "new 3D view navigation" improvements + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -354,7 +357,10 @@ int CCamWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { HFONT hOldFont = (HFONT)SelectObject(hDC, hfont); - wglMakeCurrent (hDC, win32.hGLRC); + //qwglMakeCurrent (hDC, win32.hGLRC); + if( qwglMakeCurrent ( hDC, win32.hGLRC ) == FALSE ) { + common->Warning("wglMakeCurrent failed: %d", ::GetLastError()); + } if ((g_qeglobals.d_font_list = qglGenLists(256)) == 0) { common->Warning( "couldn't create font dlists" ); @@ -2062,11 +2068,13 @@ void CCamWnd::Cam_Render() { return; // not valid yet } - if (!qwglMakeCurrent(dc.m_hDC, win32.hGLRC)) { + // DG: from SteelStorm2 + // Jmarshal23 recommended to disable this to fix lighting render in the Cam window + /* if (!qwglMakeCurrent(dc.m_hDC, win32.hGLRC)) { common->Printf("ERROR: wglMakeCurrent failed..\n "); common->Printf("Please restart " EDITOR_WINDOWTEXT " if the camera view is not working\n"); return; - } + } */ // save the editor state //qglPushAttrib( GL_ALL_ATTRIB_BITS ); diff --git a/neo/tools/radiant/CameraTargetDlg.cpp b/neo/tools/radiant/CameraTargetDlg.cpp index ab5464261..30714846a 100644 --- a/neo/tools/radiant/CameraTargetDlg.cpp +++ b/neo/tools/radiant/CameraTargetDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "CameraTargetDlg.h" diff --git a/neo/tools/radiant/CapDialog.cpp b/neo/tools/radiant/CapDialog.cpp index dcac4a938..a4651d6dc 100644 --- a/neo/tools/radiant/CapDialog.cpp +++ b/neo/tools/radiant/CapDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/CommandsDlg.cpp b/neo/tools/radiant/CommandsDlg.cpp index eb9a03876..6b39dbea1 100644 --- a/neo/tools/radiant/CommandsDlg.cpp +++ b/neo/tools/radiant/CommandsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -102,10 +102,10 @@ BOOL CCommandsDlg::OnInitDialog() { strMod += " + "; } - strLine.Format("%s \t%s%s", g_Commands[n].m_strCommand, strMod, strKeys); + strLine.Format("%s \t%s%s", g_Commands[n].m_strCommand, strMod.GetString(), strKeys.GetString()); m_lstCommands.AddString(strLine); - strLine.Format("%s \t\t\t%s%s", g_Commands[n].m_strCommand, strMod, strKeys); + strLine.Format("%s \t\t\t%s%s", g_Commands[n].m_strCommand, strMod.GetString(), strKeys.GetString()); fileout.Write(strLine, strLine.GetLength()); fileout.Write("\r\n", 2); diff --git a/neo/tools/radiant/CommentsDlg.cpp b/neo/tools/radiant/CommentsDlg.cpp index b4837ac40..9e27d37e4 100644 --- a/neo/tools/radiant/CommentsDlg.cpp +++ b/neo/tools/radiant/CommentsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/ConsoleDlg.cpp b/neo/tools/radiant/ConsoleDlg.cpp index 5f4bbfaf3..2433a4716 100644 --- a/neo/tools/radiant/ConsoleDlg.cpp +++ b/neo/tools/radiant/ConsoleDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/CurveDlg.cpp b/neo/tools/radiant/CurveDlg.cpp index 05e130375..1925d2f44 100644 --- a/neo/tools/radiant/CurveDlg.cpp +++ b/neo/tools/radiant/CurveDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/DRAG.CPP b/neo/tools/radiant/DRAG.CPP index 3e069af06..a0a5bdf85 100644 --- a/neo/tools/radiant/DRAG.CPP +++ b/neo/tools/radiant/DRAG.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "splines.h" diff --git a/neo/tools/radiant/DialogInfo.cpp b/neo/tools/radiant/DialogInfo.cpp index 6458ce3c7..fe1ebe8fb 100644 --- a/neo/tools/radiant/DialogInfo.cpp +++ b/neo/tools/radiant/DialogInfo.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/DialogTextures.cpp b/neo/tools/radiant/DialogTextures.cpp index 89d2d0499..4714106b5 100644 --- a/neo/tools/radiant/DialogTextures.cpp +++ b/neo/tools/radiant/DialogTextures.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/DialogThick.cpp b/neo/tools/radiant/DialogThick.cpp index 616f7cf84..144d1178e 100644 --- a/neo/tools/radiant/DialogThick.cpp +++ b/neo/tools/radiant/DialogThick.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/DlgCamera.cpp b/neo/tools/radiant/DlgCamera.cpp index 6a1a0a954..e26f65e4a 100644 --- a/neo/tools/radiant/DlgCamera.cpp +++ b/neo/tools/radiant/DlgCamera.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/common_resource.h" #include "../comafx/DialogName.h" @@ -330,7 +330,7 @@ void CDlgCamera::OnFileOpen() DialogName dlg("Open Camera File"); if (dlg.DoModal() == IDOK) { g_splineList->clear(); - g_splineList->load(va("cameras/%s.camera", dlg.m_strName)); + g_splineList->load(va("cameras/%s.camera", dlg.m_strName.GetString())); } } @@ -338,7 +338,7 @@ void CDlgCamera::OnFileSave() { DialogName dlg("Save Camera File"); if (dlg.DoModal() == IDOK) { - g_splineList->save(va("cameras/%s.camera", dlg.m_strName)); + g_splineList->save(va("cameras/%s.camera", dlg.m_strName.GetString())); } } diff --git a/neo/tools/radiant/DlgEvent.cpp b/neo/tools/radiant/DlgEvent.cpp index 70784fc3b..621a3d00a 100644 --- a/neo/tools/radiant/DlgEvent.cpp +++ b/neo/tools/radiant/DlgEvent.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "DlgEvent.h" diff --git a/neo/tools/radiant/ECLASS.CPP b/neo/tools/radiant/ECLASS.CPP index c7ebb6dd6..697cbf427 100644 --- a/neo/tools/radiant/ECLASS.CPP +++ b/neo/tools/radiant/ECLASS.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "io.h" diff --git a/neo/tools/radiant/EditViewDlg.cpp b/neo/tools/radiant/EditViewDlg.cpp index 762590959..2fe4d5992 100644 --- a/neo/tools/radiant/EditViewDlg.cpp +++ b/neo/tools/radiant/EditViewDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/EditorBrush.cpp b/neo/tools/radiant/EditorBrush.cpp index 3c4322168..092eb2677 100644 --- a/neo/tools/radiant/EditorBrush.cpp +++ b/neo/tools/radiant/EditorBrush.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include @@ -44,7 +44,7 @@ bool g_bShowLightVolumes = false; bool g_bShowLightTextures = false; void GLCircle(float x, float y, float z, float r); - +void GLSphere(float r, int lats, int longs); const int POINTS_PER_KNOT = 50; /* @@ -3618,9 +3618,9 @@ void DrawProjectedLight(brush_t *b, bool bSelected, bool texture) { qglColor3f(1, 0, 1); for (i = 0; i < tri->numIndexes; i += 3) { qglBegin(GL_LINE_LOOP); - glVertex3fv(tri->verts[tri->indexes[i]].xyz.ToFloatPtr()); - glVertex3fv(tri->verts[tri->indexes[i + 1]].xyz.ToFloatPtr()); - glVertex3fv(tri->verts[tri->indexes[i + 2]].xyz.ToFloatPtr()); + qglVertex3fv(tri->verts[tri->indexes[i]].xyz.ToFloatPtr()); + qglVertex3fv(tri->verts[tri->indexes[i + 1]].xyz.ToFloatPtr()); + qglVertex3fv(tri->verts[tri->indexes[i + 2]].xyz.ToFloatPtr()); qglEnd(); } @@ -3732,6 +3732,35 @@ void GLCircle(float x, float y, float z, float r) qglEnd(); } +/* +================ +GLSphere - DG: from SteelStorm2 +================ +*/ +void GLSphere(float r, int lats, int longs) { + int i, j; + for(i = 0; i <= lats; i++) { + float lat0 = idMath::PI * (-0.5 + (float) (i - 1) / lats); + float z0 = idMath::Sin(lat0); + float zr0 = idMath::Cos(lat0); + float lat1 = idMath::PI * (-0.5 + (float) i / lats); + float z1 = sin(lat1); + float zr1 = cos(lat1); + + qglBegin(GL_QUAD_STRIP); + for(j = 0; j <= longs; j++) { + float lng = 2 * idMath::PI * (float) (j - 1) / longs; + float x = idMath::Cos(lng); + float y = idMath::Sin(lng); + + qglNormal3f(x * zr0, y * zr0, z0); + qglVertex3f(x * zr0, y * zr0, z0); + qglNormal3f(x * zr1, y * zr1, z1); + qglVertex3f(x * zr1, y * zr1, z1); + } + qglEnd(); + } + } /* ================ DrawSpeaker @@ -3788,10 +3817,9 @@ void DrawSpeaker(brush_t *b, bool bSelected, bool twoD) { qglTranslatef(b->owner->origin.x, b->owner->origin.y, b->owner->origin.z ); qglColor3f( 0.4f, 0.4f, 0.4f ); qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); - GLUquadricObj* qobj = gluNewQuadric(); - gluSphere(qobj, min, 8, 8); + qglColor3f( 0.8f, 0.8f, 0.8f ); - gluSphere(qobj, max, 8, 8); + GLSphere(max, 8, 8); qglEnable(GL_BLEND); qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -3801,14 +3829,13 @@ void DrawSpeaker(brush_t *b, bool bSelected, bool twoD) { } else { qglColor4f( b->owner->eclass->color.x, b->owner->eclass->color.y, b->owner->eclass->color.z, 0.35f ); } - gluSphere(qobj, min, 8, 8); + GLSphere(min, 8, 8); if (bSelected) { qglColor4f( g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES].x, g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES].y, g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES].z, 0.1f ); } else { qglColor4f( b->owner->eclass->color.x, b->owner->eclass->color.y, b->owner->eclass->color.z, 0.1f ); } - gluSphere(qobj, max, 8, 8); - gluDeleteQuadric(qobj); + GLSphere(max, 8, 8); qglPopMatrix(); } diff --git a/neo/tools/radiant/EditorBrushPrimit.cpp b/neo/tools/radiant/EditorBrushPrimit.cpp index b721248ce..d4d5e64b5 100644 --- a/neo/tools/radiant/EditorBrushPrimit.cpp +++ b/neo/tools/radiant/EditorBrushPrimit.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/EditorEntity.cpp b/neo/tools/radiant/EditorEntity.cpp index 9252bd247..7d6e49221 100644 --- a/neo/tools/radiant/EditorEntity.cpp +++ b/neo/tools/radiant/EditorEntity.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "../../renderer/tr_local.h" diff --git a/neo/tools/radiant/EditorMap.cpp b/neo/tools/radiant/EditorMap.cpp index 432c6b259..aaa34f3ad 100644 --- a/neo/tools/radiant/EditorMap.cpp +++ b/neo/tools/radiant/EditorMap.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" @@ -699,10 +699,13 @@ bool Map_SaveFile(const char *filename, bool use_region, bool autosave) { if ( _unlink(backup) != 0 && errno != 2 ) { // errno 2 means the file doesn't exist, which we don't care about g_pParentWnd->MessageBox( va("Unable to delete %s: %s", backup.c_str(), strerror(errno) ), "File Error" ); } - - if ( rename(filename, backup) != 0 ) { - g_pParentWnd->MessageBox( va("Unable to rename %s to %s: %s", filename, backup.c_str(), strerror(errno) ), "File Error" ); - } + // DG: from SteelStorm2: +// Removed this check. On the first save, it is valid that the map file does not exist because +// it has not been written to disk yet. +// KJA +// if ( rename(filename, backup) != 0 ) { +// g_pParentWnd->MessageBox( va("Unable to rename %s to %s: %s", filename, backup.c_str(), strerror(errno) ), "File Error" ); +// } } common->Printf("Map_SaveFile: %s\n", filename); diff --git a/neo/tools/radiant/EntKeyFindReplace.cpp b/neo/tools/radiant/EntKeyFindReplace.cpp index ff1cee11f..f7082e0a2 100644 --- a/neo/tools/radiant/EntKeyFindReplace.cpp +++ b/neo/tools/radiant/EntKeyFindReplace.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + //#include "stdafx.h" #include "radiant.h" @@ -126,7 +126,7 @@ void CEntKeyFindReplace::OnReplace() { // another check, if they're trying to do a replace with a missing replace key, it'll just delete found keys... // - if ((!m_strReplaceKey.IsEmpty() && !m_strReplaceValue.IsEmpty()) || GetYesNo(va("Empty REPLACE or fields will just delete all occurence of \"%s\"\n\nProceed?",m_strFindKey))) + if ((!m_strReplaceKey.IsEmpty() && !m_strReplaceValue.IsEmpty()) || GetYesNo(va("Empty REPLACE or fields will just delete all occurence of \"%s\"\n\nProceed?",m_strFindKey.GetString()))) { if (GetYesNo("Sure?")) { diff --git a/neo/tools/radiant/EntityDlg.cpp b/neo/tools/radiant/EntityDlg.cpp index b0b05c22c..618c1de87 100644 --- a/neo/tools/radiant/EntityDlg.cpp +++ b/neo/tools/radiant/EntityDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/EntityListDlg.cpp b/neo/tools/radiant/EntityListDlg.cpp index 94a3547df..91d87208b 100644 --- a/neo/tools/radiant/EntityListDlg.cpp +++ b/neo/tools/radiant/EntityListDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/FindTextureDlg.cpp b/neo/tools/radiant/FindTextureDlg.cpp index 967d11038..ea9cfe3e8 100644 --- a/neo/tools/radiant/FindTextureDlg.cpp +++ b/neo/tools/radiant/FindTextureDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/GLWidget.cpp b/neo/tools/radiant/GLWidget.cpp index 1e69078d8..df2b91794 100644 --- a/neo/tools/radiant/GLWidget.cpp +++ b/neo/tools/radiant/GLWidget.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -445,6 +445,19 @@ void idGLDrawableMaterial::draw(int x, int y, int w, int h) { } renderView_t refdef; + + // DG: renderSystem->BeginFrame() changes glConfig.vidWidth and vidHeight to w and h + // that is never reset automatically and for some reason glConfig.vidWith/height is even + // used for renderSystem->GetScreenWidth()/Height() so idSessionLocal::UpdateScreen() + // which calls renderSystem->BeginFrame( renderSystem->GetScreenWidth(), renderSystem->GetScreenHeight() ); + // won't reset those values to something sane either, causing the game to be rendered in a tiny rectangle + // at the lower left corner of the screen once we're done picking a material here.. + // I don't dare to fix this in renderSystem, as other code might rely on this behavior.. + // (OTOH I wouldn't be surprised if other callers of renderSystem->BeginFrame() cause the same issue) + // Anyway, my workaround is to remember glConfig.vidWith/Height and set them to the original + // values once we're done rendering here.. + int oldWidth = glConfig.vidWidth; + int oldHeight = glConfig.vidHeight; // render it renderSystem->BeginFrame(w, h); memset( &refdef, 0, sizeof( refdef ) ); @@ -469,6 +482,9 @@ void idGLDrawableMaterial::draw(int x, int y, int w, int h) { qglMatrixMode( GL_MODELVIEW ); qglLoadIdentity(); + // DG: reset glConfig.vidWidth/Height + glConfig.vidWidth = oldWidth; + glConfig.vidHeight = oldHeight; } } diff --git a/neo/tools/radiant/GetString.cpp b/neo/tools/radiant/GetString.cpp index 001fa240e..afed6d6f2 100644 --- a/neo/tools/radiant/GetString.cpp +++ b/neo/tools/radiant/GetString.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/InspectorDialog.cpp b/neo/tools/radiant/InspectorDialog.cpp index cd29687d8..865e971c7 100644 --- a/neo/tools/radiant/InspectorDialog.cpp +++ b/neo/tools/radiant/InspectorDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/LightDlg.cpp b/neo/tools/radiant/LightDlg.cpp index 4417e76cf..31cf2d173 100644 --- a/neo/tools/radiant/LightDlg.cpp +++ b/neo/tools/radiant/LightDlg.cpp @@ -26,12 +26,11 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" -#include "../../game/game.h" #include "../comafx/DialogColorPicker.h" #include "LightDlg.h" diff --git a/neo/tools/radiant/MRU.CPP b/neo/tools/radiant/MRU.CPP index 3658f7905..01501259a 100644 --- a/neo/tools/radiant/MRU.CPP +++ b/neo/tools/radiant/MRU.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include #include "mru.h" diff --git a/neo/tools/radiant/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index df956f7c6..9a0bfac95 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -135,6 +135,7 @@ SCommandInfo g_Commands[] = { { "Camera_Down", 'C', 0, ID_CAMERA_DOWN }, { "Camera_AngleUp", 'A', 0, ID_CAMERA_ANGLEUP }, { "Camera_AngleDown", 'Z', 0, ID_CAMERA_ANGLEDOWN }, + // FIXME: DG: SteelStorm2 has bindings for Camera_Left and Camera_StrafeLeft switched (same for Right) { "Camera_StrafeRight", VK_PERIOD, 0, ID_CAMERA_STRAFERIGHT }, { "Camera_StrafeLeft", VK_COMMA, 0, ID_CAMERA_STRAFELEFT }, { "Camera_UpFloor", VK_PRIOR, 0, ID_VIEW_UPFLOOR }, @@ -158,14 +159,20 @@ SCommandInfo g_Commands[] = { { "Grid_Set16", '5', 0, ID_GRID_16 }, { "Grid_Set32", '6', 0, ID_GRID_32 }, { "Grid_Set64", '7', 0, ID_GRID_64 }, - { "Grid_Down", 219, 0, ID_GRID_PREV }, - { "Grid_Up", 221, 0, ID_GRID_NEXT }, + { "Grid_Down", VK_OEM_4, 0, ID_GRID_PREV }, /* [{ in us layout */ + { "Grid_Up", VK_OEM_6, 0, ID_GRID_NEXT }, /* ]} in US layouts */ { "Grid_Toggle", '0', 0, ID_GRID_TOGGLE }, { "Grid_ToggleSizePaint", 'Q', RAD_PRESS, ID_SELECTION_TOGGLESIZEPAINT }, { "Grid_PrecisionCursorMode",VK_F11, 0 , ID_PRECISION_CURSOR_CYCLE}, + /* Begin SS2 Changes */ + { "Grid_SetViewTop", VK_NUMPAD7, 0, ID_SET_VIEW_TOP }, + { "Grid_SetViewSide", VK_NUMPAD3, 0, ID_SET_VIEW_SIDE }, + { "Grid_SetViewFront", VK_NUMPAD1, 0, ID_SET_VIEW_FRONT }, + /* End SS2 Changes */ + { "Grid_NextView", VK_TAB, RAD_CONTROL, ID_VIEW_NEXTVIEW }, { "Grid_ToggleCrosshairs", 'X', RAD_SHIFT, ID_VIEW_CROSSHAIR }, @@ -214,9 +221,9 @@ SCommandInfo g_Commands[] = { { "Clipper_SplitSelected", VK_RETURN, RAD_SHIFT, ID_SPLIT_SELECTED }, { "Clipper_FlipClip", VK_RETURN, RAD_CONTROL, ID_FLIP_CLIP }, - { "CameraClip_ZoomOut", 219, RAD_CONTROL, ID_VIEW_CUBEOUT }, - { "CameraClip_ZoomIn", 221, RAD_CONTROL, ID_VIEW_CUBEIN }, - { "CameraClip_Toggle", 220, RAD_CONTROL, ID_VIEW_CUBICCLIPPING }, + { "CameraClip_ZoomOut", VK_OEM_4, RAD_CONTROL, ID_VIEW_CUBEOUT }, + { "CameraClip_ZoomIn", VK_OEM_5, RAD_CONTROL, ID_VIEW_CUBEIN }, + { "CameraClip_Toggle", VK_OEM_6, RAD_CONTROL, ID_VIEW_CUBICCLIPPING }, { "ViewTab_EntityInfo", 'N', 0, ID_VIEW_ENTITY }, { "ViewTab_Console", 'O', 0, ID_VIEW_CONSOLE }, @@ -289,6 +296,9 @@ SCommandInfo g_Commands[] = { int g_nCommandCount = sizeof(g_Commands) / sizeof(SCommandInfo); SKeyInfo g_Keys[] = { + /* To understand the VK_* information, please read the MSDN: + http://msdn.microsoft.com/en-us/library/ms927178.aspx + */ { "Space", VK_SPACE }, { "Backspace", VK_BACK }, { "Escape", VK_ESCAPE }, @@ -330,9 +340,9 @@ SKeyInfo g_Keys[] = { { "NumPad7", VK_NUMPAD7 }, { "NumPad8", VK_NUMPAD8 }, { "NumPad9", VK_NUMPAD9 }, - { "[", 219 }, - { "]", 221 }, - { "\\", 220 } + { "[", VK_OEM_4 }, /* Was 219, 0xDB */ + { "\\", VK_OEM_5 }, /* Was 220, 0xDC */ + { "]", VK_OEM_6 }, /* Was 221, 0xDD */ }; int g_nKeyCount = sizeof(g_Keys) / sizeof(SKeyInfo); @@ -475,6 +485,9 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ON_COMMAND(ID_EDIT_MAPINFO, OnEditMapinfo) ON_COMMAND(ID_EDIT_ENTITYINFO, OnEditEntityinfo) ON_COMMAND(ID_VIEW_NEXTVIEW, OnViewNextview) + ON_COMMAND(ID_SET_VIEW_TOP, OnSetViewTop) + ON_COMMAND(ID_SET_VIEW_SIDE, OnSetViewSide) + ON_COMMAND(ID_SET_VIEW_FRONT, OnSetViewFront) ON_COMMAND(ID_HELP_COMMANDLIST, OnHelpCommandlist) ON_COMMAND(ID_FILE_NEWPROJECT, OnFileNewproject) ON_COMMAND(ID_FLIP_CLIP, OnFlipClip) @@ -1936,7 +1949,7 @@ void CMainFrame::OnFileSaveCopy() { AddSlash(strPath); strPath += "maps"; if (g_PrefsDlg.m_strMaps.GetLength() > 0) { - strPath += va("\\%s", g_PrefsDlg.m_strMaps); + strPath += va("\\%s", g_PrefsDlg.m_strMaps.GetString()); } /* Place the terminating null character in the szFile. */ @@ -3008,7 +3021,7 @@ void CMainFrame::OnMiscSetViewPos() } else { - ErrorBox(va("\"%s\" wasn't 3 valid floats with spaces",psNewCoords)); + ErrorBox(va("\"%s\" wasn't 3 valid floats with spaces",psNewCoords.GetString())); } } } @@ -3878,6 +3891,42 @@ void CMainFrame::OnViewNextview() { Sys_UpdateWindows(W_XY | W_CAMERA); } +/* Begin SS2 Changes */ +void CMainFrame::OnSetViewTop() { + if (m_pXYWnd->GetViewType() != XY) { + m_pXYWnd->SetViewType(XY); + m_pXYWnd->PositionView(); + if (g_qeglobals.flatRotation) { + g_qeglobals.rotateAxis = 2; + } + Sys_UpdateWindows(W_XY | W_CAMERA); + } +} + +void CMainFrame::OnSetViewSide() { + if (m_pXYWnd->GetViewType() != YZ) { + m_pXYWnd->SetViewType(YZ); + m_pXYWnd->PositionView(); + if (g_qeglobals.flatRotation) { + g_qeglobals.rotateAxis = 0; + } + Sys_UpdateWindows(W_XY | W_CAMERA); + } +} + +void CMainFrame::OnSetViewFront() { + if (m_pXYWnd->GetViewType() != XZ) { + m_pXYWnd->SetViewType(XZ); + m_pXYWnd->PositionView(); + if (g_qeglobals.flatRotation) { + g_qeglobals.rotateAxis = 1; + } + Sys_UpdateWindows(W_XY | W_CAMERA); + } +} +/* End SS2 Changes */ + + /* ======================================================================================================================= ======================================================================================================================= diff --git a/neo/tools/radiant/MainFrm.h b/neo/tools/radiant/MainFrm.h index d6ec90191..f57776835 100644 --- a/neo/tools/radiant/MainFrm.h +++ b/neo/tools/radiant/MainFrm.h @@ -198,6 +198,13 @@ class CMainFrame : public CFrameWnd afx_msg void OnFileSave(); afx_msg void OnFileSaveas(); afx_msg void OnFileSaveCopy(); + + /* Begin SS2 Changes */ + afx_msg void OnSetViewTop(); + afx_msg void OnSetViewSide(); + afx_msg void OnSetViewFront(); + /* end SS2 Changes */ + afx_msg void OnViewShowModels(); afx_msg void OnView100(); afx_msg void OnViewCenter(); diff --git a/neo/tools/radiant/MapInfo.cpp b/neo/tools/radiant/MapInfo.cpp index d7a82ed14..dca3d3c57 100644 --- a/neo/tools/radiant/MapInfo.cpp +++ b/neo/tools/radiant/MapInfo.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -109,7 +109,7 @@ BOOL CMapInfo::OnInitDialog() { mapEntity.GetNextAssoc(pos, strKey, reinterpret_cast(nValue)); CString strList; - strList.Format("%s\t%i", strKey, nValue); + strList.Format("%s\t%i", strKey.GetString(), nValue); m_lstEntity.AddString(strList); } diff --git a/neo/tools/radiant/MediaPreviewDlg.cpp b/neo/tools/radiant/MediaPreviewDlg.cpp index 6210988e8..750c3242f 100644 --- a/neo/tools/radiant/MediaPreviewDlg.cpp +++ b/neo/tools/radiant/MediaPreviewDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/NewProjDlg.cpp b/neo/tools/radiant/NewProjDlg.cpp index 373d22343..4b0d8999f 100644 --- a/neo/tools/radiant/NewProjDlg.cpp +++ b/neo/tools/radiant/NewProjDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/NewTexWnd.cpp b/neo/tools/radiant/NewTexWnd.cpp index 8388f155d..10ec3b048 100644 --- a/neo/tools/radiant/NewTexWnd.cpp +++ b/neo/tools/radiant/NewTexWnd.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/PARSE.CPP b/neo/tools/radiant/PARSE.CPP index d00a4384f..851700430 100644 --- a/neo/tools/radiant/PARSE.CPP +++ b/neo/tools/radiant/PARSE.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/PMESH.CPP b/neo/tools/radiant/PMESH.CPP index c774c067a..9decaab40 100644 --- a/neo/tools/radiant/PMESH.CPP +++ b/neo/tools/radiant/PMESH.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "DialogInfo.h" diff --git a/neo/tools/radiant/PatchDensityDlg.cpp b/neo/tools/radiant/PatchDensityDlg.cpp index bedf007f6..a0a695113 100644 --- a/neo/tools/radiant/PatchDensityDlg.cpp +++ b/neo/tools/radiant/PatchDensityDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/PatchDialog.cpp b/neo/tools/radiant/PatchDialog.cpp index b2f3ef4ee..a14f5da34 100644 --- a/neo/tools/radiant/PatchDialog.cpp +++ b/neo/tools/radiant/PatchDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/PointFile.cpp b/neo/tools/radiant/PointFile.cpp index 81fced8b6..fce65254b 100644 --- a/neo/tools/radiant/PointFile.cpp +++ b/neo/tools/radiant/PointFile.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/PrefsDlg.cpp b/neo/tools/radiant/PrefsDlg.cpp index b9ad780e9..36dc98d6b 100644 --- a/neo/tools/radiant/PrefsDlg.cpp +++ b/neo/tools/radiant/PrefsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "shlobj.h" diff --git a/neo/tools/radiant/PreviewDlg.cpp b/neo/tools/radiant/PreviewDlg.cpp index 6668f1aa3..ad80b9899 100644 --- a/neo/tools/radiant/PreviewDlg.cpp +++ b/neo/tools/radiant/PreviewDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" @@ -303,7 +303,7 @@ void CPreviewDlg::OnTvnSelchangedTreeMedia(NMHDR *pNMHDR, LRESULT *pResult) } // strip the leading "base/" if (id == MATERIALS) { - mediaName.Strip("Materials/"); + mediaName.Strip("Materials/"); // FIXME: SteelStorm2 has a _v1 suffix here } else if (id == WAVES) { mediaName.Strip( "Wave files/" ); } else if (id == PARTICLES) { @@ -448,7 +448,8 @@ void CPreviewDlg::SetModal() { void CPreviewDlg::OnBnClickedButtonReload() { BuildTree(); - g_qeglobals.sw->StopAllSounds(); + if(g_qeglobals.sw != NULL) + g_qeglobals.sw->StopAllSounds(); } void CPreviewDlg::OnBnClickedButtonAdd() @@ -608,7 +609,7 @@ void CPreviewDlg::AddMaterials(bool rootItems) { list.Append(mat->GetName()); } list.Sort(); - AddStrList("Materials", list, MATERIALS); + AddStrList("Materials", list, MATERIALS); // FIXME: SteelStorm2 has a _v1 suffix here } } diff --git a/neo/tools/radiant/PropertyList.cpp b/neo/tools/radiant/PropertyList.cpp index f45c11147..92d829fd0 100644 --- a/neo/tools/radiant/PropertyList.cpp +++ b/neo/tools/radiant/PropertyList.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/QE3.CPP b/neo/tools/radiant/QE3.CPP index d930e4a16..d3adbc38f 100644 --- a/neo/tools/radiant/QE3.CPP +++ b/neo/tools/radiant/QE3.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include @@ -127,7 +127,7 @@ void Map_Snapshot() { CString strFile; while (bGo) { - strFile.Format("%s.%i", strNewPath, nCount); + strFile.Format("%s.%i", strNewPath.GetString(), nCount); bGo = DoesFileExist(strFile, lSize); nCount++; } @@ -139,12 +139,12 @@ void Map_Snapshot() { common->Printf ( "The snapshot files in the [%s] directory total more than 4 megabytes. You might consider cleaning the directory up.", - strOrgPath + strOrgPath.GetString() ); } } else { - strMsg.Format("Snapshot save failed.. unabled to create directory\n%s", strOrgPath); + strMsg.Format("Snapshot save failed.. unabled to create directory\n%s", strOrgPath.GetString()); g_pParentWnd->MessageBox(strMsg); } } diff --git a/neo/tools/radiant/Radiant.cpp b/neo/tools/radiant/Radiant.cpp index 808bcfa6a..c7c2216a5 100644 --- a/neo/tools/radiant/Radiant.cpp +++ b/neo/tools/radiant/Radiant.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "radiant.h" diff --git a/neo/tools/radiant/RotateDlg.cpp b/neo/tools/radiant/RotateDlg.cpp index 47ef444d6..389ff91ca 100644 --- a/neo/tools/radiant/RotateDlg.cpp +++ b/neo/tools/radiant/RotateDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/SELECT.CPP b/neo/tools/radiant/SELECT.CPP index 15c7bcf82..356127cc4 100644 --- a/neo/tools/radiant/SELECT.CPP +++ b/neo/tools/radiant/SELECT.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "../../renderer/model_local.h" // for idRenderModelPrt @@ -1762,7 +1762,7 @@ void Select_AllOfType() { CString strName = e->eclass->name; idStr strKey, strVal; bool bCriteria = g_Inspectors->GetSelectAllCriteria(strKey, strVal); - common->Printf("Selecting all %s(s)\n", strName); + common->Printf("Selecting all %s(s)\n", strName.GetString()); Select_Deselect(); for (b = active_brushes.next; b != &active_brushes; b = next) { diff --git a/neo/tools/radiant/ScaleDialog.cpp b/neo/tools/radiant/ScaleDialog.cpp index de1cf546b..1b5f9a507 100644 --- a/neo/tools/radiant/ScaleDialog.cpp +++ b/neo/tools/radiant/ScaleDialog.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/SurfaceDlg.cpp b/neo/tools/radiant/SurfaceDlg.cpp index b545ec049..ee95a0e88 100644 --- a/neo/tools/radiant/SurfaceDlg.cpp +++ b/neo/tools/radiant/SurfaceDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/TabsDlg.cpp b/neo/tools/radiant/TabsDlg.cpp index 6ef70f27d..e019fe9a2 100644 --- a/neo/tools/radiant/TabsDlg.cpp +++ b/neo/tools/radiant/TabsDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "QE3.H" #include "TabsDlg.h" diff --git a/neo/tools/radiant/TearoffContainerWindow.cpp b/neo/tools/radiant/TearoffContainerWindow.cpp index 0b1559771..5f32cdabd 100644 --- a/neo/tools/radiant/TearoffContainerWindow.cpp +++ b/neo/tools/radiant/TearoffContainerWindow.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + // TearoffContainerWindow.cpp : implementation file // diff --git a/neo/tools/radiant/TextureBar.cpp b/neo/tools/radiant/TextureBar.cpp index 1551e1c4b..5c9327a5c 100644 --- a/neo/tools/radiant/TextureBar.cpp +++ b/neo/tools/radiant/TextureBar.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/Undo.cpp b/neo/tools/radiant/Undo.cpp index ed0dd9527..f651fd0fb 100644 --- a/neo/tools/radiant/Undo.cpp +++ b/neo/tools/radiant/Undo.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/VERTSEL.CPP b/neo/tools/radiant/VERTSEL.CPP index 8b5624f6e..c12c8443f 100644 --- a/neo/tools/radiant/VERTSEL.CPP +++ b/neo/tools/radiant/VERTSEL.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/WIN_DLG.CPP b/neo/tools/radiant/WIN_DLG.CPP index 576e520de..b6523ef77 100644 --- a/neo/tools/radiant/WIN_DLG.CPP +++ b/neo/tools/radiant/WIN_DLG.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/WIN_QE3.CPP b/neo/tools/radiant/WIN_QE3.CPP index 5734ea87d..e234c228e 100644 --- a/neo/tools/radiant/WIN_QE3.CPP +++ b/neo/tools/radiant/WIN_QE3.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "mru.h" @@ -336,7 +336,7 @@ void OpenDialog(void) { } if (g_PrefsDlg.m_strMaps.GetLength() > 0) { - strcat(szDirName, va("\\%s", g_PrefsDlg.m_strMaps)); + strcat(szDirName, va("\\%s", g_PrefsDlg.m_strMaps.GetString())); } /* Place the terminating null character in the szFile. */ @@ -422,7 +422,7 @@ void SaveAsDialog(bool bRegion) { AddSlash(strPath); strPath += "maps"; if (g_PrefsDlg.m_strMaps.GetLength() > 0) { - strPath += va("\\%s", g_PrefsDlg.m_strMaps); + strPath += va("\\%s", g_PrefsDlg.m_strMaps.GetString()); } /* Place the terminating null character in the szFile. */ diff --git a/neo/tools/radiant/WaitDlg.cpp b/neo/tools/radiant/WaitDlg.cpp index fbb0c40fb..f94986822 100644 --- a/neo/tools/radiant/WaitDlg.cpp +++ b/neo/tools/radiant/WaitDlg.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "WaitDlg.h" diff --git a/neo/tools/radiant/WaveOpen.cpp b/neo/tools/radiant/WaveOpen.cpp index e17a74346..870566523 100644 --- a/neo/tools/radiant/WaveOpen.cpp +++ b/neo/tools/radiant/WaveOpen.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/XYWnd.cpp b/neo/tools/radiant/XYWnd.cpp index 8911d2055..3250e16d7 100644 --- a/neo/tools/radiant/XYWnd.cpp +++ b/neo/tools/radiant/XYWnd.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/Z.CPP b/neo/tools/radiant/Z.CPP index 515e51502..500a49fda 100644 --- a/neo/tools/radiant/Z.CPP +++ b/neo/tools/radiant/Z.CPP @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" diff --git a/neo/tools/radiant/ZClip.cpp b/neo/tools/radiant/ZClip.cpp index 012de77de..183ef17f1 100644 --- a/neo/tools/radiant/ZClip.cpp +++ b/neo/tools/radiant/ZClip.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/ZWnd.cpp b/neo/tools/radiant/ZWnd.cpp index 4b3c050fc..5b2f40365 100644 --- a/neo/tools/radiant/ZWnd.cpp +++ b/neo/tools/radiant/ZWnd.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/autocaulk.cpp b/neo/tools/radiant/autocaulk.cpp index f2478a9f3..0a38da8f4 100644 --- a/neo/tools/radiant/autocaulk.cpp +++ b/neo/tools/radiant/autocaulk.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "Radiant.h" diff --git a/neo/tools/radiant/cmdlib.cpp b/neo/tools/radiant/cmdlib.cpp index ea36508cb..5b3b5a2f8 100644 --- a/neo/tools/radiant/cmdlib.cpp +++ b/neo/tools/radiant/cmdlib.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "qe3.h" #include "cmdlib.h" diff --git a/neo/tools/radiant/splines.cpp b/neo/tools/radiant/splines.cpp index 9a93ea080..4c5b6d657 100644 --- a/neo/tools/radiant/splines.cpp +++ b/neo/tools/radiant/splines.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "splines.h" diff --git a/neo/tools/script/DialogScriptEditor.cpp b/neo/tools/script/DialogScriptEditor.cpp index e50734622..0916ee0a6 100644 --- a/neo/tools/script/DialogScriptEditor.cpp +++ b/neo/tools/script/DialogScriptEditor.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/Common_resource.h" #include "../../sys/win32/rc/ScriptEditor_resource.h" diff --git a/neo/tools/sound/DialogSound.cpp b/neo/tools/sound/DialogSound.cpp index 8d71b357d..6949c101c 100644 --- a/neo/tools/sound/DialogSound.cpp +++ b/neo/tools/sound/DialogSound.cpp @@ -26,10 +26,9 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + -#include "../../game/game.h" #include "../../sys/win32/win_local.h" #include "../../sys/win32/rc/common_resource.h" #include "../../sys/win32/rc/SoundEditor_resource.h" diff --git a/neo/tools/sound/DialogSoundGroup.cpp b/neo/tools/sound/DialogSoundGroup.cpp index 6f928ff1b..931ce9cb2 100644 --- a/neo/tools/sound/DialogSoundGroup.cpp +++ b/neo/tools/sound/DialogSoundGroup.cpp @@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ -#include "../../idlib/precompiled.h" -#pragma hdrstop +#include "tools/edit_gui_common.h" + #include "../../sys/win32/rc/SoundEditor_resource.h"