]> github.com/historicalsource and other repositories - Darwinia-and-Multiwinia-Source-Code.git/commitdiff
code: trim trailing whitespaces
authorSteven <Steven@9244cb4f-d52e-49a9-a756-7d4e53ad8306>
Tue, 8 Jun 2010 19:11:42 +0000 (19:11 +0000)
committerSteven <Steven@9244cb4f-d52e-49a9-a756-7d4e53ad8306>
Tue, 8 Jun 2010 19:11:42 +0000 (19:11 +0000)
414 files changed:
darwinia/code/3d_sierpinski_gasket.cpp
darwinia/code/app.cpp
darwinia/code/app.h
darwinia/code/attract.cpp
darwinia/code/camera.cpp
darwinia/code/camera.h
darwinia/code/clouds.cpp
darwinia/code/control_help.cpp
darwinia/code/control_help.h
darwinia/code/deform.cpp
darwinia/code/demoendsequence.cpp
darwinia/code/demoendsequence.h
darwinia/code/effect_processor.cpp
darwinia/code/effect_processor.h
darwinia/code/entity_grid.cpp
darwinia/code/entity_grid.h
darwinia/code/explosion.cpp
darwinia/code/explosion.h
darwinia/code/game_menu.cpp
darwinia/code/game_menu.h
darwinia/code/gamecursor.cpp
darwinia/code/gamecursor.h
darwinia/code/gesture.cpp
darwinia/code/gesture.h
darwinia/code/gesture_demo_win32.cpp
darwinia/code/global_internet.cpp
darwinia/code/global_internet.h
darwinia/code/global_world.cpp
darwinia/code/global_world.h
darwinia/code/helpsystem.cpp
darwinia/code/helpsystem.h
darwinia/code/interface/buildings_window.cpp
darwinia/code/interface/buynow_window.cpp
darwinia/code/interface/buynow_window.h
darwinia/code/interface/camera_anim_window.cpp
darwinia/code/interface/camera_mount_window.cpp
darwinia/code/interface/cheat_window.cpp
darwinia/code/interface/darwinia_window.cpp
darwinia/code/interface/darwinia_window.h
darwinia/code/interface/debugmenu.cpp
darwinia/code/interface/demoend_window.cpp
darwinia/code/interface/demoend_window.h
darwinia/code/interface/drop_down_menu.cpp
darwinia/code/interface/drop_down_menu.h
darwinia/code/interface/editor_window.cpp
darwinia/code/interface/filedialog.cpp
darwinia/code/interface/filedialog.h
darwinia/code/interface/gesture_window.cpp
darwinia/code/interface/globalworldeditor_window.cpp
darwinia/code/interface/input_field.cpp
darwinia/code/interface/input_field.h
darwinia/code/interface/instant_unit_window.cpp
darwinia/code/interface/instant_unit_window.h
darwinia/code/interface/landscape_window.cpp
darwinia/code/interface/landscape_window.h
darwinia/code/interface/lights_window.cpp
darwinia/code/interface/lights_window.h
darwinia/code/interface/mainmenus.cpp
darwinia/code/interface/mainmenus.h
darwinia/code/interface/message_dialog.cpp
darwinia/code/interface/mods_window.cpp
darwinia/code/interface/mods_window.h
darwinia/code/interface/network_window.cpp
darwinia/code/interface/prefs_graphics_window.cpp
darwinia/code/interface/prefs_graphics_window.h
darwinia/code/interface/prefs_keybindings_window.cpp
darwinia/code/interface/prefs_other_window.cpp
darwinia/code/interface/prefs_other_window.h
darwinia/code/interface/prefs_screen_window.cpp
darwinia/code/interface/prefs_screen_window.h
darwinia/code/interface/prefs_sound_window.cpp
darwinia/code/interface/prefs_sound_window.h
darwinia/code/interface/profilewindow.cpp
darwinia/code/interface/profilewindow.h
darwinia/code/interface/reallyquit_window.cpp
darwinia/code/interface/save_on_quit_window.cpp
darwinia/code/interface/scrollbar.cpp
darwinia/code/interface/scrollbar.h
darwinia/code/interface/sound_profile_window.cpp
darwinia/code/interface/soundeditor_window.cpp
darwinia/code/interface/soundeditor_window.h
darwinia/code/interface/soundparameter_window.cpp
darwinia/code/interface/soundparameter_window.h
darwinia/code/interface/soundstats_window.cpp
darwinia/code/interface/soundstats_window.h
darwinia/code/interface/tree_window.cpp
darwinia/code/interface/tree_window.h
darwinia/code/interface/updateavailable_window.cpp
darwinia/code/interface/userprofile_window.cpp
darwinia/code/interface/userprofile_window.h
darwinia/code/keygen.cpp
darwinia/code/landscape.cpp
darwinia/code/landscape.h
darwinia/code/landscape_renderer.cpp
darwinia/code/landscape_renderer.h
darwinia/code/level_file.cpp
darwinia/code/level_file.h
darwinia/code/lib/2d_array.cpp
darwinia/code/lib/2d_array.h
darwinia/code/lib/2d_surface_map.cpp
darwinia/code/lib/2d_surface_map.h
darwinia/code/lib/GetWinVer.cpp
darwinia/code/lib/GetWinVer.h
darwinia/code/lib/MiniVersion.cpp
darwinia/code/lib/MiniVersion.h
darwinia/code/lib/auto_vector.h
darwinia/code/lib/avi_generator.cpp
darwinia/code/lib/avi_generator.h
darwinia/code/lib/avi_player.cpp
darwinia/code/lib/avi_player.h
darwinia/code/lib/binary_stream_readers.cpp
darwinia/code/lib/binary_stream_readers.h
darwinia/code/lib/bitmap.cpp
darwinia/code/lib/bitmap.h
darwinia/code/lib/bounded_array.cpp
darwinia/code/lib/bounded_array.h
darwinia/code/lib/btree.cpp
darwinia/code/lib/btree.h
darwinia/code/lib/darray.cpp
darwinia/code/lib/darray.h
darwinia/code/lib/debug_fog_logging.cpp
darwinia/code/lib/debug_logging.cpp
darwinia/code/lib/debug_logging.h
darwinia/code/lib/debug_render.cpp
darwinia/code/lib/debug_render.h
darwinia/code/lib/debug_utils.cpp
darwinia/code/lib/debug_utils.h
darwinia/code/lib/debug_utils_gcc.cpp
darwinia/code/lib/debug_utils_linux.cpp
darwinia/code/lib/fast_darray.cpp
darwinia/code/lib/fast_darray.h
darwinia/code/lib/file_writer.cpp
darwinia/code/lib/filesys_utils.cpp
darwinia/code/lib/filesys_utils.h
darwinia/code/lib/hash_table.cpp
darwinia/code/lib/hash_table.h
darwinia/code/lib/hi_res_time.cpp
darwinia/code/lib/hi_res_time_gcc.cpp
darwinia/code/lib/hi_res_time_sdl.cpp
darwinia/code/lib/input/control_types.cpp
darwinia/code/lib/input/inputdriver_idle.h
darwinia/code/lib/input/inputdriver_simple.h
darwinia/code/lib/input/inputdriver_win32.cpp
darwinia/code/lib/input/inputdriver_win32.h
darwinia/code/lib/input/inputdriver_xinput.cpp
darwinia/code/lib/input/inputdriver_xinput.h
darwinia/code/lib/input/keydefs.h
darwinia/code/lib/input/keynames.cpp
darwinia/code/lib/input/win32_eventhandler.cpp
darwinia/code/lib/input_sdl.cpp
darwinia/code/lib/invert_matrix.cpp
darwinia/code/lib/language_table.cpp
darwinia/code/lib/language_table.h
darwinia/code/lib/llist.cpp
darwinia/code/lib/llist.h
darwinia/code/lib/macosx_hardware_detect.cpp
darwinia/code/lib/math_utils.cpp
darwinia/code/lib/math_utils.h
darwinia/code/lib/matrix33.cpp
darwinia/code/lib/matrix33.h
darwinia/code/lib/matrix34.h
darwinia/code/lib/ogl_extensions.cpp
darwinia/code/lib/ogl_extensions.h
darwinia/code/lib/ogl_extensions_directx.cpp
darwinia/code/lib/ogl_extensions_sdl.cpp
darwinia/code/lib/opengl_directx.cpp
darwinia/code/lib/opengl_directx.h
darwinia/code/lib/opengl_directx_dlist.cpp
darwinia/code/lib/opengl_directx_dlist.h
darwinia/code/lib/opengl_directx_dlist_dev.cpp
darwinia/code/lib/opengl_directx_dlist_dev.h
darwinia/code/lib/opengl_directx_matrix_stack.h
darwinia/code/lib/opengl_trace.cpp
darwinia/code/lib/persisting_debug_render.cpp
darwinia/code/lib/persisting_debug_render.h
darwinia/code/lib/poster_maker.cpp
darwinia/code/lib/poster_maker.h
darwinia/code/lib/preferences.cpp
darwinia/code/lib/preferences.h
darwinia/code/lib/presized_array.h
darwinia/code/lib/profiler.cpp
darwinia/code/lib/profiler.h
darwinia/code/lib/render_utils.cpp
darwinia/code/lib/resource.cpp
darwinia/code/lib/resource.h
darwinia/code/lib/rgb_colour.cpp
darwinia/code/lib/shape.cpp
darwinia/code/lib/shape.h
darwinia/code/lib/slice_darray.cpp
darwinia/code/lib/sorting_hash_table.cpp
darwinia/code/lib/sorting_hash_table.h
darwinia/code/lib/sphere_renderer.cpp
darwinia/code/lib/system_info.cpp
darwinia/code/lib/system_info.h
darwinia/code/lib/system_info_macosx.cpp
darwinia/code/lib/targetcursor.cpp
darwinia/code/lib/text_renderer.cpp
darwinia/code/lib/text_renderer.h
darwinia/code/lib/text_stream_readers.cpp
darwinia/code/lib/tri_tri.cpp
darwinia/code/lib/universal_include.h
darwinia/code/lib/user_info.cpp
darwinia/code/lib/vector2.cpp
darwinia/code/lib/vector2.h
darwinia/code/lib/vector3.h
darwinia/code/lib/window_manager.cpp
darwinia/code/lib/window_manager.h
darwinia/code/lib/window_manager_directx.cpp
darwinia/code/lib/window_manager_sdl.cpp
darwinia/code/loaders/amiga_loader.cpp
darwinia/code/loaders/amiga_loader.h
darwinia/code/loaders/credits_loader.cpp
darwinia/code/loaders/credits_loader.h
darwinia/code/loaders/fodder_loader.cpp
darwinia/code/loaders/fodder_loader.h
darwinia/code/loaders/gameoflife_loader.cpp
darwinia/code/loaders/gameoflife_loader.h
darwinia/code/loaders/loader.cpp
darwinia/code/loaders/loader.h
darwinia/code/loaders/matrix_loader.cpp
darwinia/code/loaders/matrix_loader.h
darwinia/code/loaders/raytrace_loader.cpp
darwinia/code/loaders/raytrace_loader.h
darwinia/code/loaders/soul_loader.cpp
darwinia/code/loaders/soul_loader.h
darwinia/code/loaders/speccy_loader.cpp
darwinia/code/loaders/speccy_loader.h
darwinia/code/location.cpp
darwinia/code/location.h
darwinia/code/location_editor.cpp
darwinia/code/location_editor.h
darwinia/code/location_input.cpp
darwinia/code/main.cpp
darwinia/code/network/clienttoserver.cpp
darwinia/code/network/clienttoserver.h
darwinia/code/network/generic.cpp
darwinia/code/network/networkupdate.cpp
darwinia/code/network/networkupdate.h
darwinia/code/network/server.cpp
darwinia/code/network/server.h
darwinia/code/network/servertoclient.cpp
darwinia/code/network/servertoclient.h
darwinia/code/network/servertoclientletter.cpp
darwinia/code/network/servertoclientletter.h
darwinia/code/obstruction_grid.cpp
darwinia/code/obstruction_grid.h
darwinia/code/particle_system.cpp
darwinia/code/particle_system.h
darwinia/code/renderer.cpp
darwinia/code/renderer.h
darwinia/code/routing_system.cpp
darwinia/code/script.cpp
darwinia/code/script.h
darwinia/code/sepulveda.cpp
darwinia/code/sepulveda.h
darwinia/code/sound/sample_cache.cpp
darwinia/code/sound/sound_filter.cpp
darwinia/code/sound/sound_filter.h
darwinia/code/sound/sound_instance.cpp
darwinia/code/sound/sound_instance.h
darwinia/code/sound/sound_library_2d.cpp
darwinia/code/sound/sound_library_2d.h
darwinia/code/sound/sound_library_2d_nosnd.cpp
darwinia/code/sound/sound_library_2d_sdl.cpp
darwinia/code/sound/sound_library_3d.h
darwinia/code/sound/sound_library_3d_dsound.cpp
darwinia/code/sound/sound_library_3d_dsound.h
darwinia/code/sound/sound_library_3d_software.cpp
darwinia/code/sound/sound_library_3d_software.h
darwinia/code/sound/sound_parameter.cpp
darwinia/code/sound/sound_parameter.h
darwinia/code/sound/sound_stream_decoder.cpp
darwinia/code/sound/sound_stream_decoder.h
darwinia/code/sound/soundsystem.cpp
darwinia/code/sound/soundsystem.h
darwinia/code/startsequence.cpp
darwinia/code/startsequence.h
darwinia/code/taskmanager.cpp
darwinia/code/taskmanager.h
darwinia/code/taskmanager_interface.cpp
darwinia/code/taskmanager_interface.h
darwinia/code/taskmanager_interface_gestures.cpp
darwinia/code/taskmanager_interface_gestures.h
darwinia/code/taskmanager_interface_icons.cpp
darwinia/code/taskmanager_interface_icons.h
darwinia/code/team.cpp
darwinia/code/team.h
darwinia/code/testharness.cpp
darwinia/code/testharness.h
darwinia/code/tutorial.cpp
darwinia/code/tutorial.h
darwinia/code/tutorial_demo1.cpp
darwinia/code/tutorial_demo2.cpp
darwinia/code/unit.cpp
darwinia/code/unit.h
darwinia/code/user_input.cpp
darwinia/code/water.cpp
darwinia/code/water.h
darwinia/code/water_reflection.cpp
darwinia/code/worldobject/ai.cpp
darwinia/code/worldobject/ai.h
darwinia/code/worldobject/airstrike.cpp
darwinia/code/worldobject/airstrike.h
darwinia/code/worldobject/anthill.cpp
darwinia/code/worldobject/anthill.h
darwinia/code/worldobject/armour.cpp
darwinia/code/worldobject/armour.h
darwinia/code/worldobject/armyant.cpp
darwinia/code/worldobject/armyant.h
darwinia/code/worldobject/blueprintstore.cpp
darwinia/code/worldobject/blueprintstore.h
darwinia/code/worldobject/bridge.cpp
darwinia/code/worldobject/bridge.h
darwinia/code/worldobject/building.cpp
darwinia/code/worldobject/building.h
darwinia/code/worldobject/cave.cpp
darwinia/code/worldobject/centipede.cpp
darwinia/code/worldobject/centipede.h
darwinia/code/worldobject/constructionyard.cpp
darwinia/code/worldobject/constructionyard.h
darwinia/code/worldobject/controltower.cpp
darwinia/code/worldobject/controltower.h
darwinia/code/worldobject/darwinian.cpp
darwinia/code/worldobject/darwinian.h
darwinia/code/worldobject/egg.cpp
darwinia/code/worldobject/egg.h
darwinia/code/worldobject/engineer.cpp
darwinia/code/worldobject/engineer.h
darwinia/code/worldobject/entity.cpp
darwinia/code/worldobject/entity.h
darwinia/code/worldobject/entity_leg.cpp
darwinia/code/worldobject/entity_leg.h
darwinia/code/worldobject/factory.cpp
darwinia/code/worldobject/factory.h
darwinia/code/worldobject/feedingtube.cpp
darwinia/code/worldobject/feedingtube.h
darwinia/code/worldobject/flag.cpp
darwinia/code/worldobject/flag.h
darwinia/code/worldobject/generator.cpp
darwinia/code/worldobject/generator.h
darwinia/code/worldobject/generichub.cpp
darwinia/code/worldobject/generichub.h
darwinia/code/worldobject/goddish.cpp
darwinia/code/worldobject/goddish.h
darwinia/code/worldobject/gunturret.cpp
darwinia/code/worldobject/gunturret.h
darwinia/code/worldobject/incubator.cpp
darwinia/code/worldobject/incubator.h
darwinia/code/worldobject/insertion_squad.cpp
darwinia/code/worldobject/insertion_squad.h
darwinia/code/worldobject/lander.cpp
darwinia/code/worldobject/lander.h
darwinia/code/worldobject/laserfence.cpp
darwinia/code/worldobject/laserfence.h
darwinia/code/worldobject/lasertrooper.cpp
darwinia/code/worldobject/lasertrooper.h
darwinia/code/worldobject/library.cpp
darwinia/code/worldobject/library.h
darwinia/code/worldobject/mine.cpp
darwinia/code/worldobject/mine.h
darwinia/code/worldobject/officer.cpp
darwinia/code/worldobject/officer.h
darwinia/code/worldobject/powerstation.cpp
darwinia/code/worldobject/powerstation.h
darwinia/code/worldobject/radardish.cpp
darwinia/code/worldobject/radardish.h
darwinia/code/worldobject/researchitem.cpp
darwinia/code/worldobject/researchitem.h
darwinia/code/worldobject/rocket.cpp
darwinia/code/worldobject/rocket.h
darwinia/code/worldobject/safearea.cpp
darwinia/code/worldobject/safearea.h
darwinia/code/worldobject/scripttrigger.cpp
darwinia/code/worldobject/scripttrigger.h
darwinia/code/worldobject/snow.cpp
darwinia/code/worldobject/snow.h
darwinia/code/worldobject/souldestroyer.cpp
darwinia/code/worldobject/souldestroyer.h
darwinia/code/worldobject/spam.cpp
darwinia/code/worldobject/spam.h
darwinia/code/worldobject/spawnpoint.cpp
darwinia/code/worldobject/spawnpoint.h
darwinia/code/worldobject/spider.cpp
darwinia/code/worldobject/spider.h
darwinia/code/worldobject/spirit.cpp
darwinia/code/worldobject/spirit.h
darwinia/code/worldobject/spiritreceiver.cpp
darwinia/code/worldobject/spiritreceiver.h
darwinia/code/worldobject/spiritstore.cpp
darwinia/code/worldobject/spiritstore.h
darwinia/code/worldobject/sporegenerator.cpp
darwinia/code/worldobject/sporegenerator.h
darwinia/code/worldobject/staticshape.cpp
darwinia/code/worldobject/staticshape.h
darwinia/code/worldobject/switch.cpp
darwinia/code/worldobject/switch.h
darwinia/code/worldobject/teleport.cpp
darwinia/code/worldobject/teleport.h
darwinia/code/worldobject/tree.cpp
darwinia/code/worldobject/tree.h
darwinia/code/worldobject/triffid.cpp
darwinia/code/worldobject/triffid.h
darwinia/code/worldobject/tripod.cpp
darwinia/code/worldobject/tripod.h
darwinia/code/worldobject/trunkport.cpp
darwinia/code/worldobject/trunkport.h
darwinia/code/worldobject/virii.cpp
darwinia/code/worldobject/virii.h
darwinia/code/worldobject/wall.cpp
darwinia/code/worldobject/wall.h
darwinia/code/worldobject/weapons.cpp
darwinia/code/worldobject/weapons.h
darwinia/code/worldobject/worldobject.cpp
darwinia/code/worldobject/worldobject.h

index 06e7fdf543cfc3239b65076b55becee790a89978..00420eff79124821b10d8f9aa9240b9dc2afada7 100644 (file)
@@ -14,7 +14,7 @@ Sierpinski3D::Sierpinski3D(unsigned int _numPoints)
 :      m_numPoints(_numPoints)
 {
        m_points = new Vector3[_numPoints];
+
        float size = 20;
        float x1=    0, y1=    0, z1= size;
        float x2= size, y2= size, z2=-size;
@@ -22,7 +22,7 @@ Sierpinski3D::Sierpinski3D(unsigned int _numPoints)
        float x4=-size, y4= size, z4=-size;
        float x5=-size, y5=-size, z5=-size;
        float x = x1, y = y1, z = z1;
-       
+
        for(unsigned int i = 0; i < m_numPoints; ++i)
        {
                switch( darwiniaRandom()%5 )
index 2c165bebb931d5b7ad9110ffaba6b7b313af0cd2..27e5a1fb6c49f09ecec9a060947884e4a62e76a3 100644 (file)
@@ -73,7 +73,7 @@ App *g_app = NULL;
 
 
 App::App()
-:   m_camera(NULL), 
+:   m_camera(NULL),
     m_location(NULL),
        m_locationId(-1),
     m_server(NULL),
@@ -136,7 +136,7 @@ App::App()
     m_negativeRenderer  = g_prefsManager->GetInt("RenderNegative", 0) ? true : false;
     if( m_negativeRenderer )    m_backgroundColour.Set(255,255,255,255);
     else                        m_backgroundColour.Set(0,0,0,0);
-       
+
        UpdateDifficultyFromPreferences();
 
 
@@ -189,7 +189,7 @@ App::App()
         else
         {
             g_prefsManager->SetString( "TextLanguage", "english" );
-        }        
+        }
     }
     language = g_prefsManager->GetString("TextLanguage");
 
@@ -262,10 +262,10 @@ App::App()
         g_app->m_resource->LoadMod( modName );
     }
 
-    
+
     //
     // Load save games
-    
+
     bool profileLoaded = LoadProfile();
 }
 
@@ -306,12 +306,12 @@ App::~App()
 void App::UpdateDifficultyFromPreferences()
 {
        // This method is called to make sure that the difficulty setting
-       // used to control the game play (g_app->m_difficultyLevel) is 
-       // consistent with the user preferences. 
-       
+       // used to control the game play (g_app->m_difficultyLevel) is
+       // consistent with the user preferences.
+
        // Preferences value is 1-based, m_difficultyLevel is 0-based.
        m_difficultyLevel = g_prefsManager->GetInt(OTHER_DIFFICULTY, 1) - 1;
-       if( m_difficultyLevel < 0 )     
+       if( m_difficultyLevel < 0 )
        {
                m_difficultyLevel = 0;
        }
@@ -341,7 +341,7 @@ void App::SetLanguage( char *_language, bool _test )
 #endif
 
        m_langTable = new LangTable(langFilename);
-    
+
     if( _test )
     {
         m_langTable->TestAgainstEnglish();
@@ -366,7 +366,7 @@ void App::SetLanguage( char *_language, bool _test )
 
     //
     // Load localised fonts if they exist
-       
+
     char fontFilename[256];
     sprintf( fontFilename, "textures/speccy_font_%s.bmp", _language );
     if( !g_app->m_resource->DoesTextureExist( fontFilename ) )
@@ -403,12 +403,12 @@ void App::SetProfileName( char *_profileName )
 #if defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOSX)
 #include <sys/types.h>
 #include <sys/stat.h>
-#endif 
+#endif
 
 const char *App::GetProfileDirectory()
 {
 #if defined(TARGET_OS_LINUX)
-       
+
        static char userdir[256];
        const char *home = getenv("HOME");
        if (home != NULL) {
@@ -421,22 +421,22 @@ const char *App::GetProfileDirectory()
        }
        else // Current directory if no home
                return "";
-               
-#elif defined(TARGET_OS_MACOSX) 
-       
+
+#elif defined(TARGET_OS_MACOSX)
+
        static char userdir[256];
        const char *home = getenv("HOME");
        if (home != NULL) {
                sprintf(userdir, "%s/Library", home);
                mkdir(userdir, 0777);
-               
+
                sprintf(userdir, "%s/Library/Application Support", home);
                mkdir(userdir, 0777);
 
                sprintf(userdir, "%s/Library/Application Support/Darwinia", home);
                mkdir(userdir, 0777);
 
-               sprintf(userdir, "%s/Library/Application Support/Darwinia/%s/", 
+               sprintf(userdir, "%s/Library/Application Support/Darwinia/%s/",
                                home, DARWINIA_GAMETYPE);
                mkdir(userdir, 0777);
 
@@ -449,11 +449,11 @@ const char *App::GetProfileDirectory()
 #ifdef TARGET_OS_VISTA
     if( IsRunningVista() )
     {
-        static char userdir[256];    
+        static char userdir[256];
 
                PWSTR path;
                SHGetKnownFolderPath( FOLDERID_SavedGames, 0, NULL, &path );
-               wcstombs( userdir, path, sizeof(userdir) );             
+               wcstombs( userdir, path, sizeof(userdir) );
                CoTaskMemFree( path );
 
 #ifdef TARGET_VISTA_DEMO2
@@ -470,7 +470,7 @@ const char *App::GetProfileDirectory()
 #endif // TARGET_OS_VISTA
        {
         return "";
-    }  
+    }
 #endif
 }
 
@@ -501,11 +501,11 @@ const char *App::GetScreenshotDirectory()
 }
 
 bool App::LoadProfile()
-{    
+{
     DebugOut( "Loading profile %s\n", m_userProfileName );
 
     if( (stricmp( m_userProfileName, "AccessAllAreas" ) == 0 ||
-               stricmp( m_userProfileName, "AttractMode" ) == 0 ) && 
+               stricmp( m_userProfileName, "AttractMode" ) == 0 ) &&
         g_app->m_gameMode != GameModePrologue )
     {
         // Cheat username that opens all locations
@@ -516,7 +516,7 @@ bool App::LoadProfile()
             delete m_globalWorld;
             m_globalWorld = NULL;
         }
-    
+
         m_globalWorld = new GlobalWorld();
         m_globalWorld->LoadGame( "game_unlockall.txt" );
         for( int i = 0; i < m_globalWorld->m_buildings.Size(); ++i )
@@ -531,7 +531,7 @@ bool App::LoadProfile()
         {
             GlobalLocation *loc = m_globalWorld->m_locations[i];
             loc->m_available = true;
-        }        
+        }
     }
     else
     {
@@ -540,9 +540,9 @@ bool App::LoadProfile()
             delete m_globalWorld;
             m_globalWorld = NULL;
         }
-    
+
         m_globalWorld = new GlobalWorld();
-        m_globalWorld->LoadGame( m_gameDataFile );    
+        m_globalWorld->LoadGame( m_gameDataFile );
     }
 
     return true;
@@ -558,8 +558,8 @@ bool App::SaveProfile( bool _global, bool _local )
 
     char folderName[512];
     sprintf( folderName, "%susers/", GetProfileDirectory() );
-    bool success = CreateDirectory( folderName );        
-    if( !success ) 
+    bool success = CreateDirectory( folderName );
+    if( !success )
     {
         DebugOut( "failed to create folder %s\n", folderName );
         return false;
@@ -567,7 +567,7 @@ bool App::SaveProfile( bool _global, bool _local )
 
     sprintf( folderName, "%susers/%s", GetProfileDirectory(), m_userProfileName );
     success = CreateDirectory( folderName );
-    if( !success ) 
+    if( !success )
     {
         DebugOut( "failed to create folder %s\n", folderName );
         return false;
@@ -593,7 +593,7 @@ bool App::SaveProfile( bool _global, bool _local )
             m_levelReset = false;
             return false;
         }
-        
+
         g_app->m_location->m_levelFile->GenerateInstantUnits();
         g_app->m_location->m_levelFile->GenerateDynamicBuildings();
         char *missionFilename = m_location->m_levelFile->m_missionFilename;
@@ -613,7 +613,7 @@ void App::ResetLevel( bool _global )
            m_requestedMap[0] = '\0';
 
         if( g_app->m_tutorial ) g_app->m_tutorial->Restart();
-        
+
 
         //
         // Delete the saved mission file
@@ -621,7 +621,7 @@ void App::ResetLevel( bool _global )
         char *missionFilename = m_location->m_levelFile->m_missionFilename;
         char saveFilename[256];
         sprintf( saveFilename, "%susers/%s/%s", GetProfileDirectory(), m_userProfileName, missionFilename );
-    
+
         DeleteThisFile( saveFilename );
 
         m_levelReset = true;
@@ -641,11 +641,11 @@ void App::ResetLevel( bool _global )
                 delete m_globalWorld;
                 m_globalWorld = NULL;
             }
-    
+
             m_globalWorld = new GlobalWorld();
-            m_globalWorld->LoadGame( m_gameDataFile );     
+            m_globalWorld->LoadGame( m_gameDataFile );
         }
-    }    
+    }
 }
 
 bool App::HasBoughtGame()
@@ -695,7 +695,7 @@ void App::LoadCampaign()
     strcpy( m_gameDataFile, "game.txt" );
     LoadProfile();
     m_gameMode = App::GameModeCampaign;
-    m_requestedLocationId = -1;  
+    m_requestedLocationId = -1;
     g_prefsManager->SetInt( "RenderSpecialLighting", 0 );
     g_prefsManager->SetInt( "CurrentGameMode", 1 );
     g_prefsManager->Save();
@@ -711,7 +711,7 @@ void App::SaveRichHeader()
        sprintf( _filename, "%s.dsg", m_userProfileName );
 
        char fullFilename[256];
-    sprintf( fullFilename, "%susers/%s", g_app->GetProfileDirectory(), _filename );        
+    sprintf( fullFilename, "%susers/%s", g_app->GetProfileDirectory(), _filename );
 
        RICH_GAME_MEDIA_HEADER header;
        ZeroMemory( &header, sizeof(RICH_GAME_MEDIA_HEADER) );
@@ -775,7 +775,7 @@ void App::SaveThumbnailScreenshot()
 
        BitmapRGBA scaled(newWidth, newHeight );
 
-       scaled.Blit(0, 0, pm.GetBitmap()->m_width, pm.GetBitmap()->m_height, pm.GetBitmap(), 
+       scaled.Blit(0, 0, pm.GetBitmap()->m_width, pm.GetBitmap()->m_height, pm.GetBitmap(),
                                                           0, 0, newWidth, newHeight, true);
 
        m_thumbnailScreenshot = new BitmapRGBA( scaled );
index 4bd92d0764eaf405fe51fbecfd5018ee67dd9379..b5a4d208dca4c4fe3867e3df15dd5b7ab7f5d42b 100644 (file)
@@ -50,7 +50,7 @@ public:
        LangTable                       *m_langTable;
     AVIGenerator        *m_aviGenerator;
     Profiler            *m_profiler;
-       
+
        // Things that are the world
     GlobalWorld         *m_globalWorld;
     Location            *m_location;
@@ -127,7 +127,7 @@ public:
     bool    LoadProfile     ();
     bool    SaveProfile     ( bool _global, bool _local );
     void    ResetLevel      ( bool _global );
-       
+
     void    SetLanguage     ( char *_language, bool _test );
 
        bool    HasBoughtGame   ();
@@ -138,7 +138,7 @@ public:
        static const char *GetProfileDirectory();
        static const char *GetPreferencesPath();
     static const char *GetScreenshotDirectory();
-       
+
        void    UpdateDifficultyFromPreferences();
 
 #ifdef TARGET_OS_VISTA
@@ -148,23 +148,23 @@ public:
 };
 
 #ifdef TARGET_OS_VISTA
-#define RM_MAXLENGTH     1024 
-#define RM_MAGICNUMBER   'HMGR' 
+#define RM_MAXLENGTH     1024
+#define RM_MAGICNUMBER   'HMGR'
 
 #pragma pack(push)
 #pragma pack(1)
-typedef  struct  _RICH_GAME_MEDIA_HEADER 
-{ 
-     DWORD        dwMagicNumber; 
-     DWORD        dwHeaderVersion; 
-     DWORD        dwHeaderSize; 
-     LARGE_INTEGER liThumbnailOffset; 
-     DWORD        dwThumbnailSize; 
-     GUID         guidGameId; 
-     WCHAR        szGameName[RM_MAXLENGTH]; 
-     WCHAR        szSaveName[RM_MAXLENGTH]; 
-     WCHAR        szLevelName[RM_MAXLENGTH]; 
-     WCHAR        szComments[RM_MAXLENGTH]; 
+typedef  struct  _RICH_GAME_MEDIA_HEADER
+{
+     DWORD        dwMagicNumber;
+     DWORD        dwHeaderVersion;
+     DWORD        dwHeaderSize;
+     LARGE_INTEGER liThumbnailOffset;
+     DWORD        dwThumbnailSize;
+     GUID         guidGameId;
+     WCHAR        szGameName[RM_MAXLENGTH];
+     WCHAR        szSaveName[RM_MAXLENGTH];
+     WCHAR        szLevelName[RM_MAXLENGTH];
+     WCHAR        szComments[RM_MAXLENGTH];
 }  RICH_GAME_MEDIA_HEADER;
 #pragma pack(pop)
 
index 86c80f36c9864f75c0c81bac530f09064a1e7af1..3ccd557fc21e4ea190487fd774a2cd0df19383ee 100644 (file)
@@ -18,7 +18,7 @@ AttractMode::AttractMode()
 void AttractMode::Advance()
 {
        if( !m_running )
-       {               
+       {
                if( g_inputManager->controlEvent( ControlStartAttractMode ) ) // change to a timer for user idleness
                {
                        StartAttractMode();
@@ -52,7 +52,7 @@ void AttractMode::StartAttractMode()
         EclRemoveWindow(w->m_name);
     }
 
-    
+
 }
 
 void AttractMode::EndAttractMode()
index 956188ef95aa8b3bd34949e92ea7556b56f3b740..24f5138ccbeb809ccfe3aec19cd60adb468c986f 100644 (file)
@@ -64,7 +64,7 @@ void Camera::AdvanceDebugMode()
     {
         m_targetFov = 60.0f;
     }
-        
+
        float advanceTime = g_advanceTime;
        Vector3 right = m_front ^ m_up;
 
@@ -72,7 +72,7 @@ void Camera::AdvanceDebugMode()
        if (g_app->m_locationId != -1)
        {
                speedSideways = g_app->m_location->m_landscape.GetWorldSizeX() / 30.0f;
-       }    
+       }
     float speedVertical = speedSideways;
     float speedForwards = speedSideways;
 
@@ -132,7 +132,7 @@ void Camera::Get2DScreenPos (Vector3 const &_vector, float *_screenX, float *_sc
     glGetIntegerv(GL_VIEWPORT, viewport);
     glGetDoublev(GL_MODELVIEW_MATRIX, viewMatrix);
     glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
-    gluProject(_vector.x, _vector.y, _vector.z, 
+    gluProject(_vector.x, _vector.y, _vector.z,
         viewMatrix,
         projMatrix,
         viewport,
@@ -165,12 +165,12 @@ void Camera::SetTargetFOV(float _fov)
 
 
 void Camera::AdvanceSphereWorldMode()
-{      
+{
     bool chatLog = g_app->m_sepulveda->ChatLogVisible();
     if( chatLog ) return;
 
        m_targetFov = 100.0f;
-    
+
        int const screenH = g_app->m_renderer->ScreenH();
        int const screenW = g_app->m_renderer->ScreenW();
 
@@ -200,7 +200,7 @@ void Camera::AdvanceSphereWorldMode()
        float factor1 = 2.0f * g_advanceTime;
        float factor2 = 1.0f - factor1;
 
-       // Update camera orientation 
+       // Update camera orientation
     if (mousePos3D.MagSquared() > 1.0f)
     {
         Vector3 desiredFront = mousePos3D - m_pos;
@@ -219,7 +219,7 @@ void Camera::AdvanceSphereWorldMode()
 
        factor1 /= 2.0f;
        factor2 = 1.0f - factor1;
-    
+
     Vector3 idealPos = focusPos - m_front * 30000;
     if( idealPos.Mag() > 35000.0f ) idealPos.SetLength( 35000.0f );
     Vector3 toIdealPos = idealPos - m_pos;
@@ -265,7 +265,7 @@ void Camera::AdvanceSphereWorldScriptedMode()
     int b = 10;
 
     m_height = 50.0f;
-    
+
        int const screenH = g_app->m_renderer->ScreenH();
        int const screenW = g_app->m_renderer->ScreenW();
 
@@ -288,7 +288,7 @@ void Camera::AdvanceSphereWorldScriptedMode()
        float factor1 = 1.0f * g_advanceTime;
        float factor2 = 1.0f - factor1;
 
-       // Update camera orientation 
+       // Update camera orientation
     Vector3 desiredFront = m_targetPos - m_pos;
     desiredFront.Normalise();
 
@@ -304,7 +304,7 @@ void Camera::AdvanceSphereWorldScriptedMode()
 
        factor1 /= 2.0f;
        factor2 = 1.0f - factor1;
-    
+
     Vector3 idealPos = focusPos - m_front * 30000;
     if( idealPos.Mag() > 35000.0f ) idealPos.SetLength( 35000.0f );
     Vector3 toIdealPos = idealPos - m_pos;
@@ -333,14 +333,14 @@ void Camera::AdvanceSphereWorldIntroMode()
         m_front.Set( 1, 0, -1 );
         m_up.Set( 1, 0, 0 );
     }
-    
+
     fixMeUp -= g_advanceTime * 500.0f;
 
     Vector3 targetFront = Vector3(200, 200, 200) - m_pos;
     float distance = targetFront.Mag();
-    
+
     float forwardSpeed = 3000.0f;
-    
+
     targetFront.Normalise();
 
     float rotateSpeed = forwardSpeed / (fixMeUp*0.66f);
@@ -382,10 +382,10 @@ void Camera::AdvanceSphereWorldIntroMode()
         m_up.Set( 0.15,0.93, 0.31 );
         m_front.Normalise();
         m_up.Normalise();
-        
+
         fixMeUp = false;
     }
-    
+
     Vector3 targetPos = g_zeroVector;
     if( runningTime < 30.0f )
     {
@@ -394,12 +394,12 @@ void Camera::AdvanceSphereWorldIntroMode()
     else
     {
         targetPos.Set( 1000, 500, 1000 );
-    }        
+    }
     Vector3 targetFront = targetPos - m_pos;
     float distance = targetFront.Mag();
-    
+
     float forwardSpeed = 3000.0f;
-    
+
     if( distance < 2000000 && runningTime > 30 )
     {
         forwardSpeed = (distance/1070000.0f) * 3000.0f;
@@ -447,12 +447,12 @@ void Camera::AdvanceSphereWorldOutroMode()
         m_up.Set( 0, 0, 1 );
         m_front.Normalise();
         m_up.Normalise();
-        
+
         m_vel = m_front;
-        
+
         fixMeUp = false;
     }
-    
+
     Vector3 targetPos( -1000000, 4000000, 397000 );
 
     if( runningTime > 30.0f )
@@ -462,11 +462,11 @@ void Camera::AdvanceSphereWorldOutroMode()
 
     Vector3 targetFront = (targetPos - m_pos) * -1.0f;
     float distance = targetFront.Mag();
-    
+
     float forwardSpeed = sqrtf(m_pos.Mag()) * 4;
     forwardSpeed = max( forwardSpeed, 1000 );
     forwardSpeed = min( forwardSpeed, 2000 );
-    
+
     targetFront.Normalise();
 
     float rotateSpeed = 4000.0f / 30000.0f;
@@ -523,10 +523,10 @@ void Camera::AdvanceSphereWorldFocusMode()
     m_targetFov = 100;
 
     Vector3 oldPos = m_pos;
-   
+
     m_trackRange = 100000;
     m_trackHeight = 50000;
-    
+
     //
     // Target a point that slowly rotates around the building
 
@@ -534,7 +534,7 @@ void Camera::AdvanceSphereWorldFocusMode()
     m_trackVector.Normalise();
     float height = sinf( g_gameTime * 0.2f ) * m_trackHeight;
     float trackRange = fabs(m_trackRange) + sinf( g_gameTime * 0.3f ) * fabs(m_trackRange) * 0.4f;
-    Vector3 realTargetPos = m_targetPos + m_trackVector * trackRange;           
+    Vector3 realTargetPos = m_targetPos + m_trackVector * trackRange;
     realTargetPos.y = -110000 + height;
 
     // Calculate a Movement Factor, so we start moving slowly towards our target,
@@ -543,14 +543,14 @@ void Camera::AdvanceSphereWorldFocusMode()
     float moveFactor = timeSinceBegin * 0.2f;
     moveFactor = min( moveFactor, 1.0f );
 
-    float factor1 = moveFactor * 0.5f * g_advanceTime;    
+    float factor1 = moveFactor * 0.5f * g_advanceTime;
     float factor2 = 1.0f - factor1;
     m_pos = m_pos * factor2 + realTargetPos * factor1;
-        
+
     m_targetPos.y = 10000;
-    
+
     Vector3 targetFront = ( m_targetPos - m_pos ).Normalise();
-    if( m_trackRange < 0.0f ) 
+    if( m_trackRange < 0.0f )
     {
         targetFront.x *= -1.0f;
         targetFront.z *= -1.0f;
@@ -558,7 +558,7 @@ void Camera::AdvanceSphereWorldFocusMode()
        factor1 = moveFactor * 1.0f * g_advanceTime * 0.5f;
        factor2 = 1.0f - factor1;
     m_front = m_front * factor2 + targetFront * factor1;
-    
+
     m_up.Set( 0.0f, -1.0f, 0.0f );
     Vector3 right = m_up ^ m_front;
     m_up = right ^ m_front;
@@ -568,7 +568,7 @@ void Camera::AdvanceSphereWorldFocusMode()
 
 // Returns the number of meters to the nearest blockage that the camera would
 // experience if it travelled in the specified direction. A blockage is defined
-// as a piece of land more than 10 metres higher than the camera's current 
+// as a piece of land more than 10 metres higher than the camera's current
 // height. If there is no blockage FLT_MAX is returned.
 float Camera::DistanceToBlockage(Vector3 const &_dir, float const _maxDist)
 {
@@ -596,12 +596,12 @@ void Camera::AdvanceFreeMovementMode()
        {
                return;
        }
-       
+
        UpdateEntityTrackingMode();
 
        // Check to see whether we should switch to entity tracking mode
        WorldObjectId selection;
-       if (m_entityTrack && GetEntityToTrack(selection)) 
+       if (m_entityTrack && GetEntityToTrack(selection))
        {
         Entity *entity = g_app->m_location->GetEntity( selection );
                if( entity->m_type == Entity::TypeInsertionSquadie )
@@ -645,7 +645,7 @@ void Camera::AdvanceFreeMovementMode()
 
                // TODO: Support mouse/joystick
         if( g_inputManager->controlEvent( ControlCameraSpeedup ) ) moveRate *= 4.0f;
-        
+
         bool keyForward     = g_inputManager->controlEvent( ControlCameraForwards );
         bool keyBackward    = g_inputManager->controlEvent( ControlCameraBackwards );
         bool keyLeft        = g_inputManager->controlEvent( ControlCameraLeft );
@@ -711,7 +711,7 @@ void Camera::AdvanceFreeMovementMode()
                if (landHeight2 > landheight) landheight = landHeight2;
                landHeight2 = g_app->m_location->m_landscape.m_heightMap->GetValue(m_targetPos.x + hitDownRadius, m_targetPos.z + hitDownRadius);
                if (landHeight2 > landheight) landheight = landHeight2;
-               
+
                if (landheight < MIN_HEIGHT) landheight = MIN_HEIGHT;
 
                if (landheight + MIN_GROUND_CLEARANCE > m_height)
@@ -727,17 +727,17 @@ void Camera::AdvanceFreeMovementMode()
                // Update our position
                float factor1 = 4.0f * g_advanceTime;
                float factor2 = 1.0f - factor1;
-               Vector3 deltaPos = -m_pos;    
+               Vector3 deltaPos = -m_pos;
                Vector3 oldPos = m_pos;
                m_pos = m_pos * factor2 + m_targetPos * factor1;
-           
+
                deltaPos = m_pos + deltaPos;
                m_vel = ( m_pos - oldPos ) / g_advanceTime;
-           
-               // Update camera orientation 
+
+               // Update camera orientation
                bool chatLog = g_app->m_sepulveda->ChatLogVisible();
 
-               if( !g_app->m_taskManagerInterface->m_visible           
+               if( !g_app->m_taskManagerInterface->m_visible
                        && !chatLog     )
                {
                        if (mousePos3D.MagSquared() > 1.0f)
@@ -752,13 +752,13 @@ void Camera::AdvanceFreeMovementMode()
                                m_front.RotateAround(desiredRotation);
        //            m_front = m_front * factor2 + desiredFront * factor1;
                                m_front.Normalise();
-                               
+
                                Vector3 right = m_front ^ g_upVector;
                                right.Normalise();
                                m_up = right ^ m_front;
                        }
                }
-           
+
                // Set up viewing matrices
                SetupModelviewMatrix();
 
@@ -793,7 +793,7 @@ void Camera::AdvanceFreeMovementMode()
                g_target->SetMousePos(newMouseX, newMouseY);
                glPopMatrix();
        }
-}   
+}
 
 
 void Camera::Render()
@@ -814,7 +814,7 @@ void Camera::AdvanceBuildingFocusMode()
     m_trackVector.Normalise();
     float height = m_trackHeight + sinf( g_gameTime * 0.3f ) * m_trackHeight * 0.5f;
     float trackRange = fabs(m_trackRange) + sinf( g_gameTime * 0.3f ) * fabs(m_trackRange) * 0.3f;
-    Vector3 realTargetPos = m_targetPos + m_trackVector * trackRange;           
+    Vector3 realTargetPos = m_targetPos + m_trackVector * trackRange;
     realTargetPos.y = m_targetPos.y + height;
 
     // Calculate a Movement Factor, so we start moving slowly towards our target,
@@ -831,12 +831,12 @@ void Camera::AdvanceBuildingFocusMode()
         realTargetPos.y = min( realTargetPos.y, 1000.0f );
     }
 
-    float factor1 = moveFactor * 0.5f * g_advanceTime;    
+    float factor1 = moveFactor * 0.5f * g_advanceTime;
     float factor2 = 1.0f - factor1;
     m_pos = m_pos * factor2 + realTargetPos * factor1;
-        
+
     Vector3 targetFront = ( m_targetPos - m_pos ).Normalise();
-    if( m_trackRange < 0.0f ) 
+    if( m_trackRange < 0.0f )
     {
         targetFront.x *= -1.0f;
         targetFront.z *= -1.0f;
@@ -844,7 +844,7 @@ void Camera::AdvanceBuildingFocusMode()
        factor1 = moveFactor * 1.0f * g_advanceTime;
        factor2 = 1.0f - factor1;
     m_front = m_front * factor2 + targetFront * factor1;
-    
+
     m_up.Set( 0.0f, -1.0f, 0.0f );
     Vector3 right = m_up ^ m_front;
     m_up = right ^ m_front;
@@ -861,7 +861,7 @@ void Camera::AdvanceBuildingFocusMode()
 bool Camera::GetEntityToTrack( WorldObjectId &selection )
 {
        if( !g_app->m_location )
-               return false;    
+               return false;
 
     Team *team = g_app->m_location->GetMyTeam();
 
@@ -886,7 +886,7 @@ bool Camera::GetEntityToTrack( WorldObjectId &selection )
     if( !unit )
                return false;
 
-       if( unit->m_troopType == Entity::TypeInsertionSquadie ) 
+       if( unit->m_troopType == Entity::TypeInsertionSquadie )
        {
                InsertionSquad *squad = (InsertionSquad *) unit;
                Entity *pointMan = squad->GetPointMan();
@@ -908,7 +908,7 @@ void Camera::AdvanceAutomaticTracking()
        int numInputs = 0;
 
        Vector3 cameraTarget;
-       
+
        if (AdvanceRopeModel( cameraTarget )) {
                avgCameraTarget += cameraTarget;
                numInputs++;
@@ -934,13 +934,13 @@ void Camera::AdvanceAutomaticTracking()
                numInputs += 3;
        }
 
-       if( AdvanceManualCameraHeight ( cameraTarget )) 
+       if( AdvanceManualCameraHeight ( cameraTarget ))
        {
                avgCameraTarget += cameraTarget;
                numInputs++;
        }
 
-       if (numInputs > 0) 
+       if (numInputs > 0)
                avgCameraTarget = avgCameraTarget / float(numInputs);
        else
                avgCameraTarget = m_pos;
@@ -1011,14 +1011,14 @@ bool Camera::AdvanceManualRotateCamera( Vector3 &cameraTarget )
         front.RotateAroundY(rotY);
 
         Vector3 right = (front ^ g_upVector).Normalise();
-        
+
                Vector3 newUp = m_up;
 
         newUp.RotateAround(right * rotRight);
         if (newUp.y > 0.1f)
         {
             front.RotateAround(right * rotRight);
-        }        
+        }
 
         cameraTarget = m_targetPos - front * m_currentDistance;
                return true;
@@ -1064,7 +1064,7 @@ bool Camera::AdvanceManualCameraHeight( Vector3 &cameraTarget )
            }
     }
 
-       return false;   
+       return false;
 }
 
 bool Camera::AdvanceRopeModel( Vector3 &cameraTarget )
@@ -1072,10 +1072,10 @@ bool Camera::AdvanceRopeModel( Vector3 &cameraTarget )
        // Follow along as if the camera is attached to the entity
        // by a rope on the floor.
 
-    Vector3 C(m_pos); 
+    Vector3 C(m_pos);
        C.y = 0.0f;
 
-    Vector3 E2(m_predictedEntityPos); 
+    Vector3 E2(m_predictedEntityPos);
        E2.y = 0.0f;
 
     Vector3 B = C - E2;
@@ -1085,7 +1085,7 @@ bool Camera::AdvanceRopeModel( Vector3 &cameraTarget )
     const float dSquared = d * d;
 
     // Stay within a certain distance of the entity
-    if (B.MagSquared() > dSquared) 
+    if (B.MagSquared() > dSquared)
     {
         B.Normalise();
                cameraTarget = E2 + B * d;
@@ -1102,11 +1102,11 @@ bool Camera::AdvanceRopeModel( Vector3 &cameraTarget )
     // (oustideD = h / tan theta, where theta is the angle of elevation of the camera from the entity's point of view)
     // Important that outsideD < d;
 
-    const float outsideD = 120.0;  // cameraHeight / 0.36; 
+    const float outsideD = 120.0;  // cameraHeight / 0.36;
     const float outsideDSquared = outsideD * outsideD;
 
     // DebugOut("2dcamdist = %f, outsideD = %f\n", B.Mag(), outsideD);
-    if (B.MagSquared() < outsideDSquared) 
+    if (B.MagSquared() < outsideDSquared)
     {
         B.Normalise();
         cameraTarget = E2 + B * outsideD;
@@ -1137,7 +1137,7 @@ bool Camera::AdvanceCanSeeUnits( Vector3 &targetCamera )
 
 bool Camera::AdvanceNotTooLow( Vector3 &targetCamera )
 {
-       // Code to check if the camera is not too low of the ground     
+       // Code to check if the camera is not too low of the ground
        float cameraHeight = m_pos.y - g_app->m_location->m_landscape.m_heightMap->GetValue( m_pos.x, m_pos.z );
 
        if (m_pos.y < MIN_HEIGHT || cameraHeight < MIN_TRACKING_HEIGHT * m_heightMultiplier) {
@@ -1159,7 +1159,7 @@ bool Camera::AdvanceNotTooFarAway( Vector3 &targetCamera )
                entityToCamera.Normalise();
                targetCamera = m_predictedEntityPos + entityToCamera * maxDist;
                return true;
-       }       
+       }
 
        return false;
 }
@@ -1169,7 +1169,7 @@ void Camera::RotateTowardsEntity( Entity *entity )
     float factor1 = g_advanceTime * 2.0f;
     float factor2 = 1.0f - factor1;
 
-       // We deliberately overshoot the target pos? 
+       // We deliberately overshoot the target pos?
 
        Vector3 newTargetPos = entity->GetCameraFocusPoint();
     m_targetPos = factor1 * newTargetPos + factor2 * m_targetPos;
@@ -1188,7 +1188,7 @@ void Camera::AdvanceEntityTrackMode()
 
        UpdateEntityTrackingMode();
 
-       if (!g_app->m_location || !m_entityTrack) 
+       if (!g_app->m_location || !m_entityTrack)
                goto finishMode;
 
        Entity *entity = g_app->m_location->GetEntity( m_objectId );
@@ -1293,7 +1293,7 @@ void Camera::GetHighestPoint( Vector3 const &_from, Vector3 const &_to, float _m
 
 // Returns the number of meters to the nearest blockage that the camera would
 // experience if it travelled in the specified direction. A blockage is defined
-// as a piece of land more than 10 metres higher than the camera's current 
+// as a piece of land more than 10 metres higher than the camera's current
 // height. If there is no blockage FLT_MAX is returned.
 float Camera::DirectDistanceToBlockage(Vector3 const &_from, Vector3 const &_to, float const _maxDist)
 {
@@ -1301,7 +1301,7 @@ float Camera::DirectDistanceToBlockage(Vector3 const &_from, Vector3 const &_to,
 
        unsigned int const numSteps = 40;
        float const distStep = _maxDist / (float)numSteps;
-       
+
        float x = _from.x;
        float y = _from.y;
        float z = _from.z;
@@ -1320,7 +1320,7 @@ float Camera::DirectDistanceToBlockage(Vector3 const &_from, Vector3 const &_to,
 
                float landHeight = g_app->m_location->m_landscape.m_heightMap->GetValue(x, z);
 
-               if (landHeight > y)     
+               if (landHeight > y)
                {
                        return (float)i * distStep;
                }
@@ -1353,11 +1353,11 @@ void Camera::AdvanceRadarAimMode()
        float oldMouseX, oldMouseY;
        Get2DScreenPos(mousePos3D, &oldMouseX, &oldMouseY);
        oldMouseY = screenH - oldMouseY;
-    
+
        float factor1 = 4.0f * g_advanceTime;
        float factor2 = 1.0f - factor1;
 
-       // Update camera orientation 
+       // Update camera orientation
     if (mousePos3D.MagSquared() > 1.0f)
     {
         Vector3 desiredFront = mousePos3D - m_pos;
@@ -1373,7 +1373,7 @@ void Camera::AdvanceRadarAimMode()
 
        //
     // Move towards the idealPos
-    
+
        Vector3 idealPos = groundPos;
        idealPos.y += m_height;
        Vector3 horiCamFront = m_front;
@@ -1427,13 +1427,13 @@ void Camera::AdvanceTurretAimMode()
        Vector3 groundPos = m_targetPos;
     groundPos.y += 20.0f;
     float minY = g_app->m_location->m_landscape.m_heightMap->GetValue(groundPos.x, groundPos.z);
-    
+
     groundPos -= m_front * m_height;
     //groundPos.y = max( groundPos.y, minY );
-    
+
        //groundPos.y = ;
     //groundPos.y -= 10.0f;
-    
+
        Vector3 focusPos = groundPos;
        focusPos.y += m_height;
 
@@ -1451,7 +1451,7 @@ void Camera::AdvanceTurretAimMode()
        float factor1 = 4.0f * g_advanceTime;
        float factor2 = 1.0f - factor1;
 
-       // Update camera orientation 
+       // Update camera orientation
     if (mousePos3D.MagSquared() > 1.0f)
     {
         Vector3 desiredFront = mousePos3D - m_pos;
@@ -1467,7 +1467,7 @@ void Camera::AdvanceTurretAimMode()
 
        //
     // Move towards the idealPos
-    
+
        Vector3 idealPos = groundPos;
        idealPos.y += m_height;
        Vector3 horiCamFront = m_front;
@@ -1537,7 +1537,7 @@ void Camera::AdvanceFirstPersonMode()
 
     //
     // Allow quake keys to move us
-    
+
     Vector3 accelForward = m_front;
     accelForward.y = 0.0f;
     accelForward.Normalise();
@@ -1555,7 +1555,7 @@ void Camera::AdvanceFirstPersonMode()
     // Update our position and orientation
 
     m_vel *= 0.9993f;
-    m_pos += g_advanceTime * m_vel;       
+    m_pos += g_advanceTime * m_vel;
 
     int mx=0, my=0;
        mx = g_target->dX();
@@ -1588,7 +1588,7 @@ void Camera::AdvanceMoveToTargetMode()
        float dist = direction.Mag();
        direction /= dist;
        float maxSpeed = (2.0f * dist) / m_moveDuration;
-       
+
        // Orientation
        Vector3 fullRotationDirection = m_startFront ^ m_targetFront;
        Vector3 middleFront = m_startFront;
@@ -1613,7 +1613,7 @@ void Camera::AdvanceMoveToTargetMode()
                RequestMode(Camera::ModeDoNothing);
                m_front = m_targetFront;
        }
-    
+
        m_front.Normalise();
        m_up = g_upVector;
     //Vector3 right = m_front ^ m_up;
@@ -1628,8 +1628,8 @@ void Camera::AdvanceMoveToTargetMode()
 
 void Camera::AdvanceEntityFollowMode()
 {
-    Entity *obj = (Entity*)g_app->m_location->GetEntity( m_objectId );    
-    if( !obj ) 
+    Entity *obj = (Entity*)g_app->m_location->GetEntity( m_objectId );
+    if( !obj )
     {
         RequestMode(Camera::ModeFreeMovement);
         return;
@@ -1638,13 +1638,13 @@ void Camera::AdvanceEntityFollowMode()
 
        //
        // Get X and Y mouse move
-       
+
        int halfHeight = g_app->m_renderer->ScreenH() / 2;
        int halfWidth = g_app->m_renderer->ScreenW() / 2;
        int deltaX = g_target->X() - halfWidth;
        int deltaY = g_target->Y() - halfHeight;
        g_target->SetMousePos(halfWidth, halfHeight);
-       
+
 
        //
        // Get Z mouse move
@@ -1660,8 +1660,8 @@ void Camera::AdvanceEntityFollowMode()
                m_distFromEntity = 5000.0f;
        }
 
-       
-       // 
+
+       //
        // Do rotation
 
        float rotY = (float)deltaX * -0.015f;
@@ -1714,7 +1714,7 @@ Camera::Camera()
        m_skipDirectionCalculation(false)
 {
        m_cosFov = cos(m_fov / 180.0f * M_PI);
-    m_pos = Vector3(1000.0f, //g_app->m_location->m_landscape.GetWorldSizeX() / 2.0f, 
+    m_pos = Vector3(1000.0f, //g_app->m_location->m_landscape.GetWorldSizeX() / 2.0f,
                                        500.0f,
                                        1000.0f);//g_app->m_location->m_landscape.GetWorldSizeZ() / 2.0f);
 
@@ -1722,11 +1722,11 @@ Camera::Camera()
        m_maxX = 1e6;
        m_minZ = -1e6;
        m_maxZ = 1e6;
-    
+
     //m_front = Vector3(0, -0.7f, 1);
     m_front.Set( 0,-0.5f,-1 );
     m_front.Normalise();
-    
+
     m_up = g_upVector;
     Vector3 right = m_up ^ m_front;
     right.Normalise();
@@ -1764,16 +1764,16 @@ void Camera::SetupProjectionMatrix(float _nearPlane, float _farPlane)
        float screenWHalf = screenW / 2.0;
        float screenH = g_app->m_renderer->ScreenH();
        float screenHHalf = screenH / 2.0;
-       
-       // Distance from camera to top-centre and bottom-centre of screen 
+
+       // Distance from camera to top-centre and bottom-centre of screen
        float dtc = screenHHalf / sin(fovRadians/2.0);
-       
+
        // Distance from camera to any corner of the screen
        float dc = sqrt( dtc*dtc + screenWHalf*screenWHalf );
-       
+
        // Half distance from one corner of the screen to the diagonally opposite corner
-       float ddHalf = sqrt(screenW * screenW + screenH * screenH) / 2.0;       
-       
+       float ddHalf = sqrt(screenW * screenW + screenH * screenH) / 2.0;
+
        m_maxFovRadians = 2.0 * asin(ddHalf/dc);
 }
 
@@ -1796,7 +1796,7 @@ void Camera::SetupModelviewMatrix()
               up.x, up.y, up.z);
 }
 
+
 bool Camera::PosInViewFrustum(Vector3 const &_pos)
 {
        Vector3 dirToPos = (_pos - m_pos).Normalise();
@@ -1845,11 +1845,11 @@ Building *Camera::GetBestBuildingInView()
         {
                Vector3 rayStart;
                Vector3 rayDir;
-               GetClickRay(g_app->m_renderer->ScreenW()/2, 
+               GetClickRay(g_app->m_renderer->ScreenW()/2,
                                    g_app->m_renderer->ScreenH()/2, &rayStart, &rayDir);
 
             float nearest = 200.0f;
-            s_buildingId = -1;         
+            s_buildingId = -1;
 
             for( int i = 0; i < g_app->m_location->m_buildings.Size(); ++i )
             {
@@ -1871,21 +1871,21 @@ Building *Camera::GetBestBuildingInView()
             s_recalculateTimer = GetHighResTime();
         }
     }
-    
+
     return g_app->m_location->GetBuilding( s_buildingId );
 }
 
 
 void Camera::AdvanceComponentZoom()
 {
-       // No zoom inside the task manager 
+       // No zoom inside the task manager
     if( g_app->m_taskManagerInterface->m_visible ||
         IsInMode( ModeEntityTrack ) )
     {
         return;
     }
 
-    float change = 30.0f;    
+    float change = 30.0f;
        float adjustedTargetFov = m_targetFov;
 
        // JAMES CHECK:
@@ -1901,13 +1901,13 @@ void Camera::AdvanceComponentZoom()
         change = 10.0f;
     }
 
-    if( m_mode == ModeMoveToTarget || 
+    if( m_mode == ModeMoveToTarget ||
         m_mode == ModeDoNothing ||
         m_mode == ModeBuildingFocus )
     {
         change = 1.0f;
     }
-    
+
 //    if( m_fov < adjustedTargetFov )
 //    {
 //        m_fov += change * g_advanceTime;
@@ -1918,7 +1918,7 @@ void Camera::AdvanceComponentZoom()
 //    }
 //    else if( m_fov > adjustedTargetFov )
 //    {
-//        m_fov -= change * g_advanceTime; 
+//        m_fov -= change * g_advanceTime;
 //        if( m_fov < adjustedTargetFov )
 //        {
 //            m_fov = adjustedTargetFov;
@@ -1953,21 +1953,21 @@ void Camera::AdvanceComponentMouseWheelHeight()
                    g_app->m_controlHelpSystem->RecordCondUsed(ControlHelpSystem::CondCameraDown);
         }
     }
-       
+
        if( g_app->m_location)
     {
                float landheight = g_app->m_location->m_landscape.m_heightMap->GetValue(m_pos.x, m_pos.z);
                if (landheight < MIN_HEIGHT) landheight = MIN_HEIGHT;
                float altitude = m_height - landheight;
                m_height += delta * 2.0f * sqrtf(fabsf(altitude));
-        
+
                if (m_mode == ModeTurretAim)
         {
             m_height = max( m_height, MIN_GROUND_CLEARANCE );
         }
         else
         {
-            if(landheight + MIN_GROUND_CLEARANCE > m_height)           
+            if(landheight + MIN_GROUND_CLEARANCE > m_height)
             {
                            m_height = landheight + MIN_GROUND_CLEARANCE;
             }
@@ -1990,7 +1990,7 @@ void Camera::AdvanceAnim()
 {
        CamAnimNode *node = m_anim->m_nodes[m_animCurrentNode];
        float finishTime = m_animNodeStartTime + node->m_duration;
-       
+
        if (g_gameTime > finishTime)
        {
                switch (node->m_transitionMode)
@@ -2040,13 +2040,13 @@ void Camera::AdvanceMainMenuMode()
     m_front = m_front * factor2 + targetFront * factor1;
     m_up.Set( 0.0f, -1.0f, 0.0f );
     Vector3 right = m_up ^ m_front;
-    m_up = right ^ m_front; 
+    m_up = right ^ m_front;
 }
 
 void Camera::Advance()
 {
     START_PROFILE(g_app->m_profiler, "Advance Camera");
-    
+
        if (m_anim)
        {
                AdvanceAnim();
@@ -2059,11 +2059,11 @@ void Camera::Advance()
 //     switch (m_mode)
 //     {
 //             case ModeReplay:
-//             case ModeSphereWorld:   
-//             case ModeFreeMovement:  
-//             case ModeBuildingFocus: 
-//             case ModeEntityTrack:   
-//             case ModeRadarAim:      
+//             case ModeSphereWorld:
+//             case ModeFreeMovement:
+//             case ModeBuildingFocus:
+//             case ModeEntityTrack:
+//             case ModeRadarAim:
 //             case ModeFirstPerson:
 //             case ModeEntityFollow:
 //        case ModeTurretAim:
@@ -2074,17 +2074,17 @@ void Camera::Advance()
 
        switch (m_mode)
        {
-               case ModeSphereWorld:   
-               case ModeFreeMovement:  
-               case ModeBuildingFocus: 
-               case ModeEntityTrack:   
-               case ModeRadarAim:      
-               case ModeFirstPerson:  
+               case ModeSphereWorld:
+               case ModeFreeMovement:
+               case ModeBuildingFocus:
+               case ModeEntityTrack:
+               case ModeRadarAim:
+               case ModeFirstPerson:
         case ModeTurretAim:
                        AdvanceComponentMouseWheelHeight();
        }
 
-       // 
+       //
        // Pick an advancer
 
        if( m_anim == NULL &&
@@ -2117,7 +2117,7 @@ void Camera::Advance()
                }
        }
 
-    
+
     if( m_cameraShake > 0.0f )
     {
         m_front.RotateAroundY( sfrand(m_cameraShake * 0.05f) );
@@ -2264,7 +2264,7 @@ bool Camera::IsMoving()
 bool Camera::IsInteractive()
 {
     //if( g_app->m_script->IsRunningScript() ) return false;
-    
+
     return ( m_mode == ModeSphereWorld ||
              m_mode == ModeFreeMovement ||
              m_mode == ModeRadarAim ||
@@ -2292,7 +2292,7 @@ void Camera::SetTarget(Vector3 const &_pos, Vector3 const &_front, Vector3 const
 
 
 bool Camera::SetTarget(char const *_mountName)
-{    
+{
        if (stricmp(_mountName, MAGIC_MOUNT_NAME_START_POS) == 0)
        {
                SetTarget(m_posBeforeAnim, m_frontBeforeAnim, m_upBeforeAnim);
@@ -2323,7 +2323,7 @@ void Camera::SetTarget(Vector3 const &_focusPos, float _distance, float _height
     targetFront.Normalise();
     Vector3 targetRight = targetFront ^ g_upVector;
     Vector3 targetUp = targetRight ^ targetFront;
-    SetTarget( targetPos, targetFront, targetUp ); 
+    SetTarget( targetPos, targetFront, targetUp );
 }
 
 
@@ -2361,7 +2361,7 @@ void Camera::GetClickRay(int _x, int _y, Vector3 *_rayStart, Vector3 *_rayDir)
     glGetDoublev(GL_MODELVIEW_MATRIX, mvMatrix);
     glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
     int realY = viewport[3] - _y - 1;
+
        if ( (mvMatrix[0] + mvMatrix[1] + mvMatrix[2] == 0) ||
                 (mvMatrix[5] + mvMatrix[6] + mvMatrix[7] == 0) ||
                 (mvMatrix[9] + mvMatrix[10] + mvMatrix[11] == 0) )
index 06f5b7dc8582166934a8bfad09df37a53034d27d..dc0a29c1eb8ec07c225a7682f1a8942d764ec726 100644 (file)
@@ -92,14 +92,14 @@ private:
        float   m_maxFovRadians;    // Updated once per frame from m_fov in SetupProjectionMatrix
     float   m_height;                  // Distance above ground (in metres)
     Vector3 m_vel;
-   
+
        float   m_minX, m_maxX;         // Bounds of camera movement
        float   m_minZ, m_maxZ;
-    Vector3 m_targetPos;  
-    Vector3 m_targetFront;        
+    Vector3 m_targetPos;
+    Vector3 m_targetFront;
     Vector3 m_targetUp;
     float   m_targetFov;
-       Vector3 m_cameraTarget;         // Target Position of camera for automatic entity tracking      
+       Vector3 m_cameraTarget;         // Target Position of camera for automatic entity tracking
        Vector3 m_predictedEntityPos;   // Predicted Position of entity for automatic entity tracking
        Entity *m_trackingEntity;       // The entity we are tracking
 
@@ -116,7 +116,7 @@ private:
     int                m_mode;
        int             m_debugMode;
        int             m_framesInThisMode;
-    
+
     WorldObjectId m_objectId;          // WorldObjectId of creature to track
     float m_trackRange;
     float m_trackHeight;
@@ -136,7 +136,7 @@ private:
     bool    m_entityTrack;         // the current state of automatic entity tracking
        Vector3 m_controlVector;                        // previous right value of the camera, if the unit is not directly below
        bool    m_skipDirectionCalculation;
-    
+
 public:
        Camera();
 
@@ -154,7 +154,7 @@ public:
     bool SphereInViewFrustum        (Vector3 const &_centre, float _radius );
 
     Building *GetBestBuildingInView ();  // Is the player currently looking at a building?
-                                                                                
+
        void Advance();
     void Render();
 
@@ -175,23 +175,23 @@ public:
        bool IsMoving                                   ();
     bool IsInteractive              ();
     bool IsInMode                   (int _mode);
-       
+
     void RecordCameraPosition       ();                 // So you can return easily
     void RestoreCameraPosition      ( bool _cut=false );
 
        // SetTarget() only sets the target data. To make these changes take effect, call either
-       // CutToTarget() or RequestMode(Camera::ModeMoveToTarget), depending on whether you 
+       // CutToTarget() or RequestMode(Camera::ModeMoveToTarget), depending on whether you
        // want an instant cut or a smooth transition
        void SetTarget          (Vector3 const &_pos, Vector3 const &_front, Vector3 const &_up=g_upVector);
        bool SetTarget          (char const *_mountName); // Returns false if mount not found
     void SetTarget      (Vector3 const &_focusPos, float _distance, float _height );
-       void SetMoveDuration(float _duration);    
+       void SetMoveDuration(float _duration);
        void CutToTarget        ();
     void SetHeight      (float _height);
     void SetFOV         (float _fov);
     void SetTargetFOV   (float _fov);
 
-       void Normalise          (); // Needs to be called reasonably regularly to prevent the front 
+       void Normalise          (); // Needs to be called reasonably regularly to prevent the front
                                                        // and up vectors becoming non-orthogonal
 
     void GetClickRay    (int _x, int _y, Vector3 *_rayStart, Vector3 *_rayDir);
index b817b8f58313143fe3bfcaa7c718d22412a449f9..25d9e0ead4faa79c7561b90a1bfe4c48a937aafc 100644 (file)
@@ -19,20 +19,20 @@ Clouds::Clouds()
     m_vel.Set(0.04f,0.0f,0.0f);
 }
 
+
 void Clouds::Advance()
-{    
+{
     m_vel.Set(0.03f,0.0f,-0.01f);
     m_offset += m_vel * SERVER_ADVANCE_PERIOD;
 }
 
 
 void Clouds::Render(float _predictionTime)
-{    
+{
     START_PROFILE( g_app->m_profiler, "RenderSky" );
        RenderSky();
     END_PROFILE( g_app->m_profiler, "RenderSky" );
-       
+
     START_PROFILE( g_app->m_profiler, "RenderBlobby" );
     RenderBlobby(_predictionTime);
     END_PROFILE( g_app->m_profiler, "RenderBlobby" );
@@ -75,7 +75,7 @@ void Clouds::RenderQuad(float posNorth, float posSouth, float posEast, float pos
 
                                glTexCoord2f(tx + texStepX, tz + texStepZ);
                                glVertex3f(px + posStepX, height, pz + posStepZ);
-                               
+
                                glTexCoord2f(tx, tz + texStepZ);
                                glVertex3f(px, height, pz + posStepZ);
 
@@ -98,21 +98,21 @@ void Clouds::RenderFlat( float _predictionTime )
     float detail    = 9.0f;
 
     int cloudDetail = g_prefsManager->GetInt( "RenderCloudDetail", 1 );
-    
+
     Vector3 offset  = m_offset + m_vel * _predictionTime;
 
     glEnable        ( GL_TEXTURE_2D );
-    glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "textures/clouds.bmp" ) ); 
+    glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "textures/clouds.bmp" ) );
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
        glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
-    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );    
-    
+    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE );
     glEnable        ( GL_BLEND );
     glDepthMask     ( false );
     glDisable          ( GL_DEPTH_TEST );
-    
+
     float fogColor  [4] = { 0.0f, 0.0f, 0.0f, 0.0f };
     glFogfv         ( GL_FOG_COLOR, fogColor );
     glFogf          ( GL_FOG_START, 2000.0f );
@@ -128,7 +128,7 @@ void Clouds::RenderFlat( float _predictionTime )
 
     RenderQuad(zStart, zEnd, xStart, xEnd, height,
                           offset.z, offset.z + detail, offset.x, offset.x + detail);
-    
+
     detail          *= 0.5f;
     height          -= 200.0f;
 
@@ -137,7 +137,7 @@ void Clouds::RenderFlat( float _predictionTime )
            RenderQuad(zStart, zEnd, xStart, xEnd, height,
                               offset.x/2, offset.x/2 + detail, offset.x/2, offset.x/2 + detail);
     }
-    
+
     g_app->m_location->SetupFog();
     glDepthMask     ( true );
     glEnable           ( GL_DEPTH_TEST );
@@ -145,7 +145,7 @@ void Clouds::RenderFlat( float _predictionTime )
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
     glDisable       ( GL_TEXTURE_2D );
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
-    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );    
+    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
 
 }
 
@@ -168,8 +168,8 @@ void Clouds::RenderBlobby( float _predictionTime )
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
        glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
-    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );    
-        
+    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE );
     glEnable        ( GL_BLEND );
     glDisable          ( GL_DEPTH_TEST );
@@ -188,13 +188,13 @@ void Clouds::RenderBlobby( float _predictionTime )
         RenderQuad             (zStart, zEnd, xStart, xEnd, height,
                                         offset.z, detail + offset.z, offset.x, detail + offset.x);
     }
-    
+
     detail          *= 0.5f;
     height          -= 200.0f;
-       
+
     RenderQuad         (zStart, zEnd, xStart, xEnd, height,
                                         offset.x/2, detail + offset.x/2, offset.x/2, detail + offset.x/2);
-    
+
     detail          *= 0.4f;
     height          -= 200.0f;
 
@@ -211,7 +211,7 @@ void Clouds::RenderBlobby( float _predictionTime )
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
     glDisable       ( GL_TEXTURE_2D );
     glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
-    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );    
+    glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
 }
 
 
index 07c5fc573e1362bff3b3420a0c19fa139e792e56..d1e2d2af03e603b657ec5de8267e027f46f49d50 100644 (file)
@@ -42,7 +42,7 @@ class HelpIcon
 {
 public:
     HelpIcon( const char *_filename, const char *_shadowFilename, const Vector2 &_setRelativePos );
-       
+
        void AddTextPosition( int _relx, int _rely );
 
        bool Enabled() const;
@@ -57,7 +57,7 @@ private:
     char m_filename[256], m_shadowFilename[256];
     Vector2 m_setRelativePos;
 
-       struct PosText {                
+       struct PosText {
                Vector2 m_pos;
                const char * m_text;
                float m_alpha;
@@ -98,7 +98,7 @@ bool HelpIcon::Enabled( float &_iconAlpha ) const
 {
        bool enabled = false;
 
-       _iconAlpha = 0.3f;      
+       _iconAlpha = 0.3f;
 
        for (int i = 0; i < m_texts.size(); i++) {
                if (m_texts[i].m_text) {
@@ -125,8 +125,8 @@ void HelpIcon::Set( int _index, const char *_helpText, float _alpha )
 
        m_texts[_index].m_text = _helpText;
        m_texts[_index].m_alpha = _alpha;
-       
-       if (m_texts[_index].m_text != m_lastTexts[_index].m_text) 
+
+       if (m_texts[_index].m_text != m_lastTexts[_index].m_text)
                m_lastHelpTextChangeTime = g_gameTime;
 }
 
@@ -138,7 +138,7 @@ void HelpIcon::Render( const Vector2 &_setPosition, float _alpha )
 
        float iconAlpha;
     float shadowOffset = 0;
-    float shadowSize = iconSize; 
+    float shadowSize = iconSize;
 
        const bool enabled = Enabled( iconAlpha );
 
@@ -156,7 +156,7 @@ void HelpIcon::Render( const Vector2 &_setPosition, float _alpha )
 
        Vector2 iconCentre = Vector2(position.x, position.y);
 
-       //if( g_app->m_largeMenus ) 
+       //if( g_app->m_largeMenus )
        //{
        //      iconGap *= 2.0f;
        //      iconSize *= 1.5f;
@@ -172,22 +172,22 @@ void HelpIcon::Render( const Vector2 &_setPosition, float _alpha )
     glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( m_shadowFilename ) );
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR );
     glDepthMask     ( false );
-    glColor4f       ( iconAlpha, iconAlpha, iconAlpha, 0.0f );         
-       
+    glColor4f       ( iconAlpha, iconAlpha, iconAlpha, 0.0f );
+
     glBegin( GL_QUADS );
         glTexCoord2i( 0, 1 );           glVertex2f( iconCentre.x - shadowX + shadowOffset, iconCentre.y - shadowSize/2 + shadowOffset );
         glTexCoord2i( 1, 1 );           glVertex2f( iconCentre.x + shadowX + shadowOffset, iconCentre.y - shadowSize/2 + shadowOffset );
         glTexCoord2i( 1, 0 );           glVertex2f( iconCentre.x + shadowX + shadowOffset, iconCentre.y + shadowSize/2 + shadowOffset );
         glTexCoord2i( 0, 0 );           glVertex2f( iconCentre.x - shadowX + shadowOffset, iconCentre.y + shadowSize/2 + shadowOffset );
-    glEnd();   
+    glEnd();
 
-    unsigned int texId = g_app->m_resource->GetTexture( m_filename );       
+    unsigned int texId = g_app->m_resource->GetTexture( m_filename );
 
        // Render the icon
     glEnable        ( GL_TEXTURE_2D );
     glBindTexture   ( GL_TEXTURE_2D, texId );
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE );
-    
+
     glColor4f   ( 1.0f, 1.0f, 1.0f, iconAlpha );
 
     float x = iconSize/2;
@@ -217,8 +217,8 @@ void HelpIcon::Render( const Vector2 &_setPosition, float _alpha )
                        //{
                        //      fontSize *= 1.5f;
                        //}
-                       
-                       Vector2 textCentrePos( 
+
+                       Vector2 textCentrePos(
                                iconCentre.x + (shadowSize / 2 + iconGap) * pos.x,
                                iconCentre.y + (shadowSize / 2 + iconGap) * pos.y);
 
@@ -276,10 +276,10 @@ void HelpIconSet::Render( Vector2 &_setPosition )
                        break;
                }
 
-       if (!atLeastOneEnabled && m_lastEnabled) 
+       if (!atLeastOneEnabled && m_lastEnabled)
                m_beginFadeOutTime = g_gameTime;
 
-       else if (atLeastOneEnabled && !m_lastEnabled) 
+       else if (atLeastOneEnabled && !m_lastEnabled)
                m_beginFadeInTime = g_gameTime;
 
        float alpha;
@@ -306,10 +306,10 @@ void HelpIconSet::Render( Vector2 &_setPosition )
        // If none enabled, we don't render the entire set
        if (alpha > 0.0f) {
                // Render
-               for (int i = 0; i < m_icons.size(); i++) 
+               for (int i = 0; i < m_icons.size(); i++)
                        m_icons[i]->Render( _setPosition, alpha );
-       }       
-       
+       }
+
        // Adjust the y value
        _setPosition.y += m_height;
        m_lastEnabled = atLeastOneEnabled;
@@ -330,47 +330,47 @@ void ControlHelpSystem::InitialiseIcons()
        m_icons[A]->AddTextPosition( 0, 1 );
 
        m_icons[B] = new HelpIcon("icons/button_b.bmp", "icons/button_abxy_shadow.bmp", Vector2(100, 50));
-       m_icons[B]->AddTextPosition( 1, 0 );    
+       m_icons[B]->AddTextPosition( 1, 0 );
 
        m_icons[X] = new HelpIcon("icons/button_x.bmp", "icons/button_abxy_shadow.bmp", Vector2(0, 50));
-       m_icons[X]->AddTextPosition( -1, 0 );   
+       m_icons[X]->AddTextPosition( -1, 0 );
 
        m_icons[Y] = new HelpIcon("icons/button_y.bmp", "icons/button_abxy_shadow.bmp", Vector2(50, 0));
-       m_icons[Y]->AddTextPosition( 0, -1 );   
+       m_icons[Y]->AddTextPosition( 0, -1 );
 
        m_icons[DPAD] = new HelpIcon("icons/button_dpad.bmp", "icons/button_control_shadow.bmp", Vector2(50, 0));
        m_icons[DPAD]->AddTextPosition( 1, 0 );
-       m_icons[DPAD]->AddTextPosition( 0, -1 );        
+       m_icons[DPAD]->AddTextPosition( 0, -1 );
        m_icons[DPAD]->AddTextPosition( 0, 1 );
 
        const int hsep = 25;
 
        m_icons[LB] = new HelpIcon("icons/button_lb.bmp", "icons/button_lb_shadow.bmp", Vector2(-hsep + 25, 0));
-       m_icons[LB]->AddTextPosition( -1, 0 );  
+       m_icons[LB]->AddTextPosition( -1, 0 );
 
        m_icons[RB] = new HelpIcon("icons/button_rb.bmp", "icons/button_rb_shadow.bmp", Vector2(+hsep + 75, 0));
-       m_icons[RB]->AddTextPosition( 1, 0 );   
+       m_icons[RB]->AddTextPosition( 1, 0 );
 
        const int vsep = -25;
        const int yoffset = -25;
 
        m_icons[LA] = new HelpIcon("icons/button_la.bmp", "icons/button_control_shadow.bmp", Vector2(-hsep + 50, yoffset + -vsep + 0));
-       m_icons[LA]->AddTextPosition( 1, 0 );   
+       m_icons[LA]->AddTextPosition( 1, 0 );
 
        m_icons[LT] = new HelpIcon("icons/button_lt.bmp", "icons/button_trigger_shadow.bmp", Vector2(-hsep + 0, yoffset + -vsep + 0));
-       m_icons[LT]->AddTextPosition( 0, 1 );   
+       m_icons[LT]->AddTextPosition( 0, 1 );
 
        m_icons[RA] = new HelpIcon("icons/button_ra.bmp", "icons/button_control_shadow.bmp", Vector2(+hsep + 50, yoffset + +vsep + 100));
-       m_icons[RA]->AddTextPosition( -1, 0 );  
+       m_icons[RA]->AddTextPosition( -1, 0 );
 
        m_icons[RT] = new HelpIcon("icons/button_rt.bmp", "icons/button_trigger_shadow.bmp", Vector2(+hsep + 100, yoffset + +vsep + 100));
-       m_icons[RT]->AddTextPosition( 0, 1 );   
+       m_icons[RT]->AddTextPosition( 0, 1 );
 
        m_sets[++set] = new HelpIconSet( 175 );
        m_sets[set]->AddIcon( m_icons[A] );
        m_sets[set]->AddIcon( m_icons[B] );
        m_sets[set]->AddIcon( m_icons[X] );
-       m_sets[set]->AddIcon( m_icons[Y] );     
+       m_sets[set]->AddIcon( m_icons[Y] );
 
        m_sets[++set] = new HelpIconSet( 75 );
        m_sets[set]->AddIcon( m_icons[LB] );
@@ -437,7 +437,7 @@ void ControlHelpSystem::Advance()
        for (int i = 0; i < MaxConditions; i++)
                DecayCond(i);
 
-       // Check conditions     
+       // Check conditions
        for (int i = 0; i < MaxConditions; i++)
                if (CheckCondition(i))
                        SetCondIcon(i);
@@ -461,7 +461,7 @@ static Unit *GetSelectedUnit()
 {
        Team *team = NULL;
 
-       if (g_app->m_location && 
+       if (g_app->m_location &&
            (team = g_app->m_location->GetMyTeam()))
                return team->GetMyUnit();
        else
@@ -473,9 +473,9 @@ static bool SquaddieSelected()
        Unit *unit = NULL;
        Task *currentTask = NULL;
 
-       return 
+       return
                g_app->m_camera->IsInMode( Camera::ModeEntityTrack ) &&
-               (unit = GetSelectedUnit()) && 
+               (unit = GetSelectedUnit()) &&
                unit->m_troopType == Entity::TypeInsertionSquadie &&
                (currentTask = g_app->m_taskManager->GetCurrentTask()) &&
                currentTask->m_state == Task::StateRunning;
@@ -486,7 +486,7 @@ static bool WeaponSelected( int _type )
 {
     InsertionSquad *squad = NULL;
 
-       return 
+       return
                (squad = (InsertionSquad *) GetSelectedUnit()) &&
                squad->m_troopType == Entity::TypeInsertionSquadie &&
                _type == squad->m_weaponType &&
@@ -498,7 +498,7 @@ static bool OfficerOrArmourSelected()
        Team *team = NULL;
        Entity *entity = NULL;
 
-       return 
+       return
                g_app->m_location &&
                (team = g_app->m_location->GetMyTeam()) &&
                (entity = team->GetMyEntity()) &&
@@ -511,7 +511,7 @@ static bool OfficerSelected()
        Team *team = NULL;
        Entity *entity = NULL;
 
-       return 
+       return
                g_app->m_location &&
                (team = g_app->m_location->GetMyTeam()) &&
                (entity = team->GetMyEntity()) &&
@@ -523,7 +523,7 @@ static bool ArmourSelected()
        Team *team = NULL;
        Entity *entity = NULL;
 
-       return 
+       return
                g_app->m_location &&
                (team = g_app->m_location->GetMyTeam()) &&
                (entity = team->GetMyEntity()) &&
@@ -533,7 +533,7 @@ static bool ArmourSelected()
 
 static bool HasMoreThanOneSecondaryWeapon()
 {
-       int numSecondaryWeapons = 
+       int numSecondaryWeapons =
                g_app->m_globalWorld->m_research->HasResearch( GlobalResearch::TypeGrenade ) +
                g_app->m_globalWorld->m_research->HasResearch( GlobalResearch::TypeAirStrike ) +
                g_app->m_globalWorld->m_research->HasResearch( GlobalResearch::TypeRocket );
@@ -544,7 +544,7 @@ static bool HasMoreThanOneSecondaryWeapon()
 static bool UnitSelected()
 {
        if( !g_app->m_location )
-               return false;    
+               return false;
 
     Team *team = g_app->m_location->GetMyTeam();
 
@@ -625,7 +625,7 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                case CondTaskManagerCloseBlue:
                        // Too cluttered to have two close buttons
                        return false; // g_app->m_taskManagerInterface->AdviseCloseControlHelp();
-               
+
                case CondTaskManagerCloseRed:
                        return g_app->m_taskManagerInterface->m_visible;
 
@@ -633,11 +633,11 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                        return UnitSelected() || BuildingSelected();
 
                case CondSelectUnit:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                   g_app->m_gameCursor->AdviseHighlightingSomething();
 
                case CondTaskManagerCreateGreen:
-                       return g_app->m_taskManagerInterface->m_visible && 
+                       return g_app->m_taskManagerInterface->m_visible &&
                                   g_app->m_taskManagerInterface->AdviseCreateControlHelpGreen();
 
                case CondMoveUnit:
@@ -645,7 +645,7 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                                   g_app->m_gameCursor->AdviseMoveableEntitySelected();
 
                case CondTaskManagerSelect:
-                       return g_app->m_taskManagerInterface->m_visible && 
+                       return g_app->m_taskManagerInterface->m_visible &&
                                   g_app->m_taskManagerInterface->AdviseOverSelectableZone();
 
                case CondPlaceUnit:
@@ -655,28 +655,28 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                case CondPromoteOfficer:
                        return !g_app->m_taskManagerInterface->m_visible &&
                                   g_app->m_gameCursor->AdviseHighlightingSomething() &&
-                                  PlacingOfficerProgram();             
+                                  PlacingOfficerProgram();
 
                case CondMoveCameraOrUnit:
-                       return !g_app->m_taskManagerInterface->m_visible && 
-                                  (g_app->m_camera->IsInMode( Camera::ModeFreeMovement ) || 
+                       return !g_app->m_taskManagerInterface->m_visible &&
+                                  (g_app->m_camera->IsInMode( Camera::ModeFreeMovement ) ||
                                    g_app->m_camera->IsInMode( Camera::ModeEntityTrack ));
 
                case CondCameraAim:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                   g_app->m_camera->IsInMode( Camera::ModeFreeMovement );
 
                case CondSquaddieFire:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        SquaddieSelected();
 
                case CondChangeWeapon:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        SquaddieSelected() &&
                                        HasMoreThanOneSecondaryWeapon();
 
                case CondChangeOrders:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        OfficerOrArmourSelected();
 
                case CondCameraUp:
@@ -686,30 +686,30 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                        return !m_icons[LA]->Enabled() && !m_icons[RA]->Enabled() && !g_app->m_taskManagerInterface->m_visible;
 
                case CondZoom:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                   // RadarDishSelected() &&
                                   g_app->m_camera->IsInMode( Camera::ModeRadarAim );
 
                case CondFireGrenades:
                        return !g_app->m_taskManagerInterface->m_visible &&
                                   g_inputManager->controlEvent( ControlUnitPrimaryFireDirected ) &&
-                                  SquaddieSelected() &&                                   
+                                  SquaddieSelected() &&
                                   WeaponSelected( GlobalResearch::TypeGrenade );
-                                                          
+
                case CondFireRocket:
                        return !g_app->m_taskManagerInterface->m_visible &&
                                   g_inputManager->controlEvent( ControlUnitPrimaryFireDirected ) &&
-                                  SquaddieSelected() &&                                   
+                                  SquaddieSelected() &&
                                   WeaponSelected( GlobalResearch::TypeRocket );
 
                case CondFireAirstrike:
                        return !g_app->m_taskManagerInterface->m_visible &&
                                   g_inputManager->controlEvent( ControlUnitPrimaryFireDirected ) &&
-                                  SquaddieSelected() &&                                   
+                                  SquaddieSelected() &&
                                   WeaponSelected( GlobalResearch::TypeAirStrike );
 
                case CondOfficerSetGoto:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        OfficerSelected();
 
                case CondOfficerSetFollow:
@@ -721,18 +721,18 @@ bool ControlHelpSystem::CheckCondition( int _condition )
                                Entity *e = g_app->m_location->GetEntity( idUnderMouse );
                                if( e && e->m_type == Entity::TypeOfficer ) officerHighlighted = true;
                        }
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        OfficerSelected() &&
                                        officerHighlighted;
                }
 
                case CondArmourSetTurret:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        ArmourSelected();
 
                case CondSwitchPrevUnit:
                case CondSwitchNextUnit:
-                       return !g_app->m_taskManagerInterface->m_visible && 
+                       return !g_app->m_taskManagerInterface->m_visible &&
                                        CanSwitchUnit();
 
         case CondRadarAim:
@@ -784,7 +784,7 @@ void ControlHelpSystem::SetCondIcon( int _cond )
        if (ti.m_minTime != 0.0f && ti.m_maxTime != 0.0f) {
                if (ti.m_timeUsed < ti.m_minTime)
                        alpha = 1.0f;
-               else 
+               else
                        alpha = (ti.m_maxTime - ti.m_timeUsed ) / (ti.m_maxTime - ti.m_minTime);
 
                if (alpha < 0.0f)
@@ -802,7 +802,7 @@ void ControlHelpSystem::Render()
 {
        // Don't render if not in location
        if (g_app->m_locationId == -1 ||
-               g_inputManager->getInputMode() != INPUT_MODE_GAMEPAD || 
+               g_inputManager->getInputMode() != INPUT_MODE_GAMEPAD ||
                !g_prefsManager->GetInt(OTHER_CONTROLHELPENABLED, 1))
        {
                return;
@@ -825,7 +825,7 @@ void ControlHelpSystem::Render()
                return;
        }
 
-       if (g_app->m_taskManagerInterface->m_visible) 
+       if (g_app->m_taskManagerInterface->m_visible)
                setPosition.x -= 100;
 
        for (int i = 0; i < MaxSets; i++)
index b355d660c1656641fc87709c2e1c7a7294e58f04..1f99e48deed83e6eb8a533e904d9c2adff50b831 100644 (file)
@@ -76,7 +76,7 @@ private:
        HelpIconSet *m_sets[MaxSets];
 
        typedef struct TextIndicator {
-               TextIndicator() 
+               TextIndicator()
                        : m_icon( 0 ),
                          m_text( 0 ),
                          m_minTime( 0.0f ),
@@ -87,7 +87,7 @@ private:
                }
 
                TextIndicator( int _icon, int _text, const char *_langPhrase, float _minTime = 0.0f, float _maxTime = 0.0f, float _maxUsage = 0.0f, float _decayRate = 1.0f )
-                       :       m_icon( _icon ), 
+                       :       m_icon( _icon ),
                                m_text( _text ),
                                m_langPhrase( _langPhrase ),
                                m_minTime( _minTime ),
index df3b11184592805abef5b6537dcded92e6a82f51..80d54695abd8c8ab625e79f906bbccdb46f0228b 100644 (file)
@@ -51,7 +51,7 @@ DeformEffect* DeformEffect::Create()
        if(!d->m_deformFullscreenShader
                || !d->m_deformSphereShader
                || !d->m_deformDiamondShader
-               || !d->m_screenTexture 
+               || !d->m_screenTexture
                || !d->m_deformTexture
                ) SAFE_DELETE(d);
        return d;
@@ -130,7 +130,7 @@ static float Get2DScreenPos(Vector3 const &_vector, float *_screenX, float *_scr
        double projMatrix[16];
        glGetDoublev(GL_MODELVIEW_MATRIX, viewMatrix);
        glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
-       gluProject(_vector.x, _vector.y, _vector.z, 
+       gluProject(_vector.x, _vector.y, _vector.z,
                viewMatrix,
                projMatrix,
                viewport,
index 3d26a52e041aa5d8043b7d26e91b6afa7796fa31..fb96813fcb8842593564c9090e27c56aae982494 100644 (file)
@@ -28,11 +28,11 @@ DemoEndSequence::DemoEndSequence()
 
     char *missionFilename = g_app->m_location->m_levelFile->m_missionFilename;
     char saveFilename[256];
-    sprintf( saveFilename, "%susers/%s/%s", g_app->GetProfileDirectory(), g_app->m_userProfileName, missionFilename );    
+    sprintf( saveFilename, "%susers/%s/%s", g_app->GetProfileDirectory(), g_app->m_userProfileName, missionFilename );
     DeleteThisFile( saveFilename );
 
     //
-    // Delete the game file 
+    // Delete the game file
 
     sprintf( saveFilename, "%susers/%s/game_demo2.txt", g_app->GetProfileDirectory(), g_app->m_userProfileName );
     DeleteThisFile( saveFilename );
@@ -42,7 +42,7 @@ DemoEndSequence::DemoEndSequence()
     g_prefsManager->SetInt("PrologueComplete", 1 );
        g_prefsManager->SetInt("CurrentGameMode", 1 );
     g_prefsManager->Save();
-    
+
 }
 
 DemoEndSequence::~DemoEndSequence()
@@ -75,7 +75,7 @@ void DemoEndSequence::Render()
 
     //
     // White out the background
-    
+
     glBegin( GL_QUADS );
         glVertex2i( 0, 0 );
         glVertex2i( 800, 0 );
@@ -98,7 +98,7 @@ void DemoEndSequence::Render()
         if( sfrand() > 0.0f ) darwinian->m_turnRate *= -1.0f;
         darwinian->m_size = 50 + sfrand(25);
         m_darwinians.PutData( darwinian );
-        
+
         m_newDarwinianTimer = 3.0f;
     }
 
@@ -107,7 +107,7 @@ void DemoEndSequence::Render()
     // Advance and Render Darwinians
 
     glEnable( GL_TEXTURE_2D );
-        
+
     for( int i = 0; i < m_darwinians.Size(); ++i )
     {
         DemoEndDarwinian *darwinian = m_darwinians[i];
@@ -119,20 +119,20 @@ void DemoEndSequence::Render()
             --i;
             continue;
         }
-        
+
         darwinian->m_up.RotateAroundY( darwinian->m_turnRate * g_advanceTime );
-        
+
         float size = darwinian->m_size;
         Vector3 right = darwinian->m_up ^ Vector3(0,1,0);
         Vector3 topLeft = darwinian->m_pos - darwinian->m_up * size/2 - right * size/2;
         Vector3 topRight = darwinian->m_pos - darwinian->m_up * size/2 + right * size/2;
         Vector3 bottomRight = darwinian->m_pos + darwinian->m_up * size/2 + right * size/2;
         Vector3 bottomLeft = darwinian->m_pos + darwinian->m_up * size/2 - right * size/2;
-       
+
         glBindTexture( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "sprites/ghost.bmp" ) );
-        glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR );  
+        glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR );
         glColor4f( 0.8f, 0.3f, 0.8f, 0.0f );
-       
+
         glBegin( GL_QUADS );
             glTexCoord2i(0,1);      glVertex2f( topLeft.x, topLeft.z );
             glTexCoord2i(1,1);      glVertex2f( topRight.x, topRight.z );
@@ -146,7 +146,7 @@ void DemoEndSequence::Render()
         glBindTexture( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "sprites/darwinian.bmp" ) );
         glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
         glColor4f( 0.3f, 1.0f, 0.3f, 0.1f );
-       
+
         size *= 0.7f;
         topLeft = darwinian->m_pos - darwinian->m_up * size/2 - right * size/2;
         topRight = darwinian->m_pos - darwinian->m_up * size/2 + right * size/2;
@@ -168,7 +168,7 @@ void DemoEndSequence::Render()
     //
     // Bring up end dialog
 
-       if (g_app->HasBoughtGame()) 
+       if (g_app->HasBoughtGame())
        {
                if( timeSinceStart > 30 )
                {
@@ -179,7 +179,7 @@ void DemoEndSequence::Render()
                if( timeSinceStart > 40 && !m_endDialogCreated )
                {
                        EclRegisterWindow( new DemoEndWindow(15.0f, false) );
-                       m_endDialogCreated = true;        
+                       m_endDialogCreated = true;
                }
        }
 
index 5bfcb9bfee75c63021b0e2771fdddbf6706c8be1..17b27c3c88e2eb2a37be764acfcfec4db09a7594 100644 (file)
@@ -24,7 +24,7 @@ protected:
     float   m_timer;
     float   m_newDarwinianTimer;
     bool    m_endDialogCreated;
-    
+
     LList<DemoEndDarwinian *> m_darwinians;
 
 public:
@@ -32,7 +32,7 @@ public:
     ~DemoEndSequence();
 
     void Render();
-    
+
 };
 
 
index 9fde8d2d312b6cbf56cb2822dfd48dfddb9d23bf..2522c5a857aa2e185fc24c4b19ecc814a9708d69 100644 (file)
@@ -34,7 +34,7 @@ Channel::~Channel()
 
 
 // *** Advance
-// Returns false if we have reached the end 
+// Returns false if we have reached the end
 bool Channel::Advance()
 {
        m_currentTime++;
@@ -102,7 +102,7 @@ unsigned char Channel::GetValue(int _type)
 // *** GetVolume
 unsigned char Channel::GetVolume()
 {
-       return GetValue(TimeValue::TypeVol);    
+       return GetValue(TimeValue::TypeVol);
 //     TimeValue *p1 = m_volumePoints.GetData(m_currentVolumePoint);
 //     TimeValue *p2 = m_volumePoints.GetData(m_currentVolumePoint + 1);
 //     if (p2 && p2->m_time <= m_currentTime)
@@ -129,7 +129,7 @@ unsigned char Channel::GetVolume()
 // *** GetFreq
 unsigned char Channel::GetFreq()
 {
-       return GetValue(TimeValue::TypeFreq);   
+       return GetValue(TimeValue::TypeFreq);
 //     TimeValue *p1 = m_freqPoints.GetData(m_currentFreqPoint);
 //     TimeValue *p2 = m_freqPoints.GetData(m_currentFreqPoint + 1);
 //     if (p2 && p2->m_time <= m_currentTime)
@@ -148,7 +148,7 @@ unsigned char Channel::GetFreq()
 //             float returnVal = p1->m_value + slope * interpTime;
 //             return (unsigned char)returnVal;
 //     }
-//     
+//
 //     return p1->m_value;
 }
 
@@ -156,7 +156,7 @@ unsigned char Channel::GetFreq()
 // *** GetCtrl
 unsigned char Channel::GetCtrl()
 {
-       return GetValue(TimeValue::TypeCtrl);   
+       return GetValue(TimeValue::TypeCtrl);
 //     TimeValue *p1 = m_ctrlPoints.GetData(m_currentCtrlPoint);
 //     TimeValue *p2 = m_ctrlPoints.GetData(m_currentCtrlPoint + 1);
 //     if (p2 && p2->m_time <= m_currentTime)
@@ -170,8 +170,8 @@ unsigned char Channel::GetCtrl()
 
 
 // *** CreateTimeValue
-// Inserts a new TimeValue into the correct place in a sorted list of 
-// TimeValues. Will overwrite an existing TimeValue if there is one at 
+// Inserts a new TimeValue into the correct place in a sorted list of
+// TimeValues. Will overwrite an existing TimeValue if there is one at
 // the specified time index already.
 void Channel::CreateTimeValue(int _type, unsigned char _freq, unsigned short _time)
 {
@@ -179,7 +179,7 @@ void Channel::CreateTimeValue(int _type, unsigned char _freq, unsigned short _ti
        {
                m_duration = _time;
        }
-       
+
        LList<TimeValue*> *points = &m_points[_type];
 
        unsigned int numPoints = points->Size();
@@ -215,7 +215,7 @@ void Channel::DeleteTimeValue(int _type, int _index)
        {
                return;
        }
-       
+
        points->RemoveData(_index);
 }
 
@@ -227,7 +227,7 @@ void Channel::SetTimeValue(int _type, unsigned char _value, unsigned short _time
 
        TimeValue *t = points->GetData(_index);
        DarwiniaDebugAssert(t);
-       
+
        points->RemoveData(_index);
        t->m_time = _time;
        t->m_value = _value;
index f04cb7a0271b50f056ceb251ca79e287eda446b8..d53c5171dc70e9c9403edb42ae808ebcce957b3b 100644 (file)
@@ -6,15 +6,15 @@
 #include "lib/llist.h"
 
 
-// This module provides a mechanism to define volume envelopes and frequency 
+// This module provides a mechanism to define volume envelopes and frequency
 // changes that can be used to drive the Pokey chip. The idea is that the
 // registers of the Pokey will be updated many times a second (say 60). In
-// the old days this was done by an Interrupt Service Routine. 
+// the old days this was done by an Interrupt Service Routine.
 //   ____________
 //  /            \
 // /              \
 // 0 1          2 3
-// A typical volume envelope might look like this. It contains four 
+// A typical volume envelope might look like this. It contains four
 // VolumePoints. The m_time variables might be 0, 30, 100, 130 respectively.
 // Interpolation is used to generate volume levels for times that are not
 // specified directly - ie time index 15 would produce half volume.
@@ -27,7 +27,7 @@
 class TimeValue
 {
 public:
-       enum 
+       enum
        {
                TypeNone = -1,
                TypeFreq = 0,
@@ -39,7 +39,7 @@ public:
 
        // if this is a volume value then 0 = mute, 255 = full volume (note the pokey will only use the top 4 bits)
        // if it is a freq value then 0 = high freq, 255 = low freq (this value is used as a clock divider)
-       unsigned char m_value;  
+       unsigned char m_value;
        unsigned short m_time;  // How many interrupts to occur before this point becomes active.
 
        TimeValue(unsigned char _val, unsigned short _time) : m_value(_val), m_time(_time) {}
@@ -60,7 +60,7 @@ public:
        LList<TimeValue *> m_points[TimeValue::TypeNumParametersInAChannel];
 
     // For the example above, if m_currentTime==15, this equals 0
-       unsigned m_currentPoint[TimeValue::TypeNumParametersInAChannel]; 
+       unsigned m_currentPoint[TimeValue::TypeNumParametersInAChannel];
 
 public:
        Channel();
@@ -71,7 +71,7 @@ public:
        unsigned GetDuration();
 
        unsigned char GetVolume(); // Returns an interpolated value between volume points
-       unsigned char GetFreq();   // Returns an interpolated value between frequency points    
+       unsigned char GetFreq();   // Returns an interpolated value between frequency points
        unsigned char GetCtrl();   // Returns the most recent ctrl value
        unsigned char GetValue(int _type);
 
@@ -94,7 +94,7 @@ public:
 public:
        EffectProcessor();
        ~EffectProcessor();
-       
+
        void Advance(); // Called as if by an interrupt, say every 60th of a second
 };
 
index 3fe9cbf2884b68ec8794dd9e1415c5f63ab3f5fa..73af2d32bcb82352cce34e220a2b4b24c44e5369 100644 (file)
@@ -143,7 +143,7 @@ void EntityGridCell::AddObjectId(WorldObjectId _objectId)
        }
 
        int target = m_firstFree;
-       
+
     DarwiniaDebugAssert( target >= 0 );
     DarwiniaDebugAssert( target < m_arraySize);
 
@@ -188,7 +188,7 @@ void LogEntityGridError( WorldObjectId _id, Vector3 const &_pos, int _error )
     for( int i = 0; i < s_entityGridErrors.Size(); ++i )
     {
         EntityGridError *theError = s_entityGridErrors[i];
-        if( theError->m_id == _id ) 
+        if( theError->m_id == _id )
         {
             // The error already exists
             return;
@@ -200,7 +200,7 @@ void LogEntityGridError( WorldObjectId _id, Vector3 const &_pos, int _error )
     theError->m_errorCode = _error;
     s_entityGridErrors.PutData( theError );
 #else
-    DarwiniaDebugAssert( false );            
+    DarwiniaDebugAssert( false );
 #endif
 }
 
@@ -225,7 +225,7 @@ EntityGrid::EntityGrid(float _cellSizeX, float _cellSizeZ)
     {
         m_cells[t] = new EntityGridCell[m_numCellsX * m_numCellsZ];
     }
-    
+
 //     SetNewReportingThreshold(-1);
 }
 
@@ -238,7 +238,7 @@ void EntityGrid::EnsureMaxNeighbours( int _maxNeighbours )
 
         int newMaxNeighbours = m_maxNeighbours + 100;
         WorldObjectId *newNeighbours = new WorldObjectId[ newMaxNeighbours ];
-        
+
         if( m_neighbours )
         {
             memcpy( newNeighbours, m_neighbours, m_maxNeighbours * sizeof(WorldObjectId) );
@@ -301,7 +301,7 @@ EntityGridCell *EntityGrid::GetCell(int _indexX, int _indexZ, int _team)
 // WorldX and WorldY MUST BE VALID
 // ObjectID MUST NOT already exist within the grid cell
 void EntityGrid::AddObject (WorldObjectId _objectID, float _worldX, float _worldZ, float _radius )
-{    
+{
     int teamId = _objectID.GetTeamId();
     if( teamId == 255 ) return;
 
@@ -321,7 +321,7 @@ void EntityGrid::AddObject (WorldObjectId _objectID, float _worldX, float _world
         rightMostCell   = min(m_numCellsX - 1, rightMostCell);
         upMostCell      = max(0, upMostCell);
         downMostCell    = min(m_numCellsZ - 1, downMostCell);
-        
+
         for( int x = leftMostCell; x <= rightMostCell; ++x )
         {
             for( int z = upMostCell; z <= downMostCell; ++z )
@@ -359,7 +359,7 @@ void EntityGrid::RemoveObject (WorldObjectId _objectID, float _worldX, float _wo
         rightMostCell   = min(m_numCellsX - 1, rightMostCell);
         upMostCell      = max(0, upMostCell);
         downMostCell    = min(m_numCellsZ - 1, downMostCell);
-        
+
         for( int x = leftMostCell; x <= rightMostCell; ++x )
         {
             for( int z = upMostCell; z <= downMostCell; ++z )
@@ -384,7 +384,7 @@ void EntityGrid::UpdateObject (WorldObjectId _objectId, float _oldWorldX, float
     int newIndexX = GetGridIndexX(_newWorldX);
     int newIndexZ = GetGridIndexZ(_newWorldZ);
 
-    if ( oldIndexX != newIndexX || 
+    if ( oldIndexX != newIndexX ||
          oldIndexZ != newIndexZ ||
          _radius > 0.0f )
     {
@@ -412,7 +412,7 @@ WorldObjectId *EntityGrid::GetEnemies(float _worldX, float _worldZ, float _range
 // *** GetBestEnemy
 // Returns the nearest enemy with between the _minRange and _maxRange.
 // Returns an "invalid" WorldObjectId if no enemy is within that range.
-WorldObjectId EntityGrid::GetBestEnemy(float _worldX, float _worldZ, 
+WorldObjectId EntityGrid::GetBestEnemy(float _worldX, float _worldZ,
                                                                   float _minRange, float _maxRange, unsigned char _myTeam)
 {
     int numFound;
@@ -458,7 +458,7 @@ WorldObjectId *EntityGrid::GetFriends(float _worldX, float _worldZ, float _range
 
 
 // *** GetNeighbours
-WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _range, 
+WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _range,
                                                                                 int *_numNeighbours)
 {
     bool include[NUM_TEAMS];
@@ -469,11 +469,11 @@ WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _ra
 
 
 // *** GetNeighbours
-WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _range, 
+WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _range,
                                                                 int *_numFound, bool _includeTeam[NUM_TEAMS] )
 {
     int numFoundSoFar = 0;
-    
+
     // Find out which cells to look it
     int leftMostCell = GetGridIndexX(_worldX - _range);
     int rightMostCell = GetGridIndexX(_worldX + _range);
@@ -497,14 +497,14 @@ WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _ra
                 if( _includeTeam[t] )
                 {
                     EntityGridCell *ogc = GetCell(x, z, t);
-            
+
                     for (int i = 0; i < ogc->m_arraySize; i++)
                     {
                         WorldObjectId const &objId = ogc->m_objectIds[i];
 
                         if (!objId.IsValid()) continue;
 
-                        // Is this ID already added?  
+                        // Is this ID already added?
                         // (some entities occupy more than one entity grid square)
                         bool added = false;
                         for( int j = 0; j < numFoundSoFar; ++j )
@@ -518,9 +518,9 @@ WorldObjectId *EntityGrid::GetNeighbours(float _worldX, float _worldZ, float _ra
                         if( added ) continue;
 
                         Entity *obj = g_app->m_location->GetEntity( objId );
-                        if( !obj ) 
+                        if( !obj )
                         {
-                            LogEntityGridError( objId, Vector3(x*m_cellSizeX, 0.0f, z*m_cellSizeZ), 1 );                
+                            LogEntityGridError( objId, Vector3(x*m_cellSizeX, 0.0f, z*m_cellSizeZ), 1 );
                             continue;
                         }
 
@@ -573,14 +573,14 @@ int EntityGrid::GetNumNeighbours(float _worldX, float _worldZ, float _range, boo
                 if( _includeTeam[t] )
                 {
                     EntityGridCell *ogc = GetCell(x, z, t);
-            
+
                     for (int i = 0; i < ogc->m_arraySize; i++)
                     {
                         WorldObjectId const &objId = ogc->m_objectIds[i];
-                
+
                         if (!objId.IsValid()) continue;
 
-                        // Is this ID already added?  
+                        // Is this ID already added?
                         // (some entities occupy more than one entity grid square)
                         bool added = false;
                         for( int j = 0; j < numFoundSoFar; ++j )
@@ -611,7 +611,7 @@ int EntityGrid::GetNumFriends(float _worldX, float _worldZ, float _range, unsign
     bool includeTeam[NUM_TEAMS];
     for( int i = 0; i < NUM_TEAMS; ++i )
     {
-        includeTeam[i] = g_app->m_location->IsFriend( i, _myTeam );        
+        includeTeam[i] = g_app->m_location->IsFriend( i, _myTeam );
     }
 
     return GetNumNeighbours( _worldX, _worldZ, _range, includeTeam );
@@ -623,7 +623,7 @@ int EntityGrid::GetNumEnemies(float _worldX, float _worldZ, float _range, unsign
     bool includeTeam[NUM_TEAMS];
     for( int i = 0; i < NUM_TEAMS; ++i )
     {
-        includeTeam[i] = !g_app->m_location->IsFriend( i, _myTeam );        
+        includeTeam[i] = !g_app->m_location->IsFriend( i, _myTeam );
     }
 
     return GetNumNeighbours( _worldX, _worldZ, _range, includeTeam );
@@ -672,7 +672,7 @@ bool EntityGrid::AreEnemiesPresent(float _worldX, float _worldZ, float _range, u
     bool includeTeam[NUM_TEAMS];
     for( int i = 0; i < NUM_TEAMS; ++i )
     {
-        includeTeam[i] = !g_app->m_location->IsFriend( i, _myTeam );        
+        includeTeam[i] = !g_app->m_location->IsFriend( i, _myTeam );
     }
 
     return AreNeighboursPresent( _worldX, _worldZ, _range, includeTeam );
@@ -684,7 +684,7 @@ bool EntityGrid::AreFriendsPresent(float _worldX, float _worldZ, float _range, u
     bool includeTeam[NUM_TEAMS];
     for( int i = 0; i < NUM_TEAMS; ++i )
     {
-        includeTeam[i] = g_app->m_location->IsFriend( i, _myTeam );        
+        includeTeam[i] = g_app->m_location->IsFriend( i, _myTeam );
     }
 
     return AreNeighboursPresent( _worldX, _worldZ, _range, includeTeam );
@@ -700,11 +700,11 @@ void EntityGrid::Render ()
 
     float cellSizeX = g_app->m_location->m_landscape.GetWorldSizeX() / (float) m_numCellsX;
     float cellSizeZ = g_app->m_location->m_landscape.GetWorldSizeZ() / (float) m_numCellsZ;
+
     glDisable( GL_CULL_FACE );
     glEnable( GL_BLEND );
 
-    for ( x = 0; x < m_numCellsX; ++x ) 
+    for ( x = 0; x < m_numCellsX; ++x )
     {
         float worldX = ((float) x / (float) m_numCellsX) * g_app->m_location->m_landscape.GetWorldSizeX();
         for ( z = 0; z < m_numCellsZ; ++z )
@@ -719,7 +719,7 @@ void EntityGrid::Render ()
                      float worldZ = ((float) z / (float) m_numCellsZ) * g_app->m_location->m_landscape.GetWorldSizeZ();
                      float worldY = g_app->m_location->m_landscape.m_heightMap->GetValue( worldX, worldZ ) + 10.0f;
                      worldY = 100.0f + t * 30.0f;
-                
+
                      float alpha = 128;
                      RGBAColour col = g_app->m_location->m_teams[t].m_colour;
                      glColor4ub(col.r, col.g, col.b, alpha);
@@ -776,16 +776,16 @@ void EntityGrid::Render ()
             for( int z = 0; z < m_numCellsZ; ++z )
             {
                 EntityGridCell *ogc = GetCell(x, z);
-            
+
                 for (int i = 0; i < ogc->m_arraySize; i++)
                 {
-                    WorldObjectId const &objId = ogc->m_objectIds[i];                              
+                    WorldObjectId const &objId = ogc->m_objectIds[i];
                     if (!objId.IsValid()) continue;
 
                     Entity *obj = g_app->m_location->GetEntity( objId );
-                    if( !obj ) 
+                    if( !obj )
                     {
-                        LogEntityGridError( objId, Vector3(x*m_cellSizeX, 0.0f, z*m_cellSizeZ), 1 );                                        
+                        LogEntityGridError( objId, Vector3(x*m_cellSizeX, 0.0f, z*m_cellSizeZ), 1 );
                     }
                 }
             }
index 11b8fb8ee40cc5fa2015cd9a93073b9224d84edd..a9fecc48f89ca2480e2bf49f4020e8530f9f44b1 100644 (file)
@@ -19,7 +19,7 @@ private:
     int                 m_maxNeighbours;
 
        EntityGridCell      *m_cells[NUM_TEAMS];
-       
+
     int                 m_numCellsX;
        int                 m_numCellsZ;
     float               m_cellSizeX;
@@ -31,7 +31,7 @@ private:
        EntityGridCell      *GetCell(int _indexX, int _indexZ, int _team);
 
     void                EnsureMaxNeighbours( int _maxNeighbours );
-    
+
 public:
        EntityGrid(float _cellSizeX, float _cellSizeZ);
        ~EntityGrid();
@@ -45,16 +45,16 @@ public:
                                              float _newWorldX, float _newWorldZ,
                                              float _radius );
 
-    WorldObjectId *GetNeighbours(float _worldX, float _worldZ, float _range, 
+    WorldObjectId *GetNeighbours(float _worldX, float _worldZ, float _range,
                                                                 int *_numFound, bool _includeTeam[NUM_TEAMS] );
 
-    WorldObjectId *GetNeighbours(float _worldX, float _worldZ, float _range, 
+    WorldObjectId *GetNeighbours(float _worldX, float _worldZ, float _range,
                                  int *_numFound);
 
     WorldObjectId *GetEnemies   (float _worldX, float _worldZ, float _range,
                                  int *_numFound, unsigned char _myTeam);
 
-       WorldObjectId GetBestEnemy  (float _worldX, float _worldZ, 
+       WorldObjectId GetBestEnemy  (float _worldX, float _worldZ,
                                                                 float _minRange, float _maxRange, unsigned char _myTeam);
 
     WorldObjectId *GetFriends   (float _worldX, float _worldZ, float _range,
@@ -63,7 +63,7 @@ public:
     int GetNumNeighbours        (float _worldX, float _worldZ, float _range, bool _includeTeam[NUM_TEAMS] );    // fast
     int GetNumEnemies           (float _worldX, float _worldZ, float _range, unsigned char _myTeam );           // fast
     int GetNumFriends           (float _worldX, float _worldZ, float _range, unsigned char _myTeam );           // fast
-    
+
     bool AreNeighboursPresent   (float _worldX, float _worldZ, float _range, bool _includeTeam[NUM_TEAMS] );    // very fast
     bool AreEnemiesPresent      (float _worldX, float _worldZ, float _range, unsigned char _myTeam );           // very fast
     bool AreFriendsPresent      (float _worldX, float _worldZ, float _range, unsigned char _myTeam );           // very fast
index 076761af42a3599e5ebd69b0bba7d50e4c8c568d..bc2722eaa76241baeadc4bfbd30b64b85e12937d 100644 (file)
@@ -127,7 +127,7 @@ Explosion::Explosion(ShapeFragment *_frag, Matrix34 const &_transform, float _fr
 
                triangles.PutData(tri);
        }
-    
+
        m_numTris = triangles.Size();
     if( m_numTris > 0 )
     {
@@ -165,7 +165,7 @@ bool Explosion::Advance()
                if (g_gameTime > m_tris[i].m_timeToDie) continue;
 
                m_tris[i].m_pos += m_tris[i].m_vel * g_advanceTime;
-       
+
                // Friction
                float speed = m_tris[i].m_vel.Mag();
                float friction = speed * FRICTION_COEF * g_advanceTime;
@@ -202,12 +202,12 @@ void Explosion::Render()
                Vector3 const v1(m_tris[i].m_tumbler->m_rotMat * m_tris[i].m_v1 + m_tris[i].m_pos);
                Vector3 const v2(m_tris[i].m_tumbler->m_rotMat * m_tris[i].m_v2 + m_tris[i].m_pos);
                Vector3 const v3(m_tris[i].m_tumbler->m_rotMat * m_tris[i].m_v3 + m_tris[i].m_pos);
-       
-               glColor4ub(m_tris[i].m_colour.r, 
+
+               glColor4ub(m_tris[i].m_colour.r,
                    m_tris[i].m_colour.g,
                    m_tris[i].m_colour.b,
                    (1.0f-age) * 255);
-        
+
                glNormal3fv(norm.GetDataConst());
 
         glTexCoord2i( 0, 0 );       glVertex3fv(v1.GetDataConst());
@@ -251,14 +251,14 @@ ExplosionManager::~ExplosionManager()
 }
 
 
-void ExplosionManager::AddExplosion(ShapeFragment *_frag, 
+void ExplosionManager::AddExplosion(ShapeFragment *_frag,
                                                                        Matrix34 const &_transform, bool _recurse, float _fraction)
 {
     if( _fraction <= 0.0f )
     {
         return;
     }
-    
+
        if (_frag->m_numTriangles > 0)
        {
                Explosion *explosion = new Explosion(_frag, _transform, _fraction);
index 4976c5f5a1ee535eefc443066f8e6ded894d8d26..df153dfce3366cd291e7dcf538e5780bcaf20398 100644 (file)
@@ -11,7 +11,7 @@
 // Class Tumbler
 //*****************************************************************************
 
-// This class maintains a rotation matrix that is used to make an ExplodingTri 
+// This class maintains a rotation matrix that is used to make an ExplodingTri
 // tumble as it flys through space. The m_rotMat matrix has a little bit of
 // rotation multiplied on to it every frame.
 class Tumbler
index 7dd0d2b60cbbbc22e53c053be9e4af00d96c94ee..dbfaf6eba28406e27ef10c4d202e0f33e58be781 100644 (file)
@@ -63,7 +63,7 @@ void GameMenuButton::Render( int realX, int realY, bool highlighted, bool clicke
     {
         glColor4f( 1.0, 0.3f, 0.3, 1.0f );
     }
-    
+
     g_gameFont.SetRenderOutline(false);
     g_gameFont.DrawText2DCentre( realX, realY, m_fontSize, m_iconName );
 
@@ -231,7 +231,7 @@ public:
             strcpy( g_app->m_requestedMap, g_app->m_gameMenu->m_maps[parent->m_gameType][parent->m_requestedMapId] );
             strcpy( g_app->m_requestedMission, "null" );
         }
-        
+
         g_app->m_requestToggleEditing = false;
         g_app->m_requestedLocationId = 999;
 
@@ -489,7 +489,7 @@ void GameMenuWindow::GetDefaultPositions(int *_x, int *_y, int *_gap)
     *_x = (w / 2) - 150;
     switch( m_newPage )
     {
-        case PageMain:     
+        case PageMain:
         case PageDarwinia:      *_y = float((h / 864.0f ) * 200.0f); *_gap = *_y;            break;
         case PageMultiwinia:    *_y = float((h / 864.0f ) * 200.0f); *_gap = *_y / 1.5f;     break;
         case PageGameSetup:
index 25a05aa9442f12bff6b335a1525cb3a5b6a5c7a6..b32638d1471668ddd594e93538dbfe62305b2ecd 100644 (file)
@@ -63,7 +63,7 @@ public:
     void SetupMainPage();
     void SetupDarwiniaPage();
 
-    void CreateMenuControl( char const *name, int dataType, void *value, int y, 
+    void CreateMenuControl( char const *name, int dataType, void *value, int y,
                                                        float change, float _lowBound, float _highBound,
                             DarwiniaButton *callback, int x, int w, float fontSize);
 
index 41dddda68e918d44e44ad6f7c8c8d15cf1908d6f..253a8ab4332e35b877e28fde7813b7801946d070 100644 (file)
@@ -67,21 +67,21 @@ GameCursor::GameCursor()
 
     m_cursorSelection = new MouseCursor( "icons/mouse_selection.bmp" );
     m_cursorSelection->SetHotspot( 0.5f, 0.5f );
-    
+
        m_cursorMissile = NULL;
 
     //
     // Load selection arrow graphic
-    
+
        sprintf( m_selectionArrowFilename, "icons/selectionarrow.bmp" );
 
     BinaryReader *binReader = g_app->m_resource->GetBinaryReader( m_selectionArrowFilename );
-       DarwiniaReleaseAssert(binReader, "Failed to open mouse cursor resource %s", m_selectionArrowFilename ); 
+       DarwiniaReleaseAssert(binReader, "Failed to open mouse cursor resource %s", m_selectionArrowFilename );
     BitmapRGBA bmp( binReader, "bmp" );
        SAFE_DELETE(binReader);
 
        g_app->m_resource->AddBitmap(m_selectionArrowFilename, bmp);
-       
+
        sprintf(m_selectionArrowShadowFilename, "shadow_%s", m_selectionArrowFilename);
     bmp.ApplyBlurFilter( 10.0f );
        g_app->m_resource->AddBitmap(m_selectionArrowShadowFilename, bmp);
@@ -127,8 +127,8 @@ bool GameCursor::GetSelectedObject( WorldObjectId &_id, Vector3 &_pos )
         {
             Unit *selected = team->GetMyUnit();
             if( selected )
-            {       
-                _pos = selected->m_centrePos + selected->m_vel * g_predictionTime;                
+            {
+                _pos = selected->m_centrePos + selected->m_vel * g_predictionTime;
                 _id.Set( selected->m_teamId, selected->m_unitId, -1, -1 );
 
                 // Add the centre pos
@@ -152,7 +152,7 @@ bool GameCursor::GetSelectedObject( WorldObjectId &_id, Vector3 &_pos )
 
 
 bool GameCursor::GetHighlightedObject( WorldObjectId &_id, Vector3 &_pos, float &_radius )
-{    
+{
     WorldObjectId id;
     bool somethingHighlighted = false;
     bool found = false;
@@ -171,7 +171,7 @@ bool GameCursor::GetHighlightedObject( WorldObjectId &_id, Vector3 &_pos, float
         }
     }
 
-    
+
     if( somethingHighlighted )
     {
         if( id.GetUnitId() == UNIT_BUILDINGS )
@@ -226,7 +226,7 @@ bool GameCursor::GetHighlightedObject( WorldObjectId &_id, Vector3 &_pos, float
             if( entity->m_type == Entity::TypeDarwinian ) _radius = entity->m_radius*2.0f;
             found = true;
         }
-    }    
+    }
 
     return found;
 }
@@ -276,7 +276,7 @@ void GameCursor::RenderMarkers()
 
 
 void GameCursor::Render()
-{        
+{
     START_PROFILE( g_app->m_profiler, "Render GameCursor" );
 
        float nearPlaneStart = g_app->m_renderer->GetNearPlane();
@@ -287,7 +287,7 @@ void GameCursor::Render()
        int screenY = g_target->Y();
     Vector3 mousePos = g_app->m_userInput->GetMousePos3d();
     mousePos.y = max( 1.0f, mousePos.y );
-        
+
     bool cursorRendered = false;
        bool chatLog = g_app->m_sepulveda->ChatLogVisible();
 
@@ -298,7 +298,7 @@ void GameCursor::Render()
        // Set mip mapping for game cursor
        glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
        glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-    
+
     if( g_app->m_editing || EclGetWindows()->Size() > 0 )
     {
         // Editing
@@ -314,9 +314,9 @@ void GameCursor::Render()
     }
     else if( !g_app->m_location )
     {
-        // We are in the global world        
+        // We are in the global world
         GlobalLocation *highlightedLocation = g_app->m_globalWorld->GetHighlightedLocation();
-        bool locAvailable = highlightedLocation && 
+        bool locAvailable = highlightedLocation &&
                             strcmp(highlightedLocation->m_missionFilename, "null" ) != 0 &&
                             highlightedLocation->m_available;
         g_app->m_renderer->SetupMatricesFor2D();
@@ -338,8 +338,8 @@ void GameCursor::Render()
         WorldObjectId highlightedId;
         float highlightedRadius;
 
-        bool somethingSelected = GetSelectedObject( selectedId, selectedWorldPos );                        
-        bool somethingHighlighted = GetHighlightedObject( highlightedId, highlightedWorldPos, highlightedRadius ); 
+        bool somethingSelected = GetSelectedObject( selectedId, selectedWorldPos );
+        bool somethingHighlighted = GetHighlightedObject( highlightedId, highlightedWorldPos, highlightedRadius );
 
         if( g_app->m_taskManagerInterface->m_visible )
         {
@@ -348,7 +348,7 @@ void GameCursor::Render()
             {
                 RenderSelectionArrows( selectedId, selectedWorldPos );
             }
-            
+
             if( somethingHighlighted )
             {
                 float camDist = ( g_app->m_camera->GetPos() - highlightedWorldPos ).Mag();
@@ -363,10 +363,10 @@ void GameCursor::Render()
             }
 
         }
-        else if( task && 
-                task->m_state == Task::StateStarted && 
+        else if( task &&
+                task->m_state == Task::StateStarted &&
                 task->m_type != GlobalResearch::TypeOfficer &&
-                !somethingHighlighted )        
+                !somethingHighlighted )
         {
             // The player is placing a task
             bool validPlacement = g_app->m_taskManager->IsValidTargetArea(task->m_id, mousePos);
@@ -375,11 +375,11 @@ void GameCursor::Render()
             Vector3 landNormal = g_app->m_location->m_landscape.m_normalMap->GetValue(mousePos.x, mousePos.z);
             Vector3 front = (landNormal ^ g_upVector).Normalise();
             m_cursorPlacement->Render3D( mousePos, front, landNormal );
-            if( !validPlacement) 
+            if( !validPlacement)
                                m_cursorDisabled->Render3D(mousePos, front, landNormal);
                        else
                                m_validPlacementOpportunity = true;
-                       
+
             cursorRendered = true;
         }
                else if( g_app->m_camera->IsInMode( Camera::ModeEntityTrack ) )
@@ -409,7 +409,7 @@ void GameCursor::Render()
                    cursorRendered = true;
                }
         else
-        {            
+        {
             if( somethingHighlighted &&
                 !(somethingSelected && highlightedId.GetUnitId() == UNIT_BUILDINGS) )
             {
@@ -433,13 +433,13 @@ void GameCursor::Render()
             {
                 int entityType = Entity::TypeInvalid;
                 if( selectedId.GetIndex() == -1 )   entityType = g_app->m_location->GetUnit(selectedId)->m_troopType;
-                else                                entityType = g_app->m_location->GetEntity(selectedId)->m_type;             
+                else                                entityType = g_app->m_location->GetEntity(selectedId)->m_type;
 
                 RenderSelectionArrows( selectedId, selectedWorldPos );
                                m_moveableEntitySelected = true;
 
                 bool highlightedBuilding = ( somethingHighlighted && highlightedId.GetUnitId() == UNIT_BUILDINGS );
-                
+
                 if( (entityType == Entity::TypeInsertionSquadie ||
                      entityType == Entity::TypeOfficer)
                      && highlightedBuilding )
@@ -494,12 +494,12 @@ void GameCursor::Render()
                 Vector3 front = (landNormal ^ g_upVector).Normalise();
                 m_cursorHighlight->SetAnimation( false );
                 m_cursorHighlight->SetSize( 30.0f );
-                m_cursorHighlight->Render3D( mousePos, front, landNormal );                                
+                m_cursorHighlight->Render3D( mousePos, front, landNormal );
                 cursorRendered = true;
             }
         }
     }
-                    
+
     if( !cursorRendered &&
         g_inputManager->getInputMode() != INPUT_MODE_GAMEPAD )
     {
@@ -514,9 +514,9 @@ void GameCursor::Render()
     {
         //RenderSphere( g_app->m_location->GetMyTeam()->m_currentMousePos, 10 );
     }
-    
+
     RenderMarkers();
-    
+
        g_app->m_camera->SetupProjectionMatrix(nearPlaneStart,
                                                                                   g_app->m_renderer->GetFarPlane());
 
@@ -578,10 +578,10 @@ void GameCursor::FindScreenEdge( Vector2 const &_line, float *_posX, float *_pos
 
     int screenH = g_app->m_renderer->ScreenH();
     int screenW = g_app->m_renderer->ScreenW();
-    
+
     float m = _line.y / _line.x;
     float c = ( screenH / 2.0f ) - m * ( screenW / 2.0f );
-    
+
     if( _line.y < 0 )
     {
         // Intersect with top view plane
@@ -602,14 +602,14 @@ void GameCursor::FindScreenEdge( Vector2 const &_line, float *_posX, float *_pos
             *_posX = x;
             *_posY = screenH;
             return;
-        }        
+        }
     }
 
     if( _line.x < 0 )
     {
-        // Intersect with left view plane 
+        // Intersect with left view plane
         float y = m * 0 + c;
-        if( y >= 0 && y <= screenH ) 
+        if( y >= 0 && y <= screenH )
         {
             *_posX = 0;
             *_posY = y;
@@ -620,12 +620,12 @@ void GameCursor::FindScreenEdge( Vector2 const &_line, float *_posX, float *_pos
     {
         // Intersect with right view plane
         float y = m * screenW + c;
-        if( y >= 0 && y <= screenH ) 
+        if( y >= 0 && y <= screenH )
         {
             *_posX = screenW;
             *_posY = y;
             return;
-        }        
+        }
     }
 
     // We should never ever get here
@@ -660,7 +660,7 @@ void GameCursor::RenderSelectionArrow( float _screenX, float _screenY, float _sc
         glTexCoord2i( 1, 0 );       glVertex2fv( (pos + rightAngle * _size / 2.0f + gradient * _size).GetData() );
         glTexCoord2i( 1, 1 );       glVertex2fv( (pos + rightAngle * _size / 2.0f).GetData() );
     glEnd();
-    
+
     glColor4f       ( 1.0f, 1.0f, 0.3f, _alpha );
        glBlendFunc             ( GL_SRC_ALPHA, GL_ONE );
     glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( m_selectionArrowFilename ) );
@@ -690,7 +690,7 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
     float triSize = 40.0f;
 
     static bool onScreen = true;
-    
+
     int screenH = g_app->m_renderer->ScreenH();
     int screenW = g_app->m_renderer->ScreenW();
 
@@ -721,12 +721,12 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
         {
             alpha = max( min( ( camDist - 200.0f ) / 200.0f, 0.9f ), alpha );
         }
-        g_app->m_renderer->SetupMatricesFor2D();  
+        g_app->m_renderer->SetupMatricesFor2D();
         RenderSelectionArrow( screenX, screenY - distanceOut, 0, -1, triSize, alpha );
         RenderSelectionArrow( screenX, screenY + distanceOut, 0, 1, triSize, alpha );
         RenderSelectionArrow( screenX - distanceOut, screenY, -1, 0, triSize, alpha );
         RenderSelectionArrow( screenX + distanceOut, screenY, 1, 0, triSize, alpha );
-        g_app->m_renderer->SetupMatricesFor3D();  
+        g_app->m_renderer->SetupMatricesFor3D();
 
         if( !onScreen ) BoostSelectionArrows(2.0f);
         onScreen = true;
@@ -744,15 +744,15 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
 
         Vector2 lineNormal( posX - camX, posY - camY );
         lineNormal.Normalise();
-        
+
         float edgeX, edgeY;
         FindScreenEdge( lineNormal, &edgeX, &edgeY );
 
         lineNormal.x *= -1;
 
-        g_app->m_renderer->SetupMatricesFor2D();  
-        RenderSelectionArrow( edgeX, screenH - edgeY, lineNormal.x, lineNormal.y, triSize * 1.5f, 0.9f );       
-        g_app->m_renderer->SetupMatricesFor3D();  
+        g_app->m_renderer->SetupMatricesFor2D();
+        RenderSelectionArrow( edgeX, screenH - edgeY, lineNormal.x, lineNormal.y, triSize * 1.5f, 0.9f );
+        g_app->m_renderer->SetupMatricesFor3D();
 
         onScreen = false;
     }
@@ -767,7 +767,7 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
        float yOut = 24.0f;
 
     static bool onScreen = true;
-    
+
        // Project worldTarget into screen co-ordinates
     int screenH = g_app->m_renderer->ScreenH();
     int screenW = g_app->m_renderer->ScreenW();
@@ -778,15 +778,15 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
        // Calculate alpha
        Vector3 toCam = g_app->m_camera->GetPos() - _pos;
        float distance = toCam.Mag();
-       
+
     if( distance < 400.0f )
     {
         xOut += ( 100.0f - distance/4.0f );
         yOut += ( 100.0f - distance/4.0f );
     }
-    
+
     float alpha = 0.0f;
-       if (distance > 350.0f) 
+       if (distance > 350.0f)
        {
                distance -= 350.0f;
                alpha = distance / 300.0f;
@@ -808,7 +808,7 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
        if (angle > 0.0f)
        {
                // Unit is behind camera
-               
+
                alpha = SELECTION_ARROWS_MAX_ALPHA;
 
                if (rotationVector.y < 0.0f)
@@ -832,7 +832,7 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
         {
             BoostSelectionArrows( 2.0f );
         }
-        
+
                if (screenX > screenW + xOut)
                {
                        alpha = SELECTION_ARROWS_MAX_ALPHA;
@@ -887,32 +887,32 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
 
         Vector2 lineNormal( posX - camX, posY - camY );
         lineNormal.Normalise();
-        
+
         float edgeX, edgeY;
         FindScreenEdge( lineNormal, &edgeX, &edgeY );
 
         lineNormal.x *= -1;
 
-        g_app->m_renderer->SetupMatricesFor2D();  
+        g_app->m_renderer->SetupMatricesFor2D();
 
         RenderSelectionArrow( edgeX, screenH - edgeY, lineNormal.x, lineNormal.y, triSize, 1.0f );
-        
-        g_app->m_renderer->SetupMatricesFor3D();  
+
+        g_app->m_renderer->SetupMatricesFor3D();
     }
     else
     {
            // Get ready to render
-        g_app->m_renderer->SetupMatricesFor2D();  
+        g_app->m_renderer->SetupMatricesFor2D();
         glEnable        ( GL_BLEND );
         glDisable       ( GL_CULL_FACE );
     // glEnable                ( GL_TEXTURE_2D );
     // glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture("selection_arrow") );
 
-           // Do subtractive pass 
+           // Do subtractive pass
            {
                    glColor4f       ( 0.9f, 0.9f, 0.1f, alpha/2.0f );
                    glBlendFunc         ( GL_ZERO, GL_ONE_MINUS_SRC_ALPHA );
-                   
+
                    LeftArrow ( screenX - xOut, screenY, triSize );
                    RightArrow( screenX + xOut, screenY, triSize );
                    TopArrow  ( screenX, screenY - yOut, triSize );
@@ -922,7 +922,7 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
            // Do additive pass
            {
                    float myTriSize = triSize - 8.0f;
-                   float myXOut = xOut + 5.0f;            
+                   float myXOut = xOut + 5.0f;
                    float myYOut = yOut + 5.0f;
 
                    glColor4f       ( 0.9f, 0.9f, 0.1f, alpha );
@@ -938,13 +938,13 @@ void GameCursor::RenderSelectionArrows( WorldObjectId _id, Vector3 const &_pos )
         glEnable        ( GL_CULL_FACE );
     // glDisable               ( GL_TEXTURE_2D );
 
-        g_app->m_renderer->SetupMatricesFor3D();  
+        g_app->m_renderer->SetupMatricesFor3D();
     }
 }*/
 
 void GameCursor::RenderWeaponMarker ( Vector3 _pos, Vector3 _front, Vector3 _up )
 {
-    m_cursorPlacement->SetSize(40.0f);    
+    m_cursorPlacement->SetSize(40.0f);
     m_cursorPlacement->SetShadowed( true );
     m_cursorPlacement->SetAnimation( true );
     m_cursorPlacement->Render3D( _pos, _front, _up );
@@ -968,12 +968,12 @@ MouseCursor::MouseCursor( char const *_filename )
        m_mainFilename = strdup(fullFilename);
 
     BinaryReader *binReader = g_app->m_resource->GetBinaryReader( m_mainFilename );
-       DarwiniaReleaseAssert(binReader, "Failed to open mouse cursor resource %s", _filename); 
+       DarwiniaReleaseAssert(binReader, "Failed to open mouse cursor resource %s", _filename);
     BitmapRGBA bmp( binReader, "bmp" );
        SAFE_DELETE(binReader);
 
        g_app->m_resource->AddBitmap(m_mainFilename, bmp);
-       
+
        sprintf(fullFilename, "shadow_%s", _filename);
        m_shadowFilename = strdup(fullFilename);
     bmp.ApplyBlurFilter( 10.0f );
@@ -1034,7 +1034,7 @@ void MouseCursor::SetColour(RGBAColour &_col )
 
 void MouseCursor::Render(float _x, float _y)
 {
-       float s = GetSize();    
+       float s = GetSize();
        float x = (float)_x - s * m_hotspotX;
        float y = (float)_y - s * m_hotspotY;
 
@@ -1055,10 +1055,10 @@ void MouseCursor::Render(float _x, float _y)
                    glTexCoord2i(0,0);                  glVertex2f(x, y + s);
            glEnd();
     }
-    
+
     glColor4ubv     (m_colour.GetData() );
        glBindTexture   (GL_TEXTURE_2D, g_app->m_resource->GetTexture(m_mainFilename));
-       glBlendFunc     (GL_SRC_ALPHA, GL_ONE);                                                 
+       glBlendFunc     (GL_SRC_ALPHA, GL_ONE);
        glBegin         (GL_QUADS);
                glTexCoord2i(0,1);                      glVertex2f(x, y);
                glTexCoord2i(1,1);                      glVertex2f(x + s, y);
@@ -1068,7 +1068,7 @@ void MouseCursor::Render(float _x, float _y)
 
     glDepthMask     (true);
     glDisable       (GL_BLEND);
-       glBlendFunc     (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);                                                 
+       glBlendFunc     (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glDisable       (GL_TEXTURE_2D);
     glEnable        (GL_CULL_FACE);
 }
@@ -1077,14 +1077,14 @@ void MouseCursor::Render(float _x, float _y)
 void MouseCursor::Render3D( Vector3 const &_pos, Vector3 const &_front, Vector3 const &_up, bool _cameraScale)
 {
     Vector3 rightAngle = (_front ^ _up).Normalise();
-    
+
        glEnable        (GL_TEXTURE_2D);
-    
+
        glEnable        (GL_BLEND);
     glDisable       (GL_CULL_FACE );
     //glDisable       (GL_DEPTH_TEST );
     glDepthMask     (false);
-    
+
     float scale = GetSize();
     if( _cameraScale )
     {
@@ -1112,7 +1112,7 @@ void MouseCursor::Render3D( Vector3 const &_pos, Vector3 const &_front, Vector3
 
     glColor4ubv     (m_colour.GetData());
        glBindTexture   (GL_TEXTURE_2D, g_app->m_resource->GetTexture(m_mainFilename));
-       glBlendFunc     (GL_SRC_ALPHA, GL_ONE);                                                 
+       glBlendFunc     (GL_SRC_ALPHA, GL_ONE);
 
     glBegin( GL_QUADS );
         glTexCoord2i(0,1);      glVertex3fv( (pos).GetData() );
@@ -1122,9 +1122,9 @@ void MouseCursor::Render3D( Vector3 const &_pos, Vector3 const &_front, Vector3
     glEnd();
 
     glDepthMask     (true);
-    glEnable        (GL_DEPTH_TEST );    
+    glEnable        (GL_DEPTH_TEST );
     glDisable       (GL_BLEND);
-       glBlendFunc     (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);                                                 
+       glBlendFunc     (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glDisable       (GL_TEXTURE_2D);
     glEnable        (GL_CULL_FACE);
 }
index ceaa9d10cd3f84c2ddb9460c783a799b97ae2253..17c88938283d7a44f43edaf0b052601e98ca382b 100644 (file)
@@ -36,12 +36,12 @@ protected:
        float           m_selectionArrowBoost;
 
        bool            m_highlightingSomething;
-       bool            m_validPlacementOpportunity; 
+       bool            m_validPlacementOpportunity;
        bool            m_moveableEntitySelected;
 
     bool GetSelectedObject      ( WorldObjectId &_id, Vector3 &_pos );
-    bool GetHighlightedObject   ( WorldObjectId &_id, Vector3 &_pos, float &_radius );        
-    
+    bool GetHighlightedObject   ( WorldObjectId &_id, Vector3 &_pos, float &_radius );
+
     void RenderSelectionArrows  ( WorldObjectId _id, Vector3 const &_pos );
     void RenderSelectionArrow   ( float _screenX, float _screenY, float _screenDX, float _screenDY, float _size, float _alpha );
 
@@ -49,7 +49,7 @@ protected:
     void FindScreenEdge         ( Vector2 const &_line, float *_posX, float *_posY );
 
     LList<MouseCursorMarker *>  m_markers;
-       
+
 public:
 
 
@@ -99,7 +99,7 @@ protected:
 
        float   GetSize();
 
-public:    
+public:
     MouseCursor         (char const *_filename);
        ~MouseCursor        ();
 
@@ -108,7 +108,7 @@ public:
     void SetShadowed    (bool _onOrOff);
        void SetHotspot     (float x, float y);
     void SetColour      (RGBAColour &_col );
-       
+
        void Render         (float _x, float _y);
     void Render3D       (Vector3 const &_pos, Vector3 const &_front, Vector3 const &_up, bool _cameraScale=true);
 };
index 142a09829de3597021b77d402f39f426b5ed5706..573fb408268805357943d4016076ead26429505e 100644 (file)
@@ -25,7 +25,7 @@
 
 /*
  * Feature Set
- * A set of calculated data that represents 
+ * A set of calculated data that represents
  * a complete gesture.
  *
     double   f1;                         // Cosine of angle between sample[0] and sample[2]
@@ -104,7 +104,7 @@ bool Gesture::CalculateFeatureSet()
     double startDX = double (m_mouseSamples[2].x - m_mouseSamples[0].x);
     double startDY = double (m_mouseSamples[2].y - m_mouseSamples[0].y);
     m_featureSet.f[1] = startDX / sqrt( startDX * startDX + startDY * startDY );
-    
+
 
     //
     // Compute f2 : sine of angle between sample[0] and sample[2]
@@ -113,7 +113,7 @@ bool Gesture::CalculateFeatureSet()
 
     //
     // Compute f3 : Length of bounding box diagonal
-    
+
     double boundL = (double) 999999;
     double boundR = 0.0f;
     double boundT = (double) 999999;
@@ -140,7 +140,7 @@ bool Gesture::CalculateFeatureSet()
     m_featureSet.f[5] = sqrt( firstToLastDX * firstToLastDX + firstToLastDY * firstToLastDY );
 
 
-    // 
+    //
     // Compute f6 : Cosine of the angle of the line between first and last point
     m_featureSet.f[6] = firstToLastDX / m_featureSet.f[5];
 
@@ -176,9 +176,9 @@ bool Gesture::CalculateFeatureSet()
         double b_dX = m_mouseSamples[k].x - m_mouseSamples[k-1].x;
         double b_dY = m_mouseSamples[k].y - m_mouseSamples[k-1].y;
 
-        double angle = atan( (a_dX * b_dY - b_dX * a_dY ) / 
+        double angle = atan( (a_dX * b_dY - b_dX * a_dY ) /
                             (a_dX * b_dX + a_dY * b_dY ) );
-        
+
         totalAngleTraversed += angle;
         sumAbsoluteAngles += fabs(angle);
         sumSquaredAngles += (angle * angle);
@@ -198,7 +198,7 @@ bool Gesture::CalculateFeatureSet()
         double dX = m_mouseSamples[l+1].x - m_mouseSamples[l].x;
         double dY = m_mouseSamples[l+1].y - m_mouseSamples[l].y;
         double dT = m_mouseSamples[l+1].time - m_mouseSamples[l].time;
-        double thisSpeed = ( dX * dX + dY * dY ) / 
+        double thisSpeed = ( dX * dX + dY * dY ) /
                           ( dT * dT );
         if( dT == 0.0 )
             continue;
@@ -236,7 +236,7 @@ void Gesture::TrainSystem()
     };
 
     coVarianceElement *coVarianceMatrix = new coVarianceElement[numSymbols];
-    memset( coVarianceMatrix, 0, numSymbols * sizeof(coVarianceElement) );    
+    memset( coVarianceMatrix, 0, numSymbols * sizeof(coVarianceElement) );
 
     double commonCovarianceMatrix[GESTURE_MAX_FEATURES+1][GESTURE_MAX_FEATURES+1];
     memset( commonCovarianceMatrix, 0, (GESTURE_MAX_FEATURES+1) * (GESTURE_MAX_FEATURES+1) * sizeof(double) );
@@ -273,8 +273,8 @@ void Gesture::TrainSystem()
             for( int j = 0; j <= GESTURE_MAX_FEATURES; ++j )
             {
                 double result = 0.0f;
-        
-                for( int e = 0; e < theClass->m_nextTrainer; ++e )            
+
+                for( int e = 0; e < theClass->m_nextTrainer; ++e )
                 {
                     result += ( (theClass->m_trainers[e].f[i] - m_symbols[c].m_averages.f[i]) *
                                 (theClass->m_trainers[e].f[j] - m_symbols[c].m_averages.f[j]) );
@@ -311,8 +311,8 @@ void Gesture::TrainSystem()
     //
     // Invert the common coVariance Matrix
 
-    InvertMatrix( (double *) commonCovarianceMatrix, 
-                  (double *) m_invertedCovarianceMatrix, 
+    InvertMatrix( (double *) commonCovarianceMatrix,
+                  (double *) m_invertedCovarianceMatrix,
                   GESTURE_MAX_FEATURES+1, GESTURE_MAX_FEATURES+1 );
 
     //
@@ -327,12 +327,12 @@ void Gesture::TrainSystem()
             {
                 total += ( m_invertedCovarianceMatrix[i][j] *
                            m_symbols[c].m_averages.f[i] );
-            }                
+            }
             m_symbols[c].m_classes.m_weights.f[j] = total;
         }
     }
 
-    
+
     for( int c = 0; c < numSymbols; ++c )
     {
         // Calculate weight 0
@@ -344,7 +344,7 @@ void Gesture::TrainSystem()
         }
         total *= -0.5f;
         m_symbols[c].m_classes.m_weights.f[0] = total;
-    }    
+    }
 
        delete coVarianceMatrix;
 }
@@ -353,7 +353,7 @@ void Gesture::TrainSystem()
 void Gesture::AddTrainingSample( int symbolID )
 {
     Classification *newDataClass = &m_symbols[symbolID].m_classes;
-    
+
     //
     // Put the data into the Classification
 
@@ -382,9 +382,9 @@ void Gesture::RunComparison()
 
             for( int i = 1; i <= GESTURE_MAX_FEATURES; ++i )
             {
-                thisResult += theClass->m_weights.f[i] * m_featureSet.f[i];                
+                thisResult += theClass->m_weights.f[i] * m_featureSet.f[i];
             }
-            
+
             m_symbols[c].m_results = thisResult;
         }
         else
@@ -394,9 +394,9 @@ void Gesture::RunComparison()
     }
 
     for( int i = 0; i < numSymbols; ++i )
 
-    
+
+
     //
     // Calculate confidence of results
 
@@ -405,15 +405,15 @@ void Gesture::RunComparison()
         double total = 0.0;
         for( int j = 0; j < numSymbols; ++j )
         {
-            double diff = m_symbols[j].m_results - m_symbols[i].m_results;                
+            double diff = m_symbols[j].m_results - m_symbols[i].m_results;
             double expResult = exp( diff / 500.0 );
-            total += expResult;  
+            total += expResult;
         }
 
         m_symbols[i].m_confidence = 1.0 / total;
     }
 
-    
+
     //
     // Calculate Mahalanobis distance of results
 
@@ -441,9 +441,9 @@ void Gesture::LoadTrainingData( char *filename )
        reader->ReadLine();
     int numSymbols = atoi(reader->GetNextToken());
     m_symbols.SetSize( numSymbols );
-    
+
     for( int c = 0; c < numSymbols; ++c )
-    {        
+    {
         m_symbols.PutData( GestureSymbol(), c );
         Classification *theClass = &m_symbols[c].m_classes;
 
@@ -504,7 +504,7 @@ Gesture::Gesture( char *_filename )
 
     memset( m_mouseSamples, 0, GESTURE_MAX_MOUSE_SAMPLES * sizeof(MouseSample) );
     memset( &m_featureSet, 0, sizeof(FeatureSet) );
-        
+
     m_nextMouseSample = 0;
     m_recordingGesture = false;
 
@@ -625,7 +625,7 @@ double Gesture::GetCalculatedResult( int symbolID )
         return -1.0;
     }
 }
-    
+
 double Gesture::GetCalculatedConfidence( int symbolID )
 {
     if( symbolID >= 0 && symbolID < GetNumSymbols() )
@@ -649,14 +649,14 @@ double Gesture::GetMahalanobisDistance( int symbolID )
         return -1.0;
     }
 }
-    
+
 int Gesture::GetSymbolID()
 {
     int symbolMax = -1;
 
     for( int i = 0; i < GetNumSymbols(); ++i )
     {
-        if( symbolMax == -1 || 
+        if( symbolMax == -1 ||
             m_symbols[i].m_results > m_symbols[symbolMax].m_results )
         {
             symbolMax = i;
index 72acfc7def1fec7eae2bdcbaf9286626d8c54582..0390d9fe7991d20d910b2ad8241c9e80fd2bf97b 100644 (file)
@@ -25,7 +25,7 @@
 
 // struct MouseSample
 struct MouseSample
-{   
+{
     int             x;
     int             y;
     double          time;
@@ -37,7 +37,7 @@ class FeatureSet
 {
 public:
     FeatureSet      ();
-    double          f[GESTURE_MAX_FEATURES+1];          // Features are numbered 1 to MAX_FEATURES inclusive          
+    double          f[GESTURE_MAX_FEATURES+1];          // Features are numbered 1 to MAX_FEATURES inclusive
 };
 
 
@@ -58,7 +58,7 @@ class GestureSymbol
 public:
     GestureSymbol   ();
     void            ClearResults();
-    
+
     FeatureSet      m_averages;
     Classification  m_classes;
     double          m_results;
@@ -88,7 +88,7 @@ protected:
     void            RunComparison();
 
 public:
-    
+
     Gesture( char *_filename );
 
     //
index 36696585b1ae670a74bd651ae1ca963f95cc1f5b..af9925c95527c35e5b8fa2de3493a667ffdd9aaf 100644 (file)
@@ -18,17 +18,17 @@ static DWORD WINAPI Win32RecordingThread(void *_param)
 
 void RecordGestureDemo()
 {
-       HANDLE threadHandle; 
+       HANDLE threadHandle;
        unsigned long threadId;
 
-    threadHandle = CreateThread( 
-        NULL,                        // default security attributes 
-        0,                           // use default stack size  
-        Win32RecordingThread,        // thread function 
-        NULL,                           // argument to thread function 
-        0,                           // use default creation flags 
-        &threadId);                  // returns the thread identifier 
+    threadHandle = CreateThread(
+        NULL,                        // default security attributes
+        0,                           // use default stack size
+        Win32RecordingThread,        // thread function
+        NULL,                           // argument to thread function
+        0,                           // use default creation flags
+        &threadId);                  // returns the thread identifier
+
        DarwiniaReleaseAssert(threadHandle, "Couldn't create gesture recording thread");
-       SetThreadPriority(threadHandle, THREAD_PRIORITY_TIME_CRITICAL); 
+       SetThreadPriority(threadHandle, THREAD_PRIORITY_TIME_CRITICAL);
 }
\ No newline at end of file
index db071cce3fee0f73f197a41b53ac05ccf7357802..4733f09cfb5d8c1eba9224c1c7e93ca0fe03c4db 100644 (file)
@@ -68,7 +68,7 @@ unsigned short GlobalInternet::GenerateInternet( Vector3 const &_pos, unsigned c
 
     GlobalInternetNode *node = &m_nodes[m_numNodes];
     node->m_pos = _pos;
-    node->m_size = _size;    
+    node->m_size = _size;
     unsigned short nodeIndex = m_numNodes;
        m_numNodes++;
        DarwiniaDebugAssert(m_numNodes < GLOBALINTERNET_MAXNODES);
@@ -82,7 +82,7 @@ unsigned short GlobalInternet::GenerateInternet( Vector3 const &_pos, unsigned c
 
     unsigned char numLinks = _size;
     float distance = powf( _size, 4.0f ) * 2.0f;
-    
+
     while( numLinks > 0 )
     {
         float z = sfrand(distance);
@@ -103,7 +103,7 @@ unsigned short GlobalInternet::GenerateInternet( Vector3 const &_pos, unsigned c
         --numLinks;
     }
 
-    return nodeIndex;    
+    return nodeIndex;
 }
 
 
@@ -118,19 +118,19 @@ void GlobalInternet::GenerateInternet()
     //Vector3 centre(449,1787,-139);
     Vector3 centre(-797,1949,-1135);
     unsigned short firstNode = GenerateInternet( centre, GLOBALINTERNET_ITERATIONS );
-    
+
     m_nodes[m_numNodes].m_pos.Zero();
     m_nodes[m_numNodes].m_size = 0.0f;
     unsigned short nodeIndex = m_numNodes;
        m_numNodes++;
        DarwiniaDebugAssert(m_numNodes <= GLOBALINTERNET_MAXNODES);
-    
+
     m_links[m_numLinks].m_from = m_nearestNodeToCentre;
     m_links[m_numLinks].m_to = nodeIndex;
     m_links[m_numLinks].m_size = 1.0f;
     m_numLinks++;
        DarwiniaDebugAssert(m_numLinks <= GLOBALINTERNET_MAXLINKS);
-    
+
     for( int i = 0; i < m_numNodes; ++i )
     {
         GlobalInternetNode *node = &m_nodes[i];
@@ -200,14 +200,14 @@ void GlobalInternet::Render()
 //    {
 //        fogVal -= 100000;
 //    }
-    
+
     glFogf      ( GL_FOG_DENSITY, 1.0f );
     glFogf      ( GL_FOG_START, 0.0f );
     glFogf      ( GL_FOG_END, (float) fogVal );
     glFogfv     ( GL_FOG_COLOR, fogCol );
     glFogi      ( GL_FOG_MODE, GL_LINEAR );
     glEnable    ( GL_FOG );
-    
+
     glEnable        ( GL_BLEND );
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE );
     glDepthMask     ( false );
@@ -225,7 +225,7 @@ void GlobalInternet::Render()
     else
     {
         linksId = g_app->m_resource->CreateDisplayList(DISPLAY_LIST_NAME_LINKS);
-        glNewList(linksId, GL_COMPILE);       
+        glNewList(linksId, GL_COMPILE);
 
         glColor4f       ( 0.25f, 0.25f, 0.5f, 0.8f );
 
@@ -245,13 +245,13 @@ void GlobalInternet::Render()
             Vector3 midPoint        = (toPos + fromPos)/2.0f;
             Vector3 camToMidPoint   = g_zeroVector - midPoint;
             Vector3 rightAngle      = (camToMidPoint ^ ( midPoint - toPos )).Normalise();
-        
+
             rightAngle *= link->m_size * 0.5f;
-        
+
             glTexCoord2i( 0, 0 );       glVertex3fv( (fromPos - rightAngle).GetData() );
             glTexCoord2i( 0, 1 );       glVertex3fv( (fromPos + rightAngle).GetData() );
-            glTexCoord2i( 1, 1 );       glVertex3fv( (toPos + rightAngle).GetData() );                
-            glTexCoord2i( 1, 0 );       glVertex3fv( (toPos - rightAngle).GetData() );                
+            glTexCoord2i( 1, 1 );       glVertex3fv( (toPos + rightAngle).GetData() );
+            glTexCoord2i( 1, 0 );       glVertex3fv( (toPos - rightAngle).GetData() );
         }
         glEnd();
 
@@ -278,7 +278,7 @@ void GlobalInternet::Render()
         for( int i = 0; i < m_numNodes; ++i )
         {
             GlobalInternetNode *node = &m_nodes[i];
-       
+
             Vector3 camToMidPoint   = (g_zeroVector - node->m_pos).Normalise();
             Vector3 right           = camToMidPoint ^ Vector3(0,0,1);
             Vector3 up              = right ^ camToMidPoint;
@@ -299,12 +299,12 @@ void GlobalInternet::Render()
     glEnable        ( GL_CULL_FACE );
     glDepthMask     ( true );
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-    glDisable       ( GL_BLEND );    
-    
-        
-   
+    glDisable       ( GL_BLEND );
+
+
+
     RenderPackets();
-    
+
     g_app->m_globalWorld->SetupFog();
     glDisable( GL_FOG );
 
@@ -350,7 +350,7 @@ void GlobalInternet::RenderPackets()
 
     if( frand(100.0f) < 11.0f )
     {
-        int leafIndex = frand( m_leafs.Size() );    
+        int leafIndex = frand( m_leafs.Size() );
         GlobalInternetNode *node = &m_nodes[m_leafs[leafIndex]];
         node->m_burst = 4.0f;
         m_bursts.PutData( m_leafs[leafIndex] );
@@ -392,7 +392,7 @@ void GlobalInternet::RenderPackets()
     glEnable        ( GL_TEXTURE_2D );
     glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "textures/starburst.bmp" ) );
     glDepthMask     ( false );
-    
+
     for( int i = 0; i < m_numLinks; ++i )
     {
         GlobalInternetLink *link = &m_links[i];
@@ -419,10 +419,10 @@ void GlobalInternet::RenderPackets()
                     *thisPacket = -0.01f;
                     TriggerPacket( link->m_from, i );
                     link->m_packets.RemoveData(j);
-                    --j;                        
+                    --j;
                 }
-            }                
-        
+            }
+
             GlobalInternetNode *from = &m_nodes[ link->m_from ];
             GlobalInternetNode *to = &m_nodes[ link->m_to ];
             Vector3 packetPos;
@@ -434,20 +434,20 @@ void GlobalInternet::RenderPackets()
             {
                 packetPos = from->m_pos + ( to->m_pos - from->m_pos ) * -packetVal;
             }
-                        
+
             glBegin( GL_QUADS );
                 glTexCoord2i( 0, 0 );       glVertex3fv( (packetPos - camUp - camRight).GetData() );
                 glTexCoord2i( 1, 0 );       glVertex3fv( (packetPos - camUp + camRight).GetData() );
                 glTexCoord2i( 1, 1 );       glVertex3fv( (packetPos + camUp + camRight).GetData() );
                 glTexCoord2i( 0, 1 );       glVertex3fv( (packetPos + camUp - camRight).GetData() );
-            glEnd();                
+            glEnd();
         }
     }
 
     glDepthMask ( true );
     glDisable   ( GL_TEXTURE_2D );
     glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-    glDisable   ( GL_BLEND );    
+    glDisable   ( GL_BLEND );
     glEnable    ( GL_CULL_FACE );
 
     glTexParameteri        (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
index e9fd2fb215229d1b9eda9620e02fce274e071fd0..377946a293c91e042b2f4e45bcad04bd9ba4ba2e 100644 (file)
@@ -27,7 +27,7 @@ public:
     Vector3                    m_pos;
     unsigned char      m_size;
     float                      m_burst;
-    
+
        unsigned short  m_links[GLOBALINTERNET_ITERATIONS];
        unsigned short  m_numLinks;
 };
@@ -60,10 +60,10 @@ protected:
        unsigned short          m_numLinks;
     LList       <int>       m_leafs;
     LList       <int>       m_bursts;
-    
+
     int                     m_nearestNodeToCentre;
     float                   m_nearestDistance;
-    
+
     void            GenerateInternet();
     unsigned short  GenerateInternet( Vector3 const &_pos, unsigned char _size );
     void            DeleteInternet();
index 075bfd64ca3e343e52b451fd0c420ba9b84d6d10..40b371ad50c39725d717fc8eafe58e375464e2cd 100644 (file)
@@ -71,7 +71,7 @@ void GlobalLocation::AddSpirits( int _count )
     m_numSpirits += _count;
 }
 
+
 
 // ****************************************************************************
 // Class GlobalBuilding
@@ -134,7 +134,7 @@ void GlobalEventCondition::SetCutScene ( char *_cutScene )
 
 char *GlobalEventCondition::GetTypeName( int _type )
 {
-    static char *names[] = {  
+    static char *names[] = {
                                 "AlwaysTrue",
                                 "BuildingOnline",
                                 "BuildingOffline",
@@ -170,23 +170,23 @@ bool GlobalEventCondition::Evaluate()
     {
         case AlwaysTrue:
             return true;
-        
+
         case BuildingOnline:
         {
             GlobalBuilding *building = g_app->m_globalWorld->GetBuilding( m_id, m_locationId );
             if( building ) return building->m_online;
             break;
         }
-        
+
         case BuildingOffline:
         {
             GlobalBuilding *building = g_app->m_globalWorld->GetBuilding( m_id, m_locationId );
             if( building ) return !building->m_online;
             break;
         }
-     
+
         case ResearchOwned:
-            return( g_app->m_globalWorld->m_research->HasResearch( m_id ) );            
+            return( g_app->m_globalWorld->m_research->HasResearch( m_id ) );
 
         case NotInLocation:
             return( g_app->m_location == NULL );
@@ -242,16 +242,16 @@ char *GlobalEventAction::GetTypeName(int _type)
     static char *names[] = {
                                 "SetMission",
                                 "RunScript",
-                                "MakeAvailable" 
+                                "MakeAvailable"
                             };
-    
+
     DarwiniaDebugAssert( _type >= 0 && _type < NumActionTypes );
 
     return names[_type];
 }
 
 
-GlobalEventAction::GlobalEventAction()    
+GlobalEventAction::GlobalEventAction()
 {
     strcpy( m_filename, "null" );
 }
@@ -297,7 +297,7 @@ void GlobalEventAction::Write(FileWriter *_out)
         case SetMission:        _out->printf( "%s %s", locationName, m_filename);       break;
         case RunScript:         _out->printf( "%s", m_filename );                       break;
         case MakeAvailable:     _out->printf( "%s", locationName);                      break;
-    
+
         default:
             DarwiniaDebugAssert(false);
     }
@@ -315,7 +315,7 @@ void GlobalEventAction::Execute()
         {
             if (g_app->m_testHarness)
                        {
-                               fprintf(g_app->m_testHarness->m_out, "%sSetting Mission: %s in location %s\n", 
+                               fprintf(g_app->m_testHarness->m_out, "%sSetting Mission: %s in location %s\n",
                                                g_app->m_testHarness->m_indent,
                                                m_filename,
                                                g_app->m_globalWorld->GetLocationName(m_locationId));
@@ -325,7 +325,7 @@ void GlobalEventAction::Execute()
         case RunScript:
                        if (g_app->m_testHarness)
                        {
-                               fprintf(g_app->m_testHarness->m_out, "%sRunning script: %s\n", 
+                               fprintf(g_app->m_testHarness->m_out, "%sRunning script: %s\n",
                                                g_app->m_testHarness->m_indent,
                                                m_filename);
                        }
@@ -333,7 +333,7 @@ void GlobalEventAction::Execute()
         case MakeAvailable:
                        if (g_app->m_testHarness)
                        {
-                               fprintf(g_app->m_testHarness->m_out, "%sMaking location available: %s\n", 
+                               fprintf(g_app->m_testHarness->m_out, "%sMaking location available: %s\n",
                                                g_app->m_testHarness->m_indent,
                                                g_app->m_globalWorld->GetLocationName(m_locationId));
                        }
@@ -422,10 +422,10 @@ bool GlobalEvent::Execute()
     GlobalEventAction *action = m_actions[0];
     m_actions.RemoveData(0);
     action->Execute();
-    delete action;    
+    delete action;
 
     if( m_actions.Size() == 0 ) return true;
-       
+
     return false;
 }
 
@@ -439,7 +439,7 @@ void GlobalEvent::MakeAlwaysTrue()
     }
 
     m_conditions.EmptyAndDelete();
-    
+
     GlobalEventCondition *cond = new GlobalEventCondition();
     cond->m_type = GlobalEventCondition::AlwaysTrue;
     m_conditions.PutData( cond );
@@ -450,7 +450,7 @@ void GlobalEvent::Read( TextReader *_in )
 {
     //
     // Parse conditions line
-    
+
     while( _in->TokenAvailable() )
     {
                char *conditionTypeName = _in->GetNextToken();
@@ -464,7 +464,7 @@ void GlobalEvent::Read( TextReader *_in )
             case GlobalEventCondition::AlwaysTrue:
             case GlobalEventCondition::NotInLocation:
                 break;
-            
+
                        case GlobalEventCondition::BuildingOffline:
                        case GlobalEventCondition::BuildingOnline:
                                condition->m_locationId = g_app->m_globalWorld->GetLocationId( _in->GetNextToken() );
@@ -476,7 +476,7 @@ void GlobalEvent::Read( TextReader *_in )
                 condition->m_id = GlobalResearch::GetType( _in->GetNextToken() );
                 DarwiniaDebugAssert( condition->m_id != -1 );
                 break;
-                
+
             case GlobalEventCondition::DebugKey:
                 condition->m_id = atoi( _in->GetNextToken() );
                                break;
@@ -484,7 +484,7 @@ void GlobalEvent::Read( TextReader *_in )
 
         m_conditions.PutData( condition );
     }
-   
+
 
        //
        // Parse actions
@@ -548,12 +548,12 @@ GlobalResearch::GlobalResearch()
 void GlobalResearch::AddResearch( int _type )
 {
     DarwiniaDebugAssert( _type >= 0 && _type < NumResearchItems );
-    
+
     if( m_researchLevel[_type] < 1 )
     {
         m_researchProgress[_type] = RequiredProgress(0);
         EvaluateLevel( _type );
-    }    
+    }
 }
 
 
@@ -623,7 +623,7 @@ void GlobalResearch::EvaluateLevel( int _type )
 void GlobalResearch::SetCurrentResearch( int _type )
 {
     int currentLevel = m_researchLevel[_type];
-    
+
     if( currentLevel == 4 )
     {
         // Fully researched already
@@ -686,7 +686,7 @@ void GlobalResearch::IncreaseProgress  ( int _amount )
 
 
 void GlobalResearch::DecreaseProgress( int _amount )
-{   
+{
     m_researchProgress[m_currentResearch] -= _amount;
     EvaluateLevel( m_currentResearch );
 }
@@ -703,7 +703,7 @@ int GlobalResearch::CurrentLevel( int _type )
 void GlobalResearch::Write(FileWriter *_out)
 {
     _out->printf( "Research_StartDefinition\n" );
-        
+
     for( int i = 0; i < NumResearchItems; ++i )
     {
         _out->printf( "\tResearch %s %d %d\n", GetTypeName(i), CurrentProgress(i), CurrentLevel(i) );
@@ -756,7 +756,7 @@ void GlobalResearch::Read( TextReader *_in )
 
 char *GlobalResearch::GetTypeName( int _type )
 {
-    char *names[] = {   
+    char *names[] = {
                         "Darwinian",
                         "Officer",
                         "Squad",
@@ -790,7 +790,7 @@ char *GlobalResearch::GetTypeNameTranslated ( int _type )
     {
         return typeName;
     }
-} 
+}
 
 
 int GlobalResearch::GetType( char *_name )
@@ -849,18 +849,18 @@ SphereWorld::SphereWorld()
 
 void SphereWorld::AddLocation( int _locationId )
 {
-       // Initialise the sphere world to 
+       // Initialise the sphere world to
        if (_locationId < m_numLocations)
                return;
 
        int oldNumLocations = m_numLocations;
        m_numLocations = _locationId + 1;
        LList<float> *newSpirits = new LList<float>[m_numLocations];
-    
+
        // Initialise the spirits for the new worlds.
     for( int locationId = 0; locationId < m_numLocations; ++locationId )
     {
-               if (locationId < oldNumLocations) 
+               if (locationId < oldNumLocations)
                {
                        // Copy across the old spirits
                        newSpirits[locationId] = m_spirits[locationId];
@@ -897,16 +897,16 @@ void SphereWorld::AddLocation( int _locationId )
 
 void SphereWorld::Render()
 {
-       // For some reason this fixes a slight glitch in the first few frames of the 
+       // For some reason this fixes a slight glitch in the first few frames of the
        // start sequence on my machine. God knows why, but it won't cause any harm.
        static int frameCount = 0;
-       if (frameCount < 10) 
+       if (frameCount < 10)
        {
                frameCount++;
                return;
        }
 
-    RenderWorldShape();    
+    RenderWorldShape();
     RenderIslands();
     RenderTrunkLinks();
 
@@ -929,7 +929,7 @@ void SphereWorld::RenderSpirits()
     // Advance all spirits
 
     for( int locationId = 0; locationId < m_numLocations; ++locationId )
-    {        
+    {
         GlobalLocation *location = g_app->m_globalWorld->GetLocation(locationId);
         if( location )
         {
@@ -941,12 +941,12 @@ void SphereWorld::RenderSpirits()
             }
             else if( !isReceiver && frand(300) < 1.0f )
             {
-                m_spirits[locationId].PutDataAtStart( 1.0f );        
+                m_spirits[locationId].PutDataAtStart( 1.0f );
             }
-    
+
             if( location->m_numSpirits > 0 && frand(20) < 1.0f)
             {
-                m_spirits[locationId].PutDataAtStart( 1.0f );        
+                m_spirits[locationId].PutDataAtStart( 1.0f );
                 location->m_numSpirits--;
             }
 
@@ -954,13 +954,13 @@ void SphereWorld::RenderSpirits()
             {
                 float *thisSpirit = m_spirits[locationId].GetPointer(i);
 
-                if( isReceiver )        *thisSpirit += g_advanceTime * 0.02f;            
+                if( isReceiver )        *thisSpirit += g_advanceTime * 0.02f;
                 else                    *thisSpirit -= g_advanceTime * 0.02f;
-            
+
                 if( *thisSpirit >= 1.0f || *thisSpirit <= 0.0f )
                 {
                     m_spirits[locationId].RemoveData(i);
-                    --i;                
+                    --i;
                 }
             }
         }
@@ -991,7 +991,7 @@ void SphereWorld::RenderSpirits()
             {
                 float *thisSpirit = m_spirits[locationId].GetPointer(i);
 
-                Vector3 fromPos = g_app->m_globalWorld->GetLocationPosition(locationId);        
+                Vector3 fromPos = g_app->m_globalWorld->GetLocationPosition(locationId);
 
                 float alphaValue = *thisSpirit * 3.0f;
                 if( alphaValue > 1.0f ) alphaValue = 1.0f;
@@ -1005,7 +1005,7 @@ void SphereWorld::RenderSpirits()
                 position.z += sinf(*thisSpirit * 16 + timeOffset) * posOffset;
 
                 float scale = 0.4f;
-        
+
                 glColor4f( 0.6f, 0.2f, 0.1f, alphaValue);
                 glBegin( GL_QUADS );
                     glTexCoord2f(0.5f, 0.5f);      glVertex3fv( (position + camUp * 300 * scale).GetData() );
@@ -1013,7 +1013,7 @@ void SphereWorld::RenderSpirits()
                     glTexCoord2f(0.5f, 0.5f);      glVertex3fv( (position - camUp * 300 * scale).GetData() );
                     glTexCoord2f(0.5f, 0.5f);      glVertex3fv( (position - camRight * 300 * scale).GetData() );
                 glEnd();
-    
+
                 glColor4f( 0.6f, 0.2f, 0.1f, alphaValue);
                 glBegin( GL_QUADS );
                     glTexCoord2f(0.5f, 0.5f);      glVertex3fv( (position + camUp * 100 * scale).GetData() );
@@ -1050,10 +1050,10 @@ void SphereWorld::RenderSpirits()
 
 void SphereWorld::RenderWorldShape()
 {
-    START_PROFILE(g_app->m_profiler, "Shape");   
+    START_PROFILE(g_app->m_profiler, "Shape");
 
        g_app->m_globalWorld->SetupLights();
-       
+
     glEnable        (GL_LIGHTING);
     glEnable        (GL_LIGHT0);
 
@@ -1064,7 +1064,7 @@ void SphereWorld::RenderWorldShape()
        GLfloat materialSpecular[] = { spec, spec, spec, 1.0f };
        GLfloat materialDiffuse[] = { diffuse, diffuse, diffuse, 1.0f };
        GLfloat ambCol[] = { amb, amb, amb, 1.0f };
-   
+
        glMaterialfv(GL_FRONT, GL_SPECULAR, materialSpecular);
        glMaterialfv(GL_FRONT, GL_DIFFUSE, materialDiffuse);
        glMaterialfv(GL_FRONT, GL_SHININESS, materialShininess);
@@ -1078,15 +1078,15 @@ void SphereWorld::RenderWorldShape()
     glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
 
     glDisable( GL_CULL_FACE );
-    
+
     //
     // Render outer
 
     m_shapeOuter->Render(0.0f, g_identityMatrix34);
     m_shapeMiddle->Render(0.0f, g_identityMatrix34);
     m_shapeInner->Render(0.0f, g_identityMatrix34);
-    
-    
+
+
     glDisable       (GL_NORMALIZE);
     glPopMatrix     ();
 
@@ -1095,7 +1095,7 @@ void SphereWorld::RenderWorldShape()
     glDisable       (GL_LIGHTING);
     glDisable       (GL_LIGHT0);
     glDisable       (GL_LIGHT1);
-        
+
     END_PROFILE(g_app->m_profiler, "Shape");
 }
 
@@ -1106,13 +1106,13 @@ void SphereWorld::RenderTrunkLinks()
     //if( g_app->m_editing ) return;
 
     Matrix34    rootMat(0);
-    
+
     glEnable    ( GL_BLEND );
     glBlendFunc ( GL_SRC_ALPHA, GL_ONE );
     glDepthMask ( false );
 
     glBegin     ( GL_QUADS );
-    
+
     for( int i = 0; i < g_app->m_globalWorld->m_buildings.Size(); ++i )
     {
         GlobalBuilding *building = g_app->m_globalWorld->m_buildings[i];
@@ -1126,25 +1126,25 @@ void SphereWorld::RenderTrunkLinks()
                 (fromLoc->m_available && toLoc->m_available) ||
                 g_app->m_editing )
             {
-                Vector3 fromPos = g_app->m_globalWorld->GetLocationPosition(building->m_locationId);        
-                Vector3 toPos = g_app->m_globalWorld->GetLocationPosition(building->m_link);        
+                Vector3 fromPos = g_app->m_globalWorld->GetLocationPosition(building->m_locationId);
+                Vector3 toPos = g_app->m_globalWorld->GetLocationPosition(building->m_link);
 
                 if( building->m_online )    glColor4f( 0.4f, 0.3f, 1.0f, 1.0f );
-                else                        glColor4f( 0.4f, 0.3f, 1.0f, 0.4f );                
-                            
+                else                        glColor4f( 0.4f, 0.3f, 1.0f, 0.4f );
+
                 //fromPos *= 120.0f;
                 //toPos *= 120.0f;
-            
+
                 Vector3 midPoint        = fromPos + (toPos - fromPos)/2.0f;
                 Vector3 camToMidPoint   = g_app->m_camera->GetPos() - midPoint;
                 Vector3 rightAngle      = (camToMidPoint ^ ( midPoint - toPos )).Normalise();
-            
+
                 rightAngle *= 200.0f;
-            
+
                 glVertex3fv( (fromPos - rightAngle).GetData() );
                 glVertex3fv( (fromPos + rightAngle).GetData() );
-                glVertex3fv( (toPos + rightAngle).GetData() );                
-                glVertex3fv( (toPos - rightAngle).GetData() );                     
+                glVertex3fv( (toPos + rightAngle).GetData() );
+                glVertex3fv( (toPos - rightAngle).GetData() );
             }
         }
     }
@@ -1177,17 +1177,17 @@ void SphereWorld::RenderHeaven()
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE );
     glEnable        ( GL_TEXTURE_2D );
     glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "textures/glow.bmp" ) );
-    
+
     for( int i = 0; i < 50; ++i )
     {
-        Vector3 pos( sinf(i/g_gameTime+i) * 20, 
-                     sinf(g_gameTime+i) * i, 
+        Vector3 pos( sinf(i/g_gameTime+i) * 20,
+                     sinf(g_gameTime+i) * i,
                      cosf(i/g_gameTime+i) * 20 );
-        
+
         float size = i;
 
         glColor4f( 0.6f, 0.2f, 0.1f, 0.9f);
-        
+
         glBegin( GL_QUADS );
             glTexCoord2i(0,0);      glVertex3fv( (pos - camRight * size + camUp * size).GetData() );
             glTexCoord2i(1,0);      glVertex3fv( (pos + camRight * size + camUp * size).GetData() );
@@ -1195,18 +1195,18 @@ void SphereWorld::RenderHeaven()
             glTexCoord2i(0,1);      glVertex3fv( (pos - camRight * size - camUp * size).GetData() );
         glEnd();
     }
-    
-       
+
+
     glPopMatrix     ();
+
     //
-    // Render god rays going down 
+    // Render god rays going down
 
 /*
     glBindTexture   ( GL_TEXTURE_2D, g_app->m_resource->GetTexture( "textures/godray.bmp" ) );
-    
+
        for (int i = 0; i < g_app->m_globalWorld->m_locations.Size(); ++i)
-       {        
+       {
                GlobalLocation *loc = g_app->m_globalWorld->m_locations.GetData(i);
         Vector3 islandPos = g_app->m_globalWorld->GetLocationPosition(loc->m_id );
         Vector3 centrePos = g_zeroVector;
@@ -1224,7 +1224,7 @@ void SphereWorld::RenderHeaven()
             lineToCentre.Normalise();
 
             glColor4f( 0.6f, 0.2f, 0.1f, 0.8f);
-            
+
             glBegin( GL_QUADS );
                 glTexCoord2f(0.75f,0);      glVertex3fv( (centrePos - lineToCentre * 1000).GetData() );
                 glTexCoord2f(0.75f,1);      glVertex3fv( (centrePos + lineToCentre * 1000).GetData() );
@@ -1241,7 +1241,7 @@ void SphereWorld::RenderHeaven()
     glBlendFunc     ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
     glDisable       ( GL_BLEND );
     glDepthMask     ( true );
-    
+
     END_PROFILE( g_app->m_profiler, "Heaven" );
 }
 
@@ -1287,14 +1287,14 @@ void SphereWorld::RenderIslands()
             if( !loc->m_missionCompleted &&
                 stricmp( loc->m_missionFilename, "null" ) != 0 &&
                 fmodf( g_gameTime, 1.0f ) < 0.7f ) numRedraws = 10;
-            
+
             glBegin( GL_QUADS );
             for( int j = 0; j <= numRedraws; ++j )
             {
                 glTexCoord2i(0,0);      glVertex3fv( (islandPos + camUp * 1000 * j).GetData() );
                 glTexCoord2i(1,0);      glVertex3fv( (islandPos + camRight * 1000 * j).GetData() );
                 glTexCoord2i(1,1);      glVertex3fv( (islandPos - camUp * 1000 * j).GetData() );
-                glTexCoord2i(0,1);      glVertex3fv( (islandPos - camRight * 1000 * j).GetData() );            
+                glTexCoord2i(0,1);      glVertex3fv( (islandPos - camRight * 1000 * j).GetData() );
             }
             glEnd();
         }
@@ -1305,13 +1305,13 @@ void SphereWorld::RenderIslands()
     glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
     glDepthMask ( true );
     glEnable    ( GL_DEPTH_TEST );
-    
+
 
        //
     // Render the islands names
 
     glColor4f(1.0f,1.0f,1.0f,1.0f);
-    
+
        for (int i = 0; i < g_app->m_globalWorld->m_locations.Size(); ++i)
        {
                GlobalLocation *loc = g_app->m_globalWorld->m_locations.GetData(i);
@@ -1320,7 +1320,7 @@ void SphereWorld::RenderIslands()
                    Vector3 islandPos = g_app->m_globalWorld->GetLocationPosition(loc->m_id );
             char *islandName = strdup( g_app->m_globalWorld->GetLocationNameTranslated( loc->m_id ) );
             strupr(islandName);
-        
+
             float size = 5.0f * sqrtf(( g_app->m_camera->GetPos() - islandPos ).Mag());
             size = 1000.0f;
 
@@ -1336,13 +1336,13 @@ void SphereWorld::RenderIslands()
 
             islandPos += camUp * size * 0.3f;
             islandPos += camRight * size * 0.1f;
-            
+
             g_gameFont.SetRenderShadow( false );
             glColor4f(1.0f,1.0f,1.0f,1.0f);
             if( stricmp(loc->m_missionFilename, "null" ) == 0 ) glColor4f(0.5f,0.5f,0.5f,1.0f);
-            
+
             g_gameFont.DrawText3DCentre(islandPos + camUp * size*1.5f, size*3.0f, islandName );
-            
+
             if( g_app->m_editing )
             {
                 g_gameFont.DrawText3DCentre(islandPos, size, loc->m_mapFilename );
@@ -1385,7 +1385,7 @@ GlobalWorld::GlobalWorld(GlobalWorld &_other)
        m_locationRequested(-1)
 {
     m_research = new GlobalResearch();
-    
+
     for (int i = 0; i < _other.m_locations.Size(); ++i)
        {
                GlobalLocation *newLoc = new GlobalLocation(*(_other.m_locations[i]));
@@ -1444,7 +1444,7 @@ void GlobalWorld::Advance()
             {
                            Vector3 rayStart, rayDir;
                            g_app->m_camera->GetClickRay( g_target->X(), g_target->Y(), &rayStart, &rayDir );
-                           m_editorSelectionId = LocationHit(rayStart, rayDir);                
+                           m_editorSelectionId = LocationHit(rayStart, rayDir);
             }
             else if( g_inputManager->controlEvent( ControlLocationDragActive ) )
             {
@@ -1452,7 +1452,7 @@ void GlobalWorld::Advance()
                 if( loc )
                 {
                        Vector3 mousePos3D = g_app->m_userInput->GetMousePos3d();
-                    loc->m_pos = mousePos3D / 120.0f;    
+                    loc->m_pos = mousePos3D / 120.0f;
                 }
             }
             else if( g_inputManager->controlEvent( ControlDeselectLocation ) )
@@ -1462,13 +1462,13 @@ void GlobalWorld::Advance()
         }
        }
        else
-       {   
+       {
                bool chatLog = g_app->m_sepulveda->ChatLogVisible();
 
                // Has the user clicked on a location?
                if ( g_inputManager->controlEvent( ControlSelectLocation ) &&
                     m_locationRequested == -1 &&
-                    EclGetWindows()->Size() == 0 
+                    EclGetWindows()->Size() == 0
                         && !chatLog )
                {
                        Vector3 rayStart, rayDir;
@@ -1482,17 +1482,17 @@ void GlobalWorld::Advance()
                                {
                                        if (!g_app->m_script->IsRunningScript()) {
                                                if ( !g_app->HasBoughtGame() ) {
-                                                       // We're not registered, we should run a script to end 
+                                                       // We're not registered, we should run a script to end
                                                        if (!(strcmp(loc->m_mapFilename, "map_garden.txt") == 0 ||
                                                                  strcmp(loc->m_mapFilename, "map_containment.txt") == 0)) {
-                                                                                                                               
+
                                                                // Buy me URL
                                                                EclRegisterWindow( new BuyNowWindow );
-                                                               
+
                                                                // Bar Location
                                                                return;
                                                        }
-                                               } 
+                                               }
                                        }
 
                                        // Default behaviour is to go the location
@@ -1539,7 +1539,7 @@ void GlobalWorld::Advance()
 void GlobalWorld::Render()
 {
     START_PROFILE(g_app->m_profiler, "Render Global World");
-    
+
        if( !g_app->m_editing ) m_globalInternet->Render();
        CHECK_OPENGL_STATE();
     m_sphereWorld->Render();
@@ -1558,8 +1558,8 @@ int       GlobalWorld::LocationHit(Vector3 const &_pos, Vector3 const &_dir, float loc
     for( int i = 0; i < m_locations.Size(); ++i )
     {
         GlobalLocation *gl = m_locations[i];
-        Vector3 locPos = GetLocationPosition( gl->m_id );               
-        
+        Vector3 locPos = GetLocationPosition( gl->m_id );
+
                bool hit = RaySphereIntersection(_pos, _dir, locPos, locationRadius);
                if (hit)
                {
@@ -1594,7 +1594,7 @@ GlobalLocation *GlobalWorld::GetHighlightedLocation()
     Vector3 rayStart, rayDir;
        g_app->m_camera->GetClickRay(screenX, screenY, &rayStart, &rayDir);
        int locId = g_app->m_globalWorld->LocationHit(rayStart, rayDir);
-    
+
     GlobalLocation *loc = GetLocation( locId );
 
     if( loc && loc->m_available ) return loc;
@@ -1627,7 +1627,7 @@ int GlobalWorld::GetLocationId( char const *_name )
         }
     }
 
-    return -1;    
+    return -1;
 }
 
 
@@ -1680,7 +1680,7 @@ Vector3 GlobalWorld::GetLocationPosition(int _id)
 GlobalBuilding *GlobalWorld::GetBuilding( int _id, int _locationId )
 {
     if( _id == -1 || _locationId == -1 ) return NULL;
-    
+
     for( int i = 0; i < m_buildings.Size(); ++i )
     {
         GlobalBuilding *buil = m_buildings[i];
@@ -1689,7 +1689,7 @@ GlobalBuilding *GlobalWorld::GetBuilding( int _id, int _locationId )
             return buil;
         }
     }
-    
+
     return NULL;
 }
 
@@ -1722,7 +1722,7 @@ void GlobalWorld::AddBuilding( GlobalBuilding *building )
     {
         m_nextBuildingId = building->m_id + 1;
     }
-    
+
     m_buildings.PutData( building );
 }
 
@@ -1731,7 +1731,7 @@ void GlobalWorld::WriteLocations( FileWriter *_out )
 {
     _out->printf( "Locations_StartDefinition\n" );
     _out->printf( "\t# Id  Avail                   mapFile                    missionFile\n" );
-    _out->printf( "\t# ==================================================================\n" );                    
+    _out->printf( "\t# ==================================================================\n" );
 
     for( int i = 0; i < m_locations.Size(); ++i )
     {
@@ -1739,7 +1739,7 @@ void GlobalWorld::WriteLocations( FileWriter *_out )
         _out->printf( "\t%4d %4d %30s %40s\n",
                          location->m_id, int(location->m_available), location->m_mapFilename, location->m_missionFilename );
     }
-    
+
     _out->printf( "Locations_EndDefinition\n\n" );
 }
 
@@ -1789,13 +1789,13 @@ void GlobalWorld::ParseLocations( TextReader *_in )
                }
 
         GlobalLocation *location = new GlobalLocation();
-        
+
                location->m_id          = atoi(word);
         location->m_available   = bool( atoi(_in->GetNextToken() ) );
 
         strcpy( location->m_mapFilename, _in->GetNextToken());
-        strcpy( location->m_missionFilename, _in->GetNextToken());        
-        
+        strcpy( location->m_missionFilename, _in->GetNextToken());
+
         strcpy( location->m_name, (location->m_mapFilename+4) );
         location->m_name[ strlen(location->m_name)-4 ] = '\x0';
 
@@ -1818,7 +1818,7 @@ void GlobalWorld::ParseBuildings( TextReader *_in )
                }
 
         GlobalBuilding *building = new GlobalBuilding();
-        
+
         building->m_id          = atoi(word);
         building->m_teamId      = atoi(_in->GetNextToken());
         building->m_locationId  = atoi(_in->GetNextToken());
@@ -1862,7 +1862,7 @@ void GlobalWorld::AddLevelBuildingToGlobalBuildings(Building *_building, int _lo
                        gb = new GlobalBuilding();
                        gb->m_type = _building->m_type;
                        gb->m_locationId = _locId;
-                       gb->m_id = _building->m_id.GetUniqueId(); 
+                       gb->m_id = _building->m_id.GetUniqueId();
             gb->m_teamId = _building->m_id.GetTeamId();
                        m_buildings.PutData(gb);
 
@@ -1872,22 +1872,22 @@ void GlobalWorld::AddLevelBuildingToGlobalBuildings(Building *_building, int _lo
                        }
                }
                gb->m_pos = _building->m_pos;
-       }            
+       }
 }
 
 void GlobalWorld::LoadGame( char *_filename )
 {
     TextReader *in = NULL;
     char fullFilename[256];
-    
+
     if( !g_app->m_editing )
-    {   
+    {
         sprintf( fullFilename, "%susers/%s/%s", g_app->GetProfileDirectory(), g_app->m_userProfileName, _filename );
-        if( DoesFileExist( fullFilename ) ) in = new TextFileReader( fullFilename ); 
+        if( DoesFileExist( fullFilename ) ) in = new TextFileReader( fullFilename );
     }
 
     if( !in )
-    {        
+    {
         in = g_app->m_resource->GetTextReader(_filename);
     }
 
@@ -1928,7 +1928,7 @@ void GlobalWorld::LoadGame( char *_filename )
     // Load locations
 
     LoadLocations( "locations.txt" );
-    
+
 
     //
     // Load all map files into memory
@@ -1947,15 +1947,15 @@ void GlobalWorld::LoadGame( char *_filename )
                        Building *building = levFile.m_buildings[b];
                        AddLevelBuildingToGlobalBuildings(building, loc->m_id);