comparison libvo/matrixview.c @ 36241:0cfa55e44ea5

Remove code related to unused lighting.
author reimar
date Wed, 12 Jun 2013 18:54:14 +0000
parents f73711af11ae
children 406e87858d1f
comparison
equal deleted inserted replaced
36240:e8640e3f9b7e 36241:0cfa55e44ea5
32 #include "matrixview_font.h" 32 #include "matrixview_font.h"
33 33
34 static float matrix_contrast = 1.5; 34 static float matrix_contrast = 1.5;
35 static float matrix_brightness = 1.0; 35 static float matrix_brightness = 1.0;
36 36
37 // Settings for our light. Try playing with these (or add more lights).
38 static float Light_Ambient[] = { 0.1f, 0.1f, 0.1f, 1.0f };
39 static float Light_Diffuse[] = { 1.2f, 1.2f, 1.2f, 1.0f };
40 static float Light_Position[] = { 2.0f, 2.0f, 0.0f, 1.0f };
41
42 static const uint8_t flare[4][4] = { 37 static const uint8_t flare[4][4] = {
43 { 0, 0, 0, 0}, 38 { 0, 0, 0, 0},
44 { 0, 180, 0, 0}, 39 { 0, 180, 0, 0},
45 { 0, 0, 0, 0}, 40 { 0, 0, 0, 0},
46 { 0, 0, 0, 0} 41 { 0, 0, 0, 0}
74 light *= matrix_brightness; 69 light *= matrix_brightness;
75 num2 = num / 10; 70 num2 = num / 10;
76 num3 = num - (num2 * 10); 71 num3 = num - (num2 * 10);
77 ty = (float)num2 / 7; 72 ty = (float)num2 / 7;
78 tx = (float)num3 / 10; 73 tx = (float)num3 / 10;
79 mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
80 mpglColor4ub(0, 255, 0, light); // Basic polygon color 74 mpglColor4ub(0, 255, 0, light); // Basic polygon color
81 75
82 mpglTexCoord2f(tx, ty); 76 mpglTexCoord2f(tx, ty);
83 mpglVertex3f(x, y, z); 77 mpglVertex3f(x, y, z);
84 mpglTexCoord2f(tx + 0.1, ty); 78 mpglTexCoord2f(tx + 0.1, ty);
96 90
97 num2 = num / 10; 91 num2 = num / 10;
98 num3 = num - (num2 * 10); 92 num3 = num - (num2 * 10);
99 ty = (float)num2 / 7; 93 ty = (float)num2 / 7;
100 tx = (float)num3 / 10; 94 tx = (float)num3 / 10;
101 mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
102 mpglColor4ub(255, 255, 255, 128); // Basic polygon color 95 mpglColor4ub(255, 255, 255, 128); // Basic polygon color
103 96
104 mpglTexCoord2f(tx, ty); 97 mpglTexCoord2f(tx, ty);
105 mpglVertex3f(x, y, z); 98 mpglVertex3f(x, y, z);
106 mpglTexCoord2f(tx + 0.1, ty); 99 mpglTexCoord2f(tx + 0.1, ty);
111 mpglVertex3f(x, y - 1, z); 104 mpglVertex3f(x, y - 1, z);
112 } 105 }
113 106
114 static void draw_flare(float x, float y, float z) //flare 107 static void draw_flare(float x, float y, float z) //flare
115 { 108 {
116 mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
117 mpglColor4ub(255, 255, 255, 204); // Basic polygon color 109 mpglColor4ub(255, 255, 255, 204); // Basic polygon color
118 110
119 mpglTexCoord2f(0, 0); 111 mpglTexCoord2f(0, 0);
120 mpglVertex3f(x - 1, y + 1, z); 112 mpglVertex3f(x - 1, y + 1, z);
121 mpglTexCoord2f(0.75, 0); 113 mpglTexCoord2f(0.75, 0);
279 271
280 // Depth to clear depth buffer to; type of test. 272 // Depth to clear depth buffer to; type of test.
281 mpglClearDepth(1.0); 273 mpglClearDepth(1.0);
282 mpglDepthFunc(GL_LESS); 274 mpglDepthFunc(GL_LESS);
283 275
284 // Enables Smooth Color Shading; try GL_FLAT for (lack of) fun.
285 mpglShadeModel(GL_SMOOTH);
286
287 // Set up a light, turn it on.
288 mpglLightfv(GL_LIGHT1, GL_POSITION, Light_Position);
289 mpglLightfv(GL_LIGHT1, GL_AMBIENT, Light_Ambient);
290 mpglLightfv(GL_LIGHT1, GL_DIFFUSE, Light_Diffuse);
291 mpglEnable(GL_LIGHT1);
292
293 // A handy trick -- have surface material mirror the color.
294 mpglColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
295 mpglEnable(GL_COLOR_MATERIAL);
296
297 // Allow adjusting of texture color via glColor 276 // Allow adjusting of texture color via glColor
298 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 277 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
299 278
300 mpglEnable(GL_BLEND); 279 mpglEnable(GL_BLEND);
301 mpglEnable(GL_TEXTURE_2D); 280 mpglEnable(GL_TEXTURE_2D);
302 281
303 mpglDisable(GL_LIGHTING);
304 mpglBlendFunc(GL_SRC_ALPHA, GL_ONE); 282 mpglBlendFunc(GL_SRC_ALPHA, GL_ONE);
305 mpglDisable(GL_DEPTH_TEST); 283 mpglDisable(GL_DEPTH_TEST);
306 284
307 matrixview_reshape(w, h); 285 matrixview_reshape(w, h);
308 } 286 }