gcblue-commits Mailing List for Global Conflict Blue (Page 60)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Xavi <xr...@us...> - 2004-03-28 18:56:54
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9432 Modified Files: tcDBObjSerializer.h Log Message: + added ifdef MSV for #pragma once instruction + added std:: namespace declaration where needed Index: tcDBObjSerializer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBObjSerializer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDBObjSerializer.h 30 Nov 2003 17:23:53 -0000 1.1 --- tcDBObjSerializer.h 28 Mar 2004 18:45:34 -0000 1.2 *************** *** 23,27 **** --- 23,29 ---- #define _DBOBJSERIALIZER_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabase.h" *************** *** 56,60 **** bool tcDBObjSerializer<T>::LoadCsv() { ! ifstream infile; CsvTranslator csv; std::string errorString = "Error - tcDatabase::SerializeCSV - error with file: "; --- 58,62 ---- bool tcDBObjSerializer<T>::LoadCsv() { ! std::ifstream infile; CsvTranslator csv; std::string errorString = "Error - tcDatabase::SerializeCSV - error with file: "; *************** *** 97,101 **** bool tcDBObjSerializer<T>::SaveCsv() { ! ofstream outfile; CsvTranslator csv; std::string errorString = "Error - tcDatabase::SerializeCSV - error with file: "; --- 99,103 ---- bool tcDBObjSerializer<T>::SaveCsv() { ! std::ofstream outfile; CsvTranslator csv; std::string errorString = "Error - tcDatabase::SerializeCSV - error with file: "; *************** *** 133,137 **** } // namespace Database - - #endif \ No newline at end of file --- 135,138 ---- } // namespace Database + #endif |
|
From: Xavi <xr...@us...> - 2004-03-28 18:55:48
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9154 Modified Files: tcDBString.h Log Message: + added ifdef MSV for #pragma once instruction + removed tcDBString:: in method declaration Index: tcDBString.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBString.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDBString.h 30 Nov 2003 17:23:53 -0000 1.1 --- tcDBString.h 28 Mar 2004 18:44:29 -0000 1.2 *************** *** 23,28 **** #define _DBSTRING_H_ #pragma once ! #include "tcPool.h" --- 23,29 ---- #define _DBSTRING_H_ + #if _MSC_VER > 1000 #pragma once ! #endif // _MSC_VER > 1000 #include "tcPool.h" *************** *** 49,53 **** int Serialize(tcFile& file, bool mbLoad); tcDBString(); ! tcDBString::tcDBString(const char *buff); ~tcDBString(); }; --- 50,54 ---- int Serialize(tcFile& file, bool mbLoad); tcDBString(); ! tcDBString(const char *buff); ~tcDBString(); }; *************** *** 55,57 **** } // namespace Database ! #endif \ No newline at end of file --- 56,60 ---- } // namespace Database ! #endif ! ! |
|
From: Xavi <xr...@us...> - 2004-03-28 14:37:52
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24202 Modified Files: tcGenericDBObject.h tcFlightportDBObject.h CsvTranslator.h Log Message: added ifdef MSV for #pragma once instruction Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcGenericDBObject.h 14 Jan 2004 01:13:21 -0000 1.5 --- tcGenericDBObject.h 28 Mar 2004 14:26:35 -0000 1.6 *************** *** 23,27 **** --- 23,29 ---- #define _GENERICDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 84,86 **** } ! #endif \ No newline at end of file --- 86,89 ---- } ! #endif ! Index: tcFlightportDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFlightportDBObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightportDBObject.h 4 Jan 2004 22:24:52 -0000 1.1 --- tcFlightportDBObject.h 28 Mar 2004 14:26:35 -0000 1.2 *************** *** 22,26 **** --- 22,28 ---- #define _FLIGHTPORTDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 63,65 **** } ! #endif \ No newline at end of file --- 65,68 ---- } ! #endif ! Index: CsvTranslator.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/CsvTranslator.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CsvTranslator.h 7 Dec 2003 14:29:32 -0000 1.2 --- CsvTranslator.h 28 Mar 2004 14:26:35 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- #define _CSVTRANSLATOR_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include <iostream> *************** *** 40,45 **** /// SetInputStream must be called if fin is NULL or defaults to NULL CsvTranslator(std::istream* fin = NULL, std::ostream* fout = NULL, std::string sep = ",") : ! inputStream(fin), outputStream(fout), fieldsep(sep), fieldIdx(0), ! isWriteLineBlocked(false) {} int GetLine(std::string&); --- 42,47 ---- /// SetInputStream must be called if fin is NULL or defaults to NULL CsvTranslator(std::istream* fin = NULL, std::ostream* fout = NULL, std::string sep = ",") : ! isWriteLineBlocked(false), inputStream(fin), outputStream(fout), fieldsep(sep), fieldIdx(0) ! {} int GetLine(std::string&); *************** *** 85,87 **** } ! #endif \ No newline at end of file --- 87,90 ---- } ! #endif ! |
|
From: Xavi <xr...@us...> - 2004-03-28 14:35:47
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23840 Modified Files: tcLauncherDBObject.h tcAirDBObject.h Log Message: added ifdef MSV for #pragma once instruction Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcLauncherDBObject.h 30 Jan 2004 01:02:34 -0000 1.3 --- tcLauncherDBObject.h 28 Mar 2004 14:24:27 -0000 1.4 *************** *** 23,27 **** --- 23,29 ---- #define _LAUNCHERDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 54,56 **** } // namespace Database ! #endif \ No newline at end of file --- 56,58 ---- } // namespace Database ! #endif Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcAirDBObject.h 29 Jan 2004 00:05:01 -0000 1.5 --- tcAirDBObject.h 28 Mar 2004 14:24:27 -0000 1.6 *************** *** 21,25 **** --- 21,27 ---- #define _AIRDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "wx/wx.h" *************** *** 60,64 **** void PrintToFile(tcFile& file) {} ///< not supported, redundant with CSV serialization, TODO get rid of these ! int Serialize(tcFile& file, bool mbLoad) {} ///< binary serialization not supported here int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings --- 62,66 ---- void PrintToFile(tcFile& file) {} ///< not supported, redundant with CSV serialization, TODO get rid of these ! int Serialize(tcFile& file, bool mbLoad) {return 0;} ///< binary serialization not supported here int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings *************** *** 71,72 **** --- 73,75 ---- #endif + |
|
From: Xavi <xr...@us...> - 2004-03-28 14:34:27
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23426 Modified Files: tcRadarDBObject.h tcMissileDBObject.h Log Message: added ifdef MSV for #pragma once instruction Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcRadarDBObject.h 5 Feb 2004 23:17:04 -0000 1.5 --- tcRadarDBObject.h 28 Mar 2004 14:22:57 -0000 1.6 *************** *** 23,27 **** --- 23,29 ---- #define _RADARDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcSensorDBObject.h" *************** *** 54,56 **** } // namespace Database ! #endif \ No newline at end of file --- 56,59 ---- } // namespace Database ! #endif ! Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMissileDBObject.h 5 Feb 2004 23:17:04 -0000 1.6 --- tcMissileDBObject.h 28 Mar 2004 14:22:57 -0000 1.7 *************** *** 23,27 **** --- 23,29 ---- #define _MISSILEDBOBJECT_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" *************** *** 120,125 **** } - - - #endif \ No newline at end of file --- 122,125 ---- } + #endif |
|
From: Xavi <xr...@us...> - 2004-03-28 11:44:09
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18303 Modified Files: tcString.h Log Message: changed overloads to let = and + operators with const strings Index: tcString.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcString.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcString.h 19 Oct 2003 17:46:01 -0000 1.2 --- tcString.h 28 Mar 2004 11:32:52 -0000 1.3 *************** *** 18,22 **** --- 18,27 ---- */ + #ifndef _TCSTRING_H_ + #define _TCSTRING_H_ + + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include <string> *************** *** 41,49 **** tcString& operator=(const char * s) {StdString::operator=(s);return *this;} ! tcString& operator=(tcString& s) {StdString::operator=(s);return *this;} tcString& operator+=(const char * s) {StdString::operator+=(s);return *this;} ! tcString& operator+=(tcString& s) {StdString::operator+=(s);return *this;} tcString() : StdString() {} tcString(const char *s) : StdString(s) {} }; --- 46,58 ---- tcString& operator=(const char * s) {StdString::operator=(s);return *this;} ! //tcString& operator=(tcString& s) {StdString::operator=(s);return *this;} ! tcString& operator=(const tcString& s) {StdString::operator=(s);return *this;} tcString& operator+=(const char * s) {StdString::operator+=(s);return *this;} ! //tcString& operator+=(tcString& s) {StdString::operator+=(s);return *this;} ! tcString& operator+=(const tcString& s) {StdString::operator+=(s);return *this;} tcString() : StdString() {} tcString(const char *s) : StdString(s) {} }; + #endif // _TCSTRING_H_ + |
|
From: Xavi <xr...@us...> - 2004-03-28 11:43:26
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18200 Modified Files: wxcommands.h Log Message: removed comma at the end of enum Index: wxcommands.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/wxcommands.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxcommands.h 6 Mar 2004 20:52:28 -0000 1.12 --- wxcommands.h 28 Mar 2004 11:32:09 -0000 1.13 *************** *** 47,51 **** ID_CONNECT = 160, ID_SENDTEST = 170, ! ID_CHATPROTOCOL = 180, }; --- 47,51 ---- ID_CONNECT = 160, ID_SENDTEST = 170, ! ID_CHATPROTOCOL = 180 }; |
|
From: Xavi <xr...@us...> - 2004-03-28 11:42:07
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17944 Modified Files: util.h Log Message: newline at the end of file Index: util.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/util.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** util.h 19 Oct 2003 17:46:01 -0000 1.2 --- util.h 28 Mar 2004 11:30:51 -0000 1.3 *************** *** 35,37 **** const char* FindCharFollowing(const char *z, char c); ! #endif \ No newline at end of file --- 35,38 ---- const char* FindCharFollowing(const char *z, char c); ! #endif ! |
|
From: Xavi <xr...@us...> - 2004-03-28 11:41:31
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17858 Modified Files: tcSound.h tcSoundConsole.h Log Message: added ifdef MSV for #pragma once instruction Index: tcSoundConsole.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSoundConsole.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcSoundConsole.h 29 Feb 2004 22:51:35 -0000 1.6 --- tcSoundConsole.h 28 Mar 2004 11:30:14 -0000 1.7 *************** *** 28,33 **** #endif // _MSC_VER > 1000 ! #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions #include "tcConsole.h" --- 28,35 ---- #endif // _MSC_VER > 1000 ! #include "wx/wx.h" ! #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions + #endif // WIN32 #include "tcConsole.h" Index: tcSound.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcSound.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSound.h 6 Mar 2004 20:52:28 -0000 1.11 --- tcSound.h 28 Mar 2004 11:30:14 -0000 1.12 *************** *** 20,30 **** */ - #if _MSC_VER > 1000 - #pragma once - #endif #ifndef _SOUND_H_ #define _SOUND_H_ #include <AL/al.h> #include <AL/alut.h> --- 20,31 ---- */ #ifndef _SOUND_H_ #define _SOUND_H_ + #if _MSC_VER > 1000 + #pragma once + #endif + #include <AL/al.h> #include <AL/alut.h> |
|
From: Xavi <xr...@us...> - 2004-03-28 11:39:53
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17493 Modified Files: tcFile.h Log Message: added ifdef MSV for #pragma once instruction Index: tcFile.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcFile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFile.h 7 Dec 2003 14:29:32 -0000 1.4 --- tcFile.h 28 Mar 2004 11:28:37 -0000 1.5 *************** *** 18,23 **** --- 18,27 ---- */ + #ifndef _TCFILE_H_ + #define _TCFILE_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include <stdio.h> *************** *** 54,55 **** --- 58,61 ---- FILE *mpFile; }; + + #endif // _TCFILE_H_ |
|
From: Xavi <xr...@us...> - 2004-03-28 11:38:40
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17284 Modified Files: nsNav.h Log Message: added ifdef MSV for #pragma once instruction Index: nsNav.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/nsNav.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nsNav.h 4 Dec 2003 22:31:52 -0000 1.5 --- nsNav.h 28 Mar 2004 11:27:23 -0000 1.6 *************** *** 21,25 **** --- 21,27 ---- #define _NSNAV_H_ + #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #include "stdwx.h" *************** *** 36,40 **** float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad, float afAltA_m, float afAltB_m); ! float GCHeading_rad(tsGeoPointRad a, tsGeoPointRad b, float *apfDistance_rad = NULL); float GCHeadingApprox_rad(tsGeoPointRad a, tsGeoPointRad b); float GCHeadingApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); --- 38,42 ---- float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad, float afAltA_m, float afAltB_m); ! float GCHeading_rad(tsGeoPointRad a, tsGeoPointRad b, float *apfDistance_rad = 0); float GCHeadingApprox_rad(tsGeoPointRad a, tsGeoPointRad b); float GCHeadingApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); |
|
From: Xavi <xr...@us...> - 2004-03-28 11:37:04
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17021 Modified Files: math_constants.h Log Message: added ifdef MSV for #pragma once instruction Index: math_constants.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/math_constants.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** math_constants.h 4 Dec 2003 22:31:52 -0000 1.4 --- math_constants.h 28 Mar 2004 11:25:48 -0000 1.5 *************** *** 21,26 **** #define _MATHCONSTANTS_H_ ! #pragma once #define C_TWOPI 6.2831853f --- 21,27 ---- #define _MATHCONSTANTS_H_ ! #if _MSC_VER > 1000 #pragma once + #endif // _MSC_VER > 1000 #define C_TWOPI 6.2831853f |
|
From: Xavi <xr...@us...> - 2004-03-28 11:24:25
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14936 Modified Files: gctypes.h Log Message: added definition of windows types in case we are under linux Index: gctypes.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/gctypes.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gctypes.h 28 Oct 2003 12:32:34 -0000 1.2 --- gctypes.h 28 Mar 2004 11:13:09 -0000 1.3 *************** *** 14,21 **** --- 14,57 ---- #endif + #ifndef INT16 + typedef short INT16; + #endif + #ifndef UINT32 typedef unsigned int UINT32; #endif + #ifndef UINT + typedef unsigned int UINT; + #endif + + #ifndef UCHAR + typedef unsigned char UCHAR; + #endif + + #ifndef DWORD + typedef unsigned long DWORD; + #endif + + #ifndef ULONG_PTR + typedef unsigned long ULONG_PTR; + #endif + + #ifndef WIN32 // to avoid visual 7 error related to redefinition + + #ifndef LARGE_INTEGER + typedef int long LARGE_INTEGER; + #endif + + + #ifndef WCHAR + typedef unsigned int WCHAR; + #endif + + #ifndef LONGLONG + typedef unsigned long LONGLONG; #endif + #endif // WIN32 + + #endif // _GCTYPES_H_ |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:22
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/src/sim Modified Files: Game.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Game.cpp 21 Mar 2004 21:03:25 -0000 1.70 --- Game.cpp 25 Mar 2004 01:33:39 -0000 1.71 *************** *** 393,396 **** --- 393,398 ---- // need to fix DB obj structure so that only leaf classes are used by game objects mcDatabase.SaveDBCSV("_out"); + mcDatabase.SaveDBXml(""); + tcGameObject::SetGameObjectDatabase(&mcDatabase); // added to allow objects to init themselves |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:21
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/src/common Modified Files: tinyxml.cpp Log Message: Index: tinyxml.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tinyxml.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tinyxml.cpp 24 Mar 2004 21:09:28 -0000 1.1 --- tinyxml.cpp 25 Mar 2004 01:33:39 -0000 1.2 *************** *** 535,538 **** --- 535,549 ---- } + /** + * ALTERED code + * This code was added to set floating point attributes + */ + void TiXmlElement::SetAttribute( const char * name, float value ) + { + char buf[64]; + sprintf( buf, "%f", value ); + SetAttribute( name, buf ); + } + void TiXmlElement::SetAttribute( const char * name, const char * _value ) |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:21
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/src/database Modified Files: tcDatabase.cpp tcDatabaseObject.cpp Log Message: Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcDatabaseObject.cpp 30 Jan 2004 01:02:34 -0000 1.5 --- tcDatabaseObject.cpp 25 Mar 2004 01:33:39 -0000 1.6 *************** *** 34,37 **** --- 34,38 ---- #include "CsvTranslator.h" #include "tc3DModel.h" + #include "common/tinyxml.h" namespace Database *************** *** 208,211 **** --- 209,230 ---- return 1; } + + /** + * Loads/saves XML data for database object + * @param load true to load, false to save + */ + void tcDatabaseObject::SerializeXml(TiXmlElement* node, bool load) + { + if (load) return; // write only for now + wxASSERT(node); + + node->SetAttribute("DBCLASS", mzClass.mz); + node->SetAttribute("MODELTYPE", int(mnModelType)); + node->SetAttribute("FUNCTYPE", int(mnType)); + node->SetAttribute("IMAGE", mzImageFileName.mz); + node->SetAttribute("3DMODEL", mz3DModelFileName.mz); + TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); + descriptionNode->InsertEndChild(TiXmlText(mzDescription)); + } int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDatabase.cpp 7 Feb 2004 02:19:54 -0000 1.7 --- tcDatabase.cpp 25 Mar 2004 01:33:39 -0000 1.8 *************** *** 42,45 **** --- 42,46 ---- #include "tcAirDBObject.h" #include "tcFlightportDBObject.h" + #include "common/tinyxml.h" using namespace std; *************** *** 152,155 **** --- 153,196 ---- } + /** + * @param suffix string to append after type name, e.g. "2b" -> database2b.xml + * @param load true to load DB from XML file, false to save to XML file + */ + void tcDatabase::SerializeXml(std::string suffix, bool load) + { + std::string path(DATABASE_PATH); + std::string fileName = path + string("database") + suffix + ".xml"; + if (load) return; // load not supported yet + + + // create XML document + TiXmlDocument* doc = new TiXmlDocument(fileName.c_str()); + + // create root node to be XML compliant + TiXmlNode* root = doc->InsertEndChild(TiXmlElement("DATA")); + + // for each DB object: add new TiXmlElement to doc, and call virtual SerializeXml method + // need to create iterator for this + long pos = mcObjectData.GetStartPosition(); + long objCount = mcObjectData.GetCount(); + + for (long i=0; i<objCount; i++) + { + tcDatabaseObject* obj; + long key; + mcObjectData.GetNextAssoc(pos, key, obj); + wxASSERT(obj); + + TiXmlNode* objNode = root->InsertEndChild(TiXmlElement("OBJ")); + obj->SerializeXml(objNode->ToElement(), false); + } + + // write document to file + doc->SaveFile(); + + // delete document + delete doc; + } + int tcDatabase::Serialize(tcFile& file, bool mbLoad) { tnPoolIndex nMapSize, nKey, nPoolPos; *************** *** 656,659 **** --- 697,707 ---- } + /** + * Load database from XML file. + */ + void tcDatabase::LoadDBXml(std::string suffix) + { + } + void tcDatabase::SaveDB(tcString astrDBFileName) { int nResult; *************** *** 690,693 **** --- 738,749 ---- } + /** + * Save database to XML file + */ + void tcDatabase::SaveDBXml(std::string suffix) + { + SerializeXml(suffix, false); + } + void tcDatabase::LoadDB() { |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:21
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/include/database Modified Files: tcDatabase.h tcDatabaseObject.h Log Message: Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDatabaseObject.h 30 Jan 2004 01:02:34 -0000 1.7 --- tcDatabaseObject.h 25 Mar 2004 01:33:38 -0000 1.8 *************** *** 39,42 **** --- 39,43 ---- class tc3DModel; + class TiXmlElement; namespace Database *************** *** 132,135 **** --- 133,137 ---- int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization + virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings tcDatabaseObject(); Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDatabase.h 7 Feb 2004 02:19:53 -0000 1.3 --- tcDatabase.h 25 Mar 2004 01:33:38 -0000 1.4 *************** *** 83,90 **** --- 83,93 ---- void LoadDBCSV(std::string suffix = ""); void SaveDBCSV(std::string suffix = ""); + void LoadDBXml(std::string suffix = ""); + void SaveDBXml(std::string suffix = ""); void RandomizePlatforms(void); void PrintToFile(tcString); int Serialize(tcFile& file, bool mbLoad); int SerializeCSV(std::string suffix, bool mbLoad); + void SerializeXml(std::string suffix, bool load); tcDatabase(); ~tcDatabase(); |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:21
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/include/common Modified Files: tinyxml.h Log Message: Index: tinyxml.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tinyxml.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tinyxml.h 24 Mar 2004 21:09:27 -0000 1.1 --- tinyxml.h 25 Mar 2004 01:33:38 -0000 1.2 *************** *** 769,772 **** --- 769,775 ---- void SetAttribute( const char * name, int value ); + /// ALTERED code - Added to set floating point attribute + void SetAttribute( const char * name, float value ); + /** Deletes an attribute with the given name. */ |
|
From: Dewitt C. <ddc...@us...> - 2004-03-25 01:44:20
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CHANGES.txt 24 Mar 2004 21:09:26 -0000 1.3 --- CHANGES.txt 25 Mar 2004 01:33:38 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- *** 2004-03-24 Dewitt Colclough *** - Replaced libxml2 with TinyXml C++ library + - Started adding XML support to database *** 2004-03-21 Dewitt Colclough *** |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:36
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331 Modified Files: GCblue.vcproj Log Message: Replaced libxml2 with TinyXml to make Xml easier to use Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** GCblue.vcproj 6 Mar 2004 20:52:28 -0000 1.46 --- GCblue.vcproj 24 Mar 2004 21:09:25 -0000 1.47 *************** *** 23,27 **** Optimization="0" AdditionalIncludeDirectories="include/sim;include/graphics;include/common;include/scriptinterface;include;"C:\wxWindows-2.4.1\lib\mswd";include\database" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WXDEBUG__;WXDEBUG=1;__WIN95__;__WIN32__;WINVER=0x0400;STRICT;_WIN32_IMPLEMENTATION" MinimalRebuild="FALSE" BasicRuntimeChecks="3" --- 23,27 ---- Optimization="0" AdditionalIncludeDirectories="include/sim;include/graphics;include/common;include/scriptinterface;include;"C:\wxWindows-2.4.1\lib\mswd";include\database" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WXDEBUG__;WXDEBUG=1;__WIN95__;__WIN32__;WINVER=0x0400;STRICT;_WIN32_IMPLEMENTATION;TIXML_USE_STL" MinimalRebuild="FALSE" BasicRuntimeChecks="3" *************** *** 39,43 **** Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32d.lib ALutd.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib libxml2.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" --- 39,43 ---- Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32d.lib ALutd.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" *************** *** 92,96 **** OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="include;include/sim;include/scriptinterface;include/common;include/graphics;"C:\wxWindows-2.4.1\lib\msw";include\database" ! PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WIN95__;__WIN32__;WINVER=0x0400;STRICT;_WIN32_IMPLEMENTATION" StringPooling="TRUE" RuntimeLibrary="2" --- 92,96 ---- OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="include;include/sim;include/scriptinterface;include/common;include/graphics;"C:\wxWindows-2.4.1\lib\msw";include\database" ! PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WIN95__;__WIN32__;WINVER=0x0400;STRICT;_WIN32_IMPLEMENTATION;TIXML_USE_STL" StringPooling="TRUE" RuntimeLibrary="2" *************** *** 105,109 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib winmm.LIB opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32.lib ALut.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib osg.lib osgDB.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib libxml2.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" --- 105,109 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib winmm.LIB opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32.lib ALut.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib osg.lib osgDB.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" *************** *** 197,201 **** </File> <File ! RelativePath="src\common\tcXMLFile.cpp"> </File> <File --- 197,210 ---- </File> <File ! RelativePath=".\src\common\tinystr.cpp"> ! </File> ! <File ! RelativePath=".\src\common\tinyxml.cpp"> ! </File> ! <File ! RelativePath=".\src\common\tinyxmlerror.cpp"> ! </File> ! <File ! RelativePath=".\src\common\tinyxmlparser.cpp"> </File> <File *************** *** 555,559 **** </File> <File ! RelativePath="include\common\tcXMLFile.h"> </File> <File --- 564,571 ---- </File> <File ! RelativePath=".\include\common\tinystr.h"> ! </File> ! <File ! RelativePath=".\include\common\tinyxml.h"> </File> <File |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:10
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/src/sim Modified Files: tcNetworkView.cpp Log Message: Replaced libxml2 with TinyXml to make Xml easier to use Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcNetworkView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcNetworkView.cpp 20 Mar 2004 18:46:47 -0000 1.7 --- tcNetworkView.cpp 24 Mar 2004 21:09:27 -0000 1.8 *************** *** 32,36 **** #include "tcEditBox.h" #include "tcConsoleBox.h" ! #include "tcXMLFile.h" #include "network/tcMultiplayerInterface.h" #include "wxcommands.h" --- 32,36 ---- #include "tcEditBox.h" #include "tcConsoleBox.h" ! #include "common/tinyxml.h" #include "network/tcMultiplayerInterface.h" #include "wxcommands.h" *************** *** 209,220 **** if (config) { - config->GetRootNode().WriteDebug(); AddXMLControls(); } ! tcXMLNode root = config->GetRootNode(); // add IP edit box ! tcXMLNode current = root.GetChildMatching("EditIP"); ! ipEdit = new tcEditBox(this, ¤t); ipEdit->SetCommand(1); ipEdit->SetClearOnReturn(false); --- 209,230 ---- if (config) { AddXMLControls(); } ! else ! { ! std::cerr << "tcNetworkView::tcNetworkView - NULL xml config node\n"; ! return; ! } ! ! TiXmlNode* root = config->FirstChild("Window"); ! if (!root) ! { ! std::cerr << "tcNetworkView::tcNetworkView - Missing top level <Window> tag\n"; ! return; ! } // add IP edit box ! TiXmlNode* current = root->FirstChild("EditIP"); ! ipEdit = new tcEditBox(this, current); ipEdit->SetCommand(1); ipEdit->SetClearOnReturn(false); *************** *** 222,238 **** // read status box parameters ! current = root.GetChildMatching("StatusBox"); ! statusBoxBounds.x = current.GetChildMatching("X").GetAsInt(); ! statusBoxBounds.y = current.GetChildMatching("Y").GetAsInt(); ! statusBoxBounds.width = current.GetChildMatching("Width").GetAsInt(); ! statusBoxBounds.height = current.GetChildMatching("Height").GetAsInt(); // add chat text console ! current = root.GetChildMatching("ChatBox"); ! chatBox = new tcConsoleBox(this, ¤t); // add chat text edit box ! current = root.GetChildMatching("ChatEntry"); ! chatEntry = new tcEditBox(this, ¤t); chatEntry->SetCommand(2); chatEntry->SetClearOnReturn(true); --- 232,257 ---- // read status box parameters ! current = root->FirstChild("StatusBox"); ! ! if (current) ! { ! TiXmlElement* elt = current->ToElement(); ! elt->Attribute("X", &statusBoxBounds.x); ! elt->Attribute("Y", &statusBoxBounds.y); ! elt->Attribute("Width", &statusBoxBounds.width); ! elt->Attribute("Height", &statusBoxBounds.height); ! } ! else ! { ! std::cerr << "tcNetworkView::tcNetworkView - no StatusBox xml node\n"; ! } // add chat text console ! current = root->FirstChild("ChatBox"); ! chatBox = new tcConsoleBox(this, current); // add chat text edit box ! current = root->FirstChild("ChatEntry"); ! chatEntry = new tcEditBox(this, current); chatEntry->SetCommand(2); chatEntry->SetClearOnReturn(true); |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:10
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/src/common Added Files: tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp Removed Files: tcXMLFile.cpp Log Message: Replaced libxml2 with TinyXml to make Xml easier to use --- NEW FILE: tinyxmlparser.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1120 lines suppressed...] standalone = attrib.Value(); } else { // Read over whatever it is. while( p && *p && *p != '>' && !isspace( *p ) ) ++p; } } return 0; } bool TiXmlText::Blank() const { for ( unsigned i=0; i<value.length(); i++ ) if ( !isspace( value[i] ) ) return false; return true; } --- NEW FILE: tinyxmlerror.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" // The goal of the seperate error file is to make the first // step towards localization. tinyxml (currently) only supports // latin-1, but at least the error messages could now be translated. // // It also cleans up the code a bit. // const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = { "No error", "Error", "Failed to open file", "Memory allocation failed.", "Error parsing Element.", "Failed to read Element name", "Error reading Element value.", "Error reading Attributes.", "Error: empty tag.", "Error reading end tag.", "Error parsing Unknown.", "Error parsing Comment.", "Error parsing Declaration.", "Error document empty." }; --- tcXMLFile.cpp DELETED --- --- NEW FILE: tinystr.cpp --- /* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" #ifndef TIXML_USE_STL #include <stdlib.h> #include <string.h> #include <ctype.h> #include "tinystr.h" #pragma warning (disable : 4267) // ALTERED, added this line for vc7.1 // TiXmlString constructor, based on a C string TiXmlString::TiXmlString (const char* instring) { unsigned newlen; char * newstring; if (!instring) { allocated = 0; cstring = NULL; current_length = 0; return; } newlen = strlen (instring) + 1; newstring = new char [newlen]; memcpy (newstring, instring, newlen); // strcpy (newstring, instring); allocated = newlen; cstring = newstring; current_length = newlen - 1; } // TiXmlString copy constructor TiXmlString::TiXmlString (const TiXmlString& copy) { unsigned newlen; char * newstring; // Prevent copy to self! if ( © == this ) return; if (! copy . allocated) { allocated = 0; cstring = NULL; current_length = 0; return; } newlen = copy . length () + 1; newstring = new char [newlen]; // strcpy (newstring, copy . cstring); memcpy (newstring, copy . cstring, newlen); allocated = newlen; cstring = newstring; current_length = newlen - 1; } // TiXmlString = operator. Safe when assign own content void TiXmlString ::operator = (const char * content) { unsigned newlen; char * newstring; if (! content) { empty_it (); return; } newlen = strlen (content) + 1; newstring = new char [newlen]; // strcpy (newstring, content); memcpy (newstring, content, newlen); empty_it (); allocated = newlen; cstring = newstring; current_length = newlen - 1; } // = operator. Safe when assign own content void TiXmlString ::operator = (const TiXmlString & copy) { unsigned newlen; char * newstring; if (! copy . length ()) { empty_it (); return; } newlen = copy . length () + 1; newstring = new char [newlen]; // strcpy (newstring, copy . c_str ()); memcpy (newstring, copy . c_str (), newlen); empty_it (); allocated = newlen; cstring = newstring; current_length = newlen - 1; } //// Checks if a TiXmlString contains only whitespace (same rules as isspace) //bool TiXmlString::isblank () const //{ // char * lookup; // for (lookup = cstring; * lookup; lookup++) // if (! isspace (* lookup)) // return false; // return true; //} // append a const char * to an existing TiXmlString void TiXmlString::append( const char* str, int len ) { char * new_string; unsigned new_alloc, new_size, size_suffix; size_suffix = strlen (str); if (len < (int) size_suffix) size_suffix = len; if (! size_suffix) return; new_size = length () + size_suffix + 1; // check if we need to expand if (new_size > allocated) { // compute new size new_alloc = assign_new_size (new_size); // allocate new buffer new_string = new char [new_alloc]; new_string [0] = 0; // copy the previous allocated buffer into this one if (allocated && cstring) // strcpy (new_string, cstring); memcpy (new_string, cstring, length ()); // append the suffix. It does exist, otherwize we wouldn't be expanding // strncat (new_string, str, len); memcpy (new_string + length (), str, size_suffix); // return previsously allocated buffer if any if (allocated && cstring) delete [] cstring; // update member variables cstring = new_string; allocated = new_alloc; } else { // we know we can safely append the new string // strncat (cstring, str, len); memcpy (cstring + length (), str, size_suffix); } current_length = new_size - 1; cstring [current_length] = 0; } // append a const char * to an existing TiXmlString void TiXmlString::append( const char * suffix ) { char * new_string; unsigned new_alloc, new_size; new_size = length () + strlen (suffix) + 1; // check if we need to expand if (new_size > allocated) { // compute new size new_alloc = assign_new_size (new_size); // allocate new buffer new_string = new char [new_alloc]; new_string [0] = 0; // copy the previous allocated buffer into this one if (allocated && cstring) memcpy (new_string, cstring, 1 + length ()); // strcpy (new_string, cstring); // append the suffix. It does exist, otherwize we wouldn't be expanding // strcat (new_string, suffix); memcpy (new_string + length (), suffix, strlen (suffix) + 1); // return previsously allocated buffer if any if (allocated && cstring) delete [] cstring; // update member variables cstring = new_string; allocated = new_alloc; } else { // we know we can safely append the new string // strcat (cstring, suffix); memcpy (cstring + length (), suffix, strlen (suffix) + 1); } current_length = new_size - 1; } // Check for TiXmlString equuivalence //bool TiXmlString::operator == (const TiXmlString & compare) const //{ // return (! strcmp (c_str (), compare . c_str ())); //} //unsigned TiXmlString::length () const //{ // if (allocated) // // return strlen (cstring); // return current_length; // return 0; //} unsigned TiXmlString::find (char tofind, unsigned offset) const { char * lookup; if (offset >= length ()) return (unsigned) notfound; for (lookup = cstring + offset; * lookup; lookup++) if (* lookup == tofind) return lookup - cstring; return (unsigned) notfound; } bool TiXmlString::operator == (const TiXmlString & compare) const { if ( allocated && compare.allocated ) { assert( cstring ); assert( compare.cstring ); return ( strcmp( cstring, compare.cstring ) == 0 ); } return false; } bool TiXmlString::operator < (const TiXmlString & compare) const { if ( allocated && compare.allocated ) { assert( cstring ); assert( compare.cstring ); return ( strcmp( cstring, compare.cstring ) > 0 ); } return false; } bool TiXmlString::operator > (const TiXmlString & compare) const { if ( allocated && compare.allocated ) { assert( cstring ); assert( compare.cstring ); return ( strcmp( cstring, compare.cstring ) < 0 ); } return false; } #endif // TIXML_USE_STL --- NEW FILE: tinyxml.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1221 lines suppressed...] } TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement( value ); for ( i=0; child && i<count; child = child->NextSiblingElement( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:10
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/include/common Added Files: tinystr.h tinyxml.h Removed Files: tcXMLFile.h Log Message: Replaced libxml2 with TinyXml to make Xml easier to use --- tcXMLFile.h DELETED --- --- NEW FILE: tinystr.h --- /* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" #ifndef TIXML_USE_STL #ifndef TIXML_STRING_INCLUDED #define TIXML_STRING_INCLUDED #pragma warning( disable : 4514 ) #include <assert.h> /* TiXmlString is an emulation of the std::string template. Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. Only the member functions relevant to the TinyXML project have been implemented. The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase a string and there's no more room, we allocate a buffer twice as big as we need. */ class TiXmlString { public : // TiXmlString constructor, based on a string TiXmlString (const char * instring); // TiXmlString empty constructor TiXmlString () { allocated = 0; cstring = NULL; current_length = 0; } // TiXmlString copy constructor TiXmlString (const TiXmlString& copy); // TiXmlString destructor ~ TiXmlString () { empty_it (); } // Convert a TiXmlString into a classical char * const char * c_str () const { if (allocated) return cstring; return ""; } // Return the length of a TiXmlString unsigned length () const { return ( allocated ) ? current_length : 0; } // TiXmlString = operator void operator = (const char * content); // = operator void operator = (const TiXmlString & copy); // += operator. Maps to append TiXmlString& operator += (const char * suffix) { append (suffix); return *this; } // += operator. Maps to append TiXmlString& operator += (char single) { append (single); return *this; } // += operator. Maps to append TiXmlString& operator += (TiXmlString & suffix) { append (suffix); return *this; } bool operator == (const TiXmlString & compare) const; bool operator < (const TiXmlString & compare) const; bool operator > (const TiXmlString & compare) const; // Checks if a TiXmlString is empty bool empty () const { return length () ? false : true; } // Checks if a TiXmlString contains only whitespace (same rules as isspace) // Not actually used in tinyxml. Conflicts with a C macro, "isblank", // which is a problem. Commenting out. -lee // bool isblank () const; // single char extraction const char& at (unsigned index) const { assert( index < length ()); return cstring [index]; } // find a char in a string. Return TiXmlString::notfound if not found unsigned find (char lookup) const { return find (lookup, 0); } // find a char in a string from an offset. Return TiXmlString::notfound if not found unsigned find (char tofind, unsigned offset) const; /* Function to reserve a big amount of data when we know we'll need it. Be aware that this function clears the content of the TiXmlString if any exists. */ void reserve (unsigned size) { empty_it (); if (size) { allocated = size; cstring = new char [size]; cstring [0] = 0; current_length = 0; } } // [] operator char& operator [] (unsigned index) const { assert( index < length ()); return cstring [index]; } // Error value for find primitive enum { notfound = 0xffffffff, npos = notfound }; void append (const char *str, int len ); protected : // The base string char * cstring; // Number of chars allocated unsigned allocated; // Current string size unsigned current_length; // New size computation. It is simplistic right now : it returns twice the amount // we need unsigned assign_new_size (unsigned minimum_to_allocate) { return minimum_to_allocate * 2; } // Internal function that clears the content of a TiXmlString void empty_it () { if (cstring) delete [] cstring; cstring = NULL; allocated = 0; current_length = 0; } void append (const char *suffix ); // append function for another TiXmlString void append (const TiXmlString & suffix) { append (suffix . c_str ()); } // append for a single char. This could be improved a lot if needed void append (char single) { char smallstr [2]; smallstr [0] = single; smallstr [1] = 0; append (smallstr); } } ; /* TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. Only the operators that we need for TinyXML have been developped. */ class TiXmlOutStream : public TiXmlString { public : TiXmlOutStream () : TiXmlString () {} // TiXmlOutStream << operator. Maps to TiXmlString::append TiXmlOutStream & operator << (const char * in) { append (in); return (* this); } // TiXmlOutStream << operator. Maps to TiXmlString::append TiXmlOutStream & operator << (const TiXmlString & in) { append (in . c_str ()); return (* this); } } ; #endif // TIXML_STRING_INCLUDED #endif // TIXML_USE_STL --- NEW FILE: tinyxml.h --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1220 lines suppressed...] TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } #endif /// Return the handle as a TiXmlNode. This may return null. TiXmlNode* Node() const { return node; } /// Return the handle as a TiXmlElement. This may return null. TiXmlElement* Element() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } /// Return the handle as a TiXmlText. This may return null. TiXmlText* Text() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } private: TiXmlNode* node; }; #endif |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:10
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/src/graphics Modified Files: tcButton.cpp tcConsoleBox.cpp tcEditBox.cpp tcRadioButton.cpp tcStandardWindow.cpp Log Message: Replaced libxml2 with TinyXml to make Xml easier to use Index: tcRadioButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcRadioButton.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcRadioButton.cpp 20 Mar 2004 18:46:46 -0000 1.2 --- tcRadioButton.cpp 24 Mar 2004 21:09:26 -0000 1.3 *************** *** 31,35 **** #include "tcButton.h" #include "wxcommands.h" ! #include "tcXMLFile.h" #include <iostream> --- 31,35 ---- #include "tcButton.h" #include "wxcommands.h" ! #include "common/tinyxml.h" #include <iostream> *************** *** 195,199 **** * version to initialize from XML file */ ! tcRadioButton::tcRadioButton(tcWindow *parent, tcXMLNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent), caption("NULL"), --- 195,199 ---- * version to initialize from XML file */ ! tcRadioButton::tcRadioButton(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent), caption("NULL"), *************** *** 209,230 **** wxASSERT(config); if (config == NULL) return; - - int x = config->GetChildMatching("X").GetAsInt(); - int y = config->GetChildMatching("Y").GetAsInt(); - int width = config->GetChildMatching("Width").GetAsInt(); - int height = config->GetChildMatching("Height").GetAsInt(); - caption = config->GetChildMatching("Caption").GetText(); - SetCommand(config->GetChildMatching("Command").GetAsInt()); wxWindow::SetSize(x, y, width, height); // add buttons ! tcXMLNode current = config->GetChildMatching("Button"); ! while (current.IsValid()) { ! tcButton *button = new tcButton(this, ¤t); buttons.push_back(button); ! current = current.GetNextMatching("Button"); } --- 209,244 ---- wxASSERT(config); if (config == NULL) return; + TiXmlElement* current = config->ToElement(); + wxASSERT(current); + if (current == NULL) return; + + int x; + int y; + int width; + int height; + int command; + + current->Attribute("X", &x); + current->Attribute("Y", &y); + current->Attribute("Width", &width); + current->Attribute("Height", &height); + + current->Attribute("Command", &command); + SetCommand(command); + + caption = current->Attribute("Caption"); + + wxWindow::SetSize(x, y, width, height); // add buttons ! TiXmlNode* buttonNode = config->FirstChild("Button"); ! while (buttonNode) { ! tcButton *button = new tcButton(this, buttonNode); buttons.push_back(button); ! buttonNode = buttonNode->NextSibling("Button"); } Index: tcStandardWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStandardWindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcStandardWindow.cpp 20 Mar 2004 18:46:46 -0000 1.5 --- tcStandardWindow.cpp 24 Mar 2004 21:09:26 -0000 1.6 *************** *** 30,34 **** #include "tcStandardWindow.h" #include "wxcommands.h" ! #include "tcXMLFile.h" #include "tcButton.h" #include "tcRadioButton.h" --- 30,34 ---- #include "tcStandardWindow.h" #include "wxcommands.h" ! #include "common/tinyxml.h" #include "tcButton.h" #include "tcRadioButton.h" *************** *** 55,59 **** void tcStandardWindow::AddXMLControls() { ! if ((config == NULL)||(!config->GetRootNode().IsValid())) { std::cerr << "Error - tcStandardWindow::AddXMLControls - Null or invalid xml file" --- 55,59 ---- void tcStandardWindow::AddXMLControls() { ! if ((config == NULL)||(config->Error())) { std::cerr << "Error - tcStandardWindow::AddXMLControls - Null or invalid xml file" *************** *** 61,80 **** return; } - tcXMLNode root = config->GetRootNode(); // add buttons ! tcXMLNode current = root.GetChildMatching("Button"); ! while (current.IsValid()) { ! tcButton *button = new tcButton(this, ¤t); ! current = current.GetNextMatching("Button"); } // add radio buttons ! current = root.GetChildMatching("RadioButton"); ! while (current.IsValid()) { ! tcRadioButton *radioButton = new tcRadioButton(this, ¤t); ! current = current.GetNextMatching("RadioButton"); } --- 61,88 ---- return; } + // config is also the root node + TiXmlNode* root = config->FirstChild("Window"); + + if (!root) + { + std::cerr << + "Error - tcStandardWindow::AddXMLControls - <Window> xml tag not found at doc top\n"; + return; + } // add buttons ! TiXmlNode* current = root->FirstChild("Button"); ! while (current) { ! tcButton *button = new tcButton(this, current); ! current = current->NextSibling("Button"); } // add radio buttons ! current = root->FirstChild("RadioButton"); ! while (current) { ! tcRadioButton *radioButton = new tcRadioButton(this, current); ! current = current->NextSibling("RadioButton"); } *************** *** 106,110 **** if (configFile.length() > 2) { ! config = new tcXMLFile(configFile.c_str()); } else --- 114,125 ---- if (configFile.length() > 2) { ! ! config = new TiXmlDocument(configFile.c_str()); ! if (!config->LoadFile()) ! { ! delete config; ! config = NULL; ! std::cerr << "Error loading XML file " << configFile.c_str() << std::endl; ! } } else Index: tcButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcButton.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcButton.cpp 20 Mar 2004 18:46:46 -0000 1.8 --- tcButton.cpp 24 Mar 2004 21:09:26 -0000 1.9 *************** *** 30,34 **** #include "tcButton.h" #include "wxcommands.h" ! #include "tcXMLFile.h" #include "tcSound.h" #include <iostream> --- 30,34 ---- #include "tcButton.h" #include "wxcommands.h" ! #include "common/tinyxml.h" #include "tcSound.h" #include <iostream> *************** *** 222,226 **** * version to initialize from XML file */ ! tcButton::tcButton(tcWindow *parent, tcXMLNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent) { --- 222,226 ---- * version to initialize from XML file */ ! tcButton::tcButton(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLButton", parent) { *************** *** 244,262 **** if (config == NULL) return; ! int x = config->GetChildMatching("X").GetAsInt(); ! int y = config->GetChildMatching("Y").GetAsInt(); ! int width = config->GetChildMatching("Width").GetAsInt(); ! int height = config->GetChildMatching("Height").GetAsInt(); ! caption = config->GetChildMatching("Caption").GetText(); ! SetCommand(config->GetChildMatching("Command").GetAsInt()); ! std::string offImageName = config->GetChildMatching("OffImage").GetText(); ! if (offImageName.length() > 3) { ! std::string onImageName = config->GetChildMatching("OnImage").GetText(); ! std::string overOnImageName = config->GetChildMatching("OverOnImage").GetText(); ! std::string overOffImageName = config->GetChildMatching("OverOffImage").GetText(); LoadImages(offImageName, onImageName, overOffImageName, overOnImageName); - if (offImage) { --- 244,276 ---- if (config == NULL) return; ! TiXmlElement* current = config->ToElement(); ! wxASSERT(current); ! if (current == NULL) return; ! int x; ! int y; ! int width; ! int height; ! int command; ! ! current->Attribute("X", &x); ! current->Attribute("Y", &y); ! current->Attribute("Width", &width); ! current->Attribute("Height", &height); ! ! current->Attribute("Command", &command); ! SetCommand(command); ! ! caption = current->Attribute("Caption"); ! ! TiXmlNode* childNode = config->FirstChild("Image"); ! if (childNode) { ! TiXmlElement* imageElement = childNode->ToElement(); ! std::string offImageName = imageElement->Attribute("Off"); ! std::string onImageName = imageElement->Attribute("On"); ! std::string overOnImageName = imageElement->Attribute("OverOn"); ! std::string overOffImageName = imageElement->Attribute("OverOff"); LoadImages(offImageName, onImageName, overOffImageName, overOnImageName); if (offImage) { Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcConsoleBox.cpp 23 Mar 2004 18:22:37 -0000 1.1 --- tcConsoleBox.cpp 24 Mar 2004 21:09:26 -0000 1.2 *************** *** 26,30 **** #include "tcConsoleBox.h" #include "aerror.h" ! #include "tcXMLFile.h" #include <stdio.h> #include <iostream> --- 26,30 ---- #include "tcConsoleBox.h" #include "aerror.h" ! #include "common/tinyxml.h" #include <stdio.h> #include <iostream> *************** *** 240,244 **** ////////////////////////////////////////////////////////////////////// ! tcConsoleBox::tcConsoleBox(tcWindow *parent, tcXMLNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLConsoleBox", parent), mbRedraw(true), --- 240,244 ---- ////////////////////////////////////////////////////////////////////// ! tcConsoleBox::tcConsoleBox(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLConsoleBox", parent), mbRedraw(true), *************** *** 258,262 **** mpPen = NULL; ! if (!config->IsValid()) { std::cerr << "Error - bad xml config file for Console Box" << std::endl; --- 258,262 ---- mpPen = NULL; ! if (!config) { std::cerr << "Error - bad xml config file for Console Box" << std::endl; *************** *** 265,276 **** } ! int x = config->GetChildMatching("X").GetAsInt(); ! int y = config->GetChildMatching("Y").GetAsInt(); ! int width = config->GetChildMatching("Width").GetAsInt(); ! int height = config->GetChildMatching("Height").GetAsInt(); SetSize(x, y, width, height); // set all size params nyzero = height - 20; ! float fontSize = config->GetChildMatching("FontSize").GetAsFloat(); if (fontSize == 0) { --- 265,292 ---- } ! /* some of code below should be moved to a parent class so it isn't ! * repeated so much ! */ ! TiXmlElement* current = config->ToElement(); ! wxASSERT(current); ! if (current == NULL) return; ! ! // read window dimensions from XML ! int x; ! int y; ! int width; ! int height; ! ! current->Attribute("X", &x); ! current->Attribute("Y", &y); ! current->Attribute("Width", &width); ! current->Attribute("Height", &height); ! SetSize(x, y, width, height); // set all size params nyzero = height - 20; ! double fontSize; ! current->Attribute("FontSize", &fontSize); ! if (fontSize == 0) { Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcEditBox.cpp 20 Mar 2004 18:46:46 -0000 1.3 --- tcEditBox.cpp 24 Mar 2004 21:09:26 -0000 1.4 *************** *** 30,34 **** #include "tcEditBox.h" #include "tcTime.h" ! #include "tcXMLFile.h" #include "tcSound.h" #include <iostream> --- 30,34 ---- #include "tcEditBox.h" #include "tcTime.h" ! #include "common/tinyxml.h" #include "tcSound.h" #include <iostream> *************** *** 263,267 **** } ! tcEditBox::tcEditBox(tcWindow *parent, tcXMLNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLEditBox", parent), isMouseOver(false), --- 263,267 ---- } ! tcEditBox::tcEditBox(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLEditBox", parent), isMouseOver(false), *************** *** 285,303 **** mrectTextCaption.Offset(-2,-mrectTextBar.Height-2); ! if (!config->IsValid()) return; - int x = config->GetChildMatching("X").GetAsInt(); - int y = config->GetChildMatching("Y").GetAsInt(); - int width = config->GetChildMatching("Width").GetAsInt(); - int height = config->GetChildMatching("Height").GetAsInt(); SetSize(x, y, width, height); // set all size params ! std::string caption = config->GetChildMatching("Caption").GetText(); ! strcpy(mzCaption,caption.c_str()); ! mrectTextBar.X = config->GetChildMatching("BarX").GetAsFloat(); ! mrectTextBar.Y = config->GetChildMatching("BarY").GetAsFloat(); ! mrectTextBar.Width = config->GetChildMatching("BarWidth").GetAsFloat(); ! mrectTextBar.Height = config->GetChildMatching("BarHeight").GetAsFloat(); mrectTextCaption = mrectTextBar; --- 285,327 ---- mrectTextCaption.Offset(-2,-mrectTextBar.Height-2); ! if (!config) ! { ! std::cerr << "Error - tcEditBox::tcEditBox - Bad xml node\n"; ! return; ! } ! ! TiXmlElement* current = config->ToElement(); ! wxASSERT(current); ! if (current == NULL) return; ! ! // read window dimensions from XML ! int x; ! int y; ! int width; ! int height; ! ! current->Attribute("X", &x); ! current->Attribute("Y", &y); ! current->Attribute("Width", &width); ! current->Attribute("Height", &height); SetSize(x, y, width, height); // set all size params ! std::string caption = current->Attribute("Caption"); ! strcpy(mzCaption, caption.c_str()); ! // read text edit bar dimensions from XML ! double barx; ! double bary; ! double barwidth; ! double barheight; ! ! current->Attribute("BarX", &barx); ! current->Attribute("BarY", &bary); ! current->Attribute("BarWidth", &barwidth); ! current->Attribute("BarHeight", &barheight); ! ! RectF textBar(barx, bary, barwidth, barheight); ! mrectTextBar = textBar; mrectTextCaption = mrectTextBar; |
|
From: Dewitt C. <ddc...@us...> - 2004-03-24 21:20:10
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/include/graphics Modified Files: tcButton.h tcConsoleBox.h tcEditBox.h tcRadioButton.h tcStandardWindow.h Log Message: Replaced libxml2 with TinyXml to make Xml easier to use Index: tcButton.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcButton.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcButton.h 27 Feb 2004 00:07:58 -0000 1.5 --- tcButton.h 24 Mar 2004 21:09:26 -0000 1.6 *************** *** 30,34 **** #include <string> ! class tcXMLNode; /** --- 30,34 ---- #include <string> ! class TiXmlNode; /** *************** *** 56,60 **** tcButton(tcWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "PushButton"); ! tcButton(tcWindow *parent, tcXMLNode *config); virtual ~tcButton(); --- 56,60 ---- tcButton(tcWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "PushButton"); ! tcButton(tcWindow *parent, TiXmlNode *config); virtual ~tcButton(); Index: tcEditBox.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcEditBox.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcEditBox.h 2 Mar 2004 02:52:14 -0000 1.2 --- tcEditBox.h 24 Mar 2004 21:09:26 -0000 1.3 *************** *** 25,29 **** #include "tcWindow.h" ! class tcXMLNode; /** --- 25,29 ---- #include "tcWindow.h" ! class TiXmlNode; /** *************** *** 41,45 **** void SetCommand(long cmd) {command = cmd;} ! tcEditBox(tcWindow *parent, tcXMLNode *config); virtual ~tcEditBox(void); protected: --- 41,45 ---- void SetCommand(long cmd) {command = cmd;} ! tcEditBox(tcWindow *parent, TiXmlNode *config); virtual ~tcEditBox(void); protected: Index: tcStandardWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStandardWindow.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcStandardWindow.h 20 Mar 2004 18:46:46 -0000 1.6 --- tcStandardWindow.h 24 Mar 2004 21:09:26 -0000 1.7 *************** *** 32,36 **** #include "tcSound.h" ! class tcXMLFile; /** --- 32,36 ---- #include "tcSound.h" ! class TiXmlDocument; /** *************** *** 48,52 **** virtual ~tcStandardWindow(); protected: ! tcXMLFile *config; ///< XML auto-configuration file for window static Gdiplus::SolidBrush *mpBrush; static Gdiplus::Font *font20; --- 48,52 ---- virtual ~tcStandardWindow(); protected: ! TiXmlDocument *config; ///< XML auto-configuration file for window static Gdiplus::SolidBrush *mpBrush; static Gdiplus::Font *font20; Index: tcRadioButton.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcRadioButton.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcRadioButton.h 27 Feb 2004 00:07:58 -0000 1.1 --- tcRadioButton.h 24 Mar 2004 21:09:26 -0000 1.2 *************** *** 28,32 **** #include <string> ! class tcXMLNode; class tcButton; --- 28,32 ---- #include <string> ! class TiXmlNode; class tcButton; *************** *** 48,52 **** void SetSoundEffect(int effect) {soundEffect = effect;} ! tcRadioButton(tcWindow *parent, tcXMLNode *config); ///< XML configuration required for this control virtual ~tcRadioButton(); --- 48,52 ---- void SetSoundEffect(int effect) {soundEffect = effect;} ! tcRadioButton(tcWindow *parent, TiXmlNode *config); ///< XML configuration required for this control virtual ~tcRadioButton(); Index: tcConsoleBox.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcConsoleBox.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcConsoleBox.h 23 Mar 2004 18:22:37 -0000 1.1 --- tcConsoleBox.h 24 Mar 2004 21:09:26 -0000 1.2 *************** *** 32,36 **** #include "tcWindow.h" ! class tcXMLNode; /** --- 32,36 ---- #include "tcWindow.h" ! class TiXmlNode; /** *************** *** 69,73 **** void UpdateCursor(); ! tcConsoleBox(tcWindow *parent, tcXMLNode *config); virtual ~tcConsoleBox(); protected: --- 69,73 ---- void UpdateCursor(); ! tcConsoleBox(tcWindow *parent, TiXmlNode *config); virtual ~tcConsoleBox(); protected: |