00001 00007 #ifndef _LEVEL_H_ 00008 #define _LEVEL_H_ 00009 00010 #include <stdlib.h> 00011 #include <stdio.h> 00012 #include <string.h> 00013 #include "../Math/Vector.h" 00014 00015 #define LVL_MAX_LIGHTS 4 00016 #define LVL_MAX_MODELS 4 00017 00018 struct LevelLight { 00019 Vec3 pos; 00020 Vec4 color; 00021 Vec4 ambient; 00022 Vec3 attenuation; 00023 float pulse; 00024 float radius; 00025 }; 00026 00027 struct LevelInfo { 00028 char name[32]; 00029 unsigned int music; 00030 unsigned int sky; 00031 int numModels; 00032 char modelsPath[128]; 00033 char models[LVL_MAX_MODELS][32]; 00034 char texWater[32]; 00035 char texWaterSurface[32]; 00036 float waterSurfaceSpeed; 00037 char texWall[32]; 00038 char texFloor[32]; 00039 float gravity; 00040 float friction; 00041 int numLights; 00042 LevelLight lights[LVL_MAX_LIGHTS]; 00043 int width; 00044 int height; 00045 unsigned char *data; 00046 }; 00047 00048 class Level { 00049 public: 00050 static bool load(LevelInfo &lvl, const char *filename); 00051 static bool save(LevelInfo &lvl, const char *filename); 00052 static void unload(LevelInfo &lvl); 00053 }; 00054 00055 #endif