32 void Print(
const char* fmt, ...);
36 static Camera emergency_cam;
37 static Scene emergency_scene;
42 :
View(c), video(0), camera(cam), projector(c, cam), scene(s),
43 lens_flare_enable(0), halo_bitmap(0), infinite(0),
44 projection_type(
Video::PROJECTION_PERSPECTIVE)
54 scene = &emergency_scene;
84 scene = &emergency_scene;
187 if (
camera == &emergency_cam)
315 while (++graphic_iter) {
343 while (++light_iter) {
348 if (!bright_enough) {
351 bright_enough =
true;
357 bright_enough =
false;
361 bright_enough =
false;
364 double obs_radius = graphic->
Radius();
365 if (obs_radius < 100)
419 bool foregroundVisible =
false;
422 while (++iter && !foregroundVisible) {
425 foregroundVisible =
true;
428 if (!foregroundVisible)
565 if (g->
Depth() > 5e6) {
595 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
605 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
610 while (++shadow_iter) {
628 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
640 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
657 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
668 if (distant && g->
Depth() > 5e6 || !distant && g->
Depth() < 5e6) {
708 int flare_visible = 0;
711 while (++light_iter) {
723 if (distance > 1e9) {
738 int x = (int) (sun_pos.
x);
739 int y = (int) (sun_pos.
y);
748 Point vector = center - sun_pos;
749 float vlen = (float) vector.
length();
752 static int nelem = 12;
753 static int elem_indx[] = { 0, 1, 1, 1, 0, 0, 0, 0, 2, 0, 0, 2 };
754 static float elem_dist[] = { -0.2f, 0.5f, 0.55f, 0.62f, 1.23f, 1.33f, 1.35f, 0.8f, 0.9f, 1.4f, 1.7f, 1.8f };
755 static float elem_size[] = { 0.3f, 0.2f, 0.4f, 0.3f, 0.4f, 0.2f, 0.6f, 0.1f, 0.1f, 1.6f, 1.0f, 0.2f };
757 for (
int elem = 0; elem < nelem; elem++) {
768 flare_pos = sun_pos + (vector * elem_dist[elem] * vlen);
769 x = (int) (flare_pos.
x);
770 y = (int) (flare_pos.
y);
771 w = (int) (
window->
Width() / 8.0 * elem_size[elem]);