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...> - 2006-12-31 13:41:38
|
Author: nsmoooose Date: 2006-12-31 05:41:30 -0800 (Sun, 31 Dec 2006) New Revision: 2047 Added: branches/mainmenu_and_style/ Log: This is a short lived branch (couple of weeks) while I am doing work with: * create classes that handles Css classes for the UI. * create a main menu. When the branch is completed and merged to the trunk we can remove it. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2047 Copied: branches/mainmenu_and_style (from rev 2046, trunk) |
From: <sv...@ww...> - 2006-12-31 09:23:19
|
Author: nsmoooose Date: 2006-12-31 01:23:12 -0800 (Sun, 31 Dec 2006) New Revision: 2046 Modified: trunk/csp/csplib/xml/XmlParser.h Log: Fixed a copy n paste error in XmlParser.h that didn't compile on linux. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2046 Modified: trunk/csp/csplib/xml/XmlParser.h =================================================================== --- trunk/csp/csplib/xml/XmlParser.h 2006-12-30 19:11:43 UTC (rev 2045) +++ trunk/csp/csplib/xml/XmlParser.h 2006-12-31 09:23:12 UTC (rev 2046) @@ -210,7 +210,7 @@ XMLNode getChildNode(CSP_XMLCSTR name, int *i=NULL); // A method for very basic xpath queries. - XMLNode XMLNode::selectSingleNode(CSP_XMLCSTR xpath); + XMLNode selectSingleNode(CSP_XMLCSTR xpath); XMLNode getChildNodeWithAttribute(CSP_XMLCSTR tagName, // return child node with specific name/attribute CSP_XMLCSTR attributeName, // (return an empty node if failing) |
From: <sv...@ww...> - 2006-12-30 19:11:49
|
Author: mkrose Date: 2006-12-30 11:11:43 -0800 (Sat, 30 Dec 2006) New Revision: 2045 Modified: trunk/csp/tools/build/setup.py Log: Fix indentation error. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2045 Modified: trunk/csp/tools/build/setup.py =================================================================== --- trunk/csp/tools/build/setup.py 2006-12-30 18:57:20 UTC (rev 2044) +++ trunk/csp/tools/build/setup.py 2006-12-30 19:11:43 UTC (rev 2045) @@ -244,7 +244,7 @@ print '"scons setup" is no longer supported, since running scons' print 'as root causes permissions problems for metadata files' print 'created by scons. Run "python tools/setup.py" as root' - print 'or admin instead.' + print 'or admin instead.' #sys.path.insert(0, scons.Dir('#').abspath) #import tools.setup #del sys.path[0] |
From: <sv...@ww...> - 2006-12-30 18:57:27
|
Author: mkrose Date: 2006-12-30 10:57:20 -0800 (Sat, 30 Dec 2006) New Revision: 2044 Modified: trunk/csp/SConstruct trunk/csp/tools/build/__init__.py trunk/csp/tools/build/setup.py trunk/csp/tools/setup.py Log: Make tools/setup.py work as a standalone script and remove 'scons setup'. The latter required scons to be run as root, which caused various scons metadata files to be created with root as owner. This prevented scons from working correctly when run as a normal user. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2044 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2006-12-20 20:22:43 UTC (rev 2043) +++ trunk/csp/SConstruct 2006-12-30 18:57:20 UTC (rev 2044) @@ -116,7 +116,6 @@ scons indexserver build the master server needed for multiplayer scons dox generate doxygen documentation scons runtests build and run all unittests - scons setup configure the workspace (only needs to be run once) """ INCLUDE = ['#/..', build.GetPythonInclude()] Modified: trunk/csp/tools/build/__init__.py =================================================================== --- trunk/csp/tools/build/__init__.py 2006-12-20 20:22:43 UTC (rev 2043) +++ trunk/csp/tools/build/__init__.py 2006-12-30 18:57:20 UTC (rev 2044) @@ -68,13 +68,12 @@ print 'intended to be run as a standalone program.' sys.exit(1) -# csp bootstrap module may not be installed yet, so manually adjust the module -# search path if necessary. +# Before doing any real work, check that the csp bootstrap module is installed. try: import csp except ImportError: - csp_parent = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) - sys.path.insert(0, csp_parent) + print 'The CSP build environment has not been initialized. Please' + print 'run "python tools/setup.py" as root or admin.' from csp.tools.build.setup import Environment Modified: trunk/csp/tools/build/setup.py =================================================================== --- trunk/csp/tools/build/setup.py 2006-12-20 20:22:43 UTC (rev 2043) +++ trunk/csp/tools/build/setup.py 2006-12-30 18:57:20 UTC (rev 2044) @@ -241,15 +241,19 @@ def SetupClientWorkspace(force): - sys.path.insert(0, scons.Dir('#').abspath) - import tools.setup - del sys.path[0] - setup_log = logging.Logger('setup', logging.INFO) - setup_log.addHandler(logging.FileHandler('.setup.log', mode='wt')) - if tools.setup.SetupClientWorkspace(force, log=setup_log): - print 'Setup complete.' - else: - print 'Setup failed; see .setup.log for details.' + print '"scons setup" is no longer supported, since running scons' + print 'as root causes permissions problems for metadata files' + print 'created by scons. Run "python tools/setup.py" as root' + print 'or admin instead.' + #sys.path.insert(0, scons.Dir('#').abspath) + #import tools.setup + #del sys.path[0] + #setup_log = logging.Logger('setup', logging.INFO) + #setup_log.addHandler(logging.FileHandler('.setup.log', mode='wt')) + #if tools.setup.SetupClientWorkspace(force, log=setup_log): + # print 'Setup complete.' + #else: + # print 'Setup failed; see .setup.log for details.' def AddSetupTargets(env): Modified: trunk/csp/tools/setup.py =================================================================== --- trunk/csp/tools/setup.py 2006-12-20 20:22:43 UTC (rev 2043) +++ trunk/csp/tools/setup.py 2006-12-30 18:57:20 UTC (rev 2044) @@ -18,22 +18,28 @@ """ -Installs a stub module csp.py into the Python site-packages directory, -allowing csp and its submodules to be imported from the current client -workspace without modifying the default Python module path. +Prepares the development workspace for building and running CSP +and related tools. In particular, this script installs a stub +module named csp.py into the Python site-packages directory, +allowing csp and its submodules to be imported from the current +client workspace without modifying the default Python module path. -Also prepares the build environment for the current platform. (Not -fully implemented yet.) +This script should be run once as root or admin for each CSP +subversion client.""" -This module is used by the scons build environment. See the top-level -README for details. -""" +# This module is used by the scons build environment. See the top-level +# README for details. Note that using scons to install the bootstrap +# module is deprecated, and support for 'scons setup' will be removed. +# This is because running scons as root causes a number of scons +# metadata files to be owned by root, which breaks the build when +# later running scons as a normal user. import sys import os import os.path import commands import logging +import optparse from distutils import sysconfig from distutils import file_util from distutils import util @@ -115,3 +121,29 @@ installer = BootstrapInstaller(log) return installer.install(force) + +if __name__ == '__main__': + USAGE = '%s [options]\n%s' % (sys.argv[0], __doc__) + + # parse commandline options + opt = optparse.OptionParser(usage=USAGE) + opt.add_option('-f', '--force', action='store_true', default=False, help='overwrite existing csp module') + opt.add_option('--logfile', type='string', default='', help='log messages to this file (instead of stdout)') + options, args = opt.parse_args() + + # initialize logging + formatter = logging.Formatter('%(levelname)s : %(message)s') + setup_log = logging.Logger('setup', logging.INFO) + logstream = sys.stdout + if options.logfile: + logstream = open(options.logfile, 'wt') + loghandler = logging.StreamHandler(logstream) + loghandler.setFormatter(formatter) + setup_log.addHandler(loghandler) + + # setup the client workspace + if SetupClientWorkspace(options.force, log=setup_log): + print 'Setup complete.' + else: + print 'Setup failed.' + sys.exit(1) |
From: <sv...@ww...> - 2006-12-20 20:22:50
|
Author: nsmoooose Date: 2006-12-20 12:22:43 -0800 (Wed, 20 Dec 2006) New Revision: 2043 Added: trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp trunk/csp/cspsim/wf/ControlGeometryBuilder.h Removed: trunk/csp/cspsim/wf/Theme.h trunk/csp/cspsim/wf/themes/ Modified: trunk/csp/cspsim/GameScreen.cpp trunk/csp/cspsim/SConscript trunk/csp/cspsim/VirtualScene.cpp trunk/csp/cspsim/wf/Button.cpp trunk/csp/cspsim/wf/Button.h trunk/csp/cspsim/wf/CheckBox.cpp trunk/csp/cspsim/wf/CheckBox.h trunk/csp/cspsim/wf/Container.cpp trunk/csp/cspsim/wf/Container.h trunk/csp/cspsim/wf/Control.cpp trunk/csp/cspsim/wf/Control.h trunk/csp/cspsim/wf/Label.cpp trunk/csp/cspsim/wf/Label.h trunk/csp/cspsim/wf/ListBox.cpp trunk/csp/cspsim/wf/ListBox.h trunk/csp/cspsim/wf/ListBoxItem.cpp trunk/csp/cspsim/wf/ListBoxItem.h trunk/csp/cspsim/wf/MessageBox.cpp trunk/csp/cspsim/wf/MessageBox.h trunk/csp/cspsim/wf/MultiControlContainer.cpp trunk/csp/cspsim/wf/MultiControlContainer.h trunk/csp/cspsim/wf/Serialization.cpp trunk/csp/cspsim/wf/SingleControlContainer.cpp trunk/csp/cspsim/wf/SingleControlContainer.h trunk/csp/cspsim/wf/Tab.cpp trunk/csp/cspsim/wf/Tab.h trunk/csp/cspsim/wf/TabPage.cpp trunk/csp/cspsim/wf/TabPage.h trunk/csp/cspsim/wf/TableControlContainer.cpp trunk/csp/cspsim/wf/TableControlContainer.h trunk/csp/cspsim/wf/Window.cpp trunk/csp/cspsim/wf/Window.h trunk/csp/cspsim/wf/WindowManager.cpp trunk/csp/cspsim/wf/WindowManager.h trunk/csp/cspsim/windows/Options.cpp trunk/csp/cspsim/windows/Options.h trunk/csp/cspsim/windows/QuitResume.cpp trunk/csp/cspsim/windows/QuitResume.h Log: Since we are going to read theme information from xml files we no longer need a hardcoded theme (themes/Default.cpp). Renamed themes/Default.cpp class into ControlGeometryBuilder. This class shall be modified to handle theme information that is available on each control. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2043 Diff omitted (74413 bytes). |
From: <sv...@ww...> - 2006-12-20 17:22:40
|
Author: nsmoooose Date: 2006-12-20 09:22:32 -0800 (Wed, 20 Dec 2006) New Revision: 2042 Modified: trunk/csp/cspsim/wf/Serialization.cpp Log: Fix for a compilation error with g++ contributed by Mythos_Greece. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2042 Modified: trunk/csp/cspsim/wf/Serialization.cpp =================================================================== --- trunk/csp/cspsim/wf/Serialization.cpp 2006-12-19 08:22:31 UTC (rev 2041) +++ trunk/csp/cspsim/wf/Serialization.cpp 2006-12-20 17:22:32 UTC (rev 2042) @@ -354,7 +354,8 @@ for(int cellIndex=0;cellIndex < cellNodeCount;++cellIndex) { XMLNode cellNode = rowNode.getChildNode(cellIndex); if(cellNode.nChildNode() > 0) { - Ref<Control> cellControl = createControl(theme, cellNode.getChildNode(0)); + XMLNode controlNode = cellNode.getChildNode(0); + Ref<Control> cellControl = createControl(theme, controlNode); (*dst)[cellIndex][rowIndex] = cellControl; } |
From: <sv...@ww...> - 2006-12-19 08:22:41
|
Author: mkrose Date: 2006-12-19 00:22:31 -0800 (Tue, 19 Dec 2006) New Revision: 2041 Added: trunk/csp/csplib/util/Boolean.h trunk/csp/csplib/util/test/test_Boolean.cpp Modified: trunk/csp/csplib/SConscript Log: Add a three-state boolean class and associated unittest. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2041 Modified: trunk/csp/csplib/SConscript =================================================================== --- trunk/csp/csplib/SConscript 2006-12-18 19:57:35 UTC (rev 2040) +++ trunk/csp/csplib/SConscript 2006-12-19 08:22:31 UTC (rev 2041) @@ -214,9 +214,10 @@ name = 'csplib_tests', sources = [ 'data/test/test_Object.cpp', + 'util/test/test_Boolean.cpp', 'util/test/test_FileUtility.cpp', 'util/test/test_Ref.cpp', - 'util/test/test_StringTools.cpp' + 'util/test/test_StringTools.cpp', 'util/test/test_Testing.cpp' ], deps = ['csplib'], Added: trunk/csp/csplib/util/Boolean.h =================================================================== --- trunk/csp/csplib/util/Boolean.h 2006-12-18 19:57:35 UTC (rev 2040) +++ trunk/csp/csplib/util/Boolean.h 2006-12-19 08:22:31 UTC (rev 2041) @@ -0,0 +1,118 @@ +/* Combat Simulator Project + * Copyright (C) 2006 Mark Rose <mk...@us...> + * + * 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. + */ + + +#ifndef __CSPLIB_UTIL_BOOLEAN_H__ +#define __CSPLIB_UTIL_BOOLEAN_H__ + +#include <csp/csplib/util/Namespace.h> + +CSP_NAMESPACE + +/** A three-state boolean value. The value can be false, true, or unspecified. + * Supports all normal boolean operations for all three state values, returning + * a tribool result in most cases. For example, (true || unspecified) is true, + * while (true && unspecified) is unspecified. Inspired by boost::tribool. + */ +class tribool { + typedef enum { UNSET=0, FALSE=1, TRUE=2 } State; + State _state; + tribool(State state): _state(state) {} + +public: + // Default constructor. The value is neither true nor false. + tribool(): _state(UNSET) {} + + tribool(tribool const &other): _state(other._state) {} + tribool(bool value): _state(value ? TRUE : FALSE) {} + + tribool &operator =(bool value) { _state = (value ? TRUE : FALSE); return *this; } + tribool &operator =(tribool other) { _state = other._state; return *this; } + + /** Cast to bool. Returns true iff the tribool value is true. Both + * false and unspecified tribool values evaluate to false. + */ + operator bool() const { return _state == TRUE; } + + /** Logical not. True values return false, false values return true, + * and unspecified values return unspecified. + */ + tribool operator !() const { + return tribool(_state == FALSE ? TRUE : (_state == TRUE ? FALSE : UNSET)); + } + + /** Bitwise complement. For regular bool values, the bitwise complement is + * always true, since integral conversion rules of C++ map false to 0 and + * true to 1. The integer complement of these values are -1 and -2, + * respectively, which evaluate to true in a bool context. If the tribool + * state is not set to true or false, this operator returns 0, which + * evaluates to false in a bool context. Hence 'if (~x)' succeeds if x is + * either true or false, and fails if x has not been set. + */ + int operator ~() const { + return _state == UNSET ? 0 : (_state == TRUE ? ~true : ~false); + } + + tribool operator &&(tribool other) const { + static const unsigned char and_state[12] = { + UNSET, FALSE, UNSET, UNSET, + FALSE, FALSE, FALSE, UNSET, + UNSET, FALSE, TRUE, UNSET }; + return static_cast<State>(and_state[(other._state << 2) | _state]); + } + + tribool operator ||(tribool other) const { + static const unsigned char or_state[12] = { + UNSET, UNSET, TRUE, UNSET, + UNSET, FALSE, TRUE, UNSET, + TRUE, TRUE, TRUE, UNSET }; + return static_cast<State>(or_state[(other._state << 2) | _state]); + } + + /** Test equality of two tribool values. Note that if the truth state + * of either value is unspecified, the result of the comparison will + * be unspecified. + */ + tribool operator ==(tribool other) const { + static const unsigned char eq_state[12] = { + UNSET, UNSET, UNSET, UNSET, + UNSET, TRUE, FALSE, UNSET, + UNSET, FALSE, TRUE, UNSET }; + return static_cast<State>(eq_state[(other._state << 2) | _state]); + } + + /** Test inequality of two tribool values. Note that if the truth state + * of either value is unspecified, the result of the comparison will + * be unspecified. + */ + tribool operator !=(tribool other) const { + return !(*this == other); + } + + // Binary operators with bool to resolve ambiguity between (bool op bool) + // and (tribool op tribool). + tribool operator &&(bool other) const { return *this && tribool(other); } + tribool operator ||(bool other) const { return *this || tribool(other); } + tribool operator ==(bool other) const { return *this == tribool(other); } + tribool operator !=(bool other) const { return *this != tribool(other); } +}; + +CSP_NAMESPACE_END + +#endif // __CSPLIB_UTIL_BOOLEAN_H__ + Added: trunk/csp/csplib/util/test/test_Boolean.cpp =================================================================== --- trunk/csp/csplib/util/test/test_Boolean.cpp 2006-12-18 19:57:35 UTC (rev 2040) +++ trunk/csp/csplib/util/test/test_Boolean.cpp 2006-12-19 08:22:31 UTC (rev 2041) @@ -0,0 +1,113 @@ +/* Combat Simulator Project + * Copyright (C) 2006 Mark Rose <mk...@us...> + * + * 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 test_Boolean.h + * @brief Test for csplib/util/Boolean.h. + */ + + +#include <csp/csplib/util/Boolean.h> +#include <csp/csplib/util/Testing.h> + +CSP_NAMESPACE + +CSP_TESTFIXTURE(TriBool) { + + CSP_TESTCASE(TestCasts) { + tribool t; + CSP_EXPECT(!static_cast<bool>(t)); + t = true; + CSP_EXPECT(t); + CSP_EXPECT(static_cast<bool>(t)); + t = false; + CSP_EXPECT(!t); + CSP_EXPECT(!static_cast<bool>(t)); + } + + CSP_TESTCASE(TestNegation) { + tribool t; + CSP_EXPECT(!static_cast<bool>(t)); + CSP_EXPECT(!static_cast<bool>(!t)); + t = true; + CSP_EXPECT(static_cast<bool>(t)); + CSP_EXPECT(!static_cast<bool>(!t)); + t = false; + CSP_EXPECT(!static_cast<bool>(t)); + CSP_EXPECT(static_cast<bool>(!t)); + } + + CSP_TESTCASE(TestEquality) { + CSP_EXPECT(static_cast<bool>(tribool(true) == tribool(true))); + CSP_EXPECT(static_cast<bool>(tribool(false) == tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() == tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(true) == tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool(false) == tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(true) == tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(false) == tribool())); + CSP_EXPECT(!static_cast<bool>(tribool() == tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() == tribool(true))); + } + + CSP_TESTCASE(TestInequality) { + CSP_EXPECT(!static_cast<bool>(tribool(true) != tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(false) != tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() != tribool())); + CSP_EXPECT(static_cast<bool>(tribool(true) != tribool(false))); + CSP_EXPECT(static_cast<bool>(tribool(false) != tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(true) != tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(false) != tribool())); + CSP_EXPECT(!static_cast<bool>(tribool() != tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() != tribool(true))); + } + + CSP_TESTCASE(TestAnd) { + CSP_EXPECT(static_cast<bool>(tribool(true) && tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(false) && tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() && tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(true) && tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool(false) && tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(true) && tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(false) && tribool())); + CSP_EXPECT(!static_cast<bool>(tribool() && tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() && tribool(true))); + } + + CSP_TESTCASE(TestOr) { + CSP_EXPECT(static_cast<bool>(tribool(true) || tribool(true))); + CSP_EXPECT(!static_cast<bool>(tribool(false) || tribool(false))); + CSP_EXPECT(!static_cast<bool>(tribool() || tribool())); + CSP_EXPECT(static_cast<bool>(tribool(true) || tribool(false))); + CSP_EXPECT(static_cast<bool>(tribool(false) || tribool(true))); + CSP_EXPECT(static_cast<bool>(tribool(true) || tribool())); + CSP_EXPECT(!static_cast<bool>(tribool(false) || tribool())); + CSP_EXPECT(!static_cast<bool>(tribool() || tribool(false))); + CSP_EXPECT(static_cast<bool>(tribool() || tribool(true))); + } + + CSP_TESTCASE(TestComplement) { + CSP_EXPECT(~tribool(true)); + CSP_EXPECT(~tribool(false)); + CSP_EXPECT(!~tribool()); + } +}; + +CSP_NAMESPACE_END + + |
From: <sv...@ww...> - 2006-12-18 19:57:46
|
Author: nsmoooose Date: 2006-12-18 11:57:35 -0800 (Mon, 18 Dec 2006) New Revision: 2040 Removed: trunk/csp/cspsim/windows/DisplayOptions.cpp trunk/csp/cspsim/windows/DisplayOptions.h trunk/csp/cspsim/windows/SoundOptions.cpp trunk/csp/cspsim/windows/SoundOptions.h Modified: trunk/csp/cspsim/SConscript trunk/csp/cspsim/wf/ListBox.cpp trunk/csp/cspsim/wf/ListBox.h trunk/csp/cspsim/wf/ListBoxItem.cpp trunk/csp/cspsim/wf/MultiControlContainer.cpp trunk/csp/cspsim/wf/Serialization.cpp trunk/csp/cspsim/wf/SingleControlContainer.cpp trunk/csp/cspsim/wf/Tab.cpp trunk/csp/cspsim/windows/Options.cpp trunk/csp/cspsim/windows/Options.h trunk/csp/data/ui/themes/default/options.xml trunk/csp/data/ui/window_document.xsd Log: All gui is now read from data/ui/themes/default/*.xml files. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2040 Diff omitted (25147 bytes). |
Author: nsmoooose Date: 2006-12-17 04:15:32 -0800 (Sun, 17 Dec 2006) New Revision: 2039 Modified: trunk/csp/bin/sim.ini trunk/csp/csp_visual_studio/ trunk/csp/csp_visual_studio/CSP_VS/ trunk/csp/csp_visual_studio/cspsim/ trunk/csp/csplib/ trunk/csp/cspsim/ trunk/csp/cspsim/wf/Button.cpp trunk/csp/cspsim/wf/Button.h trunk/csp/cspsim/wf/CheckBox.h trunk/csp/cspsim/wf/Container.h trunk/csp/cspsim/wf/Control.cpp trunk/csp/cspsim/wf/Control.h trunk/csp/cspsim/wf/Label.cpp trunk/csp/cspsim/wf/Label.h trunk/csp/cspsim/wf/ListBox.h trunk/csp/cspsim/wf/ListBoxItem.cpp trunk/csp/cspsim/wf/ListBoxItem.h trunk/csp/cspsim/wf/Serialization.cpp trunk/csp/cspsim/wf/SingleControlContainer.cpp trunk/csp/cspsim/wf/Tab.cpp trunk/csp/cspsim/wf/Tab.h trunk/csp/cspsim/wf/TabPage.h trunk/csp/cspsim/wf/TableControlContainer.cpp trunk/csp/cspsim/wf/Window.cpp trunk/csp/cspsim/wf/Window.h trunk/csp/cspsim/wf/WindowManager.cpp trunk/csp/cspsim/windows/QuitResume.cpp trunk/csp/cspsim/windows/QuitResume.h trunk/csp/data/ui/themes/default/quit_resume.xml trunk/csp/data/ui/window_document.xsd trunk/csp/modules/chunklod/ trunk/csp/modules/demeter/ Log: * The quit and resume window is now loaded from a xml file. * Cleaned up some of the code. * Prepared most of the controls for serialization from xml file. * Added svn:ignore on some directories and file types that we don't want to commit in the repository. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2039 Diff omitted (31000 bytes). |
From: <sv...@ww...> - 2006-12-13 07:55:49
|
Author: mkrose Date: 2006-12-12 23:55:42 -0800 (Tue, 12 Dec 2006) New Revision: 2038 Modified: trunk/csp/SConstruct trunk/csp/csplib/util/Export.h trunk/csp/cspsim/Export.h trunk/csp/tools/build/autoconf.py Log: Defer symbol export under gcc to v4.2, since gcc 4.1 doesn't support attributes at class declarations which are currently used in Object declarations. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2038 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2006-12-12 19:26:14 UTC (rev 2037) +++ trunk/csp/SConstruct 2006-12-13 07:55:42 UTC (rev 2038) @@ -140,7 +140,7 @@ env.Replace(CXXFLAGS=Split('-O2 -g -W -Wall -pedantic -Wno-long-long')) env.Replace(SWIGCXXFLAGS=Split('-O2 -g')) env.Replace(ARFLAGS=Split('cr')) - if gcc and gcc[0] >= 4: + if gcc and gcc[0] >= (4, 2, 0): env.AppendUnique(CXXFLAGS=Split('-fvisibility=hidden')) def customize_darwin(self, env): Modified: trunk/csp/csplib/util/Export.h =================================================================== --- trunk/csp/csplib/util/Export.h 2006-12-12 19:26:14 UTC (rev 2037) +++ trunk/csp/csplib/util/Export.h 2006-12-13 07:55:42 UTC (rev 2038) @@ -36,7 +36,7 @@ # define CSPLIB_EXPORT __declspec(dllimport) # endif // CSPLIB_EXPORTS #else -# if defined(__GNUC__) && __GNUC__ >= 4 +# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 2 # define CSPLIB_EXPORT __attribute__ ((visibility("default"))) # else # define CSPLIB_EXPORT Modified: trunk/csp/cspsim/Export.h =================================================================== --- trunk/csp/cspsim/Export.h 2006-12-12 19:26:14 UTC (rev 2037) +++ trunk/csp/cspsim/Export.h 2006-12-13 07:55:42 UTC (rev 2038) @@ -26,17 +26,21 @@ #define __CSPSIM_EXPORT_H__ #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) - # ifdef SWIG - # undef __declspec - # define __declspec(x) - # endif // SWIG - # ifdef CSPSIM_EXPORTS - # define CSPSIM_EXPORT __declspec(dllexport) - # else - # define CSPSIM_EXPORT __declspec(dllimport) - # endif // CSPSIM_EXPORTS +# ifdef SWIG +# undef __declspec +# define __declspec(x) +# endif // SWIG +# ifdef CSPSIM_EXPORTS +# define CSPSIM_EXPORT __declspec(dllexport) +# else +# define CSPSIM_EXPORT __declspec(dllimport) +# endif // CSPSIM_EXPORTS #else - # define CSPSIM_EXPORT +# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 2 +# define CSPSIM_EXPORT __attribute__ ((visibility("default"))) +# else +# define CSPSIM_EXPORT +# endif #endif # if defined(_MSC_VER) && (_MSC_VER <= 1400) Modified: trunk/csp/tools/build/autoconf.py =================================================================== --- trunk/csp/tools/build/autoconf.py 2006-12-12 19:26:14 UTC (rev 2037) +++ trunk/csp/tools/build/autoconf.py 2006-12-13 07:55:42 UTC (rev 2038) @@ -52,7 +52,7 @@ def GetGCCVersion(): version = os.popen('gcc -dumpversion').read().strip() try: - return map(int, version.split('.')) + return tuple(map(int, version.split('.'))) except: return None |
From: <sv...@ww...> - 2006-12-12 19:26:22
|
Author: nsmoooose Date: 2006-12-12 11:26:14 -0800 (Tue, 12 Dec 2006) New Revision: 2037 Modified: trunk/csp/csplib/util/StringTools.cpp Log: Fixed missing header file (#include <limits>) issue on windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2037 Modified: trunk/csp/csplib/util/StringTools.cpp =================================================================== --- trunk/csp/csplib/util/StringTools.cpp 2006-12-12 15:46:47 UTC (rev 2036) +++ trunk/csp/csplib/util/StringTools.cpp 2006-12-12 19:26:14 UTC (rev 2037) @@ -29,6 +29,7 @@ #include <cassert> #include <cstdio> #include <ctype.h> +#include <limits> #if !defined(__GNUC__) && !defined(snprintf) #define snprintf _snprintf |
Author: hedo Date: 2006-12-12 07:46:47 -0800 (Tue, 12 Dec 2006) New Revision: 2036 Added: trunk/csp/data/models/industry/ trunk/csp/data/models/industry/refinery_column01/ trunk/csp/data/models/industry/refinery_column01/refinery_column01.jpg trunk/csp/data/models/industry/refinery_column01/refinery_column01.osg trunk/csp/data/models/industry/refinery_column01/refinery_column01_ladder.png trunk/csp/data/models/stores/missiles/agm88c/ trunk/csp/data/models/stores/missiles/agm88c/agm88c.jpg trunk/csp/data/models/stores/missiles/agm88c/agm88c.osg trunk/csp/data/models/stores/missiles/aim120c/ trunk/csp/data/models/stores/missiles/aim120c/aim120c.jpg trunk/csp/data/models/stores/missiles/aim120c/aim120c.osg trunk/csp/data/xml/theater/balkan/refinery_column01.xml trunk/csp/data/xml/theater/balkan/refinery_column01/ trunk/csp/data/xml/theater/balkan/refinery_column01/model.xml Removed: trunk/csp/data/models/stores/missiles/agm88/ trunk/csp/data/models/stores/missiles/aim120/ Log: - add a new folder "data/models/industry" (says me if folder name are unsuitable (i am not english)) :-) - add a column 3d model (first part of a whole refinery)(textures can be easily reduced if optimization needed) - update missiles 3d models names. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2036 Diff omitted (283049 bytes). |
From: <sv...@ww...> - 2006-12-12 08:38:54
|
Author: mkrose Date: 2006-12-12 00:38:48 -0800 (Tue, 12 Dec 2006) New Revision: 2035 Added: trunk/csp/csplib/util/test/test_StringTools.cpp Modified: trunk/csp/csplib/SConscript trunk/csp/csplib/util/StringTools.cpp trunk/csp/csplib/util/StringTools.h Log: Add functions for converting strings to integers in various representations. Add unittests for StringTools. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2035 Diff omitted (17321 bytes). |
From: <sv...@ww...> - 2006-12-12 08:34:55
|
Author: mkrose Date: 2006-12-12 00:34:48 -0800 (Tue, 12 Dec 2006) New Revision: 2034 Modified: trunk/csp/csplib/util/Endian.h Log: Add templates for typed access to endian macros. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2034 Modified: trunk/csp/csplib/util/Endian.h =================================================================== --- trunk/csp/csplib/util/Endian.h 2006-12-12 08:32:06 UTC (rev 2033) +++ trunk/csp/csplib/util/Endian.h 2006-12-12 08:34:48 UTC (rev 2034) @@ -276,5 +276,39 @@ #define CSP_HTONS(val) (CSP_UINT16_TO_BE (val)) +CSP_NAMESPACE + +/** Template wrappers for endian macros. + */ +template<typename T> struct endian { }; +template<> struct endian<uint8> { + inline static uint8 to_le(uint8 x) { return x; } + inline static uint8 from_le(uint8 x) { return x; } +}; +template<> struct endian<int8> { + inline static int8 to_le(int8 x) { return x; } + inline static int8 from_le(int8 x) { return x; } +}; +template<> struct endian<char> { + inline static char to_le(char x) { return x; } + inline static char from_le(char x) { return x; } +}; +#define CSP_ENDIAN_TEMPLATE(TYPE, CAPTYPE) \ + template<> struct endian<TYPE> { \ + inline static TYPE to_le(TYPE x) { return CSP_##CAPTYPE##_TO_LE(x); } \ + inline static TYPE from_le(TYPE x) { return CSP_##CAPTYPE##_FROM_LE(x); } \ + }; +CSP_ENDIAN_TEMPLATE(int16, INT16) +CSP_ENDIAN_TEMPLATE(int32, INT32) +CSP_ENDIAN_TEMPLATE(int64, INT64) +CSP_ENDIAN_TEMPLATE(uint16, UINT16) +CSP_ENDIAN_TEMPLATE(uint32, UINT32) +CSP_ENDIAN_TEMPLATE(uint64, UINT64) +CSP_ENDIAN_TEMPLATE(float, UINT32) +CSP_ENDIAN_TEMPLATE(double, UINT64) +#undef CSP_ENDIAN_TEMPLATE + +CSP_NAMESPACE_END + #endif // __CSPLIB_UTIL_ENDIAN_H__ |
From: <sv...@ww...> - 2006-12-12 08:32:13
|
Author: mkrose Date: 2006-12-12 00:32:06 -0800 (Tue, 12 Dec 2006) New Revision: 2033 Added: trunk/csp/csplib/util/test/test_Testing.cpp Modified: trunk/csp/csplib/SConscript trunk/csp/csplib/util/Testing.cpp trunk/csp/csplib/util/Testing.h trunk/csp/csplib/util/swig/Testing.i Log: Improve unittest reporting, add new assertion macros, and add a unittest for float comparisons. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2033 Diff omitted (32144 bytes). |
From: <sv...@ww...> - 2006-12-12 08:26:27
|
Author: mkrose Date: 2006-12-12 00:26:20 -0800 (Tue, 12 Dec 2006) New Revision: 2032 Modified: trunk/csp/SConstruct trunk/csp/csplib/util/Export.h trunk/csp/tools/build/__init__.py trunk/csp/tools/build/autoconf.py Log: Change default symbol visibility to 'hidden' under gcc 4, which matches the default behavior of visual c++. This should eliminate one class of cross-platform errors related to missing CSPLIB_EXPORT tags. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2032 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2006-12-12 08:04:39 UTC (rev 2031) +++ trunk/csp/SConstruct 2006-12-12 08:26:20 UTC (rev 2032) @@ -136,9 +136,12 @@ env.CopyEnvironment(Split('PATH INCLUDE LIB')) def customize_linux(self, env): + gcc = build.GetGCCVersion() env.Replace(CXXFLAGS=Split('-O2 -g -W -Wall -pedantic -Wno-long-long')) env.Replace(SWIGCXXFLAGS=Split('-O2 -g')) env.Replace(ARFLAGS=Split('cr')) + if gcc and gcc[0] >= 4: + env.AppendUnique(CXXFLAGS=Split('-fvisibility=hidden')) def customize_darwin(self, env): print 'WARNING: Darwin is not yet a fully supported platform.' Modified: trunk/csp/csplib/util/Export.h =================================================================== --- trunk/csp/csplib/util/Export.h 2006-12-12 08:04:39 UTC (rev 2031) +++ trunk/csp/csplib/util/Export.h 2006-12-12 08:26:20 UTC (rev 2032) @@ -26,17 +26,21 @@ #define __CSPLIB_UTIL_EXPORT_H__ #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) - # ifdef SWIG - # undef __declspec - # define __declspec(x) - # endif // SWIG - # ifdef CSPLIB_EXPORTS - # define CSPLIB_EXPORT __declspec(dllexport) - # else - # define CSPLIB_EXPORT __declspec(dllimport) - # endif // CSPLIB_EXPORTS +# ifdef SWIG +# undef __declspec +# define __declspec(x) +# endif // SWIG +# ifdef CSPLIB_EXPORTS +# define CSPLIB_EXPORT __declspec(dllexport) +# else +# define CSPLIB_EXPORT __declspec(dllimport) +# endif // CSPLIB_EXPORTS #else - # define CSPLIB_EXPORT +# if defined(__GNUC__) && __GNUC__ >= 4 +# define CSPLIB_EXPORT __attribute__ ((visibility("default"))) +# else +# define CSPLIB_EXPORT +# endif #endif # if defined(_MSC_VER) && (_MSC_VER <= 1400) Modified: trunk/csp/tools/build/__init__.py =================================================================== --- trunk/csp/tools/build/__init__.py 2006-12-12 08:04:39 UTC (rev 2031) +++ trunk/csp/tools/build/__init__.py 2006-12-12 08:26:20 UTC (rev 2032) @@ -82,7 +82,7 @@ SourceGroup, Program, Generate, SharedLibrary, Command from csp.tools.build.autoconf import \ - CheckSConsVersion, CheckPythonVersion, GetPythonInclude, GetPythonLibrary + CheckSConsVersion, CheckPythonVersion, GetPythonInclude, GetPythonLibrary, GetGCCVersion from csp.tools.build.libconf import \ ExternalLibrary, PkgConfig, CommandConfig, UnixLibConfig, WindowsLibConfig, DevpackConfig Modified: trunk/csp/tools/build/autoconf.py =================================================================== --- trunk/csp/tools/build/autoconf.py 2006-12-12 08:04:39 UTC (rev 2031) +++ trunk/csp/tools/build/autoconf.py 2006-12-12 08:26:20 UTC (rev 2032) @@ -49,6 +49,12 @@ 'version %s or newer.' % (version, minimum)) sys.exit(1) +def GetGCCVersion(): + version = os.popen('gcc -dumpversion').read().strip() + try: + return map(int, version.split('.')) + except: + return None def CheckSwig(context, min_version, not_versions=[]): ok = 0 |
From: <sv...@ww...> - 2006-12-12 08:04:46
|
Author: mkrose Date: 2006-12-12 00:04:39 -0800 (Tue, 12 Dec 2006) New Revision: 2031 Modified: trunk/csp/csplib/util/LogStream.cpp trunk/csp/csplib/util/LogStream.h Log: Move ~LogEntry out of the header and expose LogEntry::BufferStream. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2031 Modified: trunk/csp/csplib/util/LogStream.cpp =================================================================== --- trunk/csp/csplib/util/LogStream.cpp 2006-12-11 13:29:30 UTC (rev 2030) +++ trunk/csp/csplib/util/LogStream.cpp 2006-12-12 08:04:39 UTC (rev 2031) @@ -230,6 +230,14 @@ ::abort(); } +LogStream::LogEntry::~LogEntry() { + m_stream.lock(); + m_stream.getStream() << m_buffer.get() << "\n"; + if (m_priority >= LogStream::cWarning || m_stream.autoflush()) m_stream.flush(); + m_stream.unlock(); + if (m_priority == LogStream::cFatal) die(); +} + LogStream *LogStream::getOrCreateNamedLog(const std::string &name, bool *created) { if (created) *created = false; if (!NamedLogStreamRegistry) NamedLogStreamRegistry = new LogStreamRegistry; Modified: trunk/csp/csplib/util/LogStream.h =================================================================== --- trunk/csp/csplib/util/LogStream.h 2006-12-11 13:29:30 UTC (rev 2030) +++ trunk/csp/csplib/util/LogStream.h 2006-12-12 08:04:39 UTC (rev 2031) @@ -241,13 +241,7 @@ * write operation if running in a multithreaded environment. If the priority * is cFatal, records a stack trace and aborts the program. */ - ~LogEntry() { - m_stream.lock(); - m_stream.getStream() << m_buffer.get() << "\n"; - if (m_priority >= LogStream::cWarning || m_stream.autoflush()) m_stream.flush(); - m_stream.unlock(); - if (m_priority == LogStream::cFatal) die(); - } + ~LogEntry(); /** Stream operator for recording messages in the log entry. */ @@ -263,10 +257,6 @@ return *this; } -private: - void prefix(const char *file, int linenum); - void die(); - /** A fixed size string stream used to buffer the log entry text internally * before writing the completed string to the log stream. */ @@ -278,6 +268,10 @@ FixedStringBuffer<512> m_buffer; }; +private: + void prefix(const char *file, int linenum); + void die(); + LogStream &m_stream; int m_priority; BufferStream m_buffer; |
Author: hedo Date: 2006-12-11 05:29:30 -0800 (Mon, 11 Dec 2006) New Revision: 2030 Added: trunk/csp/data/models/city/ trunk/csp/data/models/city/building01/ trunk/csp/data/models/city/building01/building01.jpg trunk/csp/data/models/city/building01/building01.osg trunk/csp/data/models/city/building02/ trunk/csp/data/models/city/building02/building02.jpg trunk/csp/data/models/city/building02/building02.osg trunk/csp/data/models/city/building03/ trunk/csp/data/models/city/building03/building03.jpg trunk/csp/data/models/city/building03/building03.osg trunk/csp/data/models/city/house02/ trunk/csp/data/models/city/house02/house02.jpg trunk/csp/data/models/city/house02/house02.osg trunk/csp/data/models/city/house03/ trunk/csp/data/models/city/house03/house03.jpg trunk/csp/data/models/city/house03/house03.osg trunk/csp/data/models/city/house04/ trunk/csp/data/models/city/house04/house04.jpg trunk/csp/data/models/city/house04/house04.osg trunk/csp/data/models/city/house05/ trunk/csp/data/models/city/house05/house05.jpg trunk/csp/data/models/city/house05/house05.osg trunk/csp/data/models/city/house06/ trunk/csp/data/models/city/house06/house06.jpg trunk/csp/data/models/city/house06/house06.osg Removed: trunk/csp/data/models/town/ Log: - rename folder "town" to "city" (data/models/) :-) Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2030 Diff omitted (68018 bytes). |
Author: hedo Date: 2006-12-11 04:30:29 -0800 (Mon, 11 Dec 2006) New Revision: 2029 Added: trunk/csp/data/models/stores/missiles/agm88/ trunk/csp/data/models/stores/missiles/agm88/agm88.jpg trunk/csp/data/models/stores/missiles/agm88/agm88.osg trunk/csp/data/models/stores/missiles/aim120/ trunk/csp/data/models/stores/missiles/aim120/aim120.jpg trunk/csp/data/models/stores/missiles/aim120/aim120.osg trunk/csp/data/models/stores/missiles/mk84/ trunk/csp/data/models/stores/missiles/mk84/mk84.jpg trunk/csp/data/models/stores/missiles/mk84/mk84.osg Modified: trunk/csp/data/models/vehicles/Hmmwv01/hmmwv01.jpg trunk/csp/data/xml/theater/balkan/building01/model.xml trunk/csp/data/xml/theater/balkan/building02/model.xml trunk/csp/data/xml/theater/balkan/building03/model.xml trunk/csp/data/xml/theater/balkan/house02/model.xml trunk/csp/data/xml/theater/balkan/house03/model.xml trunk/csp/data/xml/theater/balkan/house04/model.xml trunk/csp/data/xml/theater/balkan/house05/model.xml trunk/csp/data/xml/theater/balkan/house06/model.xml Log: - Add some 3D models missiles and bombs (MK-84, AIM-120, AGM-88). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2029 Diff omitted (352933 bytes). |
From: <sv...@ww...> - 2006-12-10 16:03:53
|
Author: nsmoooose Date: 2006-12-10 08:03:46 -0800 (Sun, 10 Dec 2006) New Revision: 2028 Added: trunk/csp/cspsim/wf/Serialization.cpp trunk/csp/cspsim/wf/Serialization.h Modified: trunk/csp/cspsim/Config.cpp trunk/csp/cspsim/Config.h trunk/csp/cspsim/SConscript trunk/csp/cspsim/VirtualScene.cpp trunk/csp/cspsim/wf/Button.cpp trunk/csp/cspsim/wf/Button.h trunk/csp/cspsim/wf/Container.cpp trunk/csp/cspsim/wf/Container.h trunk/csp/cspsim/wf/Control.cpp trunk/csp/cspsim/wf/Control.h trunk/csp/cspsim/wf/ListBox.cpp trunk/csp/cspsim/wf/ListBox.h trunk/csp/cspsim/wf/MultiControlContainer.cpp trunk/csp/cspsim/wf/MultiControlContainer.h trunk/csp/cspsim/wf/SingleControlContainer.cpp trunk/csp/cspsim/wf/SingleControlContainer.h trunk/csp/cspsim/wf/Tab.cpp trunk/csp/cspsim/wf/Tab.h trunk/csp/cspsim/wf/TableControlContainer.cpp trunk/csp/cspsim/wf/TableControlContainer.h trunk/csp/cspsim/wf/Window.cpp trunk/csp/cspsim/wf/Window.h trunk/csp/cspsim/wf/WindowManager.cpp trunk/csp/cspsim/wf/WindowManager.h Log: Modification to the window framework. Control and containers: * Each control can have an id assigned. * Container controls can find a child control by id. Serialization (not in use yet): * Basic framework for serialization using templates. * Added serialize() template method to several of the controls. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2028 Diff omitted (34208 bytes). |
From: <sv...@ww...> - 2006-12-10 14:09:28
|
Author: nsmoooose Date: 2006-12-10 06:09:20 -0800 (Sun, 10 Dec 2006) New Revision: 2027 Added: trunk/csp/data/ui/ trunk/csp/data/ui/localization/ trunk/csp/data/ui/localization/en/ trunk/csp/data/ui/themes/ trunk/csp/data/ui/themes/default/ trunk/csp/data/ui/themes/default/options.xml trunk/csp/data/ui/themes/default/quit_resume.xml trunk/csp/data/ui/window_document.xsd Log: Added: * directory structure for window xml and localized content. * schema describing format of xml files. * xml files for quit_resume and options windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2027 Diff omitted (10870 bytes). |
From: <sv...@ww...> - 2006-12-09 11:46:06
|
Author: nsmoooose Date: 2006-12-09 03:45:59 -0800 (Sat, 09 Dec 2006) New Revision: 2026 Modified: trunk/csp/csplib/xml/XmlParser.cpp trunk/csp/csplib/xml/XmlParser.h Log: Added support for very basic xpath queries like A/B/C. Made the xml parser available to cspsim library. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2026 Modified: trunk/csp/csplib/xml/XmlParser.cpp =================================================================== --- trunk/csp/csplib/xml/XmlParser.cpp 2006-12-09 07:26:24 UTC (rev 2025) +++ trunk/csp/csplib/xml/XmlParser.cpp 2006-12-09 11:45:59 UTC (rev 2026) @@ -102,6 +102,7 @@ #include <cstdio> #include <cstring> #include <memory.h> +#include <string> CSP_NAMESPACE @@ -2236,6 +2237,32 @@ return getChildNode(name,&i); } +XMLNode XMLNode::selectSingleNode(CSP_XMLCSTR xpath) { + std::string path = xpath; + + XMLNode currentNode = *this; + std::string::size_type pos = 0; + while(true) + { + std::string::size_type nextpos = path.find('/', pos); + std::string nodeName = path.substr(pos, nextpos == std::string::npos ? std::string::npos : nextpos - pos); + XMLNode childNode = currentNode.getChildNode(nodeName.c_str()); + + // Test to see if this was the last one. + if(nextpos == std::string::npos) { + return childNode; + } + // If we didn't find a child node then we return an empty one. + if(childNode.isEmpty()) { + return childNode; + } + + // Iterate into the next node... + pos = nextpos+1; + currentNode = childNode; + } +} + XMLNode XMLNode::getChildNodeWithAttribute(CSP_XMLCSTR name,CSP_XMLCSTR attributeName,CSP_XMLCSTR attributeValue, int *k) { int i=0,j; Modified: trunk/csp/csplib/xml/XmlParser.h =================================================================== --- trunk/csp/csplib/xml/XmlParser.h 2006-12-09 07:26:24 UTC (rev 2025) +++ trunk/csp/csplib/xml/XmlParser.h 2006-12-09 11:45:59 UTC (rev 2026) @@ -49,6 +49,7 @@ #ifndef __CSPLIB_XML_XMLPARSER_H__ #define __CSPLIB_XML_XMLPARSER_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <cstdlib> @@ -156,7 +157,7 @@ struct XMLNodeContents; -typedef struct XMLNode +typedef struct CSPLIB_EXPORT XMLNode { private: @@ -208,6 +209,9 @@ // (return an empty node if failing) XMLNode getChildNode(CSP_XMLCSTR name, int *i=NULL); + // A method for very basic xpath queries. + XMLNode XMLNode::selectSingleNode(CSP_XMLCSTR xpath); + XMLNode getChildNodeWithAttribute(CSP_XMLCSTR tagName, // return child node with specific name/attribute CSP_XMLCSTR attributeName, // (return an empty node if failing) CSP_XMLCSTR attributeValue=NULL, // |
From: <sv...@ww...> - 2006-12-09 07:26:32
|
Author: mkrose Date: 2006-12-08 23:26:24 -0800 (Fri, 08 Dec 2006) New Revision: 2025 Added: trunk/csp/data/shaders/clod.fragment trunk/csp/data/shaders/clod.vertex Log: Add chunklod vertex and fragment shaders. Not sure exactly what state these files and the chunklod shader loader are in; some changes may be needed to get them to work. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2025 Added: trunk/csp/data/shaders/clod.fragment =================================================================== --- trunk/csp/data/shaders/clod.fragment 2006-12-01 12:03:43 UTC (rev 2024) +++ trunk/csp/data/shaders/clod.fragment 2006-12-09 07:26:24 UTC (rev 2025) @@ -0,0 +1,20 @@ +// clod fragment shader +// +// Copyright 2003-2006 Mark Rose <mk...@us...> +// + +uniform sampler2D tex0; +varying vec4 normal; +varying vec4 light; +varying vec4 eye; + +const vec4 fog_color = vec4(0.2, 0.2, 0.4, 1.0); + +void main() { + const vec4 color = texture2D(tex0, gl_TexCoord[0].st); + vec3 r = reflect(normalize(light.xyz), normalize(normal.xyz)); + float spot = dot(r, normalize(eye.xyz)); + spot = pow(spot, 20.0); + float specular = spot * color.b / dot(color, color); + gl_FragColor = mix(color + vec4(1.0, 1.0, 1.0, 1.0) * clamp(specular, 0.0, 1.0), fog_color, gl_FogFragCoord); +} Added: trunk/csp/data/shaders/clod.vertex =================================================================== --- trunk/csp/data/shaders/clod.vertex 2006-12-01 12:03:43 UTC (rev 2024) +++ trunk/csp/data/shaders/clod.vertex 2006-12-09 07:26:24 UTC (rev 2025) @@ -0,0 +1,34 @@ +// clod vertex morpher +// +// Copyright 2003-2006 Mark Rose <mk...@us...> +// +// + +uniform vec3 vertex_scale; +uniform vec3 vertex_offset; + +varying vec4 normal; +varying vec4 light; +varying vec4 eye; + +void main() { + vec4 morph = vec4(0.0, 0.0, 0.0, 1.0); + morph.xz = vertex_offset.xz + gl_Vertex.xz * vertex_scale.xz; + vec4 vxy_eye = gl_ModelViewMatrix * morph; + vec4 range = length(vxy_eye); + morph.y = (gl_Vertex.y + gl_Vertex.w * vertex_offset.y) * vertex_scale.y - range * range / 12740000.0; + gl_Position = gl_ModelViewProjectionMatrix * morph; + + vec4 t0 = vec4(0.0, 0.0, 1.0, 1.0); + t0.s = dot(morph, gl_ObjectPlaneS[0]); + t0.t = dot(morph, gl_ObjectPlaneT[0]); + gl_TexCoord[0] = gl_TextureMatrix[0] * t0; + + normal = gl_ModelViewMatrix * vec4(0.0, 1.0, 0.0, 0.0); + eye = gl_ModelViewMatrix * morph; + light = -gl_LightSource[0].position; + + gl_FrontColor = vec4(1.0, 1.0, 1.0, 1.0); + gl_FogFragCoord = 1.0 - exp(-length(eye) * 0.000002); +} + |
From: <sv...@ww...> - 2006-12-01 12:03:52
|
Author: hedo Date: 2006-12-01 04:03:43 -0800 (Fri, 01 Dec 2006) New Revision: 2024 Modified: trunk/csp/data/xml/theater/balkan/hmmwv01/model.xml Log: - Correction of a mistake in "balkan/hmmwv01/model.xml" Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2024 Modified: trunk/csp/data/xml/theater/balkan/hmmwv01/model.xml =================================================================== --- trunk/csp/data/xml/theater/balkan/hmmwv01/model.xml 2006-12-01 08:45:20 UTC (rev 2023) +++ trunk/csp/data/xml/theater/balkan/hmmwv01/model.xml 2006-12-01 12:03:43 UTC (rev 2024) @@ -14,5 +14,5 @@ <String name="model_id">Wheels</String> <Int name="lod_limit">10</Int> </Object> - +</List> </Object> |
From: <sv...@ww...> - 2006-12-01 08:45:27
|
Author: mkrose Date: 2006-12-01 00:45:20 -0800 (Fri, 01 Dec 2006) New Revision: 2023 Modified: trunk/csp/modules/demeter/BitArray.h trunk/csp/modules/demeter/TerrainTextureFactory.cpp Log: Fix a couple bugs in demeter that valgrind turned up. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2023 Modified: trunk/csp/modules/demeter/BitArray.h =================================================================== --- trunk/csp/modules/demeter/BitArray.h 2006-11-30 18:46:43 UTC (rev 2022) +++ trunk/csp/modules/demeter/BitArray.h 2006-12-01 08:45:20 UTC (rev 2023) @@ -36,7 +36,7 @@ virtual ~BitArray() { if (mLength > 1) - delete mpStore; + delete[] mpStore; } // @@ -50,7 +50,7 @@ if (this != &that) { if (mLength > 1) - delete mpStore; + delete[] mpStore; Init(that.mNumBits); Modified: trunk/csp/modules/demeter/TerrainTextureFactory.cpp =================================================================== --- trunk/csp/modules/demeter/TerrainTextureFactory.cpp 2006-11-30 18:46:43 UTC (rev 2022) +++ trunk/csp/modules/demeter/TerrainTextureFactory.cpp 2006-12-01 08:45:20 UTC (rev 2023) @@ -150,12 +150,12 @@ TerrainTextureFactory::~TerrainTextureFactory() { - delete m_BaseTextures[0]; - delete m_BaseTextures[1]; - delete m_BaseTextures[2]; - delete m_BaseTextures[3]; - delete m_BaseTextures[4]; - delete m_BaseTextures[5]; + delete[] m_BaseTextures[0]; + delete[] m_BaseTextures[1]; + delete[] m_BaseTextures[2]; + delete[] m_BaseTextures[3]; + delete[] m_BaseTextures[4]; + delete[] m_BaseTextures[5]; } void TerrainTextureFactory::SetTerrain(Terrain * pTerrain) |