… | |
… | |
12 | static GLuint global_texture = 0; |
12 | static GLuint global_texture = 0; |
13 | |
13 | |
14 | #include "util.h" |
14 | #include "util.h" |
15 | #include "entity.h" |
15 | #include "entity.h" |
16 | #include "txtprt_import.h" |
16 | #include "txtprt_import.h" |
|
|
17 | |
|
|
18 | bool doom3parse (const char *f); |
17 | |
19 | |
18 | #include "shader.h" |
20 | #include "shader.h" |
19 | |
21 | |
20 | /**********************************************************************/ |
22 | /**********************************************************************/ |
21 | |
23 | |
… | |
… | |
169 | e->show (); |
171 | e->show (); |
170 | } |
172 | } |
171 | |
173 | |
172 | void fisch (vec3 center, GLfloat radius, int depth) |
174 | void fisch (vec3 center, GLfloat radius, int depth) |
173 | { |
175 | { |
174 | entity *planet = new entity (new geometry_sphere (radius)); |
176 | entity *planet = new entity (new geometry_sphere (testmat, radius)); |
175 | planet->move (center); |
177 | planet->move (center); |
176 | planet->show (); |
178 | planet->show (); |
177 | |
179 | |
178 | if (--depth) |
180 | if (--depth) |
179 | { |
181 | { |
… | |
… | |
300 | |
302 | |
301 | /* Set the gamma for the window */ |
303 | /* Set the gamma for the window */ |
302 | if (gamma != 0.0) |
304 | if (gamma != 0.0) |
303 | SDL_SetGamma (gamma, gamma, gamma); |
305 | SDL_SetGamma (gamma, gamma, gamma); |
304 | |
306 | |
|
|
307 | |
|
|
308 | |
305 | testmat = new test_material; |
309 | testmat = new test_material; |
306 | |
310 | |
307 | #if 0 |
|
|
308 | entity *planet = new entity (new geometry_sphere (10)); |
311 | entity *planet = new entity (new geometry_sphere (testmat, 10)); |
309 | planet->move (vec3 (0, 0, -20)); |
312 | planet->move (vec3 (0, 0, -20)); |
310 | planet->show (); |
313 | planet->show (); |
311 | #endif |
314 | |
|
|
315 | //doom3parse ("test.proc"); |
312 | |
316 | |
313 | for (int i = 0; i < 20; i++) |
317 | for (int i = 0; i < 20; i++) |
314 | { |
318 | { |
315 | // load a entity |
319 | // load a entity |
316 | txtprt_parser p; |
320 | txtprt_parser p; |
… | |
… | |
327 | entity *e = new entity (g); |
331 | entity *e = new entity (g); |
328 | e->move (vec3 (i*5, -3, -i*10)); |
332 | e->move (vec3 (i*5, -3, -i*10)); |
329 | e->show (); |
333 | e->show (); |
330 | } |
334 | } |
331 | |
335 | |
332 | #if 0 |
|
|
333 | { |
336 | { |
334 | fisch (vec3 (0, 0, -2e9), 1e9, 8); |
337 | fisch (vec3 (0, 0, -2e9), 1e9, 8); |
335 | //entity *planet = new entity (new geometry_sphere (1e9)); |
338 | //entity *planet = new entity (new geometry_sphere (1e9)); |
336 | //planet->move (vec3 (0, 0, -1.5e9)); |
339 | //planet->move (vec3 (0, 0, -1.5e9)); |
337 | //planet->show (); |
340 | //planet->show (); |
338 | } |
341 | } |
339 | |
342 | |
340 | { |
343 | { |
341 | entity *planet = new entity (new geometry_sphere (4e15)); |
344 | entity *planet = new entity (new geometry_sphere (testmat, 4e15)); |
342 | planet->move (vec3 (0, 0, 1e17)); |
345 | planet->move (vec3 (0, 0, 1e17)); |
343 | planet->show (); |
346 | planet->show (); |
344 | } |
347 | } |
345 | |
348 | |
346 | //draw_floor (10, -500, -10, -1000); |
349 | //draw_floor (10, -500, -10, -1000); |
347 | draw_level (); |
350 | draw_level (); |
348 | |
351 | |
349 | |
352 | |
|
|
353 | #if 0 |
350 | { |
354 | { |
351 | geometry_heightfield *hf = new geometry_heightfield (100000., 100000.); |
355 | geometry_heightfield *hf = new geometry_heightfield (100000., 100000.); |
352 | entity *e = new entity (hf); |
356 | entity *e = new entity (hf); |
353 | e->move (vec3 (-100000, -100000 * 0.01, -100000)); |
357 | e->move (vec3 (-100000, -100000 * 0.01, -100000)); |
354 | e->show (); |
358 | e->show (); |
355 | } |
359 | } |
|
|
360 | #endif |
356 | |
361 | |
357 | //draw_test_nurb (); |
362 | //draw_test_nurb (); |
358 | #endif |
|
|
359 | |
363 | |
360 | //camera.orig.x = 108; camera.orig.y = 0; camera.orig.z = -368; |
364 | //camera.orig.x = 108; camera.orig.y = 0; camera.orig.z = -368; |
361 | camera.orig.x = 0; camera.orig.y = 0; camera.orig.z = 0; |
365 | camera.orig.x = 0; camera.orig.y = 0; camera.orig.z = 0; |
362 | camera.p = point (0, 0, 10); |
366 | camera.p = point (0, 0, 10); |
363 | camera.d = vec3 (0, 0, -1); |
367 | camera.d = vec3 (0, 0, -1); |
… | |
… | |
373 | frames = 0; |
377 | frames = 0; |
374 | |
378 | |
375 | linear_light mylight; |
379 | linear_light mylight; |
376 | mylight.radius = 100000; |
380 | mylight.radius = 100000; |
377 | mylight.c = colour (1., 1, 1, 1.); |
381 | mylight.c = colour (1., 1, 1, 1.); |
378 | mylight.intensity = 1.2; |
382 | mylight.intensity = 1.F; |
379 | |
383 | |
380 | pass pass_light (&mylight); |
384 | pass pass_light (&mylight); |
381 | |
385 | |
382 | while (!done) |
386 | while (!done) |
383 | { |
387 | { |