diff --git a/CMakeLists.txt b/CMakeLists.txt index 133fe53..ec424c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,15 +153,15 @@ set( SOURCES src/lightmap/collision.cpp src/lightmap/halffloat.cpp src/lightmap/kexlib/binfile.cpp - src/lightmap/kexlib/math/angle.cpp - src/lightmap/kexlib/math/bounds.cpp - src/lightmap/kexlib/math/mathlib.cpp - src/lightmap/kexlib/math/matrix.cpp - src/lightmap/kexlib/math/plane.cpp - src/lightmap/kexlib/math/pluecker.cpp - src/lightmap/kexlib/math/quaternion.cpp - src/lightmap/kexlib/math/random.cpp - src/lightmap/kexlib/math/vector.cpp + src/math/angle.cpp + src/math/bounds.cpp + src/math/mathlib.cpp + src/math/matrix.cpp + src/math/plane.cpp + src/math/pluecker.cpp + src/math/quaternion.cpp + src/math/random.cpp + src/math/vector.cpp ) if( WIN32 ) set( SOURCES "${SOURCES}" src/viewer/view.cpp ) @@ -183,7 +183,6 @@ set( HEADERS src/framework/templates.h src/framework/zdray.h src/framework/xs_Float.h - src/lightmap/common.h src/lightmap/lightmap.h src/lightmap/lightsurface.h src/lightmap/mapdata.h @@ -193,7 +192,7 @@ set( HEADERS src/lightmap/collision.h src/lightmap/halffloat.h src/lightmap/kexlib/binfile.h - src/lightmap/kexlib/math/mathlib.h + src/math/mathlib.h ) if( SSE_MATTERS ) @@ -263,6 +262,6 @@ source_group("Sources\\Platform" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR source_group("Sources\\Platform\\Windows" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/platform/windows/.+") source_group("Sources\\Viewer" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/viewer/.+") source_group("Sources\\Wad" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/wad/.+") +source_group("Sources\\Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/math/.+") source_group("Sources\\Lightmap" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/lightmap/.+") source_group("Sources\\Lightmap\\kexlib" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/lightmap/kexlib/.+") -source_group("Sources\\Lightmap\\kexlib\\math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/lightmap/kexlib/math/.+") diff --git a/src/level/doomdata.h b/src/level/doomdata.h index 9dcf2eb..4172ccf 100644 --- a/src/level/doomdata.h +++ b/src/level/doomdata.h @@ -2,7 +2,7 @@ #pragma once #include "framework/tarray.h" -#include "lightmap/kexlib/math/mathlib.h" +#include "math/mathlib.h" #include "lightmap/collision.h" #include #undef MIN diff --git a/src/level/level.cpp b/src/level/level.cpp index fae17da..ff55767 100644 --- a/src/level/level.cpp +++ b/src/level/level.cpp @@ -22,6 +22,11 @@ //#include "rejectbuilder.h" #include +#ifdef _MSC_VER +#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data +#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data +#endif + extern int LMDims; extern int Samples; diff --git a/src/level/level_udmf.cpp b/src/level/level_udmf.cpp index 417b4a5..f08443d 100644 --- a/src/level/level_udmf.cpp +++ b/src/level/level_udmf.cpp @@ -28,6 +28,11 @@ typedef unsigned int uint32; typedef signed int int32; #include "framework/xs_Float.h" +#ifdef _MSC_VER +#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data +#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data +#endif + static void CopyUDMFString(char *dest, int destlen, const char *udmfvalue) { destlen--; diff --git a/src/lightmap/collision.h b/src/lightmap/collision.h index 5927633..8b112a2 100644 --- a/src/lightmap/collision.h +++ b/src/lightmap/collision.h @@ -22,7 +22,7 @@ #pragma once -#include "kexlib/math/mathlib.h" +#include "math/mathlib.h" #include class SphereShape diff --git a/src/lightmap/common.h b/src/lightmap/common.h deleted file mode 100644 index d715bcb..0000000 --- a/src/lightmap/common.h +++ /dev/null @@ -1,45 +0,0 @@ -//----------------------------------------------------------------------------- -// Note: this is a modified version of dlight. It is not the original software. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2013-2014 Samuel Villarreal -// svkaiser@gmail.com -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data -#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data -#endif - -#include "kexlib/math/mathlib.h" diff --git a/src/lightmap/kexlib/binfile.cpp b/src/lightmap/kexlib/binfile.cpp index 9ccb65b..61752f2 100644 --- a/src/lightmap/kexlib/binfile.cpp +++ b/src/lightmap/kexlib/binfile.cpp @@ -30,7 +30,6 @@ // //----------------------------------------------------------------------------- -#include "lightmap/common.h" #include "lightmap/kexlib/binfile.h" typedef union diff --git a/src/lightmap/kexlib/binfile.h b/src/lightmap/kexlib/binfile.h index 35dc20b..fcf8a83 100644 --- a/src/lightmap/kexlib/binfile.h +++ b/src/lightmap/kexlib/binfile.h @@ -27,7 +27,7 @@ #pragma once -#include "lightmap/kexlib/math/mathlib.h" +#include "math/mathlib.h" #include class kexBinFile diff --git a/src/lightmap/lightmap.cpp b/src/lightmap/lightmap.cpp index 824fd86..400117a 100644 --- a/src/lightmap/lightmap.cpp +++ b/src/lightmap/lightmap.cpp @@ -30,7 +30,7 @@ // //----------------------------------------------------------------------------- -#include "common.h" +#include "math/mathlib.h" #include "surfaces.h" #include "trace.h" #include "mapdata.h" @@ -43,6 +43,11 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data +#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data +#endif + extern int Multisample; extern thread_local kexVec3 *colorSamples; diff --git a/src/lightmap/lightsurface.cpp b/src/lightmap/lightsurface.cpp index 13656d7..47e5e56 100644 --- a/src/lightmap/lightsurface.cpp +++ b/src/lightmap/lightsurface.cpp @@ -32,7 +32,7 @@ // //----------------------------------------------------------------------------- -#include "common.h" +#include "math/mathlib.h" #include "mapdata.h" #include "trace.h" #include "lightsurface.h" diff --git a/src/lightmap/mapdata.cpp b/src/lightmap/mapdata.cpp index e4b084b..ba7483c 100644 --- a/src/lightmap/mapdata.cpp +++ b/src/lightmap/mapdata.cpp @@ -30,11 +30,16 @@ // //----------------------------------------------------------------------------- -#include "common.h" +#include "math/mathlib.h" #include "mapdata.h" #include "lightsurface.h" #include +#ifdef _MSC_VER +#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data +#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data +#endif + static const kexVec3 defaultSunColor(1, 1, 1); static const kexVec3 defaultSunDirection(0.45f, 0.3f, 0.9f); diff --git a/src/lightmap/surfaces.cpp b/src/lightmap/surfaces.cpp index f1590b3..7aabc04 100644 --- a/src/lightmap/surfaces.cpp +++ b/src/lightmap/surfaces.cpp @@ -30,10 +30,15 @@ // //----------------------------------------------------------------------------- -#include "common.h" +#include "math/mathlib.h" #include "mapdata.h" #include "surfaces.h" +#ifdef _MSC_VER +#pragma warning(disable: 4267) // warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data +#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data +#endif + std::vector surfaces; static void CreateSideSurfaces(FLevel &doomMap, IntSideDef *side) diff --git a/src/lightmap/surfaces.h b/src/lightmap/surfaces.h index 6436965..8e5087f 100644 --- a/src/lightmap/surfaces.h +++ b/src/lightmap/surfaces.h @@ -27,6 +27,8 @@ #pragma once +#include + struct MapSubsectorEx; enum surfaceType_t diff --git a/src/lightmap/trace.cpp b/src/lightmap/trace.cpp index 858a3b3..344e670 100644 --- a/src/lightmap/trace.cpp +++ b/src/lightmap/trace.cpp @@ -31,7 +31,7 @@ // //----------------------------------------------------------------------------- -#include "common.h" +#include "math/mathlib.h" #include "mapdata.h" #include "trace.h" diff --git a/src/lightmap/worker.cpp b/src/lightmap/worker.cpp index a93f847..fbb576c 100644 --- a/src/lightmap/worker.cpp +++ b/src/lightmap/worker.cpp @@ -1,6 +1,6 @@ #include "worker.h" -#include "common.h" +#include "math/mathlib.h" #include #include #include diff --git a/src/lightmap/kexlib/math/angle.cpp b/src/math/angle.cpp similarity index 99% rename from src/lightmap/kexlib/math/angle.cpp rename to src/math/angle.cpp index 904e0a7..cf1a4e6 100644 --- a/src/lightmap/kexlib/math/angle.cpp +++ b/src/math/angle.cpp @@ -32,6 +32,7 @@ #include #include "mathlib.h" +#include #define FULLCIRCLE (M_PI * 2) diff --git a/src/lightmap/kexlib/math/bounds.cpp b/src/math/bounds.cpp similarity index 99% rename from src/lightmap/kexlib/math/bounds.cpp rename to src/math/bounds.cpp index 71d4a6c..f4be7c8 100644 --- a/src/lightmap/kexlib/math/bounds.cpp +++ b/src/math/bounds.cpp @@ -32,6 +32,7 @@ #include #include "mathlib.h" +#include // // kexBBox::kexBBox diff --git a/src/lightmap/kexlib/math/mathlib.cpp b/src/math/mathlib.cpp similarity index 98% rename from src/lightmap/kexlib/math/mathlib.cpp rename to src/math/mathlib.cpp index 5552e01..b8bc3fa 100644 --- a/src/lightmap/kexlib/math/mathlib.cpp +++ b/src/math/mathlib.cpp @@ -30,7 +30,6 @@ // //----------------------------------------------------------------------------- -#include "lightmap/common.h" #include "mathlib.h" // diff --git a/src/lightmap/kexlib/math/mathlib.h b/src/math/mathlib.h similarity index 99% rename from src/lightmap/kexlib/math/mathlib.h rename to src/math/mathlib.h index 8281ad2..fd96c7f 100644 --- a/src/lightmap/kexlib/math/mathlib.h +++ b/src/math/mathlib.h @@ -28,7 +28,7 @@ #pragma once #include -#include "lightmap/common.h" +#include #ifdef M_PI #undef M_PI diff --git a/src/lightmap/kexlib/math/matrix.cpp b/src/math/matrix.cpp similarity index 100% rename from src/lightmap/kexlib/math/matrix.cpp rename to src/math/matrix.cpp diff --git a/src/lightmap/kexlib/math/plane.cpp b/src/math/plane.cpp similarity index 100% rename from src/lightmap/kexlib/math/plane.cpp rename to src/math/plane.cpp diff --git a/src/lightmap/kexlib/math/pluecker.cpp b/src/math/pluecker.cpp similarity index 100% rename from src/lightmap/kexlib/math/pluecker.cpp rename to src/math/pluecker.cpp diff --git a/src/lightmap/kexlib/math/quaternion.cpp b/src/math/quaternion.cpp similarity index 100% rename from src/lightmap/kexlib/math/quaternion.cpp rename to src/math/quaternion.cpp diff --git a/src/lightmap/kexlib/math/random.cpp b/src/math/random.cpp similarity index 99% rename from src/lightmap/kexlib/math/random.cpp rename to src/math/random.cpp index 175a6b9..05b2fad 100644 --- a/src/lightmap/kexlib/math/random.cpp +++ b/src/math/random.cpp @@ -32,6 +32,7 @@ #include #include "mathlib.h" +#include #define RANDOM_MAX 0x7FFF diff --git a/src/lightmap/kexlib/math/vector.cpp b/src/math/vector.cpp similarity index 99% rename from src/lightmap/kexlib/math/vector.cpp rename to src/math/vector.cpp index 634ddbe..72758ad 100644 --- a/src/lightmap/kexlib/math/vector.cpp +++ b/src/math/vector.cpp @@ -32,6 +32,7 @@ #include #include "mathlib.h" +#include const kexVec3 kexVec3::vecRight(1, 0, 0); const kexVec3 kexVec3::vecUp(0, 0, 1);