[Gcblue-commits] gcb_wx/include/sim tcSonar.h,NONE,1.1 commandlist.h,1.4,1.5 tcGameObject.h,1.27,1.2
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-02 04:18:07
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31820/include/sim Modified Files: commandlist.h tcGameObject.h tcLauncher.h tcMenu.h tcObjectControl.h tcRadar.h tcSubObject.h Added Files: tcSonar.h Log Message: Sonar work Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcGameObject.h 23 Nov 2004 23:30:49 -0000 1.27 --- tcGameObject.h 2 Dec 2004 04:17:24 -0000 1.28 *************** *** 163,166 **** --- 163,167 ---- static void SetGameObjectDatabase(Database::tcDatabase *db) {database = db;} static void SetGameObjectMapData(tcMapData *md) {mapData = md;} + static void SetHookedId(long id) {hookedId = id;} static void SetSimState(tcSimState *ss) {simState = ss;} const tcGameObject* operator= (const tcGameObject *p) {return p;} *************** *** 173,177 **** --- 174,181 ---- static Database::tcDatabase *database; static tcSimState *simState; + static long hookedId; ///< id hooked by user, used for messaging only static bool clientMode; ///< true if running as multiplayer client + + bool IsHooked() const; }; #endif \ No newline at end of file Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcLauncher.h 29 Nov 2004 03:54:49 -0000 1.5 --- tcLauncher.h 2 Dec 2004 04:17:24 -0000 1.6 *************** *** 66,69 **** --- 66,70 ---- unsigned int mnUncommitted; ///< mnCurrent - mnUncommitted = # pending launch int errorCode; ///< used in multiplayer to pass error code to client + bool isLoading; ///< true if launcher is offline to load/unload weapons tsGeoPoint msDatum; ///< datum to pass to weapon nav guidance *************** *** 92,95 **** --- 93,97 ---- void SetErrorCode(int code) {errorCode = code;} void SetChildClass(const std::string& childClass); + void SetLoadState(bool state); unsigned int GetCompatibleCount() const; std::string GetCompatibleName(unsigned int idx) const; Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcObjectControl.h 29 Nov 2004 03:54:49 -0000 1.10 --- tcObjectControl.h 2 Dec 2004 04:17:24 -0000 1.11 *************** *** 90,94 **** BS_READYING, BS_READY, ! BS_ACTIVE }; --- 90,95 ---- BS_READYING, BS_READY, ! BS_ACTIVE, ! BS_LOADING }; Index: tcMenu.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMenu.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMenu.h 1 Nov 2004 03:17:17 -0000 1.8 --- tcMenu.h 2 Dec 2004 04:17:24 -0000 1.9 *************** *** 48,51 **** --- 48,52 ---- std::string mzCommand; std::string mzUserInput; + std::string textParam; int mnCommand; bool mbSelected; *************** *** 57,61 **** void Clear() { ! mzCaption="";mzCommand="";mzUserInput=""; mnCommand=0;mbSelected=0;mbTop=0;mbBottom=0;mpSubMenu=NULL; } --- 58,62 ---- void Clear() { ! mzCaption="";mzCommand="";mzUserInput="";textParam=""; mnCommand=0;mbSelected=0;mbTop=0;mbBottom=0;mpSubMenu=NULL; } *************** *** 72,75 **** --- 73,77 ---- void AddItem(std::string caption, int command); void AddItem(std::string caption, std::string command, int param = -1); + void AddItem(std::string caption, std::string command, std::string textParam); void AddItemUI(std::string caption, std::string callback, std::string input, int param = -1); void BeginSubMenu(); Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcRadar.h 23 Nov 2004 23:30:50 -0000 1.11 --- tcRadar.h 2 Dec 2004 04:17:24 -0000 1.12 *************** *** 34,40 **** } using Database::tcRadarDBObject; ! /** ! * ! */ struct tsRadarTargetInfo { --- 34,39 ---- } using Database::tcRadarDBObject; ! ! /* struct tsRadarTargetInfo { *************** *** 46,49 **** --- 45,49 ---- float mfRCS_dbsm; } ; + */ class tcGameObject; Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSubObject.h 23 Nov 2004 23:30:50 -0000 1.1 --- tcSubObject.h 2 Dec 2004 04:17:24 -0000 1.2 *************** *** 81,87 **** --- 81,89 ---- bool periscopeRaised; float periscopeDepth_m; ///< periscope depth (positive number) + float lastDepth_m; ///< for depth notification messages virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); + virtual void UpdateMessages(); virtual void UpdateSensors(double t); virtual void UpdateSpeed(float dt_s); Index: commandlist.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/commandlist.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** commandlist.h 8 Aug 2004 00:31:33 -0000 1.4 --- commandlist.h 2 Dec 2004 04:17:24 -0000 1.5 *************** *** 49,52 **** --- 49,55 ---- #define MAX_QUEUED_COMMANDS 32 + /** + * + */ struct tsCommandInfo { *************** *** 60,63 **** --- 63,67 ---- bool mbCallback; bool mbGetUserInput; + std::string textParam; ///< string parameter for python }; *************** *** 100,105 **** } } ! // version without user input and callback ! void AddPythonCommand(const char *azCommand, int param = -1) { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; --- 104,112 ---- } } ! /** ! * version without user input and callback ! */ ! void AddPythonCommand(const char *azCommand, int param = -1) ! { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; *************** *** 107,111 **** newcmd.mbCallback = false; newcmd.mbGetUserInput = false; ! newcmd.mnData = param; strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); --- 114,119 ---- newcmd.mbCallback = false; newcmd.mbGetUserInput = false; ! newcmd.mnData = param; // int param ! newcmd.textParam = ""; // text param strcpy(newcmd.mzString , azCommand); strcpy(newcmd.mzUserInput, ""); *************** *** 114,117 **** --- 122,146 ---- } } + + /** + * version without user input and callback + */ + void AddPythonCommand(const char *azCommand, std::string textParam) + { + tsCommandInfo newcmd; + newcmd.meCmd = (teGameCommand)0; + newcmd.mbUsePython = true; + newcmd.mbCallback = false; + newcmd.mbGetUserInput = false; + newcmd.mnData = -1; // int param + newcmd.textParam = textParam; + strcpy(newcmd.mzString , azCommand); + strcpy(newcmd.mzUserInput, ""); + if (mnCount < MAX_QUEUED_COMMANDS) { + maCommand[mnCount++] = newcmd; + } + } + + /* GetUserInput is called to add a command to get user input data. ** Once the user input is complete, the callback function is called though *************** *** 119,123 **** ** callback function along with an optional parameter. */ ! void GetUserInput(const char *azCallback, const char *azUserInput, int param = -1) { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; --- 148,153 ---- ** callback function along with an optional parameter. */ ! void GetUserInput(const char *azCallback, const char *azUserInput, int param = -1) ! { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; *************** *** 126,129 **** --- 156,160 ---- newcmd.mbGetUserInput = true; newcmd.mnData = param; + newcmd.textParam = ""; strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); *************** *** 132,137 **** } } ! // version for callback ! void AddPythonCallback(const char *azCallback, const char *azUserInput, int param = -1) { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; --- 163,171 ---- } } ! /** ! * version for callback ! */ ! void AddPythonCallback(const char *azCallback, const char *azUserInput, int param = -1) ! { tsCommandInfo newcmd; newcmd.meCmd = (teGameCommand)0; *************** *** 140,143 **** --- 174,178 ---- newcmd.mbGetUserInput = false; newcmd.mnData = param; + newcmd.textParam = ""; strcpy(newcmd.mzString , azCallback); strcpy(newcmd.mzUserInput, azUserInput); --- NEW FILE: tcSonar.h --- /** ** @file tcSonar.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCSONAR_H_ #define _TCSONAR_H_ #include "tcSensorState.h" #include <vector> namespace Database { class tcSonarDBObject; } using Database::tcSonarDBObject; class tcGameObject; class tcStream; class tcUpdateStream; /** * Class to handle surveillance, fire control, and seeker radars. * May want to break this up use derived classes for detailed * functions. * */ class tcSonar : public tcSensorState { public: tcSonarDBObject *mpDBObj; virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key void Serialize(tcFile& file, bool mbLoad); virtual bool IsRadar() const; virtual bool IsSonar() const; virtual void Update(double t); tcSonar& operator=(tcSonar& ss); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcSonar* Clone(); tcSonar(); tcSonar(tcSonarDBObject* dbObj); virtual ~tcSonar(); protected: void UpdateSeeker(double t); void UpdateSensorMapActive(double t, const tcGameObject* target, float range_km); void UpdateSensorMapPassive(double t, const tcGameObject* target, float range_km, float az_rad); void UpdateSurveillance(double t); void UpdateTrack(const tcGameObject* target, double t); private: float last_az_rad; ///< [rad] target azimuth from last call to CanDetectTarget }; #endif |