Revision: 1629
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1629&view=rev
Author: rorthomas
Date: 2011-02-01 12:56:24 +0000 (Tue, 01 Feb 2011)
Log Message:
-----------
0.38.7:
* improved mygui integration: better fonts, cleaned up deprecated warnings upon
mygui loading
* fixed preview images in mygui
* merged layouts.zip into mygui.zip
* added wallpaper for mygui, better than plain black
* added extcamera command:
http://www.rigsofrods.com/wiki/pages/Truck_Description_File#Extcamera
* fixed character showing up before map loading
* remove ingame console by default. You can enable it again by setting "Enable
Ingame Console=Yes" in RoR.cfg
Modified Paths:
--------------
trunk/bin/resources/mygui.zip
trunk/source/main/Beam.cpp
trunk/source/main/Beam.h
trunk/source/main/BeamLoadTruck.cpp
trunk/source/main/Character.cpp
trunk/source/main/DustPool.cpp
trunk/source/main/InputEngine.cpp
trunk/source/main/LoadingWindow.h
trunk/source/main/RigsOfRods.cpp
trunk/source/main/RoRFrameListener.cpp
trunk/source/main/RoRFrameListener.h
trunk/source/main/SelectorWindow.h
trunk/source/main/gui_manager.cpp
Removed Paths:
-------------
trunk/bin/resources/layouts.zip
Deleted: trunk/bin/resources/layouts.zip
===================================================================
(Binary files differ)
Modified: trunk/bin/resources/mygui.zip
===================================================================
(Binary files differ)
Modified: trunk/source/main/Beam.cpp
===================================================================
--- trunk/source/main/Beam.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/Beam.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -351,6 +351,8 @@
memset(this->flexbodies, 0, sizeof(FlexBody *) * MAX_FLEXBODIES);
free_flexbody = 0;
// clearing done
+ externalcameramode=0;
+ externalcameranode=-1;
net=_net;
if(net && !networking) networking = true; // enable networking if some
network class is existing
@@ -1655,14 +1657,32 @@
void Beam::updateTruckPosition()
{
// calculate average position (and smooth)
- if(freecinecamera > 0)
+ if(externalcameramode == 0)
{
- // fix for detaching beams
- position = nodes[cinecameranodepos[0]].AbsPosition; // -
cinecam_avg_offset;
+ // the classic approach: average over all nodes and beams
+ Vector3 aposition = Vector3::ZERO;
for (int n=0; n < free_node; n++)
{
nodes[n].smoothpos = nodes[n].AbsPosition;
+ aposition += nodes[n].smoothpos;
}
+ position = aposition / free_node;
+ } else if(externalcameramode == 1 && freecinecamera > 0)
+ {
+ // the new (strange) approach: reuse the cinecam node
+ for (int n=0; n < free_node; n++)
+ {
+ nodes[n].smoothpos = nodes[n].AbsPosition;
+ }
+ position = nodes[cinecameranodepos[0]].AbsPosition;
+ } else if(externalcameramode == 2 && externalcameranode >= 0)
+ {
+ // the new (strange) approach #2: reuse a specified node
+ for (int n=0; n < free_node; n++)
+ {
+ nodes[n].smoothpos = nodes[n].AbsPosition;
+ }
+ position = nodes[externalcameranode].AbsPosition;
} else
{
Vector3 aposition = Vector3::ZERO;
Modified: trunk/source/main/Beam.h
===================================================================
--- trunk/source/main/Beam.h 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/Beam.h 2011-02-01 12:56:24 UTC (rev 1629)
@@ -288,6 +288,7 @@
int cameranodepos[MAX_CAMERAS];
int cameranodedir[MAX_CAMERAS];
int cameranoderoll[MAX_CAMERAS];
+ int externalcameramode, externalcameranode;
bool revroll[MAX_CAMERAS];
float WheelSpeed;
int stabcommand;
Modified: trunk/source/main/BeamLoadTruck.cpp
===================================================================
--- trunk/source/main/BeamLoadTruck.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/BeamLoadTruck.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -217,6 +217,23 @@
mode=0;
continue;
}
+ if (!strncmp("extcamera", line, 9))
+ {
+ char modestr[255] = "";
+ int nodeid=-1;
+ int result = sscanf(line,"extcamera %s %i", modestr,
&nodeid);
+ if (result < 1 || result == EOF)
+ {
+ LogManager::getSingleton().logMessage("Error
parsing File (extcamera) " + String(fname) +" line " +
StringConverter::toString(linecounter) + ". trying to continue ...");
+ continue;
+ }
+ if(!strcmp(modestr, "classic")) externalcameramode = 0;
+ if(!strcmp(modestr, "cinecam")) externalcameramode = 1;
+ if(!strcmp(modestr, "node")) externalcameramode = 2;
+
+ externalcameranode = nodeid;
+ continue;
+ }
if (!strncmp("fileformatversion", line, 17))
{
int fileformatversion;
Modified: trunk/source/main/Character.cpp
===================================================================
--- trunk/source/main/Character.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/Character.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -219,12 +219,12 @@
return personode->setOrientation(rot);
}
-void Character::setVisible(bool v)
+void Character::setVisible(bool visible)
{
- personode->setVisible(v);
+ personode->setVisible(visible);
#ifdef USE_MYGUI
if(map)
- map->getEntityByName(myName)->setVisibility(v);
+ map->getEntityByName(myName)->setVisibility(visible);
#endif //MYGUI
}
Modified: trunk/source/main/DustPool.cpp
===================================================================
--- trunk/source/main/DustPool.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/DustPool.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -52,6 +52,7 @@
{
visible[i] = s;
pss[i]->setVisible(s);
+ pss[i]->setEmitting(false);
}
}
@@ -152,7 +153,11 @@
for (i=0; i<allocated; i++)
{
// show particle if requested
- if(pss[i] && !pss[i]->isVisible() && visible[i])
pss[i]->setVisible(true);
+ if(pss[i] && !pss[i]->isVisible() && visible[i])
+ {
+ pss[i]->setVisible(true);
+ pss[i]->setEmitting(true);
+ }
if (types[i]==DUST_NORMAL)
{
Modified: trunk/source/main/InputEngine.cpp
===================================================================
--- trunk/source/main/InputEngine.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/InputEngine.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -1888,7 +1888,7 @@
bool InputEngine::keyPressed( const OIS::KeyEvent &arg )
{
#ifdef USE_MYGUI
- if(Console::get()->getVisible())
+ if(Console::get() && Console::get()->getVisible())
{
GUIManager::getSingleton().keyPressed(arg);
return true;
Modified: trunk/source/main/LoadingWindow.h
===================================================================
--- trunk/source/main/LoadingWindow.h 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/LoadingWindow.h 2011-02-01 12:56:24 UTC (rev 1629)
@@ -46,9 +46,9 @@
void renderOneFrame();
private:
ATTRIBUTE_FIELD_WIDGET_NAME(LoadingWindow, mBarProgress, "Bar");
- MyGUI::Progress* mBarProgress;
+ MyGUI::ProgressBar* mBarProgress;
ATTRIBUTE_FIELD_WIDGET_NAME(LoadingWindow, mInfoStaticText, "Info");
- MyGUI::StaticText* mInfoStaticText;
+ MyGUI::TextBox* mInfoStaticText;
bool mFrameForced;
};
Modified: trunk/source/main/RigsOfRods.cpp
===================================================================
--- trunk/source/main/RigsOfRods.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/RigsOfRods.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -193,8 +193,7 @@
loadMainResource("meshes");
loadMainResource("overlays");
loadMainResource("particles");
- loadMainResource("mygui");
- loadMainResource("layouts");
+ loadMainResource("mygui", "cache"); // HACK for mygui only supporting
one resource group
loadMainResource("scripts");
loadMainResource("textures");
loadMainResource("flags");
Modified: trunk/source/main/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/RoRFrameListener.cpp 2011-02-01 10:49:00 UTC (rev
1628)
+++ trunk/source/main/RoRFrameListener.cpp 2011-02-01 12:56:24 UTC (rev
1629)
@@ -923,11 +923,17 @@
// create main menu :D
new GUI_MainMenu(this);
new GUI_Friction();
+
+ MyGUI::LayoutManager::getInstance().load("wallpaper.layout");
+
#endif //MYGUI
#ifdef USE_ANGELSCRIPT
#ifdef USE_MYGUI
- Console::getInstance();
+ ingame_console = (SETTINGS.getSetting("Enable Ingame Console") ==
"Yes");
+
+ if(ingame_console)
+ Console::getInstance();
#endif// MYGUI
#endif
@@ -1158,7 +1164,7 @@
// initiate player colours
new PlayerColours();
- // hide console when not in netmode
+ // hide chat when not in netmode
NETCHAT.setMode(this, NETCHAT_LEFT_SMALL, false);
// you always need that, even if you are not using the network
@@ -1342,10 +1348,6 @@
#endif // MYGUI
}
- // show character
- person->setVisible(true);
-
-
initialized=true;
}
@@ -4153,9 +4155,12 @@
}
#ifdef USE_MYGUI
- if
(INPUTENGINE.getEventBoolValueBounce(EV_COMMON_CONSOLEDISPLAY))
+ if(ingame_console)
{
-
Console::get()->setVisible(!Console::get()->getVisible());
+ if
(INPUTENGINE.getEventBoolValueBounce(EV_COMMON_CONSOLEDISPLAY))
+ {
+
Console::get()->setVisible(!Console::get()->getVisible());
+ }
}
#endif // MYGUI
@@ -4748,28 +4753,28 @@
{
LogManager::getSingleton().logMessage("Loading Ogitor scene
format: " + terrainfile);
loadOgitorTerrain(terrainfile);
-#ifdef USE_MYGUI
- LoadingWindow::get()->hide();
-#endif // USE_MYGUI
- return;
}
-
- if(terrainfile.find(".terrn") != String::npos)
+ else if(terrainfile.find(".terrn") != String::npos)
{
LogManager::getSingleton().logMessage("Loading classic terrain
format: " + terrainfile);
loadClassicTerrain(terrainfile);
-
+ } else
+ {
+ // exit on unkown terrain handler
+ LogManager::getSingleton().logMessage("Terrain not supported,
unknown format: " + terrainfile);
+ showError(_L("Terrain loading error"), _L("Terrain not
supported, unknown format: ") + terrainfile);
+ exit(123);
+ }
+
#ifdef USE_MYGUI
- LoadingWindow::get()->hide();
+ // hide loading window
+ LoadingWindow::get()->hide();
+ // hide wallpaper
+ MyGUI::Window *w =
MyGUI::Gui::getInstance().findWidget<MyGUI::Window>("wallpaper");
+ if(w) w->setVisibleSmooth(false);
#endif // USE_MYGUI
- return;
- }
- // exit on unkown terrain handler
- LogManager::getSingleton().logMessage("Terrain not supported, unknown
format: " + terrainfile);
- showError(_L("Terrain loading error"), _L("Terrain not supported,
unknown format: ") + terrainfile);
- exit(123);
-
+ if(person) person->setVisible(true);
}
void RoRFrameListener::loadClassicTerrain(String terrainfile)
Modified: trunk/source/main/RoRFrameListener.h
===================================================================
--- trunk/source/main/RoRFrameListener.h 2011-02-01 10:49:00 UTC (rev
1628)
+++ trunk/source/main/RoRFrameListener.h 2011-02-01 12:56:24 UTC (rev
1629)
@@ -310,6 +310,7 @@
void gridScreenshots(Ogre::RenderWindow* pRenderWindow, Ogre::Camera*
pCamera, const int& pGridSize, const Ogre::String& path, const Ogre::String&
pFileName, const Ogre::String& pFileExtention, const bool& pStitchGridImages);
void initDust();
unsigned int inputhwnd;
+ bool ingame_console;
public:
// Constructor takes a RenderWindow because it uses that to determine
input context
RoRFrameListener(RenderWindow* win, Camera* cam, SceneManager* scm,
Root* root, bool isEmbedded=false, unsigned int inputhwnd=0);
Modified: trunk/source/main/SelectorWindow.h
===================================================================
--- trunk/source/main/SelectorWindow.h 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/SelectorWindow.h 2011-02-01 12:56:24 UTC (rev 1629)
@@ -87,15 +87,15 @@
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mTypeComboBox, "Type");
MyGUI::ComboBox* mTypeComboBox;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mModelList, "Model");
- MyGUI::List* mModelList;
+ MyGUI::ListBox* mModelList;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mEntryNameStaticText,
"EntryName");
- MyGUI::StaticText* mEntryNameStaticText;
+ MyGUI::TextBox* mEntryNameStaticText;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow,
mEntryDescriptionStaticText, "EntryDescription");
- MyGUI::StaticText* mEntryDescriptionStaticText;
+ MyGUI::TextBox* mEntryDescriptionStaticText;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mConfigComboBox, "Config");
MyGUI::ComboBox* mConfigComboBox;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mPreviewStaticImage,
"Preview");
- MyGUI::StaticImage* mPreviewStaticImage;
+ MyGUI::ImageBox* mPreviewStaticImage;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mOkButton, "Ok");
MyGUI::Button* mOkButton;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mCancelButton, "Cancel");
@@ -103,7 +103,7 @@
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mSearchSheet, "Search");
MyGUI::Sheet* mSearchSheet;
ATTRIBUTE_FIELD_WIDGET_NAME(SelectorWindow, mSearchLineEdit,
"SearchLine");
- MyGUI::Edit* mSearchLineEdit;
+ MyGUI::EditBox* mSearchLineEdit;
};
#endif // __SELECTOR_WINDOW_H__
Modified: trunk/source/main/gui_manager.cpp
===================================================================
--- trunk/source/main/gui_manager.cpp 2011-02-01 10:49:00 UTC (rev 1628)
+++ trunk/source/main/gui_manager.cpp 2011-02-01 12:56:24 UTC (rev 1629)
@@ -81,7 +81,7 @@
{
String gui_logfilename = SETTINGS.getSetting("Log Path") + "mygui.log";
mPlatform = new MyGUI::OgrePlatform();
- mPlatform->initialise(mWindow, mSceneManager,
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, gui_logfilename);
+ mPlatform->initialise(mWindow, mSceneManager, "cache",
gui_logfilename); // use cache resource group so preview images are working
mGUI = new MyGUI::Gui();
mGUI->initialise(mResourceFileName);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel