Update of /cvsroot/super-tux/supertux/src/screen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18728/src/screen
Modified Files:
drawing_context.cpp drawing_context.h
Log Message:
A few changes to make the code ready for the new level editor.
Major changes:
- Level's save() works. Still doesn't save the game properly.
- added a set_drawing_effect() for DrawingContext. Will apply it to the following drawings. Works with pop/push_transform.
Index: drawing_context.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- drawing_context.cpp 25 Jun 2004 11:54:37 -0000 1.11
+++ drawing_context.cpp 28 Jun 2004 11:30:25 -0000 1.12
@@ -27,6 +27,7 @@
DrawingContext::DrawingContext()
{
+transform.draw_effect = NONE_EFFECT;
}
DrawingContext::~DrawingContext()
@@ -46,6 +47,7 @@
request.request_data = const_cast<Surface*> (surface);
request.pos = transform.apply(position);
request.drawing_effect = drawing_effect;
+ request.drawing_effect = transform.draw_effect | drawing_effect;
drawingrequests.push_back(request);
}
@@ -341,3 +343,8 @@
transformstack.pop_back();
}
+void
+DrawingContext::set_drawing_effect(int effect)
+{
+ transform.draw_effect = effect;
+}
Index: drawing_context.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- drawing_context.h 25 Jun 2004 11:54:37 -0000 1.9
+++ drawing_context.h 28 Jun 2004 11:30:26 -0000 1.10
@@ -83,6 +83,9 @@
void push_transform();
void pop_transform();
+ /** apply that effect in the next draws (effects are listed on surface.h) */
+ void set_drawing_effect(int effect);
+
private:
class Transform
{
@@ -93,6 +96,8 @@
{
return v - translation;
}
+
+ int draw_effect;
};
/// the transform stack
|