gcblue-commits Mailing List for Global Conflict Blue (Page 56)
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: Dewitt C. <ddc...@us...> - 2004-04-13 21:51:44
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9290/include/common Modified Files: cspDate.h tcStream.h Log Message: Multiplayer related updates Index: cspDate.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/cspDate.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cspDate.h 15 Dec 2003 04:19:59 -0000 1.2 --- cspDate.h 13 Apr 2004 21:37:39 -0000 1.3 *************** *** 61,65 **** typedef double degree_t; ! --- 61,65 ---- typedef double degree_t; ! class tcStream; *************** *** 335,338 **** --- 335,341 ---- */ virtual std::string typeString() const { return "type::Date"; } + + tcStream& operator<<(tcStream& stream); + tcStream& operator>>(tcStream& stream); private: *************** *** 543,546 **** --- 546,552 ---- virtual std::string typeString() const { return "type::Zulu"; } + tcStream& operator<<(tcStream& stream); + tcStream& operator>>(tcStream& stream); + private: time_t m_time; *************** *** 698,701 **** --- 704,710 ---- double getLST(radian_t longitude=0.0L) const; + tcStream& operator<<(tcStream& stream); + tcStream& operator>>(tcStream& stream); + }; Index: tcStream.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcStream.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStream.h 13 Apr 2004 00:24:37 -0000 1.1 --- tcStream.h 13 Apr 2004 21:37:39 -0000 1.2 *************** *** 6,9 **** --- 6,14 ---- { public: + enum + { + WRITE_DYNAMIC = 0, + WRITE_ALL = 1 + }; bool eof(); *************** *** 12,18 **** --- 17,27 ---- void write(const char* buff, std::streamsize count); + int GetDetailLevel() const; + void SetDetailLevel(int dl); + /// write operators tcStream& operator<<(int& val); tcStream& operator<<(long& val); + tcStream& operator<<(short& val); tcStream& operator<<(bool& val); tcStream& operator<<(unsigned char& val); *************** *** 25,28 **** --- 34,38 ---- tcStream& operator>>(int& val); tcStream& operator>>(long& val); + tcStream& operator>>(short& val); tcStream& operator>>(bool& val); tcStream& operator>>(unsigned char& val); *************** *** 35,38 **** --- 45,49 ---- tcStream(); private: + int detailLevel; |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:39:03
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/include/database Modified Files: tcDBString.h Log Message: Multiplayer related updates Index: tcDBString.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBString.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDBString.h 9 Apr 2004 03:08:07 -0000 1.3 --- tcDBString.h 13 Apr 2004 00:24:37 -0000 1.4 *************** *** 29,37 **** #include "tcPool.h" #include "tcString.h" // CString replacement ! #include "tcFile.h" // tcFile replacement ! #include <sstream> #include "tcFile.h" namespace Database { --- 29,38 ---- #include "tcPool.h" #include "tcString.h" // CString replacement ! #include "tcFile.h" // CFile replacement #include "tcFile.h" + class tcStream; + namespace Database { *************** *** 49,54 **** void operator= (const char *s); ! std::stringstream& operator<<(std::stringstream& buffer); ! std::stringstream& operator>>(std::stringstream& buffer); int Serialize(tcFile& file, bool mbLoad); tcDBString(); --- 50,55 ---- void operator= (const char *s); ! tcStream& operator<<(tcStream& stream); ! tcStream& operator>>(tcStream& stream); int Serialize(tcFile& file, bool mbLoad); tcDBString(); |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:39:01
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/include/common Modified Files: simmath.h Added Files: tcStream.h Log Message: Multiplayer related updates --- NEW FILE: tcStream.h --- #include <sstream> class tcStream : private std::stringstream { public: bool eof(); void read(char* buff, std::streamsize count); size_t size(); void write(const char* buff, std::streamsize count); /// write operators tcStream& operator<<(int& val); tcStream& operator<<(long& val); tcStream& operator<<(bool& val); tcStream& operator<<(unsigned char& val); tcStream& operator<<(unsigned int& val); tcStream& operator<<(float& val); tcStream& operator<<(double& val); tcStream& operator<<(std::string& val); /// read operators tcStream& operator>>(int& val); tcStream& operator>>(long& val); tcStream& operator>>(bool& val); tcStream& operator>>(unsigned char& val); tcStream& operator>>(unsigned int& val); tcStream& operator>>(float& val); tcStream& operator>>(double& val); tcStream& operator>>(std::string& val); tcStream(const char* data, std::streamsize count); ///< creates stream from char array tcStream(); private: }; Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** simmath.h 9 Apr 2004 03:08:07 -0000 1.11 --- simmath.h 13 Apr 2004 00:24:37 -0000 1.12 *************** *** 31,35 **** #include "gctypes.h" #include "tcDatabaseObject.h" - #include <sstream> #ifndef UINT8 --- 31,34 ---- *************** *** 37,40 **** --- 36,40 ---- #endif + class tcStream; class tcPoint *************** *** 148,151 **** --- 148,153 ---- void Set(float x,float y) {mfLon_rad=x;mfLat_rad=y;} void Set(float x,float y,float z) {mfLon_rad=x;mfLat_rad=y;mfAlt_m=z;} + tcStream& operator<<(tcStream& buffer); + tcStream& operator>>(tcStream& buffer); }; *************** *** 179,186 **** void GetInterceptData3D(const tcTrack& track, float& rfHeading_rad, float& rfClimbAngle_rad, float& rfTimeToIntercept, float& rfRange_rad); - void LoadFromStream(std::stringstream& buffer); - void SaveToStream(std::stringstream& buffer); void Serialize(tcFile& file, bool abLoad); void SetRelativeGeo(tsGeoPoint& rpGeoPoint, float afBearing_rad, float afRange_km); }; --- 181,188 ---- void GetInterceptData3D(const tcTrack& track, float& rfHeading_rad, float& rfClimbAngle_rad, float& rfTimeToIntercept, float& rfRange_rad); void Serialize(tcFile& file, bool abLoad); void SetRelativeGeo(tsGeoPoint& rpGeoPoint, float afBearing_rad, float afRange_km); + tcStream& operator<<(tcStream& stream); + tcStream& operator>>(tcStream& stream); }; |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:39:01
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636 Modified Files: GCblue.vcproj Log Message: Multiplayer related updates Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** GCblue.vcproj 7 Apr 2004 00:41:06 -0000 1.49 --- GCblue.vcproj 13 Apr 2004 00:24:36 -0000 1.50 *************** *** 194,197 **** --- 194,200 ---- </File> <File + RelativePath=".\src\common\tcStream.cpp"> + </File> + <File RelativePath="src\common\tcString.cpp"> </File> *************** *** 516,519 **** --- 519,525 ---- RelativePath=".\src\network\tcTextMessageHandler.cpp"> </File> + <File + RelativePath=".\src\network\tcUpdateMessageHandler.cpp"> + </File> </Filter> </Filter> *************** *** 570,573 **** --- 576,582 ---- </File> <File + RelativePath=".\include\common\tcStream.h"> + </File> + <File RelativePath="include\common\tcString.h"> </File> *************** *** 892,895 **** --- 901,907 ---- RelativePath=".\include\network\tcTextMessageHandler.h"> </File> + <File + RelativePath=".\include\network\tcUpdateMessageHandler.h"> + </File> </Filter> </Filter> |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:39:01
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/docs Modified Files: CHANGES.txt Log Message: Multiplayer related updates Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGES.txt 11 Apr 2004 22:27:59 -0000 1.12 --- CHANGES.txt 13 Apr 2004 00:24:36 -0000 1.13 *************** *** 3,8 **** --- 3,13 ---- 0.6 --------------------------------------------------------------------- + *** 2004-04-13 Dewitt Colclough *** + - Added more object serialization updates + - Created basic multiplayer update handler class + *** 2004-04-12 Xavi Rubio *** - Linux compatibility fixes in graphics dirs + *** 2004-04-09 Dewitt Colclough *** - Added client-mode to simstate update |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:45
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/src/sim Modified Files: tcGameObject.cpp tcGuidanceState.cpp tcLauncherState.cpp tcPlatformObject.cpp tcSimState.cpp Log Message: Multiplayer related updates Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcSimState.cpp 9 Apr 2004 03:08:09 -0000 1.38 --- tcSimState.cpp 13 Apr 2004 00:24:39 -0000 1.39 *************** *** 39,43 **** #include "tc3DModel.h" #include "tcGameObjIterator.h" ! using namespace Database; --- 39,43 ---- #include "tc3DModel.h" #include "tcGameObjIterator.h" ! #include "common/tcStream.h" using namespace Database; *************** *** 1517,1523 **** file.WriteString(buff); ! std::stringstream test; ! pplat->SaveToStream(test); ! pplat->LoadFromStream(test); idx++; --- 1517,1539 ---- file.WriteString(buff); ! /* ! tcStream test2; ! size_t s1 = test2.size(); ! ! *pplat >> test2; ! ! size_t s2 = test2.size(); ! ! pplat->Clear(); ! *pplat << test2; ! ! size_t s3 = test2.size(); ! ! int x = 7; ! test2 >> x; ! ! bool isEOF = false; ! isEOF = test2.eof(); ! */ idx++; Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcPlatformObject.cpp 15 Feb 2004 19:47:23 -0000 1.18 --- tcPlatformObject.cpp 13 Apr 2004 00:24:39 -0000 1.19 *************** *** 31,34 **** --- 31,35 ---- #include "tcESMSensor.h" #include "tc3DModel.h" + #include "common/tcStream.h" using namespace AI; *************** *** 465,468 **** --- 466,493 ---- } + /** + * Loads state from stream + */ + tcStream& tcPlatformObject::operator<<(tcStream& stream) + { + tcGameObject::operator<<(stream); + + mcGS << stream; + + return stream; + } + + /** + * Saves state to stream + */ + tcStream& tcPlatformObject::operator>>(tcStream& stream) + { + tcGameObject::operator>>(stream); + + mcGS >> stream; + + return stream; + } + /******************************************************************************/ tcPlatformObject::tcPlatformObject() Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcLauncherState.cpp 12 Feb 2004 01:54:49 -0000 1.7 --- tcLauncherState.cpp 13 Apr 2004 00:24:39 -0000 1.8 *************** *** 26,29 **** --- 26,86 ---- #include "tcSimState.h" #include <iostream> + #include "common/tcStream.h" + + /** + * Load state from stream + */ + tcStream& tsLData::operator <<(tcStream& buffer) + { + buffer >> mbActive; + buffer >> mnDBKey; + buffer >> mnChildDBKey; + + buffer >> mfTimeToReady; + buffer >> mnCurrent; + buffer >> mnPending; + + msDatum << buffer; + + buffer >> mnTargetID; + + int temp; + buffer >> temp; + meLaunchMode = (Database::teWeaponLaunchMode)temp; + + buffer >> mnTargetFlags; + buffer >> pointingAngle; + buffer >> fireControlSensorIdx; + + return buffer; + } + + /** + * Save state to stream + */ + tcStream& tsLData::operator >>(tcStream& buffer) + { + buffer << mbActive; + buffer << mnDBKey; + buffer << mnChildDBKey; + + buffer << mfTimeToReady; + buffer << mnCurrent; + buffer << mnPending; + + msDatum >> buffer; + + buffer << mnTargetID; + + int temp = (int)meLaunchMode; + buffer << temp; + + buffer << mnTargetFlags; + buffer << pointingAngle; + buffer << fireControlSensorIdx; + + return buffer; + } + tcDatabase* tcLauncherState::mpDatabase = NULL; *************** *** 332,335 **** --- 389,425 ---- } + /** + * Load state from stream + */ + tcStream& tcLauncherState::operator<<(tcStream& buffer) + { + launchers.clear(); + + buffer >> mnCount; + for(int n = 0; n < mnCount; n++) + { + tsLData ldata; + ldata << buffer; + launchers.push_back(ldata); + } + + return buffer; + } + + /** + * Save state to stream + */ + tcStream& tcLauncherState::operator>>(tcStream& buffer) + { + buffer << mnCount; + for(int n = 0; n < mnCount; n++) + { + tsLData& ldata = launchers[n]; + ldata >> buffer; + } + + return buffer; + } + /** Index: tcGuidanceState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGuidanceState.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGuidanceState.cpp 4 Dec 2003 05:15:22 -0000 1.1 --- tcGuidanceState.cpp 13 Apr 2004 00:24:39 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- #include "tcGuidanceState.h" + #include "common/tcStream.h" /** *************** *** 51,53 **** --- 52,82 ---- rsKinGoal.mfSpeed_kts = mfGoalSpeed_kts; rsKinGoal.mfAlt_m = mfGoalAltitude_m; + } + + /** + * Loads state from stream + */ + tcStream& tcGuidanceState::operator<<(tcStream& stream) + { + stream >> mfGoalHeading_deg; + stream >> mfGoalSpeed_kts; + stream >> mfGoalAltitude_m; + mcKinIntercept << stream; + stream >> mbIntercept; + + return stream; + } + + /** + * Saves state to stream + */ + tcStream& tcGuidanceState::operator>>(tcStream& stream) + { + stream << mfGoalHeading_deg; + stream << mfGoalSpeed_kts; + stream << mfGoalAltitude_m; + mcKinIntercept >> stream; + stream << mbIntercept; + + return stream; } \ No newline at end of file Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcGameObject.cpp 9 Apr 2004 03:08:09 -0000 1.12 --- tcGameObject.cpp 13 Apr 2004 00:24:39 -0000 1.13 *************** *** 29,54 **** #include "tc3DModel.h" #include "tcSimState.h" ! void tsRelativePosition::LoadFromStream(std::stringstream& buffer) { ! buffer.read((char*)&dx, sizeof(dx)); ! buffer.read((char*)&dy, sizeof(dy)); ! buffer.read((char*)&dz, sizeof(dz)); ! buffer.read((char*)&yaw, sizeof(yaw)); ! buffer.read((char*)&pitch, sizeof(pitch)); ! buffer.read((char*)&roll, sizeof(roll)); ! buffer.read((char*)&isVisible, sizeof(isVisible)); } ! void tsRelativePosition::SaveToStream(std::stringstream& buffer) { ! buffer.write((char*)&dx, sizeof(dx)); ! buffer.write((char*)&dy, sizeof(dy)); ! buffer.write((char*)&dz, sizeof(dz)); ! buffer.write((char*)&yaw, sizeof(yaw)); ! buffer.write((char*)&pitch, sizeof(pitch)); ! buffer.write((char*)&roll, sizeof(roll)); ! buffer.write((char*)&isVisible, sizeof(isVisible)); } --- 29,65 ---- #include "tc3DModel.h" #include "tcSimState.h" + #include "common/tcStream.h" ! /** ! * Loads state from stream ! */ ! tcStream& tsRelativePosition::operator<<(tcStream& stream) { ! stream >> dx; ! stream >> dy; ! stream >> dz; ! stream >> yaw; ! stream >> pitch; ! stream >> roll; ! stream >> isVisible; ! ! return stream; } ! /** ! * Saves state to stream ! */ ! tcStream& tsRelativePosition::operator>>(tcStream& stream) { ! stream << dx; ! stream << dy; ! stream << dz; ! stream << yaw; ! stream << pitch; ! stream << roll; ! stream << isVisible; ! ! return stream; } *************** *** 256,306 **** /** ! * Loads object state from stream */ ! void tcGameObject::LoadFromStream(std::stringstream& buffer) { ! rel_pos.LoadFromStream(buffer); ! buffer.read((char*)&mnModelType, sizeof(mnModelType)); ! buffer.read((char*)&mnID, sizeof(mnID)); ! mzClass << buffer; ! buffer.read((char*)&mnDBKey, sizeof(mnID)); ! mzUnit << buffer; ! buffer.read((char*)&mnAlliance, sizeof(mnAlliance)); ! buffer.read((char*)&mfStatusTime, sizeof(mfStatusTime)); ! mcKin.LoadFromStream(buffer); ! buffer.read((char*)&mfDamageLevel, sizeof(mfDamageLevel)); } /** ! * Saves object state to stream */ ! void tcGameObject::SaveToStream(std::stringstream& buffer) { ! rel_pos.SaveToStream(buffer); ! buffer.write((char*)&mnModelType, sizeof(mnModelType)); ! buffer.write((char*)&mnID, sizeof(mnID)); ! mzClass >> buffer; ! buffer.write((char*)&mnDBKey, sizeof(mnID)); ! ! mzUnit >> buffer; ! buffer.write((char*)&mnAlliance, sizeof(mnAlliance)); ! buffer.write((char*)&mfStatusTime, sizeof(mfStatusTime)); ! mcKin.SaveToStream(buffer); ! buffer.write((char*)&mfDamageLevel, sizeof(mfDamageLevel)); } /** * --- 267,322 ---- /** ! * Loads state from stream */ ! tcStream& tcGameObject::operator<<(tcStream& stream) { ! rel_pos << stream; ! stream >> mnModelType; ! stream >> mnID; ! mzClass << stream; ! stream >> mnDBKey; ! mzUnit << stream; ! stream >> mnAlliance; ! stream >> mfStatusTime; ! mcKin << stream; ! stream >> mfDamageLevel; ! ! return stream; } /** ! * Saves state to stream */ ! tcStream& tcGameObject::operator>>(tcStream& stream) { ! rel_pos >> stream; ! stream << mnModelType; ! stream << mnID; ! mzClass >> stream; ! stream << mnDBKey; ! mzUnit >> stream; ! stream << mnAlliance; ! stream << mfStatusTime; ! mcKin >> stream; ! ! stream << mfDamageLevel; ! ! return stream; } + /** * |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:34
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/src/network Modified Files: tcMultiplayerInterface.cpp Added Files: tcUpdateMessageHandler.cpp Log Message: Multiplayer related updates --- NEW FILE: tcUpdateMessageHandler.cpp --- /** * @file tcUpdateMessageHandler.cpp * * Copyright (C) 2004 Dewitt Colclough (de...@tw...) * All rights reserved. * * This file is part of the Global Conflict Blue (GCB) program. * GCB is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * GCB 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 GCB; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wx/string.h" #include "wx/event.h" #include "network/tcUpdateMessageHandler.h" #include "network/tcMultiplayerInterface.h" #include "tcSimState.h" #include "wxcommands.h" #include "common/tcStream.h" BEGIN_NAMESPACE(network) /** * Add update for game object to stream */ void tcUpdateMessageHandler::AddUpdate(tcGameObject* obj, tcStream& stream) { stream << obj->mnID; // write id stream << obj->mnDBKey; // write database key (to support object creation) // write obj state to stream *obj >> stream; } void tcUpdateMessageHandler::Handle(int connectionId, unsigned messageSize, const unsigned char *data) { // server ignores update messages if (isServer) { fprintf(stderr, "Warning - update message received by server\n"); return; } tcSimState* simState = tcSimState::Get(); wxASSERT(simState); tcDatabase* database = simState->mpDatabase; // convert database to singleton eventually tcStream stream((const char*)data, messageSize); fprintf(stdout, "Updating objs, time %.1f: ", simState->GetTime()); long id; long databaseId = -1; while ((stream >> id).eof() == false) { stream >> databaseId; // lookup obj tcGameObject* obj = simState->GetObject(id); // update obj if it exists, otherwise create object if (obj) { *obj << stream; fprintf(stdout, "%d ", id); } else { tcDatabaseObject* dbObj = database->GetObject(databaseId); if (dbObj) { obj = simState->CreateGameObject(dbObj); *obj << stream; simState->AddPlatformWithKey(obj, id); fprintf(stdout, "%d (NEW) ", id); } else { std::cerr << "Bad update, database entry not found\n"; return; } } } fprintf(stdout, "\n"); } tcUpdateMessageHandler::tcUpdateMessageHandler() { } tcUpdateMessageHandler::~tcUpdateMessageHandler() { } END_NAMESPACE Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMultiplayerInterface.cpp 9 Apr 2004 03:08:08 -0000 1.6 --- tcMultiplayerInterface.cpp 13 Apr 2004 00:24:39 -0000 1.7 *************** *** 30,37 **** --- 30,41 ---- #include "network/tcTextMessageHandler.h" #include "network/tcControlMessageHandler.h" + #include "network/tcUpdateMessageHandler.h" + #include "common/tcStream.h" #include <iostream> #include <queue> #include "tcSound.h" #include "tcTime.h" + #include "tcSimState.h" + #include "tcGameObjIterator.h" BEGIN_NAMESPACE(network) *************** *** 185,189 **** else { // client-specific handlers ! } } --- 189,193 ---- else { // client-specific handlers ! AddMessageHandler(MSG_UPDATE, new tcUpdateMessageHandler()); } } *************** *** 456,459 **** --- 460,476 ---- } + void tcMultiplayerInterface::SendUpdateMessage(int destination, tcStream& stream) + { + size_t streamSize = stream.size(); + char* buffer = new char[streamSize]; + stream.read(buffer, streamSize); + + networkInterface->SendMessage(destination, MSG_UPDATE, streamSize, (unsigned char*)buffer, + tcNetworkInterface::TCP); + + delete buffer; + + } + /** * 0 - UDP, otherwise - TCP *************** *** 498,504 **** --- 515,568 ---- ProcessReceiveMessages(); + // update player information UpdatePlayerInfo(); + + UpdateObjects(); } + /** + * Server only for now, send state updates on objects to clients + */ + void tcMultiplayerInterface::UpdateObjects() + { + static double lastUpdate = -1; + + if (!IsServer()) return; + + tcSimState* simState = tcSimState::Get(); + wxASSERT(simState); + + double t = simState->GetTime(); + if (t <= lastUpdate + 2.0) return; + + lastUpdate = t; + + // iterate through all game objects and build update stream + tcStream stream; + tcGameObjIterator iter; + int idx = 0; + for (iter.First();iter.NotDone();iter.Next()) + { + tcGameObject* obj = iter.Get(); + if (simState->mpUserInfo->IsOwnAlliance(obj->mnAlliance)) + { + tcUpdateMessageHandler::AddUpdate(obj, stream); + } + } + + // send update message to all clients + unsigned nConnections = GetNumConnections(); + + for (unsigned n=0;n<nConnections;n++) + { + int connId = GetConnectionId(n); + SendUpdateMessage(connId, stream); + } + if (nConnections) + { + fprintf(stdout, "Sent obj state update, time: %.1f\n", t); + } + + } /** |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:33
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/src/common Modified Files: simmath.cpp Added Files: tcStream.cpp Log Message: Multiplayer related updates Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** simmath.cpp 9 Apr 2004 03:08:08 -0000 1.8 --- simmath.cpp 13 Apr 2004 00:24:38 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- #include "simmath.h" #include "nsNav.h" + #include "common/tcStream.h" void ConformLonLatRad(float &lon_rad, float &lat_rad) { *************** *** 316,319 **** --- 317,346 ---- } } + + /********************** tsGeoPoint *************************************/ + /** + * Load state from stream + */ + tcStream& tsGeoPoint::operator<<(tcStream& stream) + { + stream >> mfLon_rad; + stream >> mfLat_rad; + stream >> mfAlt_m; + + return stream; + } + + /** + * Save state to stream + */ + tcStream& tsGeoPoint::operator>>(tcStream& stream) + { + stream << mfLon_rad; + stream << mfLat_rad; + stream << mfAlt_m; + + return stream; + } + /******************************* tcKinematics *******************************/ *************** *** 392,419 **** } ! void tcKinematics::LoadFromStream(std::stringstream& buffer) { ! buffer.read((char*)&mfLon_rad, sizeof(mfLon_rad)); ! buffer.read((char*)&mfLat_rad, sizeof(mfLat_rad)); ! buffer.read((char*)&mfAlt_m, sizeof(mfAlt_m)); ! buffer.read((char*)&mfHeading_rad, sizeof(mfHeading_rad)); ! buffer.read((char*)&mfClimbAngle_rad, sizeof(mfClimbAngle_rad)); ! buffer.read((char*)&mfYaw_rad, sizeof(mfYaw_rad)); ! buffer.read((char*)&mfPitch_rad, sizeof(mfPitch_rad)); ! buffer.read((char*)&mfRoll_rad, sizeof(mfRoll_rad)); ! buffer.read((char*)&mfSpeed_kts, sizeof(mfSpeed_kts)); } ! void tcKinematics::SaveToStream(std::stringstream& buffer) { ! buffer.write((char*)&mfLon_rad, sizeof(mfLon_rad)); ! buffer.write((char*)&mfLat_rad, sizeof(mfLat_rad)); ! buffer.write((char*)&mfAlt_m, sizeof(mfAlt_m)); ! buffer.write((char*)&mfHeading_rad, sizeof(mfHeading_rad)); ! buffer.write((char*)&mfClimbAngle_rad, sizeof(mfClimbAngle_rad)); ! buffer.write((char*)&mfYaw_rad, sizeof(mfYaw_rad)); ! buffer.write((char*)&mfPitch_rad, sizeof(mfPitch_rad)); ! buffer.write((char*)&mfRoll_rad, sizeof(mfRoll_rad)); ! buffer.write((char*)&mfSpeed_kts, sizeof(mfSpeed_kts)); } --- 419,456 ---- } ! /** ! * Load state from stream ! */ ! tcStream& tcKinematics::operator<<(tcStream& stream) { ! stream >> mfLon_rad; ! stream >> mfLat_rad; ! stream >> mfAlt_m; ! stream >> mfHeading_rad; ! stream >> mfClimbAngle_rad; ! stream >> mfYaw_rad; ! stream >> mfPitch_rad; ! stream >> mfRoll_rad; ! stream >> mfSpeed_kts; ! ! return stream; } ! /** ! * Save state to stream ! */ ! tcStream& tcKinematics::operator>>(tcStream& stream) { ! stream << mfLon_rad; ! stream << mfLat_rad; ! stream << mfAlt_m; ! stream << mfHeading_rad; ! stream << mfClimbAngle_rad; ! stream << mfYaw_rad; ! stream << mfPitch_rad; ! stream << mfRoll_rad; ! stream << mfSpeed_kts; ! ! return stream; } --- NEW FILE: tcStream.cpp --- #include "tcStream.h" #include <iostream> /** * creates stream from char array */ tcStream::tcStream(const char* data, std::streamsize count) { std::stringstream::write(data, count); } /** * default constructor */ tcStream::tcStream() { } /** * @return true if end of stream has been reached */ bool tcStream::eof() { return std::stringstream::eof(); } void tcStream::read(char* buff, std::streamsize count) { std::stringstream::read(buff, count); } /** * @return size of stream in bytes */ size_t tcStream::size() { return std::stringstream::str().size(); } void tcStream::write(const char* buff, std::streamsize count) { std::stringstream::write(buff, count); } /*** write operators ***/ tcStream& tcStream::operator<<(int& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(long& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(unsigned char& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(unsigned int& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(bool& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(float& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(double& val) { write((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator<<(std::string& val) { size_t len = val.size(); write((char*)&len, sizeof(len)); write(val.c_str(), (std::streamsize)len); return *this; } /*** read operators ***/ tcStream& tcStream::operator>>(int& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(long& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(unsigned char& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(unsigned int& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(bool& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(float& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(double& val) { read((char*)&val, sizeof(val)); return *this; } tcStream& tcStream::operator>>(std::string& val) { size_t len; read((char*)&len, sizeof(len)); if (len >= 2048) { std::cerr << "tcStream::operator>>(std::string& val) - length overflow\n"; } else { char* buffer = new char[len+1]; read(buffer, (std::streamsize)len); buffer[len] = 0; // add terminating null char val = buffer; delete buffer; } return *this; } |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:33
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/src/database Modified Files: tcDBString.cpp Log Message: Multiplayer related updates Index: tcDBString.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDBString.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDBString.cpp 9 Apr 2004 03:08:08 -0000 1.3 --- tcDBString.cpp 13 Apr 2004 00:24:38 -0000 1.4 *************** *** 23,26 **** --- 23,27 ---- #include "tcDBString.h" #include "tcString.h" + #include "common/tcStream.h" namespace Database *************** *** 126,145 **** } ! std::stringstream& tcDBString::operator<<(std::stringstream& buffer) { size_t len; - buffer.read((char*)&len, sizeof(len)); - buffer.read(mz, len); ! return buffer; } ! std::stringstream& tcDBString::operator>>(std::stringstream& buffer) { size_t len = strlen(mz); ! buffer.write((char*)&len, sizeof(len)); ! buffer.write(mz, len); ! return buffer; } --- 127,155 ---- } ! tcStream& tcDBString::operator<<(tcStream& stream) { size_t len; ! stream.read((char*)&len, sizeof(len)); ! if (len >= DB_STRING_SIZE) ! { ! std::cerr << "tcStream::operator>>(std::string& val) - length overflow\n"; ! } ! else ! { ! stream.read(mz, (std::streamsize)len); ! mz[len] = 0; // add terminating null char ! } ! ! return stream; } ! tcStream& tcDBString::operator>>(tcStream& stream) { size_t len = strlen(mz); ! stream.write((char*)&len, sizeof(len)); ! stream.write(mz, len); ! return stream; } |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:33
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/include/network Modified Files: tcMessage.h tcMultiplayerInterface.h Added Files: tcUpdateMessageHandler.h Log Message: Multiplayer related updates --- NEW FILE: tcUpdateMessageHandler.h --- /** @file tcUpdateMessageHandler.h * * Copyright (C) 2004 Dewitt Colclough (de...@tw...) * All rights reserved. * * This file is part of the Global Conflict Blue (GCB) program. * GCB is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * GCB 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 GCB; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _UPDATEMESSAGEHANDLER_H_ #define _UPDATEMESSAGEHANDLER_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <queue> #include <string> #include "network/tcMessageHandler.h" class tcGameObject; class tcStream; #define BEGIN_NAMESPACE(x) namespace x { #define END_NAMESPACE } BEGIN_NAMESPACE(network) /** * Game object update handler */ class tcUpdateMessageHandler : public tcMessageHandler { public: static void AddUpdate(tcGameObject* obj, tcStream& stream); virtual void Handle(int connectionId, unsigned messageSize, const unsigned char *data); tcUpdateMessageHandler(); virtual ~tcUpdateMessageHandler(); }; END_NAMESPACE #endif Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMultiplayerInterface.h 9 Apr 2004 03:08:07 -0000 1.7 --- tcMultiplayerInterface.h 13 Apr 2004 00:24:37 -0000 1.8 *************** *** 37,40 **** --- 37,41 ---- class wxEvtHandler; + class tcStream; BEGIN_NAMESPACE(network) *************** *** 42,47 **** class tcNetworkInterface; class tcMessageHandler; - class tcPlayerStatus { public: --- 43,48 ---- class tcNetworkInterface; class tcMessageHandler; class tcPlayerStatus + { public: *************** *** 66,70 **** MSG_CHATTEXT = 1, MSG_CONTROL = 2, ! MSG_USERNAME = 3 }; static tcMultiplayerInterface* Get(); --- 67,72 ---- MSG_CHATTEXT = 1, MSG_CONTROL = 2, ! MSG_USERNAME = 3, ! MSG_UPDATE = 4 }; static tcMultiplayerInterface* Get(); *************** *** 91,94 **** --- 93,97 ---- void SendControlMessage(int destination, int messageCode); void SendTestUDP(int destination, std::string message); + void SendUpdateMessage(int destination, tcStream& stream); void SetChatProtocol(int code); void SetEvtHandler(wxEvtHandler *eh); *************** *** 113,116 **** --- 116,120 ---- void ProcessReceiveMessages(); + void UpdateObjects(); void UpdatePlayerInfo(); Index: tcMessage.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMessage.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMessage.h 4 Apr 2004 20:52:23 -0000 1.4 --- tcMessage.h 13 Apr 2004 00:24:37 -0000 1.5 *************** *** 37,41 **** enum { ! BUFFER_SIZE = 1024, /// < max size in bytes of total message including header HEADER_SIZE = 8, SIZE_SIZE = 2, ///< size of messageSize field (first field in header) --- 37,41 ---- enum { ! BUFFER_SIZE = 2048, /// < max size in bytes of total message including header HEADER_SIZE = 8, SIZE_SIZE = 2, ///< size of messageSize field (first field in header) |
|
From: Dewitt C. <ddc...@us...> - 2004-04-13 00:38:33
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27636/include/sim Modified Files: tcGameObject.h tcGuidanceState.h tcLauncherState.h tcPlatformObject.h Log Message: Multiplayer related updates Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcGameObject.h 9 Apr 2004 03:08:07 -0000 1.15 --- tcGameObject.h 13 Apr 2004 00:24:37 -0000 1.16 *************** *** 42,45 **** --- 42,46 ---- class tcSimState; + class tcStream; /** *************** *** 67,72 **** bool isVisible; ! void LoadFromStream(std::stringstream& buffer); ! void SaveToStream(std::stringstream& buffer); }; --- 68,73 ---- bool isVisible; ! tcStream& operator<<(tcStream& stream); ! tcStream& operator>>(tcStream& stream); }; *************** *** 108,113 **** virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); ! virtual void LoadFromStream(std::stringstream& buffer); ! virtual void SaveToStream(std::stringstream& buffer); virtual void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); --- 109,116 ---- virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); ! virtual tcStream& operator<<(tcStream& stream); ! virtual tcStream& operator>>(tcStream& stream); ! ! virtual void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); Index: tcGuidanceState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGuidanceState.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGuidanceState.h 4 Dec 2003 05:15:22 -0000 1.1 --- tcGuidanceState.h 13 Apr 2004 00:24:37 -0000 1.2 *************** *** 25,35 **** #include "simmath.h" /** * */ ! typedef struct _guidanceparams { long mnTargetID; double mfInterceptTime; ! } tsGuidanceParameters; /** --- 25,38 ---- #include "simmath.h" + class tcStream; + /** * */ ! struct tsGuidanceParameters ! { long mnTargetID; double mfInterceptTime; ! }; /** *************** *** 51,54 **** --- 54,59 ---- void SetAltitude(float afNewAltitude_m) {mfGoalAltitude_m=afNewAltitude_m;} void GetKinGoal(tcKinematics& rsKinCurrent,tcKinematics& rsKinGoal); + tcStream& operator<<(tcStream& stream); + tcStream& operator>>(tcStream& stream); }; #endif \ No newline at end of file Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcLauncherState.h 1 Feb 2004 22:19:08 -0000 1.5 --- tcLauncherState.h 13 Apr 2004 00:24:37 -0000 1.6 *************** *** 40,43 **** --- 40,44 ---- class tcSimState; class tcRadar; + class tcStream; /** *************** *** 65,68 **** --- 66,72 ---- tcRadar *fireControlSensor; ///< sensor for fire control guidance unsigned fireControlSensorIdx; ///< index of sensor on parent platform + + tcStream& operator<<(tcStream& buffer); + tcStream& operator>>(tcStream& buffer); }; *************** *** 102,105 **** --- 106,111 ---- bool IsSeekerLaunch(unsigned anLauncher); + tcStream& operator<<(tcStream& buffer); + tcStream& operator>>(tcStream& buffer); void Serialize(tcFile& file, bool abLoad); void SetFireControlSensor(unsigned nLauncher, tcRadar* radar, unsigned sensorIdx); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcPlatformObject.h 15 Feb 2004 19:47:22 -0000 1.13 --- tcPlatformObject.h 13 Apr 2004 00:24:37 -0000 1.14 *************** *** 29,32 **** --- 29,34 ---- using namespace AI; + class tcStream; + namespace Database { *************** *** 82,85 **** --- 84,90 ---- void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); + virtual tcStream& operator<<(tcStream& stream); + virtual tcStream& operator>>(tcStream& stream); + tcPlatformObject(void); |
|
From: Xavi <xr...@us...> - 2004-04-11 22:41:42
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10751 Modified Files: CHANGES.txt Log Message: + committed changes to graphics dir Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CHANGES.txt 9 Apr 2004 03:08:06 -0000 1.11 --- CHANGES.txt 11 Apr 2004 22:27:59 -0000 1.12 *************** *** 3,6 **** --- 3,8 ---- 0.6 --------------------------------------------------------------------- + *** 2004-04-12 Xavi Rubio *** + - Linux compatibility fixes in graphics dirs *** 2004-04-09 Dewitt Colclough *** - Added client-mode to simstate update |
|
From: Xavi <xr...@us...> - 2004-04-11 22:39:59
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10421 Modified Files: tc3DModel.cpp Log Message: + added ifdef MSV where needed + newline at the end of file Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tc3DModel.cpp 21 Mar 2004 21:03:25 -0000 1.7 --- tc3DModel.cpp 11 Apr 2004 22:26:16 -0000 1.8 *************** *** 22,30 **** #ifndef WX_PRECOMP ! #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #endif #include "tc3DModel.h" --- 22,30 ---- #ifndef WX_PRECOMP ! #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tc3DModel.h" *************** *** 403,405 **** tc3DModel::~tc3DModel() { ! } \ No newline at end of file --- 403,406 ---- tc3DModel::~tc3DModel() { ! } ! |
|
From: Xavi <xr...@us...> - 2004-04-11 22:39:16
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10256 Modified Files: tcGraphicsEngine.cpp Log Message: + added ifdef MSV where needed + newline at the end of file Index: tcGraphicsEngine.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGraphicsEngine.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcGraphicsEngine.cpp 20 Mar 2004 18:46:46 -0000 1.14 --- tcGraphicsEngine.cpp 11 Apr 2004 22:25:33 -0000 1.15 *************** *** 25,36 **** #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif ! #endif #include "tcGraphicsEngine.h" ! #include <GL\gl.h> // Header file for the OpenGL32 library ! #include <GL\glu.h> // Header file for the GLu32 library ! #include <GL\glaux.h> // Header file for the GLaux library ! #include "aerror.h" #include <math.h> #include "tcString.h" --- 25,36 ---- #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tcGraphicsEngine.h" ! #include <GL/gl.h> // Header file for the OpenGL32 library ! #include <GL/glu.h> // Header file for the GLu32 library ! #include <GL/glaux.h> // Header file for the GLaux library ! #include "AError.h" #include <math.h> #include "tcString.h" *************** *** 39,43 **** --- 39,45 ---- #include "wx/dcscreen.h" + #if _MSC_VER > 1000 #pragma warning( disable: 4312) //'type cast' : conversion from 'WXHDC' to 'HDC' of greater size + #endif #ifndef GL_EXT_bgra *************** *** 866,867 **** --- 868,870 ---- DeleteAllSurfaces(); } + |
|
From: Xavi <xr...@us...> - 2004-04-11 22:35:53
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9724 Modified Files: tcWindow.cpp Log Message: + added ifdef MSV where needed + newline at the end of file Index: tcWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcWindow.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcWindow.cpp 4 Apr 2004 21:49:33 -0000 1.1 --- tcWindow.cpp 11 Apr 2004 22:22:11 -0000 1.2 *************** *** 24,34 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tcWindow.h" #include "gdiplus.h" #include "tcGraphicsEngine.h" ! #include "aerror.h" #include <stdio.h> #include <iostream> --- 24,36 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tcWindow.h" #include "gdiplus.h" #include "tcGraphicsEngine.h" ! #include "AError.h" #include <stdio.h> #include <iostream> |
|
From: Xavi <xr...@us...> - 2004-04-11 22:35:26
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9621 Modified Files: tcFIFO.cpp Log Message: + newline at the end of file + changed tcfifo.h to tcFIFO.h Index: tcFIFO.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFIFO.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcFIFO.cpp 19 Oct 2003 17:46:01 -0000 1.2 --- tcFIFO.cpp 11 Apr 2004 22:21:38 -0000 1.3 *************** *** 19,23 **** ! #include "tcfifo.h" --- 19,23 ---- ! #include "tcFIFO.h" *************** *** 96,98 **** tcStack::~tcStack(void) { mnMinSize = 0; ! } \ No newline at end of file --- 96,99 ---- tcStack::~tcStack(void) { mnMinSize = 0; ! } ! |
|
From: Xavi <xr...@us...> - 2004-04-11 22:33:14
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9180 Modified Files: tc2DGraphicsSurface.cpp Log Message: + added ifdef MSV where needed Index: tc2DGraphicsSurface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc2DGraphicsSurface.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tc2DGraphicsSurface.cpp 20 Mar 2004 18:46:46 -0000 1.8 --- tc2DGraphicsSurface.cpp 11 Apr 2004 22:19:31 -0000 1.9 *************** *** 24,29 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tc2DGraphicsSurface.h" --- 24,31 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tc2DGraphicsSurface.h" |
|
From: Xavi <xr...@us...> - 2004-04-11 22:32:02
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8946 Modified Files: tcTerrainTextureFactory.cpp Log Message: + added ifdef MSV where needed + changed scope of declaration of int nTex local variable. Index: tcTerrainTextureFactory.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainTextureFactory.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcTerrainTextureFactory.cpp 5 Apr 2004 02:24:29 -0000 1.6 --- tcTerrainTextureFactory.cpp 11 Apr 2004 22:18:19 -0000 1.7 *************** *** 29,34 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tcTerrainTextureFactory.h" --- 29,36 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOM #include "tcTerrainTextureFactory.h" *************** *** 166,170 **** // calculate alpha for each texture bool searching = true; ! for (int nTex=0;(nTex<NUM_TEXTURES)&& searching;nTex++) { float zmin = textureInfo[nTex].zmin; --- 168,173 ---- // calculate alpha for each texture bool searching = true; ! int nTex = 0; ! for (nTex=0;(nTex<NUM_TEXTURES)&& searching;nTex++) { float zmin = textureInfo[nTex].zmin; *************** *** 193,197 **** Uint8 blue = 0; // calculate red, green, blue ! for (int nTex=0;nTex<NUM_TEXTURES;nTex++) { int srcIndex = imageIndex % textureInfo[nTex].sizeBytes; --- 196,200 ---- Uint8 blue = 0; // calculate red, green, blue ! for (nTex=0;nTex<NUM_TEXTURES;nTex++) { int srcIndex = imageIndex % textureInfo[nTex].sizeBytes; |
|
From: Xavi <xr...@us...> - 2004-04-11 22:27:53
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8176 Modified Files: cspSky.cpp Log Message: + added ifdef MSV where needed Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cspSky.cpp 18 Feb 2004 18:53:55 -0000 1.8 --- cspSky.cpp 11 Apr 2004 22:14:11 -0000 1.9 *************** *** 31,36 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "math_constants.h" --- 31,38 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "math_constants.h" |
|
From: Xavi <xr...@us...> - 2004-04-11 22:27:40
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8078 Modified Files: tcStandardWindow.cpp Log Message: + added ifdef MSV where needed Index: tcStandardWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStandardWindow.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcStandardWindow.cpp 24 Mar 2004 21:09:26 -0000 1.6 --- tcStandardWindow.cpp 11 Apr 2004 22:13:57 -0000 1.7 *************** *** 24,30 **** #include "wx/wx.h" #ifdef WIN32 ! #include "wx/msw/private.h" ! #endif ! #endif #include "tcStandardWindow.h" --- 24,30 ---- #include "wx/wx.h" #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tcStandardWindow.h" *************** *** 193,195 **** } - --- 193,194 ---- |
|
From: Xavi <xr...@us...> - 2004-04-11 22:19:26
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6635 Modified Files: tcConsoleBox.cpp Log Message: + added ifdef MSV where needed + reordered constructors of attributes + newline at the end of file + include "aerror.h" renamed to include "AError.h" Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcConsoleBox.cpp 24 Mar 2004 21:09:26 -0000 1.2 --- tcConsoleBox.cpp 11 Apr 2004 22:05:44 -0000 1.3 *************** *** 21,29 **** #include "stdwx.h" - #ifndef WX_PRECOMP - #endif - #include "tcConsoleBox.h" ! #include "aerror.h" #include "common/tinyxml.h" #include <stdio.h> --- 21,26 ---- #include "stdwx.h" #include "tcConsoleBox.h" ! #include "AError.h" #include "common/tinyxml.h" #include <stdio.h> *************** *** 242,252 **** tcConsoleBox::tcConsoleBox(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLConsoleBox", parent), - mbRedraw(true), - mbForceRedraw(true), - useDelayedTextEffect(false), - nlinespace(15), cursorLine(0), cursorCol(0), nwrapcol(80), isMouseOver(false), isFocused(false) --- 239,249 ---- tcConsoleBox::tcConsoleBox(tcWindow *parent, TiXmlNode *config) : tcWindow(parent, wxPoint(0,0), wxSize(10,10), "XMLConsoleBox", parent), cursorLine(0), cursorCol(0), nwrapcol(80), + useDelayedTextEffect(false), + mbRedraw(true), + mbForceRedraw(true), + nlinespace(15), isMouseOver(false), isFocused(false) *************** *** 306,307 **** --- 303,305 ---- if (mpBrush != NULL) {delete mpBrush;} } + |
|
From: Xavi <xr...@us...> - 2004-04-11 22:13:00
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5309 Modified Files: ObjectUpdater.cpp tc3DTerrain.cpp tcRadioButton.cpp Log Message: + added ifdef MSV where neede + newline at the end of file Index: tcRadioButton.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcRadioButton.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcRadioButton.cpp 24 Mar 2004 21:09:26 -0000 1.3 --- tcRadioButton.cpp 11 Apr 2004 21:59:16 -0000 1.4 *************** *** 35,39 **** - BEGIN_EVENT_TABLE(tcRadioButton, tcWindow) EVT_COMMAND(-1, wxEVT_COMMAND_BUTTON_CLICKED , tcRadioButton::OnButtonCommand) --- 35,38 ---- *************** *** 266,269 **** } - - --- 265,266 ---- Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DTerrain.cpp 18 Feb 2004 18:53:55 -0000 1.10 --- tc3DTerrain.cpp 11 Apr 2004 21:59:16 -0000 1.11 *************** *** 24,29 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tc3DTerrain.h" --- 24,31 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tc3DTerrain.h" Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectUpdater.cpp 20 Jan 2004 03:02:53 -0000 1.6 --- ObjectUpdater.cpp 11 Apr 2004 21:59:16 -0000 1.7 *************** *** 135,137 **** ObjectUpdater::~ObjectUpdater() { ! } \ No newline at end of file --- 135,138 ---- ObjectUpdater::~ObjectUpdater() { ! } ! |
|
From: Xavi <xr...@us...> - 2004-04-11 22:09:51
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4796 Modified Files: tc3DSky.cpp Log Message: + newline at the end of file Index: tc3DSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DSky.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DSky.cpp 30 Nov 2003 23:30:55 -0000 1.1 --- tc3DSky.cpp 11 Apr 2004 21:56:08 -0000 1.2 *************** *** 135,137 **** tc3DSky::~tc3DSky() { ! } \ No newline at end of file --- 135,138 ---- tc3DSky::~tc3DSky() { ! } ! |
|
From: Xavi <xr...@us...> - 2004-04-11 22:09:22
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4665 Modified Files: tcMapObject.cpp Log Message: + added ifdef MSV where needed Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcMapObject.cpp 21 Dec 2003 00:40:00 -0000 1.1 --- tcMapObject.cpp 11 Apr 2004 21:55:40 -0000 1.2 *************** *** 26,31 **** #ifndef WX_PRECOMP #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif #include "tcMapObject.h" --- 26,33 ---- #ifndef WX_PRECOMP #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP #include "tcMapObject.h" *************** *** 42,47 **** tcMapView* tcMapObject::mapView = NULL; - - void tcMapObject::Draw(Gdiplus::Graphics *graphics) { --- 44,47 ---- *************** *** 133,139 **** } - - - - - --- 133,134 ---- |
|
From: Xavi <xr...@us...> - 2004-04-11 22:05:37
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4022 Modified Files: tcGraphicsEngine.h Log Message: + added ifdef MSV for #pragma once instruction + corrected includes where path was set in windows-style (GL\glu.h) for standard path (GL/glu.h) + removed comma at the end of enum Index: tcGraphicsEngine.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcGraphicsEngine.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcGraphicsEngine.h 20 Mar 2004 18:46:46 -0000 1.10 --- tcGraphicsEngine.h 11 Apr 2004 21:51:53 -0000 1.11 *************** *** 23,35 **** #define _TCGRAPHICSENGINE_H_ #pragma once ! #include "wx/wx.h" #include "wx/msw/private.h" // for MS Windows specific definitions ! #include <GL\gl.h> // Header file for the OpenGL32 library ! #include <GL\glu.h> // Header file for the GLu32 library // had to remove (change name) GLAux.lib from SDK directory to avoid __ftol error // GLAux.lib from VC98 directory works ! #include <GL\glaux.h> // Header file for the GLaux library #include <string> #include "tc2DGraphicsSurface.h" --- 23,42 ---- #define _TCGRAPHICSENGINE_H_ + #if _MSC_VER > 1000 #pragma once + #endif ! #ifndef WX_PRECOMP ! #include "wx/wx.h" ! #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions ! #endif // WIN32 ! #endif // WX_PRECOMP ! ! #include <GL/gl.h> // Header file for the OpenGL32 library ! #include <GL/glu.h> // Header file for the GLu32 library // had to remove (change name) GLAux.lib from SDK directory to avoid __ftol error // GLAux.lib from VC98 directory works ! #include <GL/glaux.h> // Header file for the GLaux library #include <string> #include "tc2DGraphicsSurface.h" *************** *** 133,137 **** MODE_NONE, MODE_2D, ! MODE_TEXTURE2D, } meGraphicsMode; --- 140,144 ---- MODE_NONE, MODE_2D, ! MODE_TEXTURE2D } meGraphicsMode; |