Revision: 1663
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1663&view=rev
Author: rorthomas
Date: 2011-02-07 00:51:26 +0000 (Mon, 07 Feb 2011)
Log Message:
-----------
improved screenshotfixed initialization of hash chars
improved screenshots
Modified Paths:
--------------
trunk/source/configurator/configurator.cpp
trunk/source/main/gameplay/RoRFrameListener.cpp
trunk/source/main/physics/collision/collisions.cpp
trunk/source/main/scripting/ScriptEngine.cpp
trunk/source/main/utils/Settings.cpp
Added Paths:
-----------
trunk/source/main/gfx/AdvancedScreen.h
Modified: trunk/source/configurator/configurator.cpp
===================================================================
--- trunk/source/configurator/configurator.cpp 2011-02-06 02:31:50 UTC (rev
1662)
+++ trunk/source/configurator/configurator.cpp 2011-02-07 00:51:26 UTC (rev
1663)
@@ -2607,7 +2607,7 @@
st = settings["Particles"]; if (st.length()>0)
particles->SetValue(st=="Yes");
st = settings["HeatHaze"]; if (st.length()>0)
heathaze->SetValue(st=="Yes");
st = settings["Hydrax"]; if (st.length()>0) hydrax->SetValue(st=="Yes");
- st = settings["Use RTShader System"]; if (st.length()>0)
rtshader->SetValue(st=="Yes");
+ //st = settings["Use RTShader System"]; if (st.length()>0)
rtshader->SetValue(st=="Yes");
st = settings["disableOverViewMap"]; if (st.length()>0)
dismap->SetValue(st=="Yes");
if(leds) { st = settings["Logitech LEDs"]; if (st.length()>0)
leds->SetValue(st=="Yes"); };
st = settings["External Camera Mode"]; if (st.length()>0)
extcam->SetValue(st=="Static");
Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp 2011-02-06 02:31:50 UTC
(rev 1662)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp 2011-02-07 00:51:26 UTC
(rev 1663)
@@ -50,6 +50,7 @@
#include "ShadowManager.h"
#include "TruckHUD.h"
#include "DotSceneLoader.h"
+#include "AdvancedScreen.h"
#ifdef USE_MPLATFORM
#include "mplatform_fd.h"
@@ -2425,17 +2426,54 @@
} else if (INPUTENGINE.getEventBoolValueBounce(EV_COMMON_SCREENSHOT,
0.5f))
{
int mNumScreenShots=0;
- String tmp = SETTINGS.getSetting("User Path") +
String("screenshot_") + StringConverter::toString(++mNumScreenShots) +
String(".") + String(screenshotformat);
- while(fileExists(tmp.c_str()))
- tmp = SETTINGS.getSetting("User Path") +
String("screenshot_") + StringConverter::toString(++mNumScreenShots) +
String(".") + String(screenshotformat);
+ String tmpfn = SETTINGS.getSetting("User Path") +
String("screenshot_") + StringConverter::toString(++mNumScreenShots) +
String(".") + String(screenshotformat);
+ while(fileExists(tmpfn.c_str()))
+ tmpfn = SETTINGS.getSetting("User Path") +
String("screenshot_") + StringConverter::toString(++mNumScreenShots) +
String(".") + String(screenshotformat);
- LogManager::getSingleton().logMessage("Wrote screenshot : " +
tmp);
- // hide any flash message
+ if(String(screenshotformat) == "png")
+ {
+ // add some more data into the image
+ AdvancedScreen *as = new AdvancedScreen(mWindow, tmpfn);
+ as->addData("terrain_Name", loadedTerrain);
+ as->addData("terrain_Hash",
SETTINGS.getSetting("TerrainHash"));
+ as->addData("Truck_Num",
StringConverter::toString(current_truck));
+ if(current_truck>=0 && trucks[current_truck])
+ {
+ as->addData("Truck_fname",
trucks[current_truck]->realtruckfilename);
+ as->addData("Truck_name",
trucks[current_truck]->getTruckName());
+ as->addData("Truck_beams",
StringConverter::toString(trucks[current_truck]->getBeamCount()));
+ as->addData("Truck_nodes",
StringConverter::toString(trucks[current_truck]->getNodeCount()));
+ }
+ as->addData("User_NickName",
SETTINGS.getSetting("Nickname"));
+ as->addData("User_Language",
SETTINGS.getSetting("Language"));
+ as->addData("RoR_VersionString",
String(ROR_VERSION_STRING));
+ as->addData("RoR_VersionSVN", String(SVN_REVISION));
+ as->addData("RoR_VersionSVNID", String(SVN_ID));
+ as->addData("RoR_ProtocolVersion",
String(RORNET_VERSION));
+ as->addData("RoR_BinaryHash",
SETTINGS.getSetting("BinaryHash"));
+ as->addData("MP_ServerName",
SETTINGS.getSetting("Server name"));
+ as->addData("MP_ServerPort",
SETTINGS.getSetting("Server port"));
+ as->addData("MP_NetworkEnabled",
SETTINGS.getSetting("Network enable"));
+ as->addData("Camera_Mode",
StringConverter::toString(cameramode));
+ as->addData("Camera_Position",
StringConverter::toString(mCamera->getPosition()));
+
+ const RenderTarget::FrameStats& stats =
mWindow->getStatistics();
+ as->addData("AVGFPS",
StringConverter::toString(stats.avgFPS));
+
+ as->write();
+ delete(as);
+ } else
+ {
+ mWindow->update();
+ mWindow->writeContentsToFile(tmpfn);
+ }
+ LogManager::getSingleton().logMessage("Wrote screenshot : " +
tmpfn);
+
+ // hide any old flash message
if(ow) ow->hideFlashMessage();
- mWindow->update();
- mWindow->writeContentsToFile(tmp);
+ // show new flash message
char tmp1[255];
String ssmsg = _L("wrote screenshot:");
sprintf(tmp1, "%s %d", ssmsg.c_str(), mNumScreenShots);
@@ -4696,6 +4734,7 @@
{
Cache_Entry ce = CACHE.getResourceInfo(terrainfile);
char hash_result[250];
+ memset(hash_result, 0, 249);
RoR::CSHA1 sha1;
String fn;
if(ce.type == "Zip")
@@ -8257,3 +8296,4 @@
RTSSgenerateShadersForMaterial(curMaterialName,
normalTextureName);
}
}
+
Added: trunk/source/main/gfx/AdvancedScreen.h
===================================================================
--- trunk/source/main/gfx/AdvancedScreen.h (rev 0)
+++ trunk/source/main/gfx/AdvancedScreen.h 2011-02-07 00:51:26 UTC (rev
1663)
@@ -0,0 +1,124 @@
+/*
+This source file is part of Rigs of Rods
+Copyright 2005-2011 Pierre-Michel Ricordel
+Copyright 2007-2011 Thomas Fischer
+
+For more information, see http://www.rigsofrods.com/
+
+Rigs of Rods is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3, as
+published by the Free Software Foundation.
+
+Rigs of Rods is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// create by thomas fischer, 6th of februray 2011
+
+#ifndef AdvancedScreen_H__
+#define AdvancedScreen_H__
+
+#include "RoRPrerequisites.h"
+#include "Ogre.h"
+#include <map>
+
+#define SET_BIT(var, pos) ((var) |= (1<<(pos)))
+#define CLEAR_BIT(var, pos) ((var) &= ~(1<<(pos)))
+#define SET_LSB(var) ((var) |= 1)
+#define CLEAR_LSB(var) ((var) &= ~1)
+#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
+
+// this only works with lossless image compression (png)
+
+class AdvancedScreen
+{
+protected:
+ Ogre::RenderWindow *win;
+ Ogre::String filename;
+ std::map<Ogre::String, Ogre::String> map;
+public:
+ AdvancedScreen(Ogre::RenderWindow *win, Ogre::String filename) :
win(win), filename(filename)
+ {
+ }
+
+ ~AdvancedScreen()
+ {
+ }
+
+ void addData(Ogre::String name, Ogre::String value)
+ {
+ if(value.empty()) return;
+ map[name] = value;
+ }
+
+ void write()
+ {
+ win->update();
+
+ // please do not misinterpret this feature
+ // its used in the forums like an EXTIF data to display things
beside the screenshots
+ int mWidth = win->getWidth();
+ int mHeight = win->getHeight();
+
+ // grab the image data
+ Ogre::PixelFormat pf = Ogre::PF_B8G8R8;
//win->suggestPixelFormat();
+ long isize = mWidth * mHeight * PixelUtil::getNumElemBytes(pf);
+ uchar *data = OGRE_ALLOC_T(uchar, isize, MEMCATEGORY_RENDERSYS);
+ Ogre::PixelBox pb(mWidth, mHeight, 1, pf, data);
+ win->copyContentsToMemory(pb);
+
+ // now do the fancy stuff ;)
+
+ // 0. allocate enough buffer
+ char databuf[32768];
+ memset(databuf, 0, 32767);
+ char *ptr = databuf;
+ // header
+ long dsize = 0;
+ int w = sprintf(ptr, "RORED\n");
+ ptr += w;
+ dsize += w;
+
+ // 1. convert the std::map to something properly
+ for(std::map<Ogre::String, Ogre::String>::iterator it =
map.begin(); it != map.end(); it++)
+ {
+ int w = sprintf(ptr, "%s:%s\n", it->first.c_str(),
it->second.c_str());
+ ptr += w;
+ dsize += w;
+ }
+
+ // now buffer ready, put it into the image
+ uchar *ptri = data;
+ // set data pointer to the start again
+ ptr = databuf;
+ int bc = 7;
+ for(long b = 0; b < isize && b < dsize * 8 + 40; b++, ptri++)
// 40 = 5 zero bytes
+ {
+ if(CHECK_BIT(*ptr, bc))
+ SET_LSB(*ptri);
+ else
+ CLEAR_LSB(*ptri);
+ bc--;
+ if(bc<0)
+ {
+ bc=7;
+ ptr++;
+ }
+ }
+ //float used_per = ((float)(dsize * 8 + 40) / (float)isize) *
100.0f;
+ //Ogre::LogManager::getSingleton().logMessage("used " +
Ogre::StringConverter::toString(used_per) + " %");
+
+ //save it
+ Ogre::Image img;
+ img.loadDynamicImage(data, mWidth, mHeight, 1, pf, false, 1, 0);
+ img.save(filename);
+
+ OGRE_FREE(data, MEMCATEGORY_RENDERSYS);
+ }
+};
+#endif //AdvancedScreen_H__
Modified: trunk/source/main/physics/collision/collisions.cpp
===================================================================
--- trunk/source/main/physics/collision/collisions.cpp 2011-02-06 02:31:50 UTC
(rev 1662)
+++ trunk/source/main/physics/collision/collisions.cpp 2011-02-07 00:51:26 UTC
(rev 1663)
@@ -33,72 +33,72 @@
//hash function SBOX
//from http://home.comcast.net/~bretm/hash/10.html
unsigned int sbox[] =
- {
- 0xF53E1837, 0x5F14C86B, 0x9EE3964C, 0xFA796D53,
- 0x32223FC3, 0x4D82BC98, 0xA0C7FA62, 0x63E2C982,
- 0x24994A5B, 0x1ECE7BEE, 0x292B38EF, 0xD5CD4E56,
- 0x514F4303, 0x7BE12B83, 0x7192F195, 0x82DC7300,
- 0x084380B4, 0x480B55D3, 0x5F430471, 0x13F75991,
- 0x3F9CF22C, 0x2FE0907A, 0xFD8E1E69, 0x7B1D5DE8,
- 0xD575A85C, 0xAD01C50A, 0x7EE00737, 0x3CE981E8,
- 0x0E447EFA, 0x23089DD6, 0xB59F149F, 0x13600EC7,
- 0xE802C8E6, 0x670921E4, 0x7207EFF0, 0xE74761B0,
- 0x69035234, 0xBFA40F19, 0xF63651A0, 0x29E64C26,
- 0x1F98CCA7, 0xD957007E, 0xE71DDC75, 0x3E729595,
- 0x7580B7CC, 0xD7FAF60B, 0x92484323, 0xA44113EB,
- 0xE4CBDE08, 0x346827C9, 0x3CF32AFA, 0x0B29BCF1,
- 0x6E29F7DF, 0xB01E71CB, 0x3BFBC0D1, 0x62EDC5B8,
- 0xB7DE789A, 0xA4748EC9, 0xE17A4C4F, 0x67E5BD03,
- 0xF3B33D1A, 0x97D8D3E9, 0x09121BC0, 0x347B2D2C,
- 0x79A1913C, 0x504172DE, 0x7F1F8483, 0x13AC3CF6,
- 0x7A2094DB, 0xC778FA12, 0xADF7469F, 0x21786B7B,
- 0x71A445D0, 0xA8896C1B, 0x656F62FB, 0x83A059B3,
- 0x972DFE6E, 0x4122000C, 0x97D9DA19, 0x17D5947B,
- 0xB1AFFD0C, 0x6EF83B97, 0xAF7F780B, 0x4613138A,
- 0x7C3E73A6, 0xCF15E03D, 0x41576322, 0x672DF292,
- 0xB658588D, 0x33EBEFA9, 0x938CBF06, 0x06B67381,
- 0x07F192C6, 0x2BDA5855, 0x348EE0E8, 0x19DBB6E3,
- 0x3222184B, 0xB69D5DBA, 0x7E760B88, 0xAF4D8154,
- 0x007A51AD, 0x35112500, 0xC9CD2D7D, 0x4F4FB761,
- 0x694772E3, 0x694C8351, 0x4A7E3AF5, 0x67D65CE1,
- 0x9287DE92, 0x2518DB3C, 0x8CB4EC06, 0xD154D38F,
- 0xE19A26BB, 0x295EE439, 0xC50A1104, 0x2153C6A7,
- 0x82366656, 0x0713BC2F, 0x6462215A, 0x21D9BFCE,
- 0xBA8EACE6, 0xAE2DF4C1, 0x2A8D5E80, 0x3F7E52D1,
- 0x29359399, 0xFEA1D19C, 0x18879313, 0x455AFA81,
- 0xFADFE838, 0x62609838, 0xD1028839, 0x0736E92F,
- 0x3BCA22A3, 0x1485B08A, 0x2DA7900B, 0x852C156D,
- 0xE8F24803, 0x00078472, 0x13F0D332, 0x2ACFD0CF,
- 0x5F747F5C, 0x87BB1E2F, 0xA7EFCB63, 0x23F432F0,
- 0xE6CE7C5C, 0x1F954EF6, 0xB609C91B, 0x3B4571BF,
- 0xEED17DC0, 0xE556CDA0, 0xA7846A8D, 0xFF105F94,
- 0x52B7CCDE, 0x0E33E801, 0x664455EA, 0xF2C70414,
- 0x73E7B486, 0x8F830661, 0x8B59E826, 0xBB8AEDCA,
- 0xF3D70AB9, 0xD739F2B9, 0x4A04C34A, 0x88D0F089,
- 0xE02191A2, 0xD89D9C78, 0x192C2749, 0xFC43A78F,
- 0x0AAC88CB, 0x9438D42D, 0x9E280F7A, 0x36063802,
- 0x38E8D018, 0x1C42A9CB, 0x92AAFF6C, 0xA24820C5,
- 0x007F077F, 0xCE5BC543, 0x69668D58, 0x10D6FF74,
- 0xBE00F621, 0x21300BBE, 0x2E9E8F46, 0x5ACEA629,
- 0xFA1F86C7, 0x52F206B8, 0x3EDF1A75, 0x6DA8D843,
- 0xCF719928, 0x73E3891F, 0xB4B95DD6, 0xB2A42D27,
- 0xEDA20BBF, 0x1A58DBDF, 0xA449AD03, 0x6DDEF22B,
- 0x900531E6, 0x3D3BFF35, 0x5B24ABA2, 0x472B3E4C,
- 0x387F2D75, 0x4D8DBA36, 0x71CB5641, 0xE3473F3F,
- 0xF6CD4B7F, 0xBF7D1428, 0x344B64D0, 0xC5CDFCB6,
- 0xFE2E0182, 0x2C37A673, 0xDE4EB7A3, 0x63FDC933,
- 0x01DC4063, 0x611F3571, 0xD167BFAF, 0x4496596F,
- 0x3DEE0689, 0xD8704910, 0x7052A114, 0x068C9EC5,
- 0x75D0E766, 0x4D54CC20, 0xB44ECDE2, 0x4ABC653E,
- 0x2C550A21, 0x1A52C0DB, 0xCFED03D0, 0x119BAFE2,
- 0x876A6133, 0xBC232088, 0x435BA1B2, 0xAE99BBFA,
- 0xBB4F08E4, 0xA62B5F49, 0x1DA4B695, 0x336B84DE,
- 0xDC813D31, 0x00C134FB, 0x397A98E6, 0x151F0E64,
- 0xD9EB3E69, 0xD3C7DF60, 0xD2F2C336, 0x2DDD067B,
- 0xBD122835, 0xB0B3BD3A, 0xB0D54E46, 0x8641F1E4,
- 0xA0B38F96, 0x51D39199, 0x37A6AD75, 0xDF84EE41,
- 0x3C034CBA, 0xACDA62FC, 0x11923B8B, 0x45EF170A,
- };
+{
+ 0xF53E1837, 0x5F14C86B, 0x9EE3964C, 0xFA796D53,
+ 0x32223FC3, 0x4D82BC98, 0xA0C7FA62, 0x63E2C982,
+ 0x24994A5B, 0x1ECE7BEE, 0x292B38EF, 0xD5CD4E56,
+ 0x514F4303, 0x7BE12B83, 0x7192F195, 0x82DC7300,
+ 0x084380B4, 0x480B55D3, 0x5F430471, 0x13F75991,
+ 0x3F9CF22C, 0x2FE0907A, 0xFD8E1E69, 0x7B1D5DE8,
+ 0xD575A85C, 0xAD01C50A, 0x7EE00737, 0x3CE981E8,
+ 0x0E447EFA, 0x23089DD6, 0xB59F149F, 0x13600EC7,
+ 0xE802C8E6, 0x670921E4, 0x7207EFF0, 0xE74761B0,
+ 0x69035234, 0xBFA40F19, 0xF63651A0, 0x29E64C26,
+ 0x1F98CCA7, 0xD957007E, 0xE71DDC75, 0x3E729595,
+ 0x7580B7CC, 0xD7FAF60B, 0x92484323, 0xA44113EB,
+ 0xE4CBDE08, 0x346827C9, 0x3CF32AFA, 0x0B29BCF1,
+ 0x6E29F7DF, 0xB01E71CB, 0x3BFBC0D1, 0x62EDC5B8,
+ 0xB7DE789A, 0xA4748EC9, 0xE17A4C4F, 0x67E5BD03,
+ 0xF3B33D1A, 0x97D8D3E9, 0x09121BC0, 0x347B2D2C,
+ 0x79A1913C, 0x504172DE, 0x7F1F8483, 0x13AC3CF6,
+ 0x7A2094DB, 0xC778FA12, 0xADF7469F, 0x21786B7B,
+ 0x71A445D0, 0xA8896C1B, 0x656F62FB, 0x83A059B3,
+ 0x972DFE6E, 0x4122000C, 0x97D9DA19, 0x17D5947B,
+ 0xB1AFFD0C, 0x6EF83B97, 0xAF7F780B, 0x4613138A,
+ 0x7C3E73A6, 0xCF15E03D, 0x41576322, 0x672DF292,
+ 0xB658588D, 0x33EBEFA9, 0x938CBF06, 0x06B67381,
+ 0x07F192C6, 0x2BDA5855, 0x348EE0E8, 0x19DBB6E3,
+ 0x3222184B, 0xB69D5DBA, 0x7E760B88, 0xAF4D8154,
+ 0x007A51AD, 0x35112500, 0xC9CD2D7D, 0x4F4FB761,
+ 0x694772E3, 0x694C8351, 0x4A7E3AF5, 0x67D65CE1,
+ 0x9287DE92, 0x2518DB3C, 0x8CB4EC06, 0xD154D38F,
+ 0xE19A26BB, 0x295EE439, 0xC50A1104, 0x2153C6A7,
+ 0x82366656, 0x0713BC2F, 0x6462215A, 0x21D9BFCE,
+ 0xBA8EACE6, 0xAE2DF4C1, 0x2A8D5E80, 0x3F7E52D1,
+ 0x29359399, 0xFEA1D19C, 0x18879313, 0x455AFA81,
+ 0xFADFE838, 0x62609838, 0xD1028839, 0x0736E92F,
+ 0x3BCA22A3, 0x1485B08A, 0x2DA7900B, 0x852C156D,
+ 0xE8F24803, 0x00078472, 0x13F0D332, 0x2ACFD0CF,
+ 0x5F747F5C, 0x87BB1E2F, 0xA7EFCB63, 0x23F432F0,
+ 0xE6CE7C5C, 0x1F954EF6, 0xB609C91B, 0x3B4571BF,
+ 0xEED17DC0, 0xE556CDA0, 0xA7846A8D, 0xFF105F94,
+ 0x52B7CCDE, 0x0E33E801, 0x664455EA, 0xF2C70414,
+ 0x73E7B486, 0x8F830661, 0x8B59E826, 0xBB8AEDCA,
+ 0xF3D70AB9, 0xD739F2B9, 0x4A04C34A, 0x88D0F089,
+ 0xE02191A2, 0xD89D9C78, 0x192C2749, 0xFC43A78F,
+ 0x0AAC88CB, 0x9438D42D, 0x9E280F7A, 0x36063802,
+ 0x38E8D018, 0x1C42A9CB, 0x92AAFF6C, 0xA24820C5,
+ 0x007F077F, 0xCE5BC543, 0x69668D58, 0x10D6FF74,
+ 0xBE00F621, 0x21300BBE, 0x2E9E8F46, 0x5ACEA629,
+ 0xFA1F86C7, 0x52F206B8, 0x3EDF1A75, 0x6DA8D843,
+ 0xCF719928, 0x73E3891F, 0xB4B95DD6, 0xB2A42D27,
+ 0xEDA20BBF, 0x1A58DBDF, 0xA449AD03, 0x6DDEF22B,
+ 0x900531E6, 0x3D3BFF35, 0x5B24ABA2, 0x472B3E4C,
+ 0x387F2D75, 0x4D8DBA36, 0x71CB5641, 0xE3473F3F,
+ 0xF6CD4B7F, 0xBF7D1428, 0x344B64D0, 0xC5CDFCB6,
+ 0xFE2E0182, 0x2C37A673, 0xDE4EB7A3, 0x63FDC933,
+ 0x01DC4063, 0x611F3571, 0xD167BFAF, 0x4496596F,
+ 0x3DEE0689, 0xD8704910, 0x7052A114, 0x068C9EC5,
+ 0x75D0E766, 0x4D54CC20, 0xB44ECDE2, 0x4ABC653E,
+ 0x2C550A21, 0x1A52C0DB, 0xCFED03D0, 0x119BAFE2,
+ 0x876A6133, 0xBC232088, 0x435BA1B2, 0xAE99BBFA,
+ 0xBB4F08E4, 0xA62B5F49, 0x1DA4B695, 0x336B84DE,
+ 0xDC813D31, 0x00C134FB, 0x397A98E6, 0x151F0E64,
+ 0xD9EB3E69, 0xD3C7DF60, 0xD2F2C336, 0x2DDD067B,
+ 0xBD122835, 0xB0B3BD3A, 0xB0D54E46, 0x8641F1E4,
+ 0xA0B38F96, 0x51D39199, 0x37A6AD75, 0xDF84EE41,
+ 0x3C034CBA, 0xACDA62FC, 0x11923B8B, 0x45EF170A,
+};
Collisions::Collisions(
#ifdef USE_LUA
@@ -916,7 +916,7 @@
{
collision_box_t *cbox =
&collision_boxes[(*cell)[k]];
if (node->AbsPosition > cbox->lo
- && node->AbsPosition < cbox->hi)
+ && node->AbsPosition < cbox->hi)
{
if (cbox->refined || cbox->selfrotated)
{
@@ -931,7 +931,7 @@
}
//now test with the inner box
if (Pos > cbox->relo
- && Pos < cbox->rehi)
+ && Pos < cbox->rehi)
{
if
(cbox->eventsourcenum!=-1 && permitEvent(cbox->event_filter))
{
Modified: trunk/source/main/scripting/ScriptEngine.cpp
===================================================================
--- trunk/source/main/scripting/ScriptEngine.cpp 2011-02-06 02:31:50 UTC
(rev 1662)
+++ trunk/source/main/scripting/ScriptEngine.cpp 2011-02-07 00:51:26 UTC
(rev 1663)
@@ -600,6 +600,7 @@
// using SHA1 here is stupid, we need to replace it with
something better
// then hash it
char hash_result[250];
+ memset(hash_result, 0, 249);
RoR::CSHA1 sha1;
sha1.UpdateHash((uint8_t *)script.c_str(), script.size());
sha1.Final();
Modified: trunk/source/main/utils/Settings.cpp
===================================================================
--- trunk/source/main/utils/Settings.cpp 2011-02-06 02:31:50 UTC (rev
1662)
+++ trunk/source/main/utils/Settings.cpp 2011-02-07 00:51:26 UTC (rev
1663)
@@ -171,6 +171,7 @@
// now hash ourself
{
char hash_result[250];
+ memset(hash_result, 0, 249);
RoR::CSHA1 sha1;
sha1.HashFile(program_path);
sha1.Final();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel