3 Commits

6 changed files with 72 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -22,6 +22,8 @@ namespace actor
actor_t *selected = nullptr;
actor_t *picked = nullptr;
static bool room_changed = false;
int brilli_brilli=0;
draw::surface *brilli;
int current_tag = 0;
@@ -975,6 +977,8 @@ namespace actor
{
if (!act) return;
if (act==first) { brilli_brilli=(brilli_brilli+1)&0x7; }
actor_t *next = act->next;
// Actualitzem el frame de l'animació (si no te el flag de animat, no afectarà per a res)
@@ -1072,7 +1076,14 @@ namespace actor
draw::stencil::set(act->tag);
draw::draw(x, y, act->bmp_rect.w, act->bmp_rect.h, act->bmp_rect.x+ao, act->bmp_rect.y+oo, flip);
draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
if (act->flags&FLAG_SPECIAL)
{
draw::setSource(brilli);
const int dx = (act->bmp_rect.w-22)>>1;
draw::draw(x+dx, y, 22, 24, brilli_brilli*22, 96, DRAW_FLIP_NONE);
}
draw::popSource();
if (debug::isEnabled(DEBUG_ACTOR_POS))
{
char tmp[100];
@@ -1346,6 +1357,7 @@ namespace actor
skills = SKILL_NONE;
parts = PART_NONE;
for (int i=0; i<100; ++i) boosters_collected[i] = false;
brilli = draw::getSurface("objectes.gif");
} else {
hero->pos = first_pos;
hero->orient = first_orient;

View File

@@ -424,6 +424,7 @@ namespace modules
}
int line = -treeview_scroll;
/*
if (section==SECTION_GENERAL)
{
draw::color(LIGHT+BLUE);
@@ -432,47 +433,62 @@ namespace modules
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
section = SECTION_GENERAL;
}
draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK);
line++;
for (int i=0;i<64;++i)
//draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK);
//line++;
*/
if (section==SECTION_ROOM)
{
if (room::editor::roomExists(i))
for (int i=0;i<MAX_ROOMS;++i)
{
if (section==SECTION_ROOM && i == room::editor::getCurrentRoom())
if (room::editor::roomExists(i))
{
draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9);
}
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
room::load(i);
section = SECTION_ROOM;
}
char num[] = "+ROOM 00";
num[6] = int(i/10)+48;
num[7] = (i%10)+48;
draw::print(num, 10, 4+line*9, LIGHT+WHITE, BLACK); line++;
if (i==room::editor::getCurrentRoom())
{
act = actor::getFirst();
while (act) {
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) {
if (section==SECTION_ACTOR && act==actor::getSelected()) {
draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9);
}
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
actor::select(act);
section = SECTION_ACTOR;
}
draw::print(act->name, 14, 4+line*9, LIGHT+WHITE, BLACK);
line++;
}
act = act->next;
if (i == room::editor::getCurrentRoom())
{
draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9);
}
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
if (i == room::editor::getCurrentRoom()) {
section = SECTION_ACTOR;
} else {
room::load(i);
}
}
char num[] = "+ROOM 00";
num[6] = int(i/10)+48;
num[7] = (i%10)+48;
draw::print(num, 6, 4+line*9, LIGHT+WHITE, BLACK); line++;
}
}
} else if (section==SECTION_ACTOR)
{
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
section = SECTION_ROOM;
}
const int i = room::editor::getCurrentRoom();
char num[] = "-ROOM 00";
num[6] = int(i/10)+48;
num[7] = (i%10)+48;
draw::print(num, 6, 4+line*9, LIGHT+WHITE, BLACK); line++;
act = actor::getFirst();
while (act)
{
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) {
if (act==actor::getSelected()) {
draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9);
}
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
actor::select(act);
section = SECTION_ACTOR;
}
draw::print(act->name, 14, 4+line*9, LIGHT+WHITE, BLACK);
line++;
}
act = act->next;
}
}
if ((line+treeview_scroll)>24)

View File

@@ -23,36 +23,42 @@ namespace modules
if (parts[0]==nullptr)
{
parts[0] = actor::createFromTemplate("P-ELBOW");
parts[0]->flags=0;
parts[0]->inner_x=166+16;
parts[0]->inner_y=68+8;
}
if (parts[1]==nullptr)
{
parts[1] = actor::createFromTemplate("P-PIPE");
parts[1]->flags=0;
parts[1]->inner_x=148+16;
parts[1]->inner_y=75+8;
}
if (parts[2]==nullptr)
{
parts[2] = actor::createFromTemplate("P-SALT");
parts[2]->flags=0;
parts[2]->inner_x=123+16;
parts[2]->inner_y=84+8;
}
if (parts[3]==nullptr)
{
parts[3] = actor::createFromTemplate("P-FILTER");
parts[3]->flags=0;
parts[3]->inner_x=144+16;
parts[3]->inner_y=45+8;
}
if (parts[4]==nullptr)
{
parts[4] = actor::createFromTemplate("P-PUMP");
parts[4]->flags=0;
parts[4]->inner_x=121+16;
parts[4]->inner_y=54+8;
}
if (parts[5]==nullptr)
{
parts[5] = actor::createFromTemplate("P-TIMER");
parts[5]->flags=0;
parts[5]->inner_x=96+16;
parts[5]->inner_y=69+8;
}

View File

@@ -123,7 +123,7 @@ namespace room
//void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn, uint8_t col, uint8_t floor, uint8_t walls, uint8_t door, uint8_t walldoor)
void load(int room, const int door)
{
if (room > 64 || room < 0) {
if (room > MAX_ROOMS || room < 0) {
room = find_next_room();
exits[inverse_door(door)] = room;
if (door<4 && door_height[door]==-1) door_height[door]=0;

View File

@@ -2,6 +2,8 @@
#include "misc.h"
#include <vector>
#define MAX_ROOMS 64
#define NO_DOOR 0
#define DOOR_XP 1
#define DOOR_XN 2