Back to index

extremetuxracer  0.5beta
snow.h
Go to the documentation of this file.
00001 /* 
00002  * PPRacer 
00003  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _SNOW_H_
00021 #define _SNOW_H_
00022 
00023 #include "ppgltk/ppgltk.h"
00024 
00025 #include "player.h"
00026 
00027 static double xrand (double min, double max);
00028 
00029 void UpdateArea(pp::Vec3d pos);
00030 static void MakeSnowParticle (int i);
00031 static void MakeNearParticle (int i);
00032  
00033 void init_snow( pp::Vec3d playerPos);
00034 void update_snow( double time_step, bool windy, pp::Vec3d playerPos );
00035 void draw_snow( pp::Vec3d eyepoint );
00036 
00037 void update_wind();
00038 
00039 void draw_sprite( pp::Vec3d eyepoint, pp::Vec3d spriteLoc, double spriteSize, pp::Vec2d tex_min, pp::Vec2d tex_max );
00040 void draw_cuboid_areas();
00041 
00042 typedef struct {
00043     double speed;
00044     double minSize; 
00045     double maxSize;
00046     int MAXPART;
00047     int MAXNEAR;
00048 } SnowType;
00049 
00050 typedef struct {
00051     pp::Vec3d wind_vel;
00052 } WindType;
00053 
00054 static const int SnowTypeArgCount = 5;
00055 static const int WindTypeArgCount = 3;
00056 
00057 void reset_snow();
00058 
00059 void RegisterSnowType(int index, SnowType type);
00060 void SetSnowType(int index);
00061 void RegisterWindType(int index, WindType type);
00062 void SetWindType(int index);
00063 
00064 //wind vector
00065 extern pp::Vec3d wind_vel;
00066 
00067 extern double wind_scale;
00068 
00069 #endif // _SNOW_H_