gcblue-commits Mailing List for Global Conflict Blue (Page 50)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:09
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/scriptinterface Modified Files: tcPlatformInterface.h Log Message: Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcPlatformInterface.h 24 May 2004 00:14:45 -0000 1.20 --- tcPlatformInterface.h 18 Jul 2004 03:18:00 -0000 1.21 *************** *** 258,261 **** --- 258,262 ---- bool HasFlightPort(void); tcFlightPortInterface GetFlightPortInfo(void); + tcTrack GetLandingData(long id); int GetLandingState(); void SetLandingState(int state); |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:09
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/database Modified Files: tcDatabase.h tcDatabaseObject.h tcGenericDBObject.h Log Message: Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcGenericDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 --- tcGenericDBObject.h 18 Jul 2004 03:17:59 -0000 1.8 *************** *** 36,39 **** --- 36,41 ---- { + class tcFlightportDBObject; + /** * Models a generic platform that has weapon launchers and *************** *** 76,79 **** --- 78,82 ---- void Animate3DModel(); virtual const char* GetClassName() {return "Generic";} ///< returns class name of database object + tcFlightportDBObject* GetFlightport(); void RandInit(); virtual void PrintToFile(tcFile& file); Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDatabaseObject.h 28 Mar 2004 23:12:27 -0000 1.10 --- tcDatabaseObject.h 18 Jul 2004 03:17:59 -0000 1.11 *************** *** 87,90 **** --- 87,91 ---- #define MTYPE_PLATFORM 11 #define MTYPE_FIXEDWINGX 12 // model with more realism + #define MTYPE_AIRFIELD 13 // database object types (database class identifier) Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcDatabase.h 28 Mar 2004 19:02:47 -0000 1.5 --- tcDatabase.h 18 Jul 2004 03:17:59 -0000 1.6 *************** *** 43,47 **** { ! class CsvTranslator; #ifndef NULL_INDEX --- 43,47 ---- { ! class CsvTranslator; #ifndef NULL_INDEX *************** *** 53,98 **** #define N_DATABASE_OBJECTS 1024 ! /*************** DATABASE ********************/ ! class tcDatabase ! { ! public: ! tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this ! tcString mstrCurrentFile; ! UINT32 mnVersion; ! void Clear(void); ! void CreateDefaultDB(void); ! int CreateObjectCopy(tnPoolIndex anKey); ! int CreateObjectByType(UINT anClassID); ! int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(void); ! tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize(void) {return mcObjectData.GetCount();} ! int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); ! tcDatabaseObject* GetObject(tnPoolIndex anKey); ! tcDatabaseObject* GetObject(std::string className); ///< gets object by class name ! int GetObjectClass(tnPoolIndex anKey, tcDBString& rzClass); ! tnPoolIndex GetFirstObjectOfClass(UINT anClassID); ! tnPoolIndex GetNextObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetPrevObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetKey(tcDBString& s); ! void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(void); ! void LoadDB(tcString astrDBFileName); ! void SaveDB(tcString astrDBFileName); ! void LoadDBCSV(std::string suffix = ""); ! void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); ! void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(void); ! void PrintToFile(tcString); ! int Serialize(tcFile& file, bool mbLoad); ! int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); ! tcDatabase(); ! ~tcDatabase(); ! private: ! bool IsVersionSupported(void); ! }; } --- 53,104 ---- #define N_DATABASE_OBJECTS 1024 ! /** ! * Singleton class for interface with game object database ! */ ! class tcDatabase ! { ! public: ! static tcDatabase* Get(); ! tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this ! tcString mstrCurrentFile; ! UINT32 mnVersion; ! ! void Clear(void); ! void CreateDefaultDB(void); ! int CreateObjectCopy(tnPoolIndex anKey); ! int CreateObjectByType(UINT anClassID); ! int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(void); ! tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize(void) {return mcObjectData.GetCount();} ! int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); ! tcDatabaseObject* GetObject(tnPoolIndex anKey); ! tcDatabaseObject* GetObject(std::string className); ///< gets object by class name ! int GetObjectClass(tnPoolIndex anKey, tcDBString& rzClass); ! tnPoolIndex GetFirstObjectOfClass(UINT anClassID); ! tnPoolIndex GetNextObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetPrevObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetKey(tcDBString& s); ! void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(void); ! void LoadDB(tcString astrDBFileName); ! void SaveDB(tcString astrDBFileName); ! void LoadDBCSV(std::string suffix = ""); ! void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); ! void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(void); ! void PrintToFile(tcString); ! int Serialize(tcFile& file, bool mbLoad); ! int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); ! ! private: ! tcDatabase(); ! ~tcDatabase(); ! ! bool IsVersionSupported(void); ! }; } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:08
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/common Modified Files: simmath.h Log Message: Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** simmath.h 23 Apr 2004 00:14:56 -0000 1.13 --- simmath.h 18 Jul 2004 03:17:59 -0000 1.14 *************** *** 111,115 **** void ClearFlags() {mnFlags=0;} ! void Clear() { --- 111,115 ---- void ClearFlags() {mnFlags=0;} ! /// why is mnID set to 0 instead of -1 ? void Clear() { *************** *** 118,122 **** mnID=0;mfClimbAngle_rad=0;mnFlags = 0; mnPassivePlatformID = -1; ! } bool IsAir() {return ((mnClassification & PTYPE_AIR) != 0);} bool IsMissile() {return ((mnClassification & PTYPE_MISSILE) != 0);} --- 118,122 ---- mnID=0;mfClimbAngle_rad=0;mnFlags = 0; mnPassivePlatformID = -1; ! } bool IsAir() {return ((mnClassification & PTYPE_AIR) != 0);} bool IsMissile() {return ((mnClassification & PTYPE_MISSILE) != 0);} |
|
From: Dewitt C. <ddc...@us...> - 2004-07-13 23:28:12
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15364/include/sim Modified Files: tcCarrierObject.h Added Files: tcFlightOpsObject.h Log Message: Index: tcCarrierObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCarrierObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcCarrierObject.h 13 Feb 2004 01:31:32 -0000 1.6 --- tcCarrierObject.h 13 Jul 2004 23:28:02 -0000 1.7 *************** *** 49,52 **** tcCarrierObject(tcCarrierObject&); tcCarrierObject(tcGenericDBObject *obj); ! ~tcCarrierObject(); }; \ No newline at end of file --- 49,52 ---- tcCarrierObject(tcCarrierObject&); tcCarrierObject(tcGenericDBObject *obj); ! virtual ~tcCarrierObject(); }; \ No newline at end of file --- NEW FILE: tcFlightOpsObject.h --- /** @file tcFlightOpsObject.h ** ** Header for tcFlightOpsObject class. */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #pragma once #include "tcFile.h" #include "tcFlightPort.h" class tcGameObject; /** * Models a sim object with a flightport for air ops. * tcFlightOpsObjects can launch, land, and reposition aircraft. * * @see tcFlightPort */ class tcFlightOpsObject { public: tcFlightPort flight_deck; bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); int CheckLanding(tcGameObject* obj); 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); void SetFlightportDefaults(); virtual void Update(double afStatusTime); virtual void UpdateLaunch(); tcFlightOpsObject(); tcFlightOpsObject(tcGenericDBObject *obj); virtual ~tcFlightOpsObject(); private: tcGameObject* gameObj; ///< to avoid (some) virtual inheritance inefficiency }; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-13 23:28:11
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15364/src/sim Added Files: tcFlightOpsObject.cpp Log Message: --- NEW FILE: tcFlightOpsObject.cpp --- /** ** @file tcFlightOpsObject.cpp */ /* ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "tcFlightOpsObject.h" #include "tcAirObject.h" #include "tcAeroAirObject.h" #include "tcAirDBObject.h" #include "tcFlightportDBObject.h" /******************************************************************************/ /****************************** tcFlightOpsObject *******************************/ /******************************************************************************/ /** * Determines if obj has landed on runway or crashed into flightport. * Calls tcFlightPort method. * If object successfully lands, it is added as a child. * @param obj Object to attempt landing * @return -1 if crash, 0 if not close enough for landing, 1 if landed * @see tcFlightPort::CheckLanding */ int tcFlightOpsObject::CheckLanding(tcGameObject *obj) { GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate int result = flight_deck.CheckLanding(obj); if (result == 1) { AddChild(obj); } return result; } void tcFlightOpsObject::Clear() { tcSurfaceObject::Clear(); flight_deck.Clear(); } /** * Supports aero air model and air generic models. Adding other * model types will fail. * @return true if successful, false otherwise */ bool tcFlightOpsObject::AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc) { tcGameObject *child = NULL; // object to add to flight_deck tcDatabaseObject *dbObj = database->GetObject(className); if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj)) { child = new tcAeroAirObject(airDBObj); } else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(dbObj)) { if (genericDBObj->mnModelType == MTYPE_FIXEDWING) { child = new tcAirObject(genericDBObj); } else { std::cerr << "Attempted to add non-air generic object type to carrier: " << className << "\n"; return false; } } else { std::cerr << "Attempted to add non-air object type to carrier: " << className << "\n"; return false; } child->mzUnit = unitName.c_str(); child->mnAlliance = mnAlliance; child->SetRelativePosition(0,0,0); child->SetRelativeOrientation(0,0,0); AddChild(child); // add child to carrier object flight_deck.AddObject(child, loc); // add child to flight_deck return true; } /******************************************************************************/ void tcFlightOpsObject::RandInitNear(float afLon_deg, float afLat_deg) { // tcGameObject::RandInitNear(afLon,afLat); // why can't we call base here ? virtual issue? if (mpDBObject == NULL) {return;} strcpy(mzClass.mz,mpDBObject->mzClass.mz); mzUnit = "CV_"; 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 = mpDBObject->mfMaxSpeed_kts; mfDamageLevel = 0; mcGS.SetHeading(mcKin.mfHeading_rad); mcGS.SetSpeed(mcKin.mfSpeed_kts); mcGS.SetAltitude(mcKin.mfAlt_m); int nAircraft = flight_deck.GetHangarCapacity(); for(int i=0;i<nAircraft;i++) { // add FW air child for test tcDatabaseObject *dbObj = database->GetRandomOfType(MTYPE_FIXEDWINGX); tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj); tcAeroAirObject *child = NULL; if (airDBObj) child = new tcAeroAirObject(airDBObj); wxASSERT(child); if (child != NULL) { child->mzUnit = "AIRX_"; child->mzUnit.AssignRandomSuffix(); float z = -20.0f + (float)i * 18.0f; child->SetRelativePosition(7.5,12.0,z); child->SetRelativeOrientation(0,0,0); AddChild(child); flight_deck.AddObject(child, LAUNCH); } } } /******************************************************************************/ void tcFlightOpsObject::PrintToFile(tcFile& file) { tcSurfaceObject::PrintToFile(file); } /******************************************************************************/ void tcFlightOpsObject::SaveToFile(tcFile& file) { tcSurfaceObject::SaveToFile(file); } /******************************************************************************/ void tcFlightOpsObject::LoadFromFile(tcFile& file) { tcSurfaceObject::LoadFromFile(file); } /******************************************************************************/ void tcFlightOpsObject::Serialize(tcFile& file, bool mbLoad) { if (mbLoad) { LoadFromFile(file); } else { SaveToFile(file); } } /** * Set up default spots and capacities for carrier flightport. */ void tcFlightOpsObject::SetFlightportDefaults() { flight_deck.Clear(); flight_deck.SetParent(this); flight_deck.AddSpot(LAUNCH, -7.5, 16.0f, 18.8f, 0.03f); flight_deck.AddSpot(READY, 5.0f, 16.0f, 36.25f, -0.5f); flight_deck.AddSpot(READY, 1.25f, 16.0f, 45.0f, -0.5f); flight_deck.AddSpot(READY, 7.5f, 16.0f, 60.0f, 0.4f); flight_deck.AddSpot(READY, 7.5f, 16.0f, 72.5f, 0.4f); flight_deck.AddSpot(READY, 7.5f, 16.0f, 85.0f, 0.4f); flight_deck.AddSpot(READY, 7.5f, 16.0f, 97.5f, 0.4f); flight_deck.SetHangarCapacity(16); } /******************************************************************************/ void tcFlightOpsObject::Update(double afStatusTime) { tcSurfaceObject::Update(afStatusTime); flight_deck.Update(afStatusTime); UpdateLaunch(); } /******************************************************************************/ /* Check if flight_deck has an objects in the toLaunch vector. If so, move them ** to the tcGameObject::toLaunch vector and delete the matching pointer in the ** child list. This is a bit awkward because tcGameObject is holding an object ** in its child list that functionally belongs to the flight deck. */ void tcFlightOpsObject::UpdateLaunch() { int nLaunch = (int)flight_deck.toLaunch.size(); if (nLaunch==0) return; for(int n=0;n<nLaunch;n++) { tcGameObject *object_to_launch = flight_deck.toLaunch[n]; toLaunch.push_back(object_to_launch); RemoveChild(object_to_launch); } flight_deck.toLaunch.clear(); } /******************************************************************************/ tcFlightOpsObject::tcFlightOpsObject() { Clear(); //SetFlightportDefaults(); mpDBObject = NULL; mnModelType = MTYPE_CARRIER; } /******************************************************************************/ /* tcFlightOpsObject::tcFlightOpsObject(tcFlightOpsObject& o) : tcSurfaceObject(o) { } */ /** * Constructor that initializes using info from database entry. * This object will have its own database object eventually. The * DB object will have info on number and types of aircraft the carrier * can hold. */ tcFlightOpsObject::tcFlightOpsObject(tcGenericDBObject *obj) : tcSurfaceObject(obj) { wxASSERT(database); mpDBObject = obj; tcFlightportDBObject* flightportDBObj = dynamic_cast<tcFlightportDBObject*> (database->GetObject(obj->flightportClass.mz)); wxASSERT(flightportDBObj); if (flightportDBObj == NULL) { std::cerr << "Flightport database obj not found for carrier obj: "; std::cerr << mzUnit.mz << "\n"; return; } flight_deck.InitFromDatabase(flightportDBObj); } /******************************************************************************/ tcFlightOpsObject::~tcFlightOpsObject() { } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-10 01:51:24
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/src/graphics Modified Files: tcDisplayModes.cpp tcDisplaySettingsView.cpp Log Message: Index: tcDisplayModes.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplayModes.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDisplayModes.cpp 14 Jun 2004 21:52:48 -0000 1.1 --- tcDisplayModes.cpp 10 Jul 2004 01:51:16 -0000 1.2 *************** *** 40,57 **** ! void tcDisplayModes::ChangeMode(unsigned width, unsigned height, unsigned bits) { DEVMODE winModeInfo; winModeInfo.dmSize = sizeof(DEVMODE); ! winModeInfo.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; winModeInfo.dmBitsPerPel = bits; winModeInfo.dmPelsHeight = height; winModeInfo.dmPelsWidth = width; ! if (!IsModeValid(width, height, bits)) { fprintf(stderr, "tcDisplayModes::ChangeMode - Invalid mode: " ! "W:%d, H:%d, Bits:%d\n", width, height, bits); return; } --- 40,60 ---- ! void tcDisplayModes::ChangeMode(unsigned width, unsigned height, unsigned bits, ! unsigned freq) { DEVMODE winModeInfo; winModeInfo.dmSize = sizeof(DEVMODE); ! winModeInfo.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | ! DM_DISPLAYFREQUENCY; winModeInfo.dmBitsPerPel = bits; winModeInfo.dmPelsHeight = height; winModeInfo.dmPelsWidth = width; + winModeInfo.dmDisplayFrequency = freq; ! if (!IsModeValid(width, height, bits, freq)) { fprintf(stderr, "tcDisplayModes::ChangeMode - Invalid mode: " ! "W:%d, H:%d, Bits:%d, Freq:%d\n", width, height, bits, freq); return; } *************** *** 64,72 **** currentMode.width = width; currentMode.height = height; } else if (result == DISP_CHANGE_BADMODE) { fprintf(stderr, "tcDisplayModes::ChangeMode - Mode not supported: " ! "W:%d, H:%d, Bits:%d\n", width, height, bits); } else --- 67,76 ---- currentMode.width = width; currentMode.height = height; + currentMode.frequency = freq; } else if (result == DISP_CHANGE_BADMODE) { fprintf(stderr, "tcDisplayModes::ChangeMode - Mode not supported: " ! "W:%d, H:%d, Bits:%d Freq:%d\n", width, height, bits, freq); } else *************** *** 81,94 **** * after restart of game (if mode is valid). */ ! void tcDisplayModes::ChangeOptionsMode(unsigned width, unsigned height, unsigned bits) { ! if (!IsModeValid(width, height, bits)) { fprintf(stderr, "tcDisplayModes::ChangeOptionsMode - Invalid mode: " ! "W:%d, H:%d, Bits:%d\n", width, height, bits); return; } ! wxString modeString = wxString::Format("%d %d %d", width, height, bits); tcOptions::Get()->SetOptionString("DisplaySettings", modeString.GetData()); --- 85,99 ---- * after restart of game (if mode is valid). */ ! void tcDisplayModes::ChangeOptionsMode(unsigned width, unsigned height, unsigned bits, ! unsigned freq) { ! if (!IsModeValid(width, height, bits, freq)) { fprintf(stderr, "tcDisplayModes::ChangeOptionsMode - Invalid mode: " ! "W:%d, H:%d, Bits:%d Freq:%d\n", width, height, bits, freq); return; } ! wxString modeString = wxString::Format("%d %d %d %d", width, height, bits, freq); tcOptions::Get()->SetOptionString("DisplaySettings", modeString.GetData()); *************** *** 126,130 **** return ((mode_n.bits == currentMode.bits)&& (mode_n.height == currentMode.height)&& ! (mode_n.width == currentMode.width)); } --- 131,136 ---- return ((mode_n.bits == currentMode.bits)&& (mode_n.height == currentMode.height)&& ! (mode_n.width == currentMode.width)&& ! (mode_n.frequency == currentMode.frequency)); } *************** *** 132,136 **** * @return true if mode params match at least one of the modes in modeInfo */ ! bool tcDisplayModes::IsModeValid(unsigned width, unsigned height, unsigned bits) { unsigned int modeCount = GetModeCount(); --- 138,143 ---- * @return true if mode params match at least one of the modes in modeInfo */ ! bool tcDisplayModes::IsModeValid(unsigned width, unsigned height, unsigned bits, ! unsigned freq) { unsigned int modeCount = GetModeCount(); *************** *** 140,144 **** if ((info.bits == bits)&& (info.width == width)&& ! (info.height == height)) { return true; --- 147,152 ---- if ((info.bits == bits)&& (info.width == width)&& ! (info.height == height)&& ! (info.frequency == freq)) { return true; *************** *** 154,164 **** int height; int bits; ! if (sscanf(modeString, "%d %d %d", &width, &height, &bits) < 3) { return; } ! ChangeMode(width, height, bits); } --- 162,173 ---- int height; int bits; + int freq; ! if (sscanf(modeString, "%d %d %d %d", &width, &height, &bits, &freq) < 4) { return; } ! ChangeMode(width, height, bits, freq); } *************** *** 172,177 **** { tcDisplayModes::Info& info = modeInfo[n]; ! fprintf(stdout, "Display mode %d: W: %d, H: %d, Bits: %d\n", ! n, info.width, info.height, info.bits); } } --- 181,186 ---- { tcDisplayModes::Info& info = modeInfo[n]; ! fprintf(stdout, "Display mode %d: W: %d, H: %d, Bits: %d Freq: %d\n", ! n, info.width, info.height, info.bits, info.frequency); } } *************** *** 193,196 **** --- 202,207 ---- unsigned lastWidth = 0; unsigned lastHeight = 0; + unsigned lastFreq = 0; + int i = 0; while ( EnumDisplaySettings(0, i++, &winModeInfo) ) *************** *** 200,207 **** info.height = winModeInfo.dmPelsHeight; info.width = winModeInfo.dmPelsWidth; bool matchesLast = ((info.bits == lastBits)&& (info.width == lastWidth)&& ! (info.height == lastHeight)); if ((info.bits >= 16)&&(info.width >= 800)&&(!matchesLast)) --- 211,220 ---- info.height = winModeInfo.dmPelsHeight; info.width = winModeInfo.dmPelsWidth; + info.frequency = winModeInfo.dmDisplayFrequency; bool matchesLast = ((info.bits == lastBits)&& (info.width == lastWidth)&& ! (info.height == lastHeight)&& ! (info.frequency == lastFreq)); if ((info.bits >= 16)&&(info.width >= 800)&&(!matchesLast)) *************** *** 213,216 **** --- 226,230 ---- lastWidth = info.width; lastHeight = info.height; + lastFreq = info.frequency; } *************** *** 220,223 **** --- 234,238 ---- currentMode.height = winModeInfo.dmPelsHeight; currentMode.width = winModeInfo.dmPelsWidth; + currentMode.frequency = winModeInfo.dmDisplayFrequency; } *************** *** 232,236 **** tcDisplayModes::~tcDisplayModes() { ! ChangeMode(startMode.width, startMode.height, startMode.bits); } --- 247,252 ---- tcDisplayModes::~tcDisplayModes() { ! ChangeMode(startMode.width, startMode.height, startMode.bits, ! startMode.frequency); } Index: tcDisplaySettingsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDisplaySettingsView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDisplaySettingsView.cpp 14 Jun 2004 21:52:48 -0000 1.1 --- tcDisplaySettingsView.cpp 10 Jul 2004 01:51:16 -0000 1.2 *************** *** 166,170 **** const tcDisplayModes::Info& info = tcDisplayModes::Get()->GetModeInfo((unsigned)downIdx); ! tcDisplayModes::Get()->ChangeOptionsMode(info.width, info.height, info.bits); selectedModeIdx = downIdx; --- 166,171 ---- const tcDisplayModes::Info& info = tcDisplayModes::Get()->GetModeInfo((unsigned)downIdx); ! tcDisplayModes::Get()->ChangeOptionsMode(info.width, info.height, info.bits, ! info.frequency); selectedModeIdx = downIdx; *************** *** 203,208 **** const tcDisplayModes::Info& info = tcDisplayModes::Get()->GetModeInfo(n); ! drawingInfo.modeText = wxString::Format("%d x %d (%d)", ! info.width, info.height, info.bits); MultiByteToWideChar(CP_ACP, 0, drawingInfo.modeText, -1, szwchar, 255); --- 204,209 ---- const tcDisplayModes::Info& info = tcDisplayModes::Get()->GetModeInfo(n); ! drawingInfo.modeText = wxString::Format("%d x %d (%d) %d Hz", ! info.width, info.height, info.bits, info.frequency); MultiByteToWideChar(CP_ACP, 0, drawingInfo.modeText, -1, szwchar, 255); |
|
From: Dewitt C. <ddc...@us...> - 2004-07-10 01:51:24
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CHANGES.txt 24 Jun 2004 21:35:39 -0000 1.24 --- CHANGES.txt 10 Jul 2004 01:51:15 -0000 1.25 *************** *** 3,6 **** --- 3,11 ---- 0.6 --------------------------------------------------------------------- + *** 2004-07-09 Dewitt Colclough *** + - Added display frequency to display mode code. Before the game would + change the display frequency to 60 Hz on exit. + + *** 2004-06-24 Dewitt Colclough *** - Missing tile areas of world map are darkened (bright areas show |
|
From: Dewitt C. <ddc...@us...> - 2004-07-10 01:51:24
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263 Modified Files: doxygen_config Log Message: Index: doxygen_config =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/doxygen_config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doxygen_config 19 Jun 2004 22:00:26 -0000 1.2 --- doxygen_config 10 Jul 2004 01:51:15 -0000 1.3 *************** *** 64,68 **** *.cpp RECURSIVE = YES ! EXCLUDE = .#*.* EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = --- 64,68 ---- *.cpp RECURSIVE = YES ! EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = |
|
From: Dewitt C. <ddc...@us...> - 2004-07-10 01:51:24
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/include/graphics Modified Files: tcDisplayModes.h Log Message: Index: tcDisplayModes.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDisplayModes.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDisplayModes.h 14 Jun 2004 21:52:55 -0000 1.1 --- tcDisplayModes.h 10 Jul 2004 01:51:15 -0000 1.2 *************** *** 40,53 **** unsigned int height; unsigned int bits; }; static tcDisplayModes* Get(); ! void ChangeMode(unsigned width, unsigned height, unsigned bits); ! void ChangeOptionsMode(unsigned width, unsigned height, unsigned bits); unsigned GetModeCount() const; const tcDisplayModes::Info& GetCurrentModeInfo() const; const tcDisplayModes::Info& GetModeInfo(unsigned n) const; bool IsCurrentMode(unsigned n) const; ! bool IsModeValid(unsigned width, unsigned height, unsigned bits); void LoadModeFromOptions(); void LogModeInfo(); --- 40,56 ---- unsigned int height; unsigned int bits; + unsigned int frequency; }; + + static tcDisplayModes* Get(); ! void ChangeMode(unsigned width, unsigned height, unsigned bits, unsigned freq); ! void ChangeOptionsMode(unsigned width, unsigned height, unsigned bits, unsigned freq); unsigned GetModeCount() const; const tcDisplayModes::Info& GetCurrentModeInfo() const; const tcDisplayModes::Info& GetModeInfo(unsigned n) const; bool IsCurrentMode(unsigned n) const; ! bool IsModeValid(unsigned width, unsigned height, unsigned bits, unsigned freq); void LoadModeFromOptions(); void LogModeInfo(); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-25 01:40:36
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12581/src/sim Modified Files: tcCreditView.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcMapView.cpp 24 Jun 2004 21:35:41 -0000 1.26 --- tcMapView.cpp 25 Jun 2004 01:40:27 -0000 1.27 *************** *** 2082,2085 **** --- 2082,2086 ---- else { + ToggleMapSize(); } } Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCreditView.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcCreditView.cpp 14 May 2004 23:37:08 -0000 1.11 --- tcCreditView.cpp 25 Jun 2004 01:40:27 -0000 1.12 *************** *** 52,57 **** AddCredit(s, 40.0f, 1); ! s = "Dewitt \"Cole\" Colclough"; AddCredit(s, 25.0f, 1); --- 52,59 ---- AddCredit(s, 40.0f, 1); + s = "CREDITS NOT UPDATED YET FOR 0.6"; + AddCredit(s, 75.0f, 1); ! s = "Dewitt Colclough"; AddCredit(s, 25.0f, 1); *************** *** 215,219 **** ! float fY = (float)mnHeight - 2*0.5f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; --- 217,221 ---- ! float fY = (float)mnHeight - 0.5f*(float)nDeltaTime; float fX = 0.5f*(float)mnWidth; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-25 01:40:36
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12581 Modified Files: ReleaseInstallScript.nsi Log Message: Index: ReleaseInstallScript.nsi =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/ReleaseInstallScript.nsi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReleaseInstallScript.nsi 24 Jun 2004 21:35:39 -0000 1.2 --- ReleaseInstallScript.nsi 25 Jun 2004 01:40:27 -0000 1.3 *************** *** 12,16 **** ; The file to write ! OutFile "gcb_06x_.exe" ; The default installation directory --- 12,16 ---- ; The file to write ! OutFile "gcb_06x2_.exe" ; The default installation directory |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:51
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/src/sim Modified Files: Game.cpp tcDirector.cpp tcDirectorEvent.cpp tcMapData.cpp tcMapView.cpp tcTerrainView.cpp Log Message: Index: tcDirector.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirector.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDirector.cpp 29 Feb 2004 22:51:36 -0000 1.6 --- tcDirector.cpp 24 Jun 2004 21:35:41 -0000 1.7 *************** *** 2,6 **** ** tcDirector.cpp ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** tcDirector.cpp ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 31,39 **** #include "tcDirector.h" #include "tcDirectorEvent.h" - #include "tcMapView.h" #include "tcSound.h" #include "wxcommands.h" ! using MapView::tcMapView; /** --- 31,47 ---- #include "tcDirector.h" #include "tcDirectorEvent.h" #include "tcSound.h" #include "wxcommands.h" ! ! /** ! * static method to set static members for map views ! * ! * @see tcMapEvent::AttachMapViews ! */ ! void tcDirector::AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv) ! { ! tcMapEvent::AttachMapViews(tmv, wmv); ! } /** *************** *** 80,99 **** AddEvent(new tcConsoleTextEvent("Engage enemy to the Northwest",5)); ! AddEvent(new tcMapViewEvent(mapView, 7, -5.9, 49.5, 4.0)); AddEvent(new tcSoundEffectEvent(7,SEFFECT_THUCK)); ! AddEvent(new tcMapTextEvent(mapView,"OPFOR",7.0,18.0f,-6.0, 49.9,1)); ! AddEvent(new tcConsoleTextEvent("",9)); ! AddEvent(new tcConsoleTextEvent("Enemy is believed to be a medium sized task force",9)); ! AddEvent(new tcConsoleTextEvent("similar in makeup to your own.",9)); ! AddEvent(new tcConsoleTextEvent("",12)); ! AddEvent(new tcConsoleTextEvent("Extreme caution is advised",12)); ! AddEvent(new tcConsoleTextEvent("",13)); ! AddEvent(new tcConsoleTextEvent("Good hunting",13)); AddEvent(new tcGameCommandEvent(ID_SETPAUSE, 18 , 0)); AddEvent(new tcGameCommandEvent(ID_SETBRIEFING, 18, 0)); AddEvent(new tcGameCommandEvent(ID_SET3D, 18, 1)); // deactivate 3D window ! //AddEvent(new tcMapViewEvent(mapView, 24, -5.9, 49.5, 4.0)); } --- 88,107 ---- AddEvent(new tcConsoleTextEvent("Engage enemy to the Northwest",5)); ! 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)); ! AddEvent(new tcConsoleTextEvent("", 9)); ! AddEvent(new tcConsoleTextEvent("Enemy is believed to be a medium sized task force", 9)); ! AddEvent(new tcConsoleTextEvent("similar in makeup to your own.", 9)); ! AddEvent(new tcConsoleTextEvent("", 12)); ! AddEvent(new tcConsoleTextEvent("Extreme caution is advised", 12)); ! AddEvent(new tcConsoleTextEvent("", 13)); ! AddEvent(new tcConsoleTextEvent("Good hunting", 13)); AddEvent(new tcGameCommandEvent(ID_SETPAUSE, 18 , 0)); AddEvent(new tcGameCommandEvent(ID_SETBRIEFING, 18, 0)); AddEvent(new tcGameCommandEvent(ID_SET3D, 18, 1)); // deactivate 3D window ! //AddEvent(new tcMapViewEvent(24, -5.9, 49.5, 4.0)); } *************** *** 107,113 **** } ! tcDirector::tcDirector(tc3DViewer *view3D, tcMapView *mv, tcConsole *console , wxWindow *win) ! : mapView(mv), viewer(view3D) { tcConsoleTextEvent::AttachConsole(console); --- 115,121 ---- } ! tcDirector::tcDirector(tc3DViewer *view3D, tcConsole *console , wxWindow *win) ! : viewer(view3D) { tcConsoleTextEvent::AttachConsole(console); Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Game.cpp 21 Jun 2004 22:22:00 -0000 1.85 --- Game.cpp 24 Jun 2004 21:35:41 -0000 1.86 *************** *** 647,652 **** wxASSERT(director == NULL); wxASSERT(tacticalMap); wxASSERT(briefingConsoleLeft); ! director = new tcDirector(viewer, tacticalMap, briefingConsoleLeft, this); director->SetStartTime(0); director->InitTest(); // load test event sequence --- 647,655 ---- wxASSERT(director == NULL); wxASSERT(tacticalMap); + wxASSERT(worldMap); wxASSERT(briefingConsoleLeft); ! ! tcDirector::AttachMapViews(tacticalMap, worldMap); ! director = new tcDirector(viewer, briefingConsoleLeft, this); director->SetStartTime(0); director->InitTest(); // load test event sequence *************** *** 715,724 **** { mrectWorldMap = mrectMap; ! mrectWorldMap.left = mrectWorldMap.right - 256; ! mrectWorldMap.top = mrectWorldMap.bottom - 128; worldMap = new tcWorldMapView(glCanvas, wxPoint(mrectWorldMap.left, mrectWorldMap.top), ! wxSize(mrectWorldMap.right - mrectWorldMap.left, ! mrectWorldMap.bottom - mrectWorldMap.top)); if (!worldMap) --- 718,727 ---- { mrectWorldMap = mrectMap; ! mrectWorldMap.left = mrectWorldMap.right - 257; ! mrectWorldMap.top = mrectWorldMap.bottom - 129; worldMap = new tcWorldMapView(glCanvas, wxPoint(mrectWorldMap.left, mrectWorldMap.top), ! wxSize(mrectWorldMap.right - mrectWorldMap.left - 1, ! mrectWorldMap.bottom - mrectWorldMap.top - 1)); if (!worldMap) *************** *** 1776,1779 **** --- 1779,1788 ---- if (chatBox->mbActive) chatBox->MoveToTop(); return; + case 'w': // toggle world map size + if (worldMap) + { + worldMap->ToggleMapSize(); + } + return; case 'A': accelerateTime--; Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcMapView.cpp 24 Jun 2004 01:43:44 -0000 1.25 --- tcMapView.cpp 24 Jun 2004 21:35:41 -0000 1.26 *************** *** 331,335 **** * Draws tactical map grid */ ! void tcTacticalMapView::DrawGrid(Graphics *apGraphics) { float lat,lon; --- 331,335 ---- * Draws tactical map grid */ ! void tcTacticalMapView::DrawGrid(Gdiplus::Graphics *apGraphics) { float lat,lon; *************** *** 356,360 **** * Draws tactical map scale bar */ ! void tcTacticalMapView::DrawScaleBar(Graphics *apGraphics) { float fKmPerPel, fKmScale; --- 356,360 ---- * Draws tactical map scale bar */ ! void tcTacticalMapView::DrawScaleBar(Gdiplus::Graphics *apGraphics) { float fKmPerPel, fKmScale; *************** *** 389,393 **** /***********************************************************************************/ ! void tcTacticalMapView::DrawTerrainText(Graphics *apGraphics) { tcPoint p; float fTerrainHeight_m; --- 389,394 ---- /***********************************************************************************/ ! void tcTacticalMapView::DrawTerrainText(Gdiplus::Graphics *apGraphics) ! { tcPoint p; float fTerrainHeight_m; *************** *** 396,400 **** if (apGraphics==NULL) {return;} p = ScreenToGeo(mpointMouse); ! fTerrainHeight_m = mpMapData->GetTerrainHeightLowRes(C_180OVERPI*p.x,C_180OVERPI*p.y); char ns; --- 397,406 ---- if (apGraphics==NULL) {return;} p = ScreenToGeo(mpointMouse); ! //fTerrainHeight_m = mpMapData->GetTerrainHeightLowRes(C_180OVERPI*p.x,C_180OVERPI*p.y); ! ! /* replaced with high res lookup, note converted to deg and then back in ! ** tcMapData::GetTerrainHeightHighRes ! */ ! fTerrainHeight_m = mpMapData->GetTerrainHeightHighRes(C_180OVERPI*p.x, C_180OVERPI*p.y); char ns; *************** *** 1900,1908 **** Erase(); ! if (!GetGraphics(pGraphics)) { ! //WTL("Failed to get Graphics in tcWorldMapView::Draw()\n"); return 0; } /*** Draw grid ***/ //DrawGrid(pGraphics); --- 1906,1922 ---- Erase(); ! if (!GetGraphics(pGraphics)) ! { return 0; } + if (mnWidth == iconSize) + { + DrawIcon(pGraphics); + ReleaseGraphics(pGraphics); + DrawBorder(); + return 1; + } + /*** Draw grid ***/ //DrawGrid(pGraphics); *************** *** 1950,1953 **** --- 1964,1978 ---- } } + + /** + * Draws icon version of world map + * TODO Eventually this should be moved up as a general function + * of tcWindow with ability to minimize, maximize, and reposition + * the window. + */ + void tcWorldMapView::DrawIcon(Gdiplus::Graphics* graphics) + { + } + /***********************************************************************************/ void tcWorldMapView::DrawTheaterBox(Gdiplus::Graphics *apGraphics) *************** *** 2008,2011 **** --- 2033,2057 ---- SetView(p, C_PIOVER180*340.0f); } + + /** + * Posts message to change tactical map theater + */ + void tcWorldMapView::ChangeTheater(float lon_deg, float lat_deg) + { + // center on requested location + const float c1 = 0.5f * C_180OVERPI; + lon_deg -= c1 * mrectTheater.Width(); + lat_deg += c1 * mrectTheater.Height(); + + wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SETTHEATER) ; + command.SetEventObject(this); + long lon = long(lon_deg); + long lat = long(lat_deg); + + long coordField = (lat << 16) + (lon & 0xFFFF); + command.m_extraLong = coordField; + AddPendingEvent(command); + } + /***********************************************************************************/ void tcWorldMapView::OnLButtonDown(wxMouseEvent& event) *************** *** 2017,2033 **** tcPoint geoPoint = ScreenToGeo(point); // geopoint (lon,lat) in radians ! // center new theater on clicked location ! geoPoint.x -= 0.5f * mrectTheater.Width(); ! geoPoint.y += 0.5f * mrectTheater.Height(); ! ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SETTHEATER) ; ! command.SetEventObject(this); ! long lon = long(geoPoint.x * C_180OVERPI); ! long lat = long(geoPoint.y * C_180OVERPI); ! ! long coordField = (lat << 16) + (lon & 0xFFFF); ! command.m_extraLong = coordField; ! AddPendingEvent(command); ! tcSound::Get()->PlayEffect(SEFFECT_BEEP2); --- 2063,2067 ---- tcPoint geoPoint = ScreenToGeo(point); // geopoint (lon,lat) in radians ! ChangeTheater(C_180OVERPI * geoPoint.x, C_180OVERPI * geoPoint.y); tcSound::Get()->PlayEffect(SEFFECT_BEEP2); *************** *** 2076,2084 **** } ! /***********************************************************************************/ tcWorldMapView::tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name) { terrainView = new tcTerrainView(parent, pos, size, false); --- 2110,2134 ---- } ! /** ! * ! */ ! void tcWorldMapView::ToggleMapSize() ! { ! if (IsWindowMinimized()) ! { ! tcWindow::Maximize(); ! terrainView->Maximize(); ! } ! else ! { ! tcWindow::Minimize(); ! terrainView->Minimize(); ! } ! } ! tcWorldMapView::tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! tcMapView(parent, pos, size, name) { terrainView = new tcTerrainView(parent, pos, size, false); *************** *** 2089,2094 **** ClearMapObjects(); } ! /***********************************************************************************/ ! tcWorldMapView::~tcWorldMapView() { } --- 2139,2145 ---- ClearMapObjects(); } ! ! tcWorldMapView::~tcWorldMapView() ! { } Index: tcTerrainView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTerrainView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcTerrainView.cpp 24 Jun 2004 01:43:44 -0000 1.10 --- tcTerrainView.cpp 24 Jun 2004 21:35:41 -0000 1.11 *************** *** 47,50 **** --- 47,63 ---- } + /** + * If the terrain view is minimized always force + * abActive to false + */ + void tcTerrainView::SetActive(bool abActive) + { + if (IsWindowMinimized()) + { + tcWindow::SetActive(false); + } + tcWindow::SetActive(abActive); + } + /** * update display region of mp2DSurface *************** *** 164,167 **** --- 177,189 ---- } + /** + * call tcWindow::SetActive(false) on Minimize() + */ + void tcTerrainView::Minimize() + { + tcWindow::SetActive(false); + tcWindow::Minimize(); + } + int tcTerrainView::RefreshSurfaces() { Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDirectorEvent.cpp 29 Feb 2004 22:51:36 -0000 1.6 --- tcDirectorEvent.cpp 24 Jun 2004 21:35:41 -0000 1.7 *************** *** 67,77 **** /********** tcMapEvent ****************/ /** ! * @param map pointer to tcMapView window that event applies to * @param obj pointer to tcMapObject graphical map object */ ! tcMapEvent::tcMapEvent(tcMapView *map, tcMapObject *obj) ! : mapView(map), mapObject(obj), addedToMap(false) { } --- 67,90 ---- /********** tcMapEvent ****************/ + tcTacticalMapView* tcMapEvent::tacticalMapView = 0; + tcWorldMapView* tcMapEvent::worldMapView = 0; + + void tcMapEvent::AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv) + { + tacticalMapView = tmv; + worldMapView = wmv; + } + /** ! * static method tcMapEvent::AttachMapViews must be called first ! * ! * @see tcMapEvent::AttachMapViews * @param obj pointer to tcMapObject graphical map object */ ! tcMapEvent::tcMapEvent(tcMapObject *obj) ! : mapObject(obj), addedToMap(false) { + wxASSERT(tacticalMapView); + wxASSERT(worldMapView); } *************** *** 93,97 **** { wxASSERT(mapObject); ! mapView->AddMapObject(mapObject); addedToMap = true; } --- 106,110 ---- { wxASSERT(mapObject); ! tacticalMapView->AddMapObject(mapObject); addedToMap = true; } *************** *** 126,132 **** ! tcMapTextEvent::tcMapTextEvent(tcMapView *map, std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect) ! : tcMapEvent(map, new tcMapTextObject(text, lon_deg, lat_deg)) , tcDirectorEvent(startTime, endTime) { --- 139,145 ---- ! tcMapTextEvent::tcMapTextEvent(std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect) ! : tcMapEvent(new tcMapTextObject(text, lon_deg, lat_deg)) , tcDirectorEvent(startTime, endTime) { *************** *** 278,282 **** /*************** tcMapViewEvent ***************/ ! void tcMapViewEvent::Update(double t) { --- 291,303 ---- /*************** tcMapViewEvent ***************/ ! /** ! * For lonSpan_rad = 0 theater view is changed ! * via the world map ! * For lonSpan_rad > 0 the tactical map view is ! * changed. ! * ! * @see tcTacticalMapView::SetView ! * @see tcWorldMapView::ChangeTheater ! */ void tcMapViewEvent::Update(double t) { *************** *** 284,300 **** if (triggered) return; ! wxASSERT(mapView); tcPoint pCenter; pCenter.x = lon_rad; pCenter.y = lat_rad; ! mapView->SetView(pCenter,lonSpan_rad); triggered = true; } ! tcMapViewEvent::tcMapViewEvent(tcMapView *map, double t, double lon_deg, double lat_deg, double lonSpan_deg) ! : tcMapEvent(map, NULL) , tcDirectorEvent(t, t) { lon_rad = C_PIOVER180 * lon_deg; --- 305,330 ---- if (triggered) return; ! wxASSERT(tacticalMapView); ! wxASSERT(worldMapView); tcPoint pCenter; pCenter.x = lon_rad; pCenter.y = lat_rad; ! ! if (lonSpan_rad > 0) ! { ! tacticalMapView->SetView(pCenter, lonSpan_rad); ! } ! else ! { ! worldMapView->ChangeTheater(C_180OVERPI*lon_rad, C_180OVERPI*lat_rad); ! } triggered = true; } ! tcMapViewEvent::tcMapViewEvent(double t, double lon_deg, double lat_deg, double lonSpan_deg) ! : tcMapEvent(NULL) , tcDirectorEvent(t, t) { lon_rad = C_PIOVER180 * lon_deg; Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapData.cpp 24 Jun 2004 01:43:44 -0000 1.11 --- tcMapData.cpp 24 Jun 2004 21:35:41 -0000 1.12 *************** *** 392,395 **** --- 392,439 ---- void tcMapData::DarkenLowResUnavailable(UINT32* imageData) { + int M, N; + UINT32 nAlphaOffset = 0xFE000000; + M = M_LOWRES; + N = N_LOWRES; + int lowResScale = int(SCALE_LOWRES); + int lowResDemTileWidth = demTileReader->GetTileWidth() / K_DEC_LOWRES; + int lowResDemTileHeight = demTileReader->GetTileHeight() / K_DEC_LOWRES; + + wxASSERT(imageData); + if (imageData == NULL) {return;} + + for (int lat = -80; lat <= 90; lat += 10) + { + for (int lon = -180; lon <=170; lon += 10) + { + /* if tile is not available, darken corresponding area + ** of low res map + */ + if (!demTileReader->IsTileAvailable(lat, lon)) + { + int mstart = (90-lat) * lowResScale; + int nstart = (180+lon) * lowResScale; + for (int m = mstart; m < mstart + lowResDemTileHeight; m++) + { + for (int n = nstart; n < nstart + lowResDemTileWidth; n++) + { + unsigned long idx = (M-1-m)*N + n; + unsigned long red = ((imageData[idx] & 0x000000FF) / 4) + & 0x000000FF; + unsigned long green = ((imageData[idx] & 0x0000FF00) / 4) + & 0x0000FF00; + unsigned long blue = ((imageData[idx] & 0x00FF0000) / 4) + & 0x00FF0000; + unsigned long darkened = nAlphaOffset + red + green + blue; + + imageData[idx] = darkened; + } + } + } + } + + } + + fprintf(stdout, "tcMapData - Darkened unavailable tiles\n"); } *************** *** 891,896 **** fMain.Close(); ! mrTheaterView.Set(C_PIOVER180*afStartLon_deg,C_PIOVER180*(afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(afStartLat_deg-RESHIGH_DEG*M_HIGHRES),C_PIOVER180*(afStartLat_deg)); tcString s; --- 935,947 ---- fMain.Close(); ! mrTheaterView.Set(C_PIOVER180*afStartLon_deg, ! C_PIOVER180*(afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(afStartLat_deg-RESHIGH_DEG*M_HIGHRES), ! C_PIOVER180*(afStartLat_deg)); ! ! theaterViewDeg.Set(afStartLon_deg, ! (afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! (afStartLat_deg-RESHIGH_DEG*M_HIGHRES), ! afStartLat_deg); tcString s; *************** *** 962,969 **** mrTheaterView.Set(C_PIOVER180*startLon_deg, ! C_PIOVER180*(startLon_deg+RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(startLat_deg-RESHIGH_DEG*M_HIGHRES), C_PIOVER180*(startLat_deg)); fprintf(stdout, "tcMapData - LoadHighResB(lon %.1f, lat %.1f) - success\n", startLon_deg, startLat_deg); --- 1013,1025 ---- mrTheaterView.Set(C_PIOVER180*startLon_deg, ! C_PIOVER180*(startLon_deg + RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(startLat_deg - RESHIGH_DEG*M_HIGHRES), C_PIOVER180*(startLat_deg)); + theaterViewDeg.Set(startLon_deg, + (startLon_deg + RESHIGH_DEG*N_HIGHRES), + (startLat_deg - RESHIGH_DEG*M_HIGHRES), + startLat_deg); + fprintf(stdout, "tcMapData - LoadHighResB(lon %.1f, lat %.1f) - success\n", startLon_deg, startLat_deg); *************** *** 1039,1044 **** ! mrTheaterView.Set(C_PIOVER180*afStartLon_deg,C_PIOVER180*(afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(afStartLat_deg-RESHIGH_DEG*M_HIGHRES),C_PIOVER180*(afStartLat_deg)); tcString s; --- 1095,1107 ---- ! mrTheaterView.Set(C_PIOVER180*afStartLon_deg, ! C_PIOVER180*(afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! C_PIOVER180*(afStartLat_deg-RESHIGH_DEG*M_HIGHRES), ! C_PIOVER180*(afStartLat_deg)); ! ! theaterViewDeg.Set(afStartLon_deg, ! (afStartLon_deg+RESHIGH_DEG*N_HIGHRES), ! (afStartLat_deg-RESHIGH_DEG*M_HIGHRES), ! afStartLat_deg); tcString s; *************** *** 1168,1176 **** } */ ! if (anMapID==0) { ! //LabelLowRes(); // TODO: add country and geopol labels } ! WTL("tcMapData - CreateMapImage - success"); } --- 1231,1243 ---- } */ ! // for low res map, darken the unavailable tiles ! if (anMapID == 0) ! { ! DarkenLowResUnavailable(apData); } ! //LabelLowRes(); // TODO: add country and geopol labels ! ! fprintf(stdout, "tcMapData - CreateMapImage - success\n"); } *************** *** 1363,1373 **** WTL("tcMapData - CreateHighResMapImage - success"); } ! /********************************************************************/ ! // low resolution version ! float tcMapData::GetTerrainHeightLowRes(float afLon_deg, float afLat_deg) { float fm,fn,fmfloor,fnfloor,fmrem,fnrem; int m1,n1,m2,n2; ! ConformLonLatDeg(afLon_deg,afLat_deg); fm = (90.0f-afLat_deg)*SCALE_LOWRES; fn = (afLon_deg+180.0f)*SCALE_LOWRES; --- 1430,1496 ---- WTL("tcMapData - CreateHighResMapImage - success"); } ! ! /** ! * Uses the high res map to get the terrain height. This does ! * not use the 0.5 x 0.5 tiles and will not load tiles to cache ! * map data. ! * @see tcMapData::GetTerrainHeight ! * @see tcMapData::GetTerrainHeightLowRes ! * ! * @return terrain height based on high resolution world map ! */ ! float tcMapData::GetTerrainHeightHighRes(float afLon_deg, float afLat_deg) ! { float fm,fn,fmfloor,fnfloor,fmrem,fnrem; int m1,n1,m2,n2; ! ConformLonLatDeg(afLon_deg, afLat_deg); ! ! if (!mrTheaterView.ContainsPoint(C_PIOVER180*afLon_deg, ! C_PIOVER180*afLat_deg)) ! { ! static unsigned errCount = 0; ! if (errCount++ < 16) ! { ! fprintf(stderr, "GetTerrainHeightHighRes - " ! "point out of theater\n"); ! } ! return -999.0f; ! } ! ! float theaterWestLon_deg = theaterViewDeg.left; ! float theaterNorthLat_deg = theaterViewDeg.top; ! ! ! fm = (theaterNorthLat_deg-afLat_deg)*SCALE_HIGHRES; ! fn = (afLon_deg-theaterWestLon_deg)*SCALE_HIGHRES; ! fmfloor = floorf(fm); ! fnfloor = floorf(fn); ! fmrem = fm - fmfloor; ! fnrem = fn - fnfloor; ! ! m1 = (int)fmfloor; ! n1 = (int)fnfloor; ! m2 = (m1+1); ! m2 %= M_HIGHRES; ! n2 = (n1+1); ! n2 %= N_HIGHRES; ! ! return ((1.0f-fmrem)*(1.0f-fnrem)*(float)maTheater[m1][n1]) + ! ((1.0f-fmrem)*(fnrem)*(float)maTheater[m1][n2]) + ! ((fmrem)*(1.0f-fnrem)*(float)maTheater[m2][n1]) + ! ((fmrem)*(fnrem)*(float)maTheater[m2][n2]); ! } ! ! ! /** ! * @return terrain height based on low resolution world map ! */ ! float tcMapData::GetTerrainHeightLowRes(float afLon_deg, float afLat_deg) ! { ! float fm,fn,fmfloor,fnfloor,fmrem,fnrem; ! int m1,n1,m2,n2; ! ! ConformLonLatDeg(afLon_deg, afLat_deg); fm = (90.0f-afLat_deg)*SCALE_LOWRES; fn = (afLon_deg+180.0f)*SCALE_LOWRES; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/include/sim Modified Files: tcDirector.h tcDirectorEvent.h tcMapData.h tcMapView.h tcTerrainView.h Log Message: Index: tcDirector.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcDirector.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcDirector.h 29 Feb 2004 22:51:35 -0000 1.5 --- tcDirector.h 24 Jun 2004 21:35:40 -0000 1.6 *************** *** 34,43 **** class tc3DViewer; namespace MapView { ! class tcMapView; } ! using MapView::tcMapView; /** --- 34,47 ---- class tc3DViewer; + namespace MapView { ! class tcTacticalMapView; ! class tcWorldMapView; } ! using MapView::tcTacticalMapView; ! using MapView::tcWorldMapView; ! /** *************** *** 57,69 **** void ClearEvents(); void InitTest(); ///< initializes director with a series of hard-coded events to help test ! tcMapView* GetMapView() {return mapView;} ! void SetMapView(tcMapView *mv) {mapView = mv;} void SetStartTime(double t) {startTime = t;} ///< Sets reference time for events void Update(double t); ! tcDirector(tc3DViewer *view3D, tcMapView *mv, tcConsole *console, wxWindow *win); ~tcDirector(); private: ! tcMapView *mapView; ///< tcMapView object for map events (only one supported currently) tc3DViewer *viewer; ////< tc3DViewer object for camera events }; --- 61,75 ---- void ClearEvents(); void InitTest(); ///< initializes director with a series of hard-coded events to help test ! //tcMapView* GetMapView() {return mapView;} ! //void SetMapView(tcMapView *mv) {mapView = mv;} void SetStartTime(double t) {startTime = t;} ///< Sets reference time for events void Update(double t); ! static void AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv); ! ! tcDirector(tc3DViewer *view3D, tcConsole *console, wxWindow *win); ~tcDirector(); private: ! //tcMapView *mapView; ///< tcMapView object for map events (only one supported currently) tc3DViewer *viewer; ////< tc3DViewer object for camera events }; Index: tcDirectorEvent.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcDirectorEvent.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDirectorEvent.h 29 Feb 2004 22:51:35 -0000 1.6 --- tcDirectorEvent.h 24 Jun 2004 21:35:40 -0000 1.7 *************** *** 36,40 **** namespace MapView { ! class tcMapView; } --- 36,41 ---- namespace MapView { ! class tcTacticalMapView; ! class tcWorldMapView; } *************** *** 52,56 **** } ! using MapView::tcMapView; /** * Base class for time-tagged camera or game events to support cut scenes and --- 53,59 ---- } ! using MapView::tcTacticalMapView; ! using MapView::tcWorldMapView; ! /** * Base class for time-tagged camera or game events to support cut scenes and *************** *** 83,92 **** { public: ! tcMapEvent(tcMapView *map, tcMapObject *obj); virtual ~tcMapEvent(); protected: bool addedToMap; ///< true if mapObject has been added to map tcMapObject *mapObject; ! tcMapView* const mapView; }; --- 86,99 ---- { public: ! static void AttachMapViews(tcTacticalMapView* tmv, tcWorldMapView* wmv); ! ! tcMapEvent(tcMapObject *obj); virtual ~tcMapEvent(); protected: bool addedToMap; ///< true if mapObject has been added to map tcMapObject *mapObject; ! ! static tcTacticalMapView* tacticalMapView; ! static tcWorldMapView* worldMapView; }; *************** *** 102,106 **** virtual void Update(double t); ! tcMapTextEvent(tcMapView *map, std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect); virtual ~tcMapTextEvent(); --- 109,113 ---- virtual void Update(double t); ! tcMapTextEvent(std::string text, double startTime, double endTime, double lon_deg, double lat_deg, int effect); virtual ~tcMapTextEvent(); *************** *** 119,124 **** virtual void Update(double t); ! tcMapViewEvent(tcMapView *map, double t, ! double lon_deg, double lat_deg, double lonSpan_deg); virtual ~tcMapViewEvent(); }; --- 126,130 ---- virtual void Update(double t); ! tcMapViewEvent(double t, double lon_deg, double lat_deg, double lonSpan_deg); virtual ~tcMapViewEvent(); }; Index: tcTerrainView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcTerrainView.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcTerrainView.h 20 Mar 2004 18:46:46 -0000 1.5 --- tcTerrainView.h 24 Jun 2004 21:35:40 -0000 1.6 *************** *** 57,62 **** --- 57,64 ---- int LoadHighResSurface(); int LoadLowResSurface(); + void Minimize(); int RefreshSurfaces(); ///< reloads terrain data to map view int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); + void SetActive(bool abActive); void SetView(tcGeoRect r); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcMapView.h 21 Jun 2004 22:21:59 -0000 1.20 --- tcMapView.h 24 Jun 2004 21:35:40 -0000 1.21 *************** *** 351,365 **** int mnCounter; int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! int Draw(void); ! void DrawGrid(Gdiplus::Graphics *apGraphics); void DrawTheaterBox(Gdiplus::Graphics *apGraphics); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(void); ! void Init(void); virtual void SetActive(bool abActive); void SetTheater(tcGeoRect r) {mrectTheater = r;} tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, --- 351,369 ---- int mnCounter; + void ChangeTheater(float lon_deg, float lat_deg); int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! int Draw(); ! void DrawGrid(Gdiplus::Graphics* apGraphics); ! void DrawIcon(Gdiplus::Graphics* graphics); void DrawTheaterBox(Gdiplus::Graphics *apGraphics); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(); ! void Init(); virtual void SetActive(bool abActive); void SetTheater(tcGeoRect r) {mrectTheater = r;} + void ToggleMapSize(); + tcWorldMapView(wxWindow *parent, const wxPoint& pos, const wxSize& size, Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMapData.h 24 Jun 2004 01:43:43 -0000 1.7 --- tcMapData.h 24 Jun 2004 21:35:40 -0000 1.8 *************** *** 3,6 **** --- 3,8 ---- ** ** Header for the tcMapData class. + ** Documentation http://www.ngdc.noaa.gov/seg/topo/report/ + ** Georeferencing info: http://www.ngdc.noaa.gov/seg/topo/report/s5/s5Biii.html ** ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) *************** *** 117,120 **** --- 119,123 ---- float minAlt = -16000.0f, float maxAlt = 16000.0f); float GetTerrainHeight(float afLon_deg, float afLat_deg, double afStatusTime); + float GetTerrainHeightHighRes(float afLon_deg, float afLat_deg); float GetTerrainHeightLowRes(float afLon_deg, float afLat_deg); void GetTheaterArea(tcGeoRect& r) {r = mrTheaterView;} *************** *** 146,149 **** --- 149,153 ---- short maTheater[M_HIGHRES][N_HIGHRES]; tcGeoRect mrTheaterView; ///< geo bounds of loaded theater (high res) map + tcRect theaterViewDeg; ///< theater boundaries in degrees tcGeoRect mrWorldView; ///< bounds of loaded world (low res) map HPEN mhPenBox; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/src/scriptinterface Modified Files: tcScenarioInterface.cpp Log Message: Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcScenarioInterface.cpp 27 Apr 2004 22:18:52 -0000 1.10 --- tcScenarioInterface.cpp 24 Jun 2004 21:35:40 -0000 1.11 *************** *** 156,159 **** --- 156,160 ---- // text console and map events .def("ChangeMapView",&tcScenarioInterface::ChangeMapView) + .def("ChangeMapTheater",&tcScenarioInterface::ChangeMapTheater) .def("ConsoleText",&tcScenarioInterface::ConsoleText) .def("MapText",&tcScenarioInterface::MapText) *************** *** 464,467 **** --- 465,483 ---- // text console and map events + /** + * Changes tactical map theater. The theater is the high resolution view + * area that is accessible from the tactical map. + * + * @param lon_deg longitude in deg for center of new theater + * @param lat_deg latitude in deg for center of new theater + */ + void tcScenarioInterface::ChangeMapTheater(double lon_deg, double lat_deg) + { + wxASSERT(director); + + // tcMapViewEvent with lonSpan_deg = 0 is used for theater change + director->AddEvent(new tcMapViewEvent(eventTime, + lon_deg, lat_deg, 0)); + } /** *************** *** 474,480 **** { wxASSERT(director); ! tcMapView *mapView = director->GetMapView(); ! wxASSERT(mapView); ! director->AddEvent(new tcMapViewEvent(mapView, eventTime, lon_deg, lat_deg, lonSpan_deg)); } --- 490,495 ---- { wxASSERT(director); ! ! director->AddEvent(new tcMapViewEvent(eventTime, lon_deg, lat_deg, lonSpan_deg)); } *************** *** 483,487 **** { wxASSERT(director); ! director->AddEvent(new tcConsoleTextEvent(text,eventTime)); } --- 498,502 ---- { wxASSERT(director); ! director->AddEvent(new tcConsoleTextEvent(text, eventTime)); } *************** *** 490,497 **** { wxASSERT(director); - tcMapView *mapView = director->GetMapView(); - wxASSERT(mapView); ! director->AddEvent(new tcMapTextEvent(mapView,text,eventTime,eventTime+duration, lon_deg, lat_deg, effect)); } --- 505,510 ---- { wxASSERT(director); ! director->AddEvent(new tcMapTextEvent(text, eventTime, eventTime+duration, lon_deg, lat_deg, effect)); } |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CHANGES.txt 24 Jun 2004 01:43:43 -0000 1.23 --- CHANGES.txt 24 Jun 2004 21:35:39 -0000 1.24 *************** *** 3,6 **** --- 3,13 ---- 0.6 --------------------------------------------------------------------- + *** 2004-06-24 Dewitt Colclough *** + - Missing tile areas of world map are darkened (bright areas show + areas with available map data. + - Switched tactical map terrain height display to use high res data. + Before it was using low res world map data that had significant error. + + *** 2004-06-23 Dewitt Colclough *** - Converted map system to use 10 x 10 deg DEM tiles. Game will run with |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738 Modified Files: .cvsignore ReleaseInstallScript.nsi Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/.cvsignore,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** .cvsignore 30 Nov 2003 23:31:25 -0000 1.10 --- .cvsignore 24 Jun 2004 21:35:39 -0000 1.11 *************** *** 10,11 **** --- 10,13 ---- *.ilk csv_test.cpp + gcb_06x_.exe + dist \ No newline at end of file Index: ReleaseInstallScript.nsi =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/ReleaseInstallScript.nsi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReleaseInstallScript.nsi 24 Jun 2004 01:43:43 -0000 1.1 --- ReleaseInstallScript.nsi 24 Jun 2004 21:35:39 -0000 1.2 *************** *** 1,5 **** ; GCB.nsi ; ! ; This script is based on example2.nsi -- it remember the directory, ; has uninstall support and (optionally) installs start menu shortcuts. ; --- 1,5 ---- ; GCB.nsi ; ! ; This script is based on example2.nsi -- it remembers the directory, ; has uninstall support and (optionally) installs start menu shortcuts. ; *************** *** 81,84 **** --- 81,89 ---- File "maps\*.dat" + ; ----- maps\tiles directory ----- + SetOutPath $INSTDIR\maps\tiles + + File "maps\tiles\*.dat" + ; ----- scenarios directory ----- SetOutPath $INSTDIR\scenarios |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/include/graphics Modified Files: tcWindow.h Log Message: Index: tcWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcWindow.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcWindow.h 21 Jun 2004 22:21:43 -0000 1.3 --- tcWindow.h 24 Jun 2004 21:35:39 -0000 1.4 *************** *** 79,86 **** --- 79,91 ---- bool IsActive() const {return mbActive;} bool IsSurfaceModified(); + virtual bool IsWindowMinimized() const; void LoadBackgroundImage(char *azFileName); Gdiplus::Image* LoadImage(const char *fileName); + virtual void Maximize(); + virtual void Minimize(); void MoveToTop(); ///< moves window to top + void MoveWindow(int ax, int ay); void SetBackground(UINT32 anColor); + bool GetBlend(); void SetBlend(bool blendingOn); *************** *** 90,94 **** void SetDisplayRegion(Gdiplus::RectF r); tc2DGraphicsSurface* GetSurface() const {return mp2DSurface;} ! void MoveWindow(int ax, int ay); bool GetDrawDC(HDC& hdc); bool ReleaseDrawDC(HDC hdc); --- 95,99 ---- void SetDisplayRegion(Gdiplus::RectF r); tc2DGraphicsSurface* GetSurface() const {return mp2DSurface;} ! bool GetDrawDC(HDC& hdc); bool ReleaseDrawDC(HDC hdc); *************** *** 127,134 **** bool mbCloned; bool mbFrozen; ! virtual int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); virtual int DeleteSurfaces(tcGraphicsEngine* apGraphicsEngine); WCHAR* PrependImagePath(const char *azFileName); virtual void OnChar(wxKeyEvent& event); --- 132,142 ---- bool mbCloned; bool mbFrozen; ! wxRect normalPosition; ///< normal, non-minimized pos of window ! wxRect iconPosition; ///< minimized, icon pos of window ! const int iconSize; virtual int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); virtual int DeleteSurfaces(tcGraphicsEngine* apGraphicsEngine); + WCHAR* PrependImagePath(const char *azFileName); virtual void OnChar(wxKeyEvent& event); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/src/graphics Modified Files: tcWindow.cpp Log Message: Index: tcWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcWindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcWindow.cpp 19 Jun 2004 22:00:28 -0000 1.4 --- tcWindow.cpp 24 Jun 2004 21:35:40 -0000 1.5 *************** *** 210,213 **** --- 210,214 ---- } + /** * @return pointer to WCHAR array (string) with IMAGE_PATH prepended, *************** *** 516,519 **** --- 517,548 ---- } + /** + * + */ + void tcWindow::Maximize() + { + if (!IsWindowMinimized()) return; // already maximized + + wxWindow::SetSize(normalPosition); + } + + /** + * + */ + void tcWindow::Minimize() + { + if (IsWindowMinimized()) return; // already minimized + + wxWindow::SetSize(iconPosition); + } + + /** + * Called IsWindowMinimized to avoid possible conflict + * with wxWindows::IsMinimized + */ + bool tcWindow::IsWindowMinimized() const + { + return mnWidth == iconSize; + } bool tcWindow::IsSurfaceModified() *************** *** 666,670 **** const wxString& name, tcWindow *sharedSurfaceHost) : wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN ! mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { wxWindow::SetBackgroundColour(*wxBLACK); --- 695,701 ---- const wxString& name, tcWindow *sharedSurfaceHost) : wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN ! mnHeight(size.GetHeight()), mnWidth(size.GetWidth()), ! iconSize(32), ! normalPosition(pos, size) { wxWindow::SetBackgroundColour(*wxBLACK); *************** *** 677,681 **** mrectWindow.top = pos.y; mrectWindow.bottom = pos.y + size.GetHeight(); ! mpiBackground = NULL; mbFrozen = false; --- 708,720 ---- mrectWindow.top = pos.y; mrectWindow.bottom = pos.y + size.GetHeight(); ! ! /* need to update to create default icon position as a ! ** function of initial window position ! */ ! iconPosition = wxRect(normalPosition.GetRight() - iconSize, ! normalPosition.GetBottom() - iconSize, ! iconSize, ! iconSize); ! mpiBackground = NULL; mbFrozen = false; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 21:35:49
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23738/include/scriptinterface Modified Files: tcScenarioInterface.h Log Message: Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcScenarioInterface.h 27 Apr 2004 22:03:01 -0000 1.9 --- tcScenarioInterface.h 24 Jun 2004 21:35:39 -0000 1.10 *************** *** 110,113 **** --- 110,114 ---- // text console and map events + void ChangeMapTheater(double lon_deg, double lat_deg); void ChangeMapView(double lon_deg, double lat_deg, double lonSpan_deg); void ConsoleText(std::string text); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 15:34:38
|
Update of /cvsroot/gcblue/gcb_wx/maps/tiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7478/maps/tiles Added Files: placeholder.txt Log Message: --- NEW FILE: placeholder.txt --- dummy file to fill this folder |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 14:45:49
|
Update of /cvsroot/gcblue/gcb_wx/maps/tiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30241/tiles Log Message: Directory /cvsroot/gcblue/gcb_wx/maps/tiles added to the repository |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 01:43:57
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454 Modified Files: GCblue.vcproj Added Files: ReleaseInstallScript.nsi Log Message: --- NEW FILE: ReleaseInstallScript.nsi --- ; GCB.nsi ; ; This script is based on example2.nsi -- it remember the directory, ; has uninstall support and (optionally) installs start menu shortcuts. ; ; It will install files into a directory that the user selects, ;-------------------------------- ; The name of the installer Name "install_gcb_06x" ; The file to write OutFile "gcb_06x_.exe" ; The default installation directory InstallDir $PROGRAMFILES\GCB ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM "Software\GCB" "Install_Dir" ;-------------------------------- LicenseText "End User License Agreement" LicenseData "END_USER_LICENSE.txt" ; Pages Page license Page components Page directory Page instfiles UninstPage uninstConfirm UninstPage instfiles ;-------------------------------- ; The stuff to install Section "GCB (required)" SectionIn RO ; ----- 3d directory ----- SetOutPath $INSTDIR\3d File "dist\3d\*.*" ; ----- bin directory ----- SetOutPath $INSTDIR\bin File "dist\release_dll\*.*" File "bin\GCblue.exe" ; ----- database directory ----- SetOutPath $INSTDIR\database File "dist\database\*.*" ; ----- help directory ----- SetOutPath $INSTDIR\help File "help\*.*" ; ----- images directory ----- SetOutPath $INSTDIR\images File "images\*.jpg" File "images\*.bmp" ; ----- images\symbology directory ----- SetOutPath $INSTDIR\images\symbology File "images\symbology\*.png" ; ----- maps directory ----- SetOutPath $INSTDIR\maps File "maps\*.dat" ; ----- scenarios directory ----- SetOutPath $INSTDIR\scenarios File "scenarios\*.py" ; ----- scripts directory ----- SetOutPath $INSTDIR\scripts File "scripts\*.py" ; ----- sound\ogg directory ----- SetOutPath $INSTDIR\sound\ogg File "sound\ogg\*.ogg" ; ----- sound\wav directory ----- SetOutPath $INSTDIR\sound\wav File "sound\wav\*.wav" ; ----- xml directory ----- SetOutPath $INSTDIR\xml File "xml\*.xml" ; ----- general ----- SetOutPath $INSTDIR File "options.dat" File "END_USER_LICENSE.txt" CreateShortCut "Play GCB.lnk" "$INSTDIR\bin\GCblue.exe" "" "$INSTDIR\bin\GCblue.exe" 0 ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\GCB "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GCB" "DisplayName" "Global Conflict Blue 0.6x" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GCB" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GCB" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GCB" "NoRepair" 1 WriteUninstaller "uninstall.exe" SectionEnd ; Optional section (can be disabled by the user) Section "Start Menu Shortcuts" CreateDirectory "$SMPROGRAMS\GCB" CreateShortCut "$SMPROGRAMS\GCB\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\GCB\Play GCB.lnk" "$INSTDIR\bin\GCblue.exe" "" "$INSTDIR\bin\GCblue.exe" 0 SectionEnd ; Optional section (can be disabled by the user) Section /o "Install with sound disabled" SetOutPath $INSTDIR\xml File /oname=options.xml "xml\options_nosound.txt" SectionEnd ;-------------------------------- ; Uninstaller Section "Uninstall" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GCB" DeleteRegKey HKLM SOFTWARE\NSIS_GCB ; Remove files and uninstaller Delete $INSTDIR\bin\*.* Delete $INSTDIR\uninstall.exe ; Remove shortcuts, if any Delete "$SMPROGRAMS\GCB\*.*" ; Remove directories used RMDir "$SMPROGRAMS\GCB" RMDir /r "$INSTDIR" SectionEnd Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** GCblue.vcproj 14 Jun 2004 21:52:46 -0000 1.55 --- GCblue.vcproj 24 Jun 2004 01:43:43 -0000 1.56 *************** *** 362,365 **** --- 362,368 ---- </File> <File + RelativePath=".\src\sim\tcDemTileReader.cpp"> + </File> + <File RelativePath="src\sim\tcDirector.cpp"> </File> *************** *** 759,762 **** --- 762,768 ---- </File> <File + RelativePath=".\include\sim\tcDemTileReader.h"> + </File> + <File RelativePath="include\sim\tcDirector.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 01:43:57
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/include/sim Modified Files: tcMapData.h tcUserInfo.h Added Files: tcDemTileReader.h Log Message: Index: tcUserInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcUserInfo.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcUserInfo.h 19 Nov 2003 01:36:14 -0000 1.3 --- tcUserInfo.h 24 Jun 2004 01:43:43 -0000 1.4 *************** *** 29,33 **** --- 29,35 ---- #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions + #endif class tcUserInfo --- NEW FILE: tcDemTileReader.h --- /** ** @file tcDemTileReader.h ** ** Header for the tcDemTileReader.h class. ** ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if !defined _TCDEMTILEREADER_H_ #define _TCDEMTILEREADER_H_ #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif #include "tcFile.h" #include <map> /** * Class to read and keep track of which DEM tiles are available */ class tcDemTileReader { public: enum { M_DEMTILE = 1200, N_DEMTILE = 1200 }; int GetTileWidth() const {return N_DEMTILE;} int GetTileHeight() const {return M_DEMTILE;} bool IsTileAvailable(int lat, int lon); void LoadDemTile(tcFile& tileFile, int lat_deg, int lon_deg); tcDemTileReader(); ~tcDemTileReader(); private: tcString mzDemPath; std::map<long, bool> tileStatus; void GetTileName(wxString& nameString, int lat_deg, int lon_deg); void KeyToLatLon(long key, int& lat, int& lon); long LatLonToKey(int lat, int lon); void MarkTileUnavailable(int lat, int lon); void ScanTiles(); }; #endif Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapData.h 21 Jun 2004 22:21:59 -0000 1.6 --- tcMapData.h 24 Jun 2004 01:43:43 -0000 1.7 *************** *** 48,53 **** #define M_TILE 60 #define N_TILE 60 ! #define M_DEMTILE 1200 ! #define N_DEMTILE 1200 #define NULL_TILE 0xFFFF #define TILE_AGEOUT (double)30.0 --- 48,53 ---- #define M_TILE 60 #define N_TILE 60 ! //#define M_DEMTILE 1200 ! //#define N_DEMTILE 1200 #define NULL_TILE 0xFFFF #define TILE_AGEOUT (double)30.0 *************** *** 57,60 **** --- 57,62 ---- #define ME(x) ReportMapDataError(x); + class tcDemTileReader; + struct tsDemInfo { *************** *** 100,104 **** class tcMapData { ! public: void AgeOutTiles(double afStatusTime); void AttachOptions(tcOptions *pOptions) {mpOptions=pOptions;mnCurrentMapMode=pOptions->mnMapMode;} --- 102,110 ---- class tcMapData { ! public: ! enum ! { ! MISSING_DATA_VAL = -32383 ! }; void AgeOutTiles(double afStatusTime); void AttachOptions(tcOptions *pOptions) {mpOptions=pOptions;mnCurrentMapMode=pOptions->mnMapMode;} *************** *** 132,136 **** tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; ! tcString mzDemPath; int GetLowResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); int GetHighResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); --- 138,142 ---- tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; ! int GetLowResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); int GetHighResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); *************** *** 144,148 **** long maPalette1[1024]; int mnCurrentMapMode; ///< versus requested map mode in options ! bool mbUseDefaultMap; unsigned short maTileLookup[M_TILE_LOOKUP][N_TILE_LOOKUP]; // 506k lookup table, 0.5 deg tiles --- 150,155 ---- long maPalette1[1024]; int mnCurrentMapMode; ///< versus requested map mode in options ! ! tcDemTileReader* demTileReader; unsigned short maTileLookup[M_TILE_LOOKUP][N_TILE_LOOKUP]; // 506k lookup table, 0.5 deg tiles *************** *** 153,163 **** unsigned short mnReturnIndex; ///< maAvailableTiles index for deallocation tsTileData* GetTile(unsigned mtile, unsigned ntile, double afStatusTime); ! void LoadDemTile(tcFile& tileFile, int lat_deg, int lon_deg); tsTileData* LoadTile(unsigned mtile, unsigned ntile); tsTileData* LoadTileB(unsigned mtile, unsigned ntile); void CreatePalettes(); ! void GetTileName(wxString& nameString, int lat_deg, int lon_deg); void LabelLowRes(); int ReadHighResData(int M, int N, int mstart, int nstart, tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); --- 160,175 ---- unsigned short mnReturnIndex; ///< maAvailableTiles index for deallocation tsTileData* GetTile(unsigned mtile, unsigned ntile, double afStatusTime); ! tsTileData* LoadTile(unsigned mtile, unsigned ntile); tsTileData* LoadTileB(unsigned mtile, unsigned ntile); + tsTileData* LoadTileFromLowRes(unsigned mtile, unsigned ntile); + void CreatePalettes(); ! void DarkenLowResUnavailable(UINT32* imageData); void LabelLowRes(); + + void FillInvalidHighResData(int M, int N, int mstart, int nstart, + tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); int ReadHighResData(int M, int N, int mstart, int nstart, tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); *************** *** 165,168 **** --- 177,181 ---- tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); int ReadHighResDataDefault(int M, int N, int mstart, int nstart,tcFile *pMain); + void ReportMapDataError(UINT32 anError); void SetDemInfo(); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 01:43:57
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/src/sim Modified Files: tcMapData.cpp tcMapView.cpp tcTerrainView.cpp Added Files: tcDemTileReader.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcMapView.cpp 21 Jun 2004 22:22:00 -0000 1.24 --- tcMapView.cpp 24 Jun 2004 01:43:44 -0000 1.25 *************** *** 1929,1933 **** } /***********************************************************************************/ ! void tcWorldMapView::DrawGrid(Graphics *apGraphics) { float lat,lon; tcPoint pgeo,pscreen; --- 1929,1934 ---- } /***********************************************************************************/ ! void tcWorldMapView::DrawGrid(Gdiplus::Graphics *apGraphics) ! { float lat,lon; tcPoint pgeo,pscreen; *************** *** 1950,1954 **** } /***********************************************************************************/ ! void tcWorldMapView::DrawTheaterBox(Graphics *apGraphics) { float width,height; --- 1951,1955 ---- } /***********************************************************************************/ ! void tcWorldMapView::DrawTheaterBox(Gdiplus::Graphics *apGraphics) { float width,height; *************** *** 1958,1963 **** mpMapData->GetTheaterArea(mrectTheater); // for box to indicate theater area - mpPen->SetColor(Color(0xFFFFFFFF)); // TODO: centralized color selection structure - p1.x = mrectTheater.left; p1.y = mrectTheater.bottom; --- 1959,1962 ---- *************** *** 1968,1975 **** width = p2.x - p1.x; height = p1.y - p2.y; ! apGraphics->DrawRectangle(mpPen,p1.x,p2.y,width,height); } /***********************************************************************************/ ! int tcWorldMapView::DrawSymbol(Graphics *apGraphics, tsWorldMapObj *pMO) { tcPoint pscreen; RectF rclipbounds; --- 1967,1978 ---- width = p2.x - p1.x; height = p1.y - p2.y; ! ! Pen* pen = (width > 16.0f) ? mpPen : mpPenThin; ! pen->SetColor(Color(0xFFFFFFFF)); // TODO: centralized color selection structure ! ! apGraphics->DrawRectangle(pen, p1.x, p2.y, width, height); } /***********************************************************************************/ ! int tcWorldMapView::DrawSymbol(Gdiplus::Graphics *apGraphics, tsWorldMapObj *pMO) { tcPoint pscreen; RectF rclipbounds; *************** *** 2013,2016 **** --- 2016,2023 ---- tcSound::Get()->PlayEffect(SEFFECT_BEEP2); tcPoint geoPoint = ScreenToGeo(point); // geopoint (lon,lat) in radians + + // center new theater on clicked location + geoPoint.x -= 0.5f * mrectTheater.Width(); + geoPoint.y += 0.5f * mrectTheater.Height(); wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SETTHEATER) ; Index: tcTerrainView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTerrainView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcTerrainView.cpp 20 Mar 2004 18:46:47 -0000 1.9 --- tcTerrainView.cpp 24 Jun 2004 01:43:44 -0000 1.10 *************** *** 156,161 **** mp2DSurface->GetBits(pBits); wxASSERT(pBits != NULL); ! mpMapData->CreateHighResMapImage(mpOptions->mnMapMode, pBits); ! mp2DSurface->mbModified = true; mp2DSurface->SetRenderTexture(mbTextureMaps); --- 156,161 ---- mp2DSurface->GetBits(pBits); wxASSERT(pBits != NULL); ! //mpMapData->CreateHighResMapImage(mpOptions->mnMapMode, pBits); ! mpMapData->CreateMapImage(mpOptions->mnMapMode, 1, pBits); // 1 for high res mp2DSurface->mbModified = true; mp2DSurface->SetRenderTexture(mbTextureMaps); Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcMapData.cpp 21 Jun 2004 22:22:00 -0000 1.10 --- tcMapData.cpp 24 Jun 2004 01:43:44 -0000 1.11 *************** *** 2,6 **** ** tcMapData.cpp ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** tcMapData.cpp ** ! ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. [...3406 lines suppressed...] //LoadHighResB(-1.0f, 12.0f); *************** *** 1758,1763 **** } /********************************************************************/ ! tcMapData::~tcMapData() { ! } /********************************************************************/ \ No newline at end of file --- 1981,1987 ---- } /********************************************************************/ ! tcMapData::~tcMapData() ! { ! delete demTileReader; } /********************************************************************/ \ No newline at end of file --- NEW FILE: tcDemTileReader.cpp --- /* ** @file tcDemTileReader.cpp ** ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef WX_PRECOMP #include "stdwx.h" #endif #include "tcDemTileReader.h" /** * Sets namestring to path + filename of 10 x 10 dem tile for northwest * point of (lat_deg, lon_deg). lat_deg and lon_deg must be multiples * of 10 to get a valid file name */ void tcDemTileReader::GetTileName(wxString& nameString, int lat_deg, int lon_deg) { wxASSERT(lat_deg % 10 == 0); wxASSERT(lon_deg % 10 == 0); nameString = mzDemPath.GetBuffer(); nameString += wxString::Format("%dx%d.dat", lat_deg, lon_deg); } bool tcDemTileReader::IsTileAvailable(int lat, int lon) { std::map<long, bool>::const_iterator mapIter; long key = LatLonToKey(lat, lon); mapIter = tileStatus.find(key); if (mapIter == tileStatus.end()) // not found { tcFile demTile; LoadDemTile(demTile, lat, lon); tileStatus[key] = demTile.IsOpen(); demTile.Close(); return tileStatus[key]; } else { return tileStatus[key]; } } void tcDemTileReader::KeyToLatLon(long key, int& lat, int& lon) { lon = (key / 256) - 180; lat = (key % 256) - 90; } long tcDemTileReader::LatLonToKey(int lat, int lon) { return (lat + 90) + 256 * (lon + 180); } /** * Loads 10 x 10 deg DEM tile specified by Northwest corner point * (lat_deg, lon_deg). If tile does not exist no load takes place. * @param lat_deg latitude of Northwest corner point in deg * @param lat_deg should be mult of 10 deg between -80 and 90 * @param lon_deg longitude of Northwest corner point in deg * @param lon_deg should be mult of 10 deg between -180 and 170 */ void tcDemTileReader::LoadDemTile(tcFile& tileFile, int lat_deg, int lon_deg) { //static int errorCount = 0; wxString demTileName; GetTileName(demTileName, lat_deg, lon_deg); if (tileFile.Open(demTileName.c_str(), tcFile::modeRead) ==0) { /* if ((errorCount < 10)||(errorCount++ % 100 == 0)) { fprintf(stderr, "Map tile not found: %s\n", demTileName.c_str()); } */ } } void tcDemTileReader::MarkTileUnavailable(int lat, int lon) { long key = LatLonToKey(lat, lon); tileStatus[key] = false; } void tcDemTileReader::ScanTiles() { int availCount = 0; for (int lat = -80; lat <= 90; lat += 10) { for (int lon = -180; lon <=170; lon += 10) { availCount += IsTileAvailable(lat, lon) ? 1 : 0; } } fprintf(stdout, "%d / %d map tiles available\n", availCount, 648); } tcDemTileReader::tcDemTileReader() { mzDemPath = "maps\\tiles\\"; ScanTiles(); } tcDemTileReader::~tcDemTileReader() { } |
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 01:43:56
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/src/graphics Modified Files: cspSky.cpp Log Message: Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** cspSky.cpp 11 Apr 2004 22:14:11 -0000 1.9 --- cspSky.cpp 24 Jun 2004 01:43:44 -0000 1.10 *************** *** 160,164 **** float phi, theta; for (i=0; i<n; i++) { ! float I = randf(); //_catalog->_stars[i].I; // C is used to reduce star color saturation as an // ad hoc approximation to human color vision response --- 160,164 ---- float phi, theta; for (i=0; i<n; i++) { ! float I = 0.5f * randf(); //_catalog->_stars[i].I; // C is used to reduce star color saturation as an // ad hoc approximation to human color vision response |