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