summaryrefslogtreecommitdiff
path: root/source/r_models.h
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-07-03 16:01:48 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-07-03 16:01:48 +0000
commit7a914ef872a436adcdb36d21ceddba6bb24eb993 (patch)
treedafc86024742e7bbced8ef897754beff5160f1ae /source/r_models.h
parent1acd69e9a128e4f3abf06b5ae97c968c87663864 (diff)
Yet another huge commit.
Implemented new error reporting framework based on errno and custom error codes. Converted filesystem code, image and model managers, BSP loader to use the new framework and report errors more accurately. Replaced fileHandle_t with qhandle_t. Removed INVALID_LENGTH definition. Killed USE_LOADBUF code. Defined FS_FileExists(Ex) macro, implemented FS_EasyOpenFile and FS_WriteFile helper functions. When testing for free screenshot slots, open the file with O_EXCL flag to avoid race conditions (works only on glibc yet). Don't allow quake paths with high bits set. Don't tolerate any fatal errors encountered when searching for files and pass errors back to the caller. FS_Seek() now fails on files from packs instead of returning an invalid position. Fixed ‘mvdskip’ command not working properly. Avoid inefficient usage of MakeColor macro in image loading functions. Prevent memory leak in JPEG and PNG image functions after calling longjmp() by marking some local variables volatile. Added support for loading monochrome JPEG images. Fixed signed integer overflow in GetWavinfo(). Fixed missing return statement in BSP_LoadSurfEdges() causing out of range edge indices to be left uncaught. Fixed possible access to uninitialized memory in BSP_LoadLeafs() for maps with no leafs. Properly NUL terminate the buffer in SCR_ScoreDump_f(), also check for being in a level. Always free latched_string when cvar is set back to current value. Fixed a crash in ‘mvdplay’ command possible when demo file is invalid.
Diffstat (limited to 'source/r_models.h')
-rw-r--r--source/r_models.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/r_models.h b/source/r_models.h
index 966fd8d..ef5b33b 100644
--- a/source/r_models.h
+++ b/source/r_models.h
@@ -73,12 +73,14 @@ 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 );
+qerror_t MOD_ValidateMD2( model_t *model, struct dmd2header_s *header, size_t length );
+
+// these are implemented in [gl,sw]_models.c
+typedef qerror_t (*mod_load_t)( model_t *, const void *, size_t );
+qerror_t 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 );
+qerror_t MOD_LoadMD3( model_t *model, const void *rawdata, size_t length );
#endif
void MOD_Reference( model_t *model );