[Sphere-axis-commits] CVS: UOMap Resource.h,1.2,1.3 UOMap.odl,1.3,1.4 UOMap.rc,1.6,1.7 UOMapCtl.cpp,
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2002-05-28 19:13:10
|
Update of /cvsroot/sphere-axis/UOMap In directory usw-pr-cvs1:/tmp/cvs-serv5723 Modified Files: Resource.h UOMap.odl UOMap.rc UOMapCtl.cpp UOMapCtl.h UOMapPpg.cpp UOMapPpg.h Log Message: Support for map2 and statics2. Index: Resource.h =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/Resource.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Resource.h 1 May 2002 03:42:44 -0000 1.2 --- Resource.h 28 May 2002 19:13:01 -0000 1.3 *************** *** 1,25 **** - /* - $Id$ - - ********************************************************************** - * Copyright (C) Philip A. Esterle 2000-2002 - * - * This program 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. - * - * 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 - * - ********************************************************************** - - */ - //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. --- 1,2 ---- *************** *** 35,38 **** --- 12,16 ---- #define IDC_MAPY 203 #define IDC_ZOOMLEVEL 204 + #define IDC_MAPFILE 205 // Next default values for new objects *************** *** 42,46 **** #define _APS_NEXT_RESOURCE_VALUE 201 #define _APS_NEXT_COMMAND_VALUE 32768 ! #define _APS_NEXT_CONTROL_VALUE 205 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 20,24 ---- #define _APS_NEXT_RESOURCE_VALUE 201 #define _APS_NEXT_COMMAND_VALUE 32768 ! #define _APS_NEXT_CONTROL_VALUE 206 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: UOMap.odl =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMap.odl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** UOMap.odl 1 Sep 2001 17:32:19 -0000 1.3 --- UOMap.odl 28 May 2002 19:13:01 -0000 1.4 *************** *** 28,35 **** //{{AFX_ODL_PROP(CUOMapCtrl) [id(DISPID_READYSTATE), readonly] long ReadyState; ! [id(1)] short ZoomLevel; ! [id(2)] short xCenter; ! [id(3)] short yCenter; ! [id(4)] boolean DrawStatics; //}}AFX_ODL_PROP --- 28,36 ---- //{{AFX_ODL_PROP(CUOMapCtrl) [id(DISPID_READYSTATE), readonly] long ReadyState; ! [id(2)] short ZoomLevel; ! [id(3)] short xCenter; ! [id(4)] short yCenter; ! [id(5)] boolean DrawStatics; ! [id(1)] short MapFile; //}}AFX_ODL_PROP *************** *** 38,63 **** // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CUOMapCtrl) ! [id(5)] void ZoomIn(); ! [id(6)] void ZoomOut(); ! [id(7)] void SetCenter(short x, short y); ! [id(8)] void Scroll(short direction, short distance); ! [id(9)] void CtrlToMap(short* x, short* y); ! [id(10)] void MapToCtrl(short* x, short* y); ! [id(11)] void GetCenter(short* x, short* y); ! [id(12)] short CtrlToMapX(short x); ! [id(13)] short CtrlToMapY(short y); ! [id(14)] short MapToCtrlX(short x); ! [id(15)] short MapToCtrlY(short y); ! [id(16)] short GetMapHeight(short x, short y); ! [id(17)] long AddDrawObject(short x, short y, short type, short size, long color); ! [id(18)] boolean RemoveDrawObject(short x, short y, short type, short size, long color); ! [id(19)] boolean RemoveDrawObjectAt(long index); ! [id(20)] void RemoveDrawObjects(); ! [id(21)] long AddDrawRect(short xleft, short ytop, short width, short height, short mode, long color); ! [id(22)] void RemoveDrawRects(); ! [id(23)] boolean RemoveDrawRectAt(long index); ! [id(24)] boolean RemoveDrawRect(short x, short y, short width, short height, short mode, long color); ! [id(25)] void SetClientPath(BSTR pszClientPath); ! [id(26)] long GetCenterBlock(); //}}AFX_ODL_METHOD }; --- 39,66 ---- // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CUOMapCtrl) ! [id(6)] void ZoomIn(); ! [id(7)] void ZoomOut(); ! [id(8)] void SetCenter(short x, short y); ! [id(9)] void Scroll(short direction, short distance); ! [id(10)] void CtrlToMap(short* x, short* y); ! [id(11)] void MapToCtrl(short* x, short* y); ! [id(12)] void GetCenter(short* x, short* y); ! [id(13)] short CtrlToMapX(short x); ! [id(14)] short CtrlToMapY(short y); ! [id(15)] short MapToCtrlX(short x); ! [id(16)] short MapToCtrlY(short y); ! [id(17)] short GetMapHeight(short x, short y); ! [id(18)] long AddDrawObject(short x, short y, short type, short size, long color); ! [id(19)] boolean RemoveDrawObject(short x, short y, short type, short size, long color); ! [id(20)] boolean RemoveDrawObjectAt(long index); ! [id(21)] void RemoveDrawObjects(); ! [id(22)] long AddDrawRect(short xleft, short ytop, short width, short height, short mode, long color); ! [id(23)] void RemoveDrawRects(); ! [id(24)] boolean RemoveDrawRectAt(long index); ! [id(25)] boolean RemoveDrawRect(short x, short y, short width, short height, short mode, long color); ! [id(26)] void SetClientPath(BSTR pszClientPath); ! [id(27)] long GetCenterBlock(); ! [id(28)] short GetMapfile(); ! [id(29)] void SetMapfile(short mapfile); //}}AFX_ODL_METHOD }; Index: UOMap.rc =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMap.rc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** UOMap.rc 12 May 2002 16:18:18 -0000 1.6 --- UOMap.rc 28 May 2002 19:13:01 -0000 1.7 *************** *** 1,27 **** - /* - // Last compiled 5/12/2002 at 10:17:1 - - ********************************************************************** - * Copyright (C) Philip A. Esterle 2000-2002 - * - * This program 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. - * - * 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 - * - ********************************************************************** - - */ - //Microsoft Developer Studio generated resource script. ! // Last compiled 4/30/2002 at 22:11:0 #include "resource.h" --- 1,4 ---- //Microsoft Developer Studio generated resource script. ! // #include "resource.h" *************** *** 143,146 **** --- 120,125 ---- LTEXT "Initial Zoom Level",IDC_STATIC,7,41,56,8 EDITTEXT IDC_ZOOMLEVEL,77,39,35,12,ES_AUTOHSCROLL + LTEXT "Mapfile",IDC_STATIC,40,55,24,8 + EDITTEXT IDC_MAPFILE,77,53,35,12,ES_AUTOHSCROLL | ES_NUMBER END Index: UOMapCtl.cpp =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMapCtl.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** UOMapCtl.cpp 12 May 2002 16:17:52 -0000 1.6 --- UOMapCtl.cpp 28 May 2002 19:13:01 -0000 1.7 *************** *** 39,44 **** #endif ! #define UO_X_SIZE 6144 ! #define UO_Y_SIZE 4096 #define UO_X_CENTER (UO_X_SIZE / 2) #define UO_Y_CENTER (UO_Y_SIZE / 2) --- 39,44 ---- #endif ! #define UO_X_SIZE m_maxX ! #define UO_Y_SIZE m_maxY #define UO_X_CENTER (UO_X_SIZE / 2) #define UO_Y_CENTER (UO_Y_SIZE / 2) *************** *** 122,125 **** --- 122,126 ---- BEGIN_DISPATCH_MAP(CUOMapCtrl, COleControl) //{{AFX_DISPATCH_MAP(CUOMapCtrl) + DISP_PROPERTY_EX(CUOMapCtrl, "MapFile", GetMapfile, SetMapfile, VT_I2) DISP_PROPERTY_EX(CUOMapCtrl, "ZoomLevel", GetZoomLevel, SetZoomLevel, VT_I2) DISP_PROPERTY_EX(CUOMapCtrl, "xCenter", GetXCenter, SetXCenter, VT_I2) *************** *** 148,151 **** --- 149,154 ---- DISP_FUNCTION(CUOMapCtrl, "SetClientPath", SetClientPath, VT_EMPTY, VTS_BSTR) DISP_FUNCTION(CUOMapCtrl, "GetCenterBlock", GetCenterBlock, VT_I4, VTS_NONE) + DISP_FUNCTION(CUOMapCtrl, "GetMapfile", GetMapfile, VT_I2, VTS_NONE) + DISP_FUNCTION(CUOMapCtrl, "SetMapfile", SetMapfile, VT_EMPTY, VTS_I2) DISP_STOCKPROP_READYSTATE() //}}AFX_DISPATCH_MAP *************** *** 285,288 **** --- 288,295 ---- SetModifiedFlag(); LoadRadarcol(); + + m_mulfile = 0; + m_maxX = 6144; + m_maxY = 4096; } *************** *** 334,342 **** COleControl::DoPropExchange(pPX); - // TODO: Call PX_ functions for each persistent custom property. PX_Bool(pPX, _T("DrawStatics"), m_bDrawStatics, FALSE); PX_Short(pPX, _T("xCenter"), m_xCenter, UO_X_CENTER); PX_Short(pPX, _T("yCenter"), m_yCenter, UO_Y_CENTER); PX_Short(pPX, _T("ZoomLevel"), m_zoomLevel, 0); } --- 341,349 ---- COleControl::DoPropExchange(pPX); PX_Bool(pPX, _T("DrawStatics"), m_bDrawStatics, FALSE); PX_Short(pPX, _T("xCenter"), m_xCenter, UO_X_CENTER); PX_Short(pPX, _T("yCenter"), m_yCenter, UO_Y_CENTER); PX_Short(pPX, _T("ZoomLevel"), m_zoomLevel, 0); + PX_Short(pPX, _T("MapFile"), m_mapfile, 0); } *************** *** 540,550 **** CString csStaticFileName; ! csMapFileName.Format(_T("%smap0.mul"), m_csUOPath); if (!cfMapFile.Open(csMapFileName, CFile::modeRead | CFile::shareDenyNone)) return; if ( bDrawStatics ) { ! csStaticIdxName.Format(_T("%sstaidx0.mul"), m_csUOPath); ! csStaticFileName.Format(_T("%sstatics0.mul"), m_csUOPath); if (!cfStaticIdx.Open(csStaticIdxName, CFile::modeRead | CFile::shareDenyNone)) { --- 547,557 ---- CString csStaticFileName; ! csMapFileName.Format(_T("%smap%d.mul"), m_csUOPath, m_mulfile); if (!cfMapFile.Open(csMapFileName, CFile::modeRead | CFile::shareDenyNone)) return; if ( bDrawStatics ) { ! csStaticIdxName.Format(_T("%sstaidx%d.mul"), m_csUOPath, m_mulfile); ! csStaticFileName.Format(_T("%sstatics%d.mul"), m_csUOPath, m_mulfile); if (!cfStaticIdx.Open(csStaticIdxName, CFile::modeRead | CFile::shareDenyNone)) { *************** *** 1325,1329 **** CFile fMap; CString csMapFile; ! csMapFile.Format(_T("%smap0.mul"), m_csUOPath); if ( !fMap.Open(csMapFile, CFile::modeRead | CFile::typeBinary | CFile::shareDenyNone) ) return 0; --- 1332,1336 ---- CFile fMap; CString csMapFile; ! csMapFile.Format(_T("%smap%d.mul"), m_csUOPath, m_mulfile); if ( !fMap.Open(csMapFile, CFile::modeRead | CFile::typeBinary | CFile::shareDenyNone) ) return 0; *************** *** 1474,1476 **** --- 1481,1513 ---- long lBlock = ( m_xCenter / 8 ) * 512 + ( m_yCenter / 8); return lBlock; + } + + short CUOMapCtrl::GetMapfile() + { + return m_mulfile; + } + + void CUOMapCtrl::SetMapfile(short mapfile) + { + switch ( mapfile ) + { + case 0: + m_maxX = 6144; + m_maxY = 4096; + break; + case 2: + m_maxX = 2304; + m_maxY = 1600; + break; + default: + // Don't know about this one + return; + } + // Make sure the current coords are within the bounds + if ( m_xCenter > m_maxX ) + m_xCenter = UO_X_CENTER; + if ( m_yCenter > m_maxY ) + m_yCenter = UO_Y_CENTER; + m_mulfile = mapfile; + SetInvalid(); } Index: UOMapCtl.h =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMapCtl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** UOMapCtl.h 1 May 2002 03:42:44 -0000 1.4 --- UOMapCtl.h 28 May 2002 19:13:01 -0000 1.5 *************** *** 117,120 **** --- 117,125 ---- CPoint m_ptMouse; + int m_maxX; + int m_maxY; + + short m_mulfile; + DECLARE_OLECREATE_EX(CUOMapCtrl) // Class factory and guid DECLARE_OLETYPELIB(CUOMapCtrl) // GetTypeInfo *************** *** 134,137 **** --- 139,143 ---- // Dispatch maps //{{AFX_DISPATCH(CUOMapCtrl) + short m_mapfile; afx_msg short GetZoomLevel(); afx_msg void SetZoomLevel(short nNewValue); *************** *** 164,167 **** --- 170,175 ---- afx_msg void SetClientPath(LPCTSTR pszClientPath); afx_msg long GetCenterBlock(); + afx_msg short GetMapfile(); + afx_msg void SetMapfile(short mapfile); //}}AFX_DISPATCH DECLARE_DISPATCH_MAP() *************** *** 182,211 **** enum { //{{AFX_DISP_ID(CUOMapCtrl) ! dispidZoomLevel = 1L, ! dispidXCenter = 2L, ! dispidYCenter = 3L, ! dispidDrawStatics = 4L, ! dispidZoomIn = 5L, ! dispidZoomOut = 6L, ! dispidSetCenter = 7L, ! dispidScroll = 8L, ! dispidCtrlToMap = 9L, ! dispidMapToCtrl = 10L, ! dispidGetCenter = 11L, ! dispidCtrlToMapX = 12L, ! dispidCtrlToMapY = 13L, ! dispidMapToCtrlX = 14L, ! dispidMapToCtrlY = 15L, ! dispidGetMapHeight = 16L, ! dispidAddDrawObject = 17L, ! dispidRemoveDrawObject = 18L, ! dispidRemoveDrawObjectAt = 19L, ! dispidRemoveDrawObjects = 20L, ! dispidAddDrawRect = 21L, ! dispidRemoveDrawRects = 22L, ! dispidRemoveDrawRectAt = 23L, ! dispidRemoveDrawRect = 24L, ! dispidSetClientPath = 25L, ! dispidGetCenterBlock = 26L, //}}AFX_DISP_ID }; --- 190,222 ---- enum { //{{AFX_DISP_ID(CUOMapCtrl) ! dispidZoomLevel = 2L, ! dispidXCenter = 3L, ! dispidYCenter = 4L, ! dispidDrawStatics = 5L, ! dispidMapFile = 1L, ! dispidZoomIn = 6L, ! dispidZoomOut = 7L, ! dispidSetCenter = 8L, ! dispidScroll = 9L, ! dispidCtrlToMap = 10L, ! dispidMapToCtrl = 11L, ! dispidGetCenter = 12L, ! dispidCtrlToMapX = 13L, ! dispidCtrlToMapY = 14L, ! dispidMapToCtrlX = 15L, ! dispidMapToCtrlY = 16L, ! dispidGetMapHeight = 17L, ! dispidAddDrawObject = 18L, ! dispidRemoveDrawObject = 19L, ! dispidRemoveDrawObjectAt = 20L, ! dispidRemoveDrawObjects = 21L, ! dispidAddDrawRect = 22L, ! dispidRemoveDrawRects = 23L, ! dispidRemoveDrawRectAt = 24L, ! dispidRemoveDrawRect = 25L, ! dispidSetClientPath = 26L, ! dispidGetCenterBlock = 27L, ! dispidGetMapfile = 28L, ! dispidSetMapfile = 29L, //}}AFX_DISP_ID }; Index: UOMapPpg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMapPpg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** UOMapPpg.cpp 1 May 2002 03:42:44 -0000 1.2 --- UOMapPpg.cpp 28 May 2002 19:13:01 -0000 1.3 *************** *** 81,84 **** --- 81,85 ---- m_yCenter = 0; m_sZoomLevel = 0; + m_iMapfile = 0; //}}AFX_DATA_INIT *************** *** 103,106 **** --- 104,109 ---- DDP_Text(pDX, IDC_ZOOMLEVEL, m_sZoomLevel, _T("ZoomLevel") ); DDX_Text(pDX, IDC_ZOOMLEVEL, m_sZoomLevel); + DDP_Text(pDX, IDC_MAPFILE, m_iMapfile, _T("MapFile")); + DDX_Text(pDX, IDC_MAPFILE, m_iMapfile); //}}AFX_DATA_MAP DDP_PostProcessing(pDX); Index: UOMapPpg.h =================================================================== RCS file: /cvsroot/sphere-axis/UOMap/UOMapPpg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** UOMapPpg.h 1 May 2002 03:42:44 -0000 1.2 --- UOMapPpg.h 28 May 2002 19:13:01 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- short m_yCenter; short m_sZoomLevel; + int m_iMapfile; //}}AFX_DATA |