- [FIX] Faltaven coses per inicialitzar al crear actors-porta

- [FIX] Les portes ja es veuen com toca respecte al heroi
This commit is contained in:
2024-09-23 13:58:45 +02:00
parent edc8e0b51d
commit 6dc59af774
6 changed files with 45 additions and 37 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -19,7 +19,7 @@ actor{
bmp: altres.gif
bmp-rect: 20 75 28 26
bmp-offset: -2 28
pos: 32 24 7
pos: 32 24 28
size: 8 8 8
orient: ZP
flags: PUSHABLE MOVING DEADLY INERTIA
@@ -31,7 +31,7 @@ actor{
bmp: altres.gif
bmp-rect: 20 75 28 26
bmp-offset: -2 28
pos: 24 32 32
pos: 24 32 9
size: 8 8 8
orient: ZN
flags: PUSHABLE MOVING DEADLY INERTIA
@@ -43,7 +43,7 @@ actor{
bmp: altres.gif
bmp-rect: 20 75 28 26
bmp-offset: -2 28
pos: 32 32 20
pos: 32 32 21
size: 8 8 8
orient: ZN
flags: PUSHABLE MOVING DEADLY INERTIA
@@ -55,7 +55,7 @@ actor{
bmp: altres.gif
bmp-rect: 20 75 28 26
bmp-offset: -2 28
pos: 24 24 20
pos: 24 24 15
size: 8 8 8
orient: ZP
flags: PUSHABLE MOVING DEADLY INERTIA
@@ -68,7 +68,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 18 8 0
size: 6 5 8
size: 6 5 4
orient: YP
flags: ORIENTABLE
movement: CW
@@ -80,7 +80,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 8 19 0
size: 6 5 8
size: 6 5 4
orient: YP
movement: CW
}
@@ -91,7 +91,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 8 41 0
size: 6 5 8
size: 6 5 4
orient: YP
movement: CW
}
@@ -102,7 +102,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 8 49 0
size: 6 5 8
size: 6 5 4
orient: YP
movement: CW
}
@@ -113,7 +113,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 49 8 0
size: 6 5 8
size: 6 5 4
orient: YP
flags: ORIENTABLE
movement: CW
@@ -125,7 +125,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -7 38
pos: 41 8 0
size: 6 5 8
size: 6 5 4
orient: YP
flags: ORIENTABLE
movement: CW

View File

@@ -46,7 +46,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -8 40
pos: 8 51 0
size: 5 4 8
size: 5 4 4
orient: YP
movement: CW
}
@@ -57,7 +57,7 @@ actor{
bmp-rect: 64 96 20 32
bmp-offset: -8 40
pos: 8 59 0
size: 5 4 8
size: 5 4 4
orient: YP
movement: CW
}
@@ -67,8 +67,8 @@ actor{
bmp: caixes.gif
bmp-rect: 64 96 20 32
bmp-offset: -8 40
pos: 31 46 0
size: 5 4 8
pos: 31 44 0
size: 5 4 4
orient: YP
flags: PUSHABLE ORIENTABLE
movement: CW

View File

@@ -58,17 +58,6 @@ actor{
movement: Z
}
actor{
name: CADIRA
bmp: caixes.gif
bmp-rect: 64 96 20 32
bmp-offset: -8 40
pos: 40 16 0
size: 5 4 8
orient: YP
movement: CW
}
actor{
name: CONV-XP-00
bmp: caixes.gif

View File

@@ -53,8 +53,7 @@ namespace actor
actor_t *create(std::string name, vec3_t p, vec3_t s, std::string bmp, SDL_Rect r, SDL_Point o)
{
actor_t *act = (actor_t*)malloc(sizeof(actor_t));
act->tag = current_tag++;
actor_t *act = createEmptyActor();
strcpy(act->name, name.c_str());
strcpy(act->bmp, bmp.c_str());
act->pos = p;
@@ -62,14 +61,6 @@ namespace actor
act->surface = draw::getSurface(bmp.c_str());
act->bmp_rect = r;
act->bmp_offset = o;
act->anim_cycle = act->orient = 0;
act->push = act->mov_push = PUSH_NONE;
act->below = act->above = nullptr;
act->prev = act->next = nullptr;
act->anim_wait = act->anim_wait_count = 0;
act->anim_frame=0;
act->react_mask = act->react_push = 0;
act->flags = FLAG_NONE;
return act;
}

View File

@@ -71,6 +71,21 @@ namespace room
//door_height[2] = inner_yp; //YP
//door_height[3] = inner_yn; //YN
if (doors & DOOR_XN)
{
actor::actor_t *act = actor::create("DOOR_XN", {4+(tmin.x-1)*8,37,1+door_height[1]*4}, {4,4,1}, "doors.gif", {24+(doors_type%6)*40,(doors_type/6)*59,8,59}, {-18,65});
act->flags = FLAG_NOEDITOR | FLAG_ORIENTABLE;
act->orient = PUSH_YP;
actor::setDirty(act, true);
}
if (doors & DOOR_YN)
{
actor::actor_t *act = actor::create("DOOR_YN", {34,4+(tmin.y-1)*8,1+door_height[3]*4}, {5,4,1}, "doors.gif", {24+(doors_type%6)*40,(doors_type/6)*59,8,59}, {-12,63});
act->flags = FLAG_NOEDITOR;
actor::setDirty(act, true);
}
if (doors & DOOR_YP)
{
uint8_t actual_floor = door_height[2]>0?0:floor_type*32;
@@ -80,6 +95,10 @@ namespace room
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_NOEDITOR;
actor::setDirty(act, true);
act = actor::create("DOOR_YP", {20,(tmax.y+1)*8,1+door_height[2]*4}, {5,4,1}, "doors.gif", {(doors_type%6)*40,(doors_type/6)*59,16,48}, {-16,49});
act->flags = FLAG_NOEDITOR;
actor::setDirty(act, true);
}
if (doors & DOOR_XP)
@@ -91,6 +110,11 @@ namespace room
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_NOEDITOR;
actor::setDirty(act, true);
act = actor::create("DOOR_XP", {(tmax.x+1)*8,20,1+door_height[0]*4}, {8,8,1}, "doors.gif", {(doors_type%6)*40,(doors_type/6)*59,16,48}, {0,49});
act->flags = FLAG_NOEDITOR | FLAG_ORIENTABLE;
act->orient = PUSH_YP;
actor::setDirty(act, true);
}
actor::reorder();
@@ -268,8 +292,12 @@ namespace room
void update()
{
actor::remove(actor::find("DOOR_XN"));
actor::remove(actor::find("DOOR_YN"));
actor::remove(actor::find("DOOR_XP"));
actor::remove(actor::find("DOOR_XP1"));
actor::remove(actor::find("DOOR_XP2"));
actor::remove(actor::find("DOOR_YP"));
actor::remove(actor::find("DOOR_YP1"));
actor::remove(actor::find("DOOR_YP2"));
@@ -419,7 +447,7 @@ namespace room
// Pintem la porta YP
draw::setSource(doors_surf);
draw::draw(164+3*16-8-(tmax.y+1)*16, -door_height[2]*8+32+3*8+4+(tmax.y+1)*8,40,59,doors_x,doors_y);
draw::draw(16+164+3*16-8-(tmax.y+1)*16, -door_height[2]*8+32+3*8+4+(tmax.y+1)*8,24,59,doors_x+16,doors_y);
}
if (doors & DOOR_XP)
{
@@ -436,7 +464,7 @@ namespace room
// Pintem la porta XP
draw::setSource(doors_surf);
draw::draw( 164+(tmax.x+1)*16-4*16-16, -door_height[0]*8+32+3*8+4+(tmax.x+1)*8, 40,59, doors_x,doors_y, DRAW_FLIP_HORIZONTAL);
draw::draw( 164+(tmax.x+1)*16-4*16-16, -door_height[0]*8+32+3*8+4+(tmax.x+1)*8, 24,59, doors_x+16,doors_y, DRAW_FLIP_HORIZONTAL);
}
draw::popSource();
}