- Portes almost completades
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "room.h"
|
||||
#include "jdraw.h"
|
||||
#include "actor.h"
|
||||
|
||||
namespace room
|
||||
{
|
||||
@@ -9,7 +10,7 @@ namespace room
|
||||
static vec3_t min = {0,0,0};
|
||||
static vec3_t max = {56,56,56};
|
||||
|
||||
static uint8_t doors = DOOR_XN | DOOR_YN ;
|
||||
static uint8_t doors = 15; //OOR_XP /*| DOOR_YP*/ ;
|
||||
static uint8_t door_height[4];
|
||||
|
||||
void load(int x, int y)
|
||||
@@ -23,12 +24,34 @@ namespace room
|
||||
door_height[1] = 3; //XN
|
||||
door_height[2] = 2; //YP
|
||||
door_height[3] = 5; //YN
|
||||
|
||||
if (doors & DOOR_YP)
|
||||
{
|
||||
actor::actor_t *act = actor::create({24,(tmax.y+1)*8,0}, {8,8,(door_height[2])*4}, {0,1,32,15}, {0,15+door_height[2]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
actor::setDirty(act, true);
|
||||
act = actor::create({32,(tmax.y+1)*8,0}, {8,8,(door_height[2])*4}, {0,1,32,15}, {0,15+door_height[2]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
actor::setDirty(act, true);
|
||||
}
|
||||
|
||||
if (doors & DOOR_XP)
|
||||
{
|
||||
actor::actor_t *act = actor::create({(tmax.x+1)*8,24,0}, {8,8,(door_height[0])*4}, {0,1,32,15}, {0,15+door_height[0]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
actor::setDirty(act, true);
|
||||
act = actor::create({(tmax.x+1)*8,32,0}, {8,8,(door_height[0])*4}, {0,1,32,15}, {0,15+door_height[0]*8});
|
||||
act->flags = FLAG_NONE;
|
||||
actor::setDirty(act, true);
|
||||
}
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
// RUTINES DE PINTAT DE LA PORTA DE DALT A LA DRETA
|
||||
if (doors & DOOR_YN)
|
||||
{
|
||||
// Si la porta està elevada, pintar la part frontal de baix de la porta
|
||||
if (door_height[3] > 0) {
|
||||
draw::draw( 164+3*16-tmin.y*16, (36+3*8+tmin.y*8) + (5-door_height[3])*8, 16, 48-(5-door_height[3])*8, 128, 16+(5-door_height[3])*8);
|
||||
draw::draw( 164+4*16-tmin.y*16, (36+4*8+tmin.y*8) + (5-door_height[3])*8, 16, 48-(5-door_height[3])*8, 128, 16+(5-door_height[3])*8);
|
||||
@@ -42,8 +65,11 @@ namespace room
|
||||
// Pintem la porta
|
||||
draw::draw(164+3*16-tmin.y*16, -door_height[3]*8+32+3*8+tmin.y*8,40,59,18,133);
|
||||
}
|
||||
|
||||
// RUTINES DE PINTAT DE LA PORTA DE DALT A LA ESQUERRA
|
||||
if (doors & DOOR_XN)
|
||||
{
|
||||
// Si la porta està elevada, pintar la part frontal de baix de la porta
|
||||
if (door_height[1] > 0) {
|
||||
draw::draw(148+tmin.x*16-3*16, (36+tmin.x*8+3*8)+(5-door_height[1])*8, 16, 48-(5-door_height[1])*8, 144, 16+(5-door_height[1])*8);
|
||||
draw::draw(148+tmin.x*16-4*16, (36+tmin.x*8+4*8)+(5-door_height[1])*8, 16, 48-(5-door_height[1])*8, 144, 16+(5-door_height[1])*8);
|
||||
@@ -80,42 +106,36 @@ namespace room
|
||||
{
|
||||
draw::draw(148+x*16-y*16,76+x*8+y*8,32,15,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
if (doors & DOOR_YP)
|
||||
{
|
||||
// Pintem les voreres dels dos tiles extra per a la porta YP
|
||||
draw::draw(164+4*16-(tmax.y+1)*16, -door_height[2]*8+84+4*8+(tmax.y+1)*8,16,15+door_height[2]*8,144,49-door_height[2]*8);
|
||||
draw::draw(148+3*16-(tmax.y+1)*16, -door_height[2]*8+84+3*8+(tmax.y+1)*8,16,15+door_height[2]*8,128,49-door_height[2]*8);
|
||||
draw::draw(148+4*16-(tmax.y+1)*16, -door_height[2]*8+84+4*8+(tmax.y+1)*8,16,15+door_height[2]*8,128,49-door_height[2]*8);
|
||||
|
||||
// Pintem els dos tiles de piso extra de la porta YP
|
||||
draw::draw(148+3*16-(tmax.y+1)*16, -door_height[2]*8+76+3*8+(tmax.y+1)*8,32,15,0,1);
|
||||
draw::draw(148+4*16-(tmax.y+1)*16, -door_height[2]*8+76+4*8+(tmax.y+1)*8,32,15,0,1);
|
||||
}
|
||||
if (doors & DOOR_XP)
|
||||
{
|
||||
// Pintem les voreres dels dos tiles extra per a la porta XP
|
||||
draw::draw(148+(tmax.x+1)*16-4*16, -door_height[0]*8+84+(tmax.x+1)*8+4*8,16,15+door_height[0]*8,128,49-door_height[0]*8);
|
||||
draw::draw(164+(tmax.x+1)*16-3*16, -door_height[0]*8+84+(tmax.x+1)*8+3*8,16,15+door_height[0]*8,144,49-door_height[0]*8);
|
||||
draw::draw(164+(tmax.x+1)*16-4*16, -door_height[0]*8+84+(tmax.x+1)*8+4*8,16,15+door_height[0]*8,144,49-door_height[0]*8);
|
||||
|
||||
// Pintem els dos tiles de piso extra de la porta XP
|
||||
draw::draw(148+(tmax.x+1)*16-3*16, -door_height[0]*8+76+(tmax.x+1)*8+3*8,32,15,0,1);
|
||||
draw::draw(148+(tmax.x+1)*16-4*16, -door_height[0]*8+76+(tmax.x+1)*8+4*8,32,15,0,1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void draw2()
|
||||
{
|
||||
if (doors & DOOR_YP)
|
||||
{
|
||||
// Pintem les voreres dels dos tiles extra per a la porta YP
|
||||
draw::draw(164+4*16-(tmax.y+1)*16, -door_height[2]*8+84+4*8+(tmax.y+1)*8, 16, 15+door_height[2]*8, 144, 17);
|
||||
draw::draw(148+3*16-(tmax.y+1)*16, -door_height[2]*8+84+3*8+(tmax.y+1)*8, 16, 15+door_height[2]*8, 128, 17);
|
||||
draw::draw(148+4*16-(tmax.y+1)*16, -door_height[2]*8+84+4*8+(tmax.y+1)*8, 16, 15+door_height[2]*8, 128, 17);
|
||||
|
||||
draw::draw(164+4*16-(tmax.y+1)*16, 91+4*8+(tmax.y+1)*8, 16, 8, 16, 24);
|
||||
draw::draw(148+3*16-(tmax.y+1)*16, 91+3*8+(tmax.y+1)*8, 16, 8, 0, 24);
|
||||
draw::draw(148+4*16-(tmax.y+1)*16, 91+4*8+(tmax.y+1)*8, 16, 8, 0, 24);
|
||||
|
||||
// Pintem la porta YP
|
||||
draw::draw(164+3*16-8-(tmax.y+1)*16, -door_height[2]*8+32+3*8+4+(tmax.y+1)*8,40,59,18,133);
|
||||
}
|
||||
if (doors & DOOR_XP)
|
||||
{
|
||||
// Pintem les voreres dels dos tiles extra per a la porta XP
|
||||
draw::draw(148+(tmax.x+1)*16-4*16, -door_height[0]*8+84+(tmax.x+1)*8+4*8,16,15+door_height[0]*8,128,17);
|
||||
draw::draw(164+(tmax.x+1)*16-3*16, -door_height[0]*8+84+(tmax.x+1)*8+3*8,16,15+door_height[0]*8,144,17);
|
||||
draw::draw(164+(tmax.x+1)*16-4*16, -door_height[0]*8+84+(tmax.x+1)*8+4*8,16,15+door_height[0]*8,144,17);
|
||||
|
||||
draw::draw(148+(tmax.x+1)*16-4*16, 91+(tmax.x+1)*8+4*8,16,8,0,24);
|
||||
draw::draw(164+(tmax.x+1)*16-3*16, 91+(tmax.x+1)*8+3*8,16,8,16,24);
|
||||
draw::draw(164+(tmax.x+1)*16-4*16, 91+(tmax.x+1)*8+4*8,16,8,16,24);
|
||||
|
||||
// Pintem la porta XP
|
||||
draw::draw( 164+(tmax.x+1)*16-4*16-16, -door_height[0]*8+32+3*8+4+(tmax.x+1)*8, 40,59, 64,133);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user