Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

lightmap.h File Reference

#include "vector.h"
#include "texture.h"
#include "polygon.h"

Go to the source code of this file.

Compounds

struct  Lightmap
struct  StaticLight

Typedefs

typedef StaticLight StaticLight
typedef Lightmap Lightmap

Functions

void SetStaticLights (StaticLight *)
void CreateLightmaps (int numpolys, POLYGON *polylist, Lightmap *lightmaplist, StaticLight *staticlight)
void CreateBSPLightmaps (BSP_node *node)
void LoadBSPLightmaps (BSP_node *node)


Typedef Documentation

typedef struct Lightmap Lightmap
 

typedef struct StaticLight StaticLight
 


Function Documentation

void CreateBSPLightmaps BSP_node   node
 

Definition at line 330 of file lightmap.cpp.

References BSP_node::backnode, CreateLightmaps(), BSP_node::frontnode, BSP_node::leaf, BSP_node::nodelightmaplist, BSP_node::nodepolylist, and BSP_node::numpolys.

Referenced by InitGL().

00331 {
00332     if (node->leaf)
00333     {
00334         node->nodelightmaplist = new Lightmap[node->numpolys];
00335         CreateLightmaps(node->numpolys, node->nodepolylist, node->nodelightmaplist);
00336         return;
00337     }
00338     CreateBSPLightmaps(node->frontnode);
00339     CreateBSPLightmaps(node->backnode);
00340 }

void CreateLightmaps int    numpolys,
POLYGON   polylist,
Lightmap   lightmaplist,
StaticLight   staticlight
 

Referenced by CreateBSPLightmaps().

void LoadBSPLightmaps BSP_node   node
 

Definition at line 342 of file lightmap.cpp.

References BSP_node::backnode, BSP_node::frontnode, BSP_node::leaf, TEXTURE::LoadTGA(), BSP_node::nodelightmaplist, BSP_node::numpolys, and Lightmap::Texture.

Referenced by InitGL().

00343 {
00344     if (node->leaf)
00345     {
00346     for (int i = 0; i < node->numpolys; i++)
00347     {
00348         node->nodelightmaplist[i].Texture.LoadTGA(GL_LINEAR, GL_NEAREST_MIPMAP_LINEAR/*GL_NEAREST, GL_NEAREST*/, GL_CLAMP, GL_CLAMP, 1);
00349                 
00350     }
00351     return;
00352     }
00353     LoadBSPLightmaps(node->frontnode);
00354     LoadBSPLightmaps(node->backnode);
00355 }

void SetStaticLights StaticLight  
 

Definition at line 14 of file lightmap.cpp.

References StaticLight::Blue, StaticLight::Brightness, StaticLight::Green, StaticLight::Position, StaticLight::Radius, StaticLight::Red, VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by InitGL().

00015 {
00016     staticlight[0].Position.x = -4.0;
00017     staticlight[0].Position.y = 9.0;
00018     staticlight[0].Position.z = -50.0;
00019     staticlight[0].Radius = 300.0;
00020     staticlight[0].Brightness = 5.0;
00021     staticlight[0].Red = 255.0;
00022     staticlight[0].Green = 255.0;
00023     staticlight[0].Blue = 255.0;
00024 
00025     staticlight[1].Position.x = -28.0;
00026     staticlight[1].Position.y = 9.0;
00027     staticlight[1].Position.z = -50.0;
00028     staticlight[1].Radius = 300.0;
00029     staticlight[1].Brightness = 5.0;
00030     staticlight[1].Red = 255.0;
00031     staticlight[1].Green = 255.0;
00032     staticlight[1].Blue = 255.0;
00033 
00034     staticlight[2].Position.x = -52.0;
00035     staticlight[2].Position.y = 9.0;
00036     staticlight[2].Position.z = -50.0;
00037     staticlight[2].Radius = 300.0;
00038     staticlight[2].Brightness = 5.0;
00039     staticlight[2].Red = 255.0;
00040     staticlight[2].Green = 255.0;
00041     staticlight[2].Blue = 255.0;
00042 
00043     staticlight[3].Position.x = -4.0;
00044     staticlight[3].Position.y = 9.0;
00045     staticlight[3].Position.z = 50.0;
00046     staticlight[3].Radius = 300.0;
00047     staticlight[3].Brightness = 5.0;
00048     staticlight[3].Red = 255.0;
00049     staticlight[3].Green = 255.0;
00050     staticlight[3].Blue = 255.0;
00051 
00052     staticlight[4].Position.x = -28.0;
00053     staticlight[4].Position.y = 9.0;
00054     staticlight[4].Position.z = 50.0;
00055     staticlight[4].Radius = 300.0;
00056     staticlight[4].Brightness = 5.0;
00057     staticlight[4].Red = 255.0;
00058     staticlight[4].Green = 255.0;
00059     staticlight[4].Blue = 255.0;
00060 
00061     staticlight[5].Position.x = -52.0;
00062     staticlight[5].Position.y = 9.0;
00063     staticlight[5].Position.z = 50.0;
00064     staticlight[5].Radius = 300.0;
00065     staticlight[5].Brightness = 5.0;
00066     staticlight[5].Red = 255.0;
00067     staticlight[5].Green = 255.0;
00068     staticlight[5].Blue = 255.0;
00069 
00070     staticlight[6].Position.x = 110.0;
00071     staticlight[6].Position.y = 5.0;
00072     staticlight[6].Position.z = 120.0;
00073     staticlight[6].Radius = 100.0;
00074     staticlight[6].Brightness = 30.0;
00075     staticlight[6].Red = 255.0;
00076     staticlight[6].Green = 255.0;
00077     staticlight[6].Blue = 255.0;
00078 
00079     staticlight[7].Position.x = 140.0;
00080     staticlight[7].Position.y = 0.0;
00081     staticlight[7].Position.z = -20.0;
00082     staticlight[7].Radius = 100.0;
00083     staticlight[7].Brightness = 10.0;
00084     staticlight[7].Red = 0.0;
00085     staticlight[7].Green = 255.0;
00086     staticlight[7].Blue = 255.0;
00087 
00088     staticlight[8].Position.x = 0.0;
00089     staticlight[8].Position.y = 25.0;
00090     staticlight[8].Position.z = 0.0;
00091     staticlight[8].Radius = 45.0;
00092     staticlight[8].Brightness = 12.0;
00093     staticlight[8].Red = 250.0;
00094     staticlight[8].Green = 170.0;
00095     staticlight[8].Blue = 50.0;
00096 }


Generated on Fri Dec 23 05:20:20 2005 for Portals by doxygen1.2.15