[Gcblue-commits] gcb_wx/include/sim tcDemTileReader.h,NONE,1.1 tcMapData.h,1.6,1.7 tcUserInfo.h,1.3,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-06-24 01:43:57
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/include/sim Modified Files: tcMapData.h tcUserInfo.h Added Files: tcDemTileReader.h Log Message: Index: tcUserInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcUserInfo.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcUserInfo.h 19 Nov 2003 01:36:14 -0000 1.3 --- tcUserInfo.h 24 Jun 2004 01:43:43 -0000 1.4 *************** *** 29,33 **** --- 29,35 ---- #include "wx/wx.h" + #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions + #endif class tcUserInfo --- NEW FILE: tcDemTileReader.h --- /** ** @file tcDemTileReader.h ** ** Header for the tcDemTileReader.h class. ** ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if !defined _TCDEMTILEREADER_H_ #define _TCDEMTILEREADER_H_ #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif #include "tcFile.h" #include <map> /** * Class to read and keep track of which DEM tiles are available */ class tcDemTileReader { public: enum { M_DEMTILE = 1200, N_DEMTILE = 1200 }; int GetTileWidth() const {return N_DEMTILE;} int GetTileHeight() const {return M_DEMTILE;} bool IsTileAvailable(int lat, int lon); void LoadDemTile(tcFile& tileFile, int lat_deg, int lon_deg); tcDemTileReader(); ~tcDemTileReader(); private: tcString mzDemPath; std::map<long, bool> tileStatus; void GetTileName(wxString& nameString, int lat_deg, int lon_deg); void KeyToLatLon(long key, int& lat, int& lon); long LatLonToKey(int lat, int lon); void MarkTileUnavailable(int lat, int lon); void ScanTiles(); }; #endif Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapData.h 21 Jun 2004 22:21:59 -0000 1.6 --- tcMapData.h 24 Jun 2004 01:43:43 -0000 1.7 *************** *** 48,53 **** #define M_TILE 60 #define N_TILE 60 ! #define M_DEMTILE 1200 ! #define N_DEMTILE 1200 #define NULL_TILE 0xFFFF #define TILE_AGEOUT (double)30.0 --- 48,53 ---- #define M_TILE 60 #define N_TILE 60 ! //#define M_DEMTILE 1200 ! //#define N_DEMTILE 1200 #define NULL_TILE 0xFFFF #define TILE_AGEOUT (double)30.0 *************** *** 57,60 **** --- 57,62 ---- #define ME(x) ReportMapDataError(x); + class tcDemTileReader; + struct tsDemInfo { *************** *** 100,104 **** class tcMapData { ! public: void AgeOutTiles(double afStatusTime); void AttachOptions(tcOptions *pOptions) {mpOptions=pOptions;mnCurrentMapMode=pOptions->mnMapMode;} --- 102,110 ---- class tcMapData { ! public: ! enum ! { ! MISSING_DATA_VAL = -32383 ! }; void AgeOutTiles(double afStatusTime); void AttachOptions(tcOptions *pOptions) {mpOptions=pOptions;mnCurrentMapMode=pOptions->mnMapMode;} *************** *** 132,136 **** tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; ! tcString mzDemPath; int GetLowResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); int GetHighResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); --- 138,142 ---- tcOptions *mpOptions; tsDemInfo maDemInfo[N_DEMFILES]; ! int GetLowResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); int GetHighResBltList(tcRect view, int anWidth, int anHeight, RECT *aaSource, RECT *aaDest); *************** *** 144,148 **** long maPalette1[1024]; int mnCurrentMapMode; ///< versus requested map mode in options ! bool mbUseDefaultMap; unsigned short maTileLookup[M_TILE_LOOKUP][N_TILE_LOOKUP]; // 506k lookup table, 0.5 deg tiles --- 150,155 ---- long maPalette1[1024]; int mnCurrentMapMode; ///< versus requested map mode in options ! ! tcDemTileReader* demTileReader; unsigned short maTileLookup[M_TILE_LOOKUP][N_TILE_LOOKUP]; // 506k lookup table, 0.5 deg tiles *************** *** 153,163 **** unsigned short mnReturnIndex; ///< maAvailableTiles index for deallocation tsTileData* GetTile(unsigned mtile, unsigned ntile, double afStatusTime); ! void LoadDemTile(tcFile& tileFile, int lat_deg, int lon_deg); tsTileData* LoadTile(unsigned mtile, unsigned ntile); tsTileData* LoadTileB(unsigned mtile, unsigned ntile); void CreatePalettes(); ! void GetTileName(wxString& nameString, int lat_deg, int lon_deg); void LabelLowRes(); int ReadHighResData(int M, int N, int mstart, int nstart, tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); --- 160,175 ---- unsigned short mnReturnIndex; ///< maAvailableTiles index for deallocation tsTileData* GetTile(unsigned mtile, unsigned ntile, double afStatusTime); ! tsTileData* LoadTile(unsigned mtile, unsigned ntile); tsTileData* LoadTileB(unsigned mtile, unsigned ntile); + tsTileData* LoadTileFromLowRes(unsigned mtile, unsigned ntile); + void CreatePalettes(); ! void DarkenLowResUnavailable(UINT32* imageData); void LabelLowRes(); + + void FillInvalidHighResData(int M, int N, int mstart, int nstart, + tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); int ReadHighResData(int M, int N, int mstart, int nstart, tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); *************** *** 165,168 **** --- 177,181 ---- tcFile *pMain, tcFile *pEast, tcFile *pSouth, tcFile *pSouthEast); int ReadHighResDataDefault(int M, int N, int mstart, int nstart,tcFile *pMain); + void ReportMapDataError(UINT32 anError); void SetDemInfo(); |