Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[b09f68]: contrib / asteroids3d-0.1.154.patch Maximize Restore History

Download this file

asteroids3d-0.1.154.patch    130 lines (113 with data), 4.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
diff -uNr asteroids3D/Makefile asteroids3D-0.1.154rr/Makefile
--- asteroids3D/Makefile Mon Aug 14 12:20:57 2000
+++ asteroids3D-0.1.154rr/Makefile Sun Sep 24 13:59:49 2000
@@ -1,7 +1,7 @@
# libraries and includes for Mesa
-INC=-I/usr/X11R6/include -I/usr/local/opengl/include
-LIB=-lglut -lGLU -lGL -lm -lX11 -lXext -lXmu -lXi -lpthread -L/usr/X11R6/lib -L/usr/local/opengl/lib
+INC=-I/usr/X11R6/include -I/usr/local/include/GL
+LIB=-lglut -lGLU -lGL -lm -lX11 -lXext -lXmu -lXi -lpthread -L/usr/X11R6/lib -L/usr/local/lib
PROG=asteroids3D
Binary files asteroids3D/asteroids3D and asteroids3D-0.1.154rr/asteroids3D differ
diff -uNr asteroids3D/asteroids3D.h asteroids3D-0.1.154rr/asteroids3D.h
--- asteroids3D/asteroids3D.h Fri Sep 22 10:23:18 2000
+++ asteroids3D-0.1.154rr/asteroids3D.h Sun Sep 24 13:55:21 2000
@@ -64,7 +64,7 @@
#define WINDOWY 800
/* What's your favorite kind of pi ? */
-#define PI 3.14159
+#define PI M_PI
/* for glutTimerFuncs */
#define MSEC 1
@@ -127,7 +127,7 @@
#define NUM_BLAST_TYPES 5
/* nebula billboard textures */
-#define NUM_NEBULA_TEX 3
+#define NUM_NEBULA_TEX 4
/* initial shield/max shield strength, and shield recharge rate per second */
#define MAX_SHIELD 4000
diff -uNr asteroids3D/display.c asteroids3D-0.1.154rr/display.c
--- asteroids3D/display.c Fri Sep 15 15:11:40 2000
+++ asteroids3D-0.1.154rr/display.c Sun Sep 24 14:05:12 2000
@@ -421,6 +421,7 @@
glCallList(nebula_dl[0]);
glCallList(nebula_dl[1]);
glCallList(nebula_dl[2]);
+ glCallList(nebula_dl[3]);
glPopMatrix() ;
return ;
Binary files asteroids3D/nebula_tex1.ppm and asteroids3D-0.1.154rr/nebula_tex1.ppm differ
Binary files asteroids3D/nebula_tex3.ppm and asteroids3D-0.1.154rr/nebula_tex3.ppm differ
diff -uNr asteroids3D/sun.c asteroids3D-0.1.154rr/sun.c
--- asteroids3D/sun.c Tue Sep 12 17:17:36 2000
+++ asteroids3D-0.1.154rr/sun.c Sun Sep 24 14:43:35 2000
@@ -97,9 +97,8 @@
- /* nebula 1 & 2 are here to look pretty (and slow the game down! :-) )*/
-
-
+ /* nebulas 1, 2 & 3 are here to look pretty and slow the game down! */
+
k = -40 ;
nebula_dl[1] = glGenLists (1);
glNewList (nebula_dl[1], GL_COMPILE);
@@ -139,6 +138,32 @@
glPushMatrix() ;
glTranslatef( 0 , 0 , -65 ) ;
glRotatef(180,1,0,0) ;
+ glBegin(GL_QUADS) ;
+ glTexCoord2f( 0,0 );
+ glVertex3f( 0,0,0 ) ;
+
+ glTexCoord2f( 0,1 );
+ glVertex3f( 0,k,0 ) ;
+
+ glTexCoord2f( 1,1 );
+ glVertex3f( k,k,0 ) ;
+
+ glTexCoord2f( 1,0 );
+ glVertex3f( k,0,0 ) ;
+ glEnd() ;
+ glPopMatrix() ;
+ glBindTexture(GL_TEXTURE_2D,0) ;
+ glEndList ();
+
+ k = -45 ;
+ nebula_dl[3] = glGenLists (1);
+ glNewList (nebula_dl[3], GL_COMPILE);
+ glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE) ;
+ glBindTexture(GL_TEXTURE_2D,nebula_tex[3]) ;
+
+ glPushMatrix() ;
+ glTranslatef( 0 , 65 , 0 ) ;
+ glRotatef(-90,1,0,0) ;
glBegin(GL_QUADS) ;
glTexCoord2f( 0,0 );
glVertex3f( 0,0,0 ) ;
diff -uNr asteroids3D/texture.c asteroids3D-0.1.154rr/texture.c
--- asteroids3D/texture.c Tue Sep 12 17:16:52 2000
+++ asteroids3D-0.1.154rr/texture.c Sun Sep 24 14:27:11 2000
@@ -37,6 +37,7 @@
char *nebula_tex0 ;
char *nebula_tex1 ;
char *nebula_tex2 ;
+ char *nebula_tex3 ;
char *torp_tex0 ;
/* WARNING! There had better be NUM_AST_TYPES number of textures! */
@@ -178,6 +179,21 @@
average_RGBA_alpha_and_floor(nebula_tex2, 256, 256, 90) ;
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,256,256,0,GL_RGBA,GL_UNSIGNED_BYTE,nebula_tex2) ;
+
+ /* M31 + 32 (Andromeda) */
+ glGenTextures(1, &nebula_tex[3]) ;
+ glBindTexture(GL_TEXTURE_2D,nebula_tex[3]) ;
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR) ;
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR) ;
+ /*glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL) ;*/
+
+ nebula_tex3 = read_bppm_tex("nebula_tex3.ppm", 15, 256, 256) ;
+
+ nebula_tex3 = add_alpha_channel_to_RGB_image(nebula_tex3, 256, 256) ;
+
+ average_RGBA_alpha_and_floor(nebula_tex3, 256, 256, 90) ;
+
+ glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,256,256,0,GL_RGBA,GL_UNSIGNED_BYTE,nebula_tex3) ;