- Augmentat el nom dels actor a 16 caràcters
- Augmentat els flags dels actors a 16 bits - Afegit flag NOEDITOR per a ocultar les portes del editor - Per ara eixim amb ESC, mes fàcil
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
*.dll
|
||||
.vscode/*
|
||||
thepool
|
||||
thepool_debug
|
||||
@@ -12,6 +12,7 @@
|
||||
#define FLAG_ORIENTABLE 32
|
||||
#define FLAG_DEADLY 64
|
||||
#define FLAG_GRAVITY 128
|
||||
#define FLAG_NOEDITOR 256
|
||||
|
||||
#define PUSH_NONE 0
|
||||
#define PUSH_XP 1
|
||||
@@ -34,7 +35,7 @@ namespace actor
|
||||
{
|
||||
struct actor_t
|
||||
{
|
||||
char name[8];
|
||||
char name[16];
|
||||
draw::surface *surface;
|
||||
SDL_Rect bmp_rect;
|
||||
SDL_Point bmp_offset;
|
||||
@@ -48,7 +49,7 @@ namespace actor
|
||||
uint8_t anim_wait;
|
||||
uint8_t anim_wait_count;
|
||||
|
||||
uint8_t flags;
|
||||
uint16_t flags;
|
||||
uint8_t push;
|
||||
|
||||
uint8_t react_mask;
|
||||
|
||||
@@ -103,6 +103,8 @@ int section = 0;
|
||||
|
||||
bool game::loop()
|
||||
{
|
||||
if (input::keyDown(SDL_SCANCODE_ESCAPE)) return false;
|
||||
|
||||
actor::update(actor::getFirst());
|
||||
actor::reorder();
|
||||
|
||||
@@ -145,12 +147,14 @@ bool game::loop()
|
||||
int line = 0;
|
||||
actor::actor_t *act = actor::getFirst();
|
||||
while (act) {
|
||||
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR) {
|
||||
if (act==actor::getSelected()) {
|
||||
draw::color(TEAL);
|
||||
draw::fillrect(330, 40+line*8, 50, 8);
|
||||
}
|
||||
draw::print(act->name, 330, 40+line*8, WHITE, BLACK);
|
||||
line++;
|
||||
}
|
||||
act = act->next;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace room
|
||||
{
|
||||
uint8_t actual_floor = door_height[2]>0?0:floor_type*32;
|
||||
actor::actor_t *act = actor::create("DOOR_YP1", {24,(tmax.y+1)*8,0}, {8,8,(door_height[2])*4}, "floor.gif", {actual_floor,1,32,15}, {0,15+door_height[2]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
act->flags = FLAG_NOEDITOR;
|
||||
actor::setDirty(act, true);
|
||||
act = actor::create("DOOR_YP2", {32,(tmax.y+1)*8,0}, {8,8,(door_height[2])*4}, "floor.gif", {actual_floor,1,32,15}, {0,15+door_height[2]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
act->flags = FLAG_NOEDITOR;
|
||||
actor::setDirty(act, true);
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ namespace room
|
||||
{
|
||||
uint8_t actual_floor = door_height[0]>0?0:floor_type*32;
|
||||
actor::actor_t *act = actor::create("DOOR_XP1", {(tmax.x+1)*8,24,0}, {8,8,(door_height[0])*4}, "floor.gif", {actual_floor,1,32,15}, {0,15+door_height[0]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
act->flags = FLAG_NOEDITOR;
|
||||
actor::setDirty(act, true);
|
||||
act = actor::create("DOOR_XP2", {(tmax.x+1)*8,32,0}, {8,8,(door_height[0])*4}, "floor.gif", {actual_floor,1,32,15}, {0,15+door_height[0]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
act->flags = FLAG_NOEDITOR;
|
||||
actor::setDirty(act, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user