- actually compile the game code as larger units and integrate them in the main project.

This eliminates the problematic subprojects for good.
Compiling the games as larger units is necessary because otherwise compile times will break down on MSVC.
This commit is contained in:
Christoph Oelckers 2021-01-04 11:45:50 +01:00
parent e866a9e0c0
commit 0f3da7194a
12 changed files with 378 additions and 252 deletions

View file

@ -1025,6 +1025,14 @@ set (PCH_SOURCES
core/menu/loadsavemenu.cpp core/menu/loadsavemenu.cpp
core/menu/razemenu.cpp core/menu/razemenu.cpp
#Duke is split because Duke and RR need different constants.
games/duke/all.cpp
games/duke/all_d.cpp
games/duke/all_r.cpp
exhumed/all.cpp
blood/all.cpp
sw/all.cpp
) )
if( ${HAVE_VM_JIT} ) if( ${HAVE_VM_JIT} )
@ -1094,7 +1102,7 @@ if( UNIX )
endif() endif()
endif() endif()
target_link_libraries( ${PROJECT_NAME} ${PROJECT_LIBRARIES} ${ZMUSIC_LIBRARIES} gdtoa lzma duke blood sw exhumed ) target_link_libraries( ${PROJECT_NAME} ${PROJECT_LIBRARIES} ${ZMUSIC_LIBRARIES} gdtoa lzma )
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@ -1353,8 +1361,3 @@ require_strnicmp()
unset( PCH_SOURCES ) unset( PCH_SOURCES )
unset( HEADER_FILES ) unset( HEADER_FILES )
unset( NOT_COMPILED_SOURCE_FILES ) unset( NOT_COMPILED_SOURCE_FILES )
add_subdirectory( games/duke )
add_subdirectory( blood )
add_subdirectory( sw )
add_subdirectory( exhumed )

View file

@ -1,72 +0,0 @@
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOONE_EXTENSIONS" )
set( PCH_SOURCES
src/actor.cpp
src/ai.cpp
src/aibat.cpp
src/aibeast.cpp
src/aiboneel.cpp
src/aiburn.cpp
src/aicaleb.cpp
src/aicerber.cpp
src/aicult.cpp
src/aigarg.cpp
src/aighost.cpp
src/aigilbst.cpp
src/aihand.cpp
src/aihound.cpp
src/aiinnoc.cpp
src/aipod.cpp
src/airat.cpp
src/aispid.cpp
src/aitchern.cpp
src/aiunicult.cpp
src/aizomba.cpp
src/aizombf.cpp
src/animatesprite.cpp
src/asound.cpp
src/barf.cpp
src/blood.cpp
src/callback.cpp
src/choke.cpp
src/controls.cpp
src/credits.cpp
src/db.cpp
src/dude.cpp
src/endgame.cpp
src/eventq.cpp
src/fire.cpp
src/fx.cpp
src/gameutil.cpp
src/gib.cpp
src/globals.cpp
src/hudsprites.cpp
src/inifile.cpp
src/levels.cpp
src/loadsave.cpp
src/messages.cpp
src/mirrors.cpp
src/misc.cpp
src/nnexts.cpp
src/osdcmd.cpp
src/player.cpp
src/prediction.cpp
src/preload.cpp
src/qav.cpp
src/replace.cpp
src/sbar.cpp
src/sectorfx.cpp
src/seq.cpp
src/sfx.cpp
src/sound.cpp
src/tile.cpp
src/trig.cpp
src/triggers.cpp
src/view.cpp
src/warp.cpp
src/weapon.cpp
src/d_menu.cpp
)
add_game_library( blood )

70
source/blood/all.cpp Normal file
View file

@ -0,0 +1,70 @@
#ifndef NOONE_EXTENSIONS
#define NOONE_EXTENSIONS
#endif
#include "src/actor.cpp"
#include "src/ai.cpp"
#include "src/aibat.cpp"
#include "src/aibeast.cpp"
#include "src/aiboneel.cpp"
#include "src/aiburn.cpp"
#include "src/aicaleb.cpp"
#include "src/aicerber.cpp"
#include "src/aicult.cpp"
#include "src/aigarg.cpp"
#include "src/aighost.cpp"
#include "src/aigilbst.cpp"
#include "src/aihand.cpp"
#include "src/aihound.cpp"
#include "src/aiinnoc.cpp"
#include "src/aipod.cpp"
#include "src/airat.cpp"
#include "src/aispid.cpp"
#include "src/aitchern.cpp"
#include "src/aiunicult.cpp"
#include "src/aizomba.cpp"
#include "src/aizombf.cpp"
#include "src/animatesprite.cpp"
#include "src/asound.cpp"
#include "src/barf.cpp"
#include "src/blood.cpp"
#include "src/callback.cpp"
#include "src/choke.cpp"
#include "src/controls.cpp"
#include "src/credits.cpp"
#include "src/db.cpp"
#include "src/dude.cpp"
#include "src/endgame.cpp"
#include "src/eventq.cpp"
#include "src/fire.cpp"
#include "src/fx.cpp"
#include "src/gameutil.cpp"
#include "src/gib.cpp"
#include "src/globals.cpp"
#include "src/hudsprites.cpp"
#include "src/inifile.cpp"
#include "src/levels.cpp"
#include "src/loadsave.cpp"
#include "src/messages.cpp"
#include "src/mirrors.cpp"
#include "src/misc.cpp"
#include "src/nnexts.cpp"
#include "src/osdcmd.cpp"
#include "src/player.cpp"
#include "src/prediction.cpp"
#include "src/preload.cpp"
#include "src/qav.cpp"
#include "src/replace.cpp"
#include "src/sbar.cpp"
#include "src/sectorfx.cpp"
#include "src/seq.cpp"
#include "src/sfx.cpp"
#include "src/sound.cpp"
#include "src/tile.cpp"
#include "src/trig.cpp"
#include "src/triggers.cpp"
#include "src/view.cpp"
#include "src/warp.cpp"
#include "src/weapon.cpp"
// This includes the VM so it is last
#include "src/d_menu.cpp"

139
source/core/def_.cpp Normal file
View file

@ -0,0 +1,139 @@
/*
** def.cpp
** Rewritten .def parser free of Build license restrictions.
**
**---------------------------------------------------------------------------
** Copyright 2020 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFf
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include "build.h"
#include "compat.h"
#include "mdsprite.h" // md3model_t
#include "buildtiles.h"
#include "bitmap.h"
#include "m_argv.h"
#include "gamecontrol.h"
#include "palettecontainer.h"
#include "mapinfo.h"
#include "sc_man.h"
bool ParseDefFile(const char* file, FScanner *parent)
{
int lump = fileSystem.FindFile(file);
bool success = false;
if (lump == -1)
{
if (!parent) Printf(PRINT_BOLD, "%sd: file not found\n", file);
else parent->ScriptError("%s: file not found\n", file);
return false;
}
FScanner sc;
if (parent) sc.symbols = std::move(parent->symbols); // the child parser needs to add to the parent's symbol table so transfer its ownership for the parsing run.
sc.OpenLumpNum(lump);
sc.SetCMode(true);
sc.SetNoOctals(true);
sc.SetNoFatalErrors(true);
FString str;
while (sc.GetString())
{
if (sc.Compare({"#include", "include"}))
{
if (!sc.MustGetString())
ParseDefFile(sc.String, &sc);
}
else if (sc.Compare({"#includedefault", "includedefault"}))
{
ParseDefFile(G_DefaultDefFile(), &sc);
}
else if (sc.Compare({"#define", "define"}))
{
parseDefine(sc);
}
else if (sc.Compare("definetexture"))
{
parseDefineTexture(sc);
}
else if (sc.Compare("defineskybox"))
{
parseDefineSkybox(sc);
}
else if (sc.Compare("definetint"))
{
parseDefineTint(sc);
}
else if (sc.Compare("alphahack")) // why 'hack'?
{
parseAlphaHack(sc);
}
else if (sc.Compare("alphahackrange")) // why 'hack'?
{
parseAlphaHackRange(sc);
}
if (sc.Compare({"spritecol", "2dcolidxrange")) // only used by Mapster32 so just read over them and ignore the result
{
parseDiscard<3>(sc);
}
else if (sc.Compare("2dcol")) // same here
{
parseDiscard<4>(sc);
}
else if (sc.Compare("fogpal"))
{
parseFogPal(sc);
}
else if (sc.Compare("nofloorpalrange"))
{
parseNoFloorpalRange(sc);
}
else if (sc.Compare("loadgrp"))
{
parseLoadGrp(sc);
}
else if (sc.Compare("cachesize") || sc.Compare("shadefactor"))
{
parseDiscard<1>(sc);
}
else if (sc.Compare("artfile"))
{
parseArtFile(sc);
}
}
success = true;
if (parent) parent->symbols = std::move(sc.symbols);
return success;
}

View file

@ -1,54 +0,0 @@
set( PCH_SOURCES
src/2d.cpp
src/anims.cpp
src/anubis.cpp
src/bubbles.cpp
src/bullet.cpp
src/cd.cpp
src/cheats.cpp
src/enginesubs.cpp
src/exhumed.cpp
src/fish.cpp
src/gameloop.cpp
src/grenade.cpp
src/gun.cpp
src/init.cpp
src/input.cpp
src/items.cpp
src/lavadude.cpp
src/light.cpp
src/lighting.cpp
src/lion.cpp
src/map.cpp
src/menu.cpp
src/move.cpp
src/movie.cpp
src/mummy.cpp
src/object.cpp
src/osdcmds.cpp
src/player.cpp
src/queen.cpp
src/ra.cpp
src/ramses.cpp
src/random.cpp
src/rat.cpp
src/rex.cpp
src/roach.cpp
src/runlist.cpp
src/save.cpp
src/scorp.cpp
src/sequence.cpp
src/set.cpp
src/snake.cpp
src/sound.cpp
src/spider.cpp
src/status.cpp
src/switch.cpp
src/trigdat.cpp
src/view.cpp
src/wasp.cpp
src/d_menu.cpp
)
add_game_library( exhumed )

50
source/exhumed/all.cpp Normal file
View file

@ -0,0 +1,50 @@
#include "src/2d.cpp"
#include "src/anims.cpp"
#include "src/anubis.cpp"
#include "src/bubbles.cpp"
#include "src/bullet.cpp"
#include "src/cd.cpp"
#include "src/cheats.cpp"
#include "src/enginesubs.cpp"
#include "src/exhumed.cpp"
#include "src/fish.cpp"
#include "src/gameloop.cpp"
#include "src/grenade.cpp"
#include "src/gun.cpp"
#include "src/init.cpp"
#include "src/input.cpp"
#include "src/items.cpp"
#include "src/lavadude.cpp"
#include "src/light.cpp"
#include "src/lighting.cpp"
#include "src/lion.cpp"
#include "src/map.cpp"
#include "src/menu.cpp"
#include "src/move.cpp"
#include "src/movie.cpp"
#include "src/mummy.cpp"
#include "src/object.cpp"
#include "src/osdcmds.cpp"
#include "src/player.cpp"
#include "src/queen.cpp"
#include "src/ra.cpp"
#include "src/ramses.cpp"
#include "src/random.cpp"
#include "src/rat.cpp"
#include "src/rex.cpp"
#include "src/roach.cpp"
#include "src/runlist.cpp"
#include "src/save.cpp"
#include "src/scorp.cpp"
#include "src/sequence.cpp"
#include "src/set.cpp"
#include "src/snake.cpp"
#include "src/sound.cpp"
#include "src/spider.cpp"
#include "src/status.cpp"
#include "src/switch.cpp"
#include "src/trigdat.cpp"
#include "src/view.cpp"
#include "src/wasp.cpp"
// This includes the VM so it is last
#include "src/d_menu.cpp"

View file

@ -1,53 +0,0 @@
set( PCH_SOURCES
src/2d_d.cpp
src/2d_r.cpp
src/actors.cpp
src/actors_r.cpp
src/actors_d.cpp
src/actors_lava.cpp
src/animatesprites_r.cpp
src/animatesprites_d.cpp
src/bowling.cpp
src/ccmds.cpp
src/cheats.cpp
src/d_menu.cpp
src/dispatch.cpp
src/flags_d.cpp
src/flags_r.cpp
src/game.cpp
src/game_misc.cpp
src/gamedef.cpp
src/gameexec.cpp
src/gameloop.cpp
src/gamevar.cpp
src/global.cpp
src/hudweapon_d.cpp
src/hudweapon_r.cpp
src/input.cpp
src/noise.cpp
src/player.cpp
src/player_d.cpp
src/player_r.cpp
src/player_w.cpp
src/premap.cpp
src/premap_d.cpp
src/premap_r.cpp
src/prediction.cpp
src/render.cpp
src/savegame.cpp
src/sbar.cpp
src/sbar_d.cpp
src/sbar_r.cpp
src/sectors.cpp
src/sectors_d.cpp
src/sectors_r.cpp
src/sounds.cpp
src/spawn.cpp
src/spawn_d.cpp
src/spawn_r.cpp
)
add_game_library2( duke )
include_directories( src )

21
source/games/duke/all.cpp Normal file
View file

@ -0,0 +1,21 @@
#include "src/actors.cpp"
#include "src/ccmds.cpp"
#include "src/cheats.cpp"
#include "src/d_menu.cpp"
#include "src/dispatch.cpp"
#include "src/game.cpp"
#include "src/game_misc.cpp"
#include "src/gamedef.cpp"
#include "src/gameexec.cpp"
#include "src/gameloop.cpp"
#include "src/global.cpp"
#include "src/input.cpp"
#include "src/noise.cpp"
#include "src/player.cpp"
#include "src/premap.cpp"
#include "src/prediction.cpp"
#include "src/render.cpp"
#include "src/savegame.cpp"
#include "src/sbar.cpp"
#include "src/sectors.cpp"
#include "src/spawn.cpp"

View file

@ -0,0 +1,15 @@
#include "src/2d_d.cpp"
#include "src/actors_d.cpp"
#include "src/animatesprites_d.cpp"
#include "src/flags_d.cpp"
#include "src/hudweapon_d.cpp"
#include "src/player_d.cpp"
#include "src/player_w.cpp"
#include "src/premap_d.cpp"
#include "src/sbar_d.cpp"
#include "src/sectors_d.cpp"
#include "src/spawn_d.cpp"
// These global files include names_d.h!
#include "src/sounds.cpp"
#include "src/gamevar.cpp"

View file

@ -0,0 +1,12 @@
#include "src/2d_r.cpp"
#include "src/actors_r.cpp"
#include "src/actors_lava.cpp"
#include "src/animatesprites_r.cpp"
#include "src/bowling.cpp"
#include "src/flags_r.cpp"
#include "src/hudweapon_r.cpp"
#include "src/player_r.cpp"
#include "src/premap_r.cpp"
#include "src/sbar_r.cpp"
#include "src/sectors_r.cpp"
#include "src/spawn_r.cpp"

View file

@ -1,67 +0,0 @@
set( PCH_SOURCES
src/2d.cpp
src/actor.cpp
src/ai.cpp
src/break.cpp
src/bunny.cpp
src/cache.cpp
src/cheats.cpp
src/colormap.cpp
src/coolg.cpp
src/coolie.cpp
src/copysect.cpp
src/draw.cpp
src/eel.cpp
src/game.cpp
src/girlninj.cpp
src/goro.cpp
src/hornet.cpp
src/input.cpp
src/interpso.cpp
src/inv.cpp
src/jsector.cpp
src/jweapon.cpp
src/lava.cpp
src/light.cpp
src/mclip.cpp
src/menus.cpp
src/miscactr.cpp
src/morph.cpp
src/network.cpp
src/ninja.cpp
src/osdcmds.cpp
src/panel.cpp
src/player.cpp
src/predict.cpp
src/quake.cpp
src/ripper.cpp
src/ripper2.cpp
src/rooms.cpp
src/rotator.cpp
src/save.cpp
src/saveable.cpp
src/sbar.cpp
src/scrip2.cpp
src/sector.cpp
src/serp.cpp
src/skel.cpp
src/skull.cpp
src/slidor.cpp
src/sounds.cpp
src/spike.cpp
src/sprite.cpp
src/sumo.cpp
src/text.cpp
src/track.cpp
src/vator.cpp
src/vis.cpp
src/wallmove.cpp
src/warp.cpp
src/weapon.cpp
src/zilla.cpp
src/zombie.cpp
src/d_menu.cpp
)
add_game_library( sw )

62
source/sw/all.cpp Normal file
View file

@ -0,0 +1,62 @@
#include "src/2d.cpp"
#include "src/actor.cpp"
#include "src/ai.cpp"
#include "src/break.cpp"
#include "src/bunny.cpp"
#include "src/cache.cpp"
#include "src/cheats.cpp"
#include "src/colormap.cpp"
#include "src/coolg.cpp"
#include "src/coolie.cpp"
#include "src/copysect.cpp"
#include "src/draw.cpp"
#include "src/eel.cpp"
#include "src/game.cpp"
#include "src/girlninj.cpp"
#include "src/goro.cpp"
#include "src/hornet.cpp"
#include "src/input.cpp"
#include "src/interpso.cpp"
#include "src/inv.cpp"
#include "src/jsector.cpp"
#include "src/jweapon.cpp"
#include "src/lava.cpp"
#include "src/light.cpp"
#include "src/mclip.cpp"
#include "src/menus.cpp"
#include "src/miscactr.cpp"
#include "src/morph.cpp"
#include "src/network.cpp"
#include "src/ninja.cpp"
#include "src/osdcmds.cpp"
#include "src/panel.cpp"
#include "src/player.cpp"
#include "src/predict.cpp"
#include "src/quake.cpp"
#include "src/ripper.cpp"
#include "src/ripper2.cpp"
#include "src/rooms.cpp"
#include "src/rotator.cpp"
#include "src/save.cpp"
#include "src/saveable.cpp"
#include "src/sbar.cpp"
#include "src/scrip2.cpp"
#include "src/sector.cpp"
#include "src/serp.cpp"
#include "src/skel.cpp"
#include "src/skull.cpp"
#include "src/slidor.cpp"
#include "src/sounds.cpp"
#include "src/spike.cpp"
#include "src/sprite.cpp"
#include "src/sumo.cpp"
#include "src/text.cpp"
#include "src/track.cpp"
#include "src/vator.cpp"
#include "src/vis.cpp"
#include "src/wallmove.cpp"
#include "src/warp.cpp"
#include "src/weapon.cpp"
#include "src/zilla.cpp"
#include "src/zombie.cpp"
#include "src/d_menu.cpp"