Skip to content

Commit

Permalink
Header stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jun 10, 2024
1 parent 87c86b0 commit daebe4b
Show file tree
Hide file tree
Showing 52 changed files with 187 additions and 364 deletions.
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ project(
VERSION 0.1.0
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

string(TIMESTAMP BUILD_TIMESTAMP "%Y.%m.%d" UTC)
add_compile_definitions(OBSIDIAN_TIMESTAMP="${BUILD_TIMESTAMP}")

if(CONSOLE_ONLY)
add_compile_definitions(CONSOLE_ONLY=1)
add_compile_definitions(CONSOLE_ONLY)
endif()
if(WIN32)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
add_compile_definitions(UNICODE)
add_compile_definitions(_UNICODE)
elseif(NOT APPLE AND NOT CONSOLE_ONLY)
add_compile_definitions(USE_XFT)
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(MSVC)
# get the number of logical cores for parallel build
cmake_host_system_information(RESULT LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES)
Expand Down
2 changes: 1 addition & 1 deletion source/bsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool ValidateMapName(char *name)
// Ok, convert to upper case
for (char *s = name; *s; s++)
{
*s = toupper(*s);
*s = ToUpperASCII(*s);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion source/bsp_wad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static bool IsDummyMarker(const char *name)
if (strlen(name) < 3)
return false;

if (!strchr("PSF", toupper(name[0])))
if (!strchr("PSF", ToUpperASCII(name[0])))
return false;

if (!isdigit(name[1]))
Expand Down
2 changes: 1 addition & 1 deletion source/csg_bsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include "hdr_fltk.h"
#endif
#include "hdr_lua.h"
#include "headers.h"
#include "lib_util.h"
#include "m_lua.h"
#include "main.h"
#include "sys_assert.h"
#include "sys_macro.h"

double QUANTIZE_GRID;
Expand Down
7 changes: 3 additions & 4 deletions source/csg_doom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include "hdr_fltk.h"
#include "hdr_ui.h" // ui_build.h
#endif
#include "headers.h"
#include "lib_util.h"
#include "main.h"
#include "sys_assert.h"
#include "sys_macro.h"

// Properties
Expand Down Expand Up @@ -841,8 +841,8 @@ template <> struct hash<Doom::vertex_map_key_s>
size_t operator()(const Doom::vertex_map_key_s &k) const
{
size_t h = 0;
h ^= std::hash<int>()(k.x);
h ^= std::hash<int>()(k.y);
h ^= IntHash(k.x);
h ^= IntHash(k.y);
return h;
}
};
Expand Down Expand Up @@ -3168,7 +3168,6 @@ static void WriteFraggleScript()

void FreeStuff()
{
// This is erroring out right now
std::for_each(vertices.begin(), vertices.end(), [](auto *i) { delete i; });
std::for_each(linedefs.begin(), linedefs.end(), [](auto *i) { delete i; });
std::for_each(sidedefs.begin(), sidedefs.end(), [](auto *i) { delete i; });
Expand Down
3 changes: 2 additions & 1 deletion source/csg_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
#include "hdr_fltk.h"
#endif
#include "hdr_lua.h"
#include "headers.h"
#include "lib_util.h"
#include "m_lua.h"
#include "main.h"
#include "sys_assert.h"
#include "sys_macro.h"

#define EPSILON 0.001

Expand Down
2 changes: 1 addition & 1 deletion source/csg_shade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include "hdr_ui.h"
#endif
#include "hdr_lua.h"
#include "headers.h"
#include "lib_argv.h"
#include "lib_util.h"
#include "main.h"
#include "sys_macro.h"

/*
Expand Down
9 changes: 3 additions & 6 deletions source/csg_spots.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
//----------------------------------------------------------------------

#include "hdr_lua.h"
#include "headers.h"
#include "lib_argv.h"
#include "lib_util.h"
#include "main.h"

#ifdef WIN32
#include <iso646.h>
#endif
#include "sys_assert.h"
#include "sys_macro.h"

#define GRID_SIZE 20

Expand Down Expand Up @@ -311,7 +308,7 @@ static void remove_dud_cells()

static bool test_mon_area(int x1, int y1, int x2, int y2, int want)
{
if (x1 < 0 or x2 >= grid_W or y1 < 0 or y2 >= grid_H)
if (x1 < 0 || x2 >= grid_W || y1 < 0 || y2 >= grid_H)
{
return false;
}
Expand Down
6 changes: 4 additions & 2 deletions source/dm_extra.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "hdr_ui.h"
#endif
#include "hdr_lua.h"
#include "headers.h"
#include "images.h"
#include "lib_tga.h"
#include "lib_util.h"
Expand All @@ -35,6 +34,9 @@
#include "m_lua.h"
#include "main.h"
#include "physfs.h"
#include "sys_assert.h"
#include "sys_endian.h"
#include "sys_macro.h"
#include "tx_forge.h"
#include "tx_skies.h"

Expand Down Expand Up @@ -656,7 +658,7 @@ int fsky_add_hills(lua_State *L)

static int FontIndexForChar(char ch)
{
ch = toupper(ch);
ch = ToUpperASCII(ch);

if (ch == ' ')
{
Expand Down
3 changes: 2 additions & 1 deletion source/dm_prefab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
#include "hdr_ui.h"
#endif
#include "hdr_lua.h"
#include "headers.h"
#include "lib_util.h"
#include "lib_wad.h"
#include "m_lua.h"
#include "main.h"
#include "physfs.h"
#include "sys_assert.h"
#include "sys_macro.h"

// callbacks for AJ-Polygonator

Expand Down
Loading

0 comments on commit daebe4b

Please sign in to comment.