wal in eine eigene datei

This commit is contained in:
Yamagi Burmeister 2010-10-21 07:44:15 +00:00
parent b94c471a24
commit 70f14e4fa5
4 changed files with 35 additions and 28 deletions

View File

@ -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

28
src/refresh/files/wal.c Normal file
View File

@ -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 );
}

View File

@ -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
*/

View File

@ -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);