summaryrefslogtreecommitdiff
path: root/source/r_models.h
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-08-16 10:19:42 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-08-16 10:19:42 +0000
commit1526e22e4ff29153e9c127081e8ea8d9e2f33b8c (patch)
treeb361766433d4a7b4a111865afd52803e2bbf7754 /source/r_models.h
parente826e5f176f21cd18b3bbc22887a266835ada57c (diff)
Split some monolithic include files into smaller ones.
Use single BSP models cache for refresh and collision subsystems. Refresh libraries may not longer be dynamically loaded. Made gi.TagMalloc use separate tag namespace to avoid conflicts with engine reserverd tags. Fixed listing order of MVD channels in chooser menu. A lot of misc changes... MSVC build is definitely broken now.
Diffstat (limited to 'source/r_models.h')
-rw-r--r--source/r_models.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/source/r_models.h b/source/r_models.h
new file mode 100644
index 0000000..1dbf739
--- /dev/null
+++ b/source/r_models.h
@@ -0,0 +1,84 @@
+/*
+Copyright (C) 2008 Andrey Nazarov
+
+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 the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+/*
+=============================================================================
+
+MODEL MANAGER
+
+=============================================================================
+*/
+
+#define Model_Malloc( size ) Hunk_Alloc( &model->pool, size )
+
+// FIXME: MD3 has 256 limit
+#define MAX_ALIAS_SKINS 32
+
+typedef struct mspriteframe_s {
+ int width, height;
+ int origin_x, origin_y;
+ struct image_s *image;
+} mspriteframe_t;
+
+typedef struct model_s {
+ char name[MAX_QPATH];
+ int registration_sequence;
+ mempool_t pool;
+
+ // alias models
+ int numframes;
+ struct maliasframe_s *frames;
+#if USE_REF == REF_GL
+ int nummeshes;
+ struct maliasmesh_s *meshes;
+#else
+ int numskins;
+ struct image_s *skins[MAX_ALIAS_SKINS];
+ int numtris;
+ struct maliastri_s *tris;
+ int numsts;
+ struct maliasst_s *sts;
+ int numverts;
+#endif
+
+ // sprite models
+ struct mspriteframe_s *spriteframes;
+} model_t;
+
+extern int registration_sequence;
+
+// these are implemented in r_models.c
+void MOD_FreeUnused( void );
+void MOD_FreeAll( void );
+void MOD_Init( void );
+void MOD_Shutdown( void );
+
+model_t *MOD_ForHandle( qhandle_t h );
+qhandle_t R_RegisterModel( const char *name );
+
+// these are implemented in [gl,sw]_models.c
+struct dmd2header_s;
+qboolean MOD_ValidateMD2( model_t *model, struct dmd2header_s *header, size_t length );
+qboolean MOD_LoadMD2( model_t *model, const void *rawdata, size_t length );
+#if USE_MD3
+qboolean MOD_LoadMD3( model_t *model, const void *rawdata, size_t length );
+#endif
+void MOD_Reference( model_t *model );
+