Path: blob/main/games/apoolGL/files/patch-gl.c
16149 views
--- gl.c.orig Sat Aug 13 01:51:49 20051+++ gl.c Thu Sep 1 02:19:45 20052@@ -40,7 +40,7 @@3#include <GL/glu.h>4#include <string.h>5#include "apool.h"6-#include <linux/param.h>7+#include <sys/param.h>8#include <sys/time.h>910#ifndef M_PI11@@ -452,14 +452,14 @@12int LoadGLTextures( void ) /* ebenfalls basierend auf einem Nehe Tutorial */13{ /* aber f�r mehrere Texturen angepasst und erweitert f. Mipmapping, Cube-Textures, usw.*/14int i;15- char txt[80];16+ char txt[PATH_MAX];17SDL_Surface *TextureImage[ANZ_TEXTURES];18memset(TextureImage,0,sizeof(void *)*ANZ_TEXTURES);19texture = malloc((sizeof(int) * ANZ_TEXTURES));2021for(i=0;i<BALLS;i++)22{23- sprintf(txt,"textures-hi/%d.bmp",i);24+ sprintf(txt,DATADIR"/textures-hi/%d.bmp",i);25if( !(TextureImage[i]=LoadBMP(txt)) )26{27printf("can't find %d of hd textures\n",i);28@@ -469,7 +469,7 @@2930for(i=BALLS;i<2*BALLS;i++)31{32- sprintf(txt,"textures-lo/%d.bmp",i-BALLS);33+ sprintf(txt,DATADIR"/textures-lo/%d.bmp",i-BALLS);34if( !(TextureImage[i]=LoadBMP(txt)) )35{36printf("can't find %d of ld textures\n",i-BALLS);37@@ -477,11 +477,11 @@38}39}4041- if( !(TextureImage[i++]=LoadBMP("textures-hi/Font.bmp")) ) return FALSE;42- if( !(TextureImage[i++]=LoadBMP("textures-hi/Holz.bmp")) ) return FALSE;43- if( !(TextureImage[i++]=LoadBMP("textures-hi/Marmor.bmp")) ) return FALSE;44- if( !(TextureImage[i++]=LoadBMP("textures-hi/Tuch.bmp")) ) return FALSE;45- if( !(TextureImage[i++]=LoadBMP("textures-hi/Env.bmp")) ) return FALSE;46+ if( !(TextureImage[i++]=LoadBMP(DATADIR"/textures-hi/Font.bmp")) ) return FALSE;47+ if( !(TextureImage[i++]=LoadBMP(DATADIR"/textures-hi/Holz.bmp")) ) return FALSE;48+ if( !(TextureImage[i++]=LoadBMP(DATADIR"/textures-hi/Marmor.bmp")) ) return FALSE;49+ if( !(TextureImage[i++]=LoadBMP(DATADIR"/textures-hi/Tuch.bmp")) ) return FALSE;50+ if( !(TextureImage[i++]=LoadBMP(DATADIR"/textures-hi/Env.bmp")) ) return FALSE;5152glGenTextures(ANZ_TEXTURES, &texture[0]);53for (i=0; i<ANZ_TEXTURES; i++)545556