[Scummvm-cvs-logs] CVS: residual lua.cpp,1.130,1.131 objectstate.h,1.9,1.10 scene.cpp,1.41,1.42 scene.h,1.26,1.27
Pawel Kolodziejski
aquadran at users.sourceforge.net
Fri Apr 8 05:41:53 CEST 2005
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12816
Modified Files:
lua.cpp objectstate.h scene.cpp scene.h
Log Message:
added code for SendObjectToBack and SendObjectToFront
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- lua.cpp 8 Apr 2005 12:09:17 -0000 1.130
+++ lua.cpp 8 Apr 2005 12:41:19 -0000 1.131
@@ -1669,7 +1669,7 @@
OBJSTATE_STATE = 3
};
- ObjectState *object = NULL;
+ ObjectState *state = NULL;
int setupID = check_int(1); // Setup ID
ObjectState::Position pos = check_objstate_pos(2); // When to draw
@@ -1680,14 +1680,34 @@
if (!lua_isnil(lua_getparam(4)))
zbitmap = luaL_check_string(4);
- object = new ObjectState(setupID, pos, bitmap, zbitmap, visible);
- g_engine->currScene()->addObjectState(object);
- lua_pushusertag(object, MKID('STAT'));
+ state = new ObjectState(setupID, pos, bitmap, zbitmap, visible);
+ g_engine->currScene()->addObjectState(state);
+ lua_pushusertag(state, MKID('STAT'));
}
static void FreeObjectState() {
- ObjectState *object = check_object(1);
- g_engine->currScene()->deleteObjectState(object);
+ ObjectState *state = check_object(1);
+ g_engine->currScene()->deleteObjectState(state);
+}
+
+static void SendObjectToBack() {
+ stubWarning("VERIFY: SendObjectToBack");
+ ObjectState *state = check_object(1);
+ // moving object to top in list ?
+ g_engine->currScene()->moveObjectStateToFirst(state);
+}
+
+static void SendObjectToFront() {
+ stubWarning("VERIFY: SendObjectToFront");
+ ObjectState *state = check_object(1);
+ g_engine->currScene()->moveObjectStateToLast(state);
+ // moving object to last in list ?
+}
+
+static void SetObjectType() {
+ ObjectState *state = check_object(1);
+ ObjectState::Position pos = check_objstate_pos(2);
+ state->setPos(pos);
}
static void GetCurrentScript() {
@@ -1878,9 +1898,6 @@
STUB_FUNC(SetActorCollisionMode)
STUB_FUNC(FlushControls)
STUB_FUNC(ActorToClean)
-STUB_FUNC(SendObjectToFront)
-STUB_FUNC(SendObjectToBack)
-STUB_FUNC(SetObjectType)
STUB_FUNC(SetActorShadowValid)
STUB_FUNC(AddShadowPlane)
STUB_FUNC(KillActorShadows)
Index: objectstate.h
===================================================================
RCS file: /cvsroot/scummvm/residual/objectstate.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- objectstate.h 8 Apr 2005 12:09:17 -0000 1.9
+++ objectstate.h 8 Apr 2005 12:41:19 -0000 1.10
@@ -26,7 +26,7 @@
#include <list>
class ObjectState {
- public:
+public:
enum Position {
OBJSTATE_UNDERLAY = 1,
OBJSTATE_OVERLAY = 2,
@@ -38,6 +38,8 @@
int setupID() const { return _setupID; }
Position pos() const { return _pos; }
+ void setPos(Position pos) { _pos = pos; }
+
const char *bitmapFilename() const {
return _bitmap->filename();
}
@@ -53,7 +55,8 @@
_zbitmap->draw();
}
- private:
+private:
+
int _setupID;
Position _pos;
ResPtr<Bitmap> _bitmap, _zbitmap;
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/scene.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- scene.cpp 18 Jan 2005 17:25:04 -0000 1.41
+++ scene.cpp 8 Apr 2005 12:41:19 -0000 1.42
@@ -259,3 +259,13 @@
*minVolume = _minVolume;
*maxVolume = _maxVolume;
}
+
+void Scene::moveObjectStateToFirst(ObjectState *s) {
+ _states.remove(s);
+ _states.push_front(s);
+}
+
+void Scene::moveObjectStateToLast(ObjectState *s) {
+ _states.remove(s);
+ _states.push_back(s);
+}
Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/residual/scene.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- scene.h 8 Apr 2005 12:09:17 -0000 1.26
+++ scene.h 8 Apr 2005 12:41:19 -0000 1.27
@@ -86,13 +86,14 @@
void addObjectState(ObjectState *s) {
_states.push_back(s);
}
+
void deleteObjectState(ObjectState *s) {
- while (!_states.empty()) {
- delete _states.back();
- _states.pop_back();
- }
+ _states.remove(s);
}
+ void moveObjectStateToFirst(ObjectState *s);
+ void moveObjectStateToLast(ObjectState *s);
+
ObjectState *findState(const char *filename);
struct Setup { // Camera setup data
More information about the Scummvm-git-logs
mailing list