- remove common.h

- move math classes
This commit is contained in:
Magnus Norddahl 2018-11-03 18:08:45 +01:00
parent 8fac445226
commit 265da537ab
25 changed files with 52 additions and 69 deletions

View file

@ -153,15 +153,15 @@ set( SOURCES
src/lightmap/collision.cpp src/lightmap/collision.cpp
src/lightmap/halffloat.cpp src/lightmap/halffloat.cpp
src/lightmap/kexlib/binfile.cpp src/lightmap/kexlib/binfile.cpp
src/lightmap/kexlib/math/angle.cpp src/math/angle.cpp
src/lightmap/kexlib/math/bounds.cpp src/math/bounds.cpp
src/lightmap/kexlib/math/mathlib.cpp src/math/mathlib.cpp
src/lightmap/kexlib/math/matrix.cpp src/math/matrix.cpp
src/lightmap/kexlib/math/plane.cpp src/math/plane.cpp
src/lightmap/kexlib/math/pluecker.cpp src/math/pluecker.cpp
src/lightmap/kexlib/math/quaternion.cpp src/math/quaternion.cpp
src/lightmap/kexlib/math/random.cpp src/math/random.cpp
src/lightmap/kexlib/math/vector.cpp src/math/vector.cpp
) )
if( WIN32 ) if( WIN32 )
set( SOURCES "${SOURCES}" src/viewer/view.cpp ) set( SOURCES "${SOURCES}" src/viewer/view.cpp )
@ -183,7 +183,6 @@ set( HEADERS
src/framework/templates.h src/framework/templates.h
src/framework/zdray.h src/framework/zdray.h
src/framework/xs_Float.h src/framework/xs_Float.h
src/lightmap/common.h
src/lightmap/lightmap.h src/lightmap/lightmap.h
src/lightmap/lightsurface.h src/lightmap/lightsurface.h
src/lightmap/mapdata.h src/lightmap/mapdata.h
@ -193,7 +192,7 @@ set( HEADERS
src/lightmap/collision.h src/lightmap/collision.h
src/lightmap/halffloat.h src/lightmap/halffloat.h
src/lightmap/kexlib/binfile.h src/lightmap/kexlib/binfile.h
src/lightmap/kexlib/math/mathlib.h src/math/mathlib.h
) )
if( SSE_MATTERS ) 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\\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\\Viewer" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/viewer/.+")
source_group("Sources\\Wad" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/src/wad/.+") 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" 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" 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/.+")

View file

@ -2,7 +2,7 @@
#pragma once #pragma once
#include "framework/tarray.h" #include "framework/tarray.h"
#include "lightmap/kexlib/math/mathlib.h" #include "math/mathlib.h"
#include "lightmap/collision.h" #include "lightmap/collision.h"
#include <memory> #include <memory>
#undef MIN #undef MIN

View file

@ -22,6 +22,11 @@
//#include "rejectbuilder.h" //#include "rejectbuilder.h"
#include <memory> #include <memory>
#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 LMDims;
extern int Samples; extern int Samples;

View file

@ -28,6 +28,11 @@ typedef unsigned int uint32;
typedef signed int int32; typedef signed int int32;
#include "framework/xs_Float.h" #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) static void CopyUDMFString(char *dest, int destlen, const char *udmfvalue)
{ {
destlen--; destlen--;

View file

@ -22,7 +22,7 @@
#pragma once #pragma once
#include "kexlib/math/mathlib.h" #include "math/mathlib.h"
#include <vector> #include <vector>
class SphereShape class SphereShape

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <cstdint>
#include <vector>
#include <limits.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
#include "kexlib/math/mathlib.h"

View file

@ -30,7 +30,6 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lightmap/common.h"
#include "lightmap/kexlib/binfile.h" #include "lightmap/kexlib/binfile.h"
typedef union typedef union

View file

@ -27,7 +27,7 @@
#pragma once #pragma once
#include "lightmap/kexlib/math/mathlib.h" #include "math/mathlib.h"
#include <string> #include <string>
class kexBinFile class kexBinFile

View file

@ -30,7 +30,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "common.h" #include "math/mathlib.h"
#include "surfaces.h" #include "surfaces.h"
#include "trace.h" #include "trace.h"
#include "mapdata.h" #include "mapdata.h"
@ -43,6 +43,11 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#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 int Multisample;
extern thread_local kexVec3 *colorSamples; extern thread_local kexVec3 *colorSamples;

View file

@ -32,7 +32,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "common.h" #include "math/mathlib.h"
#include "mapdata.h" #include "mapdata.h"
#include "trace.h" #include "trace.h"
#include "lightsurface.h" #include "lightsurface.h"

View file

@ -30,11 +30,16 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "common.h" #include "math/mathlib.h"
#include "mapdata.h" #include "mapdata.h"
#include "lightsurface.h" #include "lightsurface.h"
#include <algorithm> #include <algorithm>
#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 defaultSunColor(1, 1, 1);
static const kexVec3 defaultSunDirection(0.45f, 0.3f, 0.9f); static const kexVec3 defaultSunDirection(0.45f, 0.3f, 0.9f);

View file

@ -30,10 +30,15 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "common.h" #include "math/mathlib.h"
#include "mapdata.h" #include "mapdata.h"
#include "surfaces.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<surface_t*> surfaces; std::vector<surface_t*> surfaces;
static void CreateSideSurfaces(FLevel &doomMap, IntSideDef *side) static void CreateSideSurfaces(FLevel &doomMap, IntSideDef *side)

View file

@ -27,6 +27,8 @@
#pragma once #pragma once
#include <vector>
struct MapSubsectorEx; struct MapSubsectorEx;
enum surfaceType_t enum surfaceType_t

View file

@ -31,7 +31,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "common.h" #include "math/mathlib.h"
#include "mapdata.h" #include "mapdata.h"
#include "trace.h" #include "trace.h"

View file

@ -1,6 +1,6 @@
#include "worker.h" #include "worker.h"
#include "common.h" #include "math/mathlib.h"
#include <vector> #include <vector>
#include <thread> #include <thread>
#include <algorithm> #include <algorithm>

View file

@ -32,6 +32,7 @@
#include <math.h> #include <math.h>
#include "mathlib.h" #include "mathlib.h"
#include <assert.h>
#define FULLCIRCLE (M_PI * 2) #define FULLCIRCLE (M_PI * 2)

View file

@ -32,6 +32,7 @@
#include <math.h> #include <math.h>
#include "mathlib.h" #include "mathlib.h"
#include <assert.h>
// //
// kexBBox::kexBBox // kexBBox::kexBBox

View file

@ -30,7 +30,6 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lightmap/common.h"
#include "mathlib.h" #include "mathlib.h"
// //

View file

@ -28,7 +28,7 @@
#pragma once #pragma once
#include <math.h> #include <math.h>
#include "lightmap/common.h" #include <cstdint>
#ifdef M_PI #ifdef M_PI
#undef M_PI #undef M_PI

View file

@ -32,6 +32,7 @@
#include <math.h> #include <math.h>
#include "mathlib.h" #include "mathlib.h"
#include <cstdlib>
#define RANDOM_MAX 0x7FFF #define RANDOM_MAX 0x7FFF

View file

@ -32,6 +32,7 @@
#include <math.h> #include <math.h>
#include "mathlib.h" #include "mathlib.h"
#include <assert.h>
const kexVec3 kexVec3::vecRight(1, 0, 0); const kexVec3 kexVec3::vecRight(1, 0, 0);
const kexVec3 kexVec3::vecUp(0, 0, 1); const kexVec3 kexVec3::vecUp(0, 0, 1);