Skip to content

Commit

Permalink
More source consolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jun 9, 2024
1 parent d26248e commit 92753ac
Show file tree
Hide file tree
Showing 107 changed files with 2,386 additions and 3,553 deletions.
121 changes: 60 additions & 61 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.12..3.20)

add_subdirectory(source_files/ajbsp EXCLUDE_FROM_ALL)
if(NOT CONSOLE_ONLY)
add_subdirectory(libraries/fltk EXCLUDE_FROM_ALL)
endif()
Expand Down Expand Up @@ -49,57 +48,63 @@ if(${CMAKE_SYSTEM} MATCHES "OpenBSD")
endif()

set(OBSIDIAN_SOURCE_FILES
source_files/obsidian_main/aj_map.cc
source_files/obsidian_main/aj_poly.cc
source_files/obsidian_main/aj_util.cc
source_files/obsidian_main/aj_wad.cc
source_files/obsidian_main/csg_bsp.cc
source_files/obsidian_main/csg_doom.cc
source_files/obsidian_main/csg_main.cc
source_files/obsidian_main/csg_shade.cc
source_files/obsidian_main/csg_spots.cc
source_files/obsidian_main/dm_extra.cc
source_files/obsidian_main/dm_prefab.cc
source_files/obsidian_main/g_doom.cc
source_files/obsidian_main/g_wolf.cc
source_files/obsidian_main/lib_argv.cc
source_files/obsidian_main/lib_tga.cc
source_files/obsidian_main/lib_util.cc
source_files/obsidian_main/lib_wad.cc
source_files/obsidian_main/lib_zip.cc
source_files/obsidian_main/lib_parse.cc
source_files/obsidian_main/m_addons.cc
source_files/obsidian_main/m_cookie.cc
source_files/obsidian_main/m_lua.cc
source_files/obsidian_main/m_options.cc
source_files/obsidian_main/m_trans.cc
source_files/obsidian_main/main.cc
source_files/obsidian_main/obsidian.rc
source_files/obsidian_main/slump_dump.cc
source_files/obsidian_main/slump_main.cc
source_files/obsidian_main/slump.cc
source_files/obsidian_main/sys_assert.cc
source_files/obsidian_main/sys_debug.cc
source_files/obsidian_main/sys_xoshiro.cc
source_files/obsidian_main/tx_forge.cc
source_files/obsidian_main/tx_skies.cc
source/bsp_level.cc
source/bsp_misc.cc
source/bsp_node.cc
source/bsp_utility.cc
source/bsp_wad.cc
source/bsp.cc
source/csg_bsp.cc
source/csg_doom.cc
source/csg_main.cc
source/csg_shade.cc
source/csg_spots.cc
source/dm_extra.cc
source/dm_prefab.cc
source/g_doom.cc
source/g_wolf.cc
source/lib_argv.cc
source/lib_tga.cc
source/lib_util.cc
source/lib_wad.cc
source/lib_zip.cc
source/lib_parse.cc
source/m_addons.cc
source/m_cookie.cc
source/m_lua.cc
source/m_options.cc
source/m_trans.cc
source/main.cc
source/obsidian.rc
source/poly_map.cc
source/poly.cc
source/poly_util.cc
source/poly_wad.cc
source/slump_dump.cc
source/slump_main.cc
source/slump.cc
source/sys_assert.cc
source/sys_debug.cc
source/sys_xoshiro.cc
source/tx_forge.cc
source/tx_skies.cc
)

if (NOT CONSOLE_ONLY)
set(OBSIDIAN_SOURCE_FILES
${OBSIDIAN_SOURCE_FILES}
source_files/obsidian_main/m_about.cc
source_files/obsidian_main/m_dialog.cc
source_files/obsidian_main/m_manage.cc
source_files/obsidian_main/m_theme.cc
source_files/obsidian_main/ui_boxes.cc
source_files/obsidian_main/ui_build.cc
source_files/obsidian_main/ui_game.cc
source_files/obsidian_main/ui_hyper.cc
source_files/obsidian_main/ui_map.cc
source_files/obsidian_main/ui_module.cc
source_files/obsidian_main/ui_widgets.cc
source_files/obsidian_main/ui_window.cc
source/m_about.cc
source/m_dialog.cc
source/m_manage.cc
source/m_theme.cc
source/ui_boxes.cc
source/ui_build.cc
source/ui_game.cc
source/ui_hyper.cc
source/ui_map.cc
source/ui_module.cc
source/ui_widgets.cc
source/ui_window.cc
)
endif()

Expand All @@ -108,7 +113,6 @@ add_executable(
${OBSIDIAN_SOURCE_FILES}
)

target_include_directories(obsidian SYSTEM PRIVATE source_files/ajbsp)
if(NOT CONSOLE_ONLY)
target_include_directories(obsidian SYSTEM PRIVATE libraries/fltk)
target_include_directories(
Expand Down Expand Up @@ -144,8 +148,7 @@ if(UNIX)
if(NOT CONSOLE_ONLY)
target_link_libraries(
obsidian
PRIVATE ajbsp
filename_formatter
PRIVATE filename_formatter
fltk
fltk_images
libgrapheme
Expand All @@ -158,15 +161,14 @@ if(UNIX)
)
else()
target_link_libraries(
obsidian PRIVATE ajbsp filename_formatter libgrapheme miniz physfs-static
obsidian PRIVATE filename_formatter libgrapheme miniz physfs-static
)
endif()
elseif(${CMAKE_SYSTEM} MATCHES "BSD")
if(NOT CONSOLE_ONLY)
target_link_libraries(
obsidian
PRIVATE ajbsp
filename_formatter
PRIVATE filename_formatter
fltk
fltk_images
libgrapheme
Expand All @@ -175,15 +177,14 @@ if(UNIX)
)
else()
target_link_libraries(
obsidian PRIVATE ajbsp filename_formatter libgrapheme miniz physfs-static
obsidian PRIVATE filename_formatter libgrapheme miniz physfs-static
)
endif()
else()
if(NOT CONSOLE_ONLY)
target_link_libraries(
obsidian
PRIVATE ajbsp
filename_formatter
PRIVATE filename_formatter
fltk
fltk_images
libgrapheme
Expand All @@ -195,8 +196,7 @@ if(UNIX)
else()
target_link_libraries(
obsidian
PRIVATE ajbsp
filename_formatter
PRIVATE filename_formatter
libgrapheme
miniz
physfs-static
Expand All @@ -208,8 +208,7 @@ else()
if(NOT CONSOLE_ONLY)
target_link_libraries(
obsidian
PRIVATE ajbsp
filename_formatter
PRIVATE filename_formatter
fltk
fltk_images
libgrapheme
Expand All @@ -218,7 +217,7 @@ else()
)
else()
target_link_libraries(
obsidian PRIVATE ajbsp filename_formatter libgrapheme miniz physfs-static
obsidian PRIVATE filename_formatter libgrapheme miniz physfs-static
)
endif()
endif()
14 changes: 6 additions & 8 deletions source_files/ajbsp/ajbsp.cc → source/bsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
//
//------------------------------------------------------------------------

#include "system.h"
#include "aj_bsp.h"
#include "utility.h"
#include "wad.h"

// this is only needed for CheckTypeSizes
#include "bsp.h"
#include "bsp_utility.h"
#include "bsp_wad.h"
#include "lib_util.h"
#include "raw_def.h"

bool opt_backup = false;
Expand Down Expand Up @@ -277,7 +275,7 @@ void ParseMapList(const char *from_arg, buildinfo_t *build_info)
{
// create a mutable copy of the string
// [ we will keep long-term pointers into this buffer ]
char *buf = ajbsp::StringDup(from_arg);
char *buf = CStringDup(from_arg);

char *arg = buf;

Expand Down Expand Up @@ -346,7 +344,7 @@ int AJBSP_BuildNodes(std::string filename, buildinfo_t *build_info)
ShowBanner();

// validate file before processing it
if (! ajbsp::FileExists(filename))
if (!FileExists(filename))
build_info->FatalError("no such file: %s\n", filename.c_str());

VisitFile(filename, build_info);
Expand Down
2 changes: 2 additions & 0 deletions source_files/ajbsp/aj_bsp.h → source/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#ifndef __AJBSP_BSP_H__
#define __AJBSP_BSP_H__

#include <string>

#define AJBSP_VERSION "1.05"

//
Expand Down
Loading

0 comments on commit 92753ac

Please sign in to comment.