summaryrefslogtreecommitdiff
path: root/src/T2DLL/UT2Coordinate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/UT2Coordinate.h')
-rw-r--r--src/T2DLL/UT2Coordinate.h84
1 files changed, 43 insertions, 41 deletions
diff --git a/src/T2DLL/UT2Coordinate.h b/src/T2DLL/UT2Coordinate.h
index a9e3586..d3cfbcb 100644
--- a/src/T2DLL/UT2Coordinate.h
+++ b/src/T2DLL/UT2Coordinate.h
@@ -1,47 +1,49 @@
#pragma once
#include "common.h"
-class UT2Coordinate {
+class AFX_EXT_CLASS UT2Coordinate {
public:
- static void UnitToQD(int&, int&, int);
- static void UnitToQD(POINT&, int, int);
- static void UnitToQD(RECT&, int, int);
- static void UnitToQD(const RECT&, RECT&, int, int);
- static void UnitToQDRoof(const RECT&, RECT&, int);
- static void UnitToQDFloor(const RECT&, RECT&, int);
- static void UnitToOffRect(const RECT&, RECT&, int);
- static void QDToUnit(int&, int&, int);
- static void QDToUnit(POINT&, int);
- static void QDToUnit(SDimension16&, int);
- static void QDToUnit(RECT&, int);
- static void QDToUnit(const RECT&, RECT&, int);
- static void NoRoofQDToUnit(const RECT&, RECT&, int);
- static void BkgndToQD(int&, int&, int);
- static void BkgndToQD(POINT&, int);
- static void BkgndToQD(RECT&, int);
- static void BkgndToQD(const RECT&, RECT&, int);
- static void QDToBkgnd(int&, int&, int);
- static void QDToBkgnd(POINT&, int);
- static void QDToBkgnd(SDimension16&, int);
- static void QDToBkgnd(RECT&, int);
- static void QDToBkgnd(const RECT&, RECT&, int);
- static void UnitToBkgnd(const RECT&, RECT&);
- static void BkgndToUnit(const RECT&, RECT&);
- static void MakeRect(RECT&, const POINT&, const SDimension16&);
- static void MakeRect(RECT&, const POINT&, int, int);
- static void MakeRect(RECT&, int, int);
- static void MakeCenterRect(RECT&, const POINT&, int, int);
- static void AddRect(RECT&, const RECT&);
- static void SubRect(RECT&, const RECT&);
- static void ZoomOut(RECT&, int);
+ static void UnitToQD(int& ioV, int& ioH, int inZoomLevel = 0);
+ static void UnitToQD(POINT& ioPoint, int inZoomLevel = 0, BOOL inExcludeRoof = false);
+ static void UnitToQD(RECT& ioRect, int inZoomLevel = 0, BOOL inExcludeRoofAndFloor = false);
+ static void UnitToQD(const RECT& inUnitRect, RECT& outQDRect, int inZoomLevel = 0, BOOL inExcludeRoofAndFloor = false);
+ static void UnitToQDRoof(const RECT& inUnitRect, RECT& outQDRect, int inZoomLevel = 0);
+ static void UnitToQDFloor(const RECT& inUnitRect, RECT& outQDRect, int inZoomLevel = 0);
+ static void UnitToOffRect(const RECT& inUnitRect, RECT& outQDRect, int inHeight = 0);
+ static void QDToUnit(int& ioV, int& ioH, int inZoomLevel = 0);
+ static void QDToUnit(POINT& ioPoint, int inZoomLevel = 0);
+ static void QDToUnit(SDimension16& ioSize, int inZoomLevel = 0);
+ static void QDToUnit(RECT& ioRect, int inZoomLevel = 0);
+ static void QDToUnit(const RECT& inQDRect, RECT& outUnitRect, int inZoomLevel = 0);
+ static void NoRoofQDToUnit(const RECT& inQDRect, RECT& outUnitRect, int inZoomLevel = 0);
+ static void BkgndToQD(int& ioV, int& ioH, int inZoomLevel = 0);
+ static void BkgndToQD(POINT& ioPoint, int inZoomLevel = 0);
+ static void BkgndToQD(RECT& ioRect, int inZoomLevel = 0);
+ static void BkgndToQD(const RECT& inBkgndRect, RECT& outQDRect, int inZoomLevel = 0);
+ static void QDToBkgnd(int& ioV, int& ioH, int inZoomLevel = 0);
+ static void QDToBkgnd(POINT& ioPoint, int inZoomLevel = 0);
+ static void QDToBkgnd(SDimension16& ioSize, int inZoomLevel = 0);
+ static void QDToBkgnd(RECT& ioRect, int inZoomLevel = 0);
+ static void QDToBkgnd(const RECT& inQDRect, RECT& outBkgndRect, int inZoomLevel = 0);
+ static void UnitToBkgnd(const RECT& inUnitRect, RECT& outBkgndRect);
+ static void BkgndToUnit(const RECT& inBkgndRect, RECT& outUnitRect);
+ static void MakeRect(RECT& outRect, const POINT& inPoint, const SDimension16& inSize);
+ static void MakeRect(RECT& outRect, const POINT& inPoint, int inWidth, int inHeight);
+ static void MakeRect(RECT& outRect, int inWidth, int inHeight);
+ static void MakeCenterRect(RECT& outRect, const POINT& inPoint, int inWidth, int inHeight);
+ static void AddRect(RECT& ioRectA, const RECT& inRectB);
+ static void SubRect(RECT& ioRectA, const RECT& inRectB);
+ static void ZoomOut(RECT& ioRect, int inZoomLevel);
- // fixme
- static int UnitVSize(int) { return 0; }
- static int UnitHSize(int) { return 0; }
- static int BkgndVSize(int) { return 0; }
- static int BkgndHSize(int) { return 0; }
- static int CalcRoofThick(int) { return 0; }
- static int CalcFloorThick(int) { return 0; }
- static void QDToOff(POINT&, int) {}
- static int RectWidth(const RECT&) { return 0; }
+ static int UnitVSize(int inZoomLevel) { return 36 >> inZoomLevel; }
+ static int UnitHSize(int inZoomLevel) { return 8 >> inZoomLevel; }
+ static int BkgndVSize(int inZoomLevel) { return 72 >> inZoomLevel; }
+ static int BkgndHSize(int inZoomLevel) { return 64 >> inZoomLevel; }
+ static int CalcRoofThick(int inZoomLevel) { return 8U >> inZoomLevel; }
+ static int CalcFloorThick(int inZoomLevel) { return 4U >> inZoomLevel; }
+ static void QDToOff(POINT& ioPt, int inZoomLevel) {
+ ioPt.y <<= inZoomLevel;
+ ioPt.x <<= inZoomLevel;
+ }
+ static int RectWidth(const RECT& inRect) { return inRect.right - inRect.left; }
};