- Reorganització de part del codi abans de implementar la càrrega de nivells des d'arxiu
This commit is contained in:
@@ -769,7 +769,7 @@ namespace actor
|
|||||||
hero->above = hero->below = hero->next = hero->prev = nullptr;
|
hero->above = hero->below = hero->next = hero->prev = nullptr;
|
||||||
dirty = hero;
|
dirty = hero;
|
||||||
}
|
}
|
||||||
|
selected = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace templates
|
namespace templates
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ std::vector<std::string> gifs;
|
|||||||
|
|
||||||
void restart()
|
void restart()
|
||||||
{
|
{
|
||||||
//actor::clear();
|
|
||||||
actor::remove(actor::find("DOOR_YP1"));
|
|
||||||
actor::remove(actor::find("DOOR_YP2"));
|
|
||||||
actor::remove(actor::find("DOOR_XP1"));
|
|
||||||
actor::remove(actor::find("DOOR_XP2"));
|
|
||||||
|
|
||||||
room::load(room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color, room_floor, room_walls, room_doors, room_walldoors);
|
room::load(room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color, room_floor, room_walls, room_doors, room_walldoors);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -47,7 +41,7 @@ void restart()
|
|||||||
//box->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
//box->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
||||||
//actor::setDirty(box, true);
|
//actor::setDirty(box, true);
|
||||||
|
|
||||||
actor::reorder();
|
//actor::reorder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void game::init()
|
void game::init()
|
||||||
@@ -74,7 +68,7 @@ void game::init()
|
|||||||
hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
||||||
actor::setDirty(hero, true);
|
actor::setDirty(hero, true);
|
||||||
|
|
||||||
actor::clear();
|
restart();
|
||||||
|
|
||||||
actor::actor_t *box = actor::create("BOX", {32,32,16}, {8,8,8}, "test.gif", {32,0,32,32}, {0,32});
|
actor::actor_t *box = actor::create("BOX", {32,32,16}, {8,8,8}, "test.gif", {32,0,32,32}, {0,32});
|
||||||
box->flags = FLAG_PUSHABLE | FLAG_GRAVITY;
|
box->flags = FLAG_PUSHABLE | FLAG_GRAVITY;
|
||||||
@@ -88,8 +82,6 @@ void game::init()
|
|||||||
box->mov_push = PUSH_XN;
|
box->mov_push = PUSH_XN;
|
||||||
actor::setDirty(box, true);
|
actor::setDirty(box, true);
|
||||||
|
|
||||||
restart();
|
|
||||||
|
|
||||||
actor::select(actor::find("BOX"));
|
actor::select(actor::find("BOX"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ namespace room
|
|||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
|
actor::clear();
|
||||||
|
|
||||||
if (floor_surf) draw::freeSurface(floor_surf);
|
if (floor_surf) draw::freeSurface(floor_surf);
|
||||||
if (walls_surf) draw::freeSurface(walls_surf);
|
if (walls_surf) draw::freeSurface(walls_surf);
|
||||||
if (doors_surf) draw::freeSurface(doors_surf);
|
if (doors_surf) draw::freeSurface(doors_surf);
|
||||||
@@ -77,6 +79,8 @@ namespace room
|
|||||||
act->flags = FLAG_NOEDITOR;
|
act->flags = FLAG_NOEDITOR;
|
||||||
actor::setDirty(act, true);
|
actor::setDirty(act, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actor::reorder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw()
|
void draw()
|
||||||
|
|||||||
Reference in New Issue
Block a user