diff --git a/Makefile b/Makefile index f5431800..bb84dd16 100644 --- a/Makefile +++ b/Makefile @@ -333,7 +333,8 @@ OPENGL_OBJS = \ build/ref_gl/gl_scrap.o \ build/ref_gl/gl_warp.o \ build/ref_gl/files/pcx.o \ - build/ref_gl/files/tga.o + build/ref_gl/files/tga.o \ + build/ref_gl/files/wal.o \ # ---------- @@ -805,7 +806,10 @@ build/ref_gl/files/pcx.o: src/refresh/files/pcx.c build/ref_gl/files/tga.o: src/refresh/files/tga.c $(CC) $(CFLAGS_OPENGL) -o $@ -c $< - + +build/ref_gl/files/wal.o: src/refresh/files/wal.c + $(CC) $(CFLAGS_OPENGL) -o $@ -c $< + # ---------- build/ref_gl_game/q_shared.o: src/game/baseq2/q_shared.c diff --git a/src/refresh/files/wal.c b/src/refresh/files/wal.c new file mode 100644 index 00000000..c67c9b14 --- /dev/null +++ b/src/refresh/files/wal.c @@ -0,0 +1,28 @@ +#include "../header/local.h" + +image_t * +GL_LoadWal ( char *name ) +{ + miptex_t *mt; + int width, height, ofs; + image_t *image; + + ri.FS_LoadFile( name, (void **) &mt ); + + if ( !mt ) + { + ri.Con_Printf( PRINT_ALL, "GL_LoadWall: can't load %s\n", name ); + return ( r_notexture ); + } + + width = LittleLong( mt->width ); + height = LittleLong( mt->height ); + ofs = LittleLong( mt->offsets [ 0 ] ); + + image = GL_LoadPic( name, (byte *) mt + ofs, width, height, it_wall, 8 ); + + ri.FS_FreeFile( (void *) mt ); + + return ( image ); +} + diff --git a/src/refresh/gl_image.c b/src/refresh/gl_image.c index 66ab1d5c..c98bcdc9 100644 --- a/src/refresh/gl_image.c +++ b/src/refresh/gl_image.c @@ -836,32 +836,6 @@ GL_LoadPic ( char *name, byte *pic, int width, int height, imagetype_t type, int return ( image ); } -image_t * -GL_LoadWal ( char *name ) -{ - miptex_t *mt; - int width, height, ofs; - image_t *image; - - ri.FS_LoadFile( name, (void **) &mt ); - - if ( !mt ) - { - ri.Con_Printf( PRINT_ALL, "GL_FindImage: can't load %s\n", name ); - return ( r_notexture ); - } - - width = LittleLong( mt->width ); - height = LittleLong( mt->height ); - ofs = LittleLong( mt->offsets [ 0 ] ); - - image = GL_LoadPic( name, (byte *) mt + ofs, width, height, it_wall, 8 ); - - ri.FS_FreeFile( (void *) mt ); - - return ( image ); -} - /* * Finds or loads the given image */ diff --git a/src/refresh/header/local.h b/src/refresh/header/local.h index f3a61e6a..46dc25f9 100644 --- a/src/refresh/header/local.h +++ b/src/refresh/header/local.h @@ -321,6 +321,7 @@ struct image_s *R_RegisterSkin (char *name); void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height); image_t *GL_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type, int bits); image_t *GL_FindImage (char *name, imagetype_t type); +image_t * GL_LoadWal ( char *name ); void GL_TextureMode( char *string ); void GL_ImageList_f (void);