Merge branch 'tools'

Bringing back support for the (MFC-based Windows-only) editing tools.
Only tested 32bit (not sure if the code is 64bit-clean), needs a
"proper" (non-Express) version of Visual Studio *including* MFC support,
tested the free "Community" Editions of VS 2013 and 2017.
(For VS2013 I needed to install the "Visual C++ MFC MBCS Library for
Visual Studio 2013" because it either didn't include MFC support at all
or only the wrong version, don't remember, you'll need that one anyway)
This commit is contained in:
Daniel Gibson 2019-03-11 01:30:26 +01:00
commit 3a763fc685
191 changed files with 1105 additions and 433 deletions

View file

@ -49,6 +49,9 @@ include(GNUInstallDirs OPTIONAL RESULT_VARIABLE GNUINSTALLDIRS)
option(CORE "Build the core" ON)
option(BASE "Build the base game code" ON)
option(D3XP "Build the d3xp game code" ON)
if(MSVC)
option(TOOLS "Build the tools game code (Windows+Visual Studio+SDL2 only)" OFF)
endif()
option(DEDICATED "Build the dedicated server" OFF)
option(ONATIVE "Optimize for the host CPU" OFF)
option(SDL2 "Use SDL2 instead of SDL1.2" ON)
@ -149,6 +152,16 @@ else()
set(CURL_LIBRARY "")
endif()
if(MSVC)
# This is required for tools on windows.
find_package(MFC)
if(TOOLS AND NOT MFC_FOUND)
message(SEND_ERROR "MFC ('Microsoft Foundation Classes for C++') couldn't be found, but is needed for TOOLS!")
message(FATAL_ERROR "If you're using VS2013, you'll also need the 'Multibyte MFC Library for Visual Studio 2013': https://www.microsoft.com/en-us/download/details.aspx?id=40770 (VS2015 and 2017 include that in the default MFC package)")
endif()
endif()
# compiler specific flags
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-pipe)
@ -231,7 +244,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(sys_libs ${sys_libs} ${EXECINFO_LIBRARIES})
endif()
elseif(MSVC)
add_definitions(/MP) # parallel build (use all cores, or as many as configured in VS)
add_compile_options(/W4)
add_compile_options(/we4840) # treat as error when passing a class to a vararg-function (probably printf-like)
add_compile_options(/wd4100) # unreferenced formal parameter
add_compile_options(/wd4127) # conditional expression is constant
add_compile_options(/wd4244) # possible loss of data
@ -509,12 +525,6 @@ set(src_ui
add_globbed_headers(src_ui "ui")
set(src_tools
tools/guied/GEWindowWrapper_stub.cpp
)
# TODO: add_globbed_headers(src_tools "tools/guied")
set(src_idlib
idlib/bv/Bounds.cpp
idlib/bv/Frustum.cpp
@ -734,6 +744,80 @@ set(src_core
set(src_stub_openal sys/stub/openal_stub.cpp)
set(src_stub_gl sys/stub/stub_gl.cpp)
set(src_tools
tools/guied/GEWindowWrapper_stub.cpp
)
# TODO: add_globbed_headers(src_tools "tools/guied")
# Begin normal tools code
if (TOOLS AND MFC_FOUND AND MSVC)
set(ALLOWRESOURCES ON)
# Common files.
file(GLOB src_comafx "tools/comafx/*.cpp")
add_globbed_headers(src_comafx "tools/comafx")
file(GLOB_RECURSE src_tools_common "tools/common/*.cpp")
add_globbed_headers(src_tools_common "tools/common")
#Compilers.
# DG: this is always added, why add it again? file(GLOB src_compiler_renderbump "neo/tools/compilers/renderbump/*.cpp")
file(GLOB src_compiler_roqvq "tools/compilers/roqvq/*.cpp") # FIXME: some of those were added before
add_globbed_headers(src_compiler_roqvq "tools/compilers/roqvq")
#tools
# Articulated Frame editor.
file(GLOB src_afeditor "tools/af/*.cpp")
add_globbed_headers(src_afeditor "tools/af")
# Declaration editor
file(GLOB src_decleditor "tools/decl/*.cpp")
add_globbed_headers(src_decleditor "tools/decl")
# GUI Editor.
file(GLOB src_gui_editor "tools/guied/*.cpp")
add_globbed_headers(src_gui_editor "tools/guied")
# Material editor
file(GLOB src_materialeditor "tools/materialeditor/*.cpp")
add_globbed_headers(src_materialeditor "tools/materialeditor")
# Particle Editor
file(GLOB src_particleeditor "tools/particle/*.cpp")
add_globbed_headers(src_particleeditor "tools/particle")
# PDA editor
file(GLOB src_pdaeditor "tools/pda/*.cpp")
add_globbed_headers(src_pdaeditor "tools/pda")
# Radiant ( Map editor )
file(GLOB src_map_editor "tools/radiant/*.cpp")
add_globbed_headers(src_map_editor "tools/radiant")
# Script editor
file(GLOB src_script_editor "tools/script/*.cpp")
add_globbed_headers(src_script_editor "tools/script")
# sound editor?
file(GLOB src_sound_editor "tools/sound/*.cpp")
add_globbed_headers(src_sound_editor "tools/sound")
# The numerous tools in a nice list.
list(APPEND src_editor_tools
${src_comafx}
${src_tools_common}
${src_compiler_renderbump}
${src_afeditor}
${src_decleditor}
${src_gui_editor}
${src_materialeditor}
${src_particleeditor}
${src_pdaeditor}
${src_map_editor}
${src_script_editor}
${src_sound_editor}
"tools/edit_public.h"
"tools/edit_gui_common.h"
)
SET(CMAKE_MFC_FLAG 2)
set(TOOLS_DEFINES "ID_ALLOW_TOOLS;__AFXDLL")
else()
set(src_editor_tools "tools/edit_stub.cpp" "tools/edit_public.h")
endif()
if(AROS)
set(DHEWM3BINARY "ADoom3")
set(sys_libs ${sys_libs} dll)
@ -783,9 +867,6 @@ elseif(APPLE)
${OSX_RESOURCE_FILES}
)
elseif(WIN32)
set(WIN32_RESOURCE_FILES
"${CMAKE_SOURCE_DIR}/sys/win32/rc/dhewm3.rc"
)
set(src_sys_base
sys/cpu.cpp
@ -799,7 +880,7 @@ elseif(WIN32)
sys/win32/win_syscon.cpp
sys/win32/SDL_win32_main.c
)
# adding the few relevant headers in sys/ manually..
set(src_sys_base ${src_sys_base}
sys/platform.h
@ -810,8 +891,16 @@ elseif(WIN32)
set(src_sys_core
sys/glimp.cpp
${WIN32_RESOURCE_FILES}
)
if(TOOLS)
set(src_sys_core ${src_sys_core} "sys/win32/rc/doom.rc")
else()
# adding both .rc files breaks the build, but I think it only contains the icon
# and doom.rc also contains that (+icons for editor etc, AFAIK), so this is fine
set(src_sys_core ${src_sys_core} "${CMAKE_SOURCE_DIR}/sys/win32/rc/dhewm3.rc" )
endif()
else()
set(src_sys_base
sys/cpu.cpp
@ -852,11 +941,12 @@ if(CORE)
${src_core}
${src_sys_base}
${src_sys_core}
${src_editor_tools}
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core} ${src_editor_tools})
set_target_properties(${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "__DOOM_DLL__")
set_target_properties(${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "__DOOM_DLL__;${TOOLS_DEFINES}")
set_target_properties(${DHEWM3BINARY} PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(${DHEWM3BINARY} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/sys/osx/Info.plist)

View file

@ -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

View file

@ -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"

View file

@ -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)));

View file

@ -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;

View file

@ -34,6 +34,11 @@ If you have questions concerning this license or the applicable additional terms
#include <malloc.h>
#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__ */

View file

@ -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 );

View file

@ -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, &timestamp, true );
if ( timestamp == -1 ) {
if ( timestamp == FILE_NOT_FOUND_TIMESTAMP ) {
return false;
}

View file

@ -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;

View file

@ -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

View file

@ -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 <SDL_syswm.h>
#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);

View file

@ -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

View file

@ -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;

View file

@ -51,6 +51,8 @@ If you have questions concerning this license or the applicable additional terms
#include <sys/stat.h>
#endif
#include "tools/edit_public.h"
#include <SDL_main.h>
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 {

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -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;

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ 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

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ 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

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -17,8 +17,8 @@
// useful.
//#include "stdafx.h"
#include "../../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "PropTree.h"

View file

@ -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"

View file

@ -17,8 +17,8 @@
// useful.
//#include "stdafx.h"
#include "../../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "PropTree.h"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -17,8 +17,8 @@
// useful.
//#include "stdafx.h"
#include "../../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "PropTree.h"

View file

@ -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"

View file

@ -2,8 +2,8 @@
//
//#include "stdafx.h"
#include "../../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "PropTreeView.h"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,10 +26,11 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "../../sys/win32/common_resource.h"
#include "sys/win32/rc/Common_resource.h"
// FIXME: SteelStorm2 has this whole file commented out
idCVar rbfg_DefaultWidth( "rbfg_DefaultWidth", "0", 0, "" );
idCVar rbfg_DefaultHeight( "rbfg_DefaultHeight", "0", 0, "" );
@ -51,7 +52,9 @@ static bool CheckPow2(int Num)
return true;
}
extern void Com_WriteConfigToFile( const char *filename );
static void Com_WriteConfigToFile(const char *filename) {
common->Warning("Some renderbump code called Com_WriteConfigTiFile(\"%s\") which is not implemented!\n", filename);
}
static BOOL CALLBACK RBFProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -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

View file

@ -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;

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "../../sys/win32/rc/DeclEditor_resource.h"
@ -200,6 +200,7 @@ void DialogDeclNew::OnBnClickedFile() {
}
switch( type ) {
// FIXME: SteelStorm2 has a _v1 suffix for materials, def and fx - why?
case DECL_TABLE: folder = "materials"; ext = "(*.mtr)|*.mtr|(*.*)|*.*||"; break;
case DECL_MATERIAL: folder = "materials"; ext = "(*.mtr)|*.mtr|(*.*)|*.*||"; break;
case DECL_SKIN: folder = "skins"; ext = "(*.skin)|*.skin|(*.*)|*.*||"; break;

View file

@ -26,8 +26,10 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#if 0 // TODO: FIX this. - DG: from SteelStorm2
#include "tools/edit_gui_common.h"
#include "../../sys/win32/rc/Common_resource.h"
#include "../../sys/win32/rc/DeclEditor_resource.h"
@ -858,3 +860,5 @@ void DialogEntityDefEditor::OnBnClickedDelete() {
MessageBox("Cannot delete an inherited value");
}
}
#endif

182
neo/tools/edit_gui_common.h Normal file
View file

@ -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 <afxwin.h>
#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

View file

@ -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"
/*
===============================================================================

View file

@ -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 ) {}

View file

@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include <io.h>

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -26,8 +26,8 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "tools/edit_gui_common.h"
#include "../../sys/win32/rc/guied_resource.h"
#include "../../renderer/tr_local.h"
@ -125,7 +125,8 @@ bool rvGEViewer::OpenFile ( const char* filename )
tempfile.StripPath ();
tempfile.StripFileExtension ( );
tempfile = va("guis/temp.guied", tempfile.c_str() );
ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" );
//ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" ); DG: change from SteelStorm2
ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_savepath" );
// Make sure the gui directory exists
idStr createDir = ospath;
@ -505,11 +506,11 @@ void rvGEViewer::Render ( HDC dc )
qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Render the workspace below
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
qglMatrixMode(GL_PROJECTION);
qglLoadIdentity();
qglOrtho(0,mWindowWidth, mWindowHeight, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
qglMatrixMode(GL_MODELVIEW);
qglLoadIdentity();
if ( mInterface )
{

View file

@ -26,8 +26,8 @@ If 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"

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more