Revision: 2737
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2737&view=rev
Author: rorthomas
Date: 2012-05-28 15:57:40 +0000 (Mon, 28 May 2012)
Log Message:
-----------
fixed uninitialized pointer problem, thats the reason one should always init
pointers with 0 x|
Modified Paths:
--------------
trunk/source/main/gameplay/RoRFrameListener.cpp
trunk/source/main/gameplay/RoRFrameListener.h
trunk/source/main/terrain/TerrainManager.cpp
trunk/source/main/utils/Utils.cpp
Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-28 15:43:25 UTC
(rev 2736)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-28 15:57:40 UTC
(rev 2737)
@@ -724,8 +724,7 @@
surveyMap(0),
surveyMapMode(SURVEY_MAP_NONE),
terrainUID(""),
- truck_preload_num(0),
- terrainManager(0)
+ truck_preload_num(0)
{
// we don't use overlays in embedded mode
if (!gEnv->embeddedMode)
@@ -2809,7 +2808,7 @@
}
gEnv->terrainManager = new TerrainManager();
- terrainManager->loadTerrain(terrainfile);
+ gEnv->terrainManager->loadTerrain(terrainfile);
if (gEnv->player) gEnv->player->setVisible(true);
Modified: trunk/source/main/gameplay/RoRFrameListener.h
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.h 2012-05-28 15:43:25 UTC
(rev 2736)
+++ trunk/source/main/gameplay/RoRFrameListener.h 2012-05-28 15:57:40 UTC
(rev 2737)
@@ -147,8 +147,6 @@
char screenshotformat[256];
char terrainmap[1024];
- TerrainManager *terrainManager;
-
collision_box_t *reload_box;
double rtime;
Modified: trunk/source/main/terrain/TerrainManager.cpp
===================================================================
--- trunk/source/main/terrain/TerrainManager.cpp 2012-05-28 15:43:25 UTC
(rev 2736)
+++ trunk/source/main/terrain/TerrainManager.cpp 2012-05-28 15:57:40 UTC
(rev 2737)
@@ -44,7 +44,7 @@
using namespace Ogre;
TerrainManager::TerrainManager() :
- loading_state(NONE_LOADED)
+ loading_state(NONE_LOADED)
{
}
@@ -60,7 +60,8 @@
try
{
- ds =
ResourceGroupManager::getSingleton().openResource(filename,
ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
+ String group =
ResourceGroupManager::getSingleton().findGroupContainingResource(filename);
+ ds =
ResourceGroupManager::getSingleton().openResource(filename, group);
} catch(...)
{
LOG("Terrain not found: " + String(filename));
Modified: trunk/source/main/utils/Utils.cpp
===================================================================
--- trunk/source/main/utils/Utils.cpp 2012-05-28 15:43:25 UTC (rev 2736)
+++ trunk/source/main/utils/Utils.cpp 2012-05-28 15:57:40 UTC (rev 2737)
@@ -371,10 +371,6 @@
void generateHashFromDataStream(DataStream *ds, Ogre::String &hash)
{
- // TODO: fix memory corruption going on below
- hash = "nothashed";
- return;
-
size_t location = ds->tell();
// copy whole file into a buffer
uint8_t *buf = 0;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel