You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ww...> - 2007-06-14 05:43:28
|
Author: mkrose Date: 2007-06-13 22:43:03 -0700 (Wed, 13 Jun 2007) New Revision: 2126 Modified: trunk/csp/cspsim/wf/WindowManager.cpp Log: Another dummy commit to test the mailing list. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2126 Modified: trunk/csp/cspsim/wf/WindowManager.cpp =================================================================== --- trunk/csp/cspsim/wf/WindowManager.cpp 2007-06-14 05:10:18 UTC (rev 2125) +++ trunk/csp/cspsim/wf/WindowManager.cpp 2007-06-14 05:43:03 UTC (rev 2126) @@ -114,13 +114,13 @@ m_View->setSceneData(m_Group.get()); - osg::StateSet *stateSet = m_Group->getOrCreateStateSet(); - stateSet->setRenderBinDetails(100, "RenderBin"); - stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); - stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); + osg::StateSet *stateSet = m_Group->getOrCreateStateSet(); + stateSet->setRenderBinDetails(100, "RenderBin"); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); + stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); - osg::ref_ptr<osg::BlendFunc> blendFunction = new osg::BlendFunc; - stateSet->setAttributeAndModes(blendFunction.get()); + osg::ref_ptr<osg::BlendFunc> blendFunction = new osg::BlendFunc; + stateSet->setAttributeAndModes(blendFunction.get()); } WindowManager::~WindowManager() { |
From: <sv...@ww...> - 2007-06-14 05:36:58
|
Author: mkrose Date: 2006-10-25 00:39:07 -0700 (Wed, 25 Oct 2006) New Revision: 2001 Modified: trunk/csp/csplib/util/LogConstants.h trunk/csp/cspsim/battlefield/SimObject.h Log: Fix integer overflow warnings under gcc 4.1. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2001 Modified: trunk/csp/csplib/util/LogConstants.h =================================================================== --- trunk/csp/csplib/util/LogConstants.h 2006-10-13 18:36:26 UTC (rev 2000) +++ trunk/csp/csplib/util/LogConstants.h 2006-10-25 07:39:07 UTC (rev 2001) @@ -80,7 +80,7 @@ // groups cLogCategory_NONE = 0x00000000, - cLogCategory_ALL = 0xffffffff + cLogCategory_ALL = 0x7fffffff }; CSP_NAMESPACE_END Modified: trunk/csp/cspsim/battlefield/SimObject.h =================================================================== --- trunk/csp/cspsim/battlefield/SimObject.h 2006-10-13 18:36:26 UTC (rev 2000) +++ trunk/csp/cspsim/battlefield/SimObject.h 2006-10-25 07:39:07 UTC (rev 2001) @@ -78,11 +78,11 @@ std::vector<ObjectId> m_ContactList; uint32 m_ContactSignature; - inline void setFlags(int flag, bool on) { + inline void setFlags(unsigned flag, bool on) { if (on) m_Flags |= flag; else m_Flags &= ~flag; } - inline int getFlags(int flags) const { + inline int getFlags(unsigned flags) const { return m_Flags & flags; } |
From: <sv...@ww...> - 2007-06-14 05:27:12
|
Author: stormbringer Date: 2006-10-13 11:36:26 -0700 (Fri, 13 Oct 2006) New Revision: 2000 Modified: trunk/csp/bin/test_objects Log: Correct initial position of F16 to avoid budding out of the ground. Thanks Henrik! Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2000 Modified: trunk/csp/bin/test_objects =================================================================== --- trunk/csp/bin/test_objects 2006-10-04 03:58:40 UTC (rev 1999) +++ trunk/csp/bin/test_objects 2006-10-13 18:36:26 UTC (rev 2000) @@ -1,55 +1,55 @@ -# -*- python -*- - -# Combat Simulator Project -# Copyright (C) 2002 The Combat Simulator Project -# http://csp.sourceforge.net -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -# Create some test vehicles and other objects. The first vehicle created -# will be the initial active object. This is a temporary hack until the -# theater code is developed to the point that objects are generated -# automatically via a campaign engine. - -# shorthand - -vec = csp.csplib.Vector3 -vehicle = sim.createVehicle - -m2k = "sim:vehicles.aircraft.m2k" -f16dj = "sim:vehicles.aircraft.f16dj" - - -def createBalkan(): - vehicle(f16dj, vec(-29495, -10530, 87.8), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) - vehicle(f16dj, vec(-29510, -10530, 87.8), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) - -def createNCA(): - vehicle(m2k, vec(0, 0, 1200.0), vec(0, 100.0, 0), vec(5.0, 0.0, 0.0)) - vehicle(f16dj, vec(10, 10, 1000.2), vec(0, 100.0, 0), vec(2.0, 2.0, 140.0)) - -def unknown(): - print "Unrecognized terrain name: %s" % sim.getTerrainName() - - -dispatch = { - "Balkan Terrain": createBalkan, - "NCA Terrain": createNCA, -} - -create = dispatch.get(sim.getTerrainName(), unknown) -create() - +# -*- python -*- + +# Combat Simulator Project +# Copyright (C) 2002 The Combat Simulator Project +# http://csp.sourceforge.net +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +# Create some test vehicles and other objects. The first vehicle created +# will be the initial active object. This is a temporary hack until the +# theater code is developed to the point that objects are generated +# automatically via a campaign engine. + +# shorthand + +vec = csp.csplib.Vector3 +vehicle = sim.createVehicle + +m2k = "sim:vehicles.aircraft.m2k" +f16dj = "sim:vehicles.aircraft.f16dj" + + +def createBalkan(): + vehicle(f16dj, vec(-29495, -10530, 91.1), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) + vehicle(f16dj, vec(-29510, -10530, 91.1), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) + +def createNCA(): + vehicle(m2k, vec(0, 0, 1200.0), vec(0, 100.0, 0), vec(5.0, 0.0, 0.0)) + vehicle(f16dj, vec(10, 10, 1000.2), vec(0, 100.0, 0), vec(2.0, 2.0, 140.0)) + +def unknown(): + print "Unrecognized terrain name: %s" % sim.getTerrainName() + + +dispatch = { + "Balkan Terrain": createBalkan, + "NCA Terrain": createNCA, +} + +create = dispatch.get(sim.getTerrainName(), unknown) +create() + |
From: <sv...@ww...> - 2007-06-14 05:09:25
|
Author: stormbringer Date: 2006-10-13 11:36:26 -0700 (Fri, 13 Oct 2006) New Revision: 2000 Modified: trunk/csp/bin/test_objects Log: Correct initial position of F16 to avoid budding out of the ground. Thanks Henrik! Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2000 Modified: trunk/csp/bin/test_objects =================================================================== --- trunk/csp/bin/test_objects 2006-10-04 03:58:40 UTC (rev 1999) +++ trunk/csp/bin/test_objects 2006-10-13 18:36:26 UTC (rev 2000) @@ -1,55 +1,55 @@ -# -*- python -*- - -# Combat Simulator Project -# Copyright (C) 2002 The Combat Simulator Project -# http://csp.sourceforge.net -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -# Create some test vehicles and other objects. The first vehicle created -# will be the initial active object. This is a temporary hack until the -# theater code is developed to the point that objects are generated -# automatically via a campaign engine. - -# shorthand - -vec = csp.csplib.Vector3 -vehicle = sim.createVehicle - -m2k = "sim:vehicles.aircraft.m2k" -f16dj = "sim:vehicles.aircraft.f16dj" - - -def createBalkan(): - vehicle(f16dj, vec(-29495, -10530, 87.8), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) - vehicle(f16dj, vec(-29510, -10530, 87.8), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) - -def createNCA(): - vehicle(m2k, vec(0, 0, 1200.0), vec(0, 100.0, 0), vec(5.0, 0.0, 0.0)) - vehicle(f16dj, vec(10, 10, 1000.2), vec(0, 100.0, 0), vec(2.0, 2.0, 140.0)) - -def unknown(): - print "Unrecognized terrain name: %s" % sim.getTerrainName() - - -dispatch = { - "Balkan Terrain": createBalkan, - "NCA Terrain": createNCA, -} - -create = dispatch.get(sim.getTerrainName(), unknown) -create() - +# -*- python -*- + +# Combat Simulator Project +# Copyright (C) 2002 The Combat Simulator Project +# http://csp.sourceforge.net +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +# Create some test vehicles and other objects. The first vehicle created +# will be the initial active object. This is a temporary hack until the +# theater code is developed to the point that objects are generated +# automatically via a campaign engine. + +# shorthand + +vec = csp.csplib.Vector3 +vehicle = sim.createVehicle + +m2k = "sim:vehicles.aircraft.m2k" +f16dj = "sim:vehicles.aircraft.f16dj" + + +def createBalkan(): + vehicle(f16dj, vec(-29495, -10530, 91.1), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) + vehicle(f16dj, vec(-29510, -10530, 91.1), vec(0, 0, 0), vec(0.0, 0.0, 180.0)) + +def createNCA(): + vehicle(m2k, vec(0, 0, 1200.0), vec(0, 100.0, 0), vec(5.0, 0.0, 0.0)) + vehicle(f16dj, vec(10, 10, 1000.2), vec(0, 100.0, 0), vec(2.0, 2.0, 140.0)) + +def unknown(): + print "Unrecognized terrain name: %s" % sim.getTerrainName() + + +dispatch = { + "Balkan Terrain": createBalkan, + "NCA Terrain": createNCA, +} + +create = dispatch.get(sim.getTerrainName(), unknown) +create() + |
From: root <ro...@vi...> - 2007-06-14 05:05:14
|
test2 |
From: root <ro...@vi...> - 2007-06-14 04:00:46
|
test |
From: <sv...@ww...> - 2007-04-30 21:49:18
|
Author: nsmoooose Date: 2007-04-30 14:49:06 -0700 (Mon, 30 Apr 2007) New Revision: 2091 Added: branches/python_bindings_for_ui/csp/data/ui/messagebox.py Modified: branches/python_bindings_for_ui/csp/data/ui/localization/english/global.xml branches/python_bindings_for_ui/csp/data/ui/localization/svenska/global.xml branches/python_bindings_for_ui/csp/data/ui/options.py branches/python_bindings_for_ui/csp/data/ui/themes/default/messagebox.xml Log: * Added python message box class. * Messagebox is displayed when display resolution is changed. * Added restart simulation text message to the global string table. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2091 Modified: branches/python_bindings_for_ui/csp/data/ui/localization/english/global.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/localization/english/global.xml 2007-04-30 21:00:10 UTC (rev 2090) +++ branches/python_bindings_for_ui/csp/data/ui/localization/english/global.xml 2007-04-30 21:49:06 UTC (rev 2091) @@ -8,6 +8,7 @@ <String key="ok">OK</String> <String key="options">Options</String> <String key="quit">Quit</String> + <String key="restart_required">Restart is required for changes to take effect.</String> <String key="screen_resolution">Resolution</String> <String key="ui_theme">Theme</String> <String key="ui_language">Language</String> Modified: branches/python_bindings_for_ui/csp/data/ui/localization/svenska/global.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/localization/svenska/global.xml 2007-04-30 21:00:10 UTC (rev 2090) +++ branches/python_bindings_for_ui/csp/data/ui/localization/svenska/global.xml 2007-04-30 21:49:06 UTC (rev 2091) @@ -8,6 +8,7 @@ <String key="ok">OK</String> <String key="options">Installningar</String> <String key="quit">Avsluta</String> + <String key="restart_required">Omstart kravs for att andring skall galla.</String> <String key="screen_resolution">Upplosning</String> <String key="ui_theme">Tema</String> <String key="ui_language">Sprak</String> Added: branches/python_bindings_for_ui/csp/data/ui/messagebox.py =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/messagebox.py 2007-04-30 21:00:10 UTC (rev 2090) +++ branches/python_bindings_for_ui/csp/data/ui/messagebox.py 2007-04-30 21:49:06 UTC (rev 2091) @@ -0,0 +1,55 @@ +#!/usr/bin/python + +# Combat Simulator Project +# Copyright (C) 2002-2005 The Combat Simulator Project +# http://csp.sourceforge.net +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +""" +Combat Simulator Project : Message box script +""" + +import csp.cspsim +from csp.data.ui.utils import SlotManager + +class MessageBox(csp.cspsim.Window, SlotManager): + def __init__(self, cspsim, themeName): + csp.cspsim.Window.__init__(self) + SlotManager.__init__(self) + + self.cspsim = cspsim + + # Load the user interface for this window. + serializer = csp.cspsim.Serialization() + serializer.load(self, themeName, 'messagebox.xml') + + # Listen to the click signal for the ok button. + okButton = self.getById('ok') + if okButton != None: + self.connectToClickSignal(okButton, self.ok_Click) + + def ok_Click(self): + self.close() + + def setMessage(self, message): + messageLabel = self.getById('message') + if messageLabel != None: + messageLabel.setText(message) + + def show(self, parentWindow, message): + self.setMessage(message) + parentWindow.getWindowManager().show(self) + self.centerWindow() \ No newline at end of file Modified: branches/python_bindings_for_ui/csp/data/ui/options.py =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/options.py 2007-04-30 21:00:10 UTC (rev 2090) +++ branches/python_bindings_for_ui/csp/data/ui/options.py 2007-04-30 21:49:06 UTC (rev 2091) @@ -93,6 +93,11 @@ self.configuration.getDisplay().setWidth(width) self.configuration.getDisplay().setHeight(height) + from csp.data.ui.messagebox import MessageBox + messageBox = MessageBox(self.cspsim, self.getTheme()) + messageBox.show(self, '${restart_required}') + + def theme_Changed(self): self.configuration.getUserInterface().setTheme(self.themeListBox.getSelectedItem().getText()) Modified: branches/python_bindings_for_ui/csp/data/ui/themes/default/messagebox.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/themes/default/messagebox.xml 2007-04-30 21:00:10 UTC (rev 2090) +++ branches/python_bindings_for_ui/csp/data/ui/themes/default/messagebox.xml 2007-04-30 21:49:06 UTC (rev 2091) @@ -3,17 +3,18 @@ <Includes> <!-- This include will set the default behaviour on all controls. --> <StyleInclude>styles.xml</StyleInclude> + <StringTableInclude>global.xml</StringTableInclude> </Includes> - <Window CssClass="window_default" SizeWidth="409" SizeHeight="200" LocationZ="30" > + <Window CssClass="window_default" SizeWidth="500" SizeHeight="200" LocationZ="50" > <Control> <MultiControlContainer> <Controls> - <Label Id="caption" LocationX="10" LocationY="2" SizeWidth="398" SizeHeight="30" Text="Combat Simulator Project" /> - <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="398" SizeHeight="10" /> + <Label Id="caption" LocationX="10" LocationY="2" SizeWidth="489" SizeHeight="30" Text="Combat Simulator Project" /> + <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="489" SizeHeight="10" /> - <Label Id="message" LocationX="10" LocationY="55" SizeWidth="398" SizeHeight="30" Text="Combat Simulator Project" /> + <Label Id="message" LocationX="10" LocationY="55" SizeWidth="489" SizeHeight="30" Text="Combat Simulator Project" /> - <Button Id="ok" LocationX="140" LocationY="150" SizeWidth="120" SizeHeight="35" Text="OK" /> + <Button Id="ok" LocationX="170" LocationY="150" SizeWidth="120" SizeHeight="35" Text="OK" /> </Controls> </MultiControlContainer> </Control> |
Author: nsmoooose Date: 2007-04-30 14:00:10 -0700 (Mon, 30 Apr 2007) New Revision: 2090 Added: branches/python_bindings_for_ui/csp/data/ui/localization/english/global.xml branches/python_bindings_for_ui/csp/data/ui/localization/svenska/ branches/python_bindings_for_ui/csp/data/ui/localization/svenska/global.xml Removed: branches/python_bindings_for_ui/csp/cspsim/swig/windows.i branches/python_bindings_for_ui/csp/data/ui/localization/swedish/ Modified: branches/python_bindings_for_ui/csp/cspsim/cspsim.i branches/python_bindings_for_ui/csp/cspsim/swig/Screens.i branches/python_bindings_for_ui/csp/cspsim/wf/ControlGeometryBuilder.cpp branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.h branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.cpp branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.h branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Window.h branches/python_bindings_for_ui/csp/data/ui/themes/default/main_menu.xml branches/python_bindings_for_ui/csp/data/ui/themes/default/options.xml branches/python_bindings_for_ui/csp/data/ui/themes/default/styles.xml branches/python_bindings_for_ui/csp/data/ui/themes/experimental/main_menu.xml branches/python_bindings_for_ui/csp/data/ui/window_document.xsd Log: Added some features: * StringTableInclude tags are now handled when loading user interface from xml files. * Removed windows.i since it isn't in use anymore. * Added swedish translation to the game. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2090 Diff omitted (25947 bytes). |
Author: nsmoooose Date: 2007-04-29 10:28:48 -0700 (Sun, 29 Apr 2007) New Revision: 2089 Modified: branches/python_bindings_for_ui/csp/cspsim/SConscript branches/python_bindings_for_ui/csp/cspsim/config/Display.cpp branches/python_bindings_for_ui/csp/cspsim/config/Display.h branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i branches/python_bindings_for_ui/csp/cspsim/swig/Config.i branches/python_bindings_for_ui/csp/data/ui/options.py branches/python_bindings_for_ui/csp/data/ui/themes/default/options.xml branches/python_bindings_for_ui/csp/data/ui/themes/experimental/options.xml branches/python_bindings_for_ui/csp/data/ui/themes/red/options.xml Log: All display modes is now automatically enumerated in the options window. No resolution below 640x480 is displayed. Removed hard coded resolutions in xml files. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2089 Modified: branches/python_bindings_for_ui/csp/cspsim/SConscript =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/SConscript 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/cspsim/SConscript 2007-04-29 17:28:48 UTC (rev 2089) @@ -471,7 +471,7 @@ '@cspsim/battlefield', '@cspsim/config', ], - deps = ['csplib'], + deps = ['csplib', 'sdl'], aliases = 'all', SHLIBPREFIX = '_') Modified: branches/python_bindings_for_ui/csp/cspsim/config/Display.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/config/Display.cpp 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/cspsim/config/Display.cpp 2007-04-29 17:28:48 UTC (rev 2089) @@ -22,6 +22,8 @@ * **/ +#include <sstream> +#include <SDL/SDL.h> #include <csp/cspsim/config/Display.h> CSP_NAMESPACE @@ -61,5 +63,32 @@ m_Fullscreen = fullscreen; } +StringVector Display::enumerateDisplayModes() { + StringVector displayModes; + + /* Get available fullscreen/hardware modes */ + Uint32 flags = SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN; + SDL_Rect **modes=SDL_ListModes(NULL, flags); + + /* Check is there are any modes available */ + if(modes == (SDL_Rect **)0){ + return displayModes; + } + + /* Check if or resolution is restricted */ + if(modes != (SDL_Rect **)-1){ + for(int i=0;modes[i];++i) { + // Only display resolutions higher than 640x480 + if(modes[i]->w < 640 || modes[i]->h < 480) { + continue; + } + std::stringstream textStream; + textStream << modes[i]->w << 'x' << modes[i]->h; + displayModes.push_back(textStream.str()); + } + } + return displayModes; } + +} CSP_NAMESPACE_END Modified: branches/python_bindings_for_ui/csp/cspsim/config/Display.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/config/Display.h 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/cspsim/config/Display.h 2007-04-29 17:28:48 UTC (rev 2089) @@ -33,6 +33,8 @@ namespace config { +typedef std::vector<std::string> StringVector; + class CSPSIM_EXPORT Display: public Referenced { public: Display(int width, int height, bool fullscreen); @@ -47,6 +49,8 @@ virtual bool getFullscreen(); virtual void setFullscreen(bool fullscreen); + virtual StringVector enumerateDisplayModes(); + virtual Display* clone(); private: int m_Width; Modified: branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i 2007-04-29 17:28:48 UTC (rev 2089) @@ -48,7 +48,7 @@ namespace csp { -%newobject CSPSim::getConfiguration(); +// %newobject CSPSim::getConfiguration(); class CSPSim { public: Modified: branches/python_bindings_for_ui/csp/cspsim/swig/Config.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/swig/Config.i 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/cspsim/swig/Config.i 2007-04-29 17:28:48 UTC (rev 2089) @@ -39,6 +39,8 @@ %newobject Display::clone(); +typedef std::vector<std::string> StringVector; + class Display { public: Display(int width, int height, bool fullscreen); @@ -53,11 +55,11 @@ virtual bool getFullscreen(); virtual void setFullscreen(bool fullscreen); + virtual StringVector enumerateDisplayModes(); + virtual Display* clone(); }; -typedef std::vector<std::string> StringVector; - %newobject UserInterface::clone(); class UserInterface { Modified: branches/python_bindings_for_ui/csp/data/ui/options.py =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/options.py 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/data/ui/options.py 2007-04-29 17:28:48 UTC (rev 2089) @@ -50,12 +50,14 @@ cancelButton = self.getById('cancel') if cancelButton != None: self.connectToClickSignal(cancelButton, self.cancel_Click) + + # Class with usefull functions to handle listboxes. + listBoxManager = ListBoxManager() # List all availible themes in the corresponding listbox and select the current one. self.themeListBox = self.getById('theme') if self.themeListBox != None: themes = self.configuration.getUserInterface().enumerateThemes() - listBoxManager = ListBoxManager() listBoxManager.addListToControl(self.themeListBox, themes) self.themeListBox.setSelectedItemByText(self.configuration.getUserInterface().getTheme()) self.connectToSelectedItemChangedSignal(self.themeListBox, self.theme_Changed) @@ -72,6 +74,9 @@ self.resolutionListBox = self.getById('resolution') if self.resolutionListBox != None: currentResolution = str(self.configuration.getDisplay().getWidth()) + 'x' + str(self.configuration.getDisplay().getHeight()) + displayModes = self.configuration.getDisplay().enumerateDisplayModes() + listBoxManager = ListBoxManager() + listBoxManager.addListToControl(self.resolutionListBox, displayModes) self.resolutionListBox.setSelectedItemByText(currentResolution) self.connectToSelectedItemChangedSignal(self.resolutionListBox, self.resolution_Changed) Modified: branches/python_bindings_for_ui/csp/data/ui/themes/default/options.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/themes/default/options.xml 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/data/ui/themes/default/options.xml 2007-04-29 17:28:48 UTC (rev 2089) @@ -12,15 +12,7 @@ <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="438" SizeHeight="10" /> <Label Text="Resolution:" LocationX="25" LocationY="55" SizeHeight="25" /> - <ListBox Id="resolution" LocationX="145" LocationY="55" SizeWidth="250" SizeHeight="140"> - <Items> - <Item Text="640x480" SizeHeight="30" /> - <Item Text="800x600" SizeHeight="30" /> - <Item Text="1024x768" SizeHeight="30" /> - <Item Text="1280x1024" SizeHeight="30" /> - <Item Text="1920x1200" SizeHeight="30" /> - </Items> - </ListBox> + <ListBox Id="resolution" LocationX="145" LocationY="55" SizeWidth="250" SizeHeight="140" /> <CheckBox Id="fullscreen" LocationX="25" LocationY="195" SizeWidth="150" SizeHeight="30" Text="Fullscreen" /> Modified: branches/python_bindings_for_ui/csp/data/ui/themes/experimental/options.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/themes/experimental/options.xml 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/data/ui/themes/experimental/options.xml 2007-04-29 17:28:48 UTC (rev 2089) @@ -12,15 +12,7 @@ <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="569" SizeHeight="10" /> <Label Text="Resolution:" LocationX="10" LocationY="55" SizeHeight="25" /> - <ListBox Id="resolution" LocationX="20" LocationY="83" SizeWidth="145" SizeHeight="230"> - <Items> - <Item Text="640x480" SizeHeight="30" /> - <Item Text="800x600" SizeHeight="30" /> - <Item Text="1024x768" SizeHeight="30" /> - <Item Text="1280x1024" SizeHeight="30" /> - <Item Text="1920x1200" SizeHeight="30" /> - </Items> - </ListBox> + <ListBox Id="resolution" LocationX="20" LocationY="83" SizeWidth="145" SizeHeight="230" /> <CheckBox Id="fullscreen" LocationX="10" LocationY="330" SizeWidth="150" SizeHeight="30" Text="Fullscreen" /> Modified: branches/python_bindings_for_ui/csp/data/ui/themes/red/options.xml =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/themes/red/options.xml 2007-04-29 11:09:13 UTC (rev 2088) +++ branches/python_bindings_for_ui/csp/data/ui/themes/red/options.xml 2007-04-29 17:28:48 UTC (rev 2089) @@ -12,14 +12,7 @@ <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="438" SizeHeight="10" /> <Label Text="Resolution:" LocationX="25" LocationY="55" SizeHeight="25" /> - <ListBox Id="resolution" LocationX="145" LocationY="55" SizeWidth="250" SizeHeight="140"> - <Items> - <Item Text="640x480" SizeHeight="30" /> - <Item Text="800x600" SizeHeight="30" /> - <Item Text="1024x768" SizeHeight="30" /> - <Item Text="1280x1024" SizeHeight="30" /> - </Items> - </ListBox> + <ListBox Id="resolution" LocationX="145" LocationY="55" SizeWidth="250" SizeHeight="140" /> <CheckBox Id="fullscreen" LocationX="25" LocationY="195" SizeWidth="150" SizeHeight="30" Text="Fullscreen" /> |
From: <sv...@ww...> - 2007-04-29 11:09:21
|
Author: nsmoooose Date: 2007-04-29 04:09:13 -0700 (Sun, 29 Apr 2007) New Revision: 2088 Modified: branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp branches/python_bindings_for_ui/csp/cspsim/CSPSim.h branches/python_bindings_for_ui/csp/cspsim/cspsim.i branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i branches/python_bindings_for_ui/csp/cspsim/swig/Config.i branches/python_bindings_for_ui/csp/cspsim/swig/wf.i branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.cpp branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h branches/python_bindings_for_ui/csp/data/ui/startup.py Log: It is now possible to change the configuration again using the python scripted window. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2088 Modified: branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp 2007-04-29 11:09:13 UTC (rev 2088) @@ -183,6 +183,10 @@ m_ConfigurationChanged->emit(data.get()); } +wf::Signal* CSPSim::getConfigurationChangedSignal() { + return m_ConfigurationChanged.get(); +} + void CSPSim::setActiveObject(Ref<DynamicObject> object) { if (object.valid()) { CSPLOG(INFO, APP) << "Setting active object to " << *object; Modified: branches/python_bindings_for_ui/csp/cspsim/CSPSim.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/CSPSim.h 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/CSPSim.h 2007-04-29 11:09:13 UTC (rev 2088) @@ -105,6 +105,7 @@ virtual void quit(); virtual void cleanup(); + virtual wf::Signal* getConfigurationChangedSignal(); virtual config::Configuration* getConfiguration(); virtual void setConfiguration(config::Configuration* config); @@ -133,7 +134,7 @@ DataManager & getDataManager() { return *m_DataManager; } Atmosphere const * getAtmosphere() const { return m_Atmosphere.get(); } - + protected: void initSim(); Modified: branches/python_bindings_for_ui/csp/cspsim/cspsim.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/cspsim.i 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/cspsim.i 2007-04-29 11:09:13 UTC (rev 2088) @@ -36,6 +36,6 @@ %include <csp/cspsim/swig/Config.i> %include <csp/cspsim/swig/VirtualScene.i> %include <csp/cspsim/swig/Screens.i> +%include <csp/cspsim/swig/wf.i> %include <csp/cspsim/swig/CSPSim.i> -%include <csp/cspsim/swig/wf.i> %include <csp/cspsim/swig/windows.i> Modified: branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i 2007-04-29 11:09:13 UTC (rev 2088) @@ -48,6 +48,8 @@ namespace csp { +%newobject CSPSim::getConfiguration(); + class CSPSim { public: static csp::CSPSim *theSim; @@ -68,7 +70,9 @@ virtual config::Configuration* getConfiguration(); virtual void setConfiguration(config::Configuration* config); + virtual wf::Signal* getConfigurationChangedSignal(); + SDL_Surface * getSDLScreen(); csp::SimDate & getCurrentTime(); csp::SimTime const & getFrameRate() const; Modified: branches/python_bindings_for_ui/csp/cspsim/swig/Config.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/swig/Config.i 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/swig/Config.i 2007-04-29 11:09:13 UTC (rev 2088) @@ -37,6 +37,8 @@ %feature("ref") UserInterface "$this->_incref();" %feature("unref") UserInterface "$this->_decref();" +%newobject Display::clone(); + class Display { public: Display(int width, int height, bool fullscreen); @@ -56,6 +58,8 @@ typedef std::vector<std::string> StringVector; +%newobject UserInterface::clone(); + class UserInterface { public: UserInterface(const std::string& language, const std::string& theme); @@ -73,6 +77,10 @@ virtual StringVector enumerateLanguages(); }; +%newobject Configuration::getDisplay(); +%newobject Configuration::getUserInterface(); +%newobject Configuration::clone(); + class Configuration { public: Configuration(Display* display, UserInterface* userInterface); Modified: branches/python_bindings_for_ui/csp/cspsim/swig/wf.i =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/swig/wf.i 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/swig/wf.i 2007-04-29 11:09:13 UTC (rev 2088) @@ -222,6 +222,7 @@ public: virtual void show(Window* window); virtual void close(Window* window); + virtual void closeAll(); }; class Window : public SingleControlContainer { Modified: branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.cpp 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.cpp 2007-04-29 11:09:13 UTC (rev 2088) @@ -229,6 +229,11 @@ myWindow->dispose(); } +void WindowManager::closeAll() { + closeByType<Window>(); +} + + Size WindowManager::getScreenSize() const { return Size(CSPSim::theSim->getSDLScreen()->w, CSPSim::theSim->getSDLScreen()->h); } Modified: branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h 2007-04-29 11:09:13 UTC (rev 2088) @@ -59,6 +59,7 @@ virtual void show(Window* window); virtual void close(Window* window); + virtual void closeAll(); virtual Size getScreenSize() const; Modified: branches/python_bindings_for_ui/csp/data/ui/startup.py =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/startup.py 2007-04-27 11:23:21 UTC (rev 2087) +++ branches/python_bindings_for_ui/csp/data/ui/startup.py 2007-04-29 11:09:13 UTC (rev 2088) @@ -45,9 +45,9 @@ def run(self): # We want to connect to the configuration changed event. - #from csp.data.ui.utils import SlotProxy - #self.configurationChangedSlot = SlotProxy(self.configuration_Changed) - #self.cspsim.getConfigurationChangedSignal().connect(self.configurationChangedSlot) + from csp.data.ui.utils import SlotProxy + self.configurationChangedSlot = SlotProxy(self.configuration_Changed) + self.cspsim.getConfigurationChangedSignal().connect(self.configurationChangedSlot) self.cspsim.displayMenuScreen() self.menuScreen = self.cspsim.getCurrentScreen() @@ -58,4 +58,7 @@ self.cspsim.run() def configuration_Changed(self): - print 'configuration changed' \ No newline at end of file + self.windowManager.closeAll() + self.configuration = self.cspsim.getConfiguration() + self.displayDesktop() + self.displayMainMenu() |
From: <sv...@ww...> - 2007-04-27 11:23:33
|
Author: nsmoooose Date: 2007-04-27 04:23:21 -0700 (Fri, 27 Apr 2007) New Revision: 2087 Modified: branches/python_bindings_for_ui/csp/cspsim/wf/ControlGeometryBuilder.cpp branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.cpp branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.h branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp Log: Renamed the resource locater to ImageResourceLocator. Added a StringResourceLocator. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2087 Modified: branches/python_bindings_for_ui/csp/cspsim/wf/ControlGeometryBuilder.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-04-25 11:18:30 UTC (rev 2086) +++ branches/python_bindings_for_ui/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-04-27 11:23:21 UTC (rev 2087) @@ -231,7 +231,7 @@ // Try to locate the resource using a resource locator class. // The resource can be located in the theme directory or in // the datapath. - Ref<WindowResourceLocator> resourceLocator = new WindowResourceLocator(window); + Ref<ResourceLocator> resourceLocator = new ImageResourceLocator(window); std::string filePath = *style.backgroundImage; if(resourceLocator->locateResource(filePath)) { image = osgDB::readImageFile(filePath); Modified: branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.cpp 2007-04-25 11:18:30 UTC (rev 2086) +++ branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.cpp 2007-04-27 11:23:21 UTC (rev 2087) @@ -31,10 +31,10 @@ namespace wf { -WindowResourceLocator::WindowResourceLocator(const Window* window) : m_Window(window) { +ImageResourceLocator::ImageResourceLocator(const Window* window) : m_Window(window) { } -bool WindowResourceLocator::locateResource(std::string& file) const { +bool ImageResourceLocator::locateResource(std::string& file) const { // Build up the path to the file in order to be able to read it. std::string themesPath = ospath::join(getUIPath(), "themes"); std::string themePath = ospath::join(themesPath, m_Window->getTheme()); @@ -60,6 +60,35 @@ return false; } +StringResourceLocator::StringResourceLocator(const Window* window) : m_Window(window) { +} + +bool StringResourceLocator::locateResource(std::string& file) const { + // Build up the path to the file in order to be able to read it. + std::string themesPath = ospath::join(getUIPath(), "themes"); + std::string themePath = ospath::join(themesPath, m_Window->getTheme()); + std::string filePath = ospath::join(themePath, file); + + // Test to see if the file exists at all? + if(ospath::exists(filePath.c_str())) { + file = filePath; + return true; + } + else { + // As a secondary solution we look for the file in the specialized + // language directory. + std::string languagePath = ospath::join(getUIPath(), getUILanguage()); + std::string filePath = ospath::join(languagePath, file); + if(ospath::exists(filePath.c_str())) { + file = filePath; + return true; + } + } + + // Didn't find any file that is matching the resource asked for. + return false; +} + } // namespace wf CSP_NAMESPACE_END Modified: branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.h 2007-04-25 11:18:30 UTC (rev 2086) +++ branches/python_bindings_for_ui/csp/cspsim/wf/ResourceLocator.h 2007-04-27 11:23:21 UTC (rev 2087) @@ -40,9 +40,9 @@ virtual bool locateResource(std::string& file) const = 0; }; -class WindowResourceLocator : public ResourceLocator { +class ImageResourceLocator : public ResourceLocator { public: - WindowResourceLocator(const Window* window); + ImageResourceLocator(const Window* window); virtual bool locateResource(std::string& file) const; @@ -50,6 +50,16 @@ Ref<const Window> m_Window; }; +class StringResourceLocator : public ResourceLocator { +public: + StringResourceLocator(const Window* window); + + virtual bool locateResource(std::string& file) const; + +private: + Ref<const Window> m_Window; +}; + } // namespace wf CSP_NAMESPACE_END Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp 2007-04-25 11:18:30 UTC (rev 2086) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp 2007-04-27 11:23:21 UTC (rev 2087) @@ -216,7 +216,7 @@ std::string includeNodeName = includeNode.getName(); if(includeNodeName == "StringTableInclude") { Ref<StringResourceManager> loadedResources = new StringResourceManager; - Ref<ResourceLocator> resourceLocator = new WindowResourceLocator(window); + Ref<ResourceLocator> resourceLocator = new ImageResourceLocator(window); loadedResources->loadFromFile(includeFile, resourceLocator.get()); window->getStringResourceManager()->merge(loadedResources.get()); } |
From: <sv...@ww...> - 2007-04-25 11:18:39
|
Author: nsmoooose Date: 2007-04-25 04:18:30 -0700 (Wed, 25 Apr 2007) New Revision: 2086 Modified: branches/python_bindings_for_ui/csp/bin/sim.ini branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp branches/python_bindings_for_ui/csp/cspsim/CSPSim.h branches/python_bindings_for_ui/csp/data/ui/startup.py Log: Configuration is stored and configurationChanged signal is sent. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2086 Modified: branches/python_bindings_for_ui/csp/bin/sim.ini =================================================================== --- branches/python_bindings_for_ui/csp/bin/sim.ini 2007-04-23 19:35:07 UTC (rev 2085) +++ branches/python_bindings_for_ui/csp/bin/sim.ini 2007-04-25 11:18:30 UTC (rev 2086) @@ -64,5 +64,5 @@ [UI] -ThemeName = default -Language = english +ThemeName = experimental +Language = swedish Modified: branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp 2007-04-23 19:35:07 UTC (rev 2085) +++ branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp 2007-04-25 11:18:30 UTC (rev 2086) @@ -59,6 +59,7 @@ #include <csp/cspsim/stores/StoresDatabase.h> +#include <csp/cspsim/wf/SignalData.h> #include <csp/cspsim/windows/MenuScreen.h> #include <csp/csplib/data/GeoPos.h> @@ -107,6 +108,7 @@ CSPSim *CSPSim::theSim = 0; CSPSim::CSPSim(): + m_ConfigurationChanged(new wf::Signal), m_DataManager(new DataManager), m_Atmosphere(new Atmosphere), //--m_RenderSurface(new Producer::RenderSurface), @@ -154,14 +156,31 @@ void CSPSim::setConfiguration(config::Configuration* config) { - // TODO Check if the new configuration can be set correctly. + // TODO Check if the new configuration can be set correctly. Things to check: + // * Can the new screen resolution be set according my graphics driver? - // TODO Apply the configuration - - // Set the new configuration. + // Apply the configuration. First we start with assigning the configuration object. m_Configuration = config; + + // Set all display settings. + Ref<config::Display> display = config->getDisplay(); + ScreenSettings screenSettings = getScreenSettings(); + screenSettings.width = display->getWidth(); + screenSettings.height = display->getHeight(); + screenSettings.fullScreen = display->getFullscreen(); + setScreenSettings(screenSettings); + + // Set all UI settings. + Ref<config::UserInterface> userInterface = config->getUserInterface(); + setUITheme(userInterface->getTheme()); + setUILanguage(userInterface->getLanguage()); + + // Save the new configuration to persistent storage. + // Configuration changes is stored on successfull quit of the application. - // TODO Save the new configuration to persistent storage. + // Trigger the configuration changed signal to inform any listener about the change. + Ref<wf::SignalData> data = new wf::SignalData; + m_ConfigurationChanged->emit(data.get()); } void CSPSim::setActiveObject(Ref<DynamicObject> object) { Modified: branches/python_bindings_for_ui/csp/cspsim/CSPSim.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/CSPSim.h 2007-04-23 19:35:07 UTC (rev 2085) +++ branches/python_bindings_for_ui/csp/cspsim/CSPSim.h 2007-04-25 11:18:30 UTC (rev 2086) @@ -59,6 +59,7 @@ #include <csp/csplib/util/Ref.h> #include <csp/csplib/util/ScopedPointer.h> #include <csp/csplib/data/Date.h> +#include <csp/cspsim/wf/Signal.h> #include <osg/ref_ptr> @@ -143,6 +144,7 @@ void doStartupScript(); private: + Ref<wf::Signal> m_ConfigurationChanged; SDL_Surface *m_SDLScreen; SDL_Joystick* m_SDLJoystick; Modified: branches/python_bindings_for_ui/csp/data/ui/startup.py =================================================================== --- branches/python_bindings_for_ui/csp/data/ui/startup.py 2007-04-23 19:35:07 UTC (rev 2085) +++ branches/python_bindings_for_ui/csp/data/ui/startup.py 2007-04-25 11:18:30 UTC (rev 2086) @@ -44,6 +44,11 @@ self.windowManager.show(self.mainMenuWindow) def run(self): + # We want to connect to the configuration changed event. + #from csp.data.ui.utils import SlotProxy + #self.configurationChangedSlot = SlotProxy(self.configuration_Changed) + #self.cspsim.getConfigurationChangedSignal().connect(self.configurationChangedSlot) + self.cspsim.displayMenuScreen() self.menuScreen = self.cspsim.getCurrentScreen() self.windowManager = self.menuScreen.getWindowManager() @@ -51,3 +56,6 @@ self.displayDesktop() self.displayMainMenu() self.cspsim.run() + + def configuration_Changed(self): + print 'configuration changed' \ No newline at end of file |
From: <sv...@ww...> - 2007-04-23 19:35:16
|
Author: nsmoooose Date: 2007-04-23 12:35:07 -0700 (Mon, 23 Apr 2007) New Revision: 2085 Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Window.h branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h Log: Window is now using a weak reference to the window manager. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2085 Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp 2007-04-23 18:15:47 UTC (rev 2084) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp 2007-04-23 19:35:07 UTC (rev 2085) @@ -32,8 +32,7 @@ namespace wf { -Window::Window() : - m_WindowManager(NULL), m_StringResources(new StringResourceManager) { +Window::Window() : m_StringResources(new StringResourceManager) { } Window::~Window() { @@ -51,7 +50,7 @@ } WindowManager* Window::getWindowManager() { - return m_WindowManager; + return m_WindowManager.get(); } void Window::setWindowManager(WindowManager* manager) { @@ -73,7 +72,7 @@ } void Window::close() { - if(m_WindowManager != NULL) { + if(m_WindowManager.valid()) { m_WindowManager->close(this); } } @@ -121,7 +120,7 @@ } void Window::centerWindow() { - if(m_WindowManager == NULL) { + if(!m_WindowManager.valid()) { return; } @@ -139,7 +138,7 @@ } void Window::maximizeWindow() { - if(m_WindowManager == NULL) { + if(!m_WindowManager.valid()) { return; } Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Window.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Window.h 2007-04-23 18:15:47 UTC (rev 2084) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Window.h 2007-04-23 19:35:07 UTC (rev 2085) @@ -27,6 +27,7 @@ #include <map> #include <csp/csplib/util/Ref.h> +#include <csp/csplib/util/WeakRef.h> #include <csp/cspsim/wf/SingleControlContainer.h> #include <csp/cspsim/wf/StringResourceManager.h> @@ -81,7 +82,7 @@ } private: - WindowManager* m_WindowManager; + WeakRef<WindowManager> m_WindowManager; std::string m_Theme; Ref<StringResourceManager> m_StringResources; Modified: branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h 2007-04-23 18:15:47 UTC (rev 2084) +++ branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.h 2007-04-23 19:35:07 UTC (rev 2085) @@ -27,6 +27,7 @@ #include <csp/csplib/util/Ref.h> #include <csp/csplib/util/Referenced.h> +#include <csp/csplib/util/WeakReferenced.h> #include <csp/cspsim/wf/Window.h> #include <osg/ref_ptr> @@ -47,7 +48,7 @@ class Serialization; -class CSPSIM_EXPORT WindowManager : public Referenced { +class CSPSIM_EXPORT WindowManager : public Referenced, public WeakReferenced { public: WindowManager(osgUtil::SceneView* view); WindowManager(); |
From: <sv...@ww...> - 2007-04-23 18:15:55
|
Author: nsmoooose Date: 2007-04-23 11:15:47 -0700 (Mon, 23 Apr 2007) New Revision: 2084 Modified: branches/python_bindings_for_ui/csp/cspsim/swig/wf.i branches/python_bindings_for_ui/csp/cspsim/wf/CheckBox.cpp branches/python_bindings_for_ui/csp/cspsim/wf/CheckBox.h branches/python_bindings_for_ui/csp/cspsim/wf/ListBox.cpp branches/python_bindings_for_ui/csp/cspsim/wf/ListBox.h branches/python_bindings_for_ui/csp/data/ui/options.py branches/python_bindings_for_ui/csp/data/ui/utils.py Log: Added signal for selected item changed to ListBox control. Added signal for checked changed to CheckBox control. options.py file is listening the above events and setting the equivalent configuration properties. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2084 Diff omitted (11160 bytes). |
From: <sv...@ww...> - 2007-04-20 22:13:38
|
Author: nsmoooose Date: 2007-04-20 15:13:25 -0700 (Fri, 20 Apr 2007) New Revision: 2083 Modified: branches/python_bindings_for_ui/csp/cspsim/config/UserInterface.cpp branches/python_bindings_for_ui/csp/cspsim/config/UserInterface.h branches/python_bindings_for_ui/csp/cspsim/swig/Config.i branches/python_bindings_for_ui/csp/cspsim/swig/wf.i branches/python_bindings_for_ui/csp/cspsim/wf/Control.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Control.h branches/python_bindings_for_ui/csp/cspsim/wf/ListBoxItem.cpp branches/python_bindings_for_ui/csp/cspsim/wf/WindowManager.cpp branches/python_bindings_for_ui/csp/data/ui/options.py branches/python_bindings_for_ui/csp/data/ui/utils.py Log: Added methods to use for enumerating themes and languages. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2083 Diff omitted (13695 bytes). |
From: <sv...@ww...> - 2007-04-20 11:18:43
|
Author: nsmoooose Date: 2007-04-20 04:18:35 -0700 (Fri, 20 Apr 2007) New Revision: 2082 Added: branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.cpp branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.h Modified: branches/python_bindings_for_ui/csp/bin/sim.ini branches/python_bindings_for_ui/csp/cspsim/SConscript branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Window.h Log: Added stubs for a string resource manager. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2082 Modified: branches/python_bindings_for_ui/csp/bin/sim.ini =================================================================== --- branches/python_bindings_for_ui/csp/bin/sim.ini 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/bin/sim.ini 2007-04-20 11:18:35 UTC (rev 2082) @@ -43,8 +43,8 @@ AirBubbleRadius = 80000 VisualRadius = 40000 Theater = sim:theater.balkan +Date = 2006-07-10 02:00:00 ;Date = 2006-07-10 23:00:00 -Date = 2006-07-10 02:00:00 ;Date = 2004-05-09 12:00:00 ;Date = 2006-07-10 12:00:00 ; balkan theater (demeter) @@ -62,3 +62,7 @@ IncomingBandwidth = 20000 OutgoingBandwidth = 20000 + +[UI] +ThemeName = default +Language = english Modified: branches/python_bindings_for_ui/csp/cspsim/SConscript =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/SConscript 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/SConscript 2007-04-20 11:18:35 UTC (rev 2082) @@ -410,6 +410,8 @@ 'wf/SingleControlContainer.h', 'wf/Slot.cpp', 'wf/Slot.h', + 'wf/StringResourceManager.cpp', + 'wf/StringResourceManager.h', 'wf/Style.h', 'wf/StyleBuilder.cpp', 'wf/StyleBuilder.h', Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp 2007-04-20 11:18:35 UTC (rev 2082) @@ -34,6 +34,7 @@ #include <csp/cspsim/wf/Label.h> #include <csp/cspsim/wf/ListBox.h> #include <csp/cspsim/wf/MultiControlContainer.h> +#include <csp/cspsim/wf/ResourceLocator.h> #include <csp/cspsim/wf/Serialization.h> #include <csp/cspsim/wf/Tab.h> #include <csp/cspsim/wf/TableControlContainer.h> @@ -211,20 +212,29 @@ } std::string includeFile = includeNode.getText(0); - std::string includeFilePath = ospath::join(themePath, includeFile); - if(!ospath::exists(includeFilePath)) { - CSPLOG(ERROR, APP) << "UI Include document not found."; - continue; + + std::string includeNodeName = includeNode.getName(); + if(includeNodeName == "StringTableInclude") { + Ref<StringResourceManager> loadedResources = new StringResourceManager; + Ref<ResourceLocator> resourceLocator = new WindowResourceLocator(window); + loadedResources->loadFromFile(includeFile, resourceLocator.get()); + window->getStringResourceManager()->merge(loadedResources.get()); } - - XMLNode includeDocument = XMLNode::parseFile(includeFilePath.c_str()); - XMLNode namedStylesNode = includeDocument.selectSingleNode("StyleDocument/NamedStyles"); - NamedStyleMap styles; - ToValue(namedStylesNode, "", &styles); - - NamedStyleMap::iterator style = styles.begin(); - for(;style != styles.end();++style) { - window->addNamedStyle(style->first, style->second); + else if(includeNodeName == "StyleInclude") { + std::string includeFilePath = ospath::join(themePath, includeFile); + if(!ospath::exists(includeFilePath)) { + CSPLOG(ERROR, APP) << "UI Include document not found."; + continue; + } + XMLNode includeDocument = XMLNode::parseFile(includeFilePath.c_str()); + XMLNode namedStylesNode = includeDocument.selectSingleNode("StyleDocument/NamedStyles"); + NamedStyleMap styles; + ToValue(namedStylesNode, "", &styles); + + NamedStyleMap::iterator style = styles.begin(); + for(;style != styles.end();++style) { + window->addNamedStyle(style->first, style->second); + } } } } Added: branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.cpp 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.cpp 2007-04-20 11:18:35 UTC (rev 2082) @@ -0,0 +1,49 @@ +// Combat Simulator Project +// Copyright (C) 2002 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file StringResourceManager.cpp + * + **/ + +#include <csp/cspsim/wf/StringResourceManager.h> + +CSP_NAMESPACE + +namespace wf { + +StringResourceManager::StringResourceManager() { +} + +StringResourceManager::~StringResourceManager() { +} + +void StringResourceManager::loadFromFile(const std::string& fileName, ResourceLocator* resourceLocator) { +} + +std::string StringResourceManager::getString(const std::string& key) const { + return ""; +} + +void StringResourceManager::merge(StringResourceManager* stringsToMerge) { +} + +} // namespace wf + +CSP_NAMESPACE_END Added: branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.h 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/wf/StringResourceManager.h 2007-04-20 11:18:35 UTC (rev 2082) @@ -0,0 +1,58 @@ +// Combat Simulator Project +// Copyright (C) 2002 The Combat Simulator Project +// http://csp.sourceforge.net +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +/** + * @file StringResourceManager.h + * + **/ + +#ifndef __CSPSIM_WF_STRINGRESOURCEMANAGER_H__ +#define __CSPSIM_WF_STRINGRESOURCEMANAGER_H__ + +#include <map> +#include <csp/csplib/util/Referenced.h> +#include <csp/cspsim/Export.h> + +CSP_NAMESPACE + +namespace wf { + +class ResourceLocator; + +class CSPSIM_EXPORT StringResourceManager : public Referenced { +public: + StringResourceManager(); + virtual ~StringResourceManager(); + + virtual void loadFromFile(const std::string& fileName, ResourceLocator* resourceLocator); + + virtual std::string getString(const std::string& key) const; + virtual void merge(StringResourceManager* stringsToMerge); + +private: + typedef std::map<std::string, std::string> StringMap; + StringMap m_Values; +}; + +} // namespace wf + +CSP_NAMESPACE_END + +#endif // __CSPSIM_WF_STRINGRESOURCEMANAGER_H__ + Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Window.cpp 2007-04-20 11:18:35 UTC (rev 2082) @@ -33,7 +33,7 @@ namespace wf { Window::Window() : - m_WindowManager(NULL) { + m_WindowManager(NULL), m_StringResources(new StringResourceManager) { } Window::~Window() { @@ -102,6 +102,10 @@ return m_Theme; } +StringResourceManager* Window::getStringResourceManager() { + return m_StringResources.get(); +} + optional<Style> Window::getNamedStyle(const std::string& name) const { optional<Style> style; // Assign the style to the optional if it exists in the map. Modified: branches/python_bindings_for_ui/csp/cspsim/wf/Window.h =================================================================== --- branches/python_bindings_for_ui/csp/cspsim/wf/Window.h 2007-04-18 19:07:22 UTC (rev 2081) +++ branches/python_bindings_for_ui/csp/cspsim/wf/Window.h 2007-04-20 11:18:35 UTC (rev 2082) @@ -28,6 +28,7 @@ #include <map> #include <csp/csplib/util/Ref.h> #include <csp/cspsim/wf/SingleControlContainer.h> +#include <csp/cspsim/wf/StringResourceManager.h> namespace osg { class Group; @@ -71,6 +72,8 @@ virtual void setTheme(const std::string& theme); virtual std::string getTheme() const; + virtual StringResourceManager* getStringResourceManager(); + template<class Archive> void serialize(Archive & ar) { SingleControlContainer::serialize(ar); @@ -80,6 +83,7 @@ private: WindowManager* m_WindowManager; std::string m_Theme; + Ref<StringResourceManager> m_StringResources; NamedStyleMap m_Styles; }; |
From: <sv...@ww...> - 2007-04-18 19:07:30
|
Author: nsmoooose Date: 2007-04-18 12:07:22 -0700 (Wed, 18 Apr 2007) New Revision: 2081 Added: branches/python_bindings_for_ui/csp/data/ui/options.py branches/python_bindings_for_ui/csp/data/ui/utils.py Modified: branches/python_bindings_for_ui/csp/cspsim/SConscript branches/python_bindings_for_ui/csp/cspsim/swig/wf.i branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Serialization.h branches/python_bindings_for_ui/csp/data/ui/mainmenu.py branches/python_bindings_for_ui/csp/data/ui/startup.py Log: Added more python implementations for user interface framework. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2081 Diff omitted (11053 bytes). |
Author: nsmoooose Date: 2007-04-15 03:32:27 -0700 (Sun, 15 Apr 2007) New Revision: 2080 Added: branches/python_bindings_for_ui/csp/cspsim/config/ branches/python_bindings_for_ui/csp/cspsim/config/Configuration.cpp branches/python_bindings_for_ui/csp/cspsim/config/Configuration.h branches/python_bindings_for_ui/csp/cspsim/config/Display.cpp branches/python_bindings_for_ui/csp/cspsim/config/Display.h branches/python_bindings_for_ui/csp/cspsim/config/UserInterface.cpp branches/python_bindings_for_ui/csp/cspsim/config/UserInterface.h branches/python_bindings_for_ui/csp/cspsim/wf/Signal.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Signal.h branches/python_bindings_for_ui/csp/cspsim/wf/SignalData.cpp branches/python_bindings_for_ui/csp/cspsim/wf/SignalData.h branches/python_bindings_for_ui/csp/cspsim/wf/Slot.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Slot.h branches/python_bindings_for_ui/csp/data/__init__.py branches/python_bindings_for_ui/csp/data/ui/__init__.py branches/python_bindings_for_ui/csp/data/ui/mainmenu.py branches/python_bindings_for_ui/csp/data/ui/startup.py branches/python_bindings_for_ui/csp/doc/ branches/python_bindings_for_ui/csp/doc/window_framework.dot branches/python_bindings_for_ui/csp/doc/window_framework.png Modified: branches/python_bindings_for_ui/csp/SConstruct branches/python_bindings_for_ui/csp/bin/sim.py branches/python_bindings_for_ui/csp/cspsim/CSPSim.cpp branches/python_bindings_for_ui/csp/cspsim/CSPSim.h branches/python_bindings_for_ui/csp/cspsim/swig/CSPSim.i branches/python_bindings_for_ui/csp/cspsim/swig/Config.i branches/python_bindings_for_ui/csp/cspsim/swig/Screens.i branches/python_bindings_for_ui/csp/cspsim/swig/wf.i branches/python_bindings_for_ui/csp/cspsim/wf/Container.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Container.h branches/python_bindings_for_ui/csp/cspsim/wf/Control.cpp branches/python_bindings_for_ui/csp/cspsim/wf/Control.h branches/python_bindings_for_ui/csp/cspsim/windows/MenuScreen.cpp branches/python_bindings_for_ui/csp/cspsim/windows/MenuScreen.h branches/python_bindings_for_ui/csp/cspsim/windows/Options.cpp branches/python_bindings_for_ui/csp/data/ui/themes/default/styles.xml Log: Added more python support for the user interface code. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2080 Diff omitted (45069 bytes). |
From: <sv...@ww...> - 2007-04-14 04:14:00
|
Author: mkrose Date: 2007-04-13 21:13:53 -0700 (Fri, 13 Apr 2007) New Revision: 2079 Modified: trunk/csp/tools/build/libconf.py trunk/csp/tools/build/rules.py Log: Fix build under newer versions of SCons. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2079 Modified: trunk/csp/tools/build/libconf.py =================================================================== --- trunk/csp/tools/build/libconf.py 2007-04-10 08:13:34 UTC (rev 2078) +++ trunk/csp/tools/build/libconf.py 2007-04-14 04:13:53 UTC (rev 2079) @@ -144,10 +144,12 @@ if not path: print 'CSPDEVPACK environment variable not set.' sys.exit(1) + if path.startswith('"') and path.endswith('"'): + path = path[1:-1] try: - v = map(int, re.search(r'[0-9.]+$', path).group().split('.')) + v = map(int, re.search(r'([0-9.]+)"?$', path).group(1).split('.')) except Exception: - print 'CSPDEVPACK environment variable (%s) is does not look like a valid devpack path.' % path + print 'CSPDEVPACK environment variable (%s) does not look like a valid devpack path.' % path sys.exit(1) if v < map(int, DevpackConfig.VERSION.split('.')): print 'The installed devpack (%s) is too old; need version %s' % (path, version) Modified: trunk/csp/tools/build/rules.py =================================================================== --- trunk/csp/tools/build/rules.py 2007-04-10 08:13:34 UTC (rev 2078) +++ trunk/csp/tools/build/rules.py 2007-04-14 04:13:53 UTC (rev 2079) @@ -259,6 +259,9 @@ sources += group.sources headers += group.headers misc += group.misc + sources = map(str, sources) + headers = map(str, headers) + misc = map(str, misc) dbg = self._env.MSVSProject(target=self._name+'-dbg.vcproj', srcs=sources, incs=headers, misc=misc, buildtarget=target, variant='Debug') rel = self._env.MSVSProject(target=self._name+'-rel.vcproj', srcs=sources, incs=headers, misc=misc, buildtarget=target, variant='Release') scons.Alias('vs', [dbg, rel]) |
From: <sv...@ww...> - 2007-04-10 08:13:41
|
Author: mkrose Date: 2007-04-10 01:13:34 -0700 (Tue, 10 Apr 2007) New Revision: 2078 Modified: trunk/csp/SConstruct Log: Oops, accidentally removed the dependency on SDL under windows. Restored. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2078 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2007-04-10 08:02:06 UTC (rev 2077) +++ trunk/csp/SConstruct 2007-04-10 08:13:34 UTC (rev 2078) @@ -95,6 +95,7 @@ name = 'sdl', config = [ build.CommandConfig(package='sdl', version_command='sdl-config --version', flags_command='sdl-config --cflags --libs', version='1.2.5', label='sdl'), + build.DevpackConfig(dlls=['SDL'], headers=[('SDL', 'SDL_mouse.h')]), ]) build.ExternalLibrary( |
From: <sv...@ww...> - 2007-04-10 08:02:15
|
Author: mkrose Date: 2007-04-10 01:02:06 -0700 (Tue, 10 Apr 2007) New Revision: 2077 Modified: trunk/csp/SConstruct trunk/csp/modules/demeter/Terrain.cpp Log: Remove dependence on SDL_image. This library was only used by demeter to load textures and terrain tiles. Replaced with osg/Image. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2077 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2007-04-10 06:23:14 UTC (rev 2076) +++ trunk/csp/SConstruct 2007-04-10 08:02:06 UTC (rev 2077) @@ -95,8 +95,6 @@ name = 'sdl', config = [ build.CommandConfig(package='sdl', version_command='sdl-config --version', flags_command='sdl-config --cflags --libs', version='1.2.5', label='sdl'), - build.UnixLibConfig(lib='SDL_image', symbol='IMG_Load', label='sdl image'), - build.DevpackConfig(dlls=['SDL', 'SDL_image'], headers=[('SDL', 'SDL_mouse.h'), ('SDL', 'SDL_image.h')]), ]) build.ExternalLibrary( Modified: trunk/csp/modules/demeter/Terrain.cpp =================================================================== --- trunk/csp/modules/demeter/Terrain.cpp 2007-04-10 06:23:14 UTC (rev 2076) +++ trunk/csp/modules/demeter/Terrain.cpp 2007-04-10 08:02:06 UTC (rev 2077) @@ -41,8 +41,6 @@ #include <fcntl.h> #include <sys/stat.h> -#include <SDL/SDL_image.h> - #ifndef _WIN32 #define GL_GLEXT_PROTOTYPES #include <SDL/SDL_opengl.h> @@ -53,6 +51,10 @@ #define _read(a,b,c) read((a),(b),(c)) #endif +#include <osg/Image> +#include <osgDB/ReadFile> +#include <osgDB/Registry> + //#ifdef DEMETER_MEMORYMANAGER //#include "mmgr.h" //#endif @@ -2509,65 +2511,62 @@ } #endif -void LoadImage(const char* szShortFilename,int& width,int &height,Uint8** ppBuffer,bool bAlpha) +void LoadImage(const char* szShortFilename, int& width, int &height, Uint8** ppBuffer, bool bAlpha) { - SDL_Init(SDL_INIT_VIDEO); + width = 0; + height = 0; + *ppBuffer = NULL; + char szFullFilename[MAX_FILENAME_LENGTH]; - if (strstr(szShortFilename,"\\") || strstr(szShortFilename,"/")) - sprintf(szFullFilename,szShortFilename); + if (strstr(szShortFilename, "\\") || strstr(szShortFilename, "/")) + sprintf(szFullFilename, szShortFilename); else - Settings::GetInstance()->PrependMediaPath(szShortFilename,szFullFilename); + Settings::GetInstance()->PrependMediaPath(szShortFilename, szFullFilename); m_Logfile << "TERRAIN: Loading texture " << szFullFilename << endl; - SDL_Surface* pImage = IMG_Load(szFullFilename); - if (pImage != NULL) - { - width = pImage->w; - height = pImage->h; - Uint8* pBufferTemp; - if (bAlpha) - pBufferTemp = new Uint8[width * height * 4]; - else - pBufferTemp = new Uint8[width * height * 3]; - int i,j; - Uint8* pImagePixels = (Uint8*)pImage->pixels; - for (i = 0,j = 0; i < pImage->h * pImage->pitch; i += pImage->pitch) - { - Uint8* pImageRow = pImagePixels + i; - for (Uint8* pImagePixel = pImageRow; pImagePixel < pImageRow + pImage->w * pImage->format->BytesPerPixel; pImagePixel += pImage->format->BytesPerPixel) - { - Uint8 red,green,blue,alpha; - // Read the pixel into a 32-bit dword for use by SDL_GetRGBA - Uint8 pPixel[4]; - for (int i = 0; i < pImage->format->BytesPerPixel; i++) - pPixel[i] = pImagePixel[i]; - Uint32* pCurrentPixel = (Uint32*)pPixel; - SDL_GetRGBA(*pCurrentPixel,pImage->format,&red,&green,&blue,&alpha); - if(SDL_BYTEORDER == SDL_BIG_ENDIAN) - { - Uint8* p = (Uint8*)pCurrentPixel; - Uint32 currentPixelConverted = p[0] << 16 | p[1] << 8 | p[2]; - SDL_GetRGBA(currentPixelConverted, pImage->format, &red, &green, &blue, &alpha); - } - - pBufferTemp[j++] = red; - pBufferTemp[j++] = green; - pBufferTemp[j++] = blue; - if (bAlpha) - { - pBufferTemp[j++] = alpha; - } - } - } - *ppBuffer = pBufferTemp; - SDL_FreeSurface(pImage); + osg::ref_ptr<osg::Image> image = osgDB::readImageFile(szFullFilename); + + if (!image.valid()) { + m_Logfile << "TERRAIN: Error reading image" << endl; + return; } - else - { - width = 0; - height = 0; - *ppBuffer = NULL; + + // Only accept RGB/RGBA for simplicity. This is sufficient for the current terrain and + // texture data used in CSP. + const GLenum pixel_format = image->getPixelFormat(); + if (pixel_format != GL_RGB && pixel_format != GL_RGBA) { + m_Logfile << "TERRAIN: Can't handle pixel format " << image->getPixelFormat() << endl; + return; } + + if (image->getDataType() != GL_UNSIGNED_BYTE) { + m_Logfile << "TERRAIN: Can't handle data type " << image->getDataType() << endl; + return; + } + + width = image->s(); + height = image->t(); + Uint8* image_data = (Uint8*)image->data(); + Uint8* pBufferTemp = new Uint8[width * height * (bAlpha ? 4 : 3)]; + + const int row_size = image->getRowSizeInBytes(); + const int bits_per_pixel = image->getPixelSizeInBits(); + + assert(bits_per_pixel == 24 || bits_per_pixel == 32); + const int bytes_per_pixel = image->getPixelSizeInBits() / 8; + + for (int i = (height - 1) * row_size, j = 0; i >= 0; i -= row_size) { + Uint8* row = image_data + i; + Uint8* end = row + row_size; + for (Uint8* pixel = row; pixel < end; pixel += bytes_per_pixel) { + pBufferTemp[j++] = pixel[0]; + pBufferTemp[j++] = pixel[1]; + pBufferTemp[j++] = pixel[2]; + if (bAlpha) pBufferTemp[j++] = pixel[3]; + } + } + + *ppBuffer = pBufferTemp; } |
From: <sv...@ww...> - 2007-04-10 06:23:22
|
Author: mkrose Date: 2007-04-09 23:23:14 -0700 (Mon, 09 Apr 2007) New Revision: 2076 Modified: trunk/csp/tools/build/buildlog.py Log: Fix the new buildlog hook to (a) not suppress stdout/stderr from commands and (b) correctly return the command status. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2076 Modified: trunk/csp/tools/build/buildlog.py =================================================================== --- trunk/csp/tools/build/buildlog.py 2007-04-09 08:02:21 UTC (rev 2075) +++ trunk/csp/tools/build/buildlog.py 2007-04-10 06:23:14 UTC (rev 2076) @@ -34,15 +34,26 @@ _SPAWN = None +class _Tee: + """Generalized "T" for writing to multiple file objects.""" + def __init__(self, *out): + self._out = out + def write(self, data): + for out in self._out: + out.write(data) + + def _MakeLogHook(pspawn, log): """ Return a spawn function suitable for env['SPAWN']. The function logs the command string and then calls pspawn to execute the command, which writes stdout and stderr to the log. """ + stdout = _Tee(log, sys.stdout) + stderr = _Tee(log, sys.stderr) def _spawn_wrapper(sh, escape, cmd, cargs, env): Log(' '.join(cargs)) - pspawn(sh, escape, cmd, cargs, env, log, log) + return pspawn(sh, escape, cmd, cargs, env, stdout, stderr) return _spawn_wrapper |
From: <sv...@ww...> - 2007-04-09 08:02:28
|
Author: mkrose Date: 2007-04-09 01:02:21 -0700 (Mon, 09 Apr 2007) New Revision: 2075 Added: trunk/csp/tools/build/buildlog.py Removed: trunk/csp/tools/build/shortlog.py Modified: trunk/csp/SConstruct trunk/csp/tools/build/autoconf.py trunk/csp/tools/build/builders.py trunk/csp/tools/build/rules.py trunk/csp/tools/build/setup.py Log: Reapply r2072, but bump the minimum scons version to 0.96.93. Tested with 0.96.93 and the current development version (0.96.95). Please upgrade scons if you are using 0.96.91 or order. 0.96.92 may work but hasn't been tested. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2075 Diff omitted (18708 bytes). |
From: <sv...@ww...> - 2007-04-09 06:30:25
|
Author: mkrose Date: 2007-04-08 23:30:18 -0700 (Sun, 08 Apr 2007) New Revision: 2074 Added: trunk/csp/tools/build/shortlog.py Removed: trunk/csp/tools/build/buildlog.py Modified: trunk/csp/tools/build/autoconf.py trunk/csp/tools/build/builders.py trunk/csp/tools/build/rules.py trunk/csp/tools/build/setup.py Log: Undo rev 2073, which only works with newer versions of scons. Need to update the docs and give developers fair warning before making this change. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2074 Diff omitted (12858 bytes). |
From: <sv...@ww...> - 2007-04-09 06:24:40
|
Author: mkrose Date: 2007-04-08 23:24:33 -0700 (Sun, 08 Apr 2007) New Revision: 2073 Added: trunk/csp/tools/build/buildlog.py Removed: trunk/csp/tools/build/shortlog.py Modified: trunk/csp/tools/build/autoconf.py trunk/csp/tools/build/builders.py trunk/csp/tools/build/rules.py trunk/csp/tools/build/setup.py Log: Various build improvements. Simplify short message logging, improve .buildlog logging (which now works with and without -Q, timestamps commands, and records command output), add a check for pkg-config under posix, and fix bogus "(cached)" messages for config tests that run outside of scons. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2073 Diff omitted (22103 bytes). |