diff --git a/config.d/build_control.m4 b/config.d/build_control.m4 index c67317496..1fb6f3d9b 100644 --- a/config.d/build_control.m4 +++ b/config.d/build_control.m4 @@ -324,6 +324,7 @@ if test x"${top_need_libs}" = xyes; then qfac_include_qf_glsl="\$(include_qf_glsl)" qfac_include_qf_math="\$(include_qf_math)" qfac_include_qf_plugin="\$(include_qf_plugin)" + qfac_include_qf_scene="\$(include_qf_scene)" qfac_include_qf_simd="\$(include_qf_simd)" qfac_include_qf_vulkan="\$(include_qf_vulkan)" fi @@ -332,6 +333,7 @@ QF_SUBST(qfac_include_qf_gl) QF_SUBST(qfac_include_qf_glsl) QF_SUBST(qfac_include_qf_math) QF_SUBST(qfac_include_qf_plugin) +QF_SUBST(qfac_include_qf_scene) QF_SUBST(qfac_include_qf_simd) QF_SUBST(qfac_include_qf_vulkan) diff --git a/include/QF/Makemodule.am b/include/QF/Makemodule.am index 4c6d20451..e0f9ebb07 100644 --- a/include/QF/Makemodule.am +++ b/include/QF/Makemodule.am @@ -15,7 +15,6 @@ include_qf = \ include/QF/darray.h \ include/QF/dstring.h \ include/QF/draw.h \ - include/QF/entity.h \ include/QF/fbsearch.h \ include/QF/gib.h \ include/QF/hash.h \ @@ -126,6 +125,13 @@ include_qf_plugin = \ include/QF/plugin/snd_render.h \ include/QF/plugin/vid_render.h +include_qf_scene = \ + include/QF/scene/entity.h \ + include/QF/scene/hierarchy.h \ + include/QF/scene/transform.h \ + include/QF/scene/scene.h \ + include/QF/scene/types.h + include_qf_simd = \ include/QF/simd/mat4f.h \ include/QF/simd/types.h \ @@ -179,6 +185,7 @@ qf_gl_includedir = $(includedir)/QF/GL qf_glsl_includedir = $(includedir)/QF/GLSL qf_math_includedir = $(includedir)/QF/math qf_plugin_includedir = $(includedir)/QF/plugin +qf_scene_includedir = $(includedir)/QF/scene qf_simd_includedir = $(includedir)/QF/simd qf_vulkan_includedir = $(includedir)/QF/Vulkan qf_include_HEADERS = @qfac_include_qf@ @@ -186,6 +193,7 @@ qf_gl_include_HEADERS = @qfac_include_qf_gl@ qf_glsl_include_HEADERS = @qfac_include_qf_glsl@ qf_math_include_HEADERS = @qfac_include_qf_math@ qf_plugin_include_HEADERS = @qfac_include_qf_plugin@ +qf_scene_include_HEADERS = @qfac_include_qf_scene@ qf_simd_include_HEADERS = @qfac_include_qf_simd@ qf_vulkan_include_HEADERS = @qfac_include_qf_vulkan@ @@ -198,6 +206,7 @@ EXTRA_HEADERS += \ $(include_qf_glsl) \ $(include_qf_math) \ $(include_qf_plugin) \ + $(include_qf_scene) \ $(include_qf_simd) \ $(include_qf_vulkan) \ $(qfcc_include_qf) diff --git a/include/QF/scene/entity.h b/include/QF/scene/entity.h new file mode 100644 index 000000000..f6bd82e4b --- /dev/null +++ b/include/QF/scene/entity.h @@ -0,0 +1,51 @@ +/* + entity.h + + Entity management + + Copyright (C) 2021 Bill Currie + + Author: Bill Currie + Date: 2021/02/26 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef __QF_scene_entity_h +#define __QF_scene_entity_h + +#include "QF/darray.h" +#include "QF/qtypes.h" +#include "QF/simd/vec4f.h" +#include "QF/simd/mat4f.h" + +/** \defgroup scene_entity Entity management + \ingroup scene +*/ +///@{ + +#include "QF/scene/hierarchy.h" +#include "QF/scene/transform.h" + +#include "QF/render.h" //FIXME move entity_t here + +///@} + +#endif//__QF_scene_entity_h diff --git a/include/QF/scene/hierarchy.h b/include/QF/scene/hierarchy.h new file mode 100644 index 000000000..24c46df0a --- /dev/null +++ b/include/QF/scene/hierarchy.h @@ -0,0 +1,76 @@ +/* + hierarch.h + + Hierarchy management + + Copyright (C) 2021 Bill Currie + + Author: Bill Currie + Date: 2021/02/26 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef __QF_scene_hierarch_h +#define __QF_scene_hierarch_h + +#include "QF/darray.h" +#include "QF/qtypes.h" +#include "QF/scene/types.h" +#include "QF/simd/vec4f.h" +#include "QF/simd/mat4f.h" + +/** \defgroup entity Hierarchy management + \ingroup utils +*/ +///@{ + +#define null_transform (~0u) + +typedef struct hierarchy_s { + xformset_t transform; + entityset_t entity; + uint32set_t childCount; + uint32set_t childIndex; + uint32set_t parentIndex; + stringset_t name; + uint32set_t tag; + byteset_t modified; + mat4fset_t localMatrix; + mat4fset_t localInverse; + mat4fset_t worldMatrix; + mat4fset_t worldInverse; + vec4fset_t localRotation; + vec4fset_t localScale; + vec4fset_t worldRotation; + vec4fset_t worldScale; +} hierarchy_t; + +hierarchy_t *Hierarchy_New (size_t grow, int createRoot); +hierarchy_t *Hierarchy_Copy (hierarchy_t *src); +void Hierarchy_Delete (hierarchy_t *hierarchy); + +void Hierarchy_UpdateMatrices (hierarchy_t *hierarchy); +uint32_t Hierarchy_InsertHierarchy (hierarchy_t *dst, const hierarchy_t *src, + uint32_t dstParent, uint32_t srcRoot); +void Hierarchy_RemoveHierarchy (hierarchy_t *hierarchy, uint32_t index); +///@} + +#endif//__QF_scene_hierarch_h diff --git a/include/QF/scene/scene.h b/include/QF/scene/scene.h new file mode 100644 index 000000000..cab3110e0 --- /dev/null +++ b/include/QF/scene/scene.h @@ -0,0 +1,63 @@ +/* + scene.h + + Entity management + + Copyright (C) 2021 Bill Currie + + Author: Bill Currie + Date: 2021/02/26 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef __QF_scene_scene_h +#define __QF_scene_scene_h + +#include "QF/darray.h" + +#include "QF/scene/types.h" + +/** \defgroup scene Scene management + \ingroup utils +*/ +///@{ + +typedef struct hierarchyset_s DARRAY_TYPE (struct hierarchy_s *) + hierarchyset_t; +typedef struct visibilityset_s DARRAY_TYPE (struct visibility_s *) + visibilityset_t; + +typedef struct scene_s { + struct scene_resources_s *const resources; + hierarchyset_t roots; + xformset_t transforms; + entityset_t entities; + visibilityset_t visibility; +} scene_t; + +scene_t *Scene_NewScene (void); +struct entity_s *Scene_CreateEntity (scene_t *scene); +void Scene_FreeAllEntities (scene_t *scene); + + +///@} + +#endif//__QF_scene_scene_h diff --git a/include/QF/entity.h b/include/QF/scene/transform.h similarity index 70% rename from include/QF/entity.h rename to include/QF/scene/transform.h index 032db67a2..2a015ff36 100644 --- a/include/QF/entity.h +++ b/include/QF/scene/transform.h @@ -1,7 +1,7 @@ /* - entity.h + transform.h - Entity management + Transform management Copyright (C) 2021 Bill Currie @@ -28,50 +28,21 @@ */ -#ifndef __QF_entity_h -#define __QF_entity_h +#ifndef __QF_scene_transform_h +#define __QF_scene_transform_h #include "QF/darray.h" -#include "QF/mathlib.h" +#include "QF/qtypes.h" #include "QF/simd/vec4f.h" #include "QF/simd/mat4f.h" -/** \defgroup entity Entity management +/** \defgroup transform Transform management \ingroup utils */ ///@{ -typedef struct mat4fset_s DARRAY_TYPE (mat4f_t) mat4fset_t; -typedef struct vec4fset_s DARRAY_TYPE (vec4f_t) vec4fset_t; -typedef struct uint32set_s DARRAY_TYPE (uint32_t) uint32set_t; -typedef struct byteset_s DARRAY_TYPE (byte) byteset_t; -typedef struct stringset_s DARRAY_TYPE (char *) stringset_t; -typedef struct xformset_s DARRAY_TYPE (struct transform_s *) xformset_t; -typedef struct entityset_s DARRAY_TYPE (struct entity_s *) entityset_t; - -#define null_transform (~0u) - -typedef struct hierarchy_s { - xformset_t transform; - entityset_t entity; - uint32set_t childCount; - uint32set_t childIndex; - uint32set_t parentIndex; - stringset_t name; - uint32set_t tag; - byteset_t modified; - mat4fset_t localMatrix; - mat4fset_t localInverse; - mat4fset_t worldMatrix; - mat4fset_t worldInverse; - vec4fset_t localRotation; - vec4fset_t localScale; - vec4fset_t worldRotation; - vec4fset_t worldScale; -} hierarchy_t; - typedef struct transform_s { - hierarchy_t *hierarchy; + struct hierarchy_s *hierarchy; uint32_t index; } transform_t; @@ -111,14 +82,6 @@ vec4f_t Transform_Right (const transform_t *transform) __attribute__((pure)); vec4f_t Transform_Up (const transform_t *transform) __attribute__((pure)); // no SetWorldScale because after rotations, non uniform scale becomes shear -hierarchy_t *Hierarchy_New (size_t grow, int createRoot); -hierarchy_t *Hierarchy_Copy (hierarchy_t *src); -void Hierarchy_Delete (hierarchy_t *hierarchy); - -void Hierarchy_UpdateMatrices (hierarchy_t *hierarchy); -uint32_t Hierarchy_InsertHierarchy (hierarchy_t *dst, const hierarchy_t *src, - uint32_t dstParent, uint32_t srcRoot); -void Hierarchy_RemoveHierarchy (hierarchy_t *hierarchy, uint32_t index); ///@} -#endif//__QF_entity_h +#endif//__QF_scene_transform_h diff --git a/include/QF/scene/types.h b/include/QF/scene/types.h new file mode 100644 index 000000000..550262302 --- /dev/null +++ b/include/QF/scene/types.h @@ -0,0 +1,54 @@ +/* + types.h + + Entity management + + Copyright (C) 2021 Bill Currie + + Author: Bill Currie + Date: 2021/02/26 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef __QF_scene_types_h +#define __QF_scene_types_h + +#include "QF/darray.h" +#include "QF/qtypes.h" +#include "QF/simd/vec4f.h" +#include "QF/simd/mat4f.h" + +/** \defgroup scene_types Scene type definitions + \ingroup scene +*/ +///@{ + +typedef struct mat4fset_s DARRAY_TYPE (mat4f_t) mat4fset_t; +typedef struct vec4fset_s DARRAY_TYPE (vec4f_t) vec4fset_t; +typedef struct uint32set_s DARRAY_TYPE (uint32_t) uint32set_t; +typedef struct byteset_s DARRAY_TYPE (byte) byteset_t; +typedef struct stringset_s DARRAY_TYPE (char *) stringset_t; +typedef struct xformset_s DARRAY_TYPE (struct transform_s *) xformset_t; +typedef struct entityset_s DARRAY_TYPE (struct entity_s *) entityset_t; + +///@} + +#endif//__QF_scene_types_h diff --git a/libs/Makemodule.am b/libs/Makemodule.am index 035f65926..4dcdc3b36 100644 --- a/libs/Makemodule.am +++ b/libs/Makemodule.am @@ -9,7 +9,7 @@ include libs/models/Makemodule.am include libs/input/Makemodule.am include libs/video/Makemodule.am include libs/console/Makemodule.am -include libs/entity/Makemodule.am +include libs/scene/Makemodule.am include libs/net/Makemodule.am include libs/client/Makemodule.am diff --git a/libs/client/cl_effects.c b/libs/client/cl_effects.c index 707699141..c4e66c7ff 100644 --- a/libs/client/cl_effects.c +++ b/libs/client/cl_effects.c @@ -38,10 +38,10 @@ # include #endif -#include "QF/entity.h" #include "QF/render.h" #include "QF/plugin/vid_render.h" //FIXME +#include "QF/scene/entity.h" #include "client/entities.h" #include "client/effects.h" diff --git a/libs/client/cl_entities.c b/libs/client/cl_entities.c index 599576863..4403a49bd 100644 --- a/libs/client/cl_entities.c +++ b/libs/client/cl_entities.c @@ -31,8 +31,8 @@ # include "config.h" #endif -#include "QF/entity.h" #include "QF/render.h" //FIXME for entity_t +#include "QF/scene/entity.h" #include "QF/simd/vec4f.h" #include "client/entities.h" diff --git a/libs/client/cl_temp_entities.c b/libs/client/cl_temp_entities.c index fdffbf985..2fe2255c9 100644 --- a/libs/client/cl_temp_entities.c +++ b/libs/client/cl_temp_entities.c @@ -38,7 +38,6 @@ # include #endif -#include "QF/entity.h" #include "QF/msg.h" #include "QF/progs.h" // for PR_RESMAP #include "QF/quakefs.h" @@ -46,6 +45,7 @@ #include "QF/sound.h" #include "QF/plugin/vid_render.h" //FIXME +#include "QF/scene/entity.h" #include "client/entities.h" #include "client/temp_entities.h" diff --git a/libs/entity/Makemodule.am b/libs/entity/Makemodule.am deleted file mode 100644 index 58dc1f08c..000000000 --- a/libs/entity/Makemodule.am +++ /dev/null @@ -1,12 +0,0 @@ -include libs/entity/test/Makemodule.am - -entity_deps=libs/util/libQFutil.la - -lib_LTLIBRARIES += libs/entity/libQFentity.la - -libs_entity_libQFentity_la_LDFLAGS= $(lib_ldflags) -libs_entity_libQFentity_la_LIBADD= $(entity_deps) -libs_entity_libQFentity_la_DEPENDENCIES= $(entity_deps) -libs_entity_libQFentity_la_SOURCES= \ - libs/entity/hierarchy.c \ - libs/entity/transform.c diff --git a/libs/entity/test/Makemodule.am b/libs/entity/test/Makemodule.am deleted file mode 100644 index be280abe9..000000000 --- a/libs/entity/test/Makemodule.am +++ /dev/null @@ -1,17 +0,0 @@ -libs_entity_tests = \ - libs/entity/test/test-hierarchy - -TESTS += $(libs_entity_tests) - -check_PROGRAMS += $(libs_entity_tests) - -libs_entity_test_libs= \ - libs/entity/libQFentity.la \ - libs/util/libQFutil.la - -libs_entity_test_test_hierarchy_SOURCES= \ - libs/entity/test/test-hierarchy.c -libs_entity_test_test_hierarchy_LDADD= \ - $(libs_entity_test_libs) -libs_entity_test_test_hierarchy_DEPENDENCIES= \ - $(libs_entity_test_libs) diff --git a/libs/scene/Makemodule.am b/libs/scene/Makemodule.am new file mode 100644 index 000000000..eaf988539 --- /dev/null +++ b/libs/scene/Makemodule.am @@ -0,0 +1,13 @@ +include libs/scene/test/Makemodule.am + +scene_deps=libs/util/libQFutil.la + +lib_LTLIBRARIES += libs/scene/libQFscene.la + +libs_scene_libQFscene_la_LDFLAGS= $(lib_ldflags) +libs_scene_libQFscene_la_LIBADD= $(scene_deps) +libs_scene_libQFscene_la_DEPENDENCIES= $(scene_deps) +libs_scene_libQFscene_la_SOURCES= \ + libs/scene/hierarchy.c \ + libs/scene/scene.c \ + libs/scene/transform.c diff --git a/libs/entity/hierarchy.c b/libs/scene/hierarchy.c similarity index 99% rename from libs/entity/hierarchy.c rename to libs/scene/hierarchy.c index 39d4ed971..43c3ea598 100644 --- a/libs/entity/hierarchy.c +++ b/libs/scene/hierarchy.c @@ -35,7 +35,8 @@ # include #endif -#include "QF/entity.h" +#include "QF/scene/hierarchy.h" +#include "QF/scene/transform.h" #if defined(_WIN32) && !defined(_WIN64) // FIXME (maybe) this is a hack to make DARRAY arrrays 16-byte aligned on diff --git a/libs/scene/scene.c b/libs/scene/scene.c new file mode 100644 index 000000000..421021b7c --- /dev/null +++ b/libs/scene/scene.c @@ -0,0 +1,89 @@ +/* + scene.c + + General scene handling + + Copyright (C) 2021 Bill Currke + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif + +#include "QF/progs.h" // for PR_RESMAP + +#include "QF/scene/entity.h" +#include "QF/scene/scene.h" +#include "QF/scene/transform.h" + +typedef struct scene_resources_s { + PR_RESMAP (entity_t) entities; +} scene_resources_t; + +scene_t * +Scene_NewScene (void) +{ + scene_t *scene; + scene_resources_t *res; + + scene = calloc (1, sizeof (scene_t)); + res = calloc (1, sizeof (scene_resources_t)); + *(scene_resources_t **)&scene->resources = res; + + DARRAY_INIT (&scene->roots, 16); + DARRAY_INIT (&scene->transforms, 16); + DARRAY_INIT (&scene->entities, 16); + DARRAY_INIT (&scene->visibility, 16); + + return scene; +} + +entity_t * +Scene_CreateEntity (scene_t *scene) +{ + scene_resources_t *res = scene->resources; + + entity_t *ent = PR_RESNEW_NC (res->entities); + ent->transform = 0; + DARRAY_APPEND (&scene->entities, ent); + return ent; +} + +void +Scene_FreeAllEntities (scene_t *scene) +{ + scene_resources_t *res = scene->resources; + for (size_t i = 0; i < scene->entities.size; i++) { + entity_t *ent = scene->entities.a[i]; + if (ent->transform) { + Transform_Delete (ent->transform); + ent->transform = 0; + } + } + PR_RESRESET (res->entities); +} diff --git a/libs/scene/test/Makemodule.am b/libs/scene/test/Makemodule.am new file mode 100644 index 000000000..76f5c9dcf --- /dev/null +++ b/libs/scene/test/Makemodule.am @@ -0,0 +1,17 @@ +libs_scene_tests = \ + libs/scene/test/test-hierarchy + +TESTS += $(libs_scene_tests) + +check_PROGRAMS += $(libs_scene_tests) + +libs_scene_test_libs= \ + libs/scene/libQFscene.la \ + libs/util/libQFutil.la + +libs_scene_test_test_hierarchy_SOURCES= \ + libs/scene/test/test-hierarchy.c +libs_scene_test_test_hierarchy_LDADD= \ + $(libs_scene_test_libs) +libs_scene_test_test_hierarchy_DEPENDENCIES= \ + $(libs_scene_test_libs) diff --git a/libs/entity/test/test-hierarchy.c b/libs/scene/test/test-hierarchy.c similarity index 99% rename from libs/entity/test/test-hierarchy.c rename to libs/scene/test/test-hierarchy.c index 428dfcc5c..b6a3c0ca8 100644 --- a/libs/entity/test/test-hierarchy.c +++ b/libs/scene/test/test-hierarchy.c @@ -6,7 +6,8 @@ #include #include -#include "QF/entity.h" +#include "QF/scene/hierarchy.h" +#include "QF/scene/transform.h" // NOTE: these are the columns of the matrix! (not that it matters for a // symmetrical matrix, but...) diff --git a/libs/entity/transform.c b/libs/scene/transform.c similarity index 99% rename from libs/entity/transform.c rename to libs/scene/transform.c index b2e4b09da..c5919c097 100644 --- a/libs/entity/transform.c +++ b/libs/scene/transform.c @@ -35,8 +35,8 @@ # include #endif -#include "QF/entity.h" -#include "QF/render.h" +#include "QF/scene/hierarchy.h" +#include "QF/scene/transform.h" transform_t * Transform_New (transform_t *parent) diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index 678e4e72c..b82785660 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -42,13 +42,15 @@ #include "QF/cmd.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mersenne.h" #include "QF/qargs.h" #include "QF/quakefs.h" #include "QF/render.h" #include "QF/sys.h" #include "QF/va.h" + +#include "QF/scene/entity.h" + #include "QF/GL/defines.h" #include "QF/GL/funcs.h" #include "QF/GL/qf_explosions.h" diff --git a/libs/video/renderer/gl/gl_lightmap.c b/libs/video/renderer/gl/gl_lightmap.c index 8456b5619..3251a5913 100644 --- a/libs/video/renderer/gl/gl_lightmap.c +++ b/libs/video/renderer/gl/gl_lightmap.c @@ -43,9 +43,11 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" + +#include "QF/scene/entity.h" + #include "QF/GL/defines.h" #include "QF/GL/funcs.h" #include "QF/GL/qf_lightmap.h" diff --git a/libs/video/renderer/gl/gl_mod_alias.c b/libs/video/renderer/gl/gl_mod_alias.c index 03d403fa9..18ef24320 100644 --- a/libs/video/renderer/gl/gl_mod_alias.c +++ b/libs/video/renderer/gl/gl_mod_alias.c @@ -43,7 +43,6 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mathlib.h" #include "QF/qargs.h" #include "QF/render.h" @@ -51,6 +50,9 @@ #include "QF/sound.h" #include "QF/sys.h" #include "QF/vid.h" + +#include "QF/scene/entity.h" + #include "QF/GL/defines.h" #include "QF/GL/funcs.h" #include "QF/GL/qf_rlight.h" diff --git a/libs/video/renderer/gl/gl_mod_sprite.c b/libs/video/renderer/gl/gl_mod_sprite.c index 2aa41ac5e..d25bec868 100644 --- a/libs/video/renderer/gl/gl_mod_sprite.c +++ b/libs/video/renderer/gl/gl_mod_sprite.c @@ -38,14 +38,15 @@ # include #endif -#include "QF/GL/defines.h" -#include "QF/GL/funcs.h" - -#include "QF/entity.h" #include "QF/model.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + +#include "QF/GL/defines.h" +#include "QF/GL/funcs.h" + #include "compat.h" #include "r_internal.h" #include "varrays.h" diff --git a/libs/video/renderer/gl/gl_rmain.c b/libs/video/renderer/gl/gl_rmain.c index 617eb9206..b3dfe0c1a 100644 --- a/libs/video/renderer/gl/gl_rmain.c +++ b/libs/video/renderer/gl/gl_rmain.c @@ -44,7 +44,6 @@ #include "QF/cvar.h" #include "QF/draw.h" -#include "QF/entity.h" #include "QF/mathlib.h" #include "QF/qargs.h" #include "QF/render.h" @@ -52,6 +51,9 @@ #include "QF/sound.h" #include "QF/sys.h" #include "QF/vid.h" + +#include "QF/scene/entity.h" + #include "QF/GL/defines.h" #include "QF/GL/funcs.h" #include "QF/GL/qf_draw.h" diff --git a/libs/video/renderer/gl/gl_rsurf.c b/libs/video/renderer/gl/gl_rsurf.c index e3c4187d1..654751fff 100644 --- a/libs/video/renderer/gl/gl_rsurf.c +++ b/libs/video/renderer/gl/gl_rsurf.c @@ -45,9 +45,11 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" + +#include "QF/scene/entity.h" + #include "QF/GL/defines.h" #include "QF/GL/funcs.h" #include "QF/GL/qf_lightmap.h" diff --git a/libs/video/renderer/glsl/glsl_alias.c b/libs/video/renderer/glsl/glsl_alias.c index bb8e2a541..d7025fe72 100644 --- a/libs/video/renderer/glsl/glsl_alias.c +++ b/libs/video/renderer/glsl/glsl_alias.c @@ -43,11 +43,12 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_alias.h" diff --git a/libs/video/renderer/glsl/glsl_bsp.c b/libs/video/renderer/glsl/glsl_bsp.c index 24f3c230c..04caf310c 100644 --- a/libs/video/renderer/glsl/glsl_bsp.c +++ b/libs/video/renderer/glsl/glsl_bsp.c @@ -46,12 +46,13 @@ #include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/sys.h" #include "QF/va.h" +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_bsp.h" diff --git a/libs/video/renderer/glsl/glsl_iqm.c b/libs/video/renderer/glsl/glsl_iqm.c index eeba3f572..2e66e8f74 100644 --- a/libs/video/renderer/glsl/glsl_iqm.c +++ b/libs/video/renderer/glsl/glsl_iqm.c @@ -43,11 +43,12 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_iqm.h" diff --git a/libs/video/renderer/glsl/glsl_lightmap.c b/libs/video/renderer/glsl/glsl_lightmap.c index f50340d5b..750858251 100644 --- a/libs/video/renderer/glsl/glsl_lightmap.c +++ b/libs/video/renderer/glsl/glsl_lightmap.c @@ -44,10 +44,11 @@ #endif #include -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_lightmap.h" diff --git a/libs/video/renderer/glsl/glsl_particles.c b/libs/video/renderer/glsl/glsl_particles.c index da96477a7..b8bdf56ca 100644 --- a/libs/video/renderer/glsl/glsl_particles.c +++ b/libs/video/renderer/glsl/glsl_particles.c @@ -42,7 +42,6 @@ #include "QF/cmd.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/mersenne.h" #include "QF/qargs.h" @@ -50,6 +49,9 @@ #include "QF/render.h" #include "QF/sys.h" #include "QF/va.h" + +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" //#include "QF/GL/qf_explosions.h" diff --git a/libs/video/renderer/glsl/glsl_sprite.c b/libs/video/renderer/glsl/glsl_sprite.c index 66b30485d..a56a2fd83 100644 --- a/libs/video/renderer/glsl/glsl_sprite.c +++ b/libs/video/renderer/glsl/glsl_sprite.c @@ -42,13 +42,14 @@ #endif #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/draw.h" #include "QF/dstring.h" #include "QF/quakefs.h" #include "QF/sys.h" #include "QF/vid.h" +#include "QF/scene/entity.h" + #include "QF/GLSL/defines.h" #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_sprite.h" diff --git a/libs/video/renderer/r_efrag.c b/libs/video/renderer/r_efrag.c index eb559e9cd..4ee676d86 100644 --- a/libs/video/renderer/r_efrag.c +++ b/libs/video/renderer/r_efrag.c @@ -30,10 +30,11 @@ #include -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "qfalloca.h" #include "r_internal.h" diff --git a/libs/video/renderer/r_ent.c b/libs/video/renderer/r_ent.c index 2ce315206..303053800 100644 --- a/libs/video/renderer/r_ent.c +++ b/libs/video/renderer/r_ent.c @@ -38,13 +38,14 @@ #include #include -#include "QF/entity.h" #include "QF/model.h" #include "QF/msg.h" #include "QF/render.h" #include "QF/sound.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" #define ENT_POOL_SIZE 32 diff --git a/libs/video/renderer/sw/d_edge.c b/libs/video/renderer/sw/d_edge.c index d1e8a4e29..59963dc3a 100644 --- a/libs/video/renderer/sw/d_edge.c +++ b/libs/video/renderer/sw/d_edge.c @@ -29,9 +29,10 @@ #endif #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" +#include "QF/scene/entity.h" + #include "d_local.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw/sw_ralias.c b/libs/video/renderer/sw/sw_ralias.c index dd545debc..023c5e039 100644 --- a/libs/video/renderer/sw/sw_ralias.c +++ b/libs/video/renderer/sw/sw_ralias.c @@ -30,12 +30,13 @@ #include -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "d_ifacea.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw/sw_rbsp.c b/libs/video/renderer/sw/sw_rbsp.c index e9b3fde8a..3d726766c 100644 --- a/libs/video/renderer/sw/sw_rbsp.c +++ b/libs/video/renderer/sw/sw_rbsp.c @@ -33,10 +33,11 @@ #include "qfalloca.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" // current entity info diff --git a/libs/video/renderer/sw/sw_riqm.c b/libs/video/renderer/sw/sw_riqm.c index 8674e3ca6..d2ed9e79c 100644 --- a/libs/video/renderer/sw/sw_riqm.c +++ b/libs/video/renderer/sw/sw_riqm.c @@ -40,12 +40,13 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "d_ifacea.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw/sw_rmain.c b/libs/video/renderer/sw/sw_rmain.c index 12a47c285..e21713984 100644 --- a/libs/video/renderer/sw/sw_rmain.c +++ b/libs/video/renderer/sw/sw_rmain.c @@ -42,13 +42,14 @@ #include "QF/cmd.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mathlib.h" #include "QF/render.h" #include "QF/screen.h" #include "QF/sound.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "mod_internal.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw/sw_rpart.c b/libs/video/renderer/sw/sw_rpart.c index c429279b2..8dc268955 100644 --- a/libs/video/renderer/sw/sw_rpart.c +++ b/libs/video/renderer/sw/sw_rpart.c @@ -37,7 +37,6 @@ #endif #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mersenne.h" #include "QF/qargs.h" #include "QF/quakefs.h" @@ -45,6 +44,8 @@ #include "QF/sys.h" #include "QF/va.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw/sw_rsprite.c b/libs/video/renderer/sw/sw_rsprite.c index 6a70d2f4f..82c7b0d1b 100644 --- a/libs/video/renderer/sw/sw_rsprite.c +++ b/libs/video/renderer/sw/sw_rsprite.c @@ -37,10 +37,11 @@ #include -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" static int clip_current; diff --git a/libs/video/renderer/sw/sw_rsurf.c b/libs/video/renderer/sw/sw_rsurf.c index 36ea5fe79..106dd8f29 100644 --- a/libs/video/renderer/sw/sw_rsurf.c +++ b/libs/video/renderer/sw/sw_rsurf.c @@ -28,10 +28,11 @@ # include "config.h" #endif -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" #ifdef PIC diff --git a/libs/video/renderer/sw32/d_edge.c b/libs/video/renderer/sw32/d_edge.c index adcc62981..38ee43f63 100644 --- a/libs/video/renderer/sw32/d_edge.c +++ b/libs/video/renderer/sw32/d_edge.c @@ -32,10 +32,11 @@ #include "namehack.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "d_local.h" #include "r_internal.h" #include "vid_internal.h" diff --git a/libs/video/renderer/sw32/sw32_ralias.c b/libs/video/renderer/sw32/sw32_ralias.c index 3a73a56db..fa7c56552 100644 --- a/libs/video/renderer/sw32/sw32_ralias.c +++ b/libs/video/renderer/sw32/sw32_ralias.c @@ -33,12 +33,13 @@ #define NH_DEFINE #include "namehack.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "d_ifacea.h" #include "r_internal.h" #include "vid_sw.h" diff --git a/libs/video/renderer/sw32/sw32_rbsp.c b/libs/video/renderer/sw32/sw32_rbsp.c index 1f62b381e..44ae8122f 100644 --- a/libs/video/renderer/sw32/sw32_rbsp.c +++ b/libs/video/renderer/sw32/sw32_rbsp.c @@ -36,10 +36,11 @@ #include "qfalloca.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" // current entity info diff --git a/libs/video/renderer/sw32/sw32_riqm.c b/libs/video/renderer/sw32/sw32_riqm.c index 1db5fbbdc..193d28216 100644 --- a/libs/video/renderer/sw32/sw32_riqm.c +++ b/libs/video/renderer/sw32/sw32_riqm.c @@ -43,12 +43,13 @@ #include "namehack.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "d_ifacea.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw32/sw32_rmain.c b/libs/video/renderer/sw32/sw32_rmain.c index 8da2648b2..5377911ae 100644 --- a/libs/video/renderer/sw32/sw32_rmain.c +++ b/libs/video/renderer/sw32/sw32_rmain.c @@ -42,13 +42,14 @@ #include "QF/cmd.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mathlib.h" #include "QF/render.h" #include "QF/screen.h" #include "QF/sound.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "mod_internal.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw32/sw32_rpart.c b/libs/video/renderer/sw32/sw32_rpart.c index 851618819..45e48a9ed 100644 --- a/libs/video/renderer/sw32/sw32_rpart.c +++ b/libs/video/renderer/sw32/sw32_rpart.c @@ -40,7 +40,6 @@ #endif #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/mersenne.h" #include "QF/qargs.h" #include "QF/quakefs.h" @@ -48,6 +47,8 @@ #include "QF/sys.h" #include "QF/va.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "r_internal.h" diff --git a/libs/video/renderer/sw32/sw32_rsprite.c b/libs/video/renderer/sw32/sw32_rsprite.c index bbdc1996f..153fba1fb 100644 --- a/libs/video/renderer/sw32/sw32_rsprite.c +++ b/libs/video/renderer/sw32/sw32_rsprite.c @@ -40,10 +40,11 @@ #include -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "r_internal.h" static int clip_current; diff --git a/libs/video/renderer/sw32/sw32_rsurf.c b/libs/video/renderer/sw32/sw32_rsurf.c index 2bfb5c000..dac3e2173 100644 --- a/libs/video/renderer/sw32/sw32_rsurf.c +++ b/libs/video/renderer/sw32/sw32_rsurf.c @@ -31,10 +31,11 @@ #define NH_DEFINE #include "namehack.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "r_internal.h" #include "vid_sw.h" diff --git a/libs/video/renderer/vulkan/vulkan_alias.c b/libs/video/renderer/vulkan/vulkan_alias.c index 83c0a5e0a..91413f41c 100644 --- a/libs/video/renderer/vulkan/vulkan_alias.c +++ b/libs/video/renderer/vulkan/vulkan_alias.c @@ -45,13 +45,14 @@ #include "QF/cvar.h" #include "QF/darray.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" #include "QF/va.h" +#include "QF/scene/entity.h" + #include "QF/Vulkan/qf_alias.h" #include "QF/Vulkan/qf_texture.h" #include "QF/Vulkan/buffer.h" diff --git a/libs/video/renderer/vulkan/vulkan_bsp.c b/libs/video/renderer/vulkan/vulkan_bsp.c index ac22d1034..7bfe34fff 100644 --- a/libs/video/renderer/vulkan/vulkan_bsp.c +++ b/libs/video/renderer/vulkan/vulkan_bsp.c @@ -45,12 +45,13 @@ #include "QF/cvar.h" #include "QF/darray.h" -#include "QF/entity.h" #include "QF/image.h" #include "QF/render.h" #include "QF/sys.h" #include "QF/va.h" +#include "QF/scene/entity.h" + #include "QF/Vulkan/qf_bsp.h" #include "QF/Vulkan/qf_lightmap.h" #include "QF/Vulkan/qf_texture.h" diff --git a/libs/video/renderer/vulkan/vulkan_lightmap.c b/libs/video/renderer/vulkan/vulkan_lightmap.c index 3cfbcb7ba..7e6a61cef 100644 --- a/libs/video/renderer/vulkan/vulkan_lightmap.c +++ b/libs/video/renderer/vulkan/vulkan_lightmap.c @@ -41,7 +41,6 @@ #include #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/render.h" #include "QF/sys.h" #include "QF/Vulkan/qf_bsp.h" @@ -49,6 +48,8 @@ #include "QF/Vulkan/qf_main.h" #include "QF/Vulkan/scrap.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "r_internal.h" #include "vid_vulkan.h" diff --git a/nq/source/Makemodule.am b/nq/source/Makemodule.am index 45beb5b0e..0cfd9b915 100644 --- a/nq/source/Makemodule.am +++ b/nq/source/Makemodule.am @@ -46,7 +46,7 @@ nq_cl_plugin_LIBS= \ nq_client_LIBFILES= \ libs/gib/libQFgib_client.la \ - libs/entity/libQFentity.la \ + libs/scene/libQFscene.la \ libs/video/targets/libQFjs.la \ libs/audio/libQFcd.la \ libs/audio/libQFsound.la diff --git a/nq/source/cl_ents.c b/nq/source/cl_ents.c index 79a0f9234..1bfae5670 100644 --- a/nq/source/cl_ents.c +++ b/nq/source/cl_ents.c @@ -32,7 +32,6 @@ #include "QF/cmd.h" #include "QF/console.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/input.h" #include "QF/keys.h" #include "QF/msg.h" @@ -44,6 +43,7 @@ #include "QF/va.h" #include "QF/plugin/vid_render.h" +#include "QF/scene/entity.h" #include "compat.h" diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 88b7a78bb..c05570794 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -34,7 +34,6 @@ #include "QF/console.h" #include "QF/cvar.h" #include "QF/draw.h" -#include "QF/entity.h" #include "QF/input.h" #include "QF/joystick.h" #include "QF/keys.h" @@ -48,6 +47,7 @@ #include "QF/plugin/console.h" #include "QF/plugin/vid_render.h" +#include "QF/scene/entity.h" #include "compat.h" #include "sbar.h" diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index f511ec70e..a9078edd8 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -41,7 +41,6 @@ #include "QF/console.h" #include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/entity.h" #include "QF/idparse.h" #include "QF/input.h" #include "QF/msg.h" @@ -53,6 +52,7 @@ #include "QF/va.h" #include "QF/plugin/vid_render.h" +#include "QF/scene/entity.h" #include "client/temp_entities.h" diff --git a/nq/source/cl_view.c b/nq/source/cl_view.c index c82b495ca..ca8b2dd1a 100644 --- a/nq/source/cl_view.c +++ b/nq/source/cl_view.c @@ -30,13 +30,13 @@ #include "QF/cmd.h" #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/msg.h" #include "QF/screen.h" #include "QF/simd/vec4f.h" #include "QF/plugin/vid_render.h" +#include "QF/scene/entity.h" #include "compat.h" diff --git a/qw/include/client.h b/qw/include/client.h index 9ccfaf551..eb78c5a8c 100644 --- a/qw/include/client.h +++ b/qw/include/client.h @@ -28,13 +28,13 @@ #ifndef _CLIENT_H #define _CLIENT_H -#include "QF/entity.h" #include "QF/info.h" #include "QF/quakefs.h" #include "QF/vid.h" #include "QF/zone.h" #include "QF/plugin/vid_render.h" +#include "QF/scene/entity.h" #include "client/entities.h" #include "client/state.h" diff --git a/qw/source/Makemodule.am b/qw/source/Makemodule.am index 95ccd1a67..f5335692f 100644 --- a/qw/source/Makemodule.am +++ b/qw/source/Makemodule.am @@ -89,7 +89,7 @@ qw_client_LIBS= \ libs/qw/libqw.a \ libs/gib/libQFgib_client.la \ libs/net/libnet_chan.la \ - libs/entity/libQFentity.la \ + libs/scene/libQFscene.la \ libs/console/libQFconsole.la \ libs/video/targets/libQFjs.la \ libs/audio/libQFcd.la \ diff --git a/qw/source/cl_ents.c b/qw/source/cl_ents.c index 04b6cd9c1..489d5e8de 100644 --- a/qw/source/cl_ents.c +++ b/qw/source/cl_ents.c @@ -36,12 +36,13 @@ #endif #include "QF/cvar.h" -#include "QF/entity.h" #include "QF/msg.h" #include "QF/render.h" #include "QF/skin.h" #include "QF/sys.h" +#include "QF/scene/entity.h" + #include "compat.h" #include "d_iface.h" diff --git a/ruamoko/qwaq/Makemodule.am b/ruamoko/qwaq/Makemodule.am index 3c5b0100d..672aeca18 100644 --- a/ruamoko/qwaq/Makemodule.am +++ b/ruamoko/qwaq/Makemodule.am @@ -74,7 +74,7 @@ qwaq_cl_plugin_libs= \ @client_static_plugin_libs@ qwaq_client_libs= \ - $(top_builddir)/libs/entity/libQFentity.la \ + $(top_builddir)/libs/scene/libQFscene.la \ $(top_builddir)/libs/console/libQFconsole.la \ $(top_builddir)/libs/ui/libQFui.la \ $(top_builddir)/libs/input/libQFinput.la \