Changeset 12
- Timestamp:
- 12/29/09 00:22:48 (2 years ago)
- Location:
- trunk
- Files:
-
- 12 modified
-
SConstruct (modified) (9 diffs)
-
include/dreamforge/GameSerializer.hh (modified) (1 diff)
-
src/LevelEditor.cc (modified) (4 diffs)
-
src/LevelEditor.hh (modified) (1 diff)
-
src/ObjectEditor.cc (modified) (1 diff)
-
src/Properties.hh (modified) (3 diffs)
-
src/SConscript (modified) (1 diff)
-
src/Workbench.cc (modified) (1 diff)
-
src/Workbench.hh (modified) (3 diffs)
-
src/dreamforge/GameObjectManager.cc (modified) (1 diff)
-
src/treemodel.cpp (modified) (12 diffs)
-
src/treemodel.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r3 r12 33 33 34 34 PathOption('prefix_xerces', 'xerces-c prefix', default_path, PathOption.PathIsDir), 35 35 PathOption('prefix_log', 'DFLog prefix', default_path, PathOption.PathIsDir), 36 36 PathOption('prefix_boost', 'boost-c prefix', default_path, PathOption.PathIsDir), 37 37 ('boost_version', 'Boost version used', '1.37.0'), 38 38 PathOption('prefix_openal', 'OPENAL prefix', default_path, PathOption.PathIsDir), 39 39 PathOption('prefix_ogre', 'OGRE prefix', default_path, PathOption.PathIsDir), 40 PathOption('prefix_ openal', 'OPENALprefix', default_path, PathOption.PathIsDir)40 PathOption('prefix_qt', 'QT prefix', default_path, PathOption.PathIsDir) 41 41 ) 42 42 … … 45 45 #------------------------------------ 46 46 47 env = Environment(ENV=os.environ, options=opt, tools = ['default', 'revision', 'version', 'custom_tests', 'writeConfigH', 'qt'], toolpath = ['scons']) 47 if sys.platform == 'win32': 48 env = Environment(ENV=os.environ, options=opt, tools = ['default', 'revision', 'version', 'custom_tests', 'writeConfigH', 'qt'], toolpath = ['scons']) 49 else: 50 env = Environment(ENV=os.environ, options=opt, tools = ['default', 'revision', 'version', 'custom_tests', 'writeConfigH'], toolpath = ['scons']) 48 51 49 52 # … … 96 99 97 100 if sys.platform == 'win32': 98 bin_install_dir = top_install_dir 99 lib_install_dir = top_install_dir 100 data_install_dir = os.path.join(top_install_dir, 'share') 101 102 else: 103 bin_install_dir = os.path.join(top_install_dir, 'bin') 104 lib_install_dir = os.path.join(top_install_dir, 'lib') 105 data_install_dir = os.path.join(top_install_dir, 'share', 'gameforge') 101 bin_install_dir = top_install_dir 102 lib_install_dir = top_install_dir 103 data_install_dir = '../data/' 104 log_install_dir = '../log/' 105 else: 106 bin_install_dir = os.path.join(top_install_dir, 'bin') 107 lib_install_dir = top_install_dir 108 data_install_dir = '../data/' 109 log_install_dir = '../log/' 110 111 #if sys.platform == 'win32': 112 # bin_install_dir = top_install_dir 113 # lib_install_dir = top_install_dir 114 # data_install_dir = os.path.join(top_install_dir, 'share') 115 #else: 116 # bin_install_dir = os.path.join(top_install_dir, 'bin') 117 # lib_install_dir = os.path.join(top_install_dir, 'lib') 118 # data_install_dir = os.path.join(top_install_dir, 'share', 'gameforge') 106 119 107 120 #------------------------------------ … … 114 127 "#/include", 115 128 env["build"], 116 os.path.join(env['prefix_xerces'], 'include'), 117 os.path.join(env['prefix_ boost'], 'include'),118 os.path.join(env['prefix_ogre'], 'include', 'OGRE'), 119 os.path.join(env['prefix_openal'], 'include', 'AL')129 os.path.join(env['prefix_xerces'], 'include'), 130 os.path.join(env['prefix_log'], 'include'), 131 os.path.join(env['prefix_ogre'], 'include', 'OGRE'), 132 os.path.join(env['prefix_openal'], 'include', 'AL') 120 133 ] 121 134 122 135 lib_path = [ 123 os.path.join(env['prefix_xerces'], 'lib'), 124 os.path.join(env['prefix_boost'], 'lib'), 136 os.path.join(env['prefix_xerces'], 'lib'), 125 137 os.path.join(env['prefix_ogre'], 'lib'), 126 os.path.join(env['prefix_openal'], 'lib') 138 os.path.join(env['prefix_openal'], 'lib'), 139 os.path.join(env['prefix_qt'], 'lib') 127 140 ] 141 142 if sys.platform == 'win32': 143 env.AppendUnique(CPPPATH = [os.path.join(env['prefix_boost'], 'include', 'boost'), 144 os.path.join(env['prefix_qt'], 'include', 'qt4')]) 145 146 #env.AppendUnique(CPPPATH = [os.path.join(env['prefix_newton'], 'include', 'NEWTON')]) 147 ##env.AppendUnique(LIBPATH = [os.path.join(env['prefix_newton'], 'lib')]) 148 else: 149 env.AppendUnique(CPPPATH = [os.path.join(env['prefix_boost'], 'include', 'boost-1_37'), 150 os.path.join(env['prefix_qt'], 'include')]) 151 #env.AppendUnique(CPPPATH = [env['prefix_newton']]) 152 #env.AppendUnique(LIBPATH = [env['prefix_newton']]) 128 153 129 154 for path in cpp_path: … … 153 178 print "'%s' isn't a compiler supported !"%CXX 154 179 Exit(1) 180 181 # 182 ## Do not display deprecated messsage 183 env.Append(CXXFLAGS = ['-Wno-deprecated']) 184 155 185 #------------------------------------ 156 186 # Platform … … 172 202 # 173 203 # Qt defines and envionnment 174 env.Append(CPPDEFINES = ['QT_DLL', 'QT_NO_DEBUG', 'QT_GUI_LIB', 'QT_CORE_LIB', 'QT_THREAD_SUPPORT']) 175 176 env['QT_LIB'] = 'qtmain' 204 205 if sys.platform == 'win32': 206 env.Append(CPPDEFINES = ['QT_DLL', 'QT_NO_DEBUG', 'QT_GUI_LIB', 'QT_CORE_LIB', 'QT_THREAD_SUPPORT']) 207 env['QT_LIB'] = 'qtmain' 208 else: 209 env.Append(CPPDEFINES = ['QT_NO_DEBUG', 'QT_GUI_LIB', 'QT_CORE_LIB', 'QT_THREAD_SUPPORT', 'QT_SHARED']) 210 177 211 env['QT_AUTOSCAN'] = 1 178 env['MOC_DIR'] = '.moc' 179 env['RCC_DIR'] = '.rcc' 180 env['UI_DIR'] = '.ui' 181 env['RESOURCES'] = 'application.qrc' 212 #env['MOC_DIR'] = '*.moc' 213 #env['RCC_DIR'] = '*.rcc' 214 #env['UI_DIR'] = '*.ui' 215 #env['RESOURCES'] = 'application.qrc' 216 217 #env['QTDIR'] = '/usr/local/Trolltech/QtEmbedded-4.4.3-generic' 218 182 219 # 183 220 # … … 187 224 # 188 225 # Check QT lib name 189 for hd in ['QtCore4', 'QtGui4']:#, 'QtUiTools', 'Qt3Support4', 'QtDesigner4', 'QtHelp4', 'QtDesignerComponents4']: 190 if not conf.CheckLibWithHeader(hd, 'QtGui/QApplication', 'c++', 'QApplication qapp();'): 191 print "Not found Qt4 library" 192 Exit(1) 193 194 #for hd in ['al.h', 'alc.h', 'alut.h']: 195 # if not conf.CheckCXXHeader(hd): 196 # print "Did not find OpenAL header '%s' !"%hd 197 # Exit(1) 198 199 #for hd in ['al.h', 'alc.h', 'alut.h']: 200 # if conf.CheckLib(lib, language="C++"): 201 # found = True 202 # break 203 226 227 if sys.platform == 'win32': 228 qt_header = ['QtCore4', 'QtGui4', 'QtUiTools', 'Qt3Support4', 'QtDesigner4', 'QtHelp4', 'QtDesignerComponents4'] 229 else: 230 qt_header = ['QtCore', 'QtGui', 'QtUiTools', 'Qt3Support', 'QtDesigner', 'QtHelp', 'QtDesignerComponents'] 231 232 for hd in qt_header: 233 if not conf.CheckLibWithHeader(hd, 'QtGui/QApplication', 'c++', 'QApplication qapp();'): 234 print "Not found Qt4 library" 235 Exit(1) 236 204 237 # 205 238 # Check Xerces lib name … … 243 276 boost_compiler = ('vc', 'vc90') 244 277 else: 245 boost_compiler = ('gcc', 'gcc4 1')278 boost_compiler = ('gcc', 'gcc43') 246 279 247 280 boost_version = env['boost_version'].replace('.', '_').replace('_0', '') … … 331 364 os.path.join('src','SConscript'), 332 365 exports=['env', 'top_dir', 'bin_install_dir', 'lib_install_dir', 'data_install_dir'], 333 build_dir=os.path.join(env['build'], 'src'), 366 build_dir=os.path.join(env['build'], 'src'), 334 367 duplicate=0) 335 368 -
trunk/include/dreamforge/GameSerializer.hh
r4 r12 19 19 # define __GAME_SERIALIZER_HH__ 20 20 21 #include <xercesc/util/Xerces_autoconf_config.hpp> 21 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) 22 #include <xercesc/util/Xerces_autoconf_config.hpp> 23 #endif 24 22 25 #include <xercesc/sax2/Attributes.hpp> 23 26 -
trunk/src/LevelEditor.cc
r11 r12 17 17 18 18 #if (OGRE_PLATFORM == OGRE_PLATFORM_LINUX) 19 #include <Q X11Info>19 #include <QtGui/QX11Info> 20 20 #endif 21 21 //#include <OGRE/OgreStringConverter.h> … … 107 107 108 108 //------------------------------------------------------------------------------------------------ 109 void LevelEdWidget::saveObjectToFile( std::string& savefile)109 void LevelEdWidget::saveObjectToFile(const std::string& savefile) 110 110 { 111 111 CSaveFile::getInstance()->setFileName(savefile); … … 123 123 124 124 //------------------------------------------------------------------------------------------------ 125 void LevelEdWidget::loadObjectFromFile( std::string& loadfile)125 void LevelEdWidget::loadObjectFromFile(const std::string& loadfile) 126 126 { 127 127 // Destroy all object loaded in game … … 417 417 418 418 //------------------------------------------------------------------------------------------------ 419 void LevelEdWidget::createTempObject( std::string& name, std::string& file,std::string& type)419 void LevelEdWidget::createTempObject(const std::string& name, const std::string& file, const std::string& type) 420 420 { 421 421 mName = name; -
trunk/src/LevelEditor.hh
r10 r12 29 29 ~LevelEdWidget(void); 30 30 31 void createTempObject( std::string& name, std::string& file,std::string& type);31 void createTempObject(const std::string& name, const std::string& file, const std::string& type); 32 32 void changeInsertionMode(bool val); 33 void saveObjectToFile( std::string& savefile);34 void loadObjectFromFile( std::string& loadfile);33 void saveObjectToFile(const std::string& savefile); 34 void loadObjectFromFile(const std::string& loadfile); 35 35 36 36 inline Ogre::Root* getRoot(void) { return mRoot; } -
trunk/src/ObjectEditor.cc
r10 r12 10 10 11 11 #if (OGRE_PLATFORM == OGRE_PLATFORM_LINUX) 12 #include <Q X11Info>12 #include <QtGui/QX11Info> 13 13 #endif 14 14 -
trunk/src/Properties.hh
r10 r12 20 20 public: 21 21 SelectedObjProp(QWidget *parent = 0); 22 ~SelectedObjProp();22 virtual ~SelectedObjProp(); 23 23 24 24 QTreeView* objectView; … … 53 53 public: 54 54 ObjEdProp(QWidget *parent = 0); 55 ~ObjEdProp();55 virtual ~ObjEdProp(); 56 56 57 57 // CARACTERITICS … … 95 95 public: 96 96 ResourcesProp(QWidget *parent = 0); 97 ~ResourcesProp();97 virtual ~ResourcesProp(); 98 98 99 99 protected: -
trunk/src/SConscript
r10 r12 29 29 bin_game_env.AppendUnique(LIBS="libDFLog") 30 30 bin_game_env.AppendUnique(LIBPATH=["../../../../freequest/trunk/build/src"]) 31 bin = bin_game_env.Program("dreamforge", bin_files) 31 32 bin = bin_game_env.Program("dforge", bin_files) 32 33 33 34 # -
trunk/src/Workbench.cc
r10 r12 1 1 2 2 #ifdef HAVE_CONFIG_HH 3 #include "config.h"3 #include "config.h" 4 4 #endif 5 5 6 6 // use for object global variables 7 #define GLOBAL 8 7 #define GLOBAL 9 8 10 9 #include <QtCore/QDir> 11 // #include <QVBoxLayout>12 // #include <QFrame>10 // #include <QVBoxLayout> 11 // #include <QFrame> 13 12 14 13 #include "Workbench.hh" 15 16 14 17 15 using namespace dreamforge; -
trunk/src/Workbench.hh
r10 r12 1 #ifndef __WORKBENCH_HH__2 #define __WORKBENCH_HH__3 1 #ifndef __WORKBENCH_HH__ 2 #define __WORKBENCH_HH__ 3 4 4 #include <QtGui/QMainWindow> 5 5 #include <QtGui/QtGui> 6 7 6 8 7 #include "LevelEditor.hh" … … 15 14 namespace dreamforge 16 15 { 17 16 18 17 /*** 19 18 Our Workbench which represente the Qt MainWindow. … … 74 73 }; 75 74 76 }// namespace dreamforge 77 78 #endif 75 }// namespace dreamforge 76 77 #endif 78 79 -
trunk/src/dreamforge/GameObjectManager.cc
r8 r12 74 74 { 75 75 obj->destroy(); 76 mObjectList.erase(it );76 mObjectList.erase(it->first); 77 77 } 78 78 } -
trunk/src/treemodel.cpp
r4 r12 43 43 using namespace dreamforge; 44 44 45 //! [0] 45 46 46 TreeModel::TreeModel(const QStringList &headers, const QString &data, 47 47 QObject *parent) … … 55 55 setupModelData(data.split(QString("\n")), rootItem); 56 56 } 57 //! [0] 58 59 //! [1] 57 60 58 TreeModel::~TreeModel() 61 59 { 62 60 delete rootItem; 63 61 } 64 //! [1] 65 66 //! [2] 62 67 63 int TreeModel::columnCount(const QModelIndex &parent) const 68 64 { 69 65 return rootItem->columnCount(); 70 66 } 71 //! [2]72 67 73 68 QVariant TreeModel::data(const QModelIndex &index, int role) const … … 84 79 } 85 80 86 //! [3]87 81 Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const 88 82 { … … 92 86 return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; 93 87 } 94 //! [3] 95 96 //! [4] 88 97 89 TreeItem *TreeModel::getItem(const QModelIndex &index) const 98 90 { … … 103 95 return rootItem; 104 96 } 105 //! [4]106 97 107 98 QVariant TreeModel::headerData(int section, Qt::Orientation orientation, … … 114 105 } 115 106 116 //! [5]117 107 QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) const 118 108 { 119 109 if (parent.isValid() && parent.column() != 0) 120 110 return QModelIndex(); 121 //! [5] 122 123 //! [6] 111 124 112 TreeItem *parentItem = getItem(parent); 125 113 … … 130 118 return QModelIndex(); 131 119 } 132 //! [6]133 120 134 121 bool TreeModel::insertColumns(int position, int columns, const QModelIndex &parent) … … 155 142 } 156 143 157 //! [7]158 144 QModelIndex TreeModel::parent(const QModelIndex &index) const 159 145 { … … 169 155 return createIndex(parentItem->childNumber(), 0, parentItem); 170 156 } 171 //! [7]172 157 173 158 bool TreeModel::removeColumns(int position, int columns, const QModelIndex &parent) … … 197 182 } 198 183 199 //! [8]200 184 int TreeModel::rowCount(const QModelIndex &parent) const 201 185 { … … 204 188 return parentItem->childCount(); 205 189 } 206 //! [8]207 190 208 191 bool TreeModel::setData(const QModelIndex &index, const QVariant &value, … … 286 269 } 287 270 } 271 272 #include "treemodel.moc" -
trunk/src/treemodel.h
r4 r12 43 43 #include <QtCore/QVariant> 44 44 45 46 45 namespace dreamforge 47 46 { 48 47 49 48 class TreeItem; 50 //! [0] 49 51 50 class TreeModel : public QAbstractItemModel 52 51 { … … 54 53 55 54 public: 56 TreeModel(const QStringList &headers, const QString &data, 57 QObject *parent = 0); 58 ~TreeModel(); 59 //! [0] //! [1] 55 TreeModel(const QStringList &headers, const QString &data, QObject *parent = 0); 56 virtual ~TreeModel( void ); 60 57 61 58 QVariant data(const QModelIndex &index, int role) const; … … 69 66 int rowCount(const QModelIndex &parent = QModelIndex()) const; 70 67 int columnCount(const QModelIndex &parent = QModelIndex()) const; 71 //! [1]72 68 73 //! [2]74 69 Qt::ItemFlags flags(const QModelIndex &index) const; 75 70 bool setData(const QModelIndex &index, const QVariant &value, … … 93 88 TreeItem *rootItem; 94 89 }; 95 //! [2]96 90 97 91 }
