gcblue-commits Mailing List for Global Conflict Blue (Page 51)
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-06-24 01:43:56
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CHANGES.txt 14 Jun 2004 22:37:11 -0000 1.22 --- CHANGES.txt 24 Jun 2004 01:43:43 -0000 1.23 *************** *** 3,6 **** --- 3,16 ---- 0.6 --------------------------------------------------------------------- + *** 2004-06-23 Dewitt Colclough *** + - Converted map system to use 10 x 10 deg DEM tiles. Game will run with + missing tiles. This allows play in select but worldwide geographical + regions to keep demo download small. Raw tiles are 2.5 MB. The default + map was removed. + - Added world map window to select theater area for high res view. + Current selection is done with Ctrl+Shift+Leftclick. + - Added install script for Nullsoft installer + - Ship smoke effect is now displayed with damaged ships only + *** 2004-06-14 Dewitt Colclough *** - Added features and GUI to change display settings (screen resolution) |
|
From: Dewitt C. <ddc...@us...> - 2004-06-21 22:22:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20597/include/sim Modified Files: Game.h tcGameView.h tcMapData.h tcMapView.h Log Message: Index: tcGameView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameView.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGameView.h 7 Feb 2004 02:19:54 -0000 1.6 --- tcGameView.h 21 Jun 2004 22:21:59 -0000 1.7 *************** *** 61,65 **** * functionality is commented out for now. Some of it needs to be incorporated * into the ported version of the game with OSG e.g. displaying unknown objects. ! * */ class tcGameView --- 61,65 ---- * functionality is commented out for now. Some of it needs to be incorporated * into the ported version of the game with OSG e.g. displaying unknown objects. ! * Class has lots of old code that likely needs refactoring. */ class tcGameView Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Game.h 19 Jun 2004 22:00:27 -0000 1.40 --- Game.h 21 Jun 2004 22:21:43 -0000 1.41 *************** *** 244,247 **** --- 244,249 ---- void SetPauseMode(wxCommandEvent& event); void SetTacticalMapSize(teTacticalMapSize mapSize); + void SetTheater(wxCommandEvent& event); + void SetTheater(int lat_deg, int lon_deg); ///< sets theater view center void SetTimeAccel(wxCommandEvent& event); void ShiftTime(float delta_s); ///< shifts time for sky/environment updates Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMapView.h 3 Apr 2004 20:24:33 -0000 1.19 --- tcMapView.h 21 Jun 2004 22:21:59 -0000 1.20 *************** *** 190,194 **** tcPoint ScreenToGeo(wxPoint pscreen); tcPoint ScreenToGeo(float x, float y); ! void SetActive(bool abActive); ///< overrides base class void SetSize(const wxRect& rect); void SetView(tcPoint center, float afLonSpan); --- 190,194 ---- tcPoint ScreenToGeo(wxPoint pscreen); tcPoint ScreenToGeo(float x, float y); ! virtual void SetActive(bool abActive); ///< overrides base class void SetSize(const wxRect& rect); void SetView(tcPoint center, float afLonSpan); *************** *** 298,301 **** --- 298,302 ---- void OnMouseWheel(wxMouseEvent& event); void OnRButtonDown(wxMouseEvent& event); + void Refresh(); void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} *************** *** 359,362 **** --- 360,364 ---- void ClearMapObjects(void); void Init(void); + virtual void SetActive(bool abActive); void SetTheater(tcGeoRect r) {mrectTheater = r;} tcWorldMapView(wxWindow *parent, Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapData.h 20 Jun 2004 14:59:52 -0000 1.5 --- tcMapData.h 21 Jun 2004 22:21:59 -0000 1.6 *************** *** 91,94 **** --- 91,101 ---- #define DEFAULT_TILE_NAME "defaulttile.dat" + /** + * This class interfaces to 30 arc-sec DEM map data. + * A cache of 0.5 x 0.5 deg tiles is used. Methods are provided + * to create images for map terrain view display. Several different + * generations of code are jumbled together here. This sorely + * needs refactoring. + */ class tcMapData { *************** *** 146,154 **** 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); ! void CreatePalettes(void); ! void LabelLowRes(void); int ReadHighResData(int M, int N, int mstart, int nstart, tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); --- 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); *************** *** 157,162 **** int ReadHighResDataDefault(int M, int N, int mstart, int nstart,tcFile *pMain); void ReportMapDataError(UINT32 anError); ! void SetDemInfo(void); ! void InitTiles(void); }; --- 166,171 ---- int ReadHighResDataDefault(int M, int N, int mstart, int nstart,tcFile *pMain); void ReportMapDataError(UINT32 anError); ! void SetDemInfo(); ! void InitTiles(); }; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-21 22:22:22
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20597/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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcWindow.h 11 Apr 2004 21:45:39 -0000 1.2 --- tcWindow.h 21 Jun 2004 22:21:43 -0000 1.3 *************** *** 77,80 **** --- 77,81 ---- virtual void Freeze(); wxBitmap* GetBitmap(); + bool IsActive() const {return mbActive;} bool IsSurfaceModified(); void LoadBackgroundImage(char *azFileName); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-21 22:22:22
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20597/include/common Modified Files: tcFile.h wxcommands.h Log Message: Index: wxcommands.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/wxcommands.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxcommands.h 14 Jun 2004 21:52:47 -0000 1.15 --- wxcommands.h 21 Jun 2004 22:21:42 -0000 1.16 *************** *** 42,45 **** --- 42,46 ---- ID_SETPAUSE = 100, ///< enable/disable game pause ID_SETTIMEACCEL = 102, ///< more general version of ID_SETPAUSE + ID_SETTHEATER = 105, ///< change theater view area for tactical map ID_SET3D = 110, ///< set 3D window size ID_SKIPBRIEFING = 120, ///< skip tactical briefing Index: tcFile.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcFile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcFile.h 28 Mar 2004 11:28:37 -0000 1.5 --- tcFile.h 21 Jun 2004 22:21:42 -0000 1.6 *************** *** 45,48 **** --- 45,49 ---- long GetLength(); ///< size of file in bytes long GetLengthFromCurrent(); ///< size from current pos to end of file in bytes + bool IsOpen() const; int Read(void *apData, unsigned int anCount); ///< TODO add operator>> for this int ReadString(char *s); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-21 22:22:16
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20597/src/sim Modified Files: Game.cpp tcGameView.cpp tcMapData.cpp tcMapView.cpp tcPopupControl.cpp tcSurfaceObject.cpp Log Message: Index: tcSurfaceObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSurfaceObject.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcSurfaceObject.cpp 4 Jun 2004 21:39:23 -0000 1.10 --- tcSurfaceObject.cpp 21 Jun 2004 22:22:00 -0000 1.11 *************** *** 106,110 **** if (model) { ! model->SetSmokeMode(tcParticleEffect::DAMAGE); model->UpdateEffects(); } --- 106,117 ---- if (model) { ! if (mfDamageLevel > 0.1f) ! { ! model->SetSmokeMode(tcParticleEffect::DAMAGE); ! } ! else ! { ! model->SetSmokeMode(tcParticleEffect::OFF); ! } model->UpdateEffects(); } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Game.cpp 19 Jun 2004 22:00:28 -0000 1.84 --- Game.cpp 21 Jun 2004 22:22:00 -0000 1.85 *************** *** 87,90 **** --- 87,91 ---- EVT_COMMAND(ID_SETPAUSE, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SetPauseMode) EVT_COMMAND(ID_SETTIMEACCEL, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SetTimeAccel) + EVT_COMMAND(ID_SETTHEATER, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SetTheater) EVT_COMMAND(ID_SET3D, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::Set3D) EVT_COMMAND(ID_SKIPBRIEFING, wxEVT_COMMAND_BUTTON_CLICKED, tcGame::SkipBriefing) *************** *** 445,449 **** mcMapData.AttachOptions(tcOptions::Get()); mcMapData.LoadLowRes(); ! mcMapData.LoadHighRes(-8.0f, 55.0f); // added mapdata reference to tcGameObject to allow RandInit() // to place objects at legal positions and to set altitude appropriately --- 446,452 ---- mcMapData.AttachOptions(tcOptions::Get()); mcMapData.LoadLowRes(); ! //mcMapData.LoadHighRes(-8.0f, 55.0f); ! mcMapData.LoadHighResB(-8.0f, 55.0f); ! // added mapdata reference to tcGameObject to allow RandInit() // to place objects at legal positions and to set altitude appropriately *************** *** 912,915 **** --- 915,919 ---- mcGameView.AttachSimState(simState); mcGameView.AttachMapView(tacticalMap); + mcGameView.AttachWorldMapView(worldMap); mcGameView.AttachUserInfo(&mcUserInfo); mcGameView.AttachOptions(tcOptions::Get()); *************** *** 1038,1041 **** --- 1042,1071 ---- /** + * wxWidgets event to call SetTheater + * extralong variable contains lat and lon, + * lowest 16 bits is longitude, next 16 bits is + * latitude, both in units of degrees. + */ + void tcGame::SetTheater(wxCommandEvent& event) + { + short int lon_deg = event.m_extraLong & 0xFFFF; + short int lat_deg = (event.m_extraLong >> 16) & 0xFFFF; + + SetTheater(lat_deg, lon_deg); + } + + /** + * Sets theater view center for tacticalMap. + */ + void tcGame::SetTheater(int lat_deg, int lon_deg) + { + mcMapData.LoadHighResB(float(lon_deg), float(lat_deg)); + if (tacticalMap) + { + tacticalMap->Refresh(); + } + } + + /** * Time acceleration mode change using a wxWindows event. * This is a more general version of SetPauseMode Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcMapView.cpp 19 Jun 2004 22:00:28 -0000 1.23 --- tcMapView.cpp 21 Jun 2004 22:22:00 -0000 1.24 *************** *** 183,188 **** } ! /***********************************************************************************/ ! // need to be modified to handle wrapped coordinates int tcMapView::PointInView(tcPoint& p) { --- 183,189 ---- } ! /** ! * needs to be modified to handle wrapped coordinates ! */ int tcMapView::PointInView(tcPoint& p) { *************** *** 190,193 **** --- 191,197 ---- (p.y >= mrectCurrentView.bottom)&&(p.y <= mrectCurrentView.top); } + + + /** * override of wxWindow::SetSize so that terrainView->SetSize is called as well *************** *** 242,246 **** tcWindow::SetActive(abActive); terrainView->SetActive(abActive); - wxWindow::Raise(); // without this, the world map view wasn't receiving mouse cmds } /***********************************************************************************/ --- 246,249 ---- *************** *** 1532,1536 **** mpMapData->GetTheaterArea(mrectViewBounds); // restrict view to theater area ! SetView(p,C_PIOVER180*32.0f); // Build symbologies BuildNTDS(); --- 1535,1539 ---- mpMapData->GetTheaterArea(mrectViewBounds); // restrict view to theater area ! SetView(p, C_PIOVER180*32.0f); // Build symbologies BuildNTDS(); *************** *** 1539,1542 **** --- 1542,1562 ---- /** + * Updates view bounds, sets current view to center, and refreshes (reloads) + * terrain view. + * This should be called after the map data theater area is changed. + */ + void tcTacticalMapView::Refresh() + { + wxASSERT(mpMapData); + + mpMapData->GetTheaterArea(mrectViewBounds); // restrict view to theater area + + tcPoint center(mrectViewBounds.XCenter(), mrectViewBounds.YCenter()); + SetView(center, C_PIOVER180*32.0f); + + RefreshTerrainView(); + } + + /** * OnLeaveWindow event handler */ *************** *** 1873,1876 **** --- 1893,1898 ---- int i; + mpMapData->GetTheaterArea(mrectTheater); // update box to indicate theater area + // done here to avoid artifacts from terrainview being out of sync with mapview terrainView->SetView(mrectCurrentView); *************** *** 1889,1894 **** } /**********************/ ! for(i=0;(i<(int)mnObjCount)&&(i<MAXWORLDMAPOBJ);i++) { ! if (maMapObj[i].mbExists) { DrawSymbol(pGraphics,&maMapObj[i]); } --- 1911,1918 ---- } /**********************/ ! for(i=0;(i<(int)mnObjCount)&&(i<MAXWORLDMAPOBJ);i++) ! { ! if (maMapObj[i].mbExists) ! { DrawSymbol(pGraphics,&maMapObj[i]); } *************** *** 1985,1989 **** { wxPoint point = event.GetPosition(); ! if (event.ControlDown()) { if (mfLonWidth > 30.0f*C_PIOVER180) --- 2009,2030 ---- { wxPoint point = event.GetPosition(); ! if (event.ControlDown() && event.ShiftDown()) ! { ! tcSound::Get()->PlayEffect(SEFFECT_BEEP2); ! tcPoint geoPoint = ScreenToGeo(point); // geopoint (lon,lat) in radians ! ! 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); ! } ! else if (event.ControlDown()) { if (mfLonWidth > 30.0f*C_PIOVER180) *************** *** 2018,2021 **** --- 2059,2072 ---- mpointMouse = point; // TranslatePoint(point); } + + /** + * + */ + void tcWorldMapView::SetActive(bool abActive) + { + if (!IsActive()) wxWindow::Raise(); + tcMapView::SetActive(abActive); + } + /***********************************************************************************/ tcWorldMapView::tcWorldMapView(wxWindow *parent, Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPopupControl.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcPopupControl.cpp 4 Jan 2004 22:24:53 -0000 1.5 --- tcPopupControl.cpp 21 Jun 2004 22:22:00 -0000 1.6 *************** *** 186,189 **** --- 186,190 ---- } SetActive(true); + wxWindow::Raise(); mpointUpperLeft = point; // MoveWindow(point.x,point.y - (mpMenu->GetSize()-1)*mnItemHeight); // adjust mrectWindow to new popup menu location Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcMapData.cpp 20 Jun 2004 14:59:53 -0000 1.9 --- tcMapData.cpp 21 Jun 2004 22:22:00 -0000 1.10 *************** *** 222,225 **** --- 222,239 ---- } + /** + * 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 tcMapData::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); + } + /********************************************************************/ // TODO: fix *************** *** 803,807 **** * point (startLon_deg, startLat_deg) * Uses newer 10 x 10 deg DEM tile system - * Forces the corner to a tile boundary */ void tcMapData::LoadHighResB(float startLon_deg, float startLat_deg) --- 817,820 ---- *************** *** 809,815 **** ConformLonLatDeg(startLon_deg, startLat_deg); ! // force corner point to a tile boundary ! startLon_deg = 0.5f * floorf(startLon_deg / 0.5f); ! startLat_deg = 0.5f * floorf(startLat_deg / 0.5f); } --- 822,870 ---- ConformLonLatDeg(startLon_deg, startLat_deg); ! float minLat_deg = -90.0f + M_HIGHRES * RESHIGH_DEG; ! if (startLat_deg < minLat_deg) startLat_deg = minLat_deg; ! ! // truncate to 0.5 deg multiple ! float n_lat_tiles = floorf(startLat_deg / 0.5f); ! float n_lon_tiles = floorf(startLon_deg / 0.5f); ! ! startLat_deg = 0.5f * n_lat_tiles; ! startLon_deg = 0.5f * n_lon_tiles; ! ! int northLat = 10 * (int)ceilf(startLat_deg / 10.0f); ! int southLat = northLat - 10; ! int westLon = 10 * (int)floorf(startLon_deg / 10.0f); ! int eastLon = westLon + 10; ! if (eastLon >= 180) eastLon -= 360; ! ! int lat_offset = ((180 - int(n_lat_tiles)) % 20) * 60; ! int lon_offset = ((int(n_lon_tiles) + 360) % 20) * 60; ! ! fprintf(stdout, "LoadHighResB - (%.1f x %.1f) -> N (%d) S (%d) W (%d) E(%d)\n", ! startLat_deg, startLon_deg, northLat, southLat, westLon, eastLon); ! ! // load DEM tile files ! tcFile tileNW, tileSW, tileNE, tileSE; ! LoadDemTile(tileNW, northLat, westLon); ! LoadDemTile(tileSW, southLat, westLon); ! LoadDemTile(tileNE, northLat, eastLon); ! LoadDemTile(tileSE, southLat, eastLon); ! ! ReadHighResData2(M_DEMTILE, N_DEMTILE, lat_offset, lon_offset, ! &tileNW, &tileNE, &tileSW, &tileSE); ! ! tileNW.Close(); ! tileSW.Close(); ! tileNE.Close(); ! tileSE.Close(); ! ! 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); ! } *************** *** 1155,1167 **** ((fmrem)*(fnrem)*(float)maGlobal[m2][n2]); } ! /********************************************************************/ ! // high resolution terrain height (unless out of tiles) ! // TODO: consider changing this to use tiles that overlap (1 point border) to simplify the edge case ! float tcMapData::GetTerrainHeight(float afLon_deg, float afLat_deg, double afStatusTime) { float fm,fn,fmfloor,fnfloor,fmrem,fnrem; float h11,h12,h21,h22; long m1,n1,m2,n2,mtile,ntile; tsTileData *pTile, *pTileE, *pTileS, *pTileSE; ! enum _bcasetype { NORMAL, EAST_WEST, --- 1210,1232 ---- ((fmrem)*(fnrem)*(float)maGlobal[m2][n2]); } ! ! /** ! * Gets high resolution terrain height based on 30 arc-sec DEM ! * data. If high res data is not available, the low resolution map ! * is used instead. ! * This will call GetTile which first checks a cache of 0.5 x 0.5 deg ! * map "tiles". ! * TODO: consider changing this to use tiles that overlap (1 point border) ! * to simplify the edge case ! * @see tcMapData:GetTile ! */ ! float tcMapData::GetTerrainHeight(float afLon_deg, float afLat_deg, double afStatusTime) ! { float fm,fn,fmfloor,fnfloor,fmrem,fnrem; float h11,h12,h21,h22; long m1,n1,m2,n2,mtile,ntile; tsTileData *pTile, *pTileE, *pTileS, *pTileSE; ! enum _bcasetype ! { NORMAL, EAST_WEST, *************** *** 1171,1175 **** eeBorderCase = NORMAL; ! ConformLonLatDeg(afLon_deg,afLat_deg); fm = (90.0f-afLat_deg)*SCALE_HIGHRES; fn = (afLon_deg+180.0f)*SCALE_HIGHRES; --- 1236,1240 ---- eeBorderCase = NORMAL; ! ConformLonLatDeg(afLon_deg, afLat_deg); fm = (90.0f-afLat_deg)*SCALE_HIGHRES; fn = (afLon_deg+180.0f)*SCALE_HIGHRES; *************** *** 1186,1195 **** n1 -= ntile*N_TILE; m2 = (m1+1); ! if (m2==M_TILE) { m2=0; eeBorderCase = NORTH_SOUTH; } n2 = (n1+1); ! if (n2==N_TILE) { n2=0; eeBorderCase = (eeBorderCase==NORMAL) ? EAST_WEST : ALL_FOUR; --- 1251,1262 ---- n1 -= ntile*N_TILE; m2 = (m1+1); ! if (m2==M_TILE) ! { m2=0; eeBorderCase = NORTH_SOUTH; } n2 = (n1+1); ! if (n2==N_TILE) ! { n2=0; eeBorderCase = (eeBorderCase==NORMAL) ? EAST_WEST : ALL_FOUR; *************** *** 1197,1209 **** pTile = GetTile(mtile,ntile,afStatusTime); ! if (pTile==NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } ! if (eeBorderCase != NORMAL) { h11 = (float)pTile->maMapData[m1][n1]; ! if (eeBorderCase == NORTH_SOUTH) { pTileS = GetTile(mtile+1,ntile,afStatusTime); ! if (pTileS == NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); --- 1264,1280 ---- pTile = GetTile(mtile,ntile,afStatusTime); ! if (pTile==NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } ! if (eeBorderCase != NORMAL) ! { h11 = (float)pTile->maMapData[m1][n1]; ! if (eeBorderCase == NORTH_SOUTH) ! { pTileS = GetTile(mtile+1,ntile,afStatusTime); ! if (pTileS == NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); *************** *** 1213,1219 **** h22 = (float)pTileS->maMapData[m2][n2]; } ! if (eeBorderCase == EAST_WEST) { pTileE = GetTile(mtile,ntile+1,afStatusTime); ! if (pTileE == NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); --- 1284,1292 ---- h22 = (float)pTileS->maMapData[m2][n2]; } ! if (eeBorderCase == EAST_WEST) ! { pTileE = GetTile(mtile,ntile+1,afStatusTime); ! if (pTileE == NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); *************** *** 1223,1239 **** h22 = (float)pTileE->maMapData[m2][n2]; } ! if (eeBorderCase == ALL_FOUR) { pTileSE = GetTile(mtile+1,ntile+1,afStatusTime); ! if (pTileSE == NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } pTileS = GetTile(mtile+1,ntile,afStatusTime); ! if (pTileS == NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } pTileE = GetTile(mtile,ntile+1,afStatusTime); ! if (pTileE == NULL) { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); --- 1296,1316 ---- h22 = (float)pTileE->maMapData[m2][n2]; } ! if (eeBorderCase == ALL_FOUR) ! { pTileSE = GetTile(mtile+1,ntile+1,afStatusTime); ! if (pTileSE == NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } pTileS = GetTile(mtile+1,ntile,afStatusTime); ! if (pTileS == NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); } pTileE = GetTile(mtile,ntile+1,afStatusTime); ! if (pTileE == NULL) ! { ReportMapDataError(ME_GENERIC); return GetTerrainHeightLowRes(afLon_deg, afLat_deg); *************** *** 1244,1248 **** } } ! else { h11 = (float)pTile->maMapData[m1][n1]; h12 = (float)pTile->maMapData[m1][n2]; --- 1321,1326 ---- } } ! else ! { h11 = (float)pTile->maMapData[m1][n1]; h12 = (float)pTile->maMapData[m1][n2]; *************** *** 1261,1265 **** //if (fHeight > -20.0f) {fHeight += 20.0f*sinf(100.0f*fnrem);} // test roughness function? ! if (fHeight == 0) { ReportMapDataError(ME_GENERIC); } --- 1339,1344 ---- //if (fHeight > -20.0f) {fHeight += 20.0f*sinf(100.0f*fnrem);} // test roughness function? ! if (fHeight == 0) ! { ReportMapDataError(ME_GENERIC); } *************** *** 1339,1342 **** --- 1418,1445 ---- } /** + * 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 tcMapData::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()); + } + } + } + + /** * Loads 0.5 x 0.5 deg (default) tile from larger DEM tiles * @return populated tsTileData* or NULL if missing DEM data *************** *** 1487,1499 **** float fStartLon_deg = (float)ntile*SCALE_LOOKUP - 180.0f; ! wxString demTileName = mzDemPath.GetBuffer(); ! demTileName += wxString::Format("%dx%d.dat", lat_val, lon_val); ! ! if (demTile.Open(demTileName.c_str(), tcFile::modeRead) ==0) { - if (errorReports++ % 100 == 0) - { - fprintf(stderr, "Map tile not found: %s\n", demTileName.c_str()); - } return NULL; } --- 1590,1596 ---- float fStartLon_deg = (float)ntile*SCALE_LOOKUP - 180.0f; ! LoadDemTile(demTile, lat_val, lon_val); ! if (!demTile.IsOpen()) { return NULL; } *************** *** 1655,1658 **** --- 1752,1759 ---- s.Format("tcMapData size: %d kB",sizeof(tcMapData)/1024); WTL(s.GetBuffer()); + + //LoadHighResB(-1.0f, 12.0f); + //LoadHighResB(-89.0f, 175.0f); + } /********************************************************************/ Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcGameView.cpp 3 Apr 2004 20:24:33 -0000 1.9 --- tcGameView.cpp 21 Jun 2004 22:22:00 -0000 1.10 *************** *** 440,443 **** --- 440,447 ---- #endif + /** + * This method adds populated tcMapObj objects to the tactical and + * world map views. This is called once per frame. Needs refactoring. + */ void tcGameView::Update(double afStatusTime) { *************** *** 455,464 **** UINT8 nOtherAlliance = (nOwnAlliance == 1) ? 2 : 1; ! AddTruthTracks(nOwnAlliance,nMapObj,nWorldMapObj,FRIENDLY); ! if (nViewMode<2) { ! AddTruthTracks(nOtherAlliance,nMapObj,nWorldMapObj,HOSTILE); } ! if (nViewMode!=1) { ! AddSensorTracks(nOwnAlliance,nMapObj,nWorldMapObj,afStatusTime); } --- 459,470 ---- UINT8 nOtherAlliance = (nOwnAlliance == 1) ? 2 : 1; ! AddTruthTracks(nOwnAlliance, nMapObj, nWorldMapObj, FRIENDLY); ! if (nViewMode < 2) ! { ! AddTruthTracks(nOtherAlliance, nMapObj, nWorldMapObj, HOSTILE); } ! if (nViewMode != 1) ! { ! AddSensorTracks(nOwnAlliance, nMapObj, nWorldMapObj, afStatusTime); } *************** *** 470,485 **** tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj); tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(mpHookedObj); ! if (pPlatformObj != NULL) { tnPoolIndex nTarget = pPlatformObj->mcAI.GetTarget(); ! if (nTarget != NULL_INDEX) { bShowTarget = mpSS->mcSensorMap.GetTrack(nTarget, track, nOwnAlliance); } } ! else if ((pMissileObj != NULL)&&(pMissileObj->mnAlliance == nOwnAlliance)) { bShowTarget = mpSS->GetSeekerTrack(mnHookID,track) != 0; } ! if(bShowTarget) { tcTrack predictedtrack; track.GetPrediction(predictedtrack,afStatusTime); --- 476,495 ---- tcPlatformObject *pPlatformObj = dynamic_cast<tcPlatformObject*>(mpHookedObj); tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(mpHookedObj); ! if (pPlatformObj != NULL) ! { tnPoolIndex nTarget = pPlatformObj->mcAI.GetTarget(); ! if (nTarget != NULL_INDEX) ! { bShowTarget = mpSS->mcSensorMap.GetTrack(nTarget, track, nOwnAlliance); } } ! else if ((pMissileObj != NULL)&&(pMissileObj->mnAlliance == nOwnAlliance)) ! { bShowTarget = mpSS->GetSeekerTrack(mnHookID,track) != 0; } ! if (bShowTarget) ! { tcTrack predictedtrack; track.GetPrediction(predictedtrack,afStatusTime); *************** *** 504,508 **** tsOCSymbolList* pSymbolInfo; mpObjectControl->GetSymbols(pSymbolInfo); ! for(unsigned i=0;(i<pSymbolInfo->mnSymbols)&&(i<MAX_OCSYMBOLS)&&(nMapObj<MAXMAPOBJ);i++) { tcMapObj* pMO = &mpMapView->maMapObj[nMapObj++]; --- 514,520 ---- tsOCSymbolList* pSymbolInfo; mpObjectControl->GetSymbols(pSymbolInfo); ! for(unsigned i=0; ! (i<pSymbolInfo->mnSymbols)&&(i<MAX_OCSYMBOLS)&&(nMapObj<MAXMAPOBJ); ! i++) { tcMapObj* pMO = &mpMapView->maMapObj[nMapObj++]; *************** *** 524,528 **** mpMapView->mnObjCount = nMapObj; ! //* mpWorldMapView->mnObjCount = nWorldMapObj; // --------------- --- 536,540 ---- mpMapView->mnObjCount = nMapObj; ! mpWorldMapView->mnObjCount = nWorldMapObj; // --------------- *************** *** 538,542 **** } /******************************************************************************/ ! // add truth data to view for objects matching anAlliance void tcGameView::AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation) --- 550,556 ---- } /******************************************************************************/ ! /** ! * add truth data to view for objects matching anAlliance ! */ void tcGameView::AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation) *************** *** 574,578 **** int bAllianceMatch = (po->mnAlliance == anAlliance); ! if (bAllianceMatch&&(mpMapView->PointInView(point))&&(rnIndex < MAXMAPOBJ)) { mpSS->mpDatabase->mcObjectData.Lookup(po->mnDBKey,pdata); mpMapView->maMapObj[rnIndex].mbExists = 1; --- 588,593 ---- int bAllianceMatch = (po->mnAlliance == anAlliance); ! if (bAllianceMatch&&(mpMapView->PointInView(point))&&(rnIndex < MAXMAPOBJ)) ! { mpSS->mpDatabase->mcObjectData.Lookup(po->mnDBKey,pdata); mpMapView->maMapObj[rnIndex].mbExists = 1; *************** *** 587,592 **** rnIndex++; } ! #if 0 ! if (bAllianceMatch&&(mpWorldMapView->PointInView(point))&&(rnWorldIdx < MAXWORLDMAPOBJ)) { mpSS->mpDatabase->mcObjectData.Lookup(po->mnDBKey,pdata); mpWorldMapView->maMapObj[rnWorldIdx].mbExists = 1; --- 602,610 ---- rnIndex++; } ! ! bool updateWorldMap = mpWorldMapView && mpWorldMapView->IsActive() && ! mpWorldMapView->PointInView(point); ! if (updateWorldMap && bAllianceMatch && (rnWorldIdx < MAXWORLDMAPOBJ)) ! { mpSS->mpDatabase->mcObjectData.Lookup(po->mnDBKey,pdata); mpWorldMapView->maMapObj[rnWorldIdx].mbExists = 1; *************** *** 597,601 **** rnWorldIdx++; } ! #endif } --- 615,619 ---- rnWorldIdx++; } ! } *************** *** 612,615 **** --- 630,634 ---- tcSensorMapTrack *pSMTrack; int i = 0; + unsigned int nColor; while((i++<nSize)&&(rnIndex < MAXMAPOBJ)) *************** *** 647,650 **** --- 666,701 ---- mpMapView->maMapObj[rnIndex].mfLat = track.mfLat_rad; mpMapView->maMapObj[rnIndex].mnID = track.mnID; + + tcPoint point(track.mfLon_rad, track.mfLat_rad); + + bool updateWorldMap = mpWorldMapView && mpWorldMapView->IsActive() && + mpWorldMapView->PointInView(point); + if (updateWorldMap && (rnWorldIdx < MAXWORLDMAPOBJ)) + { + switch (affil) + { + case UNKNOWN: + nColor = 0xFFFFFF7F; + break; + case FRIENDLY: + nColor = 0xFF7DDDFF; + break; + case NEUTRAL: + nColor = 0xFFAAFFAA; + break; + case HOSTILE: + nColor = 0xFFFF8080; + break; + } + + mpWorldMapView->maMapObj[rnWorldIdx].mbExists = 1; + mpWorldMapView->maMapObj[rnWorldIdx].mnColor = nColor; + mpWorldMapView->maMapObj[rnWorldIdx].mfLon = track.mfLon_rad; + mpWorldMapView->maMapObj[rnWorldIdx].mfLat = track.mfLat_rad; + mpWorldMapView->maMapObj[rnWorldIdx].mnID = track.mnID; + rnWorldIdx++; + } + + /* tcGameObject *ptemp; |
|
From: Dewitt C. <ddc...@us...> - 2004-06-21 22:22:13
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20597/src/common Modified Files: tcFile.cpp Log Message: Index: tcFile.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcFile.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcFile.cpp 19 Oct 2003 17:46:01 -0000 1.3 --- tcFile.cpp 21 Jun 2004 22:21:59 -0000 1.4 *************** *** 81,84 **** --- 81,92 ---- } + /** + * @return true if file is opened + */ + bool tcFile::IsOpen() const + { + return mpFile != NULL; + } + int tcFile::Read(void *apData, unsigned int anCount) { |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 21:23:51
|
Update of /cvsroot/gcblue/gcblue.com/script_tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26405/script_tutorial Added Files: buildunitmenu1.jpg menu1.jpg menu2.jpg script_directory.jpg script_exmenu.htm script_exmenu2.htm script_exmenu3.htm script_intro.htm script_location.htm Log Message: --- NEW FILE: script_exmenu3.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/stut.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><strong><em>Popup menu scripting (continued)</em></strong></font></p> <p><font face="Arial, Helvetica, sans-serif">The ReverseOurCourse script can be added to the Menu.py file, but to keep it with the other unit command scripts we will add it to the UnitCommands.py file. </font></p> <p><font face="Arial, Helvetica, sans-serif">Lets add it at the end after the ToggleRadars script. To reverse course, first we get the current heading of the platform, and then we set a new heading that is 180 degrees away. In script form this looks like this:</font></p> <pre><font face="Courier New, Courier, mono">def ReverseOurCourse(UI): current_heading = UI.GetHeading() # get current heading in degrees UI.SetHeading(current_heading + 180) # set new heading 180 deg away</font></pre> <p><font face="Arial, Helvetica, sans-serif">The UI parameter is a PlatformInterface object for the current hooked unit. It serves as the interface to the game engine script methods such as GetHeading and SetHeading. Menu items added with the AddItem method will always have command scripts of this form i.e. "def <command name>(UI):" . Any parameter name can be used for the PlatformInterface object as long as it is consistent throughout the body of the script function, e.g. </font></p> <pre><font face="Courier New, Courier, mono">def ReverseOurCourse(UnitInfo): current_heading = UnitInfo.GetHeading() # get current heading in degrees UnitInfo.SetHeading(current_heading + 180) # set new heading 180 deg away</font></pre> <p><font face="Arial, Helvetica, sans-serif">is also okay.</font></p> <p><font face="Arial, Helvetica, sans-serif">After saving the updated UnitCommands.py file, the "Reverse course" menu command should now work.</font></p> <p> </p> <pre> </pre> <p> </p> <p> </p> <!-- InstanceEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="script_intro.htm">Scripting intro</a> - <a href="script_location.htm">Script files</a> - Menu scripts <a href="script_exmenu.htm">1</a> <a href="script_exmenu2.htm">2</a> <a href="script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> <!-- InstanceEnd --></html> --- NEW FILE: script_intro.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/stut.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><strong><em>GCB Scripting Overview</em></strong></font></p> <p><font face="Arial, Helvetica, sans-serif">Python (<a href="http://python.org">www.python.org</a>) is embedded into GCB for scripting using the <a href="http://www.boost.org/libs/python/doc/index.html">Boost Python</a> library. This allows text script files to be used and modified to control game behavior. Currently scripts are used for two functions:</font></p> <ul> <li> <font face="Arial, Helvetica, sans-serif">Interface definition - Customization of game menus and some interfaces.</font></li> <li><font face="Arial, Helvetica, sans-serif">AI behavior - Description of behavior of game units through a set of rules and doctrines</font></li> </ul> <p><font face="Arial, Helvetica, sans-serif">To learn more about Python and how to write scripts in Python see <a href="http://www.python.org/topics/learn/">http://www.python.org/topics/learn/</a> . </font></p> <p><font face="Arial, Helvetica, sans-serif">Script files can be opened and edited in any text editor; however, downloading and using the Python IDLE editor is recommended to make the job a little easier. The IDLE editor is included with the <a href="http://www.python.org/2.3.3/">Python release download</a>. Since GCB embeds Python within the application, the main Python binaries are not required.</font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif"><a href="script_location.htm">Next page >><em> </em></a></font></p> <p><em><br> </em></p> <p> <code><em><var><font size="-1"></font></var></em></code></p> <!-- InstanceEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="script_intro.htm">Scripting intro</a> - <a href="script_location.htm">Script files</a> - Menu scripts <a href="script_exmenu.htm">1</a> <a href="script_exmenu2.htm">2</a> <a href="script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> <!-- InstanceEnd --></html> --- NEW FILE: script_directory.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: script_location.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/stut.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><strong><em>Script location</em></strong></font></p> <p><font face="Arial, Helvetica, sans-serif">Scripts are located under the scripts directory. In the directory there will be .py and .pyc files. The .py files are the text script files. The .pyc files are compiled versions of the .py file. Python automatically generates and updates these. </font></p> <p><font face="Arial, Helvetica, sans-serif">For GCB 0.5.1 the script directory looks like this:</font></p> <p align="center"><img src="script_directory.jpg" width="464" height="314"></p> <p align="left"><font face="Arial, Helvetica, sans-serif">The script files are summarized in this table:</font></p> <table width="50%" border="0" align="center"> <tr> <td width="44%"><em><strong><font face="Arial, Helvetica, sans-serif">Script file</font></strong></em></td> <td width="56%"><em><strong><font face="Arial, Helvetica, sans-serif">Function</font></strong></em></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">AI.py</font></td> <td><font face="Arial, Helvetica, sans-serif">AI scripts</font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">FlightPort.py</font></td> <td><font face="Arial, Helvetica, sans-serif">Flight deck panel interface definition</font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">HotKey.py</font></td> <td><font face="Arial, Helvetica, sans-serif">HotKey definitions</font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">Menu.py</font></td> <td><font face="Arial, Helvetica, sans-serif">Popup menu definition</font></td> </tr> <tr> <td><font face="Arial, Helvetica, sans-serif">UnitCommands.py</font></td> <td><font face="Arial, Helvetica, sans-serif">Unit level commands</font></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <p> </p> <p><font face="Arial, Helvetica, sans-serif">To help keep the script code readable, script files should be kept to a reasonable size. Additional script files can be created and loaded via the <em>Import</em> command.</font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif"><a href="script_exmenu.htm">Next page >><em> </em></a></font></p> <p> <code><em><var><font size="-1"></font></var></em></code></p> <!-- InstanceEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="script_intro.htm">Scripting intro</a> - <a href="script_location.htm">Script files</a> - Menu scripts <a href="script_exmenu.htm">1</a> <a href="script_exmenu2.htm">2</a> <a href="script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> <!-- InstanceEnd --></html> --- NEW FILE: buildunitmenu1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: menu2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: menu1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: script_exmenu2.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/stut.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><strong><em>Popup menu scripting (continued)</em></strong></font></p> <p><font face="Arial, Helvetica, sans-serif">This script produces a popup that looks like this (SurfAir.py scenario with aircraft hooked):</font></p> <p><img src="menu1.jpg" width="199" height="213"></p> <p><font face="Arial, Helvetica, sans-serif"><em>Example 1: Adding a menu command</em></font></p> <p><font face="Arial, Helvetica, sans-serif">As an example, let's add a new menu command. We will use the UnitMenu.AddItem function to do this. This function needs two parameters. The first parameter is the caption that is displayed in the menu. The second is the name of a script function to execute when the menu item is clicked.</font></p> <p><font face="Arial, Helvetica, sans-serif">Let's add an item that will reverse the course of the platform. This can be done with a command like this:</font></p> <p align="center"><font face="Arial, Helvetica, sans-serif"> UnitMenu.AddItem('Reverse course', 'ReverseOurCourse') </font></p> <p align="left"><font face="Arial, Helvetica, sans-serif">Let's add the command to after the 'Change heading' item in the BuildUnitMenu script in Menu.py, and then save the file. The modified script looks like this:</font></p> <pre align="left"><font face="Courier New, Courier, mono">###### Unit menu scripts #####</font><font size="-1" face="Courier New, Courier, mono"> </font><font face="Courier New, Courier, mono">def BuildUnitMenu(UnitMenu, UnitInfo): UnitMenu.Clear() UnitMenu.AddItemUI('Change heading','SetHeading','Heading') UnitMenu.AddItem('Reverse course', 'ReverseOurCourse') # new command # Speed submenu UnitMenu.AddItem('Set speed','') UnitMenu.BeginSubMenu() UnitMenu.AddItem('50%','Speed50') UnitMenu.AddItem('80%','Speed80') UnitMenu.AddItem('Max','Speed100') UnitMenu.EndSubMenu()</font></pre> <p>The "# new command" at the end of the line is a comment. Everything after the "#" is ignored by Python.</p> <p><font face="Arial, Helvetica, sans-serif">Restart the game, hook a platform, and right-click to bring up the new popup menu. The new menu looks like this:</font></p> <p><font face="Arial, Helvetica, sans-serif"><img src="menu2.jpg" width="228" height="250"></font></p> <p><font face="Arial, Helvetica, sans-serif">Click the "Reverse course" item. It should produce a ProcessCommand exception in the user console. This is because we have not defined the ReverseOurCourse script yet! </font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif"><a href="script_exmenu3.htm">Next page >><em> </em></a></font></p> <p> </p> <!-- InstanceEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="script_intro.htm">Scripting intro</a> - <a href="script_location.htm">Script files</a> - Menu scripts <a href="script_exmenu.htm">1</a> <a href="script_exmenu2.htm">2</a> <a href="script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> <!-- InstanceEnd --></html> --- NEW FILE: script_exmenu.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/stut.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><strong><em>Popup menu scripting</em></strong></font></p> <p><font face="Arial, Helvetica, sans-serif">The Menu.py file is the main file that defines the popup menu. The interface is (partially) documented in the doxygen doc pages. See <a href="../doxydoc/gcb_05_docs/classScriptInterface_1_1tcMenuInterface.html">menu interface class documentation</a>.</font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif">The platform right-click popup menu is defined in the BuildUnitMenu script. After each right-click, this function is called by the game engine to construct the unit menu. This allows the menu to change based on the platform type and state.</font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif">The GCB 0.5.1 BuildUnitMenu looks like this: (<a href="buildunitmenu1.jpg">what it looks like with the IDLE editor</a>)</font></p> <pre align="left"><font face="Courier New, Courier, mono">###### Unit menu scripts ##### def BuildUnitMenu(UnitMenu, UnitInfo): UnitMenu.Clear() UnitMenu.AddItemUI('Change heading','SetHeading','Heading') # Speed submenu UnitMenu.AddItem('Set speed','') UnitMenu.BeginSubMenu() UnitMenu.AddItem('50%','Speed50') UnitMenu.AddItem('80%','Speed80') UnitMenu.AddItem('Max','Speed100') UnitMenu.EndSubMenu() # Target submenu UnitMenu.AddItem('Target','') UnitMenu.BeginSubMenu() UnitMenu.AddItemUI('Select target','SelectTarget','Target') UnitMenu.AddItem('Clear target','ClearTarget') UnitMenu.EndSubMenu()</font></pre> <pre><font face="Courier New, Courier, mono"> # Launcher BuildLaunchMenu(UnitMenu, UnitInfo)</font></pre> <pre><font face="Courier New, Courier, mono"> # Orders test UnitMenu.AddItem('Orders','') UnitMenu.BeginSubMenu() UnitMenu.AddItem('Add patrol order','AddPatrolOrder') UnitMenu.AddItemUI('Add waypoint order', 'AddWaypointOrder', 'Datum') UnitMenu.AddItem('Clear orders','ClearOrders') UnitMenu.EndSubMenu() if (UnitInfo.IsAir()): # Altitude submenu UnitMenu.AddItem('Set altitude','') UnitMenu.BeginSubMenu() UnitMenu.AddItem('High','AltitudeHigh') UnitMenu.AddItem('Medium','AltitudeMedium') UnitMenu.AddItem('Low','AltitudeLow') UnitMenu.AddItem('Very low','AltitudeVeryLow') UnitMenu.EndSubMenu() UnitMenu.AddItemUI('Land at','AddLandingOrder', 'Target')</font></pre> <pre><font face="Courier New, Courier, mono"> # Flight port panel if available if (UnitInfo.HasFlightPort()): UnitMenu.AddItem('Flight deck', 'ShowFlightPanel')</font><font size="-1" face="Courier New, Courier, mono"> </font></pre> <p><font face="Arial, Helvetica, sans-serif"><a href="script_exmenu2.htm">Next page >><em> </em></a></font></p> <p align="center"> </p> <!-- InstanceEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="script_intro.htm">Scripting intro</a> - <a href="script_location.htm">Script files</a> - Menu scripts <a href="script_exmenu.htm">1</a> <a href="script_exmenu2.htm">2</a> <a href="script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> <!-- InstanceEnd --></html> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 21:23:51
|
Update of /cvsroot/gcblue/gcblue.com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26405 Modified Files: gc_contact.htm gc_ss.htm Added Files: gc_source.htm gcb051.htm v5help.html Log Message: --- NEW FILE: gc_source.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/gc.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>GCB Download</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <table width="606" border="0" align="center"> <tr> <td><img src="images/cvbg_blue.jpg" width="720" height="109" border="0"></td> </tr> <tr> <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><a href="index.html"><strong>Home</strong></a> <strong>• <a href="gc_ss.htm">Screenshots</a> • <a href="gc_news.htm">News</a> • <a href="gc_download.htm">Download</a> • <a href="docs.htm">Docs</a> • <a href="http://sourceforge.net/projects/gcblue/">Developer Page</a> • <a href="gc_hw.htm">Join</a> • <a href="gc_contact.htm">Contact</a></strong></font></div></td> </tr> <tr> <td width="600"><p align="center"> </p></td> </tr> </table> <table width="720" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- InstanceBeginRepeat name="RepeatRegion1" --><!-- InstanceBeginRepeatEntry --> <tr> <td><div align="center"></div></td> </tr> <tr> <td><!-- InstanceBeginEditable name="EditRegion3" --><strong><font face="Arial, Helvetica, sans-serif">GCB Source Code Downloads</font></strong> <hr> <table width="93%" border="0"> <tr> <td width="31%" valign="top"><p><font face="Arial, Helvetica, sans-serif"><em><strong>GCB version 0.5.1 </strong></em></font></p> <p><font face="Arial, Helvetica, sans-serif">(most recent pre-alpha build, released January 31, 2004)</font></p> <p> </p></td> <td width="48%" valign="top"><p><font face="Arial, Helvetica, sans-serif">GCB is an Open Source project, and source code is available for download.</font></p> <p><font face="Arial, Helvetica, sans-serif">GCB source code is licensed under GPL, the GNU General Public License. See <a href="http://www.gnu.org/licenses/gpl-faq.html">the GPL FAQ</a> for more information on the GPL license.</font></p> <p><font face="Arial, Helvetica, sans-serif">T</font><font face="Arial, Helvetica, sans-serif">he GPL license allows the code to be used in other Open Source projects that have GPL compatible licensing.</font></p> <p><font face="Arial, Helvetica, sans-serif">The code cannot be legally used in software products that do not have their complete source code freely available for download under a GPL compatible license.</font></p> <p><font face="Arial, Helvetica, sans-serif">Data (art, music, database, scenarios, etc) on GCB is licensed under the GCB Data License. This license protects the copyright holders while allowing the data to be freely used for the Global Conflict Blue project. </font></p> <p><font face="Arial, Helvetica, sans-serif">To inquire about other </font><font face="Arial, Helvetica, sans-serif"> licensing arrangements, please <a href="gc_contact.htm">contact</a> the project manager.</font></p> <p> </p></td> <td width="21%" valign="top"><p><font face="Arial, Helvetica, sans-serif"><strong><em>0.5.1 source </em> </strong></font></p> <p><font face="Arial, Helvetica, sans-serif"><a href="files/GCB_0_5_1%20Source.zip">zip file</a> (565 kB)</font></p> <p> </p> <p><font face="Arial, Helvetica, sans-serif"><strong><em>0.5.1 data</em></strong> </font></p> <p><font face="Arial, Helvetica, sans-serif"><a href="files/GCB_0_5_1%20Data.zip">zip file</a> (9747 kB)</font></p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="3" valign="top"><hr></td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <p><strong><font face="Arial, Helvetica, sans-serif"></font></strong></p> <p><strong></strong></p> <p align="left"> </p> <p> </p> <blockquote> <p> </p> </blockquote> <!-- InstanceEndEditable --></td> </tr> <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat --> </table> <p> </p> <p> </p> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> <p> </p> </body> <!-- InstanceEnd --></html> Index: gc_ss.htm =================================================================== RCS file: /cvsroot/gcblue/gcblue.com/gc_ss.htm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gc_ss.htm 29 Mar 2004 22:23:30 -0000 1.5 --- gc_ss.htm 20 Jun 2004 21:23:41 -0000 1.6 *************** *** 66,71 **** <p><font face="Arial, Helvetica, sans-serif">Tactical briefing screen</font></p> <p> </p></td> ! <td><font face="Arial, Helvetica, sans-serif"> </font></td> ! <td><font face="Arial, Helvetica, sans-serif"> </font></td> </tr> <tr> --- 66,75 ---- <p><font face="Arial, Helvetica, sans-serif">Tactical briefing screen</font></p> <p> </p></td> ! <td><p><font face="Arial, Helvetica, sans-serif"> <a href="screenshots/ship_smoke_1.jpg"><img src="screenshots/ship_smoke_1_lr.jpg" width="200" height="150" border="0"></a></font></p> ! <p><font face="Arial, Helvetica, sans-serif">Smoke effect 1</font></p> ! <p> </p></td> ! <td><p><font face="Arial, Helvetica, sans-serif"> <a href="screenshots/ship_smoke_2.jpg"><img src="screenshots/ship_smoke_2_lr.jpg" width="200" height="150" border="0"></a></font></p> ! <p><font face="Arial, Helvetica, sans-serif">Smoke effect 2</font></p> ! <p> </p></td> </tr> <tr> Index: gc_contact.htm =================================================================== RCS file: /cvsroot/gcblue/gcblue.com/gc_contact.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gc_contact.htm 29 Mar 2004 22:23:30 -0000 1.2 --- gc_contact.htm 20 Jun 2004 21:23:40 -0000 1.3 *************** *** 110,115 **** <td> </td> </tr> <tr> ! <td> <p><a href="http://sourceforge.net/projects/gcblue/"><font face="Arial, Helvetica, sans-serif">http://sourceforge.net/projects/gcblue/</font></a></p></td> <td> </td> <td><font face="Arial, Helvetica, sans-serif"> </font></td> --- 110,134 ---- <td> </td> </tr> + <tr> + <td><a href="http://sourceforge.net/projects/gcblue/"><font face="Arial, Helvetica, sans-serif">http://sourceforge.net/projects/gcblue/</font></a></td> + <td> </td> + <td> </td> + <td> </td> + </tr> <tr> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr> ! <td><font face="Arial, Helvetica, sans-serif"><em>IRC </em></font></td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr> ! <td> <p><font face="Arial, Helvetica, sans-serif">irc.freenode.net, ! #gcb room, stop in anytime</font></p></td> <td> </td> <td><font face="Arial, Helvetica, sans-serif"> </font></td> --- NEW FILE: v5help.html --- <html> <head> <title>Global Conflict -- Help</title> </head> <body> <h1>Tactical map commands</h1> <table> <tr> <td>Right mouse</td> <td>Popup menu</td> </tr> <tr> <td>Left mouse</td> <td>Hook</td> </tr> <tr> <td>CTRL+Left mouse</td> <td>Zoom in</td> </tr> <tr> <td>CTRL+Right mouse</td> <td>Zoom out</td> </tr> <tr> <td>Shift+Left mouse</td> <td>Recenter</td> </tr> <tr> <td>Mouse wheel</td> <td>Zoom</td> </tr> <tr> <td>Arrow keys</td> <td>Scroll map</td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <h1>Key commands (no hooked platform)</h1> <table> <tr> <td width="28">F1</td> <td width="471">Main view</td> </tr> <tr> <td>F2</td> <td>Options window</td> </tr> <tr> <td>F3</td> <td>Cycle 3D small/large/fullscreen</td> </tr> <tr> <td>F4</td> <td>Toggle 3D window on/off</td> </tr> <tr> <td>F5</td> <td>Toggle tactical briefing display</td> </tr> <tr> <td>F8</td> <td>Toggle 3D wireframe (test feature)</td> </tr> <tr> <td>F10</td> <td>Shift environment time back 15 minutes (for viewing different sky conditions)</td> </tr> <tr> <td>F11</td> <td>Shift environment time forward 15 minutes</td> </tr> <tr> <td>F12</td> <td>Disable color elevation map (test feature, may improve speed)</td> </tr> <tr> <td>a</td> <td>Accelerate time 4x</td> </tr> <tr> <td>p</td> <td>Pause</td> </tr> <tr> <td>F</td> <td>Toggle fog</td> </tr> <tr> <td>K</td> <td>Toggle track ID tags</td> </tr> </table> <h1>Key commands (with hooked platform)</h1> <p>(see scripts/HotKey.py)</p> <table width="34%" border="0"> <tr> <td>1</td> <td>Set speed to 40%</td> </tr> <tr> <td>2</td> <td>Set speed to 75%</td> </tr> <tr> <td>3</td> <td>Set speed to 100%</td> </tr> <tr> <td>h</td> <td>Set heading</td> </tr> <tr> <td>f</td> <td>Flight deck</td> </tr> <tr> <td>g</td> <td>Toggle gear</td> </tr> <tr> <td>m</td> <td>Move to and patrol</td> </tr> <tr> <td>r</td> <td>Toggle radars</td> </tr> <tr> <td>w</td> <td>Add waypoint</td> </tr> <tr> <td>x</td> <td>Clear last order</td> </tr> <tr> <td>C</td> <td>Clear all orders</td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <p> </p> <h1>3D Window</h1> <table width="28%" border="0"> <tr> <td>Left mouse drag</td> <td>Change camera angle</td> </tr> <tr> <td>Mouse wheel</td> <td>Camera zoom</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <p> </p> </body> </html> --- NEW FILE: gcb051.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/gc.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>GCB Download</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> </head> <body> <table width="606" border="0" align="center"> <tr> <td><img src="images/cvbg_blue.jpg" width="720" height="109" border="0"></td> </tr> <tr> <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><a href="index.html"><strong>Home</strong></a> <strong>• <a href="gc_ss.htm">Screenshots</a> • <a href="gc_news.htm">News</a> • <a href="gc_download.htm">Download</a> • <a href="docs.htm">Docs</a> • <a href="http://sourceforge.net/projects/gcblue/">Developer Page</a> • <a href="gc_hw.htm">Join</a> • <a href="gc_contact.htm">Contact</a></strong></font></div></td> </tr> <tr> <td width="600"><p align="center"> </p></td> </tr> </table> <table width="720" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- InstanceBeginRepeat name="RepeatRegion1" --><!-- InstanceBeginRepeatEntry --> <tr> <td><div align="center"></div></td> </tr> <tr> <td><!-- InstanceBeginEditable name="EditRegion3" --> <p><font face="Arial, Helvetica, sans-serif"><em><strong>GCB version 0.5.1 release notes</strong></em></font></p> <p><strong>CHANGES</strong></p> <p>* Reduced number of block artifacts visible when switching screens.<br> There are still problems in this area.</p> <p>* Fixed popup menu location bug</p> <p>* 3D terrain loading is now skipped when 3D display is turned off <br> (F4 key). There should be no delay when changing hooked units with 3D <br> off now.</p> <p>* Fixed map scrolling bug. Symbols and map grid would appear in wrong <br> locations when scrolling in some situations.</p> <p>* Fixed briefing mode map symbol location bug. Symbols were appearing<br> at the wrong location when the briefing screen was displayed. After <br> the briefing mode was exited, the bad locations would remain until <br> the map view was changed.</p> <p>* Added more debug info to help isolate crash issues.</p> <p>* Added support for 800 x 600 screen mode for faster game speed</p> <p>* Added graphics detail level option. Use option 0 for fastest speed and option 2 for fastest update rate of 2D windows.</p> <p><strong>EXAMPLE PERFORMANCE RESULTS</strong></p> <p>Scenario: FourOnFourAir.py</p> <p>Test machine: 866 MHz Pentium III, 256 MB RAM, Windows 98, Nvidia GeForce2 MX/AGP/SSE driver ver 1.3.1</p> <p>Skip count: OFF</p> <table width="60%" border="0"> <tr> <td><strong>800 x 600</strong></td> <td><strong>No 3D (F4 to toggle)</strong></td> <td><strong>Full-screen 3D</strong></td> </tr> <tr> <td>Graphics level 0</td> <td>55 fps</td> <td>115 fps</td> </tr> <tr> <td>Graphics level 1</td> <td>40 fps</td> <td>115 fps</td> </tr> <tr> <td>Graphics level 2</td> <td>30 fps</td> <td>115 fps</td> </tr> </table> <p> </p> <table width="60%" border="0"> <tr> <td><strong>1024 x 768</strong></td> <td><strong>No 3D (F4 to toggle)</strong></td> <td><strong>Full-screen 3D</strong></td> </tr> <tr> <td>Graphics level 0</td> <td>34 fps</td> <td>50 fps</td> </tr> <tr> <td>Graphics level 1</td> <td>27 fps</td> <td>50 fps</td> </tr> <tr> <td>Graphics level 2</td> <td>21 fps</td> <td>50 fps</td> </tr> </table> <p> </p> <table width="60%" border="0"> <tr> <td><strong>1280 x 960</strong></td> <td><strong>No 3D (F4 to toggle)</strong></td> <td><strong>Full-screen 3D</strong></td> </tr> <tr> <td>Graphics level 0</td> <td>24 fps</td> <td>37 fps</td> </tr> <tr> <td>Graphics level 1</td> <td>16 fps</td> <td>37 fps</td> </tr> <tr> <td>Graphics level 2</td> <td>13 fps</td> <td>37 fps</td> </tr> </table> <p>Test machine: 2.39 GHz Pentium IV, 512 MB RAM, Windows XP, GeForce4 MX 420/AGP/SSE2 driver ver 1.4.0</p> <table width="60%" border="0"> <tr> <td><strong>1280 x 768</strong></td> <td><strong>No 3D (F4 to toggle)</strong></td> <td><strong>Full-screen 3D</strong></td> </tr> <tr> <td>Graphics level 0</td> <td>47 fps</td> <td>60 fps</td> </tr> <tr> <td>Graphics level 1</td> <td>40 fps</td> <td>60 fps</td> </tr> <tr> <td>Graphics level 2</td> <td>36 fps</td> <td>60 fps</td> </tr> </table> <p><strong><font face="Arial, Helvetica, sans-serif"></font></strong></p> <p><strong></strong></p> <p align="left"> </p> <p> </p> <blockquote> <p> </p> </blockquote> <!-- InstanceEndEditable --></td> </tr> <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat --> </table> <p> </p> <p> </p> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> <p> </p> </body> <!-- InstanceEnd --></html> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 21:23:51
|
Update of /cvsroot/gcblue/gcblue.com/screenshots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26405/screenshots Added Files: basic_sky.jpg ship_smoke_1.jpg ship_smoke_1_lr.jpg ship_smoke_2.jpg ship_smoke_2_lr.jpg Log Message: --- NEW FILE: ship_smoke_2_lr.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_smoke_1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_smoke_1_lr.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: basic_sky.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ship_smoke_2.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 21:23:50
|
Update of /cvsroot/gcblue/gcblue.com/Templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26405/Templates Added Files: stut.dwt Log Message: --- NEW FILE: stut.dwt --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <!-- TemplateBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- TemplateEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head> <body> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif"><img src="../images/cvbg_blue.jpg" width="613" height="92"></font></em></strong></p> <p><strong><em><font size="+2" face="Arial, Helvetica, sans-serif">GCB Scripting Tutorial</font></em></strong> </p> <hr> <!-- TemplateBeginEditable name="EditRegion3" -->EditRegion3<!-- TemplateEndEditable --> <p> </p><hr> <p> </p> <table width="622" border="0" align="center"> <tr> <td align="center" bordercolor="#999999"><a href="../script_tutorial/script_intro.htm">Scripting intro</a> - <a href="../script_tutorial/script_location.htm">Script files</a> - Menu scripts <a href="../script_tutorial/script_exmenu.htm">1</a> <a href="../script_tutorial/script_exmenu2.htm">2</a> <a href="../script_tutorial/script_exmenu3.htm">3</a></td> </tr> <tr> <td align="center" bordercolor="#999999"> <hr> <font size="1" face="Arial, Helvetica, sans-serif">Copyright ©2002-2004 by Global Conflict Blue Team. All rights reserved.</font></td> </tr> <tr> <td width="622" align="center" bordercolor="#999999"> <div align="center"><font size="-2" face="Arial, Helvetica, sans-serif"><a href="mailto:de...@tw...">Contact us</a> </font></div></td> </tr> </table> <p> </p> </body> </html> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 21:21:50
|
Update of /cvsroot/gcblue/gcblue.com/script_tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25107/script_tutorial Log Message: Directory /cvsroot/gcblue/gcblue.com/script_tutorial added to the repository |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 15:00:03
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20467/src/sim Modified Files: tcMapData.cpp Log Message: Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMapData.cpp 19 Jun 2004 22:00:28 -0000 1.8 --- tcMapData.cpp 20 Jun 2004 14:59:53 -0000 1.9 *************** *** 799,802 **** --- 799,817 ---- } + /** + * Loads high res data (theater area) specified by northwest corner + * point (startLon_deg, startLat_deg) + * Uses newer 10 x 10 deg DEM tile system + * Forces the corner to a tile boundary + */ + void tcMapData::LoadHighResB(float startLon_deg, float startLat_deg) + { + ConformLonLatDeg(startLon_deg, startLat_deg); + + // force corner point to a tile boundary + startLon_deg = 0.5f * floorf(startLon_deg / 0.5f); + startLat_deg = 0.5f * floorf(startLat_deg / 0.5f); + } + /********************************************************************/ /** |
|
From: Dewitt C. <ddc...@us...> - 2004-06-20 15:00:03
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20467/include/sim Modified Files: tcMapData.h Log Message: Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMapData.h 19 Jun 2004 22:00:27 -0000 1.4 --- tcMapData.h 20 Jun 2004 14:59:52 -0000 1.5 *************** *** 114,117 **** --- 114,118 ---- } int LoadHighRes(float afStartLon_deg, float afStartLat_deg); + void LoadHighResB(float startLon_deg, float startLat_deg); int LoadHighResDefault(float afStartLon_deg, float afStartLat_deg); void SaveHighRes(void); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-19 22:01:07
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26484/include/sim Modified Files: Game.h tcMapData.h Log Message: Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Game.h 14 Jun 2004 22:37:11 -0000 1.39 --- Game.h 19 Jun 2004 22:00:27 -0000 1.40 *************** *** 150,153 **** --- 150,154 ---- tcSoundConsole* briefingConsoleBottom; ///< to fill space at bottom for now tcTacticalMapView* tacticalMap; ///< tactical map object + tcWorldMapView* worldMap; ///< world map object tcEditControl* editControl; tcOptionsView* optionsView; *************** *** 273,276 **** --- 274,278 ---- void InitializeStartView(); void InitializeTacticalMap(); + void InitializeWorldMap(); static tcSoundConsole* messageConsole; Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMapData.h 19 Nov 2003 01:36:14 -0000 1.3 --- tcMapData.h 19 Jun 2004 22:00:27 -0000 1.4 *************** *** 1,6 **** ! /* ! ** tcMapData.h: interface for the tcMapData class. ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,8 ---- ! /** ! ** @file tcMapData.h ** ! ** Header for the tcMapData class. ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 46,49 **** --- 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 *************** *** 142,145 **** --- 146,150 ---- tsTileData* GetTile(unsigned mtile, unsigned ntile, double afStatusTime); tsTileData* LoadTile(unsigned mtile, unsigned ntile); + tsTileData* LoadTileB(unsigned mtile, unsigned ntile); void CreatePalettes(void); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-19 22:00:52
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26484/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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcWindow.cpp 14 Jun 2004 21:52:48 -0000 1.3 --- tcWindow.cpp 19 Jun 2004 22:00:28 -0000 1.4 *************** *** 105,109 **** { wxPaintDC dc(this); ! fprintf(stdout, "Paint [%s]\n",GetName()); } --- 105,109 ---- { wxPaintDC dc(this); ! //fprintf(stdout, "Paint [%s]\n",GetName()); } |
|
From: Dewitt C. <ddc...@us...> - 2004-06-19 22:00:38
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26484/src/sim Modified Files: Game.cpp tcMapData.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcMapView.cpp 3 Apr 2004 20:24:33 -0000 1.22 --- tcMapView.cpp 19 Jun 2004 22:00:28 -0000 1.23 *************** *** 242,245 **** --- 242,246 ---- tcWindow::SetActive(abActive); terrainView->SetActive(abActive); + wxWindow::Raise(); // without this, the world map view wasn't receiving mouse cmds } /***********************************************************************************/ *************** *** 1967,1971 **** } /***********************************************************************************/ ! void tcWorldMapView::Init() { tcPoint p; --- 1968,1973 ---- } /***********************************************************************************/ ! void tcWorldMapView::Init() ! { tcPoint p; *************** *** 1977,1981 **** mpMapData->GetWorldArea(mrectViewBounds); // restrict view to theater area mpMapData->GetTheaterArea(mrectTheater); // for box to indicate theater area ! SetView(p,C_PIOVER180*340.0f); } /***********************************************************************************/ --- 1979,1983 ---- mpMapData->GetWorldArea(mrectViewBounds); // restrict view to theater area mpMapData->GetTheaterArea(mrectTheater); // for box to indicate theater area ! SetView(p, C_PIOVER180*340.0f); } /***********************************************************************************/ *************** *** 2025,2028 **** --- 2027,2031 ---- if (!terrainView) {wxMessageBox("terrainView init failed\n");} + tcWindow::MoveToTop(); // so that color elevation map is underneath mnCounter = 0; ClearMapObjects(); Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcMapData.cpp 19 Nov 2003 01:36:14 -0000 1.7 --- tcMapData.cpp 19 Jun 2004 22:00:28 -0000 1.8 *************** *** 442,446 **** void tcMapData::SetDemInfo() { ! mzDemPath = "C:\\PROJECTS\\GLOBE\\DEM\\"; for (int i=0;i<16;i++) { --- 442,447 ---- void tcMapData::SetDemInfo() { ! // mzDemPath = "C:\\PROJECTS\\GLOBE\\DEM\\"; ! mzDemPath = "maps\\tiles\\"; for (int i=0;i<16;i++) { *************** *** 799,803 **** /********************************************************************/ ! int tcMapData::LoadHighRes(float afStartLon_deg, float afStartLat_deg) { int nMainTile,nEastTile,nSouthTile,nSouthEastTile; int bFound=0; --- 800,809 ---- /********************************************************************/ ! /** ! * Loads high res data (theater area) specified by northwest point ! * (afStartLon_deg, afStartLat_deg) ! */ ! int tcMapData::LoadHighRes(float afStartLon_deg, float afStartLat_deg) ! { int nMainTile,nEastTile,nSouthTile,nSouthEastTile; int bFound=0; *************** *** 1247,1266 **** } /********************************************************************/ ! tsTileData* tcMapData::GetTile(unsigned mtile, unsigned ntile, double afStatusTime) { unsigned short nTileIndex; tsTileData *pTileData; ! if ((mtile >= M_TILE_LOOKUP)||(ntile >= N_TILE_LOOKUP)) { return NULL; } nTileIndex = maTileLookup[mtile][ntile]; ! if (nTileIndex == NULL_TILE) { pTileData = LoadTile(mtile,ntile); } ! else { pTileData = &maTile[nTileIndex]; } ! if (pTileData != NULL) { pTileData->mfLastAccessTime = afStatusTime; } --- 1253,1277 ---- } /********************************************************************/ ! tsTileData* tcMapData::GetTile(unsigned mtile, unsigned ntile, double afStatusTime) ! { unsigned short nTileIndex; tsTileData *pTileData; ! if ((mtile >= M_TILE_LOOKUP)||(ntile >= N_TILE_LOOKUP)) ! { return NULL; } nTileIndex = maTileLookup[mtile][ntile]; ! if (nTileIndex == NULL_TILE) ! { pTileData = LoadTile(mtile,ntile); } ! else ! { pTileData = &maTile[nTileIndex]; } ! if (pTileData != NULL) ! { pTileData->mfLastAccessTime = afStatusTime; } *************** *** 1289,1301 **** } /********************************************************************/ ! void tcMapData::InitTiles() { unsigned int m,n,k; ! for(m=0;m<M_TILE_LOOKUP;m++) { ! for(n=0;n<N_TILE_LOOKUP;n++) { maTileLookup[m][n] = NULL_TILE; } } ! for(k=0;k<MAX_TILES;k++) { maTile[k].m_lat = 0; maTile[k].n_lon = 0; --- 1300,1316 ---- } /********************************************************************/ ! void tcMapData::InitTiles() ! { unsigned int m,n,k; ! for(m=0;m<M_TILE_LOOKUP;m++) ! { ! for(n=0;n<N_TILE_LOOKUP;n++) ! { maTileLookup[m][n] = NULL_TILE; } } ! for(k=0;k<MAX_TILES;k++) ! { maTile[k].m_lat = 0; maTile[k].n_lon = 0; *************** *** 1308,1313 **** mnTilesUsed = 0; } ! /********************************************************************/ ! tsTileData* tcMapData::LoadTile(unsigned mtile, unsigned ntile) { int nMainTile; int bFound=0; --- 1323,1332 ---- mnTilesUsed = 0; } ! /** ! * Loads 0.5 x 0.5 deg (default) tile from larger DEM tiles ! * @return populated tsTileData* or NULL if missing DEM data ! */ ! tsTileData* tcMapData::LoadTile(unsigned mtile, unsigned ntile) ! { int nMainTile; int bFound=0; *************** *** 1321,1334 **** fStartLon_deg = (float)ntile*SCALE_LOOKUP - 180.0f; ! for (k=0;(k<N_DEMFILES)&&(!bFound);k++) { ! if ((fStartLat_deg > maDemInfo[k].mfLatMin)&&(fStartLat_deg <= maDemInfo[k].mfLatMax)&& ! (fStartLon_deg >= maDemInfo[k].mfLonMin)&&(fStartLon_deg < maDemInfo[k].mfLonMax)) { ! nMainTile = k; ! bFound = 1; ! } ! } if (!bFound) {return NULL;} ! if (!mbUseDefaultMap) { if (fMain.Open(maDemInfo[nMainTile].mzFileName,tcFile::modeRead)==0) { --- 1340,1358 ---- fStartLon_deg = (float)ntile*SCALE_LOOKUP - 180.0f; ! for (k=0;(k<N_DEMFILES)&&(!bFound);k++) ! { ! if ((fStartLat_deg > maDemInfo[k].mfLatMin)&& ! (fStartLat_deg <= maDemInfo[k].mfLatMax)&& ! (fStartLon_deg >= maDemInfo[k].mfLonMin)&& ! (fStartLon_deg < maDemInfo[k].mfLonMax)) ! { ! nMainTile = k; ! bFound = 1; ! } ! } if (!bFound) {return NULL;} ! if (!mbUseDefaultMap) ! { if (fMain.Open(maDemInfo[nMainTile].mzFileName,tcFile::modeRead)==0) { *************** *** 1423,1426 **** --- 1447,1565 ---- } + /** + * Loads 0.5 x 0.5 deg (default) tile from 10 x 10 DEM tiles + * This is the newer version that uses smaller DEM tiles to allow + * the user to play without downloading the full earth map data. + * + * @return populated tsTileData* or NULL if missing DEM data + */ + tsTileData* tcMapData::LoadTileB(unsigned mtile, unsigned ntile) + { + static errorReports = 0; + tcFile demTile; + + int lat_val = 90 - 10 * (mtile / 20); + int lon_val = -180 + 10 * (ntile / 20); + int lat_offset = (mtile % 20) * M_TILE; // offsets into DEM tile for this tile + int lon_offset = (ntile % 20) * N_TILE; + + wxASSERT(lat_val > -90); + wxASSERT(lat_val <= 90); + wxASSERT(lon_val >= -180); + wxASSERT(lon_val < 180); + + float fStartLat_deg = 90.0f - (float)mtile*SCALE_LOOKUP; + float fStartLon_deg = (float)ntile*SCALE_LOOKUP - 180.0f; + + wxString demTileName = mzDemPath.GetBuffer(); + demTileName += wxString::Format("%dx%d.dat", lat_val, lon_val); + + if (demTile.Open(demTileName.c_str(), tcFile::modeRead) ==0) + { + if (errorReports++ % 100 == 0) + { + fprintf(stderr, "Map tile not found: %s\n", demTileName.c_str()); + } + return NULL; + } + + // checkout new tile + if (mnTilesUsed >= MAX_TILES) {return NULL;} + unsigned int nNewIndex = maAvailableTiles[mnCheckoutIndex++]; + if (mnCheckoutIndex >= MAX_TILES) {mnCheckoutIndex = 0;} + maTileLookup[mtile][ntile] = nNewIndex; + mnTilesUsed++; + tsTileData *pTileData = &maTile[nNewIndex]; + pTileData->m_lat = mtile; + pTileData->n_lon = ntile; + pTileData->mbActive = 1; + // end checkout new tile + + // copy appropriate section of 10 x 10 DEM tile to 0.5 x 0.5 tsTileData + + + + + if ((lat_offset >= M_DEMTILE)||(lon_offset >= N_DEMTILE)) + { + memset(pTileData->maMapData, 0, M_TILE*N_TILE*sizeof(short)); + tcString s; + s.Format("tcMapData - LoadTile (lon %.1f,lat %.1f) (m %d n %d) " + "idx:%d - out of bounds tile", + fStartLon_deg, fStartLat_deg, mtile, ntile, nNewIndex); + fprintf(stderr,"%s\n", s.GetBuffer()); + return pTileData; + } + + + // seek to first row of data in DEM tile + demTile.Seek(lat_offset * N_DEMTILE * sizeof(short), tcFile::current); + + if ((lon_offset+N_TILE) > N_DEMTILE) + { + ME(ME_TILE_STRUCTURE) + } + + int m_src = lat_offset; // row index for source data + int m_dest = 0; // row index for destination data + + int pre_read_offset = lon_offset * sizeof(short); + int read_count = N_TILE*sizeof(short); + int post_read_offset = (N_DEMTILE-N_TILE-lon_offset)*sizeof(short); + + while (m_dest < M_TILE) + { + if (m_src < M_DEMTILE) + { + // seek to first column of data + demTile.Seek(pre_read_offset, tcFile::current); + + demTile.Read((void*)pTileData->maMapData[m_dest], read_count); + + // seek to first column of next row of data + demTile.Seek(post_read_offset, tcFile::current); + } + else + { + ME(ME_TILE_STRUCTURE) + } + m_src++; + m_dest++; + } + demTile.Close(); + + tcString s; + s.Format("tcMapData - LoadTile (lon %.1f,lat %.1f) (m %d n %d) idx:%d - success", + fStartLon_deg, fStartLat_deg, mtile, ntile, nNewIndex); + WTL(s.GetBuffer()); + + if ((pTileData->maMapData[0][0] == 0)&&(pTileData->maMapData[10][10]==0)) + { + WTLC("bad tile data"); + } + + return pTileData; + } + /********************************************************************/ *************** *** 1451,1455 **** /********************************************************************/ ! tcMapData::tcMapData() { mbUseDefaultMap = false; SetDemInfo(); --- 1590,1595 ---- /********************************************************************/ ! tcMapData::tcMapData() ! { mbUseDefaultMap = false; SetDemInfo(); *************** *** 1458,1462 **** ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH|FF_MODERN,"Arial"); ! if (mhFontDefault == NULL) { WTL("mhFontDefault creation failed\n"); } --- 1598,1603 ---- ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH|FF_MODERN,"Arial"); ! if (mhFontDefault == NULL) ! { WTL("mhFontDefault creation failed\n"); } *************** *** 1465,1479 **** ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,PROOF_QUALITY, DEFAULT_PITCH|FF_MODERN,"Arial"); ! if (mhFontCountry == NULL) { WTL("mhFontCountry creation failed\n"); } mhPenBox = CreatePen(PS_SOLID,1,RGB(255,255,255)); ! if (mhPenBox == NULL) { WTL("mhPenBox creation failed\n"); } { ! for(int m=0;m<M_LOWRES;m++) { for(int n=0;n<N_LOWRES;n++) { maGlobal[m][n] = 0; --- 1606,1623 ---- ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,PROOF_QUALITY, DEFAULT_PITCH|FF_MODERN,"Arial"); ! if (mhFontCountry == NULL) ! { WTL("mhFontCountry creation failed\n"); } mhPenBox = CreatePen(PS_SOLID,1,RGB(255,255,255)); ! if (mhPenBox == NULL) ! { WTL("mhPenBox creation failed\n"); } { ! for(int m=0;m<M_LOWRES;m++) ! { for(int n=0;n<N_LOWRES;n++) { maGlobal[m][n] = 0; *************** *** 1482,1487 **** } { ! for(int m=0;m<M_HIGHRES;m++) { ! for(int n=0;n<N_HIGHRES;n++) { maTheater[m][n] = 0; } --- 1626,1633 ---- } { ! for(int m=0;m<M_HIGHRES;m++) ! { ! for(int n=0;n<N_HIGHRES;n++) ! { maTheater[m][n] = 0; } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Game.cpp 14 Jun 2004 22:37:12 -0000 1.83 --- Game.cpp 19 Jun 2004 22:00:28 -0000 1.84 *************** *** 111,114 **** --- 111,115 ---- briefingConsoleBottom = NULL; tacticalMap = NULL; + worldMap = NULL; editControl = NULL; optionsView = NULL; *************** *** 231,234 **** --- 232,236 ---- optionsView->SetActive(false); tacticalMap->SetActive(false); + worldMap->SetActive(false); infoConsole->SetActive(false); hookInfo->SetActive(false); *************** *** 454,457 **** --- 456,460 ---- */ InitializeTacticalMap(); + InitializeWorldMap(); InitializeBriefingConsoles(); InitializeDirector(); *************** *** 706,709 **** --- 709,738 ---- } + void tcGame::InitializeWorldMap() + { + 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) + { + cerr << "worldMap init failed\n"; + throw "worldMap init failed\n"; + } + + + worldMap->AttachMapData(&mcMapData); + worldMap->AttachOptions(tcOptions::Get()); + worldMap->AttachCommandInterface(&mcCommandQueue); + worldMap->Init(); + worldMap->SetActive(false); + worldMap->SetBlend(true); + worldMap->RefreshTerrainView(); + } + bool tcGame::InitGame() { *************** *** 807,826 **** #if 0 ! / * ** Initialize world map * **/ ! mrectWorldMap = mrectMap; ! mrectWorldMap.left = mrectWorldMap.right - 256; ! mrectWorldMap.top = mrectWorldMap.bottom - 128; ! mcWorldMap.SetWindow(mrectWorldMap); ! mcWorldMap.AttachMapData(&mcMapData); ! mcWorldMap.AttachOptions(&mcOptions); ! mcWorldMap.AttachCommandInterface(&mcCommandQueue); ! ! if(!mcWorldMap.CreateSurfaces(mpGraphicsEngine)) ! { ! return false; ! } ! ! mcWorldMap.Init(); ! mcWorldMap.SetActive(false); / * ** Console init * **/ --- 836,840 ---- #if 0 ! / * ** Console init * **/ *************** *** 1222,1225 **** --- 1236,1240 ---- displaySettingsView->SetActive(false); tacticalMap->SetActive(drawTacticalMap); + worldMap->SetActive(drawTacticalMap); infoConsole->SetActive(drawEdgeWindows); hookInfo->SetActive(drawEdgeWindows); *************** *** 1231,1234 **** --- 1246,1250 ---- { tacticalMap->Draw(); + worldMap->Draw(); } if (drawEdgeWindows) *************** *** 1254,1257 **** --- 1270,1274 ---- displaySettingsView->SetActive(false); tacticalMap->SetActive(drawTacticalMap); + worldMap->SetActive(drawTacticalMap); infoConsole->SetActive(false); hookInfo->SetActive(false); *************** *** 1262,1265 **** --- 1279,1283 ---- { tacticalMap->Draw(); + worldMap->Draw(); } if (drawEdgeWindows) *************** *** 1281,1284 **** --- 1299,1303 ---- //displaySettingsView->SetActive(false); tacticalMap->SetActive(false); + worldMap->SetActive(false); infoConsole->SetActive(false); hookInfo->SetActive(false); *************** *** 1297,1300 **** --- 1316,1320 ---- // displaySettingsView->SetActive(false); tacticalMap->SetActive(false); + worldMap->SetActive(false); infoConsole->SetActive(false); hookInfo->SetActive(false); *************** *** 1313,1316 **** --- 1333,1337 ---- displaySettingsView->SetActive(true); tacticalMap->SetActive(false); + worldMap->SetActive(false); infoConsole->SetActive(false); hookInfo->SetActive(false); |
|
From: Dewitt C. <ddc...@us...> - 2004-06-19 22:00:36
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26484/src/common Modified Files: tcOptions.cpp Log Message: Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOptions.cpp 17 May 2004 00:38:53 -0000 1.9 --- tcOptions.cpp 19 Jun 2004 22:00:27 -0000 1.10 *************** *** 1,6 **** ! /* ! ** tcOptions.cpp ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcOptions.cpp ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. |
|
From: Dewitt C. <ddc...@us...> - 2004-06-19 22:00:35
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26484 Modified Files: doxygen_config Log Message: Index: doxygen_config =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/doxygen_config,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doxygen_config 30 Nov 2003 15:41:48 -0000 1.1 --- doxygen_config 19 Jun 2004 22:00:26 -0000 1.2 *************** *** 5,10 **** #--------------------------------------------------------------------------- PROJECT_NAME = GCB_WX ! PROJECT_NUMBER = X4D ! OUTPUT_DIRECTORY = "C:/Documents and Settings/Primary/My Documents/Visual Studio Projects/gcb_cvs/Doxydoc/" OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = YES --- 5,10 ---- #--------------------------------------------------------------------------- PROJECT_NAME = GCB_WX ! PROJECT_NUMBER = X6A ! OUTPUT_DIRECTORY = C:/gcb/gcb_doxydoc/ OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = YES *************** *** 59,68 **** # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = "C:/Documents and Settings/Primary/My Documents/Visual Studio Projects/gcb_cvs/gcb_wx/" FILE_PATTERNS = *.h \ *.hpp \ *.cpp RECURSIVE = YES ! EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = --- 59,68 ---- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = C:/gcb/gcb_wx/ FILE_PATTERNS = *.h \ *.hpp \ *.cpp RECURSIVE = YES ! EXCLUDE = .#*.* EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = |
|
From: Dewitt C. <ddc...@us...> - 2004-06-17 21:01:01
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1774/xml Modified Files: options.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options.xml 14 Jun 2004 21:52:55 -0000 1.2 --- options.xml 17 Jun 2004 21:00:50 -0000 1.3 *************** *** 1,4 **** <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings>1024 768 32</DisplaySettings> </Options> --- 1,4 ---- <Options> <HostAddress>192.168.0.102</HostAddress> ! <DisplaySettings>default</DisplaySettings> </Options> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-17 21:01:01
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1774 Modified Files: GCB_DATA _LICENSE.txt Added Files: END_USER_LICENSE.txt Log Message: Index: GCB_DATA _LICENSE.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCB_DATA _LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GCB_DATA _LICENSE.txt 2 Jan 2004 15:03:28 -0000 1.1 --- GCB_DATA _LICENSE.txt 17 Jun 2004 21:00:49 -0000 1.2 *************** *** 1,13 **** ! ------------------------------------------------------------------------------------- ! GCB Data License v1.0 ! For the purpose of identifying the copyright holders, this license defines the "GCB Team" as the following people: * Global Conflict Blue (GCB) Project Manager * Global Conflict Blue Members ! The names and e-mails of those people are listed in the GCB site at the address: http://www.gcblue.com ! Material to which this license applies may include the following: * Texts --- 1,17 ---- ! GCB DATA LICENSE ! Version 1 ! January 2, 2004 ! For the purpose of identifying the copyright holders, this license defines ! the "GCB Team" as the following people: * Global Conflict Blue (GCB) Project Manager * Global Conflict Blue Members ! The names and e-mails of those people are listed in the GCB site at the ! address: http://www.gcblue.com ! Material to which this license applies may include but is not limited to ! the following: * Texts *************** *** 20,40 **** TERMS AND CONDITIONS FOR USAGE, COPYING, DISTRIBUTION AND MODIFICATION ! 0. This License applies to any material or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this GCB Data License. ! 1. Terms defined in this Article 1, and parenthetically elsewhere, shall throughout this License have the meanings here and there provided. Defined terms may be used in the singular or plural. Definitions: - * The "Material", below, refers to any such material or work, and a "work based on the Material" means either the Material or any Derivative Work under copyright law. - * "Derivative Work" shall mean a work containing the Material or a portion of it, such as a revision, modification, enhancement, adaptation, translation (including compilation or recompilation by computer), abridgement, condensation, expansion, or any other form in which such preexisting works may be recast, transformed, or adapted, and that, if prepared without authorization of the owner of the copyright in such preexisting work, would constitute a copyright infringement. * Each licensee is addressed as "you". ! 2. You may not copy, modify, publish, transmit, sell, participate in the transfer or sale or reproduce, create Derivative Works from, distribute, perform, display or in any way exploit any of the Material released under this License unless expressly permitted by the GCB Team. ! 3. You may use the provided Material, for personal use only, in conjunction with GCB software directly distributed by the GCB Team. NO WARRANTY ! 4. THERE IS NO WARRANTY FOR THE MATERIAL PROVIDED, TO THE EXTENT PERMITTED BY APPLICABLE LAW. THE MATERIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE MATERIAL IS WITH YOU. ! 5. IN NO EVENT SHALL THE GCB TEAM BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE MATERIAL. END OF TERMS AND CONDITIONS --- 24,70 ---- TERMS AND CONDITIONS FOR USAGE, COPYING, DISTRIBUTION AND MODIFICATION ! 0. This License applies to any material or other work which contains a ! notice placed by the copyright holder saying it may be distributed under ! the terms of this GCB Data License. ! 1. Terms defined in this Article 1, and parenthetically elsewhere, shall ! throughout this License have the meanings here and there provided. Defined ! terms may be used in the singular or plural. Definitions: ! ! * The "Material", below, refers to any such material or work, and a ! "work based on the Material" means either the Material or any ! Derivative Work under copyright law. ! ! * "Derivative Work" shall mean a work containing the Material or a ! portion of it, such as a revision, modification, enhancement, ! adaptation, translation (including compilation or recompilation by ! computer), abridgement, condensation, expansion, or any other form ! in which such preexisting works may be recast, transformed, or ! adapted, and that, if prepared without authorization of the owner ! of the copyright in such preexisting work, would constitute a copyright ! infringement. * Each licensee is addressed as "you". ! 2. You may not copy, modify, publish, transmit, sell, participate in the ! transfer or sale or reproduce, create Derivative Works from, distribute, ! perform, display or in any way exploit any of the Material released under ! this License unless expressly permitted by the GCB Team. ! 3. You may use the provided Material, for personal use only, in conjunction ! with GCB software directly distributed by the GCB Team. NO WARRANTY ! 4. THERE IS NO WARRANTY FOR THE MATERIAL PROVIDED, TO THE EXTENT PERMITTED BY ! APPLICABLE LAW. THE MATERIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY ! KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE MATERIAL IS ! WITH YOU. ! 5. IN NO EVENT SHALL THE GCB TEAM BE LIABLE FOR ANY DAMAGES WHATSOEVER, ! INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ! OUT OF THE USE OR INABILITY TO USE THE MATERIAL. END OF TERMS AND CONDITIONS --- NEW FILE: END_USER_LICENSE.txt --- Global Conflict Blue END USER LICENCE AGREEMENT (EULA) 1. Global Conflict Blue (GCB) source code and executables are distributed under the GNU General Public License, Version 2, June 1991. 2. GCB artwork, data, sound, and music files are distributed under the GCB Data License, Version 1. 3. By installing, copying, downloading, accessing or otherwise using this distribution of GCB, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install, access or use this distribution of GCB. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. GCB DATA LICENSE Version 1 For the purpose of identifying the copyright holders, this license defines the "GCB Team" as the following people: * Global Conflict Blue (GCB) Project Manager * Global Conflict Blue Members The names and e-mails of those people are listed in the GCB site at the address: http://www.gcblue.com Material to which this license applies may include but is not limited to the following: * Texts * Scenario Files * 3D Models * Images * Sounds * Musics TERMS AND CONDITIONS FOR USAGE, COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any material or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this GCB Data License. 1. Terms defined in this Article 1, and parenthetically elsewhere, shall throughout this License have the meanings here and there provided. Defined terms may be used in the singular or plural. Definitions: * The "Material", below, refers to any such material or work, and a "work based on the Material" means either the Material or any Derivative Work under copyright law. * "Derivative Work" shall mean a work containing the Material or a portion of it, such as a revision, modification, enhancement, adaptation, translation (including compilation or recompilation by computer), abridgement, condensation, expansion, or any other form in which such preexisting works may be recast, transformed, or adapted, and that, if prepared without authorization of the owner of the copyright in such preexisting work, would constitute a copyright infringement. * Each licensee is addressed as "you". 2. You may not copy, modify, publish, transmit, sell, participate in the transfer or sale or reproduce, create Derivative Works from, distribute, perform, display or in any way exploit any of the Material released under this License unless expressly permitted by the GCB Team. 3. You may use the provided Material, for personal use only, in conjunction with GCB software directly distributed by the GCB Team. NO WARRANTY 4. THERE IS NO WARRANTY FOR THE MATERIAL PROVIDED, TO THE EXTENT PERMITTED BY APPLICABLE LAW. THE MATERIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE MATERIAL IS WITH YOU. 5. IN NO EVENT SHALL THE GCB TEAM BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE MATERIAL. END OF TERMS AND CONDITIONS |
|
From: Dewitt C. <ddc...@us...> - 2004-06-17 21:00:59
|
Update of /cvsroot/gcblue/gcb_wx/3d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1774/3d Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/3d/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** .cvsignore 4 Dec 2003 22:32:48 -0000 1.7 --- .cvsignore 17 Jun 2004 21:00:46 -0000 1.8 *************** *** 67,68 **** --- 67,69 ---- *.jpg *.png + smoke.rgb \ No newline at end of file |
|
From: Dewitt C. <ddc...@us...> - 2004-06-14 22:38:31
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4824/xml Added Files: options_view.xml Log Message: --- NEW FILE: options_view.xml --- <Window> <Button X="30" Y="65" Width="65" Height="15" Caption="Start" Command="10"/> <Button X="100" Y="65" Width="65" Height="15" Caption="Credits" Command="20"/> <Button X="170" Y="65" Width="65" Height="15" Caption="Database" Command="30"/> <Button X="240" Y="65" Width="65" Height="15" Caption="Network" Command="60"/> <Button X="310" Y="65" Width="65" Height="15" Caption="Scenarios" Command="50"/> <Button X="30" Y="85" Width="150" Height="15" Caption="Display Settings" Command="42"/> </Window> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-14 22:37:23
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3774/src/common Modified Files: tcOptionsView.cpp Log Message: Index: tcOptionsView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptionsView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcOptionsView.cpp 9 Apr 2004 14:09:15 -0000 1.6 --- tcOptionsView.cpp 14 Jun 2004 22:37:11 -0000 1.7 *************** *** 32,240 **** bool tcOptionsView::Init() { ! char zBuff[96]; ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bk.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiBackground = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bon.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOn = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_boff.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOff = new Image(mzwchar,false); ! if (mpiBackground == NULL) { ! WTL("tcOptions - background bitmap (options_bk.jpg) load error"); ! return false; ! } ! if (mpiButtonOn == NULL) { ! WTL("tcOptions - background bitmap (options_bon.bmp) load error"); ! return false; ! } ! if (mpiButtonOff == NULL) { ! WTL("tcOptions - background bitmap (options_boff.bmp) load error"); ! return false; ! } ! FontFamily ff(L"Arial"); ! mpFont = new Font(&ff,12,FontStyleBold,UnitPixel); ! if (mpFont == NULL) { ! WTL("tcOptionsView - mpFont creation failed\n"); ! return false; ! } ! mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB ! if (mpBrush == NULL) { ! WTL("tcOptionsView - mpBrush creation failed\n"); ! return false; ! } ! mpPen = new Pen(Color(255,200,200,200),2); ! if (mpPen == NULL) { ! WTL("tcTOptionsView - mpPen creation failed\n"); ! return false; ! } ! // Get dimensions and limit to window dimensions ! // mpiButtonOn dimensions are used for all buttons ! mnBackgroundWidth = mpiBackground->GetWidth(); ! if (mnBackgroundWidth > mnWidth) {mnBackgroundWidth = mnWidth;} ! mnBackgroundHeight = mpiBackground->GetHeight(); ! if (mnBackgroundHeight > mnHeight) {mnBackgroundHeight = mnHeight;} ! mnButtonWidth = mpiButtonOn->GetWidth(); ! if (mnButtonWidth > mnWidth) {mnButtonWidth = mnWidth;} //limit dimensions to window ! mnButtonHeight = mpiButtonOn->GetHeight(); ! if (mnButtonHeight > mnHeight) {mnButtonHeight = mnHeight;} ! return true; } /*******************************************************************************/ ! int tcOptionsView::Draw() { ! static nTestCount = 0; ! static WCHAR szwchar[256]; // wide char array buffer for string conversion ! Graphics *pGraphics; ! Erase(); ! if (!GetGraphics(pGraphics)) { ! return false; ! } ! if (mpiBackground == NULL) {return false;} ! if (mpOptions == NULL) {return false;} ! pGraphics->DrawImage(mpiBackground,0,0,mnWidth,mnHeight); ! ! mpBrush->SetColor(Color(0xFEFFFFFF)); ! ! /*** Draw test text **/ ! ! tcString sText; ! int xpos,ypos; ! ypos = mnYStart; ! RectF rstring; ! for(int i=0;i<mpOptions->mnNumOptions;i++) { ! xpos = mnXStart; ! int nBoxWidth = maButtonPosition[i][mpOptions->maOptionInfo[i].mnStateCount-1].mnButtonX - ! maButtonPosition[i][0].mnTextX + 2*mnButtonWidth; ! mpBrush->SetColor(Color(0x60FFFFFF)); ! pGraphics->FillRectangle(mpBrush, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ! mpBrush->SetColor(Color(255,255,220,220)); - for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { - sText = mpOptions->maOptionInfo[i].mzCaption[j]; - MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); - pGraphics->MeasureString(szwchar,-1,mpFont,PointF(0,0),&rstring); - maButtonPosition[i][j].mnTextX = xpos; - maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; - xpos += (int)(rstring.Width) + 1; - maButtonPosition[i][j].mnButtonX = xpos; - maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; - xpos += 3*mnButtonWidth; ! } ! pGraphics->DrawRectangle(mpPen, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ! ypos += 3*mnButtonHeight; ! } ! ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { ! sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); ! pGraphics->DrawString(szwchar, -1, mpFont, ! PointF((float)maButtonPosition[i][j].mnTextX, (float)maButtonPosition[i][j].mnTextY), ! mpBrush); ! ! ! if (mpOptions->maOptionInfo[i].mnValue == j) { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,1); ! } ! else { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,0); ! } ! } ! } ! ! ReleaseGraphics(pGraphics); ! DrawBorder(); ! return true; } /*******************************************************************************/ void tcOptionsView::DrawButton(Graphics *apGraphics, int x, int y, int abOn) { ! Image *pButton; ! if (apGraphics == NULL) {return;} ! pButton = (abOn == 1) ? mpiButtonOn : mpiButtonOff; ! if (pButton == NULL) {return;} ! apGraphics->DrawImage(pButton,x,y); } /******************************************************************************/ void tcOptionsView::OnLButtonDown(wxMouseEvent& event) { ! bool bButtonClicked; ! int nOption, nValue; ! if (!mbActive) ! { ! event.Skip(); ! return; ! } ! // TranslatePoint(point); // adjust for flipped up/down ! bButtonClicked = ButtonContainingPoint(event.GetPosition(), nOption, nValue); ! if (bButtonClicked) { ! if ((nOption >= mpOptions->mnNumOptions)|| ! (nValue >= mpOptions->maOptionInfo[nOption].mnStateCount)) { ! WTL("tcOptionsView::OnLButtonDown error"); ! return; ! } ! mpOptions->maOptionInfo[nOption].mnValue = nValue; ! if (mpOptions->maOptionInfo[nOption].mpAssociated != NULL) { ! *mpOptions->maOptionInfo[nOption].mpAssociated = nValue; ! } ! mpOptions->Serialize(false); // create new options file - tcSound::Get()->PlayEffect(SEFFECT_BEEP2); - } - else - { - // switch back to start view if no buttons clicked (for now) - wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_STARTVIEW) ; - command.SetEventObject(this); - AddPendingEvent(command); - } - } /******************************************************************************/ bool tcOptionsView::ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue) { ! int i,j; ! int nx, ny; ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { ! nx = maButtonPosition[i][j].mnButtonX; ! ny = maButtonPosition[i][j].mnButtonY; ! wxRect cr(nx,ny,mnButtonWidth,mnButtonHeight); ! if (cr.Inside(point)) { ! rnOption = i; ! rnValue = j; ! return true; ! } ! } ! } ! return false; } --- 32,245 ---- bool tcOptionsView::Init() { ! char zBuff[96]; ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bk.jpg"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiBackground = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_bon.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOn = new Image(mzwchar,false); ! strcpy(zBuff,IMAGE_PATH); ! strcat(zBuff,"options_boff.bmp"); ! MultiByteToWideChar(CP_ACP, 0, zBuff, -1, mzwchar, 255); ! mpiButtonOff = new Image(mzwchar,false); ! if (mpiBackground == NULL) { ! WTL("tcOptions - background bitmap (options_bk.jpg) load error"); ! return false; ! } ! if (mpiButtonOn == NULL) { ! WTL("tcOptions - background bitmap (options_bon.bmp) load error"); ! return false; ! } ! if (mpiButtonOff == NULL) { ! WTL("tcOptions - background bitmap (options_boff.bmp) load error"); ! return false; ! } ! FontFamily ff(L"Arial"); ! mpFont = new Font(&ff,12,FontStyleBold,UnitPixel); ! if (mpFont == NULL) { ! WTL("tcOptionsView - mpFont creation failed\n"); ! return false; ! } ! mpBrush = new SolidBrush(Color(0xFEFFFFFF)); // color is ARGB ! if (mpBrush == NULL) { ! WTL("tcOptionsView - mpBrush creation failed\n"); ! return false; ! } ! mpPen = new Pen(Color(255,200,200,200),2); ! if (mpPen == NULL) { ! WTL("tcTOptionsView - mpPen creation failed\n"); ! return false; ! } ! // Get dimensions and limit to window dimensions ! // mpiButtonOn dimensions are used for all buttons ! mnBackgroundWidth = mpiBackground->GetWidth(); ! if (mnBackgroundWidth > mnWidth) {mnBackgroundWidth = mnWidth;} ! mnBackgroundHeight = mpiBackground->GetHeight(); ! if (mnBackgroundHeight > mnHeight) {mnBackgroundHeight = mnHeight;} ! mnButtonWidth = mpiButtonOn->GetWidth(); ! if (mnButtonWidth > mnWidth) {mnButtonWidth = mnWidth;} //limit dimensions to window ! mnButtonHeight = mpiButtonOn->GetHeight(); ! if (mnButtonHeight > mnHeight) {mnButtonHeight = mnHeight;} ! return true; } /*******************************************************************************/ ! int tcOptionsView::Draw() ! { ! static nTestCount = 0; ! static WCHAR szwchar[256]; // wide char array buffer for string conversion ! Graphics *pGraphics; ! Erase(); ! if (!GetGraphics(pGraphics)) { ! return false; ! } ! if (mpiBackground == NULL) {return false;} ! if (mpOptions == NULL) {return false;} ! pGraphics->DrawImage(mpiBackground,0,0,mnWidth,mnHeight); ! mpBrush->SetColor(Color(0xFEFFFFFF)); ! /*** Draw test text **/ ! tcString sText; ! int xpos,ypos; ! ypos = mnYStart; ! RectF rstring; ! for(int i=0;i<mpOptions->mnNumOptions;i++) { ! xpos = mnXStart; ! int nBoxWidth = maButtonPosition[i][mpOptions->maOptionInfo[i].mnStateCount-1].mnButtonX - ! maButtonPosition[i][0].mnTextX + 2*mnButtonWidth; ! mpBrush->SetColor(Color(0x60FFFFFF)); ! pGraphics->FillRectangle(mpBrush, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ! mpBrush->SetColor(Color(255,255,220,220)); ! for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { ! sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); ! pGraphics->MeasureString(szwchar,-1,mpFont,PointF(0,0),&rstring); ! maButtonPosition[i][j].mnTextX = xpos; ! maButtonPosition[i][j].mnTextY = ypos-mnButtonHeight+2; ! xpos += (int)(rstring.Width) + 1; ! maButtonPosition[i][j].mnButtonX = xpos; ! maButtonPosition[i][j].mnButtonY = ypos-mnButtonHeight-mnButtonHeight/6; ! xpos += 3*mnButtonWidth; ! ! } ! ! pGraphics->DrawRectangle(mpPen, ! maButtonPosition[i][0].mnTextX - mnButtonHeight/2, ypos - 3*mnButtonHeight/2, ! nBoxWidth, 2*mnButtonHeight); ! ! ypos += 3*mnButtonHeight; ! } ! ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(int j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { ! sText = mpOptions->maOptionInfo[i].mzCaption[j]; ! MultiByteToWideChar(CP_ACP, 0, sText.GetBuffer(), -1, szwchar, 255); ! pGraphics->DrawString(szwchar, -1, mpFont, ! PointF((float)maButtonPosition[i][j].mnTextX, (float)maButtonPosition[i][j].mnTextY), ! mpBrush); ! ! ! if (mpOptions->maOptionInfo[i].mnValue == j) { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,1); ! } ! else { ! DrawButton(pGraphics,maButtonPosition[i][j].mnButtonX, ! maButtonPosition[i][j].mnButtonY,0); ! } ! } ! } ! ! DrawChildren(pGraphics); ! ! ReleaseGraphics(pGraphics); ! DrawBorder(); ! return true; } /*******************************************************************************/ void tcOptionsView::DrawButton(Graphics *apGraphics, int x, int y, int abOn) { ! Image *pButton; ! if (apGraphics == NULL) {return;} ! pButton = (abOn == 1) ? mpiButtonOn : mpiButtonOff; ! if (pButton == NULL) {return;} ! apGraphics->DrawImage(pButton,x,y); } /******************************************************************************/ void tcOptionsView::OnLButtonDown(wxMouseEvent& event) { ! bool bButtonClicked; ! int nOption, nValue; ! if (!mbActive) ! { ! event.Skip(); ! return; ! } ! // TranslatePoint(point); // adjust for flipped up/down ! bButtonClicked = ButtonContainingPoint(event.GetPosition(), nOption, nValue); ! if (bButtonClicked) { ! if ((nOption >= mpOptions->mnNumOptions)|| ! (nValue >= mpOptions->maOptionInfo[nOption].mnStateCount)) { ! WTL("tcOptionsView::OnLButtonDown error"); ! return; ! } ! mpOptions->maOptionInfo[nOption].mnValue = nValue; ! if (mpOptions->maOptionInfo[nOption].mpAssociated != NULL) { ! *mpOptions->maOptionInfo[nOption].mpAssociated = nValue; ! } ! mpOptions->Serialize(false); // create new options file ! ! tcSound::Get()->PlayEffect(SEFFECT_BEEP2); ! } ! else ! { ! /* Now this uses tcStandardWindow button bar to switch back to start ! // switch back to start view if no buttons clicked (for now) ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_STARTVIEW) ; ! command.SetEventObject(this); ! AddPendingEvent(command); ! */ ! } } /******************************************************************************/ bool tcOptionsView::ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue) { ! int i,j; ! int nx, ny; ! for(i=0;i<mpOptions->mnNumOptions;i++) { ! for(j=0;j<mpOptions->maOptionInfo[i].mnStateCount;j++) { ! nx = maButtonPosition[i][j].mnButtonX; ! ny = maButtonPosition[i][j].mnButtonY; ! wxRect cr(nx,ny,mnButtonWidth,mnButtonHeight); ! if (cr.Inside(point)) { ! rnOption = i; ! rnValue = j; ! return true; ! } ! } ! } ! return false; } *************** *** 243,278 **** ////////////////////////////////////////////////////////////////////// ! tcOptionsView::tcOptionsView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name, tcWindow *sharedSurface) : ! tcWindow(parent, pos, size, name, sharedSurface) { ! mpiBackground = NULL; ! mpiButtonOn = NULL; ! mpiButtonOff = NULL; ! mpOptions = NULL; ! mpFont = NULL; ! mpBrush = NULL; ! mnXStart = 100; ! mnYStart = 100; ! for(int i=0;i<N_OPTIONS;i++) ! { ! for(int k=0;k<N_OPTION_VALUES;k++) ! { ! maButtonPosition[i][k].mnButtonX = -100; ! maButtonPosition[i][k].mnButtonY = -100; ! maButtonPosition[i][k].mnTextX = -100; ! maButtonPosition[i][k].mnTextY = -100; ! } ! } } tcOptionsView::~tcOptionsView() { ! if (mpiBackground != NULL) {delete mpiBackground;} ! if (mpiButtonOn != NULL) {delete mpiButtonOn;} ! if (mpiButtonOff != NULL) {delete mpiButtonOff;} ! if (mpFont != NULL) {delete mpFont;} ! if (mpBrush != NULL) {delete mpBrush;} ! if (mpPen != NULL) {delete mpPen;} } --- 248,295 ---- ////////////////////////////////////////////////////////////////////// ! tcOptionsView::tcOptionsView(wxWindow *parent, tcWindow *surfaceHost, ! const wxPoint& pos, const wxSize& size, const wxString& name) ! : ! tcStandardWindow(parent, pos, size, "xml/options_view.xml", name, surfaceHost) { ! wxASSERT(surfaceHost); ! ! if (config) ! { ! AddXMLControls(); ! } ! else ! { ! fprintf(stderr, "tcOptionsView::tcOptionsView - NULL xml config node\n"); ! return; ! } ! ! mpiBackground = NULL; ! mpiButtonOn = NULL; ! mpiButtonOff = NULL; ! mpOptions = NULL; ! mpFont = NULL; ! mpBrush = NULL; ! mnXStart = 100; ! mnYStart = 150; ! for(int i=0;i<N_OPTIONS;i++) ! { ! for(int k=0;k<N_OPTION_VALUES;k++) ! { ! maButtonPosition[i][k].mnButtonX = -100; ! maButtonPosition[i][k].mnButtonY = -100; ! maButtonPosition[i][k].mnTextX = -100; ! maButtonPosition[i][k].mnTextY = -100; ! } ! } } tcOptionsView::~tcOptionsView() { ! if (mpiBackground != NULL) {delete mpiBackground;} ! if (mpiButtonOn != NULL) {delete mpiButtonOn;} ! if (mpiButtonOff != NULL) {delete mpiButtonOff;} ! if (mpFont != NULL) {delete mpFont;} ! if (mpBrush != NULL) {delete mpBrush;} ! if (mpPen != NULL) {delete mpPen;} } |
|
From: Dewitt C. <ddc...@us...> - 2004-06-14 22:37:22
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3774/xml Modified Files: network_view.xml Log Message: Index: network_view.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/network_view.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** network_view.xml 14 Jun 2004 21:52:55 -0000 1.3 --- network_view.xml 14 Jun 2004 22:37:12 -0000 1.4 *************** *** 3,7 **** <Button X="100" Y="50" Width="65" Height="15" Caption="Credits" Command="20"/> <Button X="170" Y="50" Width="65" Height="15" Caption="Database" Command="30"/> ! <Button X="240" Y="50" Width="65" Height="15" Caption="Options" Command="42"/> <Button X="310" Y="50" Width="65" Height="15" Caption="Scenarios" Command="50"/> --- 3,7 ---- <Button X="100" Y="50" Width="65" Height="15" Caption="Credits" Command="20"/> <Button X="170" Y="50" Width="65" Height="15" Caption="Database" Command="30"/> ! <Button X="240" Y="50" Width="65" Height="15" Caption="Options" Command="40"/> <Button X="310" Y="50" Width="65" Height="15" Caption="Scenarios" Command="50"/> |
|
From: Dewitt C. <ddc...@us...> - 2004-06-14 22:37:22
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3774/include/sim Modified Files: Game.h Log Message: Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Game.h 14 Jun 2004 21:52:47 -0000 1.38 --- Game.h 14 Jun 2004 22:37:11 -0000 1.39 *************** *** 220,225 **** void CheckGoals(); ///< checks if any win/loss goals satisfied void ConsoleMessage(const char *s); ///< print string to info console ! void NewHook(wxCommandEvent& event); void OnChar(wxKeyEvent& event); void OnEraseBackground(wxEraseEvent& event); --- 220,226 ---- void CheckGoals(); ///< checks if any win/loss goals satisfied void ConsoleMessage(const char *s); ///< print string to info console ! void HookSomethingFriendly(); ///< used to avoid blank 3D screen in rand scenario void NewHook(wxCommandEvent& event); + void NewHook(long hookID); void OnChar(wxKeyEvent& event); void OnEraseBackground(wxEraseEvent& event); |