From e030ec0ba762165d6ff1c24eca0f692f863daa6e Mon Sep 17 00:00:00 2001 From: tma Date: Sun, 26 Aug 2007 21:27:46 +0000 Subject: * Rewrite of R_LoadImage to make it more generic and data driven git-svn-id: svn://svn.icculus.org/quake3/trunk@1137 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/files.c | 1 - code/qcommon/q_shared.c | 22 ++++++++++++++++++++++ code/qcommon/q_shared.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'code/qcommon') diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 8a056d5..4a909e3 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1207,7 +1207,6 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF } } - Com_DPrintf ("Can't find %s\n", filename); #ifdef FS_MISSING if (missingFiles) { fprintf(missingFiles, "%s\n", filename); diff --git a/code/qcommon/q_shared.c b/code/qcommon/q_shared.c index b30688a..a68b283 100644 --- a/code/qcommon/q_shared.c +++ b/code/qcommon/q_shared.c @@ -53,6 +53,28 @@ char *COM_SkipPath (char *pathname) return last; } +/* +============ +COM_GetExtension +============ +*/ +const char *COM_GetExtension( const char *name ) { + int length, i; + + length = strlen(name)-1; + i = length; + + while (name[i] != '.') + { + i--; + if (name[i] == '/' || i == 0) + return ""; // no extension + } + + return &name[i+1]; +} + + /* ============ COM_StripExtension diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index e3a062a..fcd48e0 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -599,6 +599,7 @@ int Q_isnan( float x ); float Com_Clamp( float min, float max, float value ); char *COM_SkipPath( char *pathname ); +const char *COM_GetExtension( const char *name ); void COM_StripExtension(const char *in, char *out, int destsize); void COM_DefaultExtension( char *path, int maxSize, const char *extension ); -- cgit v1.2.3