- allow tga as q3 mapshot
git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@591 d2ac09be-c843-0410-8b1f-f8a84130e0ec
This commit is contained in:
parent
b3001b4e95
commit
075d8e6ee4
@ -1,3 +1,6 @@
|
|||||||
|
Feb 08, 2004: Ludwig Nussel <l-n@users.sourceforge.net>
|
||||||
|
- allow tga as q3 mapshot
|
||||||
|
|
||||||
Feb 02, 2004: Jordi Mallach <jordi@sindominio.net>
|
Feb 02, 2004: Jordi Mallach <jordi@sindominio.net>
|
||||||
- switch to intltoolize
|
- switch to intltoolize
|
||||||
- add desktop file for GNOME and KDE
|
- add desktop file for GNOME and KDE
|
||||||
|
@ -138,6 +138,19 @@ static void findmaps_pak(const char* packfile, GHashTable* maphash)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline gboolean is_q3_mapshot(const char* buf)
|
||||||
|
{
|
||||||
|
if(g_strncasecmp(buf,"levelshots/",11))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!g_strcasecmp(buf+strlen(buf)-4,".jpg"))
|
||||||
|
return TRUE;
|
||||||
|
if(!g_strcasecmp(buf+strlen(buf)-4,".tga"))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/** open zip file and insert all contained .bsp into maphash */
|
/** open zip file and insert all contained .bsp into maphash */
|
||||||
static void findq3maps_zip(const char* path, GHashTable* maphash)
|
static void findq3maps_zip(const char* path, GHashTable* maphash)
|
||||||
{
|
{
|
||||||
@ -175,8 +188,7 @@ static void findq3maps_zip(const char* path, GHashTable* maphash)
|
|||||||
g_hash_table_insert(maphash,mapname,GUINT_TO_POINTER(-1));
|
g_hash_table_insert(maphash,mapname,GUINT_TO_POINTER(-1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!g_strncasecmp(buf,"levelshots/",11) &&
|
else if(is_q3_mapshot(buf))
|
||||||
(!g_strcasecmp(buf+strlen(buf)-4,".jpg")))
|
|
||||||
{
|
{
|
||||||
struct q3mapinfo* mi = NULL;
|
struct q3mapinfo* mi = NULL;
|
||||||
size_t psize, nsize;
|
size_t psize, nsize;
|
||||||
@ -484,7 +496,7 @@ void findq3maps(GHashTable* maphash, const char* startdir)
|
|||||||
char* mapname = NULL;
|
char* mapname = NULL;
|
||||||
char* origkey = NULL;
|
char* origkey = NULL;
|
||||||
gboolean found = FALSE;
|
gboolean found = FALSE;
|
||||||
// 11 = levelshots, 4 = .jpg
|
// 11 = levelshots/, 4 = .jpg
|
||||||
if(!mi->levelshot || strlen(mi->levelshot) < 11+4 ) { g_free(mi); continue; }
|
if(!mi->levelshot || strlen(mi->levelshot) < 11+4 ) { g_free(mi); continue; }
|
||||||
mapname=g_strndup(mi->levelshot+11,strlen(mi->levelshot)-4-11);
|
mapname=g_strndup(mi->levelshot+11,strlen(mi->levelshot)-4-11);
|
||||||
g_strdown(mapname);
|
g_strdown(mapname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user