52 |
*/ |
*/ |
53 |
void add_layer (DisplayLayer *l); |
void add_layer (DisplayLayer *l); |
54 |
void set_tilesize (int w, int h) { m_tilew=w; m_tileh=h; } |
void set_tilesize (int w, int h) { m_tilew=w; m_tileh=h; } |
55 |
|
int get_tilew () const { return m_tilew; } |
56 |
|
int get_tileh () const { return m_tileh; } |
57 |
void set_screen_area (const px::Rect & r); |
void set_screen_area (const px::Rect & r); |
58 |
px::Rect get_area() const { return m_area; } |
const px::Rect &get_area() const { return m_area; } |
59 |
|
|
60 |
int get_width() const { return m_width; } |
int get_width() const { return m_width; } |
61 |
int get_height() const { return m_height; } |
int get_height() const { return m_height; } |
337 |
|
|
338 |
void draw (px::GC &gc, const WorldArea &a, int x, int y); |
void draw (px::GC &gc, const WorldArea &a, int x, int y); |
339 |
|
|
|
void draw_lines (px::GC &gc); |
|
|
|
|
|
|
|
340 |
RubberHandle add_line (const V2 &p1, const V2 &p2); |
RubberHandle add_line (const V2 &p1, const V2 &p2); |
341 |
void set_startpoint (unsigned id, const V2 &p1); |
void set_startpoint (unsigned id, const V2 &p1); |
342 |
void set_endpoint (unsigned id, const V2 &p2); |
void set_endpoint (unsigned id, const V2 &p2); |
400 |
//---------------------------------------- |
//---------------------------------------- |
401 |
class Follower { |
class Follower { |
402 |
public: |
public: |
403 |
|
Follower (DisplayEngine *e) { m_engine = e; } |
404 |
virtual ~Follower() {} |
virtual ~Follower() {} |
405 |
virtual void tick(double dtime, const px::V2 &point) = 0; |
virtual void tick(double dtime, const px::V2 &point) = 0; |
406 |
virtual void center(const px::V2 &point) = 0; |
virtual void center(const px::V2 &point) = 0; |
407 |
|
|
408 |
void set_engine(DisplayEngine *e) { m_engine = e; } |
// void set_engine(DisplayEngine *e) { m_engine = e; } |
409 |
DisplayEngine *get_engine() const { return m_engine; } |
DisplayEngine *get_engine() const { return m_engine; } |
410 |
private: |
private: |
411 |
DisplayEngine *m_engine; |
DisplayEngine *m_engine; |
413 |
|
|
414 |
class Follower_Screen : public Follower { |
class Follower_Screen : public Follower { |
415 |
public: |
public: |
416 |
|
Follower_Screen(DisplayEngine *e); |
417 |
void tick(double dtime, const px::V2 &point); |
void tick(double dtime, const px::V2 &point); |
418 |
void center(const px::V2 &point); |
void center(const px::V2 &point); |
419 |
|
private: |
420 |
|
bool set_offset (px::V2 offs); |
421 |
|
int m_hoff, m_voff; |
422 |
}; |
}; |
423 |
|
|
424 |
class Follower_Scrolling : public Follower { |
class Follower_Scrolling : public Follower { |
425 |
public: |
public: |
426 |
Follower_Scrolling(); |
Follower_Scrolling(DisplayEngine *e); |
427 |
void tick(double dtime, const px::V2 &point); |
void tick(double dtime, const px::V2 &point); |
428 |
void center(const px::V2 &point); |
void center(const px::V2 &point); |
429 |
private: |
private: |
444 |
void tick(double dtime); |
void tick(double dtime); |
445 |
void new_world (int w, int h); |
void new_world (int w, int h); |
446 |
|
|
447 |
|
void resize_game_area (int w, int h); |
448 |
|
|
449 |
/* |
/* |
450 |
** Scrolling |
** Scrolling |
451 |
*/ |
*/ |
462 |
void draw_all (px::GC &gc); |
void draw_all (px::GC &gc); |
463 |
private: |
private: |
464 |
void set_follower (Follower *f); |
void set_follower (Follower *f); |
465 |
|
void draw_borders (px::GC &gc); |
466 |
|
|
467 |
/* |
/* |
468 |
** Variables |
** Variables |