--- libgender/entity.h 2004/10/03 05:53:09 1.9 +++ libgender/entity.h 2004/10/03 20:14:33 1.10 @@ -13,24 +13,24 @@ struct entity_base { struct entity_base *parent; + sector orig; vector o; box bbox; virtual void update_bbox (); - virtual void show (const sector &sec) { }; + virtual void show () { world.add (orig, this); }; void hide (); + void display (draw_context &ctx); virtual void draw (draw_context &ctx) = 0; - void try_draw (draw_context &ctx) { if (ctx.may_draw (this)) draw (ctx); } - virtual ~entity_base () - { - hide (); - }; + + entity_base (); + virtual ~entity_base (); }; struct entity_container : entity_base, protected vector { void add (entity_base *e) { push_back (e); e->parent = this; } void update_bbox (); - void show (const sector &sec); + void show (); void draw (draw_context &ctx); ~entity_container (); }; @@ -55,17 +55,12 @@ entity_base *content () { return e; }; void update_bbox (); - void show (const sector &sec); + void show (); void draw (draw_context &ctx); ~entity_filter (); }; struct entity : entity_filter { - sector sec; - - void show (const sector &sec); - void show (); - void draw (draw_context &ctx); }; #if 0 @@ -96,7 +91,6 @@ template struct entity_opengl1d : entity_opengl, vector { void update_bbox (); - void show (const sector &sec); void draw (draw_context &ctx); }; @@ -106,7 +100,6 @@ GLuint list; void update_bbox (); - void show (const sector &sec); void draw (draw_context &ctx); entity_opengl2d ()