gcblue-commits Mailing List for Global Conflict Blue (Page 29)
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...> - 2005-04-08 01:54:20
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7286/src/common Modified Files: tcOggStreamer.cpp tcSound.cpp Log Message: multiplayer work Index: tcOggStreamer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOggStreamer.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcOggStreamer.cpp 25 Mar 2005 03:48:07 -0000 1.17 --- tcOggStreamer.cpp 8 Apr 2005 01:54:11 -0000 1.18 *************** *** 165,170 **** --- 165,173 ---- source->play(); + + fprintf(stdout, "Starting new audio stream: %s\n", queuedSong.c_str()); queuedSong = ""; initializingStream = true; + } } Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcSound.cpp 6 Apr 2005 02:19:48 -0000 1.30 --- tcSound.cpp 8 Apr 2005 01:54:11 -0000 1.31 *************** *** 32,35 **** --- 32,36 ---- #include "tcSound.h" #include "tcOggStreamer.h" + #include "tcOptions.h" #include <stdlib.h> #include <stdio.h> *************** *** 278,282 **** } // bool isPlaying = oggStreamer->IsPlaying(); ! if (!oggStreamer->IsSongQueued()) { QueueRandomMusic(); --- 279,283 ---- } // bool isPlaying = oggStreamer->IsPlaying(); ! if (!oggStreamer->IsSongQueued() && (tcOptions::Get()->mbPlayMusic)) { QueueRandomMusic(); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-08 01:54:20
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7286/include/network Modified Files: tcConnectionData.h tcControlMessageHandler.h tcMultiplayerInterface.h tcNetworkInterface.h Log Message: multiplayer work Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMultiplayerInterface.h 4 Mar 2005 00:46:15 -0000 1.18 --- tcMultiplayerInterface.h 8 Apr 2005 01:54:11 -0000 1.19 *************** *** 58,61 **** --- 58,62 ---- int alliance; ///< player's alliance unsigned timestamp; ///< time of last update + float ping_s; ///< value of last ping std::map<long, double> lastUpdate; ///< map of (obj id, update time) pairs *************** *** 108,111 **** --- 109,113 ---- void SendChatText(int destination, const std::string& message); void SendControlMessage(int destination, int messageCode, int param = 0); + void SendControlMessageUDP(int destination, int messageCode, int param = 0); void SendTestUDP(int destination, const std::string& message); void SendUpdateMessage(int destination, tcStream& stream); *************** *** 113,118 **** --- 115,123 ---- void SetEvtHandler(wxEvtHandler *eh); void SetName(const std::string& name); + void SetPingTime(int connectionId, float ping_s); void Update(); + unsigned updateCount; ///< elapsed time for last update + private: tcNetworkInterface *networkInterface; *************** *** 126,129 **** --- 131,135 ---- wxEvtHandler* evtHandler; ///< wxWidgets event handler for posting messages to application + void ClearMessageMap(); void DistributeChatText(); *************** *** 138,141 **** --- 144,148 ---- void UpdateObjectCommands(unsigned connIdx, bool updateUnack, bool clearNewCmdFlag); void UpdateObjects(); + void UpdatePing(); void UpdatePlayerInfo(); void UpdateSensorMaps(); Index: tcControlMessageHandler.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcControlMessageHandler.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcControlMessageHandler.h 8 Aug 2004 00:31:32 -0000 1.5 --- tcControlMessageHandler.h 8 Apr 2005 01:54:11 -0000 1.6 *************** *** 50,54 **** CM_STARTGAME = 2, CM_TIME = 3, ///< time message also includes time acceleratin/pause state ! CM_ALLIANCE = 4 }; --- 50,56 ---- CM_STARTGAME = 2, CM_TIME = 3, ///< time message also includes time acceleratin/pause state ! CM_ALLIANCE = 4, ! CM_PING = 5, ! CM_PONG = 6 ///< reply to ping }; Index: tcNetworkInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcNetworkInterface.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcNetworkInterface.h 8 Aug 2004 00:31:32 -0000 1.8 --- tcNetworkInterface.h 8 Apr 2005 01:54:11 -0000 1.9 *************** *** 69,76 **** --- 69,79 ---- void OpenConnection(wxString hostName); + const unsigned char* ReceiveMessage(int connectionId, int& messageId, unsigned& messageSize, int protocol = TCP); bool SendMessage(int connectionId, int messageId, unsigned messageSize, const unsigned char *data, int protocol = TCP); + + void SetPingTime(int connectionId, float ping_s); /// must be called regularly Index: tcConnectionData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcConnectionData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcConnectionData.h 8 Aug 2004 00:31:32 -0000 1.6 --- tcConnectionData.h 8 Apr 2005 01:54:11 -0000 1.7 *************** *** 46,50 **** static tcNetworkInterface *networkInterface; ///< pointer to network interface - wxSocketBase *socket; ///< socket associated with this connection wxString idString; ///< identifier string for source of message unsigned int timestamp; ///< start time (tcTime 30 Hz counter) for connection --- 46,49 ---- *************** *** 58,67 **** --- 57,76 ---- unsigned long writeCount; ///< number of bytes written to this connection + const wxIPV4address& GetPeerAddress() const; unsigned long GetReadCount() const; + wxSocketBase* GetSocket(); unsigned long GetWriteCount() const; + unsigned int GetReadCountSec() const; + unsigned int GetWriteCountSec() const; + float GetPingTime() const; + void ReadNextMessageTCP(); void ReadNextMessageUDP(unsigned int messageSize, unsigned char *buffer); + void SendTCP(unsigned int idx); void SendUDP(unsigned int idx, bool useAck = false); + void SetPingTime(float ping_s); + void SetSocket(wxSocketBase* sock); + void Update(); ///< read and write data from socket void WriteQueuedMessages(); *************** *** 69,73 **** --- 78,90 ---- tcConnectionData(); private: + wxSocketBase *socket; ///< socket associated with this connection tcMessage tempMessage; ///< message to use for temporary storage + unsigned long lastReadCount; ///< read count at last second mark + unsigned long lastWriteCount; ///< write count at last second mark + unsigned int readCount_sec; ///< bytes read over last full second + unsigned int writeCount_sec; ///< bytes written over last full second + float pingTime_s; ///< last ping time for this connection + wxIPV4address UDPaddress; + wxString peerName; void WriteTCP(); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:20:28
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/include/common Modified Files: wxcommands.h Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: wxcommands.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/wxcommands.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wxcommands.h 6 Sep 2004 01:08:02 -0000 1.19 --- wxcommands.h 6 Apr 2005 02:19:48 -0000 1.20 *************** *** 51,55 **** ID_MULTIPLAYERMODE = 150, ///< 0 - none, 1 - client, 2 - server ID_CONNECT = 160, ! ID_SENDTEST = 170, ID_CHATPROTOCOL = 180 }; --- 51,55 ---- ID_MULTIPLAYERMODE = 150, ///< 0 - none, 1 - client, 2 - server ID_CONNECT = 160, ! ID_JOINGAME = 170, ID_CHATPROTOCOL = 180 }; |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:20:28
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/include/sim Modified Files: tcCarrierObject.h tcFlightOpsObject.h tcFlightPort.h Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcFlightPort.h 14 Sep 2004 02:01:45 -0000 1.8 --- tcFlightPort.h 6 Apr 2005 02:19:48 -0000 1.9 *************** *** 98,111 **** void AddSpot(teLocation loc, float x, float y, float z, float orientation = 0, float length = 0); int CheckLanding(tcGameObject *obj); ! void Clear(void); int FindAirState(tcAirState *airstate); int FindEmptySpot(std::vector<tsSpotInfo> *loc_vector); int FindEmptySpot(teLocation loc, std::vector<tsSpotInfo>*& loc_vector); ! const tcAirState* GetAirState(unsigned n); int GetAirStateIdx(long id); ! size_t GetCount(void) {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); unsigned GetHangarCapacity() const {return hangarCapacity;} tcTrack GetLandingData(const tcGameObject* obj); std::vector<tsSpotInfo>* GetLocVector(teLocation loc); --- 98,112 ---- void AddSpot(teLocation loc, float x, float y, float z, float orientation = 0, float length = 0); int CheckLanding(tcGameObject *obj); ! void Clear(); int FindAirState(tcAirState *airstate); int FindEmptySpot(std::vector<tsSpotInfo> *loc_vector); int FindEmptySpot(teLocation loc, std::vector<tsSpotInfo>*& loc_vector); ! tcAirState* GetAirState(unsigned n); int GetAirStateIdx(long id); ! size_t GetCount() {return units.size();} tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); unsigned GetHangarCapacity() const {return hangarCapacity;} tcTrack GetLandingData(const tcGameObject* obj); + tcGameObject* GetObject(unsigned n); std::vector<tsSpotInfo>* GetLocVector(teLocation loc); Index: tcCarrierObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCarrierObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcCarrierObject.h 17 Aug 2004 02:22:56 -0000 1.10 --- tcCarrierObject.h 6 Apr 2005 02:19:48 -0000 1.11 *************** *** 29,32 **** --- 29,37 ---- #include "tcFlightOpsObject.h" + class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; + /** * Models a Carrier *************** *** 49,52 **** --- 54,65 ---- virtual void Update(double afStatusTime); + virtual tcCommandStream& operator<<(tcCommandStream& stream); + virtual tcCreateStream& operator<<(tcCreateStream& stream); + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); + + virtual tcCommandStream& operator>>(tcCommandStream& stream); + virtual tcCreateStream& operator>>(tcCreateStream& stream); + virtual tcUpdateStream& operator>>(tcUpdateStream& stream); + tcCarrierObject(); tcCarrierObject(tcCarrierObject&); Index: tcFlightOpsObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightOpsObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFlightOpsObject.h 17 Aug 2004 02:22:56 -0000 1.3 --- tcFlightOpsObject.h 6 Apr 2005 02:19:48 -0000 1.4 *************** *** 34,37 **** --- 34,42 ---- class tcGameObject; + class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; + namespace Database { *************** *** 56,59 **** --- 61,65 ---- virtual bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); + virtual bool AddChildToFlightDeck(tcDatabaseObject* databaseObject, std::string unitName, teLocation loc); virtual int CheckLanding(tcGameObject* obj); virtual void Clear(); *************** *** 67,70 **** --- 73,84 ---- virtual void UpdateLaunch(); + virtual tcCommandStream& operator<<(tcCommandStream& stream); + virtual tcCreateStream& operator<<(tcCreateStream& stream); + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); + + virtual tcCommandStream& operator>>(tcCommandStream& stream); + virtual tcCreateStream& operator>>(tcCreateStream& stream); + virtual tcUpdateStream& operator>>(tcUpdateStream& stream); + tcFlightOpsObject(tcFlightportDBObject* dbObject, tcGameObject* gameObject); virtual ~tcFlightOpsObject(); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:59
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/src/sim Modified Files: tcCarrierObject.cpp tcFlightOpsObject.cpp tcFlightPort.cpp tcSimState.cpp Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** tcSimState.cpp 29 Mar 2005 00:12:46 -0000 1.74 --- tcSimState.cpp 6 Apr 2005 02:19:50 -0000 1.75 *************** *** 2390,2395 **** dateZulu = tempDateZulu; } ! // if client more than 4 sec ahead, pause the client ! if (dt < -4) { timeAcceleration = 0; --- 2390,2395 ---- dateZulu = tempDateZulu; } ! // if client time is too much ahead, pause the client ! if (dt < -1) { timeAcceleration = 0; Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcFlightOpsObject.cpp 6 Nov 2004 15:13:42 -0000 1.6 --- tcFlightOpsObject.cpp 6 Apr 2005 02:19:50 -0000 1.7 *************** *** 31,34 **** --- 31,36 ---- #include "tcFlightportDBObject.h" #include "tcDatabase.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" #ifdef _DEBUG *************** *** 39,82 **** Database::tcDatabase* tcFlightOpsObject::database = 0; /** ! * Determines if obj has landed on runway or crashed into flightport. ! * Calls tcFlightPort method. ! * If object successfully lands, it is added as a child. ! * @param obj Object to attempt landing ! * @return -1 if crash, 0 if not close enough for landing, 1 if landed ! * @see tcFlightPort::CheckLanding */ ! int tcFlightOpsObject::CheckLanding(tcGameObject *obj) { ! gameObj->GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate ! int result = flight_deck.CheckLanding(obj); ! if (result == 1) ! { ! gameObj->AddChild(obj); ! } ! return result; } ! void tcFlightOpsObject::Clear() { ! flight_deck.Clear(); } /** ! * @return pointer to flight_deck */ ! tcFlightPort* tcFlightOpsObject::GetFlightPort() { ! return &flight_deck; } /** ! * @return track with landing point coord and heading with orientation */ ! tcTrack tcFlightOpsObject::GetLandingData() { ! return flight_deck.GetLandingData(gameObj); } /** * Supports aero air model and air generic models. Adding other --- 41,153 ---- Database::tcDatabase* tcFlightOpsObject::database = 0; + + + /** ! * Loads state from command stream */ ! tcCommandStream& tcFlightOpsObject::operator<<(tcCommandStream& stream) { ! ! return stream; } ! /** ! * Saves state to command stream ! */ ! tcCommandStream& tcFlightOpsObject::operator>>(tcCommandStream& stream) { ! ! return stream; } /** ! * Loads state from create stream */ ! tcCreateStream& tcFlightOpsObject::operator<<(tcCreateStream& stream) { ! ! ! return stream; } /** ! * Saves state to create stream */ ! tcCreateStream& tcFlightOpsObject::operator>>(tcCreateStream& stream) { ! unsigned short nChildren = flight_deck.GetCount(); ! ! stream << nChildren; ! ! for (unsigned short k=0; k < nChildren; k++) ! { ! tcAirState* airState = flight_deck.GetAirState(k); ! tcGameObject* obj = airState->obj; ! wxASSERT(obj); ! ! ! stream << obj->mnDBKey; ! ! std::string unitName = obj->mzUnit.mz; ! stream << unitName; ! ! unsigned char loc = unsigned char(airState->current_location); ! stream << loc; ! } ! ! ! return stream; } + + /** + * Loads state from update stream + */ + tcUpdateStream& tcFlightOpsObject::operator<<(tcUpdateStream& stream) + { + unsigned short nChildren; + stream >> nChildren; + + wxASSERT(flight_deck.GetCount() == 0); + + for (unsigned short k=0; k < nChildren; k++) + { + long key; + stream >> key; + + tcDatabaseObject* databaseObj = database->GetObject(key); + + std::string unitName; + stream >> unitName; + + unsigned char loc; + stream >> loc; + + AddChildToFlightDeck(databaseObj, unitName, teLocation(loc)); + } + + return stream; + } + + /** + * Saves state to update stream + */ + tcUpdateStream& tcFlightOpsObject::operator>>(tcUpdateStream& stream) + { + + + return stream; + } + + + bool tcFlightOpsObject::AddChildToFlightDeck(std::string className, std::string unitName, + teLocation loc) + { + return AddChildToFlightDeck(database->GetObject(className), unitName, loc); + } + + + /** * Supports aero air model and air generic models. Adding other *************** *** 84,99 **** * @return true if successful, false otherwise */ ! bool tcFlightOpsObject::AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc) { ! tcGameObject *child = NULL; // object to add to flight_deck ! tcDatabaseObject *dbObj = database->GetObject(className); ! if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj)) ! { child = new tcAeroAirObject(airDBObj); } ! else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(dbObj)) { if (genericDBObj->mnModelType == MTYPE_FIXEDWING) --- 155,172 ---- * @return true if successful, false otherwise */ ! bool tcFlightOpsObject::AddChildToFlightDeck(tcDatabaseObject* databaseObject, std::string unitName, teLocation loc) { ! wxASSERT(databaseObject); ! tcGameObject *child = 0; // object to add to flight_deck ! ! std::string className = databaseObject->mzClass.mz; + if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(databaseObject)) + { child = new tcAeroAirObject(airDBObj); } ! else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(databaseObject)) { if (genericDBObj->mnModelType == MTYPE_FIXEDWING) *************** *** 128,131 **** --- 201,246 ---- } + + /** + * Determines if obj has landed on runway or crashed into flightport. + * Calls tcFlightPort method. + * If object successfully lands, it is added as a child. + * @param obj Object to attempt landing + * @return -1 if crash, 0 if not close enough for landing, 1 if landed + * @see tcFlightPort::CheckLanding + */ + int tcFlightOpsObject::CheckLanding(tcGameObject *obj) + { + gameObj->GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate + int result = flight_deck.CheckLanding(obj); + if (result == 1) + { + gameObj->AddChild(obj); + } + return result; + } + + void tcFlightOpsObject::Clear() + { + flight_deck.Clear(); + } + + /** + * @return pointer to flight_deck + */ + tcFlightPort* tcFlightOpsObject::GetFlightPort() + { + return &flight_deck; + } + + /** + * @return track with landing point coord and heading with orientation + */ + tcTrack tcFlightOpsObject::GetLandingData() + { + return flight_deck.GetLandingData(gameObj); + } + + /** * Randomly initializes object Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcFlightPort.cpp 24 Feb 2005 22:19:16 -0000 1.14 --- tcFlightPort.cpp 6 Apr 2005 02:19:50 -0000 1.15 *************** *** 227,233 **** } //---------------------------------------------------------------------------- ! const tcAirState* tcFlightPort::GetAirState(unsigned n) { ! return NULL; } //---------------------------------------------------------------------------- --- 227,233 ---- } //---------------------------------------------------------------------------- ! tcAirState* tcFlightPort::GetAirState(unsigned n) { ! return units[n]; } //---------------------------------------------------------------------------- *************** *** 242,245 **** --- 242,255 ---- return -1; // not found } + + /** + * @returns game object for unit with index n + */ + tcGameObject* tcFlightPort::GetObject(unsigned n) + { + wxASSERT(n < units.size()); + + return units[n]->obj; + } //---------------------------------------------------------------------------- int tcFlightPort::Launch(int runway) Index: tcCarrierObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCarrierObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcCarrierObject.cpp 2 Nov 2004 04:23:56 -0000 1.9 --- tcCarrierObject.cpp 6 Apr 2005 02:19:50 -0000 1.10 *************** *** 1,4 **** /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,4 ---- /* ! ** Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 28,31 **** --- 28,33 ---- #include "tcAirDBObject.h" #include "tcFlightOpsObject.h" + #include "common/tcStream.h" + #include "common/tcObjStream.h" #ifdef _DEBUG *************** *** 34,37 **** --- 36,106 ---- + + /** + * Loads state from command stream + */ + tcCommandStream& tcCarrierObject::operator<<(tcCommandStream& stream) + { + tcPlatformObject::operator<<(stream); + + return stream; + } + + /** + * Saves state to command stream + */ + tcCommandStream& tcCarrierObject::operator>>(tcCommandStream& stream) + { + tcPlatformObject::operator>>(stream); + + return stream; + } + + /** + * Loads state from create stream + */ + tcCreateStream& tcCarrierObject::operator<<(tcCreateStream& stream) + { + tcPlatformObject::operator<<(stream); + + tcFlightOpsObject::operator<<(stream); + + return stream; + } + + /** + * Saves state to create stream + */ + tcCreateStream& tcCarrierObject::operator>>(tcCreateStream& stream) + { + tcPlatformObject::operator>>(stream); + + tcFlightOpsObject::operator>>(stream); + + return stream; + } + + + /** + * Loads state from update stream + */ + tcUpdateStream& tcCarrierObject::operator<<(tcUpdateStream& stream) + { + tcPlatformObject::operator<<(stream); + + return stream; + } + + /** + * Saves state to update stream + */ + tcUpdateStream& tcCarrierObject::operator>>(tcUpdateStream& stream) + { + tcPlatformObject::operator>>(stream); + + return stream; + } + + void tcCarrierObject::Clear() { |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:58
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/xml Modified Files: network_view.xml Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: network_view.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/network_view.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** network_view.xml 2 Mar 2005 22:28:45 -0000 1.7 --- network_view.xml 6 Apr 2005 02:19:50 -0000 1.8 *************** *** 14,18 **** <EditIP X="30" Y="300" Width="180" Height="25" BarX="10.0" BarY="5.0" BarWidth="160.0" BarHeight="14.0" Caption="IP Address"/> <Button X="240" Y="305" Width="65" Height="15" Caption="Connect" Command="160"/> ! <Button X="340" Y="305" Width="65" Height="15" Caption="Test Text" Command="170"/> <StatusBox X="250" Y="130" Width="200" Height="100"/> <ChatBox X="30" Y="350" Width="400" Height="200" FontSize="11.0" DrawBorder="1"/> --- 14,18 ---- <EditIP X="30" Y="300" Width="180" Height="25" BarX="10.0" BarY="5.0" BarWidth="160.0" BarHeight="14.0" Caption="IP Address"/> <Button X="240" Y="305" Width="65" Height="15" Caption="Connect" Command="160"/> ! <Button X="340" Y="305" Width="65" Height="15" Caption="Join Game" Command="170"/> <StatusBox X="250" Y="130" Width="200" Height="100"/> <ChatBox X="30" Y="350" Width="400" Height="200" FontSize="11.0" DrawBorder="1"/> |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:58
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/src/network Modified Files: tcMultiplayerInterface.cpp Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMultiplayerInterface.cpp 4 Mar 2005 00:46:17 -0000 1.19 --- tcMultiplayerInterface.cpp 6 Apr 2005 02:19:49 -0000 1.20 *************** *** 639,643 **** ** included as a heartbeat message. **/ ! if (tcSimState::Get()->GetTimeAcceleration() == 0) { UpdateTime(); --- 639,643 ---- ** included as a heartbeat message. **/ ! if (IsServer() && (tcSimState::Get()->GetTimeAcceleration() == 0)) { UpdateTime(); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:58
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/src/graphics Modified Files: tcNetworkView.cpp Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcNetworkView.cpp 2 Mar 2005 22:28:43 -0000 1.4 --- tcNetworkView.cpp 6 Apr 2005 02:19:49 -0000 1.5 *************** *** 41,45 **** EVT_COMMAND(ID_MULTIPLAYERMODE, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetNetworkMode) EVT_COMMAND(ID_CONNECT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::OnConnect) ! EVT_COMMAND(ID_SENDTEST, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SendTest) EVT_COMMAND(ID_CHATPROTOCOL, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetChatProtocol) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) --- 41,45 ---- EVT_COMMAND(ID_MULTIPLAYERMODE, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetNetworkMode) EVT_COMMAND(ID_CONNECT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::OnConnect) ! EVT_COMMAND(ID_JOINGAME, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::JoinGame) EVT_COMMAND(ID_CHATPROTOCOL, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SetChatProtocol) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) *************** *** 91,95 **** /** ! * Only applies in client mode. */ void tcNetworkView::OnConnect(wxCommandEvent& event) --- 91,119 ---- /** ! * Only applies in client mode when already connected ! */ ! void tcNetworkView::JoinGame(wxCommandEvent& event) ! { ! if (networkMode != MULTIPLAYER_CLIENT) ! { ! chatBox->Print("Must be in client mode and connected to join game"); ! return; ! } ! ! if (tcMultiplayerInterface::Get()->GetNumConnections() == 0) ! { ! chatBox->Print("Must be connected to join game"); ! return; ! } ! ! // post start game event ! wxEvtHandler* evtHandler = tcMultiplayerInterface::Get()->GetEvtHandler(); ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_STARTGAME); ! evtHandler->AddPendingEvent(command); ! ! } ! ! /** ! * Only applies in client mode */ void tcNetworkView::OnConnect(wxCommandEvent& event) *************** *** 97,100 **** --- 121,125 ---- if (networkMode != 1) return; + tcMultiplayerInterface::Get()->OpenConnection(ipText.c_str()); } *************** *** 167,185 **** // switching to client mode also terminates all connections ! if (mode == 0) { tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerOff(); } ! else if (mode <= 1) { tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerClient(); } ! else if (mode == 2) { tcMultiplayerInterface::Get()->MakeServer(); tcSimState::Get()->SetMultiplayerServer(); } //tcMultiplayerInterface::Get().OpenConnection("192.168.0.101"); --- 192,215 ---- // switching to client mode also terminates all connections ! if (mode == MULTIPLAYER_OFF) { tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerOff(); } ! else if (mode == MULTIPLAYER_CLIENT) { tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerClient(); } ! else if (mode == MULTIPLAYER_SERVER) { tcMultiplayerInterface::Get()->MakeServer(); tcSimState::Get()->SetMultiplayerServer(); } + else + { + fprintf(stderr, "tcNetworkView::SetNetworkMode, bad mode %d\n", mode); + return; + } //tcMultiplayerInterface::Get().OpenConnection("192.168.0.101"); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:57
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/include/graphics Modified Files: tcNetworkView.h Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcNetworkView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcNetworkView.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcNetworkView.h 2 Oct 2004 22:41:32 -0000 1.2 --- tcNetworkView.h 6 Apr 2005 02:19:48 -0000 1.3 *************** *** 44,49 **** --- 44,56 ---- { public: + enum + { + MULTIPLAYER_OFF = 0, + MULTIPLAYER_CLIENT = 1, + MULTIPLAYER_SERVER = 2 + }; void Draw(); void DrawStatusBox(); + void JoinGame(wxCommandEvent& event); void OnConnect(wxCommandEvent& event); void OnLButtonDown(wxMouseEvent& event); |
|
From: Dewitt C. <ddc...@us...> - 2005-04-06 02:19:57
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30667/src/common Modified Files: tcSound.cpp Log Message: Added join game button for multiplayer, started carrier and airfield multiplayer support Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcSound.cpp 29 Mar 2005 00:12:25 -0000 1.29 --- tcSound.cpp 6 Apr 2005 02:19:48 -0000 1.30 *************** *** 70,76 **** // Create a sample, load a .wav file. ! openalpp::Sample* sample = new openalpp::Sample(filePath); ! return sample; } --- 70,85 ---- // Create a sample, load a .wav file. ! try ! { ! openalpp::Sample* sample = new openalpp::Sample(filePath); ! return sample; ! } ! catch (openalpp::FileError e) ! { ! fprintf(stderr, "tcSound::LoadSample - %s\n", e.what()); ! return 0; ! } ! } |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:56
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/database Modified Files: database.db Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsgXlq8v and /tmp/cvsif55PN differ |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:49
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747 Modified Files: GCblue.vcproj Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** GCblue.vcproj 19 Mar 2005 15:31:07 -0000 1.90 --- GCblue.vcproj 31 Mar 2005 03:51:10 -0000 1.91 *************** *** 303,306 **** --- 303,309 ---- </File> <File + RelativePath=".\src\graphics\tcMapOverlay.cpp"> + </File> + <File RelativePath=".\src\graphics\tcMapView.cpp"> </File> *************** *** 1249,1252 **** --- 1252,1258 ---- </File> <File + RelativePath=".\include\graphics\tcMapOverlay.h"> + </File> + <File RelativePath=".\include\graphics\tcMapView.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:39
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/src/sim Modified Files: Game.cpp tcLauncher.cpp Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcLauncher.cpp 29 Mar 2005 00:12:28 -0000 1.15 --- tcLauncher.cpp 31 Mar 2005 03:51:13 -0000 1.16 *************** *** 535,539 **** if ((meLaunchMode == SEEKER_TRACK) & (!IsAutoPoint())) { ! return min(0.524f, fcFov); // guess 30 deg for seeker FOV, TODO: calculate true number } else --- 535,544 ---- if ((meLaunchMode == SEEKER_TRACK) & (!IsAutoPoint())) { ! if (tcMissileDBObject* missile = dynamic_cast<tcMissileDBObject*>(mpChildDBObj)) ! { ! return missile->GetSeekerFOV(); ! } ! ! return min(0.524f, fcFov); // guess 30 deg for FOV, TODO: calculate true number } else Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** Game.cpp 29 Mar 2005 00:12:27 -0000 1.125 --- Game.cpp 31 Mar 2005 03:51:13 -0000 1.126 *************** *** 1058,1061 **** --- 1058,1062 ---- pythonInterface->AttachSensorMap(simState->mcSensorMap.GetMap(mcUserInfo.GetOwnAlliance())); pythonInterface->AttachCommandQueue(commandQueue); + pythonInterface->AttachMapOverlay(tacticalMap->GetMapOverlay()); mcGameView.AttachSimState(simState); |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:38
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/xml Modified Files: options.xml options_nosound.txt Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: options_nosound.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options_nosound.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options_nosound.txt 7 Nov 2004 03:40:45 -0000 1.2 --- options_nosound.txt 31 Mar 2005 03:51:13 -0000 1.3 *************** *** 2,7 **** <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Random.py</LastScenarioPath> ! <LastScenarioName>Random</LastScenarioName> <DisableSound>Yes</DisableSound> </Options> --- 2,13 ---- <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>SubTestII.py</LastScenarioPath> ! <LastScenarioName>SubTestII</LastScenarioName> ! <noCopyDatabase /> ! <noWriteXmlDatabase /> ! <Log3DModelDetails /> ! <UsePositionRegistry /> ! <AutoKillAssessment /> ! <ShakeAirCamera /> <DisableSound>Yes</DisableSound> </Options> Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** options.xml 10 Mar 2005 03:28:30 -0000 1.16 --- options.xml 31 Mar 2005 03:51:13 -0000 1.17 *************** *** 2,10 **** <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Test.Type42.py</LastScenarioPath> ! <LastScenarioName>Type42</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> ! <Log3DModelDetails /> <UsePositionRegistry /> <AutoKillAssessment /> --- 2,10 ---- <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>GroundSAMTest.py</LastScenarioPath> ! <LastScenarioName>GroundSAMTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> ! <noLog3DModelDetails /> <UsePositionRegistry /> <AutoKillAssessment /> |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:38
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/src/scriptinterface Modified Files: tcScenarioInterface.cpp tcSimPythonInterface.cpp Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcSimPythonInterface.cpp 16 Feb 2005 23:13:49 -0000 1.27 --- tcSimPythonInterface.cpp 31 Mar 2005 03:51:13 -0000 1.28 *************** *** 32,35 **** --- 32,36 ---- #include "simmath.h" #include "tcSimState.h" + #include "tcMapOverlay.h" #include "tcMenu.h" #include "tcTrackInterface.h" *************** *** 225,228 **** --- 226,235 ---- } + void tcSimPythonInterface::AttachMapOverlay(tcMapOverlay* mo) + { + overlay = mo; + tcScenarioInterface::AttachMapOverlay(mo); + } + void tcSimPythonInterface::AttachSimState(tcSimState *apSimState) { *************** *** 301,308 **** } ! /* Executes command line in command text in embedded Python ** using PyRun_String. If there is an exception an error message ! ** is output to various destinations. */ ! void tcSimPythonInterface::CallPython(const char *commandtext, const char *errortext) { try --- 308,318 ---- } ! /** ! ** Executes command line in command text in embedded Python ** using PyRun_String. If there is an exception an error message ! ** is output to various destinations. ! ** @return 0 on success, non-zero for error ! */ ! int tcSimPythonInterface::CallPython(const char *commandtext, const char *errortext) { try *************** *** 310,318 **** handle<>( PyRun_String(commandtext , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); } ! catch(error_already_set) { ReportError(errortext); PyErr_Print(); } } --- 320,330 ---- handle<>( PyRun_String(commandtext , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); + return 0; } ! catch (error_already_set) { ReportError(errortext); PyErr_Print(); + return 1; } } *************** *** 363,368 **** --- 375,384 ---- wxASSERT(mpSimState); wxASSERT(director); + wxASSERT(overlay); + mpSimState->Clear(); director->ClearEvents(); + overlay->ClearMapObjects(); + wxString cmdText; wxString errText; *************** *** 379,394 **** } // import scenario file cmdText = wxString::Format("from %s import *\n", fileNameWx.c_str()); errText = wxString::Format("Error importing scenario file: %s\n", filePath); ! CallPython(cmdText.c_str(), errText.c_str()); // call CreateScenario method with ScenarioManager global object ! CallPython("CreateScenario(ScenarioManager)\n", "Error with CreateScenario method\n"); // call CreateBriefing method with ScenarioManager global object CallPython("CreateBriefing(ScenarioManager)\n", "Error with CreateBriefing method\n"); - - } --- 395,425 ---- } + // import scenario file cmdText = wxString::Format("from %s import *\n", fileNameWx.c_str()); errText = wxString::Format("Error importing scenario file: %s\n", filePath); ! int errorCode = CallPython(cmdText.c_str(), errText.c_str()); ! if (errorCode != 0) ! { ! mpSimState->Clear(); ! director->ClearEvents(); ! overlay->ClearMapObjects(); ! return; ! } // call CreateScenario method with ScenarioManager global object ! errorCode = CallPython("CreateScenario(ScenarioManager)\n", "Error with CreateScenario method\n"); ! if (errorCode != 0) ! { ! mpSimState->Clear(); ! director->ClearEvents(); ! overlay->ClearMapObjects(); ! return; ! } ! // call CreateBriefing method with ScenarioManager global object + // ignore error here CallPython("CreateBriefing(ScenarioManager)\n", "Error with CreateBriefing method\n"); } *************** *** 703,706 **** --- 734,738 ---- director(0), mpHookedObj(0), + overlay(0), isModePushed(false) { Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcScenarioInterface.cpp 29 Mar 2005 00:12:27 -0000 1.22 --- tcScenarioInterface.cpp 31 Mar 2005 03:51:13 -0000 1.23 *************** *** 41,44 **** --- 41,46 ---- #include "tcLauncher.h" #include "tcMapData.h" + #include "tcMapObject.h" + #include "tcMapOverlay.h" #include "tcScenarioInterface.h" #include "tcSimState.h" *************** *** 101,107 **** } ! tcDirector* tcScenarioInterface::director = NULL; ! tcMapData* tcScenarioInterface::mapData = NULL; ! tcSimState* tcScenarioInterface::simState = NULL; // Interface class management functions --- 103,110 ---- } ! tcDirector* tcScenarioInterface::director = 0; ! tcMapData* tcScenarioInterface::mapData = 0; ! tcMapOverlay* tcScenarioInterface::overlay = 0; ! tcSimState* tcScenarioInterface::simState = 0; // Interface class management functions *************** *** 173,176 **** --- 176,181 ---- .def("ConsoleText",&tcScenarioInterface::ConsoleText) .def("MapText",&tcScenarioInterface::MapText) + // overlay graphics + .def("OverlayText", &tcScenarioInterface::OverlayText) // camera and 3D viewer events .def("FlybyCamera",&tcScenarioInterface::FlybyCamera) *************** *** 590,594 **** * @param seekTime time in seconds within audio file */ ! void tcScenarioInterface::PlayAudio(std::string audioName, double seekTime) { wxASSERT(director); --- 595,599 ---- * @param seekTime time in seconds within audio file */ ! void tcScenarioInterface::PlayAudio(const std::string& audioName, double seekTime) { wxASSERT(director); *************** *** 644,648 **** } ! void tcScenarioInterface::ConsoleText(std::string text) { wxASSERT(director); --- 649,653 ---- } ! void tcScenarioInterface::ConsoleText(const std::string& text) { wxASSERT(director); *************** *** 650,654 **** } ! void tcScenarioInterface::MapText(std::string text, double lon_deg, double lat_deg, double duration, int effect) { --- 655,659 ---- } ! void tcScenarioInterface::MapText(const std::string& text, double lon_deg, double lat_deg, double duration, int effect) { *************** *** 659,663 **** } ! void tcScenarioInterface::FlybyCamera(std::string unitName, double duration, float az1_deg, float az2_deg, float el1_deg, float el2_deg, float r1_m, float r2_m) --- 664,680 ---- } ! void tcScenarioInterface::OverlayText(const std::string& text, ! double lon_deg, double lat_deg) ! { ! wxASSERT(overlay); ! ! tcMapTextObject* obj = new tcMapTextObject(text, lon_deg, lat_deg); ! obj->SetColor(osg::Vec4(0, 0, 0, 1)); ! ! overlay->AddMapObject(obj); ! } ! ! ! void tcScenarioInterface::FlybyCamera(const std::string& unitName, double duration, float az1_deg, float az2_deg, float el1_deg, float el2_deg, float r1_m, float r2_m) *************** *** 680,685 **** } ! void tcScenarioInterface::TrackCamera(std::string unitName, double duration, float x1, float x2, ! float y1, float y2, float z1, float z2) { wxASSERT(director); --- 697,702 ---- } ! void tcScenarioInterface::TrackCamera(const std::string& unitName, double duration, ! float x1, float x2, float y1, float y2, float z1, float z2) { wxASSERT(director); *************** *** 698,702 **** } ! void tcScenarioInterface::Text3D(std::string text, double duration, float x, float y, float size, int effect) { --- 715,719 ---- } ! void tcScenarioInterface::Text3D(const std::string& text, double duration, float x, float y, float size, int effect) { |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:37
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/include/database Modified Files: tcMissileDBObject.h Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMissileDBObject.h 29 Mar 2005 00:12:22 -0000 1.18 --- tcMissileDBObject.h 31 Mar 2005 03:51:11 -0000 1.19 *************** *** 127,130 **** --- 127,131 ---- tcDBString maSensorClass[2]; ///< primary and secondary tnPoolIndex primarySeekerKey; ///< key for fast access of primary seeker + float seekerFOV_rad; ///< for fast lookup of seeker field of view /// flight profile, array of flight segment info unsigned mnNumSegments; *************** *** 135,138 **** --- 136,140 ---- teWeaponLaunchMode GetLaunchMode(); long GetPrimarySeekerKey(); + float GetSeekerFOV(); bool HasAllEmitters(std::vector<long>& emitters); virtual void PrintToFile(tcFile& file); |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:21
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/include/scriptinterface Modified Files: tcScenarioInterface.h tcSimPythonInterface.h Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcScenarioInterface.h 2 Mar 2005 22:28:39 -0000 1.15 --- tcScenarioInterface.h 31 Mar 2005 03:51:12 -0000 1.16 *************** *** 33,36 **** --- 33,37 ---- class tcMapData; + class tcMapOverlay; class tcSimState; class tcDirector; *************** *** 124,128 **** // audio events void PauseAudio(); ! void PlayAudio(std::string audioName, double seekTime); void PlayEffect(const std::string& effectName); ///< may want to use string for this instead void SeekAudio(double seekTime); --- 125,129 ---- // audio events void PauseAudio(); ! void PlayAudio(const std::string& audioName, double seekTime); void PlayEffect(const std::string& effectName); ///< may want to use string for this instead void SeekAudio(double seekTime); *************** *** 131,143 **** void ChangeMapTheater(double lon_deg, double lat_deg); void ChangeMapView(double lon_deg, double lat_deg, double lonSpan_deg); ! void ConsoleText(std::string text); ! void MapText(std::string text, double lon_deg, double lat_deg, double duration, int effect); // camera and 3D events ! void FlybyCamera(std::string unitName, double duration, float az1_deg, float az2_deg, float el1_deg, float el2_deg, float r1_m, float r2_m); ! void TrackCamera(std::string unitName, double duration, float x1, float x2, float y1, float y2, float z1, float z2); ! void Text3D(std::string text, double duration, float x, float y, float size, int effect); // goal class creation methods (cannot find a way to do directly) --- 132,147 ---- void ChangeMapTheater(double lon_deg, double lat_deg); void ChangeMapView(double lon_deg, double lat_deg, double lonSpan_deg); ! void ConsoleText(const std::string& text); ! void MapText(const std::string& text, double lon_deg, double lat_deg, double duration, int effect); ! ! // overlay graphics ! void OverlayText(const std::string& text, double lon_deg, double lat_deg); // camera and 3D events ! void FlybyCamera(const std::string& unitName, double duration, float az1_deg, float az2_deg, float el1_deg, float el2_deg, float r1_m, float r2_m); ! void TrackCamera(const std::string& unitName, double duration, float x1, float x2, float y1, float y2, float z1, float z2); ! void Text3D(const std::string& text, double duration, float x, float y, float size, int effect); // goal class creation methods (cannot find a way to do directly) *************** *** 153,156 **** --- 157,161 ---- static void AttachDirector(tcDirector *dir) {director = dir;} static void AttachMapData(tcMapData *md) {mapData = md;} + static void AttachMapOverlay(tcMapOverlay* mo) {overlay = mo;} static void AttachSimState(tcSimState *apSS) {simState = apSS;} *************** *** 160,163 **** --- 165,169 ---- static tcMapData* mapData; static tcSimState* simState; + static tcMapOverlay* overlay; }; Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcSimPythonInterface.h 16 Feb 2005 23:13:38 -0000 1.20 --- tcSimPythonInterface.h 31 Mar 2005 03:51:12 -0000 1.21 *************** *** 49,52 **** --- 49,53 ---- class tcSoundConsole; class tcCommandQueue; + class tcMapOverlay; using namespace Sensor; *************** *** 97,113 **** void SetUnitInfo(tcPlatformObject *apObj); void Test(); void AttachCommandQueue(tcCommandQueue *cq) {tcPlatformInterface::AttachCommandQueue(cq);} void AttachConsole(tcSoundConsole *apConsole); void AttachDirector(tcDirector *dir); void AttachMapData(tcMapData *md); void AttachMenu(tcMenu *apMenu) {tcMenuInterface::AttachMenu(apMenu);} void AttachPanel(tcPanel *apPanel) {tcPanelInterface::AttachPanel(apPanel);} void AttachSensorMap(tcAllianceSensorMap *apSM) {tcTrackInterface::AttachSensorMap(apSM);} void AttachSimState(tcSimState *apSimState); void BuildGroupMenu(); ///< creates menu customized to group of units void BuildPlatformMenu(); ///< creates menu customized to unit void BuildTrackMenu(); ///< creates menu for track commands void BuildFlightPortPanel(); ! void CallPython(const char *commandtext, const char *errortext); void CallPlatformScript(tcPlatformObject *apObj, const char* azCommand); void CallTaskScript(ScriptedTask* task, const char* azCommand); --- 98,119 ---- void SetUnitInfo(tcPlatformObject *apObj); void Test(); + + // must be better way vs. all of these Attach methods? void AttachCommandQueue(tcCommandQueue *cq) {tcPlatformInterface::AttachCommandQueue(cq);} void AttachConsole(tcSoundConsole *apConsole); void AttachDirector(tcDirector *dir); void AttachMapData(tcMapData *md); + void AttachMapOverlay(tcMapOverlay* mo); void AttachMenu(tcMenu *apMenu) {tcMenuInterface::AttachMenu(apMenu);} void AttachPanel(tcPanel *apPanel) {tcPanelInterface::AttachPanel(apPanel);} void AttachSensorMap(tcAllianceSensorMap *apSM) {tcTrackInterface::AttachSensorMap(apSM);} void AttachSimState(tcSimState *apSimState); + + void BuildGroupMenu(); ///< creates menu customized to group of units void BuildPlatformMenu(); ///< creates menu customized to unit void BuildTrackMenu(); ///< creates menu for track commands void BuildFlightPortPanel(); ! int CallPython(const char *commandtext, const char *errortext); void CallPlatformScript(tcPlatformObject *apObj, const char* azCommand); void CallTaskScript(ScriptedTask* task, const char* azCommand); *************** *** 163,166 **** --- 169,173 ---- tcPlatformObject *mpHookedObj; tcSoundConsole *mpConsole; + tcMapOverlay* overlay; ScriptedTaskInterface* taskInterface; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:21
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/src/graphics Modified Files: tc3DWindow.cpp tcMapObject.cpp tcMapView.cpp tcSmoker.cpp Added Files: tcMapOverlay.cpp Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks --- NEW FILE: tcMapOverlay.cpp --- /** ** @file tcMapOverlay.cpp */ /* Copyright (C) 2005 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 // WX_PRECOMP #include "tcMapOverlay.h" #include "tcMapObject.h" #include "tcMapObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif void tcMapOverlay::AddMapObject(tcMapObject *obj) { overlayObjects.push_back(obj); redraw = true; } void tcMapOverlay::ClearMapObjects() { for (size_t n=0; n < overlayObjects.size(); n++) { delete overlayObjects[n]; } overlayObjects.clear(); redraw = true; } void tcMapOverlay::Draw() { if (!redraw) return; for (size_t n=0; n < overlayObjects.size(); n++) { overlayObjects[n]->Draw(this); } FinishDraw(); redraw = false; } void tcMapOverlay::OnSize(wxSizeEvent& event) { tc3DWindow::OnSize(event); } void tcMapOverlay::Redraw() { redraw = true; } tcMapOverlay::tcMapOverlay(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : tc3DWindow(parent, pos, size, name, 0), redraw(false) { } tcMapOverlay::~tcMapOverlay() { ClearMapObjects(); } Index: tcSmoker.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcSmoker.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSmoker.cpp 27 Jan 2005 01:01:50 -0000 1.2 --- tcSmoker.cpp 31 Mar 2005 03:51:13 -0000 1.3 *************** *** 131,135 **** // create rotation matrix (using euler angles for now) const osg::Vec3 xaxis(-1, 0, 0); ! const osg::Vec3 yaxis(0, 1, 0); const osg::Vec3 zaxis(0, 0, 1); --- 131,135 ---- // create rotation matrix (using euler angles for now) const osg::Vec3 xaxis(-1, 0, 0); ! const osg::Vec3 yaxis(0, -1, 0); const osg::Vec3 zaxis(0, 0, 1); Index: tcMapObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapObject.cpp 2 Nov 2004 04:23:56 -0000 1.6 --- tcMapObject.cpp 31 Mar 2005 03:51:12 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- #include "math_constants.h" #include "simmath.h" + #include <osg/Geometry> #ifdef _DEBUG *************** *** 41,45 **** tcMapView* tcMapObject::mapView = NULL; ! void tcMapObject::Draw() { if (!isActive) return; --- 42,102 ---- tcMapView* tcMapObject::mapView = NULL; ! osg::ref_ptr<osg::Geometry> tcMapObject::marker; ! ! void tcMapObject::LoadMarker() ! { ! float w = 10.0f; ! ! marker = new osg::Geometry; ! ! osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); ! marker->setColorArray(colors); ! marker->setColorBinding(osg::Geometry::BIND_OVERALL); ! ! marker->setUseDisplayList(true); ! ! // set state ! osg::StateSet* stateSet = marker->getOrCreateStateSet(); ! stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); ! stateSet->setMode(GL_DEPTH_WRITEMASK, osg::StateAttribute::OFF); ! stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ! stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); ! ! // ugly, this could get out of sync with map render bin offset ! //stateSet->setRenderBinDetails(12, "RenderBin"); ! ! // create vertex array ! osg::Vec3Array* vertices = new osg::Vec3Array; ! marker->setVertexArray(vertices); ! ! vertices->push_back(osg::Vec3(-w, w, 0)); ! vertices->push_back(osg::Vec3(-w, -w, 0)); ! vertices->push_back(osg::Vec3(w, -w, 0)); ! vertices->push_back(osg::Vec3(w, w, 0)); ! ! // create texture coordinates ! osg::Vec2Array* texcoords = new osg::Vec2Array(4); ! (*texcoords)[0].set(0.0f, 1.0f); ! (*texcoords)[1].set(0.0f, 0.0f); ! (*texcoords)[2].set(1.0f, 0.0f); ! (*texcoords)[3].set(1.0f, 1.0f); ! marker->setTexCoordArray(0,texcoords); ! ! marker->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4)); ! ! // add texture ! osg::Image* image = tc3DWindow::LoadImage("marker.png"); ! ! osg::Texture2D* texture = new osg::Texture2D; ! texture->setDataVariance(osg::Object::STATIC); ! texture->setImage(image); ! ! osg::StateSet* stateset = marker->getOrCreateStateSet(); ! stateset->setTextureAttributeAndModes(0, texture, ! osg::StateAttribute::ON); ! } ! ! void tcMapObject::Draw(tc3DWindow* host) { if (!isActive) return; *************** *** 50,55 **** if (markerEnabled) { ! mapView->DrawLineR(x-8, y-8, x+8, y+8, color); ! mapView->DrawLineR(x+8, y-8, x-8, y+8, color); } } --- 107,112 ---- if (markerEnabled) { ! host->DrawLineR(x-8, y-8, x+8, y+8, color); ! host->DrawLineR(x+8, y-8, x-8, y+8, color); } } *************** *** 102,105 **** --- 159,164 ---- isActive = true; markerEnabled = true; + + if (!marker.valid()) LoadMarker(); } *************** *** 111,115 **** /********** tcMapTextObject **************/ ! void tcMapTextObject::Draw() { if (!isActive) return; --- 170,174 ---- /********** tcMapTextObject **************/ ! void tcMapTextObject::Draw(tc3DWindow* host) { if (!isActive) return; *************** *** 119,129 **** ! mapView->DrawTextR(caption.c_str(), x+5.0f, y, mapView->GetDefaultFont(), color, 16.0, LEFT_BASE_LINE); if (markerEnabled) // avoids parent draw overhead this way { ! mapView->DrawLineR(x-8, y-8, x+8, y+8, color); ! mapView->DrawLineR(x+8, y-8, x-8, y+8, color); } --- 178,189 ---- ! host->DrawTextR(caption.c_str(), x+5.0f, y, mapView->GetDefaultFont(), color, 16.0, LEFT_BASE_LINE); if (markerEnabled) // avoids parent draw overhead this way { ! host->DrawGeometryR(marker.get(), x, y); ! //mapView->DrawLineR(x-8, y-8, x+8, y+8, color); ! //mapView->DrawLineR(x+8, y-8, x-8, y+8, color); } *************** *** 135,139 **** } ! tcMapTextObject::tcMapTextObject(std::string text, double x, double y, bool useRel) : tcMapObject(x, y, useRel), caption(text) { --- 195,199 ---- } ! tcMapTextObject::tcMapTextObject(const std::string& text, double x, double y, bool useRel) : tcMapObject(x, y, useRel), caption(text) { Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tc3DWindow.cpp 4 Mar 2005 00:46:17 -0000 1.17 --- tc3DWindow.cpp 31 Mar 2005 03:51:12 -0000 1.18 *************** *** 1841,1844 **** --- 1841,1847 ---- lineStateSet->setRenderBinDetails(baseRenderBin + lineRenderBin, "RenderBin"); + osg::StateSet* groupStateSet = groupRoot->getOrCreateStateSet(); + groupStateSet->setRenderBinDetails(baseRenderBin + geometryRenderBin, "RenderBin"); + size_t nChildren = children.size(); *************** *** 1885,1888 **** --- 1888,1892 ---- lineRenderBin(1), // using 1 causes dropouts at some 3D viewer window sizes!? rectRenderBin(1), + geometryRenderBin(1), textRenderBin(2), fontSize(12.0), *************** *** 1926,1929 **** --- 1930,1934 ---- groupStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); groupStateSet->setMode(GL_BLEND, osg::StateAttribute::ON); + groupStateSet->setRenderBinDetails(baseRenderBin + geometryRenderBin, "RenderBin"); textRoot = new osg::Geode; Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMapView.cpp 19 Mar 2005 15:31:08 -0000 1.21 --- tcMapView.cpp 31 Mar 2005 03:51:12 -0000 1.22 *************** *** 39,42 **** --- 39,43 ---- #include "tcString.h" #include "tcMapObject.h" + #include "tcMapOverlay.h" #include <osg/Image> *************** *** 265,275 **** } ! /***********************************************************************************/ void tcMapView::SetViewCenterZoom(wxPoint pscreen, float afZoom) { ! //SetView(ScreenToGeo(TranslatePoint(pscreen)),mfLonWidth/afZoom); ! SetView(ScreenToGeo(pscreen),mfLonWidth/afZoom); } ! /***********************************************************************************/ void tcMapView::SetView(tcPoint center, float afLonSpan) { --- 266,280 ---- } ! /** ! * ! */ void tcMapView::SetViewCenterZoom(wxPoint pscreen, float afZoom) { ! SetView(ScreenToGeo(pscreen), mfLonWidth/afZoom); } ! ! /** ! * ! */ void tcMapView::SetView(tcPoint center, float afLonSpan) { *************** *** 598,602 **** { tcMapObject* obj = specialGraphics[n]; ! obj->Draw(); } } --- 603,607 ---- { tcMapObject* obj = specialGraphics[n]; ! obj->Draw(this); } } *************** *** 725,728 **** --- 730,735 ---- if (mnGameMode != GAMEMODE_NORMAL) {DrawIndicator(1);} + overlay->Draw(); + DrawBorder(); *************** *** 778,781 **** --- 785,792 ---- } + tcMapOverlay* tcTacticalMapView::GetMapOverlay() const + { + return overlay; + } /** *************** *** 2183,2186 **** --- 2194,2204 ---- } + void tcTacticalMapView::SetView(tcPoint center, float afLonSpan) + { + tcMapView::SetView(center, afLonSpan); + + overlay->Redraw(); + } + /** * OnLeaveWindow event handler *************** *** 2368,2371 **** --- 2386,2397 ---- return; // old returned false } + + void tcTacticalMapView::OnSize(wxSizeEvent& event) + { + overlay->OnSize(event); + + tcMapView::OnSize(event); + } + /** * *************** *** 2427,2430 **** --- 2453,2470 ---- } + void tcTacticalMapView::SetActive(bool abActive) + { + overlay->SetActive(abActive); + tcMapView::SetActive(abActive); + } + + void tcTacticalMapView::SetBaseRenderBin(int n) + { + tcMapView::SetBaseRenderBin(n); + + wxASSERT(overlay); + overlay->SetBaseRenderBin(n - 5); + } + void tcTacticalMapView::SetGroupHook(std::vector<long>& hookedUnits) { *************** *** 2492,2495 **** --- 2532,2539 ---- } + overlay = new tcMapOverlay(parent, pos, size); + overlay->SetBaseRenderBin(5); + overlay->SetActive(true); + tc3DWindow::MoveToTop(); // so that color elevation map is underneath |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:21
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/include/graphics Modified Files: tc3DWindow.h tcMapObject.h tcMapView.h Added Files: tcMapOverlay.h Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMapObject.h 21 Oct 2004 04:10:58 -0000 1.7 --- tcMapObject.h 31 Mar 2005 03:51:11 -0000 1.8 *************** *** 33,50 **** #include "simmath.h" #include <osg/Vec4> ! /** ! * Windows GDI+ library TO BE REPLACED with a cross-platform library ! * or cross-platform wrapper. ! */ ! namespace Gdiplus ! { ! class Graphics; ! } namespace MapView { class tcMapView; } /** --- 33,49 ---- #include "simmath.h" + #include <osg/ref_ptr> #include <osg/Vec4> ! class tc3DWindow; ! namespace MapView { class tcMapView; } + namespace osg + { + class Geometry; + } /** *************** *** 62,66 **** bool isActive; ! virtual void Draw(); osg::Vec4 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} --- 61,65 ---- bool isActive; ! virtual void Draw(tc3DWindow* host); osg::Vec4 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} *************** *** 78,82 **** --- 77,84 ---- tcPoint GetScreenPoint() const; + static osg::ref_ptr<osg::Geometry> marker; static MapView::tcMapView *mapView; ///< used to translate lat/lon coords into screen coords + + static void LoadMarker(); private: bool useRelativeCoords; ///< interpret lat_rad and lon_rad as rel screen coords [0-1] *************** *** 93,100 **** std::string caption; ///< text to display ! virtual void Draw(); tcMapTextObject(); ! tcMapTextObject(std::string text, double x, double y, bool useRel = false); virtual ~tcMapTextObject(); }; --- 95,102 ---- std::string caption; ///< text to display ! virtual void Draw(tc3DWindow* host); tcMapTextObject(); ! tcMapTextObject(const std::string& text, double x, double y, bool useRel = false); virtual ~tcMapTextObject(); }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tc3DWindow.h 20 Feb 2005 21:54:31 -0000 1.13 --- tc3DWindow.h 31 Mar 2005 03:51:11 -0000 1.14 *************** *** 215,218 **** --- 215,219 ---- const int rectRenderBin; const int textRenderBin; + const int geometryRenderBin; *************** *** 282,286 **** osg::ref_ptr<osg::Geode> backgroundRoot; ///< root node for background graphics osg::ref_ptr<osg::Geode> lineRoot; ///< root node for lines and rectangle graphics ! osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with --- 283,287 ---- osg::ref_ptr<osg::Geode> backgroundRoot; ///< root node for background graphics osg::ref_ptr<osg::Geode> lineRoot; ///< root node for lines and rectangle graphics ! osg::ref_ptr<osgText::Text> referenceText; ///< text to make size measurements with --- NEW FILE: tcMapOverlay.h --- /** ** @file tcMapOverlay.h */ /* Copyright (C) 2005 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 _MAPOVERLAY_H_ #define _MAPOVERLAY_H_ #if _MSC_VER > 1000 #pragma once #endif #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" //for MS Windows specific definitions #endif #include "tc3DWindow.h" namespace osg { class Image; class Geometry; } class tcMapObject; /** * Class intended to draw map objects on top of map. * Example uses are to mark geopolitical borders, cities, and * items of interest for current scenario. */ class tcMapOverlay : public tc3DWindow { public: void AddMapObject(tcMapObject *obj); void ClearMapObjects(); void Draw(); /// declared public here to allow parent MapView to call void OnSize(wxSizeEvent& event); /// redraw overlay during next call to Draw() void Redraw(); tcMapOverlay(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "MapOverlay"); virtual ~tcMapOverlay(); private: std::vector<tcMapObject*> overlayObjects; // objects to draw /// used to redraw (create and add objects to scenegraph) only when necessary bool redraw; }; #endif Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcMapView.h 19 Mar 2005 15:31:08 -0000 1.16 --- tcMapView.h 31 Mar 2005 03:51:11 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- class tcMapData; class tcMapObject; + class tcMapOverlay; namespace MapView *************** *** 211,217 **** tcPoint ScreenToGeo(float x, float y); virtual void SetActive(bool abActive); ///< overrides base class ! void SetBaseRenderBin(int n); void SetSize(const wxRect& rect); ! void SetView(tcPoint center, float afLonSpan); void SetViewCenterZoom(wxPoint pscreen, float afZoom); //void SetWindow(RECT& r); --- 212,218 ---- tcPoint ScreenToGeo(float x, float y); virtual void SetActive(bool abActive); ///< overrides base class ! virtual void SetBaseRenderBin(int n); void SetSize(const wxRect& rect); ! virtual void SetView(tcPoint center, float afLonSpan); void SetViewCenterZoom(wxPoint pscreen, float afZoom); //void SetWindow(RECT& r); *************** *** 292,295 **** --- 293,297 ---- void SetMapCmdCallback(const char *azCallback, const std::vector<long>& id, int param = -1); void SetMousePoint(wxPoint point) {mpointMouse = point;} // used to be TranslatePoint(point); + void SetView(tcPoint center, float afLonSpan); void ScrollMap(float afDirection_deg); void ClearMapCmd() {meMapCmd = MC_NONE;} *************** *** 307,310 **** --- 309,313 ---- std::vector<long>& GetHookedGroup(); long GetHookID(size_t idx = 0); + tcMapOverlay* GetMapOverlay() const; long Hook(wxPoint pscreen); void HookAnother(wxPoint pscreen); *************** *** 322,325 **** --- 325,329 ---- void OnMouseWheel(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); + void OnSize(wxSizeEvent& event); void Refresh(); void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} *************** *** 327,330 **** --- 331,336 ---- void ClearMapObjects(); void Init(); + void SetActive(bool abActive); ///< overrides base class + void SetBaseRenderBin(int n); void SetDateTime(const std::string& s) {dateTime = s;} void SetHookID(long id); *************** *** 340,343 **** --- 346,350 ---- private: + tcMapOverlay* overlay; std::string dateTime; ///< string with complete date/time WCHAR mzwchar[255]; *************** *** 350,353 **** --- 357,361 ---- osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; + teSymbology meSymbology; float mfSymbolXOffset, mfSymbolYOffset; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-31 03:51:21
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27747/src/database Modified Files: tcMissileDBObject.cpp Log Message: Added map overlay, fixed smoke trail roll bug, improved FOV calc for autopoint launchers, database tweaks Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcMissileDBObject.cpp 29 Mar 2005 00:12:26 -0000 1.16 --- tcMissileDBObject.cpp 31 Mar 2005 03:51:12 -0000 1.17 *************** *** 35,38 **** --- 35,39 ---- #include "common/tinyxml.h" #include "database/tcSqlReader.h" + #include "tcSensorDBObject.h" #include <sstream> *************** *** 65,69 **** } ! tnPoolIndex tcMissileDBObject::GetPrimarySeekerKey() { wxASSERT(database); --- 66,70 ---- } ! long tcMissileDBObject::GetPrimarySeekerKey() { wxASSERT(database); *************** *** 81,84 **** --- 82,107 ---- /** + * @return seeker field of view in radians + */ + float tcMissileDBObject::GetSeekerFOV() + { + if (seekerFOV_rad >= 0) return seekerFOV_rad; + + long seekerKey = GetPrimarySeekerKey(); + tcDatabaseObject* obj = database->GetObject(seekerKey); + if (tcSensorDBObject* sensor = dynamic_cast<tcSensorDBObject*>(obj)) + { + seekerFOV_rad = C_PIOVER180 * sensor->mfFieldOfView_deg; + } + else + { + wxASSERT(false); + seekerFOV_rad = C_TWOPI; + } + + return seekerFOV_rad; + } + + /** * This checks that the database object has all of the emitters in the * emitters vector. Somewhat expensive, nEmitters * nSensors *************** *** 539,543 **** tcMissileDBObject::tcMissileDBObject(tcMissileDBObject& obj) ! : tcWeaponDBObject(obj) { mnClassID = DTYPE_MISSILE; --- 562,567 ---- tcMissileDBObject::tcMissileDBObject(tcMissileDBObject& obj) ! : tcWeaponDBObject(obj), ! seekerFOV_rad(obj.seekerFOV_rad) { mnClassID = DTYPE_MISSILE; *************** *** 574,578 **** } ! tcMissileDBObject::tcMissileDBObject() : tcWeaponDBObject() { mnClassID = DTYPE_MISSILE; --- 598,603 ---- } ! tcMissileDBObject::tcMissileDBObject() : tcWeaponDBObject(), ! seekerFOV_rad(-1.0f) { mnClassID = DTYPE_MISSILE; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-29 00:13:07
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/src/graphics Modified Files: tcCreditView.cpp tcHookInfo.cpp tcMessageCenter.cpp tcMessageInterface.cpp tcStartView.cpp Log Message: 0.7.0 release snapshot Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcStartView.cpp 19 Mar 2005 15:31:09 -0000 1.8 --- tcStartView.cpp 29 Mar 2005 00:12:27 -0000 1.9 *************** *** 96,100 **** ! wxString s = wxString::Format("%s Limited Release Build", __DATE__); DrawTextR(s.c_str(), 85.0, 150.0, --- 96,100 ---- ! wxString s = wxString::Format("%s Test Build", __DATE__); DrawTextR(s.c_str(), 85.0, 150.0, Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMessageCenter.cpp 8 Mar 2005 00:41:49 -0000 1.5 --- tcMessageCenter.cpp 29 Mar 2005 00:12:26 -0000 1.6 *************** *** 25,28 **** --- 25,29 ---- #include "tcMessageChannel.h" #include "tcPopupMessage.h" + #include "tcSoundConsole.h" #include <stdio.h> *************** *** 43,46 **** --- 44,52 ---- } + void tcMessageCenter::AttachConsole(tcSoundConsole* console_) + { + console = console_; + } + /** * Removes and deletes all channels *************** *** 59,62 **** --- 65,77 ---- } + /** + * Writes a message to the text console + */ + void tcMessageCenter::ConsoleMessage(const std::string& msg) + { + wxASSERT(console); + + console->Print(msg.c_str()); + } /** *************** *** 197,201 **** activeChannelName(""), popupBase(205, 70), ! popupCount(0) { channelTab.Set(10, 140, 10, 30); --- 212,217 ---- activeChannelName(""), popupBase(205, 70), ! popupCount(0), ! console(0) { channelTab.Set(10, 140, 10, 30); Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcCreditView.cpp 10 Mar 2005 03:28:28 -0000 1.12 --- tcCreditView.cpp 29 Mar 2005 00:12:26 -0000 1.13 *************** *** 2,6 **** ** @file tcCreditView.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** @file tcCreditView.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 54,61 **** s = "------- C R E D I T S -------"; ! AddCredit(s, 40.0f, 1); - s = "Credits not updated for 0.7 yet"; - AddCredit(s, 45.0f, 1); s = "GCB 0.6 Credits"; --- 54,86 ---- s = "------- C R E D I T S -------"; ! AddCredit(s, 60.0f, 1); ! ! s = "Dewitt Colclough"; ! AddCredit(s, 25.0f, 1); ! ! s = "Project manager and lead developer\n"; ! AddCredit(s, 80.0f, 0); ! ! s = "--- 3D art ---"; ! AddCredit(s, 25.0f, 1); ! ! s = "Guido Militello"; ! AddCredit(s, 25.0f, 1); ! ! s = "Marcelo C\341ceres (op4_delta)"; ! AddCredit(s, 25.0f, 1); ! ! s = "TLAM Strike"; ! AddCredit(s, 25.0f, 1); ! ! s = "Jason Simpson"; ! AddCredit(s, 60.0f, 1); ! ! s = "--- Test ---"; ! AddCredit(s, 25.0f, 1); ! ! s = "Dust"; ! AddCredit(s, 125.0f, 1); s = "GCB 0.6 Credits"; *************** *** 128,134 **** AddCredit(s, 30.0f, 0); ! s = "wxWindows\n"; AddCredit(s, 20.0f, 0); ! s = "www.wxwindows.org\n"; AddCredit(s, 30.0f, 0); --- 153,159 ---- AddCredit(s, 30.0f, 0); ! s = "wxWidgets\n"; AddCredit(s, 20.0f, 0); ! s = "www.wxwidgets.org\n"; AddCredit(s, 30.0f, 0); *************** *** 176,180 **** AddCredit(s, 20.0f, 0); ! s = "Copyright (C) 2002-2004, All rights reserved.\n"; AddCredit(s, 60.0f, 0); --- 201,205 ---- AddCredit(s, 20.0f, 0); ! s = "Copyright (C) 2002-2005, All rights reserved.\n"; AddCredit(s, 60.0f, 0); Index: tcMessageInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageInterface.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMessageInterface.cpp 2 Dec 2004 04:17:25 -0000 1.2 --- tcMessageInterface.cpp 29 Mar 2005 00:12:26 -0000 1.3 *************** *** 45,48 **** --- 45,55 ---- } + void tcMessageInterface::ConsoleMessage(const std::string& msg) + { + wxASSERT(messageCenter); + + messageCenter->ConsoleMessage(msg); + } + /** * Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcHookInfo.cpp 10 Mar 2005 03:28:28 -0000 1.8 --- tcHookInfo.cpp 29 Mar 2005 00:12:26 -0000 1.9 *************** *** 424,427 **** --- 424,432 ---- DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); ftexty += 15; + + sprintf(zBuff, "Distance: %.1f km", 0.001f * missile->GetDistanceFromLaunch()); + + DrawTextR(zBuff, ftextx, ftexty, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); + ftexty += 15; } |
|
From: Dewitt C. <ddc...@us...> - 2005-03-29 00:13:07
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp Log Message: 0.7.0 release snapshot Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcPlatformInterfaceExtensionB.cpp 2 Mar 2005 22:28:44 -0000 1.21 --- tcPlatformInterfaceExtensionB.cpp 29 Mar 2005 00:12:27 -0000 1.22 *************** *** 147,150 **** --- 147,152 ---- .def("LookupFriendlyName", &tcPlatformInterface::LookupFriendlyName) .def("DisplayMessage",&tcPlatformInterface::DisplayMessage) + .def("DisplayPopupMessage", &tcPlatformInterface::DisplayPopupMessage) + .def("IsPlayerControlled", &tcPlatformInterface::IsPlayerControlled) .def("IsValid",&tcPlatformInterface::IsValid) .def("PlaySound",&tcPlatformInterface::PlaySound) Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcScenarioInterface.cpp 2 Mar 2005 22:28:44 -0000 1.21 --- tcScenarioInterface.cpp 29 Mar 2005 00:12:27 -0000 1.22 *************** *** 194,198 **** if (dbObj == NULL) { ! fprintf(stderr,"Could not find class name %s in DB\n",unit.className.c_str()); return false; } --- 194,204 ---- if (dbObj == NULL) { ! wxString errorMessage = ! wxString::Format("Could not find class name \"%s\" in database, " ! "check entry in scenario \"%s\"\n", ! unit.className.c_str(), simState->GetScenarioName()); ! ! fprintf(stderr, errorMessage.c_str()); ! wxMessageBox(errorMessage.c_str(), "Error", wxICON_ERROR); return false; } Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcPlatformInterface.cpp 25 Mar 2005 03:48:07 -0000 1.40 --- tcPlatformInterface.cpp 29 Mar 2005 00:12:27 -0000 1.41 *************** *** 47,50 **** --- 47,51 ---- #include "tcLauncherState.h" #include "tcLauncher.h" + #include "tcMessageInterface.h" #include "tcStores.h" #include "ai/Brain.h" *************** *** 516,520 **** dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj)) { ! info.mfRange_km = 20; } else if (tcTorpedoDBObject* torpDBObj = --- 517,521 ---- dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj)) { ! info.mfRange_km = ballisticDBObj->maxRange_km; } else if (tcTorpedoDBObject* torpDBObj = *************** *** 1074,1077 **** --- 1075,1084 ---- } + + bool tcPlatformInterface::IsPlayerControlled() const + { + return mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->mnAlliance); + } + long tcPlatformInterface::LookupFriendlyId(const std::string& unitName) { *************** *** 1124,1128 **** * print message to user console */ ! void tcPlatformInterface::DisplayMessage(std::string text) { wxASSERT(mpConsole); --- 1131,1135 ---- * print message to user console */ ! void tcPlatformInterface::DisplayMessage(const std::string& text) { wxASSERT(mpConsole); *************** *** 1141,1144 **** --- 1148,1175 ---- } + + /** + * print message to user console + */ + void tcPlatformInterface::DisplayPopupMessage(const std::string& text) + { + wxASSERT(mpConsole); + + if (isPlatformOwnAlliance) + { + wxString s = wxString::Format("%s: %s", mpPlatformObj->mzUnit.mz, text.c_str()); + tcMessageInterface::Get()->PopupMessage(s.c_str()); + #ifdef _DEBUG + fprintf(stdout, "* popup msg from platform:%d %s\n", mpPlatformObj->mnID, text.c_str()); + #endif + } + #ifdef _DEBUG + else + { + fprintf(stdout, "* popup msg from OPFOR:%d %s\n", mpPlatformObj->mnID, text.c_str()); + } + #endif + } + /** * Modified to use string argument |
|
From: Dewitt C. <ddc...@us...> - 2005-03-29 00:13:06
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/src/database Modified Files: tcDatabase.cpp tcMissileDBObject.cpp Log Message: 0.7.0 release snapshot Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcMissileDBObject.cpp 7 Dec 2004 04:00:28 -0000 1.15 --- tcMissileDBObject.cpp 29 Mar 2005 00:12:26 -0000 1.16 *************** *** 71,77 **** primarySeekerKey = database->GetKey(maSensorClass[0]); ! if (primarySeekerKey == NULL_INDEX) { ! std::cerr << "tcMissileDBObject::GetPrimarySeekerKey -- not found" << std::endl; } return primarySeekerKey; --- 71,79 ---- primarySeekerKey = database->GetKey(maSensorClass[0]); ! // do not report error for missiles with no sensor (e.g. some AGMs) ! if ((primarySeekerKey == NULL_INDEX) && (strlen(maSensorClass[0].mz) > 0)) { ! fprintf(stderr, "tcMissileDBObject::GetPrimarySeekerKey -- not found " ! "(%s)\n", maSensorClass[0].mz); } return primarySeekerKey; *************** *** 90,98 **** unsigned int nEmitters = emitters.size(); for (unsigned int k=0; k<nEmitters; k++) { long emitterId = emitters[k]; ! if (primarySeekerKey != emitterId) return false; } return true; --- 92,102 ---- unsigned int nEmitters = emitters.size(); + long seekerKey = GetPrimarySeekerKey(); + for (unsigned int k=0; k<nEmitters; k++) { long emitterId = emitters[k]; ! if (seekerKey != emitterId) return false; } return true; *************** *** 596,601 **** mfRange_km = 123.4f; // sensor info ! maSensorClass[0] = "none"; ! maSensorClass[1] = "none"; // flight profile, array of flight segment info mnNumSegments = 1; --- 600,605 ---- mfRange_km = 123.4f; // sensor info ! maSensorClass[0] = ""; ! maSensorClass[1] = ""; // flight profile, array of flight segment info mnNumSegments = 1; Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcDatabase.cpp 5 Mar 2005 22:37:51 -0000 1.24 --- tcDatabase.cpp 29 Mar 2005 00:12:26 -0000 1.25 *************** *** 681,686 **** pmissile->mfRange_km = 123.4f; // sensor info ! pmissile->maSensorClass[0] = "none"; ! pmissile->maSensorClass[1] = "none"; // flight profile, array of flight segment info pmissile->mnNumSegments = 1; --- 681,686 ---- pmissile->mfRange_km = 123.4f; // sensor info ! pmissile->maSensorClass[0] = ""; ! pmissile->maSensorClass[1] = ""; // flight profile, array of flight segment info pmissile->mnNumSegments = 1; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-29 00:13:05
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/src/common Modified Files: tcOptions.cpp tcSound.cpp Log Message: 0.7.0 release snapshot Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcSound.cpp 25 Mar 2005 03:48:07 -0000 1.28 --- tcSound.cpp 29 Mar 2005 00:12:25 -0000 1.29 *************** *** 107,110 **** --- 107,111 ---- effectMap["shishding"] = LoadSample("shishding.wav"); effectMap["Gatling"] = LoadSample("gatling.wav"); + effectMap["Alarm"] = LoadSample("alarm.wav"); SetMusicVolume(0.5f); Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcOptions.cpp 30 Dec 2004 17:26:06 -0000 1.15 --- tcOptions.cpp 29 Mar 2005 00:12:25 -0000 1.16 *************** *** 274,279 **** } ! /******************************************************************************/ ! // set state based on value of mpAssociated void tcOptions::Synchronize() { --- 274,280 ---- } ! /** ! * Call this after changing an option variable ! */ void tcOptions::Synchronize() { |
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/include/sim Modified Files: tcGameObject.h tcLauncher.h tcLauncherState.h tcMissileObject.h tcObjectControl.h tcPlatformObject.h tcSensorState.h tcSimState.h Log Message: 0.7.0 release snapshot Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** tcGameObject.h 25 Mar 2005 03:48:06 -0000 1.34 --- tcGameObject.h 29 Mar 2005 00:12:24 -0000 1.35 *************** *** 113,116 **** --- 113,117 ---- float mfDamageLevel; ///< 0 is no damage, 1 is fully damaged + virtual void ApplyDamage(float damage); ///< called when new damage occurs float RangeTo(tcGameObject& p) const; float BearingTo(tcGameObject& p) const; Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcLauncher.h 10 Mar 2005 03:28:27 -0000 1.12 --- tcLauncher.h 29 Mar 2005 00:12:24 -0000 1.13 *************** *** 69,73 **** LAUNCHER_INACTIVE = 10, NO_FIRECONTROL = 11, ! TOO_DEEP = 12 ///< too deep for sub launch }; ///< launcher status codes --- 69,74 ---- LAUNCHER_INACTIVE = 10, NO_FIRECONTROL = 11, ! TOO_DEEP = 12, ///< too deep for sub launch ! DAMAGED = 13 ///< cannot operate due to damage }; ///< launcher status codes *************** *** 124,131 **** --- 125,134 ---- float GetSectorWidth() const; ///< returns width of engagement sector in radians bool IsAutoPoint() const; + bool IsDamaged() const; void SetErrorCode(int code) {errorCode = code;} void SetChildClass(const std::string& childClass); void SetChildQuantity(unsigned int quantity); + void SetDamaged(bool state); void SetLoadState(bool state); void SetParent(tcGameObject *obj); *************** *** 141,144 **** --- 144,148 ---- private: tcGameObject* parent; + bool isDamaged; static tcSimState* simState; Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcObjectControl.h 4 Mar 2005 00:46:15 -0000 1.14 --- tcObjectControl.h 29 Mar 2005 00:12:24 -0000 1.15 *************** *** 89,97 **** enum teButtonState { ! BS_DISABLED, ! BS_READYING, ! BS_READY, ! BS_ACTIVE, ! BS_LOADING }; --- 89,98 ---- enum teButtonState { ! BS_DAMAGED, ///< damaged ! BS_DISABLED, ///< out of ammo ! BS_READYING, ///< items loaded, launcher readying ! BS_READY, ///< ready for immediate launch ! BS_ACTIVE, ///< active but launch conditions not satisfied yet ! BS_LOADING ///< loading item(s) into launcher }; *************** *** 202,206 **** ! void CreateHeadingCircles(); void DrawBarObject(tsBarObjectInfo *apBOI, float afValue, float afValueGoal); --- 203,208 ---- ! void AddSensorRangeCircles(); ! void AddWeaponRangeCircles(); void CreateHeadingCircles(); void DrawBarObject(tsBarObjectInfo *apBOI, float afValue, float afValueGoal); Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcMissileObject.h 24 Feb 2005 22:19:14 -0000 1.16 --- tcMissileObject.h 29 Mar 2005 00:12:24 -0000 1.17 *************** *** 69,72 **** --- 69,73 ---- teAltitudeMode GetCurrentAltitudeMode(); teGuidanceMode GetCurrentGuidanceMode(); + float GetDistanceFromLaunch() const; virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} virtual tcRadar* GetSensorState(); *************** *** 85,88 **** tcMissileObject(tcMissileDBObject *obj); ~tcMissileObject(); }; ! #endif \ No newline at end of file --- 86,93 ---- tcMissileObject(tcMissileDBObject *obj); ~tcMissileObject(); + + private: + float distanceFromLaunch; ///< distance traveled from launch }; ! ! #endif Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcLauncherState.h 7 Dec 2004 03:59:14 -0000 1.13 --- tcLauncherState.h 29 Mar 2005 00:12:24 -0000 1.14 *************** *** 71,75 **** const tcLauncher* GetLauncher(unsigned nLauncher) const; std::string GetLauncherChildClass(unsigned nLauncher) const; ! int GetLauncherCount() const; int GetLauncherQuantity(unsigned anLauncher); int GetLauncherStatus(unsigned nLauncher); --- 71,75 ---- const tcLauncher* GetLauncher(unsigned nLauncher) const; std::string GetLauncherChildClass(unsigned nLauncher) const; ! unsigned int GetLauncherCount() const; int GetLauncherQuantity(unsigned anLauncher); int GetLauncherStatus(unsigned nLauncher); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcPlatformObject.h 4 Mar 2005 00:46:15 -0000 1.24 --- tcPlatformObject.h 29 Mar 2005 00:12:24 -0000 1.25 *************** *** 93,97 **** tcCommandObject commandObj; ! virtual void Clear(); virtual void DesignateDatum(tcPoint p); --- 93,97 ---- tcCommandObject commandObj; ! virtual void ApplyDamage(float damage); virtual void Clear(); virtual void DesignateDatum(tcPoint p); *************** *** 102,105 **** --- 102,106 ---- virtual void GetDatum(GeoPoint& p) {p=msTargetDatum;} virtual tcLauncher* GetLauncher(unsigned idx); + unsigned int GetLauncherCount() const; wxString GetLauncherDescription(); virtual int GetLauncherQuantity(unsigned anLauncher); Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tcSimState.h 25 Mar 2005 03:48:06 -0000 1.36 --- tcSimState.h 29 Mar 2005 00:12:24 -0000 1.37 *************** *** 152,155 **** --- 152,156 ---- void GetPlatformsWithinRegion(std::vector<long>& keyList, tcRect *apRegion); long GetRandomPlatform(); + const char* GetScenarioName() const; int GetSeekerTrack(long anKey, tcTrack& track); tcSensorMap* GetSensorMap(); Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcSensorState.h 2 Mar 2005 22:28:40 -0000 1.15 --- tcSensorState.h 29 Mar 2005 00:12:24 -0000 1.16 *************** *** 73,77 **** void GetTestArea(tcRect& region); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key ! bool IsHidden() const; virtual bool IsESM() const; --- 73,78 ---- void GetTestArea(tcRect& region); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key ! bool IsDamaged() const; ! bool IsHidden() const; virtual bool IsESM() const; *************** *** 85,88 **** --- 86,90 ---- virtual void SetActive(bool active); + void SetDamaged(bool state); void SetMountAz(float az); void SetParent(tcGameObject *obj) {parent = obj;} *************** *** 101,104 **** --- 103,107 ---- bool isHidden; ///< hidden sensors are not displayed in object control view + bool isDamaged; }; #endif \ No newline at end of file |