Commits

Anonymous committed 965c37c

Roughed out the particle system.

Comments (0)

Files changed (7)

Terrain/Avatar.cpp

   avatar.Update ();
   time_passed = GameTime () - last_time;
   last_time = GameTime ();
-  TextPrint ("%s %1.2f", anim_names[anim_id], elapsed);
+  TextPrint ("%s elapsed: %f", anim_names[anim_id], elapsed);
   region = WorldRegionGet ((int)(position.x + REGION_HALF) / REGION_SIZE, (int)(position.y + REGION_HALF) / REGION_SIZE);
   do_camera ();
   do_location ();

Terrain/CBrush.cpp

     size.y = max (size.x, size.y);//Don't lest bushes get wider than they are tall
     color = CacheSurfaceColor (world_x, world_y, SURFACE_COLOR_GRASS);
     color *= 0.75f;
-    color.green += 0.1f;
     color.alpha = 1.0f;
     //Now we construct our grass panels
     for (i = 0; i < 4; i++) { 
 ? Fix opaque trees on mike's PC
 * shadows
 * Collision
+* Particles
 
 http://www.bramstein.com/projects/gui/
 
 #include "sdl.h"
 #include "il\il.h"
 #include "main.h"
+#include "particle.h"
 #include "player.h"
 #include "random.h"
 #include "render.h"
     SkyUpdate ();
     SceneUpdate (stop);
     CacheUpdate (stop);
+    ParticleUpdate ();
     RenderUpdate ();
     Render ();	
     remaining = stop - SdlTick ();

Terrain/Scene.cpp

 #include "ini.h"
 #include "input.h"
 #include "math.h"
+#include "particle.h"
 #include "render.h"
 #include "scene.h"
 #include "sky.h"
     glDisable(GL_TEXTURE_2D);
   else
     glEnable(GL_TEXTURE_2D);
-  //SkyRender ();
+  SkyRender ();
   glDisable(GL_CULL_FACE);
   CgShaderSelect (VSHADER_TREES);
   CgShaderSelect (FSHADER_GREEN);
   CgShaderSelect (VSHADER_NORMAL);
   AvatarRender ();
   CgShaderSelect (FSHADER_NONE);
+  CgShaderSelect (VSHADER_NONE);
+  ParticleRender ();
 
 }
 

Terrain/Terraform.cpp

 #include "world.h"
 
 //The number of regions around the edge which should be ocean.
-#define OCEAN_BUFFER      (WORLD_GRID / 6) 
+#define OCEAN_BUFFER      (WORLD_GRID / 10) 
 //This affects the mapping of the coastline.  Higher = busier, more repetitive coast.
 #define FREQUENCY         3 
 //How many different colors of flowers are available
     //Oceans are ALWAYS WET.
     if (r.climate == CLIMATE_OCEAN) 
       rainfall = 1.0f;
+    rain_loss = 0.0f;
     //We lose rainfall as we move inland.
-    rain_loss = 1.0f / WORLD_GRID_CENTER;
+    if (r.climate != CLIMATE_OCEAN && r.climate != CLIMATE_COAST && r.climate != CLIMATE_LAKE)
+      rain_loss = 1.0f / WORLD_GRID_CENTER;
     //We lose rainfall more slowly as it gets colder.
     if (temp < 0.5f)
-      rain_loss *= temp * 1.0f;
+      rain_loss *= temp;
     rainfall -= rain_loss;
     //Mountains block rainfall
     if (r.climate == CLIMATE_MOUNTAIN) 
       if (r.moisture > 0.8f && r.temperature > 0.5f)
         climates.push_back (CLIMATE_SWAMP);
       //mountains only appear in the middle
-      //if (abs (x - WORLD_GRID_CENTER) < 10 && radius > 1)
-        //climates.push_back (CLIMATE_MOUNTAIN);
+      if (abs (x - WORLD_GRID_CENTER) < 10 && radius > 1)
+        climates.push_back (CLIMATE_MOUNTAIN);
       //Deserts are HOT and DRY. Duh.
       if (r.temperature > TEMP_HOT && r.moisture < 0.05f && radius > 1)
         climates.push_back (CLIMATE_DESERT);

Terrain/Terrain.vcxproj

     <ClCompile Include="glQuat.cpp" />
     <ClCompile Include="glRgba.cpp" />
     <ClCompile Include="glUvbox.cpp" />
+    <ClCompile Include="Particle.cpp" />
     <ClCompile Include="Player.cpp" />
     <ClCompile Include="Random.cpp" />
     <ClCompile Include="Region.cpp" />
     <ClInclude Include="Input.h" />
     <ClInclude Include="Main.h" />
     <ClInclude Include="Math.h" />
+    <ClInclude Include="Particle.h" />
     <ClInclude Include="Random.h" />
     <ClInclude Include="Region.h" />
     <ClInclude Include="Render.h" />
 
 #define REGION_SIZE             64
 #define REGION_HALF             (REGION_SIZE / 2)
-#define WORLD_GRID              64
+#define WORLD_GRID              128
 #define WORLD_GRID_EDGE         (WORLD_GRID + 1)
 #define WORLD_GRID_CENTER       (WORLD_GRID / 2)
 #define WORLD_SIZE_METERS       (REGION_SIZE * WORLD_GRID)
 //This is the size of the grid of trees.  The total number of tree species 
 //in the world is the square of this value, minus one. ("tree zero" is actually
 //"no trees at all".)
-#define TREE_TYPES        8
+#define TREE_TYPES        6
 
 enum Climate
 {