- [CHG] Pujat el maxim d'habitacions per al prologo
This commit is contained in:
@@ -12,7 +12,7 @@ namespace modules
|
|||||||
{
|
{
|
||||||
draw::surface *surf;
|
draw::surface *surf;
|
||||||
vec2_t scroll {0,0};
|
vec2_t scroll {0,0};
|
||||||
int drawn[64];
|
int drawn[MAX_ROOMS];
|
||||||
int current_room;
|
int current_room;
|
||||||
int previous_room;
|
int previous_room;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ namespace modules
|
|||||||
uint32_t specials;
|
uint32_t specials;
|
||||||
uint8_t editor_done;
|
uint8_t editor_done;
|
||||||
};
|
};
|
||||||
miniroom_t minirooms[64];
|
miniroom_t minirooms[MAX_ROOMS];
|
||||||
|
|
||||||
void drawLines(const int room, const int x, const int y)
|
void drawLines(const int room, const int x, const int y)
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,7 @@ namespace modules
|
|||||||
|
|
||||||
for (int i=0; i<=ZN; ++i) {
|
for (int i=0; i<=ZN; ++i) {
|
||||||
const int next_room = minirooms[room].exits[i];
|
const int next_room = minirooms[room].exits[i];
|
||||||
if ( (next_room >= 0) && (next_room <= 64) && (!drawn[next_room]) ) {
|
if ( (next_room >= 0) && (next_room <= MAX_ROOMS) && (!drawn[next_room]) ) {
|
||||||
room::load(next_room);
|
room::load(next_room);
|
||||||
loadMiniRoom();
|
loadMiniRoom();
|
||||||
}
|
}
|
||||||
@@ -124,14 +124,14 @@ namespace modules
|
|||||||
surf = draw::getSurface("mapa.gif");
|
surf = draw::getSurface("mapa.gif");
|
||||||
scroll = {260,120};
|
scroll = {260,120};
|
||||||
draw::resetViewport();
|
draw::resetViewport();
|
||||||
for (int i=0;i<64;++i) drawn[i]=false;
|
for (int i=0;i<MAX_ROOMS;++i) drawn[i]=false;
|
||||||
|
|
||||||
current_room = room::getCurrent();
|
current_room = room::getCurrent();
|
||||||
previous_room = current_room;
|
previous_room = current_room;
|
||||||
loadMiniRoom();
|
loadMiniRoom();
|
||||||
room::load(42);
|
room::load(42);
|
||||||
|
|
||||||
for (int i=0;i<64;++i) drawn[i]=false;
|
for (int i=0;i<MAX_ROOMS;++i) drawn[i]=false;
|
||||||
draw::cls(2);
|
draw::cls(2);
|
||||||
draw::setSource(surf);
|
draw::setSource(surf);
|
||||||
|
|
||||||
@@ -140,14 +140,14 @@ namespace modules
|
|||||||
for (int y=-1; y<=1; ++y)
|
for (int y=-1; y<=1; ++y)
|
||||||
for (int x=-1; x<=1; ++x)
|
for (int x=-1; x<=1; ++x)
|
||||||
{
|
{
|
||||||
for (int i=0;i<64;++i) drawn[i]=false;
|
for (int i=0;i<MAX_ROOMS;++i) drawn[i]=false;
|
||||||
drawRoom(room::getCurrent(), scroll.x+x, scroll.y+y, true);
|
drawRoom(room::getCurrent(), scroll.x+x, scroll.y+y, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw::stencil::enable();
|
draw::stencil::enable();
|
||||||
draw::stencil::clear(255);
|
draw::stencil::clear(255);
|
||||||
|
|
||||||
for (int i=0;i<64;++i) drawn[i]=false;
|
for (int i=0;i<MAX_ROOMS;++i) drawn[i]=false;
|
||||||
drawRoom(room::getCurrent(), scroll.x, scroll.y);
|
drawRoom(room::getCurrent(), scroll.x, scroll.y);
|
||||||
|
|
||||||
draw::render();
|
draw::render();
|
||||||
@@ -165,7 +165,7 @@ namespace modules
|
|||||||
//draw::stencil::enable();
|
//draw::stencil::enable();
|
||||||
//draw::stencil::clear(255);
|
//draw::stencil::clear(255);
|
||||||
|
|
||||||
//for (int i=0;i<64;++i) drawn[i]=false;
|
//for (int i=0;i<MAX_ROOMS;++i) drawn[i]=false;
|
||||||
//drawRoom(room::getCurrent(), scroll.x, scroll.y);
|
//drawRoom(room::getCurrent(), scroll.x, scroll.y);
|
||||||
|
|
||||||
const int hover = draw::stencil::query(input::mouseX(), input::mouseY());
|
const int hover = draw::stencil::query(input::mouseX(), input::mouseY());
|
||||||
|
|||||||
@@ -740,27 +740,27 @@ namespace modules
|
|||||||
ui::label("EXITS", 2, line, 96, 11, GRAY); line+=10;
|
ui::label("EXITS", 2, line, 96, 11, GRAY); line+=10;
|
||||||
|
|
||||||
ui::label("XN", 2, line, 48, 11);
|
ui::label("XN", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(XN), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(XN), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(XN), XP);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(XN), XP);
|
||||||
line += 10;
|
line += 10;
|
||||||
ui::label("YP", 2, line, 48, 11);
|
ui::label("YP", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(YP), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(YP), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(YP), YN);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(YP), YN);
|
||||||
line += 10;
|
line += 10;
|
||||||
ui::label("XP", 2, line, 48, 11);
|
ui::label("XP", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(XP), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(XP), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(XP), XN);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(XP), XN);
|
||||||
line += 10;
|
line += 10;
|
||||||
ui::label("YN", 2, line, 48, 11);
|
ui::label("YN", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(YN), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(YN), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(YN), YP);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(YN), YP);
|
||||||
line += 10;
|
line += 10;
|
||||||
ui::label("ZP", 2, line, 48, 11);
|
ui::label("ZP", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(ZP), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(ZP), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(ZP), ZN);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(ZP), ZN);
|
||||||
line += 10;
|
line += 10;
|
||||||
ui::label("ZN", 2, line, 48, 11);
|
ui::label("ZN", 2, line, 48, 11);
|
||||||
changed |= btn_small(48, line, room::editor::refExit(ZN), -1, 64, 36);
|
changed |= btn_small(48, line, room::editor::refExit(ZN), -1, MAX_ROOMS, 36);
|
||||||
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(ZN), ZP);
|
if (ui::button("GO", 84, line, 13, 11)) room::load(room::editor::refExit(ZN), ZP);
|
||||||
line += 10;
|
line += 10;
|
||||||
|
|
||||||
|
|||||||
@@ -228,22 +228,22 @@ namespace room
|
|||||||
|
|
||||||
} else if (util::strcomp(key, "exit-xp:")) {
|
} else if (util::strcomp(key, "exit-xp:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[0] = SDL_clamp(val, 0, 64);
|
exits[0] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "exit-xn:")) {
|
} else if (util::strcomp(key, "exit-xn:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[1] = SDL_clamp(val, 0, 64);
|
exits[1] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "exit-yp:")) {
|
} else if (util::strcomp(key, "exit-yp:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[2] = SDL_clamp(val, 0, 64);
|
exits[2] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "exit-yn:")) {
|
} else if (util::strcomp(key, "exit-yn:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[3] = SDL_clamp(val, 0, 64);
|
exits[3] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "exit-zp:")) {
|
} else if (util::strcomp(key, "exit-zp:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[4] = SDL_clamp(val, 0, 64);
|
exits[4] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "exit-zn:")) {
|
} else if (util::strcomp(key, "exit-zn:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
exits[5] = SDL_clamp(val, 0, 64);
|
exits[5] = SDL_clamp(val, 0, MAX_ROOMS);
|
||||||
} else if (util::strcomp(key, "editor-done:")) {
|
} else if (util::strcomp(key, "editor-done:")) {
|
||||||
const int val = file::readInt(&buffer);
|
const int val = file::readInt(&buffer);
|
||||||
editor_done = SDL_clamp(val, 0, 1);
|
editor_done = SDL_clamp(val, 0, 1);
|
||||||
@@ -598,7 +598,7 @@ namespace room
|
|||||||
{
|
{
|
||||||
if (!::editor::isDevMode()) return;
|
if (!::editor::isDevMode()) return;
|
||||||
|
|
||||||
for (int room=0; room<64; ++room)
|
for (int room=0; room<MAX_ROOMS; ++room)
|
||||||
{
|
{
|
||||||
char filename[] = "rooms/00.txt";
|
char filename[] = "rooms/00.txt";
|
||||||
filename[6] = int(room/10)+48;
|
filename[6] = int(room/10)+48;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define MAX_ROOMS 64
|
#define MAX_ROOMS 96
|
||||||
|
|
||||||
#define NO_DOOR 0
|
#define NO_DOOR 0
|
||||||
#define DOOR_XP 1
|
#define DOOR_XP 1
|
||||||
|
|||||||
Reference in New Issue
Block a user