From c60f630eea29bc264437ea7c791b6fbe407c6545 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 7 Jan 2019 02:42:00 +0100 Subject: [PATCH 1/5] GUI Editor code/integration from SteelStorm2, doesn't build yet --- neo/CMakeLists.txt | 98 +++++++++++++++++-- neo/tools/common/RenderBumpFlatDialog.cpp | 2 +- neo/tools/compilers/aas/AASFile.h | 2 +- neo/tools/compilers/renderbump/renderbump.cpp | 6 +- neo/tools/decl/DialogDeclNew.cpp | 1 + neo/tools/decl/DialogEntityDefEditor.cpp | 4 + neo/tools/edit_stub.cpp | 2 +- neo/tools/guied/GEViewer.cpp | 11 ++- neo/tools/guied/GEWindowWrapper_stub.cpp | 3 +- neo/tools/guied/GEWorkspace.cpp | 16 +-- neo/tools/guied/GEWorkspaceFile.cpp | 9 +- neo/tools/particle/DialogParticleEditor.cpp | 11 ++- neo/tools/radiant/CamWnd.cpp | 14 ++- neo/tools/radiant/EditorBrush.cpp | 47 +++++++-- neo/tools/radiant/EditorMap.cpp | 11 ++- neo/tools/radiant/MainFrm.cpp | 65 ++++++++++-- neo/tools/radiant/MainFrm.h | 7 ++ neo/tools/radiant/PreviewDlg.cpp | 4 +- 18 files changed, 253 insertions(+), 60 deletions(-) diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 37ce393e..2f1adace 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) # TODO: does this work? + option(TOOLS "build the tools game code ( Windows 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,11 @@ else() set(CURL_LIBRARY "") endif() +if(MSVC) + # This is required for tools on windows. + find_package(MFC) +endif() + # compiler specific flags if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options(-pipe) @@ -509,12 +517,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 +736,78 @@ 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") + file(GLOB_RECURSE src_tools_common "tools/common/*.cpp") + + #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) @@ -799,7 +873,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 @@ -812,6 +886,11 @@ elseif(WIN32) sys/glimp.cpp ${WIN32_RESOURCE_FILES} ) + + if(TOOLS) + set(src_sys_core ${src_sys_core} "sys/win32/rc/doom.rc") + endif() + else() set(src_sys_base sys/cpu.cpp @@ -852,11 +931,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/tools/common/RenderBumpFlatDialog.cpp b/neo/tools/common/RenderBumpFlatDialog.cpp index d105271d..6dcddc94 100644 --- a/neo/tools/common/RenderBumpFlatDialog.cpp +++ b/neo/tools/common/RenderBumpFlatDialog.cpp @@ -30,7 +30,7 @@ If you have questions concerning this license or the applicable additional terms #pragma hdrstop #include "../../sys/win32/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, "" ); diff --git a/neo/tools/compilers/aas/AASFile.h b/neo/tools/compilers/aas/AASFile.h index 9ae001c3..d5286ab1 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 8997835e..d18f902a 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/decl/DialogDeclNew.cpp b/neo/tools/decl/DialogDeclNew.cpp index ccd654a5..ec9e1373 100644 --- a/neo/tools/decl/DialogDeclNew.cpp +++ b/neo/tools/decl/DialogDeclNew.cpp @@ -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 2eb4d5a3..805516f4 100644 --- a/neo/tools/decl/DialogEntityDefEditor.cpp +++ b/neo/tools/decl/DialogEntityDefEditor.cpp @@ -26,6 +26,8 @@ If you have questions concerning this license or the applicable additional terms =========================================================================== */ +#if 0 // TODO: FIX this. - DG: from SteelStorm2 + #include "../../idlib/precompiled.h" #pragma hdrstop @@ -858,3 +860,5 @@ void DialogEntityDefEditor::OnBnClickedDelete() { MessageBox("Cannot delete an inherited value"); } } +#endif + diff --git a/neo/tools/edit_stub.cpp b/neo/tools/edit_stub.cpp index b5a9d3f5..79c2c887 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/GEViewer.cpp b/neo/tools/guied/GEViewer.cpp index 276c3be6..34312a62 100644 --- a/neo/tools/guied/GEViewer.cpp +++ b/neo/tools/guied/GEViewer.cpp @@ -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_stub.cpp b/neo/tools/guied/GEWindowWrapper_stub.cpp index 3d928b1c..92ed982d 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 cf3574e7..6fa87e11 100644 --- a/neo/tools/guied/GEWorkspace.cpp +++ b/neo/tools/guied/GEWorkspace.cpp @@ -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 725f96cf..2ee0da79 100644 --- a/neo/tools/guied/GEWorkspaceFile.cpp +++ b/neo/tools/guied/GEWorkspaceFile.cpp @@ -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/particle/DialogParticleEditor.cpp b/neo/tools/particle/DialogParticleEditor.cpp index 1b71ed50..2c271702 100644 --- a/neo/tools/particle/DialogParticleEditor.cpp +++ b/neo/tools/particle/DialogParticleEditor.cpp @@ -1273,7 +1273,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/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 425d73e6..b6b3251b 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -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/EditorBrush.cpp b/neo/tools/radiant/EditorBrush.cpp index 3c432216..223b0dac 100644 --- a/neo/tools/radiant/EditorBrush.cpp +++ b/neo/tools/radiant/EditorBrush.cpp @@ -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/EditorMap.cpp b/neo/tools/radiant/EditorMap.cpp index 432c6b25..1c43b342 100644 --- a/neo/tools/radiant/EditorMap.cpp +++ b/neo/tools/radiant/EditorMap.cpp @@ -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/MainFrm.cpp b/neo/tools/radiant/MainFrm.cpp index df956f7c..648268a6 100644 --- a/neo/tools/radiant/MainFrm.cpp +++ b/neo/tools/radiant/MainFrm.cpp @@ -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) @@ -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 d6ec9019..f5777683 100644 --- a/neo/tools/radiant/MainFrm.h +++ b/neo/tools/radiant/MainFrm.h @@ -198,6 +198,13 @@ public: 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/PreviewDlg.cpp b/neo/tools/radiant/PreviewDlg.cpp index 6668f1aa..4bc57677 100644 --- a/neo/tools/radiant/PreviewDlg.cpp +++ b/neo/tools/radiant/PreviewDlg.cpp @@ -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) { @@ -608,7 +608,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 } } From 596d40d5c93f2f21286e5c316e0bb9f9e178a0cd Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 7 Jan 2019 02:42:25 +0100 Subject: [PATCH 2/5] MSVC: Shut up Compiler warning in Matrix.h if asserts are disabled --- neo/idlib/math/Matrix.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neo/idlib/math/Matrix.h b/neo/idlib/math/Matrix.h index 785ac8f6..381f294d 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__ */ From 9a95a2a1cf19709bd637af483ff53597ebdd1d11 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 7 Jan 2019 05:19:20 +0100 Subject: [PATCH 3/5] Building with editor support (on Win w/ VS2017) works \o/ Editor also seems to start, didn't test much further. Only tested 32bit Windows, I fear the editor code isn't 64bit clean.. I hope I haven't broken anything elsewhere.. --- neo/CMakeLists.txt | 22 ++- neo/framework/BuildDefines.h | 4 +- neo/framework/Common.cpp | 1 + neo/framework/Console.cpp | 2 + neo/renderer/qgl.h | 33 ++++ neo/sys/glimp.cpp | 54 ++++++ neo/sys/win32/rc/Radiant_resource.h | 5 + neo/sys/win32/win_local.h | 6 + neo/sys/win32/win_main.cpp | 146 ++++++++++++++ neo/tools/af/DialogAF.cpp | 4 +- neo/tools/af/DialogAF.h | 2 + neo/tools/af/DialogAFBody.cpp | 4 +- neo/tools/af/DialogAFConstraint.cpp | 4 +- .../af/DialogAFConstraintBallAndSocket.cpp | 4 +- neo/tools/af/DialogAFConstraintFixed.cpp | 4 +- neo/tools/af/DialogAFConstraintHinge.cpp | 4 +- neo/tools/af/DialogAFConstraintSlider.cpp | 4 +- neo/tools/af/DialogAFConstraintSpring.cpp | 4 +- neo/tools/af/DialogAFConstraintUniversal.cpp | 4 +- neo/tools/af/DialogAFName.cpp | 4 +- neo/tools/af/DialogAFProperties.cpp | 4 +- neo/tools/af/DialogAFView.cpp | 4 +- neo/tools/comafx/CDIB.cpp | 4 +- neo/tools/comafx/CPathTreeCtrl.cpp | 4 +- neo/tools/comafx/CSyntaxRichEditCtrl.cpp | 4 +- neo/tools/comafx/DialogColorPicker.cpp | 4 +- neo/tools/comafx/DialogGoToLine.cpp | 4 +- neo/tools/comafx/DialogName.cpp | 4 +- neo/tools/comafx/StdAfx.cpp | 4 +- neo/tools/comafx/VectorCtl.cpp | 4 +- neo/tools/common/AlphaPopup.cpp | 4 +- neo/tools/common/ColorButton.cpp | 4 +- neo/tools/common/MaskEdit.cpp | 4 +- neo/tools/common/OpenFileDialog.cpp | 4 +- neo/tools/common/PropTree/PropTree.cpp | 4 +- neo/tools/common/PropTree/PropTreeInfo.cpp | 4 +- neo/tools/common/PropTree/PropTreeItem.cpp | 4 +- .../common/PropTree/PropTreeItemButton.cpp | 4 +- .../common/PropTree/PropTreeItemCheck.cpp | 4 +- .../common/PropTree/PropTreeItemColor.cpp | 4 +- .../common/PropTree/PropTreeItemCombo.cpp | 4 +- .../common/PropTree/PropTreeItemEdit.cpp | 4 +- .../PropTree/PropTreeItemEditButton.cpp | 4 +- .../common/PropTree/PropTreeItemFileEdit.cpp | 4 +- .../common/PropTree/PropTreeItemStatic.cpp | 4 +- neo/tools/common/PropTree/PropTreeList.cpp | 4 +- neo/tools/common/PropTree/PropTreeView.cpp | 4 +- neo/tools/common/PropertyGrid.cpp | 4 +- neo/tools/common/RegistryOptions.cpp | 4 +- neo/tools/common/RenderBumpFlatDialog.cpp | 11 +- neo/tools/common/RollupPanel.cpp | 4 +- neo/tools/common/SpinButton.cpp | 4 +- neo/tools/debugger/DebuggerApp.cpp | 4 +- neo/tools/debugger/DebuggerBreakpoint.cpp | 4 +- neo/tools/debugger/DebuggerClient.cpp | 4 +- neo/tools/debugger/DebuggerFindDlg.cpp | 4 +- neo/tools/debugger/DebuggerQuickWatchDlg.cpp | 4 +- neo/tools/debugger/DebuggerScript.cpp | 4 +- neo/tools/debugger/DebuggerServer.cpp | 4 +- neo/tools/debugger/DebuggerWindow.cpp | 4 +- neo/tools/debugger/debugger.cpp | 4 +- neo/tools/decl/DialogDeclBrowser.cpp | 4 +- neo/tools/decl/DialogDeclEditor.cpp | 4 +- neo/tools/decl/DialogDeclNew.cpp | 4 +- neo/tools/decl/DialogEntityDefEditor.cpp | 4 +- neo/tools/edit_gui_common.h | 182 ++++++++++++++++++ neo/tools/edit_public.h | 3 + neo/tools/guied/GEApp.cpp | 4 +- neo/tools/guied/GECheckInDlg.cpp | 4 +- neo/tools/guied/GEDeleteModifier.cpp | 4 +- neo/tools/guied/GEHideModifier.cpp | 4 +- neo/tools/guied/GEInsertModifier.cpp | 4 +- neo/tools/guied/GEItemPropsDlg.cpp | 4 +- neo/tools/guied/GEItemScriptsDlg.cpp | 4 +- neo/tools/guied/GEKeyValueModifier.cpp | 4 +- neo/tools/guied/GEModifier.cpp | 4 +- neo/tools/guied/GEModifierGroup.cpp | 4 +- neo/tools/guied/GEModifierStack.cpp | 4 +- neo/tools/guied/GEMoveModifier.cpp | 4 +- neo/tools/guied/GENavigator.cpp | 4 +- neo/tools/guied/GEOptions.cpp | 4 +- neo/tools/guied/GEOptionsDlg.cpp | 4 +- neo/tools/guied/GEProperties.cpp | 4 +- neo/tools/guied/GEPropertyPage.cpp | 4 +- neo/tools/guied/GESelectionMgr.cpp | 4 +- neo/tools/guied/GESizeModifier.cpp | 4 +- neo/tools/guied/GEStateModifier.cpp | 4 +- neo/tools/guied/GEStatusBar.cpp | 4 +- neo/tools/guied/GETransformer.cpp | 4 +- neo/tools/guied/GEViewer.cpp | 4 +- neo/tools/guied/GEWindowWrapper.cpp | 4 +- neo/tools/guied/GEWorkspace.cpp | 4 +- neo/tools/guied/GEWorkspaceFile.cpp | 4 +- neo/tools/guied/GEZOrderModifier.cpp | 4 +- neo/tools/guied/guied.cpp | 9 +- neo/tools/materialeditor/ConsoleView.cpp | 4 +- neo/tools/materialeditor/FindDialog.cpp | 4 +- neo/tools/materialeditor/MEMainFrame.cpp | 4 +- neo/tools/materialeditor/MEOptions.cpp | 4 +- neo/tools/materialeditor/MaterialDef.cpp | 4 +- neo/tools/materialeditor/MaterialDoc.cpp | 4 +- .../materialeditor/MaterialDocManager.cpp | 4 +- neo/tools/materialeditor/MaterialEditView.cpp | 4 +- neo/tools/materialeditor/MaterialEditor.cpp | 4 +- neo/tools/materialeditor/MaterialModifier.cpp | 4 +- .../MaterialPreviewPropView.cpp | 4 +- .../materialeditor/MaterialPreviewView.cpp | 4 +- .../materialeditor/MaterialPropTreeView.cpp | 4 +- neo/tools/materialeditor/MaterialTreeView.cpp | 8 +- neo/tools/materialeditor/MaterialView.cpp | 4 +- neo/tools/materialeditor/StageView.cpp | 4 +- neo/tools/materialeditor/ToggleListView.cpp | 4 +- neo/tools/particle/DialogParticleEditor.cpp | 5 +- neo/tools/pda/DialogPDAEditor.cpp | 5 +- neo/tools/radiant/CSG.CPP | 4 +- neo/tools/radiant/CamWnd.cpp | 4 +- neo/tools/radiant/CameraTargetDlg.cpp | 4 +- neo/tools/radiant/CapDialog.cpp | 4 +- neo/tools/radiant/CommandsDlg.cpp | 8 +- neo/tools/radiant/CommentsDlg.cpp | 4 +- neo/tools/radiant/ConsoleDlg.cpp | 4 +- neo/tools/radiant/CurveDlg.cpp | 4 +- neo/tools/radiant/DRAG.CPP | 4 +- neo/tools/radiant/DialogInfo.cpp | 4 +- neo/tools/radiant/DialogTextures.cpp | 4 +- neo/tools/radiant/DialogThick.cpp | 4 +- neo/tools/radiant/DlgCamera.cpp | 8 +- neo/tools/radiant/DlgEvent.cpp | 4 +- neo/tools/radiant/ECLASS.CPP | 4 +- neo/tools/radiant/EditViewDlg.cpp | 4 +- neo/tools/radiant/EditorBrush.cpp | 4 +- neo/tools/radiant/EditorBrushPrimit.cpp | 4 +- neo/tools/radiant/EditorEntity.cpp | 4 +- neo/tools/radiant/EditorMap.cpp | 4 +- neo/tools/radiant/EntKeyFindReplace.cpp | 6 +- neo/tools/radiant/EntityDlg.cpp | 4 +- neo/tools/radiant/EntityListDlg.cpp | 4 +- neo/tools/radiant/FindTextureDlg.cpp | 4 +- neo/tools/radiant/GLWidget.cpp | 4 +- neo/tools/radiant/GetString.cpp | 4 +- neo/tools/radiant/InspectorDialog.cpp | 4 +- neo/tools/radiant/LightDlg.cpp | 5 +- neo/tools/radiant/MRU.CPP | 4 +- neo/tools/radiant/MainFrm.cpp | 8 +- neo/tools/radiant/MapInfo.cpp | 6 +- neo/tools/radiant/MediaPreviewDlg.cpp | 4 +- neo/tools/radiant/NewProjDlg.cpp | 4 +- neo/tools/radiant/NewTexWnd.cpp | 4 +- neo/tools/radiant/PARSE.CPP | 4 +- neo/tools/radiant/PMESH.CPP | 4 +- neo/tools/radiant/PatchDensityDlg.cpp | 4 +- neo/tools/radiant/PatchDialog.cpp | 4 +- neo/tools/radiant/PointFile.cpp | 4 +- neo/tools/radiant/PrefsDlg.cpp | 4 +- neo/tools/radiant/PreviewDlg.cpp | 4 +- neo/tools/radiant/PropertyList.cpp | 4 +- neo/tools/radiant/QE3.CPP | 10 +- neo/tools/radiant/Radiant.cpp | 4 +- neo/tools/radiant/RotateDlg.cpp | 4 +- neo/tools/radiant/SELECT.CPP | 6 +- neo/tools/radiant/ScaleDialog.cpp | 4 +- neo/tools/radiant/SurfaceDlg.cpp | 4 +- neo/tools/radiant/TabsDlg.cpp | 4 +- neo/tools/radiant/TearoffContainerWindow.cpp | 4 +- neo/tools/radiant/TextureBar.cpp | 4 +- neo/tools/radiant/Undo.cpp | 4 +- neo/tools/radiant/VERTSEL.CPP | 4 +- neo/tools/radiant/WIN_DLG.CPP | 4 +- neo/tools/radiant/WIN_QE3.CPP | 8 +- neo/tools/radiant/WaitDlg.cpp | 4 +- neo/tools/radiant/WaveOpen.cpp | 4 +- neo/tools/radiant/XYWnd.cpp | 4 +- neo/tools/radiant/Z.CPP | 4 +- neo/tools/radiant/ZClip.cpp | 4 +- neo/tools/radiant/ZWnd.cpp | 4 +- neo/tools/radiant/autocaulk.cpp | 4 +- neo/tools/radiant/cmdlib.cpp | 4 +- neo/tools/radiant/splines.cpp | 4 +- neo/tools/script/DialogScriptEditor.cpp | 4 +- neo/tools/sound/DialogSound.cpp | 5 +- neo/tools/sound/DialogSoundGroup.cpp | 4 +- 181 files changed, 814 insertions(+), 370 deletions(-) create mode 100644 neo/tools/edit_gui_common.h diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 2f1adace..0133a8c9 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -49,8 +49,8 @@ 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) # TODO: does this work? - option(TOOLS "build the tools game code ( Windows only )" OFF) +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) @@ -155,6 +155,11 @@ 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 @@ -239,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 @@ -748,7 +756,9 @@ 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") @@ -857,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 @@ -884,11 +891,14 @@ 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() diff --git a/neo/framework/BuildDefines.h b/neo/framework/BuildDefines.h index 67cbf7c4..79a6cb9d 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 842c81e7..37648c90 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 7b81b2c2..769d9978 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/renderer/qgl.h b/neo/renderer/qgl.h index 68b020e6..7480774e 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 8b19b526..91b1e065 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 c2540fe1..3b725e75 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 40954360..637336dd 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 b47c7bae..747b29ea 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 1a43a610..d9a57936 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 cafcc799..3c9fa85d 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 ee3848e0..a15156a0 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 f471d43e..67c41225 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 88680cbf..1568499a 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 9ca96e83..849716c7 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 5bf51b01..dd0031a7 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 d726c967..77e31864 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 436eb790..b3428fd5 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 933a3799..613b7114 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 0a409a0f..78bca238 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 0b22c329..be6232c7 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 97939f52..652a6f27 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 d1c290cd..0bfd3b00 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 bb862f57..cb580a38 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 2cfcc153..0315d695 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 cbf693e5..c92570b2 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 0a999e53..5a3fcce2 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 bec4f377..48102270 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 5767fa21..5a9773cf 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 a582fb5e..613677c1 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 3f11685b..68eb557f 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 20d2f6cf..044e31fd 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 fb5641c4..c4970356 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 2d1c6286..4927dc05 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 e9a42ccc..6df28573 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 d5223c2c..7feded04 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 90761e92..f99fd6d2 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 ea7e1021..68562943 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 256c2c39..94776543 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 26b167ed..527e6201 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 0816a7dc..7313862f 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 bc04e464..1049cc86 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 bd07d41c..3f95462b 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 dda056db..391c1c61 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 b13d7c4a..b71b3fba 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 042231d0..10c5a2b1 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 88252205..4a79acf0 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 efb3bba4..efe87074 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 fcf0902f..4ca80691 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 6dcddc94..4fd5ae74 100644 --- a/neo/tools/common/RenderBumpFlatDialog.cpp +++ b/neo/tools/common/RenderBumpFlatDialog.cpp @@ -26,11 +26,12 @@ 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 85cbe3d8..09407fd5 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 f2b78fb4..8520bf41 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/debugger/DebuggerApp.cpp b/neo/tools/debugger/DebuggerApp.cpp index cace9747..82aacaa1 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 312ff85e..975f2eb2 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 4ce9766b..6ce67255 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 074bc3a0..59ce96c6 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 c7cbf827..7cf18fe3 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 3b5a1834..fc15dfac 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 f328b991..9606b19a 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 8d8266d3..fbf33e79 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 67e654b6..4e5d5f6e 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 d06e5e81..7186ca35 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 43e67ce2..b20a72d5 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 ec9e1373..bfc52058 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" diff --git a/neo/tools/decl/DialogEntityDefEditor.cpp b/neo/tools/decl/DialogEntityDefEditor.cpp index 805516f4..8aeac31d 100644 --- a/neo/tools/decl/DialogEntityDefEditor.cpp +++ b/neo/tools/decl/DialogEntityDefEditor.cpp @@ -28,8 +28,8 @@ If you have questions concerning this license or the applicable additional terms #if 0 // TODO: FIX this. - DG: from SteelStorm2 -#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/edit_gui_common.h b/neo/tools/edit_gui_common.h new file mode 100644 index 00000000..48b43c1b --- /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 4beb585b..be36df30 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/guied/GEApp.cpp b/neo/tools/guied/GEApp.cpp index 70c94363..440d307b 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 6b53efe0..1fd627be 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 95c9dc3e..9c967648 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 a51ce92c..23a353ec 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 73d8851e..1e35578f 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 cde38c88..b717f676 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 062e039d..e5832d57 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 c864e98a..39ceaeac 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 41ac976e..aa68759b 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 52310d0b..dfecc8aa 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 a13ac362..bddaffcc 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 08b93b34..4a1aa3ba 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 5baeeacb..342c25e7 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 64178f17..42068395 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 22b6b547..1afb6663 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 ded3d1d0..a1571867 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 1405e123..f937d8ea 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 3867bf75..12679cea 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 af421ff2..ec63a177 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 fcb3f45d..6a65598f 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 712710ef..fefc41f3 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 417e3405..cb93567d 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 34312a62..f7c16d74 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" diff --git a/neo/tools/guied/GEWindowWrapper.cpp b/neo/tools/guied/GEWindowWrapper.cpp index 2b994412..9f113389 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/GEWorkspace.cpp b/neo/tools/guied/GEWorkspace.cpp index 6fa87e11..8c98427b 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" diff --git a/neo/tools/guied/GEWorkspaceFile.cpp b/neo/tools/guied/GEWorkspaceFile.cpp index 2ee0da79..de1e37ae 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" diff --git a/neo/tools/guied/GEZOrderModifier.cpp b/neo/tools/guied/GEZOrderModifier.cpp index 5ca9a07b..485427ab 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 50d4e929..2953882f 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 cb633324..bd2a0e2d 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 33178585..315a7192 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 c628c2b4..a8f4a6a4 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 e3b24fdd..4c2f5fbf 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 3fe26ac1..e6a36e75 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 4005ddea..479c902d 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 5dfb0ffd..325a9e52 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 8d78d3d8..e830730b 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 6f6e3c0d..3065aca8 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 35fb6c1a..07d11aa1 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 04b3e3f0..c000fd97 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 be453469..8e1d54ec 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 a8be5888..0ae5fec0 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 921a4d5c..2a204e89 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 0659a2b9..86db1acd 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 2d619cbf..eb58fb53 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 97c4ca66..5f718a39 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 2c271702..f5a524e8 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" diff --git a/neo/tools/pda/DialogPDAEditor.cpp b/neo/tools/pda/DialogPDAEditor.cpp index 3e06c30a..a2061e6f 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 2fd3c748..ac511847 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 b6b3251b..bd1b4066 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" diff --git a/neo/tools/radiant/CameraTargetDlg.cpp b/neo/tools/radiant/CameraTargetDlg.cpp index ab546426..30714846 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 dcac4a93..a4651d6d 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 eb9a0387..6b39dbea 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 b4837ac4..9e27d37e 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 5f4bbfaf..2433a471 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 05e13037..1925d2f4 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 3e069af0..a0a5bdf8 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 6458ce3c..fe1ebe8f 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 89d2d049..4714106b 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 616f7cf8..144d1178 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 6a1a0a95..e26f65e4 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 70784fc3..621a3d00 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 c7ebb6dd..697cbf42 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 76259095..2fe4d599 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 223b0dac..092eb267 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 diff --git a/neo/tools/radiant/EditorBrushPrimit.cpp b/neo/tools/radiant/EditorBrushPrimit.cpp index b721248c..d4d5e64b 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 9252bd24..7d6e4922 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 1c43b342..aaa34f3a 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" diff --git a/neo/tools/radiant/EntKeyFindReplace.cpp b/neo/tools/radiant/EntKeyFindReplace.cpp index ff1cee11..f7082e0a 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 b0b05c22..618c1de8 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 94a3547d..91d87208 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 967d1103..ea9cfe3e 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 1e69078d..011868a4 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" diff --git a/neo/tools/radiant/GetString.cpp b/neo/tools/radiant/GetString.cpp index 001fa240..afed6d6f 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 cd29687d..865e971c 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 4417e76c..31cf2d17 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 3658f790..01501259 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 648268a6..9a0bfac9 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" @@ -1949,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. */ @@ -3021,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())); } } } diff --git a/neo/tools/radiant/MapInfo.cpp b/neo/tools/radiant/MapInfo.cpp index d7a82ed1..dca3d3c5 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 6210988e..750c3242 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 373d2234..4b0d8999 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 8388f155..10ec3b04 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 d00a4384..85170043 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 c774c067..9decaab4 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 bedf007f..a0a69511 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 b2f3ef4e..a14f5da3 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 81fced8b..fce65254 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 b9ad780e..36dc98d6 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 4bc57677..786ce19d 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" diff --git a/neo/tools/radiant/PropertyList.cpp b/neo/tools/radiant/PropertyList.cpp index f45c1114..92d829fd 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 d930e4a1..d3adbc38 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 808bcfa6..c7c2216a 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 47ef444d..389ff91c 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 15c7bcf8..356127cc 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 de1cf546..1b5f9a50 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 b545ec04..ee95a0e8 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 6ef70f27..e019fe9a 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 0b155977..5f32cdab 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 1551e1c4..5c9327a5 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 ed0dd952..f651fd0f 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 8b5624f6..c12c8443 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 576e520d..b6523ef7 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 5734ea87..e234c228 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 fbb0c40f..f9498682 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 e17a7434..87056652 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 8911d205..3250e16d 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 515e5150..500a49fd 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 012de77d..183ef17f 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 4b3c050f..5b2f4036 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 f2478a9f..0a38da8f 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 ea36508c..5b3b5a2f 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 9a93ea08..4c5b6d65 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 e5073462..0916ee0a 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 8d71b357..6949c101 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 6f928ff1..931ce9cb 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" From b0d022f5599fb202287861307b15fcec5e919345 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 27 Jan 2019 05:56:36 +0100 Subject: [PATCH 4/5] Fix crash when selecting nonexistant texture in D3Radiant When selecting a texture in Inspectors -> Media -> Textures that doesn't really exist (.mtr defines it, but referenced image files are missing), the game/editor used to crash. The problem was that somehow people thought the best way to communicate that a file wasn't found was by setting the timestamp to 0xFFFFFFFF and then checking for that - sometimes (incorrectly) by comparing it to -1. That worked for 32bit ID_TIME_T (typedefed to time_t), but not with 64bit time_t, which now seems to be the default for Win32 in VS. So I replaced a few -1 and 0xFF... with FILE_NOT_FOUND_TIMESTAMP and now it works. FILE_NOT_FOUND_TIMESTAMP is still defined as 0xFFFFFFFF, maybe I should change that, unsure if that'd break anything though.. When changing it one should keep in mind that time_t might still be 32bit on some platforms (Linux x86?) so that should still work.. (-1 could work) --- neo/framework/FileSystem.h | 2 ++ neo/renderer/Image_files.cpp | 4 ++-- neo/renderer/Image_program.cpp | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/neo/framework/FileSystem.h b/neo/framework/FileSystem.h index 529ed5bd..ad1a8de2 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/renderer/Image_files.cpp b/neo/renderer/Image_files.cpp index 24436c80..6d62e4e7 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 e7ec7eeb..1a02b872 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; } From 5c1e1d770883996eb5bb6a73118bd6d41295d282 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 10 Mar 2019 05:23:06 +0100 Subject: [PATCH 5/5] Fix ParticleEditor's Materialpicker screwing up ViewPort In short, it uses a idGLDrawableMaterial widget that calls renderSystem->BeginFrame(w, h); (with w and h being small for the texture preview window) and BeginFrame() sets glConfig.vidWidth and vidHeight to w/h and that never got reset to the original value (window width/height). This breaks everything because for some reason renderSystem->GetSCreenWidth()/Height() return glConfig.vidWidth/Height so it will just continue to render everything at that resolution (in a small rectangle on the lower left corner of the window). This bug has already existed in Doom3 1.3.1 (but was less noticable because apparently when switching away from Doom3 and back to the window it reset vidWidth/Height to the window resolution) I only implemented a workaround (restore glConfig.vid* after rendering the texture preview), it's possible that the same issue exists in other (probably editor-) code - but a "proper fix" might also break code (and I'm not super-familiar with the editor code or even just using them) --- neo/renderer/RenderSystem.cpp | 7 +++++++ neo/tools/radiant/GLWidget.cpp | 16 ++++++++++++++++ neo/tools/radiant/PreviewDlg.cpp | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/neo/renderer/RenderSystem.cpp b/neo/renderer/RenderSystem.cpp index aa718205..0a9629c3 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/tools/radiant/GLWidget.cpp b/neo/tools/radiant/GLWidget.cpp index 011868a4..df2b9179 100644 --- a/neo/tools/radiant/GLWidget.cpp +++ b/neo/tools/radiant/GLWidget.cpp @@ -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/PreviewDlg.cpp b/neo/tools/radiant/PreviewDlg.cpp index 786ce19d..ad80b989 100644 --- a/neo/tools/radiant/PreviewDlg.cpp +++ b/neo/tools/radiant/PreviewDlg.cpp @@ -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()