gcblue-commits Mailing List for Global Conflict Blue (Page 35)
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-02-16 23:13:47
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15468/include/sim Modified Files: tcPlatformObject.h Log Message: Parallel ai update Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcPlatformObject.h 29 Nov 2004 03:54:49 -0000 1.21 --- tcPlatformObject.h 16 Feb 2005 23:13:38 -0000 1.22 *************** *** 35,38 **** --- 35,40 ---- using namespace AI; + + class tcStream; class tcCommandStream; *************** *** 46,49 **** --- 48,58 ---- } + namespace ai + { + class Brain; + } + + using ai::Brain; + /** * A generic moving object with sensors, launchers, and guidance. *************** *** 78,81 **** --- 87,91 ---- tcGuidanceState mcGS; tcAIData mcAI; + Brain* brain; tcLaunchRequest mcLaunchRequest; tsGeoPoint msTargetDatum; *************** *** 91,94 **** --- 101,105 ---- virtual bool DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher); virtual void DesignateTarget(long anID); + Brain* GetBrain(); virtual void GetDatum(tsGeoPoint& p) {p=msTargetDatum;} virtual tcLauncher* GetLauncher(unsigned idx); *************** *** 151,154 **** --- 162,166 ---- virtual void Move(float dt_s); + virtual void UpdateAI(float t); virtual void UpdateClimb(float dt_s) {}; virtual void UpdateFormationGuidance(void); |
|
From: Dewitt C. <ddc...@us...> - 2005-02-16 23:13:31
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15429/scripts Modified Files: AI.py Log Message: Parallel ai update Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AI.py 11 Dec 2004 01:09:06 -0000 1.15 --- AI.py 16 Feb 2005 23:13:23 -0000 1.16 *************** *** 39,42 **** --- 39,74 ---- ZigZagPatrol(UnitInfo) + def TestTask(TI): + UI = TI.GetPlatformInterface() + UI.SetHeading(UI.GetHeading() + 5) + + # test memory functions + iteration = TI.GetMemoryValue(1) + if (iteration == 0): + TI.SetMemoryText('test', UI.GetName()) + elif (iteration == 1): + memory_name = TI.GetMemoryText('test') + UI.DisplayMessage('%s: mem name is %s' % (memory_name, UI.GetName())) + + + # test blackboard + BB = TI.GetBlackboardInterface() + if (iteration == 0): + BB.Write('TestInfo', 'test info here') + + if (iteration == 2): + bb_item = BB.Read('TestInfo') + UI.DisplayMessage('%s: %s %d %f' % (UI.GetName(), bb_item.message, bb_item.author, bb_item.priority)) + + if (iteration == 3): + bb_msg = BB.ReadMessage('TestInfo') + bb_auth = BB.ReadAuthor('TestInfo') + bb_pri = BB.ReadPriority('TestInfo') + UI.DisplayMessage('%s: %s %d %f' % (UI.GetName(), bb_msg, bb_auth, bb_pri)) + + # increment iteration + iteration = iteration + 1 + TI.SetMemoryValue(1, iteration) + def AvoidGround(UI): *************** *** 88,92 **** def ZigZagPatrol(UI): targetid = UI.GetTarget() ! if targetid != 0xFFFFFFFF: InterceptTarget(UI) return --- 120,124 ---- def ZigZagPatrol(UI): targetid = UI.GetTarget() ! if targetid != -1: InterceptTarget(UI) return *************** *** 112,116 **** # engage hostiles in range track_id = GetSuitableTarget(UI) ! if (track_id != 0xFFFFFFFF): UI.SetTarget(track_id) UI.SetHeadingToInterceptTarget() --- 144,148 ---- # engage hostiles in range track_id = GetSuitableTarget(UI) ! if (track_id != -1): UI.SetTarget(track_id) UI.SetHeadingToInterceptTarget() |
|
From: Dewitt C. <ddc...@us...> - 2005-02-08 12:58:30
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29381/include/ai Modified Files: Brain.h Task.h Log Message: Index: Brain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Brain.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Brain.h 4 Feb 2005 18:50:46 -0000 1.1 --- Brain.h 8 Feb 2005 12:58:21 -0000 1.2 *************** *** 38,52 **** class Blackboard; - class Task - { - public: - std::map<std::string, std::string> textMemory; - std::map<int, double> numberMemory; - }; - - /** * Holds --- 38,45 ---- class Blackboard; + class Task; /** * Holds *************** *** 55,62 **** { public: ! Blackboard board; ///< for inter-task communication ! Brain(); ! ~Brain(); }; --- 48,57 ---- { public: ! Brain(); ! ~Brain(); ! private: ! Blackboard board; ///< for inter-task communication ! std::map<std::string, Task*> taskMap; }; Index: Task.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Task.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Task.h 4 Feb 2005 18:50:46 -0000 1.1 --- Task.h 8 Feb 2005 12:58:21 -0000 1.2 *************** *** 58,61 **** --- 58,62 ---- double priority; long id; + std::string scriptName; }; |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:55:55
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26003 Modified Files: GCblue.vcproj Log Message: Ground SAM related updates Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** GCblue.vcproj 27 Jan 2005 01:01:36 -0000 1.80 --- GCblue.vcproj 4 Feb 2005 18:55:46 -0000 1.81 *************** *** 488,491 **** --- 488,494 ---- </File> <File + RelativePath=".\src\sim\tcGroundObject.cpp"> + </File> + <File RelativePath="src\sim\tcGuidanceState.cpp"> </File> *************** *** 671,674 **** --- 674,693 ---- </File> </Filter> + <Filter + Name="ai" + Filter=""> + <File + RelativePath=".\src\ai\Blackboard.cpp"> + </File> + <File + RelativePath=".\src\ai\BlackboardItem.cpp"> + </File> + <File + RelativePath=".\src\ai\Brain.cpp"> + </File> + <File + RelativePath=".\src\ai\Task.cpp"> + </File> + </Filter> </Filter> <Filter *************** *** 1403,1406 **** --- 1422,1428 ---- </File> <File + RelativePath=".\include\sim\tcGroundObject.h"> + </File> + <File RelativePath="include\sim\tcGuidanceState.h"> </File> *************** *** 1595,1598 **** --- 1617,1636 ---- </File> </Filter> + <Filter + Name="ai" + Filter=""> + <File + RelativePath=".\include\ai\Blackboard.h"> + </File> + <File + RelativePath=".\include\ai\BlackboardItem.h"> + </File> + <File + RelativePath=".\include\ai\Brain.h"> + </File> + <File + RelativePath=".\include\ai\Task.h"> + </File> + </Filter> </Filter> </Files> |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:55:05
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25822/src/sim Modified Files: tcMissileObject.cpp Log Message: Ground SAM related updates Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMissileObject.cpp 23 Nov 2004 23:31:14 -0000 1.21 --- tcMissileObject.cpp 4 Feb 2005 18:54:51 -0000 1.22 *************** *** 174,177 **** --- 174,178 ---- mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; mcSensorState.mfLastScan = -10; // ensure rapid update to get a valid track for guidance + if (mcSensorState.IsSemiactive() || mcSensorState.IsCommandReceiver()) { *************** *** 502,506 **** // force level flight for first few seconds for air-launched missiles ! if ((msKState.mfFlightTime < 1.5)&&(msKState.mfAltitude_m > 50.0f)) { mfGoalHeading_rad = mcKin.mfHeading_rad; --- 503,507 ---- // force level flight for first few seconds for air-launched missiles ! if ((msKState.mfFlightTime < 1.5)&&(msKState.mfAltitude_m - mcTerrain.mfHeight_m > 50.0f)) { mfGoalHeading_rad = mcKin.mfHeading_rad; *************** *** 593,596 **** --- 594,612 ---- /** + * Modified to return null if no emitter exists (AGM cmd only case) + */ + tcRadar* tcMissileObject::GetSensorState() + { + if (mcSensorState.parent) + { + return &mcSensorState; + } + else + { + return 0; + } + } + + /** * */ *************** *** 725,728 **** --- 741,751 ---- mcSensorState.SetMountAz(0); // missile seeker always points forward } + else // modified to handle case for AGMs without a sensor (use pointer for sensorstate?) + { + mcSensorState.SetParent(0); + #ifdef _DEBUG + fprintf(stderr, "tcMissileObject - Warning - Sensor not found in DB (%s)\n", obj->maSensorClass[0].mz); + #endif + } } |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:51:49
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25199/scripts Modified Files: SecondaryHook.py Log Message: Ground SAM related updates Index: SecondaryHook.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/SecondaryHook.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecondaryHook.py 23 Mar 2004 18:23:22 -0000 1.1 --- SecondaryHook.py 4 Feb 2005 18:51:40 -0000 1.2 *************** *** 3,7 **** # used for targeting with right mouse click def ProcessSecondaryHook(UnitInfo, id): ! UnitInfo.PlaySound(19) UnitInfo.SetTarget(id) track_info = UnitInfo.GetTargetTrackInfo() --- 3,7 ---- # used for targeting with right mouse click def ProcessSecondaryHook(UnitInfo, id): ! UnitInfo.PlaySound('LowBeep') UnitInfo.SetTarget(id) track_info = UnitInfo.GetTargetTrackInfo() |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:50:57
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24994/include/ai Added Files: Blackboard.h BlackboardItem.h Brain.h Task.h Log Message: Ground SAM related updates --- NEW FILE: Brain.h --- /** ** @file Brain.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 _BRAIN_H_ #define _BRAIN_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> #include <vector> #include "ai/Blackboard.h" namespace ai { class Blackboard; class Task { public: std::map<std::string, std::string> textMemory; std::map<int, double> numberMemory; }; /** * Holds */ class Brain { public: Blackboard board; ///< for inter-task communication Brain(); ~Brain(); }; } #endif --- NEW FILE: BlackboardItem.h --- /** ** @file BlackboardItem.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 _BLACKBOARDITEM_H_ #define _BLACKBOARDITEM_H_ #if _MSC_VER > 1000 #pragma once #endif #include <string> namespace ai { /** * */ class BlackboardItem { public: long author; ///< -1 for invalid, 0 for anonymous double priority; std::string message; bool Valid() const; BlackboardItem& operator=(const BlackboardItem& rhs); BlackboardItem(const BlackboardItem& src); BlackboardItem(long author_, double priority_, const std::string& message_); BlackboardItem(); ~BlackboardItem(); }; } #endif --- NEW FILE: Blackboard.h --- /** ** @file Blackboard.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 _BLACKBOARD_H_ #define _BLACKBOARD_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> namespace ai { class BlackboardItem; class Blackboard { public: void EraseAll(); void Erase(const std::string& key, double priority); bool KeyExists(const std::string& key) const; BlackboardItem Read(const std::string& key); double ReadPriority(const std::string& key); void Write(const std::string& key, const BlackboardItem& item); void Write(const std::string& key, long author, double priority, const std::string& message); Blackboard(); ~Blackboard(); private: std::map<std::string, BlackboardItem> content; }; } #endif --- NEW FILE: Task.h --- /** ** @file Task.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 _TASK_H_ #define _TASK_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> #include <vector> namespace ai { class Blackboard; /** * */ class Task { public: std::map<std::string, std::string> textMemory; std::map<int, double> numberMemory; void SetBoard(Blackboard* bb); void SetId(long id_); void SetPriority(double priority_); Task(Blackboard* bb, long id_, double priority_); Task(); ~Task(); private: Blackboard* commBoard; double priority; long id; }; } #endif |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:50:45
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24940/src/ai Added Files: Blackboard.cpp BlackboardItem.cpp Brain.cpp Task.cpp Log Message: Ground SAM related updates --- NEW FILE: Blackboard.cpp --- /** ** @file Blackboard.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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/Blackboard.h" #include "ai/BlackboardItem.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace ai; void Blackboard::EraseAll() { content.clear(); } void Blackboard::Erase(const std::string& key, double priority) { std::map<std::string, BlackboardItem>::iterator iter = content.find(key); if (iter != content.end()) { if (iter->second.priority <= priority) { content.erase(iter); } } } bool Blackboard::KeyExists(const std::string& key) const { std::map<std::string, BlackboardItem>::const_iterator iter = content.find(key); return (iter != content.end()); } BlackboardItem Blackboard::Read(const std::string& key) { std::map<std::string, BlackboardItem>::const_iterator iter = content.find(key); if (iter == content.end()) { return BlackboardItem(); } else { return BlackboardItem(iter->second); } } double Blackboard::ReadPriority(const std::string& key) { std::map<std::string, BlackboardItem>::const_iterator iter = content.find(key); if (iter == content.end()) { return -1.0; } else { return iter->second.priority; } } void Blackboard::Write(const std::string& key, const BlackboardItem& item) { std::map<std::string, BlackboardItem>::iterator iter = content.find(key); // if the item already exists check that the author matches or priority is greater to write if (iter != content.end()) { if ((iter->second.priority > item.priority) && (iter->second.author != item.author)) { return; } iter->second = item; } else { content[key] = item; } } void Blackboard::Write(const std::string& key, long author, double priority, const std::string& message) { std::map<std::string, BlackboardItem>::iterator iter = content.find(key); // if the item already exists check that the author matches or priority is greater to write if (iter != content.end()) { if ((iter->second.priority > priority) && (iter->second.author != author)) { return; } iter->second.author = author; iter->second.priority = priority; iter->second.message = message; } else { content[key] = BlackboardItem(author, priority, message); } } Blackboard::Blackboard() { } Blackboard::~Blackboard() { } --- NEW FILE: Task.cpp --- /** ** @file Task.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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/Task.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace ai; void Task::SetBoard(Blackboard* bb) { commBoard = bb; } void Task::SetId(long id_) { } void Task::SetPriority(double priority_) { } Task::Task(Blackboard* bb, long id_, double priority_) : commBoard(bb), id(id_), priority(priority_) { } Task::Task() : commBoard(0), id(-1), priority(0) { } Task::~Task() { } --- NEW FILE: Brain.cpp --- /** ** @file Brain.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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/Brain.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace ai; Brain::Brain() { } Brain::~Brain() { } --- NEW FILE: BlackboardItem.cpp --- /** ** @file BlackboardItem.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" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/BlackboardItem.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace ai; bool BlackboardItem::Valid() const { return author != -1; } BlackboardItem& BlackboardItem::operator=(const BlackboardItem& rhs) { author = rhs.author; priority = rhs.priority; message = rhs.message; return *this; } BlackboardItem::BlackboardItem(const BlackboardItem& src) : author(src.author), priority(src.priority), message(src.message) { } BlackboardItem::BlackboardItem(long author_, double priority_, const std::string& message_) : author(author_), priority(priority_), message(message_) { } BlackboardItem::BlackboardItem() : author(-1), priority(-1.0), message("") { } BlackboardItem::~BlackboardItem() { } |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:50:44
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24940/src/database Modified Files: tcLauncherDBObject.cpp Log Message: Ground SAM related updates Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcLauncherDBObject.cpp 7 Dec 2004 04:00:28 -0000 1.13 --- tcLauncherDBObject.cpp 4 Feb 2005 18:50:35 -0000 1.14 *************** *** 205,208 **** --- 205,209 ---- columnString += "CycleTime_s number(5),"; + columnString += "IsAutoPoint number(1),"; columnString += "BasicCap number(4),"; columnString += "BasicClass varchar(30),"; *************** *** 226,229 **** --- 227,231 ---- cycleTime = entry.GetDouble("CycleTime_s"); + isAutoPoint = entry.GetInt("IsAutoPoint") != 0; mnCapacity = entry.GetInt("BasicCap"); mzChildClass = entry.GetString("BasicClass").c_str(); *************** *** 257,260 **** --- 259,263 ---- s << cycleTime << ","; + s << isAutoPoint << ","; s << mnCapacity << ","; s << "'" << mzChildClass.mz << "',"; *************** *** 281,293 **** ! tcLauncherDBObject::tcLauncherDBObject() : tcDatabaseObject() ! { ! mzClass = "Default Launcher"; mnClassID = DTYPE_LAUNCHER; ! cycleTime = 0; ! mnCapacity = 0; ! mzChildClass = "NOCHILDCLASS"; ! fireControlSensorClass = ""; ! for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { --- 284,298 ---- ! tcLauncherDBObject::tcLauncherDBObject() : tcDatabaseObject(), ! cycleTime(0), ! isAutoPoint(false), ! mnCapacity(0), ! mzChildClass("NOCHILDCLASS"), ! fireControlSensorClass(""), ! mnConfigurations(0) ! { ! mzClass = "Default Launcher"; mnClassID = DTYPE_LAUNCHER; ! for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { *************** *** 295,308 **** maCapacity[i] = 0; } ! mnConfigurations = 0; } tcLauncherDBObject::tcLauncherDBObject(tcLauncherDBObject& obj) ! : tcDatabaseObject(obj) { mnClassID = DTYPE_LAUNCHER; ! cycleTime = obj.cycleTime; ! mzChildClass = obj.mzChildClass; ! mnCapacity = obj.mnCapacity; for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { --- 300,316 ---- maCapacity[i] = 0; } ! } tcLauncherDBObject::tcLauncherDBObject(tcLauncherDBObject& obj) ! : tcDatabaseObject(obj), ! cycleTime(obj.cycleTime), ! mzChildClass(obj.mzChildClass), ! mnCapacity(obj.mnCapacity), ! mnConfigurations(obj.mnConfigurations), ! fireControlSensorClass(obj.fireControlSensorClass) { mnClassID = DTYPE_LAUNCHER; ! for(unsigned i=0;i<MAX_LAUNCHER_CONFIGURATIONS;i++) { *************** *** 310,315 **** maCapacity[i] = obj.maCapacity[i]; } - mnConfigurations = obj.mnConfigurations; - fireControlSensorClass = obj.fireControlSensorClass; } --- 318,321 ---- |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:50:44
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24940/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: Ground SAM related updates Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcSimPythonInterface.cpp 10 Jan 2005 00:30:54 -0000 1.25 --- tcSimPythonInterface.cpp 4 Feb 2005 18:50:35 -0000 1.26 *************** *** 623,627 **** void tcSimPythonInterface::SetMenuPlatform(long anID) { ! if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set --- 623,627 ---- void tcSimPythonInterface::SetMenuPlatform(long anID) { ! // TODO: this causes exception on game quit sometimes if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:46:16
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23891/ai Log Message: Directory /cvsroot/gcblue/gcb_wx/src/ai added to the repository |
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:45:46
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23764/ai Log Message: Directory /cvsroot/gcblue/gcb_wx/include/ai added to the repository |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16201/src/sim Modified Files: Game.cpp tcBallisticWeapon.cpp tcESMSensor.cpp tcGameObject.cpp tcGroundObject.cpp tcLauncher.cpp tcMenu.cpp tcRadar.cpp Log Message: Ground SAM related updates Index: tcGroundObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGroundObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGroundObject.cpp 31 Jan 2005 01:33:09 -0000 1.1 --- tcGroundObject.cpp 1 Feb 2005 02:29:15 -0000 1.2 *************** *** 86,89 **** --- 86,91 ---- } + + /** * Update method calls updates that are not Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcESMSensor.cpp 27 Jan 2005 01:01:55 -0000 1.11 --- tcESMSensor.cpp 1 Feb 2005 02:29:15 -0000 1.12 *************** *** 198,206 **** if (tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(target)) { ! tcRadar* emitter = pMissileObj->GetSensorState(); ! bDetected = IsDetected(emitter, fAz_rad); ! if ((bDetected) && (nEmitters < MAX_EMITTERS)) { ! maEmitter[nEmitters++] = emitter->mnDBKey; } } --- 198,208 ---- if (tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(target)) { ! if (tcRadar* emitter = pMissileObj->GetSensorState()) // some AGMs have no sensor { ! bDetected = IsDetected(emitter, fAz_rad); ! if ((bDetected) && (nEmitters < MAX_EMITTERS)) ! { ! maEmitter[nEmitters++] = emitter->mnDBKey; ! } } } Index: tcMenu.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMenu.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcMenu.cpp 2 Dec 2004 04:17:26 -0000 1.10 --- tcMenu.cpp 1 Feb 2005 02:29:15 -0000 1.11 *************** *** 43,84 **** void tcMenu::InitSubmenuIcon() { ! float w = 2.0f; ! submenuIcon = new osg::Geometry; ! osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); ! submenuIcon->setColorArray(colors); ! submenuIcon->setColorBinding(osg::Geometry::BIND_OVERALL); ! // create vertex array ! osg::Vec3Array* vertices = new osg::Vec3Array; ! submenuIcon->setVertexArray(vertices); ! vertices->push_back(osg::Vec3(w, 0, 0)); ! vertices->push_back(osg::Vec3(-w, w, 0)); ! vertices->push_back(osg::Vec3(-w, -w, 0)); ! submenuIcon->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLES, 0, 3)); ! submenuIcon->setUseDisplayList(true); ! // set state ! osg::StateSet* stateSet = submenuIcon->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); ! stateSet->setRenderBinDetails(31, "RenderBin"); } void tcMenu::SetSubmenuIconRenderBin(int bin) { ! wxASSERT(submenuIcon.valid()); ! osg::StateSet* stateSet = submenuIcon->getOrCreateStateSet(); ! stateSet->setRenderBinDetails(bin, "RenderBin"); } --- 43,84 ---- void tcMenu::InitSubmenuIcon() { ! float w = 2.0f; ! submenuIcon = new osg::Geometry; ! osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); ! submenuIcon->setColorArray(colors); ! submenuIcon->setColorBinding(osg::Geometry::BIND_OVERALL); ! // create vertex array ! osg::Vec3Array* vertices = new osg::Vec3Array; ! submenuIcon->setVertexArray(vertices); ! vertices->push_back(osg::Vec3(w, 0, 0)); ! vertices->push_back(osg::Vec3(-w, w, 0)); ! vertices->push_back(osg::Vec3(-w, -w, 0)); ! submenuIcon->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLES, 0, 3)); ! submenuIcon->setUseDisplayList(true); ! // set state ! osg::StateSet* stateSet = submenuIcon->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); ! stateSet->setRenderBinDetails(31, "RenderBin"); } void tcMenu::SetSubmenuIconRenderBin(int bin) { ! wxASSERT(submenuIcon.valid()); ! osg::StateSet* stateSet = submenuIcon->getOrCreateStateSet(); ! stateSet->setRenderBinDetails(bin, "RenderBin"); } *************** *** 86,123 **** void tcMenu::AddItem(string caption, int command) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = ""; ! md.mzUserInput = ""; ! md.mnCommand = command; ! maMenuData.push_back(md); ! } ! else ! { ! mpCurrent->AddItem(caption, command); ! } } void tcMenu::AddItem(string caption, std::string command, int param) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = command; ! md.mzUserInput = ""; ! md.mnCommand = param; ! maMenuData.push_back(md); ! } ! else { ! mpCurrent->AddItem(caption, command, param); ! } } --- 86,123 ---- void tcMenu::AddItem(string caption, int command) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = ""; ! md.mzUserInput = ""; ! md.mnCommand = command; ! maMenuData.push_back(md); ! } ! else ! { ! mpCurrent->AddItem(caption, command); ! } } void tcMenu::AddItem(string caption, std::string command, int param) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = command; ! md.mzUserInput = ""; ! md.mnCommand = param; ! maMenuData.push_back(md); ! } ! else { ! mpCurrent->AddItem(caption, command, param); ! } } *************** *** 127,146 **** void tcMenu::AddItem(std::string caption, std::string command, std::string textParam) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = command; ! md.mzUserInput = ""; ! md.mnCommand = -1; md.textParam = textParam; ! maMenuData.push_back(md); ! } ! else { ! mpCurrent->AddItem(caption, command, textParam); ! } } --- 127,146 ---- void tcMenu::AddItem(std::string caption, std::string command, std::string textParam) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = command; ! md.mzUserInput = ""; ! md.mnCommand = -1; md.textParam = textParam; ! maMenuData.push_back(md); ! } ! else { ! mpCurrent->AddItem(caption, command, textParam); ! } } *************** *** 151,326 **** void tcMenu::AddItemUI(std::string caption, std::string callback, std::string input, int param) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = callback; ! md.mzUserInput = input; ! md.mnCommand = param; ! maMenuData.push_back(md); ! } ! else ! { ! mpCurrent->AddItemUI(caption, callback, input, param); ! } } void tcMenu::BeginSubMenu() { ! if (mpCurrent == this) ! { ! int nSize = (int)maMenuData.size(); ! if (nSize == 0) {return;} // can't add submenu to empty menu ! tsMenuData& md = maMenuData[nSize-1]; ! if (md.mpSubMenu == NULL) ! { ! // create new menu with this as parent ! tcMenu *pNewMenu = new tcMenu(this); ! md.mpSubMenu = pNewMenu; ! } ! // set mpCurrent to submenu of last item ! mpCurrent = md.mpSubMenu; ! md.mnCommand = 0; // item with subitems can't have command ! md.mzCommand = ""; ! } ! else ! { ! mpCurrent->BeginSubMenu(); ! } } void tcMenu::EndSubMenu() { ! if (mpCurrent == this) ! { ! if (mpParent == NULL) {return;} // error endsub on top level ! mpParent->mpCurrent = mpParent; ! } ! else { ! mpCurrent->EndSubMenu(); ! } } void tcMenu::ClearSelected() { ! int nMenuSize = (int)maMenuData.size(); ! for(int i=0;i<nMenuSize;i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! pmd->mbSelected = false; ! if (pmd->mpSubMenu != NULL) {pmd->mpSubMenu->ClearSelected();} ! } } void tcMenu::Clear() { ! int nMenuSize = (int)maMenuData.size(); ! // clear submenus first ! for(int i=0;i<nMenuSize;i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! if (pmd->mpSubMenu != NULL) ! { ! pmd->mpSubMenu->Clear(); ! delete pmd->mpSubMenu; ! pmd->mpSubMenu = NULL; ! } ! } ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = NULL; } void tcMenu::Draw() { ! if (mbUpdateRegions) ! { ! UpdateRegions(); ! mbUpdateRegions = false; ! } ! int nMenuSize = (int)maMenuData.size(); // number of items in menu ! for (int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! DrawItem(pmd); ! } } void tcMenu::DrawItem(tsMenuData *apMD) { ! float alpha = 0.8f; ! osg::Vec4 color(0, 0, 0, 1); ! wxASSERT(parentWindow); ! //if the menu item is selected ! if (apMD->mbSelected) ! { ! color.set(0, 0.6f, 1.0f, alpha); ! } ! else ! { ! color.set(0.8f, 0.8f, 0.84f, alpha); ! } ! tcRect item_rect = apMD->mrect; ! item_rect.Offset(anchor.x, anchor.y); ! parentWindow->DrawRectangleR(item_rect, color, tc3DWindow::FILL_ON); ! if (apMD->mbSelected) ! { ! color.set(1, 1, 1, alpha); ! } ! else ! { ! color.set(0, 0, 0, alpha); ! } ! wxRealPoint pointf(apMD->mrect.GetLeft() + 5.0f, apMD->mrect.GetTop() - 2.0f); ! pointf = pointf + anchor; ! parentWindow->DrawTextR(apMD->mzCaption.c_str(), pointf.x, pointf.y, ! parentWindow->GetDefaultFont(), color, fontSize, LEFT_BASE_LINE); ! if (apMD->mpSubMenu != NULL) ! { ! float subx = item_rect.left + mfItemWidth - 4.0f; ! float suby = item_rect.YCenter(); ! parentWindow->DrawGeometryR(submenuIcon.get(), subx, suby); #if 0 ! ! // draw submenu triangle icon ! PointF aSubIcon[3]; // points for tri submenu icon, rel to upper left of item ! aSubIcon[0].X = item_rect.X + mfItemWidth - 5.0f; ! aSubIcon[0].Y = item_rect.Y + 0.5f*item_rect.Height; ! aSubIcon[1].X = aSubIcon[0].X - 5.0f; ! aSubIcon[1].Y = aSubIcon[0].Y - 5.0f; ! aSubIcon[2].X = aSubIcon[1].X; ! aSubIcon[2].Y = aSubIcon[0].Y + 5.0f; ! apGraphics->FillPolygon(mpBrush,aSubIcon,3); #endif ! // if item is selected, draw the submenu ! if (apMD->mbSelected) ! { ! wxRealPoint submenu_offset; ! submenu_offset.x = item_rect.GetRight()-1.0f; ! submenu_offset.y = item_rect.GetBottom(); ! apMD->mpSubMenu->SetAnchor(submenu_offset); ! apMD->mpSubMenu->Draw(); ! } ! } --- 151,326 ---- void tcMenu::AddItemUI(std::string caption, std::string callback, std::string input, int param) { ! if (mpCurrent == this) ! { ! tsMenuData md; ! md.Clear(); ! md.mzCaption = caption; ! md.mzCommand = callback; ! md.mzUserInput = input; ! md.mnCommand = param; ! maMenuData.push_back(md); ! } ! else ! { ! mpCurrent->AddItemUI(caption, callback, input, param); ! } } void tcMenu::BeginSubMenu() { ! if (mpCurrent == this) ! { ! int nSize = (int)maMenuData.size(); ! if (nSize == 0) {return;} // can't add submenu to empty menu ! tsMenuData& md = maMenuData[nSize-1]; ! if (md.mpSubMenu == NULL) ! { ! // create new menu with this as parent ! tcMenu *pNewMenu = new tcMenu(this); ! md.mpSubMenu = pNewMenu; ! } ! // set mpCurrent to submenu of last item ! mpCurrent = md.mpSubMenu; ! md.mnCommand = 0; // item with subitems can't have command ! md.mzCommand = ""; ! } ! else ! { ! mpCurrent->BeginSubMenu(); ! } } void tcMenu::EndSubMenu() { ! if (mpCurrent == this) ! { ! if (mpParent == NULL) {return;} // error endsub on top level ! mpParent->mpCurrent = mpParent; ! } ! else { ! mpCurrent->EndSubMenu(); ! } } void tcMenu::ClearSelected() { ! int nMenuSize = (int)maMenuData.size(); ! for(int i=0;i<nMenuSize;i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! pmd->mbSelected = false; ! if (pmd->mpSubMenu != NULL) {pmd->mpSubMenu->ClearSelected();} ! } } void tcMenu::Clear() { ! int nMenuSize = (int)maMenuData.size(); ! // clear submenus first ! for(int i=0;i<nMenuSize;i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! if (pmd->mpSubMenu != NULL) ! { ! pmd->mpSubMenu->Clear(); ! delete pmd->mpSubMenu; ! pmd->mpSubMenu = NULL; ! } ! } ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = NULL; } void tcMenu::Draw() { ! if (mbUpdateRegions) ! { ! UpdateRegions(); ! mbUpdateRegions = false; ! } ! int nMenuSize = (int)maMenuData.size(); // number of items in menu ! for (int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! DrawItem(pmd); ! } } void tcMenu::DrawItem(tsMenuData *apMD) { ! float alpha = 0.8f; ! osg::Vec4 color(0, 0, 0, 1); ! wxASSERT(parentWindow); ! //if the menu item is selected ! if (apMD->mbSelected) ! { ! color.set(0, 0.6f, 1.0f, alpha); ! } ! else ! { ! color.set(0.8f, 0.8f, 0.84f, alpha); ! } ! tcRect item_rect = apMD->mrect; ! item_rect.Offset(anchor.x, anchor.y); ! parentWindow->DrawRectangleR(item_rect, color, tc3DWindow::FILL_ON); ! if (apMD->mbSelected) ! { ! color.set(1, 1, 1, alpha); ! } ! else ! { ! color.set(0, 0, 0, alpha); ! } ! wxRealPoint pointf(apMD->mrect.GetLeft() + 5.0f, apMD->mrect.GetTop() - 2.0f); ! pointf = pointf + anchor; ! parentWindow->DrawTextR(apMD->mzCaption.c_str(), pointf.x, pointf.y, ! parentWindow->GetDefaultFont(), color, fontSize, LEFT_BASE_LINE); ! if (apMD->mpSubMenu != NULL) ! { ! float subx = item_rect.left + mfItemWidth - 4.0f; ! float suby = item_rect.YCenter(); ! parentWindow->DrawGeometryR(submenuIcon.get(), subx, suby); #if 0 ! ! // draw submenu triangle icon ! PointF aSubIcon[3]; // points for tri submenu icon, rel to upper left of item ! aSubIcon[0].X = item_rect.X + mfItemWidth - 5.0f; ! aSubIcon[0].Y = item_rect.Y + 0.5f*item_rect.Height; ! aSubIcon[1].X = aSubIcon[0].X - 5.0f; ! aSubIcon[1].Y = aSubIcon[0].Y - 5.0f; ! aSubIcon[2].X = aSubIcon[1].X; ! aSubIcon[2].Y = aSubIcon[0].Y + 5.0f; ! apGraphics->FillPolygon(mpBrush,aSubIcon,3); #endif ! // if item is selected, draw the submenu ! if (apMD->mbSelected) ! { ! wxRealPoint submenu_offset; ! submenu_offset.x = item_rect.GetRight()-1.0f; ! submenu_offset.y = item_rect.GetBottom(); ! apMD->mpSubMenu->SetAnchor(submenu_offset); ! apMD->mpSubMenu->Draw(); ! } ! } *************** *** 333,357 **** tsMenuData* tcMenu::ItemContainingPoint(const wxRealPoint& point) { ! int nMenuSize = (int)maMenuData.size(); ! wxRealPoint local_point = point - anchor; // adjust for anchor ! for(int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! if (pmd->mrect.ContainsPoint(local_point.x, local_point.y)) ! { ! return pmd; ! } ! // if item is selected and has submenu, check submenu ! if ((pmd->mpSubMenu != NULL) && (pmd->mbSelected)) ! { ! tsMenuData *psub = pmd->mpSubMenu->ItemContainingPoint(point); ! if (psub != NULL) {return psub;} ! } ! } ! return NULL; // not found } --- 333,357 ---- tsMenuData* tcMenu::ItemContainingPoint(const wxRealPoint& point) { ! int nMenuSize = (int)maMenuData.size(); ! wxRealPoint local_point = point - anchor; // adjust for anchor ! for(int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! if (pmd->mrect.ContainsPoint(local_point.x, local_point.y)) ! { ! return pmd; ! } ! // if item is selected and has submenu, check submenu ! if ((pmd->mpSubMenu != NULL) && (pmd->mbSelected)) ! { ! tsMenuData *psub = pmd->mpSubMenu->ItemContainingPoint(point); ! if (psub != NULL) {return psub;} ! } ! } ! return NULL; // not found } *************** *** 362,399 **** bool tcMenu::UpdateSelection(const wxRealPoint& point) { ! int nMenuSize = (int)maMenuData.size(); ! wxRealPoint local_point = point - anchor; // adjust for anchor ! // if (!menubox.Contains(point)) { return NULL;} ! bool bResult = false; ! for(int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! tcMenu *pSubMenu = pmd->mpSubMenu; ! bool bSelected = pmd->mbSelected; ! if (pmd->mrect.ContainsPoint(local_point.x, local_point.y)) ! { ! pmd->mbSelected = true; ! if (pSubMenu != NULL) {pSubMenu->ClearSelected();} ! bResult = true; ! } ! else if ((pSubMenu != NULL)&&(bSelected)) ! { ! if (pSubMenu->UpdateSelection(point) == false) ! { ! pmd->mbSelected = false; ! } ! else ! { ! bResult = true; ! } ! } ! else ! { ! pmd->mbSelected = false; ! } ! } ! return bResult; // not found } --- 362,400 ---- bool tcMenu::UpdateSelection(const wxRealPoint& point) { ! int nMenuSize = (int)maMenuData.size(); ! wxRealPoint local_point = point - anchor; // adjust for anchor ! // if (!menubox.Contains(point)) { return NULL;} ! bool bResult = false; ! ! for(int i=0; i<nMenuSize; i++) ! { ! tsMenuData *pmd = &maMenuData[i]; ! tcMenu *pSubMenu = pmd->mpSubMenu; ! bool bSelected = pmd->mbSelected; ! if (!bResult && pmd->mrect.ContainsPoint(local_point.x, local_point.y)) ! { ! pmd->mbSelected = true; ! if (pSubMenu != NULL) {pSubMenu->ClearSelected();} ! bResult = true; ! } ! else if ((pSubMenu != NULL)&&(bSelected)) ! { ! if (pSubMenu->UpdateSelection(point) == false) ! { ! pmd->mbSelected = false; ! } ! else ! { ! bResult = true; ! } ! } ! else ! { ! pmd->mbSelected = false; ! } ! } ! return bResult; // not found } *************** *** 401,476 **** { ! int maxWidth = 0; ! int maxHeight = 0; ! tsMenuData *pmd; ! int nMenuSize = (int)maMenuData.size(); ! // find max item width and height ! for(int i=0; i<nMenuSize; i++) ! { ! wxSize boundingBox; ! pmd = &maMenuData[i]; ! parentWindow->MeasureText(parentWindow->GetDefaultFont(), fontSize, pmd->mzCaption.c_str(), ! boundingBox); ! ! int w = boundingBox.GetWidth(); ! if (pmd->mpSubMenu) w += 3; ! maxWidth = (w > maxWidth) ? w : maxWidth; ! maxHeight = (boundingBox.GetHeight() > maxHeight) ? boundingBox.GetHeight() : maxHeight; ! } ! mfItemWidth = float(maxWidth) + 12.0f; ! mfItemHeight = float(maxHeight) + 2.0f; ! menubox.left = 0; ! menubox.bottom = 0; // upper-left corner ! menubox.right = menubox.left + float(maxWidth) + 12.0f; ! menubox.top = menubox.bottom + (float(maxHeight) + 4.0f)*((float)nMenuSize); ! // set item rectangles ! tcRect itemrect; ! itemrect.Set(0, mfItemWidth, 0, mfItemHeight); ! for(int i=0; i<nMenuSize; i++) ! { ! pmd = &maMenuData[i]; ! pmd->mrect = itemrect; ! itemrect.bottom += mfItemHeight - 1.0f; ! itemrect.top += mfItemHeight - 1.0f; ! } } tcMenu::tcMenu() ! : fontSize(14.0) { ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = NULL; ! if (!submenuIcon.valid()) ! { ! InitSubmenuIcon(); ! } } tcMenu::tcMenu(tcMenu* apParent) ! : fontSize(14.0) { ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = apParent; ! if (!submenuIcon.valid()) ! { ! InitSubmenuIcon(); ! } } --- 402,477 ---- { ! int maxWidth = 0; ! int maxHeight = 0; ! tsMenuData *pmd; ! int nMenuSize = (int)maMenuData.size(); ! // find max item width and height ! for(int i=0; i<nMenuSize; i++) ! { ! wxSize boundingBox; ! pmd = &maMenuData[i]; ! parentWindow->MeasureText(parentWindow->GetDefaultFont(), fontSize, pmd->mzCaption.c_str(), ! boundingBox); ! int w = boundingBox.GetWidth(); ! if (pmd->mpSubMenu) w += 3; ! ! maxWidth = (w > maxWidth) ? w : maxWidth; ! maxHeight = (boundingBox.GetHeight() > maxHeight) ? boundingBox.GetHeight() : maxHeight; ! } ! mfItemWidth = float(maxWidth) + 12.0f; ! mfItemHeight = float(maxHeight) + 3.0f; ! menubox.left = 0; ! menubox.bottom = 0; // upper-left corner ! menubox.right = menubox.left + float(maxWidth) + 12.0f; ! menubox.top = menubox.bottom + (float(maxHeight) + 4.0f)*((float)nMenuSize); ! // set item rectangles ! tcRect itemrect; ! itemrect.Set(0, mfItemWidth, 0, mfItemHeight); ! for(int i=0; i<nMenuSize; i++) ! { ! pmd = &maMenuData[i]; ! pmd->mrect = itemrect; ! itemrect.bottom += mfItemHeight - 1.0f; ! itemrect.top += mfItemHeight - 1.0f; ! } } tcMenu::tcMenu() ! : fontSize(16.0) { ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = NULL; ! if (!submenuIcon.valid()) ! { ! InitSubmenuIcon(); ! } } tcMenu::tcMenu(tcMenu* apParent) ! : fontSize(16.0) { ! maMenuData.clear(); ! mbUpdateRegions = true; ! mpCurrent = this; ! mpParent = apParent; ! if (!submenuIcon.valid()) ! { ! InitSubmenuIcon(); ! } } *************** *** 479,482 **** tcMenu::~tcMenu() { ! Clear(); } --- 480,483 ---- tcMenu::~tcMenu() { ! Clear(); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** Game.cpp 31 Jan 2005 01:33:08 -0000 1.118 --- Game.cpp 1 Feb 2005 02:29:07 -0000 1.119 *************** *** 215,218 **** --- 215,222 ---- mcUserInfo.GetOwnAlliance()); + // clear old hook info + NewHook(-1); + pythonInterface->SetMenuPlatform(-1); + // hide all game windows briefingConsoleLeft->SetActive(false); Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcLauncher.cpp 7 Dec 2004 04:00:42 -0000 1.9 --- tcLauncher.cpp 1 Feb 2005 02:29:15 -0000 1.10 *************** *** 284,287 **** --- 284,295 ---- tcGameObject *targetObj = simState->GetObject(mnTargetID); + // TODO: called here as quick way to add autopoint feature, move to better location + if (IsAutoPoint()) + { + pointingAngle = parent->BearingToRad(*targetObj) - parent->mcKin.mfHeading_rad; + if (pointingAngle >= C_PI) pointingAngle -= C_TWOPI; + else if (pointingAngle < -C_PI) pointingAngle += C_TWOPI; + } + // needs a fire control track (launching platform) to launch if ((meLaunchMode == FC_TRACK)||(meLaunchMode == SEEKER_TRACK)) *************** *** 330,338 **** - return LAUNCHER_ERROR; // bad meLaunchMode } /** * @return true if item is compatible with launcher (can be loaded) */ --- 338,354 ---- return LAUNCHER_ERROR; // bad meLaunchMode } /** + * autopoint launchers will automatically point to target before launch + * @return true if launcher is auto-pointable + */ + bool tcLauncher::IsAutoPoint() const + { + return mpLauncherDBObj->isAutoPoint; + } + + /** * @return true if item is compatible with launcher (can be loaded) */ Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcGameObject.cpp 31 Jan 2005 01:33:08 -0000 1.27 --- tcGameObject.cpp 1 Feb 2005 02:29:15 -0000 1.28 *************** *** 286,289 **** --- 286,298 ---- /** + * @return bearing to p in radians + */ + float tcGameObject::BearingToRad(tcGameObject& p) + { + return (float)(atan2(p.mcKin.mfLon_rad-mcKin.mfLon_rad, + p.mcKin.mfLat_rad-mcKin.mfLat_rad)); + } + + /** * mapData must be set with SetGameObjectMapData before using this method. * @see SetGameObjectMapData Index: tcBallisticWeapon.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcBallisticWeapon.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcBallisticWeapon.cpp 31 Jan 2005 01:33:08 -0000 1.7 --- tcBallisticWeapon.cpp 1 Feb 2005 02:29:15 -0000 1.8 *************** *** 98,104 **** mcKin.mfPitch_rad += pLauncher->pointingElevation; ! // assume non-zero launch speed means shell, set az and el to intercept target datum ! // TODO, add this option directly to ballistic DB obj ! if (mpDBObject->launchSpeed_mps != 0) { mcKin.mfSpeed_kts = C_MPSTOKTS * mpDBObject->launchSpeed_mps; --- 98,103 ---- mcKin.mfPitch_rad += pLauncher->pointingElevation; ! // For gun round, set az and el to intercept target datum ! if (mpDBObject->IsGunRound()) { mcKin.mfSpeed_kts = C_MPSTOKTS * mpDBObject->launchSpeed_mps; Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcRadar.cpp 31 Jan 2005 01:33:09 -0000 1.23 --- tcRadar.cpp 1 Feb 2005 02:29:15 -0000 1.24 *************** *** 480,484 **** if (nClassification & PTYPE_MISSILE) {eAffil = HOSTILE;} // surfaced sub classified as small surface ! if (nClassification & PTYPE_SUBMARINE) { nClassification = PTYPE_SMALLSURFACE; --- 480,484 ---- if (nClassification & PTYPE_MISSILE) {eAffil = HOSTILE;} // surfaced sub classified as small surface ! if (nClassification == PTYPE_SUBMARINE) { nClassification = PTYPE_SMALLSURFACE; |
|
From: Dewitt C. <ddc...@us...> - 2005-02-01 02:28:18
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15962/include/sim Modified Files: tcGameObject.h tcLauncher.h tcMissileObject.h Log Message: Ground SAM related updates Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcGameObject.h 31 Jan 2005 01:32:36 -0000 1.29 --- tcGameObject.h 1 Feb 2005 02:28:09 -0000 1.30 *************** *** 115,119 **** float RangeTo(tcGameObject& p); float BearingTo(tcGameObject& p); ! void AddChild(tcGameObject *child); void RemoveChild(tcGameObject *child); --- 115,119 ---- float RangeTo(tcGameObject& p); float BearingTo(tcGameObject& p); ! float BearingToRad(tcGameObject& p); void AddChild(tcGameObject *child); void RemoveChild(tcGameObject *child); Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcLauncher.h 7 Dec 2004 03:59:14 -0000 1.8 --- tcLauncher.h 1 Feb 2005 02:28:09 -0000 1.9 *************** *** 119,122 **** --- 119,123 ---- int GetErrorCode() const {return errorCode;} int GetLauncherStatus(); + bool IsAutoPoint() const; void SetErrorCode(int code) {errorCode = code;} Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcMissileObject.h 23 Nov 2004 23:30:49 -0000 1.14 --- tcMissileObject.h 1 Feb 2005 02:28:09 -0000 1.15 *************** *** 70,74 **** teGuidanceMode GetCurrentGuidanceMode(); virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSensorState() {return &mcSensorState;} virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); --- 70,74 ---- teGuidanceMode GetCurrentGuidanceMode(); virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSensorState(); virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); |
|
From: Dewitt C. <ddc...@us...> - 2005-02-01 02:28:18
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15962/include/database Modified Files: tcLauncherDBObject.h Log Message: Ground SAM related updates Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcLauncherDBObject.h 7 Dec 2004 03:59:07 -0000 1.10 --- tcLauncherDBObject.h 1 Feb 2005 02:28:08 -0000 1.11 *************** *** 43,46 **** --- 43,47 ---- public: float cycleTime; ///< down time between shots + bool isAutoPoint; ///< true to always point launcher toward target tcDBString mzChildClass; ///< class of platform to launch (simple model) UINT mnCapacity; ///< max number of launch objects held (simple model) |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:28
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/database Modified Files: tcBallisticDBObject.cpp tcDatabaseObject.cpp tcGenericDBObject.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcBallisticDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcBallisticDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcBallisticDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.8 --- tcBallisticDBObject.cpp 31 Jan 2005 01:33:07 -0000 1.9 *************** *** 32,35 **** --- 32,36 ---- #include "common/tinyxml.h" #include "database/tcSqlReader.h" + #include <sstream> #ifdef _DEBUG *************** *** 108,111 **** --- 109,128 ---- /** + * @return true if this obj is a gravity bomb + */ + bool tcBallisticDBObject::IsGravityBomb() const + { + return (ballisticType == GRAVITY_BOMB); + } + + /** + * @return true if this obj is a gun round + */ + bool tcBallisticDBObject::IsGunRound() const + { + return (ballisticType == GUN_ROUND); + } + + /** * workaround for write serialization issue * @return true if db obj is a leaf obj *************** *** 185,188 **** --- 202,208 ---- tcWeaponDBObject::AddSqlColumns(columnString); + columnString += ","; + + columnString += "BallisticType number(5)"; } *************** *** 190,193 **** --- 210,215 ---- { tcWeaponDBObject::ReadSql(entry); + + ballisticType = entry.GetInt("BallisticType"); } *************** *** 196,203 **** tcWeaponDBObject::WriteSql(valueString); } ! tcBallisticDBObject::tcBallisticDBObject() : tcWeaponDBObject() { mzClass = "Default Ballistic"; --- 218,233 ---- tcWeaponDBObject::WriteSql(valueString); + std::stringstream s; + + s << ","; + + s << ballisticType; + + valueString += s.str(); } ! tcBallisticDBObject::tcBallisticDBObject() : tcWeaponDBObject(), ! ballisticType(GUN_ROUND) { mzClass = "Default Ballistic"; *************** *** 206,210 **** tcBallisticDBObject::tcBallisticDBObject(tcBallisticDBObject& obj) ! : tcWeaponDBObject(obj) { mnClassID = DTYPE_BALLISTIC; --- 236,241 ---- tcBallisticDBObject::tcBallisticDBObject(tcBallisticDBObject& obj) ! : tcWeaponDBObject(obj), ! ballisticType(obj.ballisticType) { mnClassID = DTYPE_BALLISTIC; Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcDatabaseObject.cpp 16 Jan 2005 18:36:28 -0000 1.15 --- tcDatabaseObject.cpp 31 Jan 2005 01:33:07 -0000 1.16 *************** *** 108,112 **** /***************************** tcDatabaseObject ***********************************/ ! tc3DModel* tcDatabaseObject::Get3DModel() { if (model) --- 108,116 ---- /***************************** tcDatabaseObject ***********************************/ ! ! /** ! * ! */ ! tc3DModel* tcDatabaseObject::Copy3DModel() { if (model) *************** *** 130,133 **** --- 134,161 ---- /** + * + */ + tc3DModel* tcDatabaseObject::Get3DModel() + { + if (model) + { + return model; + } + else + { + Load3DModel(); + if (model) + { + return model; + } + else + { + wxASSERT(false); + return NULL; + } + } + } + + /** * workaround for write serialization issue * @return true if db obj is a leaf obj Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcGenericDBObject.cpp 16 Jan 2005 18:36:28 -0000 1.18 --- tcGenericDBObject.cpp 31 Jan 2005 01:33:07 -0000 1.19 *************** *** 63,76 **** /** * @returns a tc3DPoint object with (x,y,z) relative position of launcher n */ tc3DPoint tcGenericDBObject::GetLauncherPosition(unsigned n) { if ((int)n >= mnNumLaunchers) { fprintf(stderr, "Error - GetLauncherPosition - bad launcher index\n"); ! return tc3DPoint(0, 0, 0); } ! return launcherPosition[n]; } --- 63,114 ---- /** + * @return relative az of launcher n or 0 for default or if error + */ + float tcGenericDBObject::GetLauncherAz(unsigned n) + { + float az = 0; + + if ((int)n >= mnNumLaunchers) + { + fprintf(stderr, "Error - GetLauncherAz - bad launcher index\n"); + return az; + } + + if (tc3DModel* model = Get3DModel()) + { + float az; + osg::Vec3 pos; + model->GetLauncherInfo(n, pos, az); + } + + return az; + + } + + /** * @returns a tc3DPoint object with (x,y,z) relative position of launcher n + * (0, 0, 0) is default */ tc3DPoint tcGenericDBObject::GetLauncherPosition(unsigned n) { + tc3DPoint p; + if ((int)n >= mnNumLaunchers) { fprintf(stderr, "Error - GetLauncherPosition - bad launcher index\n"); ! return p; } ! ! if (tc3DModel* model = Get3DModel()) ! { ! float az; ! osg::Vec3 pos; ! model->GetLauncherInfo(n, pos, az); ! p.x = pos.x(); ! p.y = pos.y(); ! p.z = pos.z(); ! } ! ! return p; } *************** *** 284,299 **** for(i=0;i<MAXLAUNCHERS;i++) { - float az; - tc3DPoint loc; *csv >> s; ! *csv >> az; ! *csv >> loc.x; ! *csv >> loc.y; ! *csv >> loc.z; if (s.size() > 0) { maLauncherClass[mnNumLaunchers] = s.c_str(); - launcherAz[mnNumLaunchers] = az; - launcherPosition[mnNumLaunchers++] = loc; } } --- 322,330 ---- for(i=0;i<MAXLAUNCHERS;i++) { *csv >> s; ! if (s.size() > 0) { maLauncherClass[mnNumLaunchers] = s.c_str(); } } *************** *** 350,365 **** { *csv << string(maLauncherClass[i].mz); - *csv << launcherAz[i]; - *csv << launcherPosition[i].x; - *csv << launcherPosition[i].y; - *csv << launcherPosition[i].z; } else { *csv << ""; - *csv << ""; - *csv << ""; - *csv << ""; - *csv << ""; } } --- 381,388 ---- *************** *** 442,449 **** TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("launcher"))->ToElement(); childNode->SetAttribute("class", maLauncherClass[i].mz); - childNode->SetAttribute("az", launcherAz[i]); - childNode->SetAttribute("x", launcherPosition[i].x); - childNode->SetAttribute("y", launcherPosition[i].y); - childNode->SetAttribute("z", launcherPosition[i].z); } --- 465,468 ---- *************** *** 499,510 **** s.Format("Lau%d",i+1); *csv << s.GetBuffer(); - s.Format("Lau%d-angle",i+1); - *csv << s.GetBuffer(); - s.Format("Lau%d-x",i+1); - *csv << s.GetBuffer(); - s.Format("Lau%d-y",i+1); - *csv << s.GetBuffer(); - s.Format("Lau%d-z",i+1); - *csv << s.GetBuffer(); } for(i=0;i<MAXSENSORS;i++) --- 518,521 ---- *************** *** 593,609 **** s.Format("L%d_name varchar(30),",i+1); columnString += s.GetBuffer(); - - s.Format("L%d_az number(8),",i+1); - columnString += s.GetBuffer(); - - s.Format("L%d_x number(8),",i+1); - columnString += s.GetBuffer(); - - s.Format("L%d_y number(8),",i+1); - columnString += s.GetBuffer(); - - s.Format("L%d_z number(8),",i+1); - columnString += s.GetBuffer(); - } --- 604,607 ---- *************** *** 688,703 **** launcherName.push_back(displayName); - s.Format("L%d_az",i+1); - launcherAz[mnNumLaunchers] = entry.GetDouble(s.GetBuffer()); - - s.Format("L%d_x",i+1); - launcherPosition[mnNumLaunchers].x = entry.GetDouble(s.GetBuffer()); - - s.Format("L%d_y",i+1); - launcherPosition[mnNumLaunchers].y = entry.GetDouble(s.GetBuffer()); - - s.Format("L%d_z",i+1); - launcherPosition[mnNumLaunchers].z = entry.GetDouble(s.GetBuffer()); - mnNumLaunchers++; } --- 686,689 ---- *************** *** 742,765 **** } - // read animations - for(i=0;i<MAXANIMATIONS;i++) - { - tcString s; - animationDBInfo ai; - s.Format("Anim%d_obj", i+1); - ai.objectName = entry.GetString(s.GetBuffer()); - - if (ai.objectName.size() > 0) - { - s.Format("Anim%d_type", i+1); - ai.animationType = entry.GetString(s.GetBuffer()); - - s.Format("Anim%d_param", i+1); - ai.param = entry.GetInt(s.GetBuffer()); - - animationInfo.push_back(ai); - } - } } --- 728,732 ---- *************** *** 799,806 **** s << "'" << string(maLauncherClass[i].mz) << "',"; s << "'" << launcherName[i].c_str() << "',"; - s << launcherAz[i] << ","; - s << launcherPosition[i].x << ","; - s << launcherPosition[i].y << ","; - s << launcherPosition[i].z << ","; } else --- 766,769 ---- *************** *** 808,819 **** s << "'',"; s << "'',"; - s << "0,"; - s << "0,"; - s << "0,"; - s << "0,"; } ! ! //if (i < MAXLAUNCHERS - 1) s << ","; ! } --- 771,776 ---- s << "'',"; s << "'',"; } ! } *************** *** 836,866 **** { s << "'" << string(maSensorClass[i].mz) << "',"; ! s << sensorAz[i] << ","; ! } ! else ! { ! s << "'',"; ! s << "0,"; ! } ! } ! ! size_t nAnimations = animationInfo.size(); ! for(size_t i=0;i<MAXANIMATIONS;i++) ! { ! if (i < nAnimations) ! { ! animationDBInfo& ai = animationInfo[i]; ! s << "'" << ai.objectName << "',"; ! s << "'" << ai.animationType << "',"; ! s << (long)ai.param; } else { s << "'',"; - s << "'',"; s << "0"; } ! if (i < MAXANIMATIONS - 1) s << ","; } valueString += s.str(); --- 793,807 ---- { s << "'" << string(maSensorClass[i].mz) << "',"; ! s << sensorAz[i]; } else { s << "'',"; s << "0"; } ! if (i < MAXSENSORS - 1) s << ","; } + + valueString += s.str(); *************** *** 921,926 **** maLauncherClass[i] = obj.maLauncherClass[i]; launcherName[i] = obj.launcherName[i]; - launcherAz[i] = obj.launcherAz[i]; - launcherPosition[i] = obj.launcherPosition[i]; } --- 862,865 ---- |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:28
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/graphics Modified Files: tc3DModel.cpp tcNumberWidget.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tc3DModel.cpp 27 Jan 2005 01:01:48 -0000 1.21 --- tc3DModel.cpp 31 Jan 2005 01:33:07 -0000 1.22 *************** *** 350,353 **** --- 350,370 ---- } + /** + * Retrieves launcher info for launcher <idx> + * Zero is used as default if idx out of range + */ + void tc3DModel::GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az) + { + if (idx >= launcherInfo.size()) + { + pos.set(0, 0, 0); + az = 0; + return; + } + + pos = launcherInfo[idx].position; + az = launcherInfo[idx].pointingAzimuth; + } + osg::ref_ptr<osg::Node> tc3DModel::GetNode() { *************** *** 471,474 **** --- 488,493 ---- LoadXmlAnimationInfo(doc); + LoadXmlMountInfo(doc); + LoadXmlSmokeInfo(doc); *************** *** 540,543 **** --- 559,594 ---- } + /** + * + */ + void tc3DModel::LoadXmlMountInfo(TiXmlDocument* doc) + { + launcherInfo.clear(); + + TiXmlNode* current = doc->FirstChild("Launcher"); + while (current) + { + if (TiXmlElement* elt = current->ToElement()) + { + LauncherMountInfo info; + double x = 0; + double y = 0; + double z = 0; + double az = 0; + + elt->Attribute("X", &x); + elt->Attribute("Y", &y); + elt->Attribute("Z", &z); + elt->Attribute("Az", &az); + + info.position.set(x, y, z); + info.pointingAzimuth = az; + + launcherInfo.push_back(info); + + } + current = current->NextSibling("Launcher"); + } + } /** Index: tcNumberWidget.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNumberWidget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcNumberWidget.cpp 28 Dec 2004 00:41:35 -0000 1.1 --- tcNumberWidget.cpp 31 Jan 2005 01:33:07 -0000 1.2 *************** *** 261,265 **** caption = "NULL"; isMouseOver = false; ! soundEffect = -1; fontSize = 10.0f; backgroundAlpha = 1.0f; --- 261,265 ---- caption = "NULL"; isMouseOver = false; ! soundEffect = ""; fontSize = 10.0f; backgroundAlpha = 1.0f; |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:28
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcScenarioInterface.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcPlatformInterface.cpp 11 Dec 2004 01:09:06 -0000 1.33 --- tcPlatformInterface.cpp 31 Jan 2005 01:33:08 -0000 1.34 *************** *** 1056,1063 **** } ! // may want to handle this through a single instance class in the future ! void tcPlatformInterface::PlaySound(int n) { ! tcSound::Get()->PlayEffect(n); } --- 1056,1066 ---- } ! /** ! * Modified to use string argument ! * May want to handle this through a single instance class in the future ! */ ! void tcPlatformInterface::PlaySound(const std::string& effect) { ! tcSound::Get()->PlayEffect(effect); } Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcScenarioInterface.cpp 27 Jan 2005 01:01:52 -0000 1.16 --- tcScenarioInterface.cpp 31 Jan 2005 01:33:08 -0000 1.17 *************** *** 38,41 **** --- 38,42 ---- #include "tcGoal.h" #include "tcGoalTracker.h" + #include "tcGroundObject.h" #include "tcLauncher.h" #include "tcMapData.h" *************** *** 247,251 **** mapData->GetTerrainHeight(unit.lon, unit.lat, 0); } ! simState->AddPlatform(gameObj); --- 248,256 ---- mapData->GetTerrainHeight(unit.lon, unit.lat, 0); } ! if (tcGroundObject* groundObj = dynamic_cast<tcGroundObject*>(gameObj)) ! { ! groundObj->mcKin.mfAlt_m += ! mapData->GetTerrainHeight(unit.lon, unit.lat, 0); ! } simState->AddPlatform(gameObj); |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:28
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/sim Modified Files: Game.cpp tcAirObject.cpp tcBallisticWeapon.cpp tcFlightPort.cpp tcGameObject.cpp tcHeloObject.cpp tcPlatformObject.cpp tcRadar.cpp tcSimState.cpp Added Files: tcGroundObject.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site --- NEW FILE: tcGroundObject.cpp --- /** ** @file tcGroundObject.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 #include "tcGroundObject.h" #include "tcGenericDBObject.h" #ifdef _DEBUG #define new DEBUG_NEW #endif void tcGroundObject::Clear() { tcPlatformObject::Clear(); } /** * Randomly initializes object */ void tcGroundObject::RandInitNear(float afLon_deg, float afLat_deg) { if (mpDBObject == NULL) {return;} strcpy(mzClass.mz, mpDBObject->mzClass.mz); mzUnit = "GR_"; mzUnit.AssignRandomSuffix(); mnAlliance = 0; mfStatusTime = 0; mcKin.mfLon_rad = C_PIOVER180*(afLon_deg + randfc(1.1f)); mcKin.mfLat_rad = C_PIOVER180*(afLat_deg + randfc(1.1f)); mcKin.mfAlt_m = 0.0f; mcKin.mfHeading_rad = C_TWOPI*randf(); mcKin.mfSpeed_kts = 0; mfDamageLevel = 0; } void tcGroundObject::PrintToFile(tcFile& file) { tcPlatformObject::PrintToFile(file); } void tcGroundObject::SaveToFile(tcFile& file) { tcPlatformObject::SaveToFile(file); } void tcGroundObject::LoadFromFile(tcFile& file) { tcPlatformObject::LoadFromFile(file); } void tcGroundObject::Serialize(tcFile& file, bool mbLoad) { if (mbLoad) { LoadFromFile(file); } else { SaveToFile(file); } } /** * Update method calls updates that are not * related to motion from tcPlatformObject. (tcGroundObject does * not move. ) * TODO: extract sensor and launcher functionality from * tcPlatformObject and use as parent classes instead. Then any * class that needs sensors or launchers can derive from the * appropriate parent class. Same thing needs to be done with * tcAirfieldObject */ void tcGroundObject::Update(double afStatusTime) { const float min_update_s = 0.0f; float dt_s = (float)(afStatusTime - mfStatusTime); if (dt_s <= min_update_s) {return;} // added for pause case UpdateEffects(); wxASSERT(mpDBObject); UpdateLauncherState(dt_s); UpdateSensors(afStatusTime); mfStatusTime = afStatusTime; } #pragma warning (disable : 4355) /** * */ tcGroundObject::tcGroundObject() { wxASSERT(false); Clear(); mpDBObject = NULL; mnModelType = MTYPE_FIXED; } /** * Constructor that initializes using info from database entry. */ tcGroundObject::tcGroundObject(tcGenericDBObject *obj) : tcPlatformObject(obj) { mpDBObject = obj; mcKin.mfSpeed_kts = 0; // make sure this doesn't move (shouldn't be necessary) mnModelType = MTYPE_FIXED; } tcGroundObject::~tcGroundObject() { } Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** tcSimState.cpp 27 Jan 2005 01:02:06 -0000 1.64 --- tcSimState.cpp 31 Jan 2005 01:33:09 -0000 1.65 *************** *** 2,6 **** ** @file tcSimState.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** --- 2,6 ---- ** @file tcSimState.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 42,45 **** --- 42,46 ---- #include "tcBallisticWeapon.h" #include "tcBallisticDBObject.h" + #include "tcGroundObject.h" #include "tcTorpedoObject.h" #include "tcTorpedoDBObject.h" *************** *** 1461,1465 **** if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect("NavalGun1"); } } --- 1462,1469 ---- if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! if (ballistic->IsGunRound()) ! { ! tcSound::Get()->PlayEffect("NavalGun1"); ! } } } *************** *** 1515,1522 **** return new tcSubObject(pGenericData); } ! else { return new tcSurfaceObject(pGenericData); } } else if (tcMissileDBObject *pMissileData = dynamic_cast<tcMissileDBObject*>(apDBObject)) --- 1519,1536 ---- return new tcSubObject(pGenericData); } ! else if (apDBObject->mnModelType == MTYPE_FIXED) ! { ! return new tcGroundObject(pGenericData); ! } ! else if (apDBObject->mnModelType == MTYPE_SURFACE) { return new tcSurfaceObject(pGenericData); } + else + { + fprintf(stderr, "tcSimState::CreateGameObject - " + "Unrecognized model type for generic DB obj (%d)\n", apDBObject->mnModelType); + return NULL; + } } else if (tcMissileDBObject *pMissileData = dynamic_cast<tcMissileDBObject*>(apDBObject)) Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcAirObject.cpp 23 Nov 2004 23:31:12 -0000 1.15 --- tcAirObject.cpp 31 Jan 2005 01:33:08 -0000 1.16 *************** *** 310,323 **** float dh_min, dh_max; ! if (roll_min < roll_max) { ! dh_min = -roll_max*roll_to_rps*dt_s; ! dh_max = -roll_min*roll_to_rps*dt_s; } ! else { ! dh_min = -roll_min*roll_to_rps*dt_s; ! dh_max = -roll_max*roll_to_rps*dt_s; } ! if (dh > dh_max) { mcKin.mfHeading_rad = heading_start + dh_max; if (mcKin.mfHeading_rad >= C_TWOPI) {mcKin.mfHeading_rad -= C_TWOPI;} --- 310,326 ---- float dh_min, dh_max; ! if (roll_min < roll_max) ! { ! dh_min = roll_min*roll_to_rps*dt_s; ! dh_max = roll_max*roll_to_rps*dt_s; } ! else ! { ! dh_min = roll_max*roll_to_rps*dt_s; ! dh_max = roll_min*roll_to_rps*dt_s; } ! if (dh > dh_max) ! { mcKin.mfHeading_rad = heading_start + dh_max; if (mcKin.mfHeading_rad >= C_TWOPI) {mcKin.mfHeading_rad -= C_TWOPI;} *************** *** 325,329 **** dh = dh_max; } ! else if (dh < dh_min) { mcKin.mfHeading_rad = heading_start + dh_min; if (mcKin.mfHeading_rad >= C_TWOPI) {mcKin.mfHeading_rad -= C_TWOPI;} --- 328,333 ---- dh = dh_max; } ! else if (dh < dh_min) ! { mcKin.mfHeading_rad = heading_start + dh_min; if (mcKin.mfHeading_rad >= C_TWOPI) {mcKin.mfHeading_rad -= C_TWOPI;} *************** *** 333,337 **** float dh_rps = dh*dtinv; ! mcKin.mfRoll_rad = -dh_rps*rps_to_roll; } --- 337,341 ---- float dh_rps = dh*dtinv; ! mcKin.mfRoll_rad = dh_rps*rps_to_roll; } Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcFlightPort.cpp 2 Nov 2004 04:23:56 -0000 1.12 --- tcFlightPort.cpp 31 Jan 2005 01:33:08 -0000 1.13 *************** *** 482,490 **** unit->mcKin = parent->mcKin; unit->mcKin.mfHeading_rad += unit->rel_pos.yaw; ! unit->mcKin.mfAlt_m += unit->rel_pos.dy; unit->SetHeading(unit->mcKin.mfHeading_rad); unit->mfStatusTime = parent->mfStatusTime; // correct latitude and longitude for relative position on parent float parent_hdg = parent->mcKin.mfHeading_rad; float cos_parent_hdg = cosf(parent_hdg); --- 482,496 ---- unit->mcKin = parent->mcKin; unit->mcKin.mfHeading_rad += unit->rel_pos.yaw; ! unit->mcKin.mfAlt_m += unit->rel_pos.dz; unit->SetHeading(unit->mcKin.mfHeading_rad); unit->mfStatusTime = parent->mfStatusTime; + tsGeoPoint childPos = parent->RelPosToLatLonAlt(unit->rel_pos); + unit->mcKin.mfAlt_m = childPos.mfAlt_m; + unit->mcKin.mfLat_rad = childPos.mfLat_rad; + unit->mcKin.mfLon_rad = childPos.mfLon_rad; + // correct latitude and longitude for relative position on parent + /* float parent_hdg = parent->mcKin.mfHeading_rad; float cos_parent_hdg = cosf(parent_hdg); *************** *** 497,500 **** --- 503,507 ---- unit->mcKin.mfLat_rad += delta_lat; unit->mcKin.mfLon_rad += delta_lon; + */ if (tcAeroAirObject* aa_unit = dynamic_cast<tcAeroAirObject*>(unit)) Index: tcHeloObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcHeloObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcHeloObject.cpp 2 Nov 2004 04:23:56 -0000 1.2 --- tcHeloObject.cpp 31 Jan 2005 01:33:09 -0000 1.3 *************** *** 140,143 **** --- 140,151 ---- } + /** + * No min speed for helo, can hover + */ + void tcHeloObject::UpdateSpeed(float dt_s) + { + tcPlatformObject::UpdateSpeed(dt_s); + } + void tcHeloObject::Update(double afStatusTime) Index: tcBallisticWeapon.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcBallisticWeapon.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcBallisticWeapon.cpp 2 Nov 2004 04:23:56 -0000 1.6 --- tcBallisticWeapon.cpp 31 Jan 2005 01:33:08 -0000 1.7 *************** *** 253,256 **** --- 253,266 ---- } + bool tcBallisticWeapon::IsGravityBomb() const + { + return mpDBObject->IsGravityBomb(); + } + + bool tcBallisticWeapon::IsGunRound() const + { + return mpDBObject->IsGunRound(); + } + /** * Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcPlatformObject.cpp 7 Dec 2004 04:00:43 -0000 1.33 --- tcPlatformObject.cpp 31 Jan 2005 01:33:09 -0000 1.34 *************** *** 920,927 **** mcLauncherState.mnCount = 0; ! for(int nLauncher=0;nLauncher<mpDBObject->mnNumLaunchers;nLauncher++) { tnPoolIndex nLauncherKey = database->GetKey(mpDBObject->maLauncherClass[nLauncher]); ! float launcherAz_deg = mpDBObject->launcherAz[nLauncher]; mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*launcherAz_deg, mpDBObject->launcherName[nLauncher]); --- 920,927 ---- mcLauncherState.mnCount = 0; ! for (int nLauncher=0; nLauncher<mpDBObject->mnNumLaunchers; nLauncher++) { tnPoolIndex nLauncherKey = database->GetKey(mpDBObject->maLauncherClass[nLauncher]); ! float launcherAz_deg = mpDBObject->GetLauncherAz(nLauncher); mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*launcherAz_deg, mpDBObject->launcherName[nLauncher]); Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** Game.cpp 27 Jan 2005 01:01:52 -0000 1.117 --- Game.cpp 31 Jan 2005 01:33:08 -0000 1.118 *************** *** 299,302 **** --- 299,304 ---- viewer->SetClearMode(2); // depth and color buffer clearing viewer->ClearDefaultTextObjects(); + size3D = MODE3D_SMALL; + Update3DSize(); // clear message center Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcGameObject.cpp 2 Dec 2004 04:17:26 -0000 1.26 --- tcGameObject.cpp 31 Jan 2005 01:33:08 -0000 1.27 *************** *** 1,20 **** /* ! * Copyright (C) 2003 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" --- 1,23 ---- + /** + ** @file tcGameObject.cpp + */ /* ! ** Copyright (C) 2003-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" *************** *** 128,136 **** /** ! * Gets relative model coordinates of obj relative to this GameObject ! * Not tested yet. ! * ! * @param rel_pos Relative position structure to store results in. ! */ void tcGameObject::GetRelPosOf(tcGameObject *obj, tsRelativePosition& rel_pos) { --- 131,140 ---- /** ! * Gets relative model coordinates of obj relative to this GameObject ! * Modified to new coord system: dx right, dy forward, dz up ! * Old system was: dx is right, dy is up, and dz is back ! * ! * @param rel_pos Relative position structure to store results in. ! */ void tcGameObject::GetRelPosOf(tcGameObject *obj, tsRelativePosition& rel_pos) { *************** *** 138,142 **** rel_pos.roll = 0; rel_pos.yaw = 0; ! rel_pos.dy = obj->mcKin.mfAlt_m - mcKin.mfAlt_m; double delta_lat = obj->mcKin.mfLat_rad - mcKin.mfLat_rad; double delta_lon = obj->mcKin.mfLon_rad - mcKin.mfLon_rad; --- 142,147 ---- rel_pos.roll = 0; rel_pos.yaw = 0; ! rel_pos.dz = obj->mcKin.mfAlt_m - mcKin.mfAlt_m; ! double delta_lat = obj->mcKin.mfLat_rad - mcKin.mfLat_rad; double delta_lon = obj->mcKin.mfLon_rad - mcKin.mfLon_rad; *************** *** 149,156 **** float sin_hdg = sinf(hdg); float dx = cos_hdg*delta_lon_m - sin_hdg*delta_lat_m; ! float dz = -cos_hdg*delta_lat_m - sin_hdg*delta_lon_m; rel_pos.dx = dx; ! rel_pos.dz = dz; } --- 154,161 ---- float sin_hdg = sinf(hdg); float dx = cos_hdg*delta_lon_m - sin_hdg*delta_lat_m; ! float dy = cos_hdg*delta_lat_m + sin_hdg*delta_lon_m; rel_pos.dx = dx; ! rel_pos.dy = dy; } *************** *** 197,202 **** /** ! * Looking forward from the object, dx is right, dy is up, and dz is back ! * TODO fix this system to use dx right, dy forward, dz up */ tsGeoPoint tcGameObject::RelPosToLatLonAlt(const float& dx, --- 202,207 ---- /** ! * Modified to new coord system: dx right, dy forward, dz up ! * Old system was: dx is right, dy is up, and dz is back */ tsGeoPoint tcGameObject::RelPosToLatLonAlt(const float& dx, *************** *** 209,216 **** float sin_hdg = sinf(hdg); ! p.mfAlt_m = mcKin.mfAlt_m + dy; p.mfLon_rad = (C_MTORAD / cosf((float)mcKin.mfLat_rad)) * ! (cos_hdg * dx - sin_hdg * dz) + mcKin.mfLon_rad; ! p.mfLat_rad = C_MTORAD * (-cos_hdg * dz - sin_hdg * dx) + mcKin.mfLat_rad; return p; --- 214,221 ---- float sin_hdg = sinf(hdg); ! p.mfAlt_m = mcKin.mfAlt_m + dz; p.mfLon_rad = (C_MTORAD / cosf((float)mcKin.mfLat_rad)) * ! (cos_hdg * dx + sin_hdg * dy) + mcKin.mfLon_rad; ! p.mfLat_rad = C_MTORAD * (cos_hdg * dy - sin_hdg * dx) + mcKin.mfLat_rad; return p; *************** *** 541,545 **** mpDBObject = obj; mnID = NULL_INDEX; // remains NULL index for child ! model = obj->Get3DModel(); if (model) model->SetupUpdate(this); } --- 546,550 ---- mpDBObject = obj; mnID = NULL_INDEX; // remains NULL index for child ! model = obj->Copy3DModel(); if (model) model->SetupUpdate(this); } Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcRadar.cpp 27 Jan 2005 01:02:06 -0000 1.22 --- tcRadar.cpp 31 Jan 2005 01:33:09 -0000 1.23 *************** *** 26,35 **** #include "tcRadar.h" #include "tcGameObject.h" ! #include "tcSurfaceObject.h" ! #include "tcAirObject.h" ! #include "tcMissileObject.h" #include "tcAirfieldObject.h" #include "tcBallisticWeapon.h" #include "tcSubObject.h" #include "tcGenericDBObject.h" --- 26,37 ---- #include "tcRadar.h" #include "tcGameObject.h" ! #include "tcAirfieldObject.h" + #include "tcAirObject.h" #include "tcBallisticWeapon.h" + #include "tcGroundObject.h" + #include "tcMissileObject.h" #include "tcSubObject.h" + #include "tcSurfaceObject.h" #include "tcGenericDBObject.h" *************** *** 107,110 **** --- 109,113 ---- float rcs_dBsm; + // Need more efficient implementation here, gotta be a better way to do this! if (const tcSurfaceObject* surfaceObj = dynamic_cast<const tcSurfaceObject*>(target)) { *************** *** 122,125 **** --- 125,133 ---- isAir = true; } + else if (const tcGroundObject* groundObj = dynamic_cast<const tcGroundObject*>(target)) + { + rcs_dBsm = groundObj->mpDBObject->mfRcs_dbsm; + isGround = true; + } else if (const tcAirfieldObject* fieldObj = dynamic_cast<const tcAirfieldObject*>(target)) { |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:33:27
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20374/src/common Modified Files: tcSound.cpp Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcSound.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcSound.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcSound.cpp 27 Jan 2005 01:01:48 -0000 1.20 --- tcSound.cpp 31 Jan 2005 01:33:07 -0000 1.21 *************** *** 461,464 **** --- 461,465 ---- { if (!mbInitialized) return; + if (effectName.length() == 0) return; ReleaseStoppedBuffers(); |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:32:46
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20285/include/sim Modified Files: tcBallisticWeapon.h tcGameObject.h tcHeloObject.h Added Files: tcGroundObject.h Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcGameObject.h 2 Dec 2004 04:17:24 -0000 1.28 --- tcGameObject.h 31 Jan 2005 01:32:36 -0000 1.29 *************** *** 1,20 **** /* ! * Copyright (C) 2003 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 _TCGAMEOBJECT_H_ --- 1,23 ---- + /** + ** @file tcGameObject.h + */ /* ! ** Copyright (C) 2003-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 _TCGAMEOBJECT_H_ *************** *** 53,75 **** /** * 3D model coordinates relative to parent frame of ! * reference. Objects point in -z direction. */ ! typedef struct _formationparams { bool mbFormation; tnPoolIndex mnFormationLeader; tcKinematics mcFormationKin; float mfFormationRange_km; ! float mfFormationBearing_rad; // relative to leader course ! } tsFormationParameters; /** * 3D model coordinates relative to parent frame of ! * reference. Objects point in -z direction. */ struct tsRelativePosition { float dx; ///< right ! float dy; ///< up ! float dz; ///< back float yaw, pitch, roll; bool isVisible; --- 56,79 ---- /** * 3D model coordinates relative to parent frame of ! * reference. Objects point in y direction. */ ! struct tsFormationParameters ! { bool mbFormation; tnPoolIndex mnFormationLeader; tcKinematics mcFormationKin; float mfFormationRange_km; ! float mfFormationBearing_rad; ///< relative to leader course ! }; /** * 3D model coordinates relative to parent frame of ! * reference. Objects point in y direction. */ struct tsRelativePosition { float dx; ///< right ! float dy; ///< forward ! float dz; ///< up float yaw, pitch, roll; bool isVisible; *************** *** 84,106 **** /** ! * Base class for all game objects. ! */ class tcGameObject { public: tcGameObject *parent; ! tsRelativePosition rel_pos; // if parent is not NULL, this contains relative position std::vector<tcGameObject*> children; ! std::vector<tcGameObject*> toLaunch; // list of ex-childrent to launch ! //osg::ref_ptr<osg::Group> model; ///< 3D model tc3DModel *model; ///< 3D model ! UINT mnModelType; // class MTYPE_ identifier long mnID; ! tcDBString mzClass; // name of database class ! tnPoolIndex mnDBKey; // key of database entry ! tcDBString mzUnit; // specific name of class instance UINT8 mnAlliance; ! // derived objects can have different DB obj type in their scope ! // mpDBObject should always point to relevant data for current model class tcDatabaseObject *mpDBObject; double mfStatusTime; ///< timestamp for parameters --- 88,110 ---- /** ! * Base class for all game objects. ! */ class tcGameObject { public: tcGameObject *parent; ! tsRelativePosition rel_pos; ///< if parent is not NULL, this contains relative position std::vector<tcGameObject*> children; ! std::vector<tcGameObject*> toLaunch; ///< list of ex-childrent to launch tc3DModel *model; ///< 3D model ! UINT mnModelType; ///< class MTYPE_ identifier long mnID; ! tcDBString mzClass; ///< name of database class ! tnPoolIndex mnDBKey; ///< key of database entry ! tcDBString mzUnit; ///< specific name of class instance UINT8 mnAlliance; ! ! /** derived objects can have different DB obj type in their scope ! /* mpDBObject should always point to relevant data for current model class */ tcDatabaseObject *mpDBObject; double mfStatusTime; ///< timestamp for parameters --- NEW FILE: tcGroundObject.h --- /** ** @file tcGroundObject.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 _TCGROUNDOBJECT_H_ #define _TCGROUNDOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tcFile.h" #include "tcPlatformObject.h" /** * Models a generic ground object (SAM site was initial use) * */ class tcGroundObject : public tcPlatformObject { public: virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); void PrintToFile(tcFile& file); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); virtual void Update(double afStatusTime); tcGroundObject(); tcGroundObject(tcGroundObject&); tcGroundObject(tcGenericDBObject* obj); virtual ~tcGroundObject(); }; #endif Index: tcHeloObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcHeloObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcHeloObject.h 9 Aug 2004 02:35:14 -0000 1.1 --- tcHeloObject.h 31 Jan 2005 01:32:36 -0000 1.2 *************** *** 41,44 **** --- 41,45 ---- virtual void UpdateClimb(float dt_s); + virtual void UpdateSpeed(float dt_s); virtual void Update(double afStatusTime); Index: tcBallisticWeapon.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcBallisticWeapon.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcBallisticWeapon.h 17 Aug 2004 02:22:56 -0000 1.4 --- tcBallisticWeapon.h 31 Jan 2005 01:32:36 -0000 1.5 *************** *** 50,54 **** void LaunchFrom(tcGameObject* obj, unsigned nLauncher); virtual void Update(double afStatusTime); ! void PrintToFile(tcFile&); --- 50,55 ---- void LaunchFrom(tcGameObject* obj, unsigned nLauncher); virtual void Update(double afStatusTime); ! bool IsGravityBomb() const; ! bool IsGunRound() const; void PrintToFile(tcFile&); |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:32:46
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20285/include/database Modified Files: tcBallisticDBObject.h tcDatabaseObject.h tcGenericDBObject.h Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcGenericDBObject.h 16 Jan 2005 18:35:56 -0000 1.15 --- tcGenericDBObject.h 31 Jan 2005 01:32:35 -0000 1.16 *************** *** 80,85 **** std::vector<long> sensorId; ///< database id's of sensors std::vector<std::string> launcherName; ///< display names of launchers, e.g. "Tube 1" ! float launcherAz[MAXLAUNCHERS]; ///< pointing angles of launchers in degrees ! tc3DPoint launcherPosition[MAXLAUNCHERS]; ///< relative position of launchers in meters float sensorAz[MAXSENSORS]; ///< pointing angles of sensors in degrees --- 80,84 ---- std::vector<long> sensorId; ///< database id's of sensors std::vector<std::string> launcherName; ///< display names of launchers, e.g. "Tube 1" ! float sensorAz[MAXSENSORS]; ///< pointing angles of sensors in degrees *************** *** 92,95 **** --- 91,95 ---- bool IsLeaf() const; ///< returns true if db obj is a leaf obj tcFlightportDBObject* GetFlightport(); + float GetLauncherAz(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); bool HasAllEmitters(std::vector<long>& emitters); Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcDatabaseObject.h 30 Dec 2004 17:26:06 -0000 1.19 --- tcDatabaseObject.h 31 Jan 2005 01:32:35 -0000 1.20 *************** *** 139,143 **** static void AttachDatabase(tcDatabase *db) {database = db;} virtual const char* GetClassName() {return "Object";} ///< returns class name of database object ! virtual tc3DModel* Get3DModel(); bool IsLeaf() const; ///< returns true if db obj is a leaf obj void Load3DModel(); --- 139,144 ---- static void AttachDatabase(tcDatabase *db) {database = db;} virtual const char* GetClassName() {return "Object";} ///< returns class name of database object ! virtual tc3DModel* Copy3DModel(); ///< creates copy of model (must be deleted) ! virtual tc3DModel* Get3DModel(); ///< gets pointer to database model bool IsLeaf() const; ///< returns true if db obj is a leaf obj void Load3DModel(); Index: tcBallisticDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcBallisticDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcBallisticDBObject.h 29 Nov 2004 03:54:48 -0000 1.5 --- tcBallisticDBObject.h 31 Jan 2005 01:32:35 -0000 1.6 *************** *** 38,43 **** --- 38,48 ---- { public: + enum {GUN_ROUND = 0, GRAVITY_BOMB = 1}; + int ballisticType; + float GetGunneryElevation(float range_m, float dz_m, float& tti_s); float GetMaxLevelGunRangeKm(); + bool IsGravityBomb() const; + bool IsGunRound() const; virtual const char* GetClassName() {return "Ballistic";} ///< returns class name of database object |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:32:46
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20285/include/scriptinterface Modified Files: tcPlatformInterface.h Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcPlatformInterface.h 11 Dec 2004 01:09:05 -0000 1.30 --- tcPlatformInterface.h 31 Jan 2005 01:32:36 -0000 1.31 *************** *** 300,304 **** void DisplayMessage(std::string text); /// play sound effect ! void PlaySound(int n); /// sets text displayed in platform info panel void SetActionText(std::string text) {mpPlatformObj->mcAI.mzActionText = text;} --- 300,304 ---- void DisplayMessage(std::string text); /// play sound effect ! void PlaySound(const std::string& effect); /// sets text displayed in platform info panel void SetActionText(std::string text) {mpPlatformObj->mcAI.mzActionText = text;} |
|
From: Dewitt C. <ddc...@us...> - 2005-01-31 01:32:46
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20285/include/graphics Modified Files: tc3DModel.h tcNumberWidget.h Log Message: Moved launcher position to 3D model animation xml file Added tcGroundObject for ground SAM site Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DModel.h 27 Jan 2005 01:01:44 -0000 1.12 --- tc3DModel.h 31 Jan 2005 01:32:36 -0000 1.13 *************** *** 72,75 **** --- 72,77 ---- }; + + class TiXmlDocument; *************** *** 97,100 **** --- 99,103 ---- tcGameObject* GetGameObj() {return gameObj;} + void GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az); osg::ref_ptr<osg::Node> GetNode(); unsigned int GetNumParents(); *************** *** 122,129 **** --- 125,138 ---- private: + struct LauncherMountInfo + { + osg::Vec3 position; ///< start pos for launched item in body coords, default (0,0,0) + float pointingAzimuth; ///< start rel az of launched item rel to nose, default 0 + }; tcSmoker smokeTrails; ///< position of smoke emitters in model coordinates for afterburner and propeller std::vector<osg::Vec3> engineSmokeSources; + std::vector<LauncherMountInfo> launcherInfo; int smokeMode; *************** *** 156,159 **** --- 165,169 ---- void Load(std::string model_name); void LoadXmlAnimationInfo(TiXmlDocument* doc); + void LoadXmlMountInfo(TiXmlDocument* doc); void LoadXmlSmokeInfo(TiXmlDocument* doc); void ProcessAnimations(); Index: tcNumberWidget.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcNumberWidget.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcNumberWidget.h 28 Dec 2004 00:42:35 -0000 1.1 --- tcNumberWidget.h 31 Jan 2005 01:32:36 -0000 1.2 *************** *** 53,57 **** void SetFontSize(float size); void SetSendRedraw(bool state); ! void SetSoundEffect(int effect) {soundEffect = effect;} tcNumberWidget(float& param, tc3DWindow *parent, const wxPoint& pos, const wxSize& size, --- 53,57 ---- void SetFontSize(float size); void SetSendRedraw(bool state); ! void SetSoundEffect(const std::string& effect) {soundEffect = effect;} tcNumberWidget(float& param, tc3DWindow *parent, const wxPoint& pos, const wxSize& size, *************** *** 66,70 **** bool isMouseOver; ! int soundEffect; float fontSize; --- 66,70 ---- bool isMouseOver; ! std::string soundEffect; float fontSize; |
|
From: Dewitt C. <ddc...@us...> - 2005-01-27 01:03:14
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11058/src/sim Modified Files: Game.cpp tcDirector.cpp tcDirectorEvent.cpp tcESMSensor.cpp tcObjectControl.cpp tcOpticalSensor.cpp tcRadar.cpp tcSimState.cpp tcSonar.cpp Log Message: Multiple smoke trail fixes Animation tweaks Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** tcSimState.cpp 10 Jan 2005 00:30:55 -0000 1.63 --- tcSimState.cpp 27 Jan 2005 01:02:06 -0000 1.64 *************** *** 240,244 **** if (mpUserInfo->IsOwnAlliance(pPlatformObj->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_NOISYBEEP); } return true; --- 240,244 ---- if (mpUserInfo->IsOwnAlliance(pPlatformObj->mnAlliance)) { ! tcSound::Get()->PlayEffect("NoisyBeepLow"); } return true; *************** *** 272,276 **** pPlatformObj->DesignateLauncherTarget(anTargetKey, anLauncher); if (mpUserInfo->IsOwnAlliance(pPlatformObj->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_NOISYBEEP); } return true; --- 272,276 ---- pPlatformObj->DesignateLauncherTarget(anTargetKey, anLauncher); if (mpUserInfo->IsOwnAlliance(pPlatformObj->mnAlliance)) { ! tcSound::Get()->PlayEffect("NoisyBeepLow"); } return true; *************** *** 278,282 **** else { //pPlatformObj->DesignateLauncherTarget(anTargetKey, anLauncher); ! //tcSound::Get()->PlayEffect(SEFFECT_LOWBEEP); return false; } --- 278,282 ---- else { //pPlatformObj->DesignateLauncherTarget(anTargetKey, anLauncher); ! //tcSound::Get()->PlayEffect("LowBeep"); return false; } *************** *** 384,388 **** else { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); } } --- 384,388 ---- else { ! tcSound::Get()->PlayEffect("Explosion2"); } } *************** *** 433,437 **** else { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); } } --- 433,437 ---- else { ! tcSound::Get()->PlayEffect("Explosion2"); } } *************** *** 518,522 **** else { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); } } --- 518,522 ---- else { ! tcSound::Get()->PlayEffect("Explosion2"); } } *************** *** 885,889 **** void tcSimState::ReportDamage(tcGameObject* obj) { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); std::string damageString = "reports light damage"; --- 885,889 ---- void tcSimState::ReportDamage(tcGameObject* obj) { ! tcSound::Get()->PlayEffect("Implosion"); std::string damageString = "reports light damage"; *************** *** 958,962 **** if (mpUserInfo->IsOwnAlliance(apRadarPlat->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } char zBuff[128]; --- 958,962 ---- if (mpUserInfo->IsOwnAlliance(apRadarPlat->mnAlliance)) { ! tcSound::Get()->PlayEffect("Ping"); } char zBuff[128]; *************** *** 1083,1087 **** if (mpUserInfo->IsOwnAlliance(apESMPlat->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } char zBuff[128]; --- 1083,1087 ---- if (mpUserInfo->IsOwnAlliance(apESMPlat->mnAlliance)) { ! tcSound::Get()->PlayEffect("Ping"); } char zBuff[128]; *************** *** 1287,1295 **** if (dynamic_cast<tcHeloObject*>(child)) { ! tcSound::Get()->PlayEffect(SEFFECT_HELOLAUNCH); } else if (dynamic_cast<tcAirObject*>(child)) { ! tcSound::Get()->PlayEffect(SEFFECT_JETLAUNCH); } --- 1287,1295 ---- if (dynamic_cast<tcHeloObject*>(child)) { ! tcSound::Get()->PlayEffect("helolaunch"); } else if (dynamic_cast<tcAirObject*>(child)) { ! tcSound::Get()->PlayEffect("jetlaunch"); } *************** *** 1356,1360 **** if(mpUserInfo->IsOwnAlliance(applat->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TWOBEEPS); } } --- 1356,1360 ---- if(mpUserInfo->IsOwnAlliance(applat->mnAlliance)) { ! tcSound::Get()->PlayEffect("TwoBeeps"); } } *************** *** 1443,1447 **** if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_MISSILELAUNCH); } } --- 1443,1447 ---- if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect("MissileLaunch"); } } *************** *** 1452,1456 **** if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TORPEDOLAUNCH); } } --- 1452,1456 ---- if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect("torpedo_launch"); } } *************** *** 1461,1465 **** if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_NAVALGUN); } } --- 1461,1465 ---- if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { ! tcSound::Get()->PlayEffect("NavalGun1"); } } Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcOpticalSensor.cpp 11 Dec 2004 01:09:08 -0000 1.4 --- tcOpticalSensor.cpp 27 Jan 2005 01:02:06 -0000 1.5 *************** *** 366,370 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_LOWBEEP); } fprintf(stdout, "target %d detected (optical) at %3.1f km at time %.1f [a:%d]\n", --- 366,370 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("LowBeep"); } fprintf(stdout, "target %d detected (optical) at %3.1f km at time %.1f [a:%d]\n", *************** *** 416,420 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TWOBEEPS); } } --- 416,420 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("TwoBeeps"); } } Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcSonar.cpp 10 Jan 2005 00:30:55 -0000 1.5 --- tcSonar.cpp 27 Jan 2005 01:02:06 -0000 1.6 *************** *** 420,424 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_SONARDETECT); } fprintf(stdout, "%s (%s): target %d (%s) detected by active sonar at %3.1f km at time %.1f " --- 420,424 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("shishding"); } fprintf(stdout, "%s (%s): target %d (%s) detected by active sonar at %3.1f km at time %.1f " *************** *** 480,484 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_SONARDETECT); } fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" --- 480,484 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("shishding"); } fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" *************** *** 566,570 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TWOBEEPS); } #endif --- 566,570 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("TwoBeeps"); } #endif Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcDirectorEvent.cpp 14 Nov 2004 22:52:22 -0000 1.13 --- tcDirectorEvent.cpp 27 Jan 2005 01:01:55 -0000 1.14 *************** *** 195,199 **** } ! tcSoundEffectEvent::tcSoundEffectEvent(double t, int effect) : tcSoundEvent(t,t), effectCode(effect) { --- 195,199 ---- } ! tcSoundEffectEvent::tcSoundEffectEvent(double t, const std::string& effect) : tcSoundEvent(t,t), effectCode(effect) { Index: tcESMSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcESMSensor.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcESMSensor.cpp 23 Nov 2004 23:31:13 -0000 1.10 --- tcESMSensor.cpp 27 Jan 2005 01:01:55 -0000 1.11 *************** *** 301,305 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } char zBuff[128]; --- 301,305 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("Ping"); } char zBuff[128]; Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcObjectControl.cpp 10 Jan 2005 00:30:55 -0000 1.29 --- tcObjectControl.cpp 27 Jan 2005 01:01:55 -0000 1.30 *************** *** 1288,1292 **** if (bAccepted) { ! tcSound::Get()->PlayEffect(SEFFECT_LOWBEEP); } } --- 1288,1292 ---- if (bAccepted) { ! tcSound::Get()->PlayEffect("LowBeep"); } } *************** *** 1396,1400 **** else { ! //tcSound::Get()->PlayEffect(SEFFECT_REJECTBEEP); } return true; --- 1396,1400 ---- else { ! //tcSound::Get()->PlayEffect("RejectBeep"); } return true; *************** *** 1455,1463 **** if (pSensorState->GetActive()) { ! tcSound::Get()->PlayEffect(SEFFECT_RADARON); } else { ! tcSound::Get()->PlayEffect(SEFFECT_RADAROFF); } --- 1455,1463 ---- if (pSensorState->GetActive()) { ! tcSound::Get()->PlayEffect("radar_on"); } else { ! tcSound::Get()->PlayEffect("radar_off"); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** Game.cpp 16 Jan 2005 18:36:29 -0000 1.116 --- Game.cpp 27 Jan 2005 01:01:52 -0000 1.117 *************** *** 707,711 **** } ! briefingConsoleLeft->SetEffect(SEFFECT_MUTEDBEEP); //briefingConsoleLeft->InitGdi(10.0f,0xFF64FF64); briefingConsoleLeft->SetLineSpacing(10); --- 707,711 ---- } ! briefingConsoleLeft->SetEffect("MutedBeep"); //briefingConsoleLeft->InitGdi(10.0f,0xFF64FF64); briefingConsoleLeft->SetLineSpacing(10); *************** *** 728,732 **** } ! briefingConsoleBottom->SetEffect(-1); //briefingConsoleBottom->InitGdi(10.0f,0xFF64FF64); briefingConsoleBottom->SetLineSpacing(10); --- 728,732 ---- } ! briefingConsoleBottom->SetEffect(""); //briefingConsoleBottom->InitGdi(10.0f,0xFF64FF64); briefingConsoleBottom->SetLineSpacing(10); *************** *** 885,889 **** } ! infoConsole->SetEffect(-1); //SEFFECT_MUTEDBEEP); // no sound // infoConsole->InitGdi(10.0f,0xFF64FF64); infoConsole->SetLineSpacing(10); --- 885,889 ---- } ! infoConsole->SetEffect(""); //"MutedBeep"); // no sound // infoConsole->InitGdi(10.0f,0xFF64FF64); infoConsole->SetLineSpacing(10); *************** *** 1055,1059 **** tcSensorMapTrack::AttachDatabase(database); ! //tcSound::Get()->PlayEffect(SEFFECT_WELCOME); return true; --- 1055,1059 ---- tcSensorMapTrack::AttachDatabase(database); ! //tcSound::Get()->PlayEffect("Welcome"); return true; *************** *** 2044,2048 **** hookedUnits = groupUnits; ! tcSound::Get()->PlayEffect(SEFFECT_SHORTBEEP); } --- 2044,2048 ---- hookedUnits = groupUnits; ! tcSound::Get()->PlayEffect("ShortBeep"); } *************** *** 2074,2078 **** if (hookID != NULL_INDEX) { ! tcSound::Get()->PlayEffect(SEFFECT_SHORTBEEP); pythonInterface->SetMenuPlatform(hookID); } --- 2074,2078 ---- if (hookID != NULL_INDEX) { ! tcSound::Get()->PlayEffect("ShortBeep"); pythonInterface->SetMenuPlatform(hookID); } Index: tcDirector.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirector.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDirector.cpp 2 Nov 2004 04:23:56 -0000 1.10 --- tcDirector.cpp 27 Jan 2005 01:01:55 -0000 1.11 *************** *** 82,86 **** AddEvent(new tcGameCommandEvent(ID_SET3D, 0, 0)); // deactivate 3D window ! //AddEvent(new tcSoundEffectEvent(1.0f,SEFFECT_WELCOME)); //AddEvent(new tcMusicEvent("","pause",0,0,0)); AddEvent(new tcMusicEvent("tension1","play",0,2.0,30.0)); --- 82,86 ---- AddEvent(new tcGameCommandEvent(ID_SET3D, 0, 0)); // deactivate 3D window ! //AddEvent(new tcSoundEffectEvent(1.0f,"Welcome")); //AddEvent(new tcMusicEvent("","pause",0,0,0)); AddEvent(new tcMusicEvent("tension1","play",0,2.0,30.0)); *************** *** 92,96 **** AddEvent(new tcMapViewEvent(7, -5.9, 49.5, 4.0)); ! AddEvent(new tcSoundEffectEvent(7,SEFFECT_THUCK)); AddEvent(new tcMapTextEvent("OPFOR", 7.0, 18.0f, -6.0, 49.9, 1)); --- 92,96 ---- AddEvent(new tcMapViewEvent(7, -5.9, 49.5, 4.0)); ! AddEvent(new tcSoundEffectEvent(7,"Thuck")); AddEvent(new tcMapTextEvent("OPFOR", 7.0, 18.0f, -6.0, 49.9, 1)); Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcRadar.cpp 11 Dec 2004 01:09:08 -0000 1.21 --- tcRadar.cpp 27 Jan 2005 01:02:06 -0000 1.22 *************** *** 486,490 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_PING); } fprintf(stdout, "target %d detected at %3.1f km at time %.1f [a:%d]\n", --- 486,490 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("Ping"); } fprintf(stdout, "target %d detected at %3.1f km at time %.1f [a:%d]\n", *************** *** 546,550 **** if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect(SEFFECT_TWOBEEPS); } #endif --- 546,550 ---- if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("TwoBeeps"); } #endif |