diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ae9265ab..55408d4fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -595,7 +595,6 @@ file( GLOB HEADER_FILES sound/backend/*.h* posix/*.h r_data/*.h - r_data/models/*.h common/audio/sound/thirdparty/*.h common/audio/sound/*.h common/audio/music/*.h* @@ -610,6 +609,7 @@ file( GLOB HEADER_FILES common/platform/posix/cocoa/*.h common/platform/posix/sdl/*.h common/platform/win32/*.h + common/models/*.h common/textures/*.h common/textures/hires/hqnx/*.h common/textures/hires/hqnx_asm/*.h @@ -996,19 +996,12 @@ set (PCH_SOURCES r_data/r_translate.cpp r_data/sprites.cpp r_data/portalgroups.cpp - r_data/voxels.cpp r_data/voxeldef.cpp r_data/r_canvastexture.cpp r_data/r_interpolate.cpp r_data/r_vanillatrans.cpp r_data/r_sections.cpp - r_data/models/models_md3.cpp - r_data/models/models_md2.cpp - r_data/models/models_voxel.cpp - r_data/models/models_ue1.cpp - r_data/models/models_obj.cpp - r_data/models/models.cpp - r_data/models/model.cpp + r_data/models.cpp scripting/vmiterators.cpp scripting/vmthunks.cpp scripting/vmthunks_actors.cpp @@ -1076,6 +1069,13 @@ set (PCH_SOURCES common/textures/formats/tgatexture.cpp common/textures/formats/stbtexture.cpp common/textures/hires/hqresize.cpp + common/models/models_md3.cpp + common/models/models_md2.cpp + common/models/models_voxel.cpp + common/models/models_ue1.cpp + common/models/models_obj.cpp + common/models/model.cpp + common/models/voxels.cpp common/console/c_commandline.cpp common/console/c_buttons.cpp common/console/c_bind.cpp @@ -1249,6 +1249,7 @@ include_directories( . common/textures/formats common/textures/hires common/textures + common/models common/filesystem common/utility common/console @@ -1441,7 +1442,6 @@ source_group("Rendering\\Poly Renderer\\Math" REGULAR_EXPRESSION "^${CMAKE_CURRE source_group("Rendering\\Poly Renderer\\Drawers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rendering/polyrenderer/drawers/.+") source_group("Rendering\\Poly Renderer\\Backend" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rendering/polyrenderer/backend/.+") source_group("Render Data" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/r_data/.+") -source_group("Render Data\\Models" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/r_data/models/.+") source_group("Render Interface" FILES r_defs.h r_renderer.h r_sky.cpp r_sky.h r_state.h r_utility.cpp r_utility.h) source_group("Platforms\\POSIX Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/.+") source_group("Platforms\\Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+") @@ -1480,6 +1480,7 @@ source_group("Common\\Rendering\\Hardware Renderer\\Data" REGULAR_EXPRESSION "^$ source_group("Common\\Rendering\\Hardware Renderer\\Postprocessing" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/hwrenderer/postprocessing/.+") source_group("Common\\Rendering\\OpenGL Loader" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/gl_load/.+") source_group("Common\\Rendering\\OpenGL Backend" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/gl/.+") +source_group("Common\\Models" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/models/.+") source_group("Common\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/textures/.+") source_group("Common\\Textures\\Hires" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/textures/hires/.+") source_group("Common\\Textures\\Hires\\HQ Resize" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/textures/hires/hqnx/.+") diff --git a/src/r_data/models/model.cpp b/src/common/models/model.cpp similarity index 96% rename from src/r_data/models/model.cpp rename to src/common/models/model.cpp index 8c5ce7a80..bd5d9ced9 100644 --- a/src/r_data/models/model.cpp +++ b/src/common/models/model.cpp @@ -31,12 +31,12 @@ #include "sc_man.h" #include "m_crc32.h" #include "printf.h" -#include "r_data/models/models.h" -#include "r_data/models/model_ue1.h" -#include "r_data/models/model_obj.h" -#include "r_data/models/model_md2.h" -#include "r_data/models/model_md3.h" -#include "r_data/models/model_kvx.h" +#include "models.h" +#include "model_ue1.h" +#include "model_obj.h" +#include "model_md2.h" +#include "model_md3.h" +#include "model_kvx.h" #include "i_time.h" #include "texturemanager.h" #include "modelrenderer.h" diff --git a/src/r_data/models/model.h b/src/common/models/model.h similarity index 100% rename from src/r_data/models/model.h rename to src/common/models/model.h diff --git a/src/r_data/models/model_kvx.h b/src/common/models/model_kvx.h similarity index 92% rename from src/r_data/models/model_kvx.h rename to src/common/models/model_kvx.h index c934491e8..bea2fdfd2 100644 --- a/src/r_data/models/model_kvx.h +++ b/src/common/models/model_kvx.h @@ -1,6 +1,14 @@ #pragma once #include "model.h" +#include "i_modelvertexbuffer.h" +#include "tarray.h" +#include "xs_Float.h" + +struct FVoxel; +struct kvxslab_t; +class FModelRenderer; +class FGameTexture; struct FVoxelVertexHash { diff --git a/src/r_data/models/model_md2.h b/src/common/models/model_md2.h similarity index 100% rename from src/r_data/models/model_md2.h rename to src/common/models/model_md2.h diff --git a/src/r_data/models/model_md3.h b/src/common/models/model_md3.h similarity index 100% rename from src/r_data/models/model_md3.h rename to src/common/models/model_md3.h diff --git a/src/r_data/models/model_obj.h b/src/common/models/model_obj.h similarity index 100% rename from src/r_data/models/model_obj.h rename to src/common/models/model_obj.h diff --git a/src/r_data/models/model_ue1.h b/src/common/models/model_ue1.h similarity index 100% rename from src/r_data/models/model_ue1.h rename to src/common/models/model_ue1.h diff --git a/src/r_data/models/modelrenderer.h b/src/common/models/modelrenderer.h similarity index 100% rename from src/r_data/models/modelrenderer.h rename to src/common/models/modelrenderer.h diff --git a/src/r_data/models/models_md2.cpp b/src/common/models/models_md2.cpp similarity index 99% rename from src/r_data/models/models_md2.cpp rename to src/common/models/models_md2.cpp index 03130aacc..6e255cf40 100644 --- a/src/r_data/models/models_md2.cpp +++ b/src/common/models/models_md2.cpp @@ -27,8 +27,7 @@ **/ #include "filesystem.h" -#include "r_data/models/models.h" -#include "r_data/models/model_md2.h" +#include "model_md2.h" #include "texturemanager.h" #include "modelrenderer.h" diff --git a/src/r_data/models/models_md3.cpp b/src/common/models/models_md3.cpp similarity index 99% rename from src/r_data/models/models_md3.cpp rename to src/common/models/models_md3.cpp index 4eafdaede..15224e4fe 100644 --- a/src/r_data/models/models_md3.cpp +++ b/src/common/models/models_md3.cpp @@ -22,8 +22,7 @@ #include "filesystem.h" #include "cmdlib.h" -#include "r_data/models/models.h" -#include "r_data/models/model_md3.h" +#include "model_md3.h" #include "texturemanager.h" #include "modelrenderer.h" diff --git a/src/r_data/models/models_obj.cpp b/src/common/models/models_obj.cpp similarity index 99% rename from src/r_data/models/models_obj.cpp rename to src/common/models/models_obj.cpp index 643fc64f2..54c237c65 100644 --- a/src/r_data/models/models_obj.cpp +++ b/src/common/models/models_obj.cpp @@ -20,7 +20,7 @@ //-------------------------------------------------------------------------- #include "filesystem.h" -#include "r_data/models/model_obj.h" +#include "model_obj.h" #include "texturemanager.h" #include "modelrenderer.h" diff --git a/src/r_data/models/models_ue1.cpp b/src/common/models/models_ue1.cpp similarity index 99% rename from src/r_data/models/models_ue1.cpp rename to src/common/models/models_ue1.cpp index 73733c9bb..1fb6146a1 100644 --- a/src/r_data/models/models_ue1.cpp +++ b/src/common/models/models_ue1.cpp @@ -22,7 +22,7 @@ #include "filesystem.h" #include "cmdlib.h" -#include "r_data/models/model_ue1.h" +#include "model_ue1.h" #include "texturemanager.h" #include "modelrenderer.h" diff --git a/src/r_data/models/models_voxel.cpp b/src/common/models/models_voxel.cpp similarity index 99% rename from src/r_data/models/models_voxel.cpp rename to src/common/models/models_voxel.cpp index eccd863bd..42c21e1d0 100644 --- a/src/r_data/models/models_voxel.cpp +++ b/src/common/models/models_voxel.cpp @@ -27,11 +27,8 @@ **/ #include "filesystem.h" -#include "g_level.h" #include "colormatcher.h" #include "bitmap.h" -#include "g_levellocals.h" -#include "models.h" #include "model_kvx.h" #include "image.h" #include "texturemanager.h" diff --git a/src/r_data/models/tab_anorms.h b/src/common/models/tab_anorms.h similarity index 100% rename from src/r_data/models/tab_anorms.h rename to src/common/models/tab_anorms.h diff --git a/src/r_data/voxels.cpp b/src/common/models/voxels.cpp similarity index 100% rename from src/r_data/voxels.cpp rename to src/common/models/voxels.cpp diff --git a/src/r_data/voxels.h b/src/common/models/voxels.h similarity index 100% rename from src/r_data/voxels.h rename to src/common/models/voxels.h diff --git a/src/r_data/models/models.cpp b/src/r_data/models.cpp similarity index 99% rename from src/r_data/models/models.cpp rename to src/r_data/models.cpp index 7e8b963a8..d98e55413 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models.cpp @@ -38,7 +38,7 @@ #include "d_player.h" #include "g_levellocals.h" #include "r_utility.h" -#include "r_data/models/models.h" +#include "models.h" #include "model_kvx.h" #include "i_time.h" #include "texturemanager.h" diff --git a/src/r_data/models/models.h b/src/r_data/models.h similarity index 99% rename from src/r_data/models/models.h rename to src/r_data/models.h index eb67a0c92..715ca73be 100644 --- a/src/r_data/models/models.h +++ b/src/r_data/models.h @@ -28,7 +28,7 @@ #include "m_bbox.h" #include "r_defs.h" #include "g_levellocals.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "i_modelvertexbuffer.h" #include "model.h" diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index 5add83733..3b88669e8 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -31,7 +31,7 @@ #include "c_dispatch.h" #include "v_text.h" #include "r_data/sprites.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "vm.h" #include "texturemanager.h" diff --git a/src/rendering/gl/renderer/gl_renderer.cpp b/src/rendering/gl/renderer/gl_renderer.cpp index e35446e79..15e151739 100644 --- a/src/rendering/gl/renderer/gl_renderer.cpp +++ b/src/rendering/gl/renderer/gl_renderer.cpp @@ -58,7 +58,7 @@ #include "hw_lightbuffer.h" #include "hwrenderer/data/hw_viewpointbuffer.h" #include "r_videoscale.h" -#include "r_data/models/models.h" +#include "model.h" #include "gl_postprocessstate.h" #include "gl_buffers.h" #include "texturemanager.h" diff --git a/src/rendering/hwrenderer/models/hw_models.h b/src/rendering/hwrenderer/models/hw_models.h index 6304e54ba..28026905e 100644 --- a/src/rendering/hwrenderer/models/hw_models.h +++ b/src/rendering/hwrenderer/models/hw_models.h @@ -24,11 +24,11 @@ #include "tarray.h" #include "p_pspr.h" -#include "r_data/voxels.h" -#include "r_data/models/models.h" +#include "voxels.h" +#include "models.h" #include "hwrenderer/data/buffers.h" #include "hw_modelvertexbuffer.h" -#include "r_data/models/modelrenderer.h" +#include "modelrenderer.h" class HWSprite; struct HWDrawInfo; diff --git a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp index 18204307f..dd239bb25 100644 --- a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp @@ -35,10 +35,10 @@ #include "hw_renderstate.h" #include "hw_drawinfo.h" #include "po_man.h" -#include "r_data/models/models.h" +#include "models.h" #include "hwrenderer/utility/hw_clock.h" #include "hw_cvars.h" -#include "hwrenderer/data/hw_viewpointbuffer.h" +#include "hw_viewpointbuffer.h" #include "flatvertices.h" #include "hw_lightbuffer.h" #include "hw_vrmodes.h" diff --git a/src/rendering/hwrenderer/scene/hw_spritelight.cpp b/src/rendering/hwrenderer/scene/hw_spritelight.cpp index 759f61a7d..71b486888 100644 --- a/src/rendering/hwrenderer/scene/hw_spritelight.cpp +++ b/src/rendering/hwrenderer/scene/hw_spritelight.cpp @@ -36,7 +36,7 @@ #include "hw_shadowmap.h" #include "hwrenderer/scene/hw_drawinfo.h" #include "hwrenderer/scene/hw_drawstructs.h" -#include "r_data/models/models.h" +#include "models.h" template T smoothstep(const T edge0, const T edge1, const T x) diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index c0dd3bd1e..dbedea82c 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -39,7 +39,7 @@ #include "actorinlines.h" #include "r_data/r_vanillatrans.h" #include "matrix.h" -#include "r_data/models/models.h" +#include "models.h" #include "vectors.h" #include "texturemanager.h" #include "basics.h" diff --git a/src/rendering/hwrenderer/scene/hw_weapon.cpp b/src/rendering/hwrenderer/scene/hw_weapon.cpp index 20ac4848b..49e4728a4 100644 --- a/src/rendering/hwrenderer/scene/hw_weapon.cpp +++ b/src/rendering/hwrenderer/scene/hw_weapon.cpp @@ -31,7 +31,7 @@ #include "doomstat.h" #include "d_player.h" #include "g_levellocals.h" -#include "r_data/models/models.h" +#include "models.h" #include "hw_weapon.h" #include "hw_fakeflat.h" #include "texturemanager.h" diff --git a/src/rendering/hwrenderer/textures/hw_precache.cpp b/src/rendering/hwrenderer/textures/hw_precache.cpp index 4b1dbb15a..58839f49a 100644 --- a/src/rendering/hwrenderer/textures/hw_precache.cpp +++ b/src/rendering/hwrenderer/textures/hw_precache.cpp @@ -30,14 +30,14 @@ #include "c_dispatch.h" #include "r_state.h" #include "actor.h" -#include "r_data/models/models.h" +#include "models.h" #include "skyboxtexture.h" #include "hw_material.h" #include "image.h" #include "v_video.h" #include "v_font.h" #include "texturemanager.h" -#include "r_data/models/modelrenderer.h" +#include "modelrenderer.h" EXTERN_CVAR(Bool, gl_precache) diff --git a/src/rendering/polyrenderer/drawers/poly_thread.cpp b/src/rendering/polyrenderer/drawers/poly_thread.cpp index 4613d6575..4b6d1a51a 100644 --- a/src/rendering/polyrenderer/drawers/poly_thread.cpp +++ b/src/rendering/polyrenderer/drawers/poly_thread.cpp @@ -31,7 +31,7 @@ #include "g_game.h" #include "g_level.h" #include "r_data/r_translate.h" -#include "r_data/models/models.h" +#include "model.h" #include "v_palette.h" #include "r_data/colormaps.h" #include "poly_thread.h" diff --git a/src/rendering/polyrenderer/drawers/poly_triangle.cpp b/src/rendering/polyrenderer/drawers/poly_triangle.cpp index 58aba69ce..54676b947 100644 --- a/src/rendering/polyrenderer/drawers/poly_triangle.cpp +++ b/src/rendering/polyrenderer/drawers/poly_triangle.cpp @@ -31,7 +31,7 @@ #include "g_game.h" #include "g_level.h" #include "r_data/r_translate.h" -#include "r_data/models/models.h" +#include "model.h" #include "v_palette.h" #include "r_data/colormaps.h" #include "poly_triangle.h" diff --git a/src/rendering/swrenderer/r_swrenderer.cpp b/src/rendering/swrenderer/r_swrenderer.cpp index 24eb81049..e43e43169 100644 --- a/src/rendering/swrenderer/r_swrenderer.cpp +++ b/src/rendering/swrenderer/r_swrenderer.cpp @@ -46,7 +46,7 @@ #include "scene/r_3dfloors.h" #include "scene/r_portal.h" #include "textures.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "drawers/r_draw_rgba.h" #include "p_setup.h" #include "g_levellocals.h" diff --git a/src/rendering/swrenderer/things/r_model.h b/src/rendering/swrenderer/things/r_model.h index 67db28881..4c0c5a342 100644 --- a/src/rendering/swrenderer/things/r_model.h +++ b/src/rendering/swrenderer/things/r_model.h @@ -24,7 +24,7 @@ #include "polyrenderer/drawers/poly_triangle.h" #include "matrix.h" -#include "r_data/models/models.h" +#include "models.h" #include "swrenderer/r_renderthread.h" #include "swrenderer/things/r_visiblesprite.h" diff --git a/src/rendering/swrenderer/things/r_particle.cpp b/src/rendering/swrenderer/things/r_particle.cpp index 6aa2cdb59..4fbc97c38 100644 --- a/src/rendering/swrenderer/things/r_particle.cpp +++ b/src/rendering/swrenderer/things/r_particle.cpp @@ -47,7 +47,7 @@ #include "v_palette.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "p_local.h" #include "p_maputl.h" #include "r_voxel.h" diff --git a/src/rendering/swrenderer/things/r_playersprite.cpp b/src/rendering/swrenderer/things/r_playersprite.cpp index d59f0a64c..0c6fd0823 100644 --- a/src/rendering/swrenderer/things/r_playersprite.cpp +++ b/src/rendering/swrenderer/things/r_playersprite.cpp @@ -52,7 +52,7 @@ #include "v_palette.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "p_local.h" #include "p_maputl.h" #include "r_voxel.h" diff --git a/src/rendering/swrenderer/things/r_sprite.cpp b/src/rendering/swrenderer/things/r_sprite.cpp index c0ebeae75..29afd0f7e 100644 --- a/src/rendering/swrenderer/things/r_sprite.cpp +++ b/src/rendering/swrenderer/things/r_sprite.cpp @@ -53,7 +53,7 @@ #include "v_palette.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "p_local.h" #include "r_voxel.h" #include "swrenderer/segments/r_drawsegment.h" diff --git a/src/rendering/swrenderer/things/r_voxel.cpp b/src/rendering/swrenderer/things/r_voxel.cpp index 662fd1bc3..62e0e4655 100644 --- a/src/rendering/swrenderer/things/r_voxel.cpp +++ b/src/rendering/swrenderer/things/r_voxel.cpp @@ -37,7 +37,7 @@ #include "sbar.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "r_data/sprites.h" #include "d_net.h" #include "po_man.h" diff --git a/src/rendering/swrenderer/things/r_wallsprite.cpp b/src/rendering/swrenderer/things/r_wallsprite.cpp index a3a526e2c..5fb431e36 100644 --- a/src/rendering/swrenderer/things/r_wallsprite.cpp +++ b/src/rendering/swrenderer/things/r_wallsprite.cpp @@ -53,7 +53,7 @@ #include "v_palette.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" -#include "r_data/voxels.h" +#include "voxels.h" #include "p_local.h" #include "p_maputl.h" #include "r_voxel.h"