From 5683f076331d2831eb4720b65bb53e8d01ca33ee Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 21 Jul 2012 18:19:07 +0200 Subject: WINTERMUTE: Rename CamelCased filenames to prefixed_under_score-filenames This is mostly a lead-up to namespacing the Ad/Base folders, and then possibly removing the prefixes from the files, it also has the added benefit of getting rid of the odd case-typos that makes for issues on platforms that don't ignore case. --- engines/wintermute/ad/ad_scene.h | 181 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 engines/wintermute/ad/ad_scene.h (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h new file mode 100644 index 0000000000..ab62a4a7fc --- /dev/null +++ b/engines/wintermute/ad/ad_scene.h @@ -0,0 +1,181 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This file is based on WME Lite. + * http://dead-code.org/redir.php?target=wmelite + * Copyright (c) 2011 Jan Nedoma + */ + +#ifndef WINTERMUTE_ADSCENE_H +#define WINTERMUTE_ADSCENE_H + +#include "engines/wintermute/base/base_fader.h" + +namespace WinterMute { + +class CUIWindow; +class CAdObject; +class CAdRegion; +class CBViewport; +class CAdLayer; +class CBPoint; +class CAdWaypointGroup; +class CAdPath; +class CAdScaleLevel; +class CAdRotLevel; +class CAdPathPoint; +class CAdScene : public CBObject { +public: + + CBObject *getNextAccessObject(CBObject *CurrObject); + CBObject *getPrevAccessObject(CBObject *CurrObject); + bool getSceneObjects(CBArray &Objects, bool InteractiveOnly); + bool getRegionObjects(CAdRegion *Region, CBArray &Objects, bool InteractiveOnly); + + bool afterLoad(); + + bool getRegionsAt(int X, int Y, CAdRegion **RegionList, int NumRegions); + bool handleItemAssociations(const char *ItemName, bool Show); + CUIWindow *_shieldWindow; + float getRotationAt(int X, int Y); + bool loadState(); + bool saveState(); + bool _persistentState; + bool _persistentStateSprites; + CBObject *getNodeByName(const char *name); + void setOffset(int OffsetLeft, int OffsetTop); + bool pointInViewport(int X, int Y); + int getOffsetTop(); + int getOffsetLeft(); + bool getViewportSize(int *Width = NULL, int *Height = NULL); + bool getViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL); + CBViewport *_viewport; + CBFader *_fader; + int _pfPointsNum; + void pfPointsAdd(int X, int Y, int Distance); + void pfPointsStart(); + bool _initialized; + bool correctTargetPoint(int StartX, int StartY, int *X, int *Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); + bool correctTargetPoint2(int StartX, int StartY, int *TargetX, int *TargetY, bool CheckFreeObjects, CBObject *Requester); + DECLARE_PERSISTENT(CAdScene, CBObject) + bool displayRegionContent(CAdRegion *Region = NULL, bool Display3DOnly = false); + bool displayRegionContentOld(CAdRegion *Region = NULL); + static int compareObjs(const void *Obj1, const void *Obj2); + + bool updateFreeObjects(); + bool traverseNodes(bool Update = false); + float getScaleAt(int Y); + bool sortScaleLevels(); + bool sortRotLevels(); + virtual bool saveAsText(CBDynBuffer *buffer, int indent); + uint32 getAlphaAt(int X, int Y, bool ColorCheck = false); + bool _paralaxScrolling; + void skipTo(int OffsetX, int OffsetY); + void setDefaults(); + void cleanup(); + void skipToObject(CBObject *Object); + void scrollToObject(CBObject *Object); + void scrollTo(int OffsetX, int OffsetY); + virtual bool update(); + bool _autoScroll; + int _targetOffsetTop; + int _targetOffsetLeft; + + int _scrollPixelsV; + uint32 _scrollTimeV; + uint32 _lastTimeV; + + int _scrollPixelsH; + uint32 _scrollTimeH; + uint32 _lastTimeH; + + virtual bool display(); + uint32 _pfMaxTime; + bool initLoop(); + void pathFinderStep(); + bool isBlockedAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); + bool isWalkableAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); + CAdLayer *_mainLayer; + float getZoomAt(int X, int Y); + bool getPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *requester = NULL); + CAdScene(CBGame *inGame); + virtual ~CAdScene(); + CBArray _layers; + CBArray _objects; + CBArray _waypointGroups; + bool loadFile(const char *filename); + bool loadBuffer(byte *buffer, bool complete = true); + int _width; + int _height; + bool addObject(CAdObject *Object); + bool removeObject(CAdObject *Object); + int _editorMarginH; + int _editorMarginV; + uint32 _editorColFrame; + uint32 _editorColEntity; + uint32 _editorColRegion; + uint32 _editorColBlocked; + uint32 _editorColWaypoints; + uint32 _editorColEntitySel; + uint32 _editorColRegionSel; + uint32 _editorColBlockedSel; + uint32 _editorColWaypointsSel; + uint32 _editorColScale; + uint32 _editorColDecor; + uint32 _editorColDecorSel; + + bool _editorShowRegions; + bool _editorShowBlocked; + bool _editorShowDecor; + bool _editorShowEntities; + bool _editorShowScale; + CBArray _scaleLevels; + CBArray _rotLevels; + + virtual bool restoreDeviceObjects(); + int getPointsDist(CBPoint p1, CBPoint p2, CBObject *requester = NULL); + + // scripting interface + virtual CScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, CScValue *value); + virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name); + virtual const char *scToString(); + + +private: + bool persistState(bool Saving = true); + void pfAddWaypointGroup(CAdWaypointGroup *Wpt, CBObject *Requester = NULL); + bool _pfReady; + CBPoint *_pfTarget; + CAdPath *_pfTargetPath; + CBObject *_pfRequester; + CBArray _pfPath; + + int _offsetTop; + int _offsetLeft; + +}; + +} // end of namespace WinterMute + +#endif -- cgit v1.2.3 From b5a07fef8ebf29f7f44b15d9b34799c7e115fdad Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 21 Jul 2012 21:01:47 +0200 Subject: WINTERMUTE: Get rid of the C-prefix for class-definitions. --- engines/wintermute/ad/ad_scene.h | 102 +++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index ab62a4a7fc..b1420cc5c2 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -33,53 +33,53 @@ namespace WinterMute { -class CUIWindow; -class CAdObject; -class CAdRegion; -class CBViewport; -class CAdLayer; -class CBPoint; -class CAdWaypointGroup; -class CAdPath; -class CAdScaleLevel; -class CAdRotLevel; -class CAdPathPoint; -class CAdScene : public CBObject { +class UIWindow; +class AdObject; +class AdRegion; +class BaseViewport; +class AdLayer; +class BasePoint; +class AdWaypointGroup; +class AdPath; +class AdScaleLevel; +class AdRotLevel; +class AdPathPoint; +class AdScene : public BaseObject { public: - CBObject *getNextAccessObject(CBObject *CurrObject); - CBObject *getPrevAccessObject(CBObject *CurrObject); - bool getSceneObjects(CBArray &Objects, bool InteractiveOnly); - bool getRegionObjects(CAdRegion *Region, CBArray &Objects, bool InteractiveOnly); + BaseObject *getNextAccessObject(BaseObject *CurrObject); + BaseObject *getPrevAccessObject(BaseObject *CurrObject); + bool getSceneObjects(BaseArray &Objects, bool InteractiveOnly); + bool getRegionObjects(AdRegion *Region, BaseArray &Objects, bool InteractiveOnly); bool afterLoad(); - bool getRegionsAt(int X, int Y, CAdRegion **RegionList, int NumRegions); + bool getRegionsAt(int X, int Y, AdRegion **RegionList, int NumRegions); bool handleItemAssociations(const char *ItemName, bool Show); - CUIWindow *_shieldWindow; + UIWindow *_shieldWindow; float getRotationAt(int X, int Y); bool loadState(); bool saveState(); bool _persistentState; bool _persistentStateSprites; - CBObject *getNodeByName(const char *name); + BaseObject *getNodeByName(const char *name); void setOffset(int OffsetLeft, int OffsetTop); bool pointInViewport(int X, int Y); int getOffsetTop(); int getOffsetLeft(); bool getViewportSize(int *Width = NULL, int *Height = NULL); bool getViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL); - CBViewport *_viewport; - CBFader *_fader; + BaseViewport *_viewport; + BaseFader *_fader; int _pfPointsNum; void pfPointsAdd(int X, int Y, int Distance); void pfPointsStart(); bool _initialized; - bool correctTargetPoint(int StartX, int StartY, int *X, int *Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); - bool correctTargetPoint2(int StartX, int StartY, int *TargetX, int *TargetY, bool CheckFreeObjects, CBObject *Requester); - DECLARE_PERSISTENT(CAdScene, CBObject) - bool displayRegionContent(CAdRegion *Region = NULL, bool Display3DOnly = false); - bool displayRegionContentOld(CAdRegion *Region = NULL); + bool correctTargetPoint(int StartX, int StartY, int *X, int *Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); + bool correctTargetPoint2(int StartX, int StartY, int *TargetX, int *TargetY, bool CheckFreeObjects, BaseObject *Requester); + DECLARE_PERSISTENT(AdScene, BaseObject) + bool displayRegionContent(AdRegion *Region = NULL, bool Display3DOnly = false); + bool displayRegionContentOld(AdRegion *Region = NULL); static int compareObjs(const void *Obj1, const void *Obj2); bool updateFreeObjects(); @@ -87,14 +87,14 @@ public: float getScaleAt(int Y); bool sortScaleLevels(); bool sortRotLevels(); - virtual bool saveAsText(CBDynBuffer *buffer, int indent); + virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); uint32 getAlphaAt(int X, int Y, bool ColorCheck = false); bool _paralaxScrolling; void skipTo(int OffsetX, int OffsetY); void setDefaults(); void cleanup(); - void skipToObject(CBObject *Object); - void scrollToObject(CBObject *Object); + void skipToObject(BaseObject *Object); + void scrollToObject(BaseObject *Object); void scrollTo(int OffsetX, int OffsetY); virtual bool update(); bool _autoScroll; @@ -113,22 +113,22 @@ public: uint32 _pfMaxTime; bool initLoop(); void pathFinderStep(); - bool isBlockedAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); - bool isWalkableAt(int X, int Y, bool CheckFreeObjects = false, CBObject *Requester = NULL); - CAdLayer *_mainLayer; + bool isBlockedAt(int X, int Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); + bool isWalkableAt(int X, int Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); + AdLayer *_mainLayer; float getZoomAt(int X, int Y); - bool getPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *requester = NULL); - CAdScene(CBGame *inGame); - virtual ~CAdScene(); - CBArray _layers; - CBArray _objects; - CBArray _waypointGroups; + bool getPath(BasePoint source, BasePoint target, AdPath *path, BaseObject *requester = NULL); + AdScene(BaseGame *inGame); + virtual ~AdScene(); + BaseArray _layers; + BaseArray _objects; + BaseArray _waypointGroups; bool loadFile(const char *filename); bool loadBuffer(byte *buffer, bool complete = true); int _width; int _height; - bool addObject(CAdObject *Object); - bool removeObject(CAdObject *Object); + bool addObject(AdObject *Object); + bool removeObject(AdObject *Object); int _editorMarginH; int _editorMarginV; uint32 _editorColFrame; @@ -149,27 +149,27 @@ public: bool _editorShowDecor; bool _editorShowEntities; bool _editorShowScale; - CBArray _scaleLevels; - CBArray _rotLevels; + BaseArray _scaleLevels; + BaseArray _rotLevels; virtual bool restoreDeviceObjects(); - int getPointsDist(CBPoint p1, CBPoint p2, CBObject *requester = NULL); + int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); // scripting interface - virtual CScValue *scGetProperty(const char *name); - virtual bool scSetProperty(const char *name, CScValue *value); - virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name); + virtual ScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, ScValue *value); + virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); private: bool persistState(bool Saving = true); - void pfAddWaypointGroup(CAdWaypointGroup *Wpt, CBObject *Requester = NULL); + void pfAddWaypointGroup(AdWaypointGroup *Wpt, BaseObject *Requester = NULL); bool _pfReady; - CBPoint *_pfTarget; - CAdPath *_pfTargetPath; - CBObject *_pfRequester; - CBArray _pfPath; + BasePoint *_pfTarget; + AdPath *_pfTargetPath; + BaseObject *_pfRequester; + BaseArray _pfPath; int _offsetTop; int _offsetLeft; -- cgit v1.2.3 From 4eda234611bd77f053defe9e61d592b308270eaa Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 26 Jul 2012 19:41:18 +0200 Subject: WINTERMUTE: Replace BaseArray with a templated subclass of Common::Array. This needs additional cleanup, but compiles and runs at this point. --- engines/wintermute/ad/ad_scene.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index b1420cc5c2..a4bf666aea 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -49,8 +49,8 @@ public: BaseObject *getNextAccessObject(BaseObject *CurrObject); BaseObject *getPrevAccessObject(BaseObject *CurrObject); - bool getSceneObjects(BaseArray &Objects, bool InteractiveOnly); - bool getRegionObjects(AdRegion *Region, BaseArray &Objects, bool InteractiveOnly); + bool getSceneObjects(BaseArray &Objects, bool InteractiveOnly); + bool getRegionObjects(AdRegion *Region, BaseArray &Objects, bool InteractiveOnly); bool afterLoad(); @@ -120,9 +120,9 @@ public: bool getPath(BasePoint source, BasePoint target, AdPath *path, BaseObject *requester = NULL); AdScene(BaseGame *inGame); virtual ~AdScene(); - BaseArray _layers; - BaseArray _objects; - BaseArray _waypointGroups; + BaseArray _layers; + BaseArray _objects; + BaseArray _waypointGroups; bool loadFile(const char *filename); bool loadBuffer(byte *buffer, bool complete = true); int _width; @@ -149,8 +149,8 @@ public: bool _editorShowDecor; bool _editorShowEntities; bool _editorShowScale; - BaseArray _scaleLevels; - BaseArray _rotLevels; + BaseArray _scaleLevels; + BaseArray _rotLevels; virtual bool restoreDeviceObjects(); int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); @@ -169,7 +169,7 @@ private: BasePoint *_pfTarget; AdPath *_pfTargetPath; BaseObject *_pfRequester; - BaseArray _pfPath; + BaseArray _pfPath; int _offsetTop; int _offsetLeft; -- cgit v1.2.3 From 3a49f2bad407787ef65d04c5f9ae423485629b41 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 26 Jul 2012 22:20:55 +0200 Subject: WINTERMUTE: More variable/function renaming VarName->varName --- engines/wintermute/ad/ad_scene.h | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index a4bf666aea..5c2f505001 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -47,55 +47,55 @@ class AdPathPoint; class AdScene : public BaseObject { public: - BaseObject *getNextAccessObject(BaseObject *CurrObject); - BaseObject *getPrevAccessObject(BaseObject *CurrObject); - bool getSceneObjects(BaseArray &Objects, bool InteractiveOnly); - bool getRegionObjects(AdRegion *Region, BaseArray &Objects, bool InteractiveOnly); + BaseObject *getNextAccessObject(BaseObject *currObject); + BaseObject *getPrevAccessObject(BaseObject *currObject); + bool getSceneObjects(BaseArray &objects, bool interactiveOnly); + bool getRegionObjects(AdRegion *region, BaseArray &objects, bool interactiveOnly); bool afterLoad(); - bool getRegionsAt(int X, int Y, AdRegion **RegionList, int NumRegions); - bool handleItemAssociations(const char *ItemName, bool Show); + bool getRegionsAt(int x, int y, AdRegion **regionList, int numRegions); + bool handleItemAssociations(const char *itemName, bool show); UIWindow *_shieldWindow; - float getRotationAt(int X, int Y); + float getRotationAt(int x, int y); bool loadState(); bool saveState(); bool _persistentState; bool _persistentStateSprites; BaseObject *getNodeByName(const char *name); - void setOffset(int OffsetLeft, int OffsetTop); - bool pointInViewport(int X, int Y); + void setOffset(int offsetLeft, int offsetTop); + bool pointInViewport(int x, int y); int getOffsetTop(); int getOffsetLeft(); - bool getViewportSize(int *Width = NULL, int *Height = NULL); - bool getViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL); + bool getViewportSize(int *width = NULL, int *height = NULL); + bool getViewportOffset(int *offsetX = NULL, int *offsetY = NULL); BaseViewport *_viewport; BaseFader *_fader; int _pfPointsNum; - void pfPointsAdd(int X, int Y, int Distance); + void pfPointsAdd(int x, int y, int distance); void pfPointsStart(); bool _initialized; - bool correctTargetPoint(int StartX, int StartY, int *X, int *Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); - bool correctTargetPoint2(int StartX, int StartY, int *TargetX, int *TargetY, bool CheckFreeObjects, BaseObject *Requester); + bool correctTargetPoint(int startX, int startY, int *x, int *y, bool checkFreeObjects = false, BaseObject *requester = NULL); + bool correctTargetPoint2(int startX, int startY, int *targetX, int *targetY, bool checkFreeObjects, BaseObject *requester); DECLARE_PERSISTENT(AdScene, BaseObject) - bool displayRegionContent(AdRegion *Region = NULL, bool Display3DOnly = false); - bool displayRegionContentOld(AdRegion *Region = NULL); - static int compareObjs(const void *Obj1, const void *Obj2); + bool displayRegionContent(AdRegion *region = NULL, bool display3DOnly = false); + bool displayRegionContentOld(AdRegion *region = NULL); + static int compareObjs(const void *obj1, const void *obj2); bool updateFreeObjects(); - bool traverseNodes(bool Update = false); - float getScaleAt(int Y); + bool traverseNodes(bool update = false); + float getScaleAt(int y); bool sortScaleLevels(); bool sortRotLevels(); virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); - uint32 getAlphaAt(int X, int Y, bool ColorCheck = false); + uint32 getAlphaAt(int x, int y, bool colorCheck = false); bool _paralaxScrolling; - void skipTo(int OffsetX, int OffsetY); + void skipTo(int offsetX, int offsetY); void setDefaults(); void cleanup(); - void skipToObject(BaseObject *Object); - void scrollToObject(BaseObject *Object); - void scrollTo(int OffsetX, int OffsetY); + void skipToObject(BaseObject *object); + void scrollToObject(BaseObject *object); + void scrollTo(int offsetX, int offsetY); virtual bool update(); bool _autoScroll; int _targetOffsetTop; @@ -113,10 +113,10 @@ public: uint32 _pfMaxTime; bool initLoop(); void pathFinderStep(); - bool isBlockedAt(int X, int Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); - bool isWalkableAt(int X, int Y, bool CheckFreeObjects = false, BaseObject *Requester = NULL); + bool isBlockedAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); + bool isWalkableAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); AdLayer *_mainLayer; - float getZoomAt(int X, int Y); + float getZoomAt(int x, int y); bool getPath(BasePoint source, BasePoint target, AdPath *path, BaseObject *requester = NULL); AdScene(BaseGame *inGame); virtual ~AdScene(); @@ -163,8 +163,8 @@ public: private: - bool persistState(bool Saving = true); - void pfAddWaypointGroup(AdWaypointGroup *Wpt, BaseObject *Requester = NULL); + bool persistState(bool saving = true); + void pfAddWaypointGroup(AdWaypointGroup *Wpt, BaseObject *requester = NULL); bool _pfReady; BasePoint *_pfTarget; AdPath *_pfTargetPath; -- cgit v1.2.3 From fed19cb66ae5b56dd7dc81b90edd5a0d15986678 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 13 Aug 2012 03:42:30 +0200 Subject: WINTERMUTE: WinterMute -> Wintermute --- engines/wintermute/ad/ad_scene.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index 5c2f505001..20b3f5026d 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -31,7 +31,7 @@ #include "engines/wintermute/base/base_fader.h" -namespace WinterMute { +namespace Wintermute { class UIWindow; class AdObject; @@ -176,6 +176,6 @@ private: }; -} // end of namespace WinterMute +} // end of namespace Wintermute #endif -- cgit v1.2.3 From b4090ead4d4334e08725323ff72fd355c93b63d5 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 4 Sep 2012 22:17:23 +0200 Subject: WINTERMUTE: Convert CRLF to LF --- engines/wintermute/ad/ad_scene.h | 362 +++++++++++++++++++-------------------- 1 file changed, 181 insertions(+), 181 deletions(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index 20b3f5026d..c9c0e413bf 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -1,181 +1,181 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This file is based on WME Lite. - * http://dead-code.org/redir.php?target=wmelite - * Copyright (c) 2011 Jan Nedoma - */ - -#ifndef WINTERMUTE_ADSCENE_H -#define WINTERMUTE_ADSCENE_H - -#include "engines/wintermute/base/base_fader.h" - -namespace Wintermute { - -class UIWindow; -class AdObject; -class AdRegion; -class BaseViewport; -class AdLayer; -class BasePoint; -class AdWaypointGroup; -class AdPath; -class AdScaleLevel; -class AdRotLevel; -class AdPathPoint; -class AdScene : public BaseObject { -public: - - BaseObject *getNextAccessObject(BaseObject *currObject); - BaseObject *getPrevAccessObject(BaseObject *currObject); - bool getSceneObjects(BaseArray &objects, bool interactiveOnly); - bool getRegionObjects(AdRegion *region, BaseArray &objects, bool interactiveOnly); - - bool afterLoad(); - - bool getRegionsAt(int x, int y, AdRegion **regionList, int numRegions); - bool handleItemAssociations(const char *itemName, bool show); - UIWindow *_shieldWindow; - float getRotationAt(int x, int y); - bool loadState(); - bool saveState(); - bool _persistentState; - bool _persistentStateSprites; - BaseObject *getNodeByName(const char *name); - void setOffset(int offsetLeft, int offsetTop); - bool pointInViewport(int x, int y); - int getOffsetTop(); - int getOffsetLeft(); - bool getViewportSize(int *width = NULL, int *height = NULL); - bool getViewportOffset(int *offsetX = NULL, int *offsetY = NULL); - BaseViewport *_viewport; - BaseFader *_fader; - int _pfPointsNum; - void pfPointsAdd(int x, int y, int distance); - void pfPointsStart(); - bool _initialized; - bool correctTargetPoint(int startX, int startY, int *x, int *y, bool checkFreeObjects = false, BaseObject *requester = NULL); - bool correctTargetPoint2(int startX, int startY, int *targetX, int *targetY, bool checkFreeObjects, BaseObject *requester); - DECLARE_PERSISTENT(AdScene, BaseObject) - bool displayRegionContent(AdRegion *region = NULL, bool display3DOnly = false); - bool displayRegionContentOld(AdRegion *region = NULL); - static int compareObjs(const void *obj1, const void *obj2); - - bool updateFreeObjects(); - bool traverseNodes(bool update = false); - float getScaleAt(int y); - bool sortScaleLevels(); - bool sortRotLevels(); - virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); - uint32 getAlphaAt(int x, int y, bool colorCheck = false); - bool _paralaxScrolling; - void skipTo(int offsetX, int offsetY); - void setDefaults(); - void cleanup(); - void skipToObject(BaseObject *object); - void scrollToObject(BaseObject *object); - void scrollTo(int offsetX, int offsetY); - virtual bool update(); - bool _autoScroll; - int _targetOffsetTop; - int _targetOffsetLeft; - - int _scrollPixelsV; - uint32 _scrollTimeV; - uint32 _lastTimeV; - - int _scrollPixelsH; - uint32 _scrollTimeH; - uint32 _lastTimeH; - - virtual bool display(); - uint32 _pfMaxTime; - bool initLoop(); - void pathFinderStep(); - bool isBlockedAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); - bool isWalkableAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); - AdLayer *_mainLayer; - float getZoomAt(int x, int y); - bool getPath(BasePoint source, BasePoint target, AdPath *path, BaseObject *requester = NULL); - AdScene(BaseGame *inGame); - virtual ~AdScene(); - BaseArray _layers; - BaseArray _objects; - BaseArray _waypointGroups; - bool loadFile(const char *filename); - bool loadBuffer(byte *buffer, bool complete = true); - int _width; - int _height; - bool addObject(AdObject *Object); - bool removeObject(AdObject *Object); - int _editorMarginH; - int _editorMarginV; - uint32 _editorColFrame; - uint32 _editorColEntity; - uint32 _editorColRegion; - uint32 _editorColBlocked; - uint32 _editorColWaypoints; - uint32 _editorColEntitySel; - uint32 _editorColRegionSel; - uint32 _editorColBlockedSel; - uint32 _editorColWaypointsSel; - uint32 _editorColScale; - uint32 _editorColDecor; - uint32 _editorColDecorSel; - - bool _editorShowRegions; - bool _editorShowBlocked; - bool _editorShowDecor; - bool _editorShowEntities; - bool _editorShowScale; - BaseArray _scaleLevels; - BaseArray _rotLevels; - - virtual bool restoreDeviceObjects(); - int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); - - // scripting interface - virtual ScValue *scGetProperty(const char *name); - virtual bool scSetProperty(const char *name, ScValue *value); - virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); - virtual const char *scToString(); - - -private: - bool persistState(bool saving = true); - void pfAddWaypointGroup(AdWaypointGroup *Wpt, BaseObject *requester = NULL); - bool _pfReady; - BasePoint *_pfTarget; - AdPath *_pfTargetPath; - BaseObject *_pfRequester; - BaseArray _pfPath; - - int _offsetTop; - int _offsetLeft; - -}; - -} // end of namespace Wintermute - -#endif +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This file is based on WME Lite. + * http://dead-code.org/redir.php?target=wmelite + * Copyright (c) 2011 Jan Nedoma + */ + +#ifndef WINTERMUTE_ADSCENE_H +#define WINTERMUTE_ADSCENE_H + +#include "engines/wintermute/base/base_fader.h" + +namespace Wintermute { + +class UIWindow; +class AdObject; +class AdRegion; +class BaseViewport; +class AdLayer; +class BasePoint; +class AdWaypointGroup; +class AdPath; +class AdScaleLevel; +class AdRotLevel; +class AdPathPoint; +class AdScene : public BaseObject { +public: + + BaseObject *getNextAccessObject(BaseObject *currObject); + BaseObject *getPrevAccessObject(BaseObject *currObject); + bool getSceneObjects(BaseArray &objects, bool interactiveOnly); + bool getRegionObjects(AdRegion *region, BaseArray &objects, bool interactiveOnly); + + bool afterLoad(); + + bool getRegionsAt(int x, int y, AdRegion **regionList, int numRegions); + bool handleItemAssociations(const char *itemName, bool show); + UIWindow *_shieldWindow; + float getRotationAt(int x, int y); + bool loadState(); + bool saveState(); + bool _persistentState; + bool _persistentStateSprites; + BaseObject *getNodeByName(const char *name); + void setOffset(int offsetLeft, int offsetTop); + bool pointInViewport(int x, int y); + int getOffsetTop(); + int getOffsetLeft(); + bool getViewportSize(int *width = NULL, int *height = NULL); + bool getViewportOffset(int *offsetX = NULL, int *offsetY = NULL); + BaseViewport *_viewport; + BaseFader *_fader; + int _pfPointsNum; + void pfPointsAdd(int x, int y, int distance); + void pfPointsStart(); + bool _initialized; + bool correctTargetPoint(int startX, int startY, int *x, int *y, bool checkFreeObjects = false, BaseObject *requester = NULL); + bool correctTargetPoint2(int startX, int startY, int *targetX, int *targetY, bool checkFreeObjects, BaseObject *requester); + DECLARE_PERSISTENT(AdScene, BaseObject) + bool displayRegionContent(AdRegion *region = NULL, bool display3DOnly = false); + bool displayRegionContentOld(AdRegion *region = NULL); + static int compareObjs(const void *obj1, const void *obj2); + + bool updateFreeObjects(); + bool traverseNodes(bool update = false); + float getScaleAt(int y); + bool sortScaleLevels(); + bool sortRotLevels(); + virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); + uint32 getAlphaAt(int x, int y, bool colorCheck = false); + bool _paralaxScrolling; + void skipTo(int offsetX, int offsetY); + void setDefaults(); + void cleanup(); + void skipToObject(BaseObject *object); + void scrollToObject(BaseObject *object); + void scrollTo(int offsetX, int offsetY); + virtual bool update(); + bool _autoScroll; + int _targetOffsetTop; + int _targetOffsetLeft; + + int _scrollPixelsV; + uint32 _scrollTimeV; + uint32 _lastTimeV; + + int _scrollPixelsH; + uint32 _scrollTimeH; + uint32 _lastTimeH; + + virtual bool display(); + uint32 _pfMaxTime; + bool initLoop(); + void pathFinderStep(); + bool isBlockedAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); + bool isWalkableAt(int x, int y, bool checkFreeObjects = false, BaseObject *requester = NULL); + AdLayer *_mainLayer; + float getZoomAt(int x, int y); + bool getPath(BasePoint source, BasePoint target, AdPath *path, BaseObject *requester = NULL); + AdScene(BaseGame *inGame); + virtual ~AdScene(); + BaseArray _layers; + BaseArray _objects; + BaseArray _waypointGroups; + bool loadFile(const char *filename); + bool loadBuffer(byte *buffer, bool complete = true); + int _width; + int _height; + bool addObject(AdObject *Object); + bool removeObject(AdObject *Object); + int _editorMarginH; + int _editorMarginV; + uint32 _editorColFrame; + uint32 _editorColEntity; + uint32 _editorColRegion; + uint32 _editorColBlocked; + uint32 _editorColWaypoints; + uint32 _editorColEntitySel; + uint32 _editorColRegionSel; + uint32 _editorColBlockedSel; + uint32 _editorColWaypointsSel; + uint32 _editorColScale; + uint32 _editorColDecor; + uint32 _editorColDecorSel; + + bool _editorShowRegions; + bool _editorShowBlocked; + bool _editorShowDecor; + bool _editorShowEntities; + bool _editorShowScale; + BaseArray _scaleLevels; + BaseArray _rotLevels; + + virtual bool restoreDeviceObjects(); + int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); + + // scripting interface + virtual ScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, ScValue *value); + virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); + virtual const char *scToString(); + + +private: + bool persistState(bool saving = true); + void pfAddWaypointGroup(AdWaypointGroup *Wpt, BaseObject *requester = NULL); + bool _pfReady; + BasePoint *_pfTarget; + AdPath *_pfTargetPath; + BaseObject *_pfRequester; + BaseArray _pfPath; + + int _offsetTop; + int _offsetLeft; + +}; + +} // end of namespace Wintermute + +#endif -- cgit v1.2.3 From afc21941e37a7481f5fe050d220968bdce43c873 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 29 Sep 2012 00:47:12 +0200 Subject: WINTERMUTE: Make scGetProperty use Common::String& instead of const char* --- engines/wintermute/ad/ad_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/ad/ad_scene.h') diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index c9c0e413bf..3b482403b5 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -156,7 +156,7 @@ public: int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); -- cgit v1.2.3