aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/math
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-05 13:42:10 +0000
committerEugene Sandulenko2010-10-12 22:27:32 +0000
commitbf53914c2aedbe340be8fb920a5023020d64c101 (patch)
treeecf6a9caa0bbb5ffda253a88cf92ae82e78a95a0 /engines/sword25/math
parentde0fe1db4939bbb787de60231dd30a7b5391f269 (diff)
downloadscummvm-rg350-bf53914c2aedbe340be8fb920a5023020d64c101.tar.gz
scummvm-rg350-bf53914c2aedbe340be8fb920a5023020d64c101.tar.bz2
scummvm-rg350-bf53914c2aedbe340be8fb920a5023020d64c101.zip
SWORD25: Fix compilation and several warnings
svn-id: r53215
Diffstat (limited to 'engines/sword25/math')
-rw-r--r--engines/sword25/math/geometry_script.cpp32
-rw-r--r--engines/sword25/math/rect.h12
2 files changed, 23 insertions, 21 deletions
diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp
index f01f977f4a..aaf4c4d604 100644
--- a/engines/sword25/math/geometry_script.cpp
+++ b/engines/sword25/math/geometry_script.cpp
@@ -301,9 +301,9 @@ static int NewWalkRegion(lua_State *L) {
static const char *GEO_LIBRARY_NAME = "Geo";
static const luaL_reg GEO_FUNCTIONS[] = {
- "NewRegion", NewRegion,
- "NewWalkRegion", NewWalkRegion,
- 0, 0,
+ {"NewRegion", NewRegion},
+ {"NewWalkRegion", NewWalkRegion},
+ {0, 0}
};
// -----------------------------------------------------------------------------
@@ -477,17 +477,17 @@ static int R_Delete(lua_State *L) {
// -----------------------------------------------------------------------------
static const luaL_reg REGION_METHODS[] = {
- "SetPos", R_SetPos,
- "SetX", R_SetX,
- "SetY", R_SetY,
- "GetPos", R_GetPos,
- "IsPointInRegion", R_IsPointInRegion,
- "GetX", R_GetX,
- "GetY", R_GetY,
- "IsValid", R_IsValid,
- "Draw", R_Draw,
- "GetCentroid", R_GetCentroid,
- 0, 0,
+ {"SetPos", R_SetPos},
+ {"SetX", R_SetX},
+ {"SetY", R_SetY},
+ {"GetPos", R_GetPos},
+ {"IsPointInRegion", R_IsPointInRegion},
+ {"GetX", R_GetX},
+ {"GetY", R_GetY},
+ {"IsValid", R_IsValid},
+ {"Draw", R_Draw},
+ {"GetCentroid", R_GetCentroid},
+ {0, 0}
};
// -----------------------------------------------------------------------------
@@ -533,8 +533,8 @@ static int WR_GetPath(lua_State *L) {
// -----------------------------------------------------------------------------
static const luaL_reg WALKREGION_METHODS[] = {
- "GetPath", WR_GetPath,
- 0, 0,
+ {"GetPath", WR_GetPath},
+ {0, 0}
};
// -----------------------------------------------------------------------------
diff --git a/engines/sword25/math/rect.h b/engines/sword25/math/rect.h
index 849839aeec..c2a42e85c4 100644
--- a/engines/sword25/math/rect.h
+++ b/engines/sword25/math/rect.h
@@ -56,15 +56,17 @@ public:
void Move(int DeltaX, int DeltaY) { translate(DeltaX, DeltaY); }
- bool DoesIntersect(const BS_Rect &Rect) const { return intersects(Rect); }
+ bool DoesIntersect(const BS_Rect &Rect_) const { return intersects(Rect_); }
- bool Intersect(const BS_Rect &Rect, BS_Rect &Result) const {
- Result = Rect;
+ bool Intersect(const BS_Rect &Rect_, BS_Rect &Result) const {
+ Result = Rect_;
Result.clip(*this);
+
+ return Result.isEmpty();
}
- void Join(const BS_Rect &Rect, BS_Rect &Result) const {
- Result = Rect;
+ void Join(const BS_Rect &Rect_, BS_Rect &Result) const {
+ Result = Rect_;
Result.extend(*this);
}