- Comencem a treballar en les habitacions

This commit is contained in:
2023-03-09 18:58:25 +01:00
parent 82fc3f3c98
commit 2ef01a14d9
7 changed files with 96 additions and 34 deletions

46
source/room.cpp Normal file
View File

@@ -0,0 +1,46 @@
#include "room.h"
#include "jdraw.h"
namespace room
{
static vec3_t size = {8,8,8};
static vec3_t tmin = {0,0,0};
static vec3_t tmax = {7,7,7};
static vec3_t min = {0,0,0};
static vec3_t max = {56,56,56};
void load(int x, int y)
{
size = {(x+1)*2,(y+1)*2,3};
tmin = {3-x,3-y,0};
tmax = {4+x,4+y,3};
min = {tmin.x*8,tmin.y*8,0};
max = {tmax.x*8,tmax.y*8,24};
}
void draw()
{
for (int y=tmin.y;y<=tmax.y;++y)
{
for (int x=tmin.x;x<=tmax.x;++x)
{
draw::draw(148+x*16-y*16,76+x*8+y*8,32,15,0,1);
}
}
}
vec3_t getSize()
{
return size;
}
vec3_t getMin()
{
return min;
}
vec3_t getMax()
{
return max;
}
}