* what to do when stuck under tiles (after using duck-sliding)
* do we want multi hit scores again?
* tux doesn't stop at igloo anymore
+ * background particle systems are too slow
--Code Refactoring/Cleanup/Optimisation--
[H] make the title using GameSession instead of reimplementing all the stuff
- New forest tileset
- Badguy sprites
- Tux's buttjump animation
-[H] Background code have the following bugs:
- - Gradient in software rendering doesn't currently work (at least here).
- Matze: can you give more details? The code looks perfectly fine to me
[M] Save score on per-level basis to make high-score
[M] Save time on per-level basis to make low-time-score
[Glade.Widget]
private Gtk.Entry DataEntry;
[Glade.Widget]
- private Gtk.Entry AnimSpeedEntry;
+ private Gtk.Entry AnimFpsEntry;
[Glade.Widget]
private Gtk.Entry IDEntry;
[Glade.Widget]
tile.ID = Int32.Parse(IDEntry.Text);
if(sender == DataEntry)
tile.Data = Int32.Parse(DataEntry.Text);
- if(sender == AnimSpeedEntry)
- tile.AnimSpeed = Int32.Parse(AnimSpeedEntry.Text);
+ if(sender == AnimFpsEntry)
+ tile.AnimFps = Single.Parse(AnimFpsEntry.Text);
} catch(Exception exception) {
// ignore parse errors for now...
}
SlopeCheckButton.Active = tile.Slope;
DontUseCheckButton.Active = tile.ID == -1;
DataEntry.Text = tile.Data.ToString();
- AnimSpeedEntry.Text = tile.AnimSpeed.ToString();
+ AnimFpsEntry.Text = tile.AnimFps.ToString();
IDEntry.Text = tile.ID.ToString();
IDEntry.Editable = true;
first = false;
public bool BoolValue {
get { return StringValue == "t" ? true : false; }
}
+ public float FloatValue {
+ get { return Single.Parse(lexer.TokenString); }
+ }
}
}
public bool Goal;
public int NextTile;
public int Data;
- public int AnimSpeed;
+ public float AnimFps;
public string EditorImage;
public ArrayList Images = new ArrayList();
public Tile() {
ID = -1;
NextTile = -1;
- AnimSpeed = 25;
+ AnimFps = 1;
}
public void Write(LispWriter writer) {
writer.Write("editor-images", EditorImage);
if(Data != 0)
writer.Write("data", Data);
- if(AnimSpeed != 25)
- writer.Write("anim-speed", AnimSpeed);
+ if(Images.Count > 1) {
+ if(AnimFps == 1.0)
+ AnimFps = 40;
+ writer.Write("anim-fps", AnimFps);
+ }
writer.EndList("tile");
}
Slope = true;
Data = parser.IntegerValue;
break;
- case "anim-speed":
- AnimSpeed = parser.IntegerValue;
+ case "anim-fps":
+ AnimFps = parser.FloatValue;
break;
case "spike":
Spike = parser.BoolValue;
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="label" translatable="yes">AnimSpeed:</property>
+ <property name="label" translatable="yes">AnimFPS:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
</child>
<child>
- <widget class="GtkEntry" id="AnimSpeedEntry">
+ <widget class="GtkEntry" id="AnimFpsEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
(sprite (name "bonusblock")
(action
+ (fps 15)
(name "default")
(images "tilesets/bonus2-1.png"
"tilesets/bonus2-2.png"
"tilesets/bonus2-3.png"
"tilesets/bonus2-4.png"
- "tilesets/bonus2-5.png"))
+ "tilesets/bonus2-5.png"
+ "tilesets/bonus2-3.png"
+ "tilesets/bonus2-2.png"
+ "tilesets/bonus2-1.png"
+ "tilesets/bonus2-1.png"
+ "tilesets/bonus2-1.png"
+ ))
(action
(name "empty")
(images "tilesets/bonus2-d.png"))
(fullbox #t)
(next-tile 84)
(data 1)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 27)
"coin-8.png"
)
(distro #t)
+ (anim-fps 10)
)
(tile
(id 47)
"waves-2.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 77)
"flag-0.png"
"flag-1.png"
)
+ (anim-fps 10)
)
(tile
(id 82)
"coin2.png"
)
(distro #t)
+ (anim-fps 10)
)
(tile
(id 83)
(fullbox #t)
(next-tile 84)
(data 1)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 84)
(next-tile 84)
(editor-images "bonus-fireflower.png")
(data 2)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 103)
(next-tile 84)
(editor-images "bonus-herring.png")
(data 3)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 104)
(next-tile 84)
(editor-images "bonus-1up.png")
(data 4)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 129)
"goal1-1.png"
"goal1-1.png"
)
+ (anim-fps 10)
)
(tile
(id 130)
"goal2-1.png"
"goal2-1.png"
)
+ (anim-fps 10)
)
(tile
(id 131)
(next-tile 84)
(editor-images "bonus-iceflower.png")
(data 5)
- (anim-speed 50)
+ (anim-fps 2)
)
(tile
(id 141)
"lava1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 174)
"lava2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 175)
"waterfall-trans1-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 176)
"waterfall-trans1-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 177)
"waterfall-trans1-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 178)
"waterfall-trans1-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 179)
"waterfall-trans2-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 180)
"waterfall-trans2-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 181)
"waterfall-trans2-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 182)
"waterfall-trans2-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 183)
"waterfall-trans3-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 184)
"waterfall-trans3-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 185)
"waterfall-trans3-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 186)
"waterfall-trans3-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 187)
"waterfall-trans4-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 188)
"waterfall-trans4-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 189)
"waterfall-trans4-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 190)
"waterfall-trans4-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 191)
"waterfall-trans5-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 192)
"waterfall-trans5-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 193)
"waterfall-trans5-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 194)
"waterfall-trans5-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 195)
"waterfall1-0-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 196)
"waterfall1-5-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 197)
"waterfall0-0-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 198)
"waterfall0-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 199)
"waterfall0-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 200)
"waves-trans-2.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 202)
"waterfall1-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 276)
"waterfall1-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 277)
"waterfall1-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 278)
"waterfall1-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 279)
"waterfall2-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 280)
"waterfall2-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 281)
"waterfall2-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 282)
"waterfall2-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 283)
"waterfall3-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 284)
"waterfall3-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 285)
"waterfall3-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 286)
"waterfall3-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 287)
"waterfall4-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 288)
"waterfall4-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 289)
"waterfall4-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 290)
"waterfall4-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 291)
"waterfall5-1-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 292)
"waterfall5-2-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 293)
"waterfall5-3-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 294)
"waterfall5-4-4.png"
)
(water #t)
+ (anim-fps 10)
)
(tile
(id 295)
"jungle12-2.png"
)
(solid #t)
+ (anim-fps 10)
)
(tile
(id 313)
)
(solid #t)
(slope-type 2)
+ (data 2)
)
(tile
(id 1048)
--- /dev/null
+;; Generated by Flexlay Editor
+(supertux-level
+ (version 2)
+ (name "No Name")
+ (author "No Author")
+ (time 999)
+ (sector
+ (name "main")
+ (width 30)
+ (height 20)
+ (gravity 10.000000)
+ (background (image "arctis.jpg")
+ (speed 0.5))
+ (tilemap
+ (layer "background")
+ (solid #f)
+ (speed 1.000000)
+ (width 30)
+ (height 20)
+ (tiles
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+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er "main")
+ (solid #t)
+ (speed 1.000000)
+ (width 30)
+ (height 20)
+ (tiles
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 191 192 193 194 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 187 188 189 190 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 183 184 185 186 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 179 180 181 182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 175 176 177 178 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 61 61 61 61 61 61 61 61 61 61 61 61 61 275 276 277 278 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 174 174 174 174 174 174 174 174 174 174 174 174 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 173 173 173 173 173 173 173 173 173 173 173 173 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0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0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ ))
+ (camera
+ (mode "normal")
+ (path
+ ))
+
+ )
+ )
+
+;; EOF ;;
--- /dev/null
+;; Generated by Flexlay Editor
+(supertux-level
+ (version 2)
+ (name "No Name")
+ (author "No Author")
+ (time 999)
+ (sector
+ (name "main")
+ (width 30)
+ (height 30)
+ (gravity 10.000000)
+ (background (image "arctis.jpg")
+ (speed 0.5))
+ (spawn-points
+ (name "main")
+ (x 100)
+ (y 170)
+ )
+ (tilemap
+ (layer "background")
+ (solid #f)
+ (speed 1.000000)
+ (width 30)
+ (height 30)
+ (tiles
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ ))
+ (camera
+ (mode "normal")
+ (path
+ ))
+
+ )
+ )
+
+;; EOF ;;
DrawingContext::DrawingContext()
{
- transform.draw_effect = NONE_EFFECT;
- transform.zoom = 1;
- transform.alpha = 255;
}
DrawingContext::~DrawingContext()
DrawingRequest request;
request.type = SURFACE;
- request.layer = layer;
- request.request_data = const_cast<Surface*> (surface);
request.pos = transform.apply(position);
if(request.pos.x >= screen->w || request.pos.y >= screen->h
|| request.pos.x + surface->w < 0 || request.pos.y + surface->h < 0)
return;
-
- request.drawing_effect = drawing_effect;
- request.drawing_effect = transform.draw_effect | drawing_effect;
+
+ request.layer = layer;
+ request.drawing_effect = transform.drawing_effect | drawing_effect;
request.zoom = transform.zoom;
request.alpha = transform.alpha;
+ request.request_data = const_cast<Surface*> (surface);
drawingrequests.push_back(request);
}
DrawingRequest request;
request.type = SURFACE_PART;
- request.layer = layer;
request.pos = transform.apply(dest);
- request.drawing_effect = drawing_effect;
+ request.layer = layer;
+ request.drawing_effect = transform.drawing_effect | drawing_effect;
request.alpha = transform.alpha;
SurfacePartRequest* surfacepartrequest = new SurfacePartRequest();
DrawingRequest request;
request.type = TEXT;
- request.layer = layer;
request.pos = transform.apply(position);
- request.drawing_effect = drawing_effect;
+ request.layer = layer;
+ request.drawing_effect = transform.drawing_effect | drawing_effect;
+ request.zoom = transform.zoom;
request.alpha = transform.alpha;
TextRequest* textrequest = new TextRequest;
DrawingRequest request;
request.type = GRADIENT;
- request.layer = layer;
request.pos = Vector(0,0);
+ request.layer = layer;
+
+ request.drawing_effect = transform.drawing_effect;
+ request.zoom = transform.zoom;
+ request.alpha = transform.alpha;
GradientRequest* gradientrequest = new GradientRequest;
gradientrequest->top = top;
DrawingRequest request;
request.type = FILLRECT;
- request.layer = layer;
request.pos = transform.apply(topleft);
+ request.layer = layer;
+
+ request.drawing_effect = transform.drawing_effect;
+ request.zoom = transform.zoom;
+ request.alpha = transform.alpha;
FillRectRequest* fillrectrequest = new FillRectRequest;
fillrectrequest->size = size;
void
DrawingContext::set_drawing_effect(int effect)
{
- transform.draw_effect = effect;
+ transform.drawing_effect = effect;
}
void
void do_drawing();
const Vector& get_translation() const
- { return transform.translation; }
+ { return transform.translation; }
Uint32 get_drawing_effect() const
- { return transform.draw_effect; }
+ { return transform.drawing_effect; }
void set_translation(const Vector& newtranslation)
{ transform.translation = newtranslation; }
private:
class Transform
- {
- public:
- Vector translation; // only translation for now...
+ {
+ public:
+ Vector translation;
+ Uint32 drawing_effect;
+ float zoom;
+ int alpha;
- Vector apply(const Vector& v) const
- {
- return v - translation;
- }
+ Transform()
+ : drawing_effect(NONE_EFFECT), zoom(1), alpha(255)
+ { }
- Uint32 draw_effect;
- float zoom;
- int alpha;
- };
+ Vector apply(const Vector& v) const
+ {
+ return v - translation;
+ }
+ };
/// the transform stack
std::vector<Transform> transformstack;
struct DrawingRequest
{
+ RequestType type;
+ Vector pos;
+
int layer;
Uint32 drawing_effect;
float zoom;
int alpha;
- RequestType type;
- Vector pos;
-
void* request_data;
bool operator<(const DrawingRequest& other) const
: type(LOAD), surface(0), file(file_), use_alpha(use_alpha_)
{}
-SurfaceData::SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, bool use_alpha_)
+SurfaceData::SurfaceData(const std::string& file_, int x_, int y_,
+ int w_, int h_, bool use_alpha_)
: type(LOAD_PART), surface(0), file(file_), use_alpha(use_alpha_),
x(x_), y(y_), w(w_), h(h_)
{}
-SurfaceData::SurfaceData(Color top_gradient_, Color bottom_gradient_, int w_, int h_)
+SurfaceData::SurfaceData(Color top_gradient_, Color bottom_gradient_,
+ int w_, int h_)
: type(GRADIENT), surface(0), use_alpha(false), w(w_), h(h_)
{
top_gradient = top_gradient_;
void Surface::apply_filter(int filter, Color color)
{
-impl->apply_filter(filter, color);
+ impl->apply_filter(filter, color);
-SurfaceData::Filter apply_filter;
-apply_filter.type = filter;
-apply_filter.color = color;
-data.applied_filters.push_back(apply_filter);
+ SurfaceData::Filter apply_filter;
+ apply_filter.type = filter;
+ apply_filter.color = color;
+ data.applied_filters.push_back(apply_filter);
}
Surface::~Surface()
SDL_Surface*
sdl_surface_from_gradient(Color top, Color bottom, int w, int h)
{
- SDL_Surface* sdl_surface;
-
- sdl_surface = SDL_CreateRGBSurface(screen->flags, w, h,
+ SDL_Surface* sdl_surface
+ = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
screen->format->BitsPerPixel, screen->format->Rmask,
screen->format->Gmask, screen->format->Bmask, 0);
- if(sdl_surface == NULL)
+ if(sdl_surface == 0)
Termination::abort("Cannot create surface for the gradient", "SURFACE");
- if(top == bottom)
- {
+ if(top == bottom) {
SDL_FillRect(sdl_surface, NULL, SDL_MapRGB(sdl_surface->format,
top.red, top.green, top.blue));
- }
- else
- {
+ } else {
float redstep = (float(bottom.red)-float(top.red)) / float(h);
float greenstep = (float(bottom.green)-float(top.green)) / float(h);
float bluestep = (float(bottom.blue) - float(top.blue)) / float(h);
rect.x = 0;
rect.w = w;
rect.h = 1;
- for(float y = 0; y < h; y++)
- {
+ for(float y = 0; y < h; y++) {
rect.y = (int)y;
SDL_FillRect(sdl_surface, &rect, SDL_MapRGB(sdl_surface->format,
- int(float(top.red) + redstep * y),
- int(float(top.green) + greenstep * y),
- int(float(top.blue) + bluestep * y)));
- }
+ int(float(top.red) + redstep * y),
+ int(float(top.green) + greenstep * y),
+ int(float(top.blue) + bluestep * y)));
}
+ }
return sdl_surface;
}
h = sdl_surface->h;
}
-SurfaceOpenGL::SurfaceOpenGL(const std::string& file_, int x_, int y_, int w_, int h_, bool use_alpha_)
+SurfaceOpenGL::SurfaceOpenGL(const std::string& file_, int x_, int y_,
+ int w_, int h_, bool use_alpha_)
{
sdl_surface = sdl_surface_part_from_file(file_,x_,y_,w_,h_,use_alpha_);
create_gl(sdl_surface, &gl_texture);
-
w = sdl_surface->w;
- h = sdl_surface->h;
+ h = sdl_surface->h;
}
-SurfaceOpenGL::SurfaceOpenGL(Color top_gradient, Color bottom_gradient, int w, int h)
+SurfaceOpenGL::SurfaceOpenGL(Color top_gradient, Color bottom_gradient,
+ int _w, int _h)
{
- sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient, w, h);
+ sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient,_w,_h);
create_gl(sdl_surface, &gl_texture);
-
w = sdl_surface->w;
- h = sdl_surface->h;
+ h = sdl_surface->h;
}
SurfaceOpenGL::~SurfaceOpenGL()
h = sdl_surface->h;
}
-SurfaceSDL::SurfaceSDL(const std::string& file, int x, int y, int w, int h, bool use_alpha)
+SurfaceSDL::SurfaceSDL(const std::string& file, int x, int y, int _w, int _h,
+ bool use_alpha)
{
- sdl_surface = sdl_surface_part_from_file(file, x, y, w, h, use_alpha);
+ sdl_surface = sdl_surface_part_from_file(file, x, y, _w, _h, use_alpha);
w = sdl_surface->w;
- h = sdl_surface->h;
+ h = sdl_surface->h;
}
-SurfaceSDL::SurfaceSDL(Color top_gradient, Color bottom_gradient, int w, int h)
+SurfaceSDL::SurfaceSDL(Color top_gradient, Color bottom_gradient,
+ int _w, int _h)
{
- sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient, w, h);
+ sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient,_w,_h);
w = sdl_surface->w;
- h = sdl_surface->h;
+ h = sdl_surface->h;
}
int
object/oneup.h object/oneup.cpp \
object/flower.h object/flower.cpp \
object/growup.h object/growup.cpp \
+ object/invisible_block.h object/invisible_block.cpp \
badguy/badguy.h badguy/badguy.cpp \
badguy/bomb.h badguy/bomb.cpp \
badguy/bouncing_snowball.h badguy/bouncing_snowball.cpp\
{
current_ = this;
- global_frame_counter = 0;
game_pause = false;
fps_fps = 0;
Uint32 lastticks = SDL_GetTicks();
fps_ticks = SDL_GetTicks();
- frame_timer.start(.025, true);
while (exit_status == ES_NONE) {
Uint32 ticks = SDL_GetTicks();
float elapsed_time = float(ticks - lastticks) / 1000.;
if(elapsed_time > .05)
elapsed_time = .05;
- if(frame_timer.check()) {
- ++global_frame_counter;
- }
-
/* Handle events: */
currentsector->player->input.old_fire = currentsector->player->input.fire;
currentsector->player->input.old_up = currentsector->player->input.old_up;
context.draw_text(white_text, _("TIME's UP"), Vector(screen->w/2, 0),
CENTER_ALLIGN, LAYER_FOREGROUND1);
} else if (time_left.get_timeleft() > TIME_WARNING
- || (global_frame_counter % 10) < 5) {
+ || int(global_time * 2.5) % 2) {
sprintf(str, " %d", int(time_left.get_timeleft()));
context.draw_text(white_text, _("TIME"),
Vector(screen->w/2, 0), CENTER_ALLIGN, LAYER_FOREGROUND1);
{
private:
Uint32 fps_ticks;
- Timer2 frame_timer;
Timer2 endsequence_timer;
Level* level;
Sector* currentsector;
show_grid = true;
selection.clear();
- global_frame_counter = 0;
selection_end = selection_ini = Vector(0,0);
left_button = middle_button = mouse_moved = false;
level = 0;
mouse_cursor->set_state(MC_NORMAL);
-frame_timer.start(.25, true);
done = false;
while(!done)
{
if(sector)
{
- if(frame_timer.check()) {
- ++global_frame_counter;
- }
-
// don't scroll before the start or after the level's end
float width = sector->solids->get_width() * 32;
float height = sector->solids->get_height() * 32;
float zoom;
SDL_Event event;
- Timer2 frame_timer;
Timer2 level_name_timer;
Surface *img_background_bt, *img_foreground_bt, *img_interactive_bt;
particle->pos.x = rand() % int(virtual_width);
particle->pos.y = rand() % int(virtual_height);
particle->texture = cloudimage;
- particle->speed = -float(250 + rand() % 200) / 1000.0;
+ particle->speed = -float(25 + rand() % 30);
particles.push_back(particle);
}
get_pos(), layer);
}
}
- else if (safe_timer.started() && global_frame_counter%2)
+ else if (safe_timer.started() && size_t(global_time*40)%2)
; // don't draw Tux
else
tux_body->draw(context, get_pos(), layer);
// Draw blinking star overlay
if (invincible_timer.started() &&
(invincible_timer.get_timeleft() > TUX_INVINCIBLE_TIME_WARNING
- || global_frame_counter % 3)
+ || size_t(global_time*20)%2)
&& !dying)
{
if (size == SMALL || duck)
extern PlayerStatus player_status;
-extern unsigned int global_frame_counter;
-
#endif /*SUPERTUX_SCENE_H*/
}
Tile::Tile()
- : id(0), attributes(0), data(0), next_tile(0), anim_speed(25)
+ : id(0), attributes(0), data(0), next_tile(0), anim_fps(1)
{
}
attributes |= GOAL;
reader.read_int("data", data);
- reader.read_int("anim-speed", anim_speed);
+ reader.read_float("anim-fps", anim_fps);
reader.read_int("next-tile", next_tile);
if(reader.read_int("slope-type", data)) {
Tile::draw(DrawingContext& context, const Vector& pos, int layer) const
{
if(images.size() > 1) {
- size_t frame = ((global_frame_counter*25) / anim_speed) % images.size();
+ size_t frame = size_t(global_time * anim_fps) % images.size();
context.draw_surface(images[frame], pos, layer);
} else if (images.size() == 1) {
context.draw_surface(images[0], pos, layer);
been collected or jumped at */
int next_tile;
- int anim_speed;
+ float anim_fps;
/** Draw a tile on the screen */
void draw(DrawingContext& context, const Vector& pos, int layer) const;
world->play_music(LEVEL_MUSIC);
- global_frame_counter++;
tux->key_event((SDLKey) keymap.right,DOWN);
if(random_timer.check()) {
tile->images.push_back(image);
}
- tile->anim_speed = 25;
- reader.read_int("anim-speed", tile->anim_speed);
+ tile->anim_fps = 1;
+ reader.read_float("anim-fps", tile->anim_fps);
if (id >= int(tiles.size()))
if(images.size() > 1)
{
- size_t frame
- = ((global_frame_counter*25) / anim_speed) % images.size();
+ size_t frame = size_t(global_time * anim_fps) % images.size();
context.draw_surface(images[frame], pos, LAYER_TILES);
}
name = "<no title>";
music = "salcon.mod";
- global_frame_counter = 0;
-
total_stats.reset();
}
void
WorldMap::update(float delta)
{
- if(!frame_timer.check()) {
- global_frame_counter++;
- }
-
if (enter_level && !tux->is_moving())
{
/* Check special tile action */
frame_rate.set_frame_limit(false);
frame_rate.start();
- frame_timer.start(.25, true);
DrawingContext context;
while(!quit)
void draw(DrawingContext& context, Vector pos);
std::vector<Surface*> images;
- int anim_speed;
+ float anim_fps;
// Directions in which Tux is allowed to walk from this tile
bool north;
Statistics total_stats;
void calculate_total_stats();
- Timer2 frame_timer;
-
public:
WorldMap();
~WorldMap();