Compare commits
3 Commits
5e2105cfeb
...
a459ff8a85
| Author | SHA1 | Date | |
|---|---|---|---|
| a459ff8a85 | |||
| 087ed163cb | |||
| 3f6082328e |
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -22,6 +22,8 @@ namespace actor
|
|||||||
actor_t *selected = nullptr;
|
actor_t *selected = nullptr;
|
||||||
actor_t *picked = nullptr;
|
actor_t *picked = nullptr;
|
||||||
static bool room_changed = false;
|
static bool room_changed = false;
|
||||||
|
int brilli_brilli=0;
|
||||||
|
draw::surface *brilli;
|
||||||
|
|
||||||
int current_tag = 0;
|
int current_tag = 0;
|
||||||
|
|
||||||
@@ -975,6 +977,8 @@ namespace actor
|
|||||||
{
|
{
|
||||||
if (!act) return;
|
if (!act) return;
|
||||||
|
|
||||||
|
if (act==first) { brilli_brilli=(brilli_brilli+1)&0x7; }
|
||||||
|
|
||||||
actor_t *next = act->next;
|
actor_t *next = act->next;
|
||||||
|
|
||||||
// Actualitzem el frame de l'animació (si no te el flag de animat, no afectarà per a res)
|
// 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::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::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
|
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();
|
draw::popSource();
|
||||||
|
|
||||||
if (debug::isEnabled(DEBUG_ACTOR_POS))
|
if (debug::isEnabled(DEBUG_ACTOR_POS))
|
||||||
{
|
{
|
||||||
char tmp[100];
|
char tmp[100];
|
||||||
@@ -1346,6 +1357,7 @@ namespace actor
|
|||||||
skills = SKILL_NONE;
|
skills = SKILL_NONE;
|
||||||
parts = PART_NONE;
|
parts = PART_NONE;
|
||||||
for (int i=0; i<100; ++i) boosters_collected[i] = false;
|
for (int i=0; i<100; ++i) boosters_collected[i] = false;
|
||||||
|
brilli = draw::getSurface("objectes.gif");
|
||||||
} else {
|
} else {
|
||||||
hero->pos = first_pos;
|
hero->pos = first_pos;
|
||||||
hero->orient = first_orient;
|
hero->orient = first_orient;
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ namespace modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
int line = -treeview_scroll;
|
int line = -treeview_scroll;
|
||||||
|
/*
|
||||||
if (section==SECTION_GENERAL)
|
if (section==SECTION_GENERAL)
|
||||||
{
|
{
|
||||||
draw::color(LIGHT+BLUE);
|
draw::color(LIGHT+BLUE);
|
||||||
@@ -432,32 +433,50 @@ namespace modules
|
|||||||
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
|
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
|
||||||
section = SECTION_GENERAL;
|
section = SECTION_GENERAL;
|
||||||
}
|
}
|
||||||
draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK);
|
//draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK);
|
||||||
line++;
|
//line++;
|
||||||
for (int i=0;i<64;++i)
|
*/
|
||||||
|
if (section==SECTION_ROOM)
|
||||||
|
{
|
||||||
|
for (int i=0;i<MAX_ROOMS;++i)
|
||||||
{
|
{
|
||||||
if (room::editor::roomExists(i))
|
if (room::editor::roomExists(i))
|
||||||
{
|
{
|
||||||
if (section==SECTION_ROOM && i == room::editor::getCurrentRoom())
|
if (i == room::editor::getCurrentRoom())
|
||||||
{
|
{
|
||||||
draw::color(LIGHT+BLUE);
|
draw::color(LIGHT+BLUE);
|
||||||
draw::fillrect(4, 2+line*9, 92, 9);
|
draw::fillrect(4, 2+line*9, 92, 9);
|
||||||
}
|
}
|
||||||
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
|
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);
|
room::load(i);
|
||||||
section = SECTION_ROOM;
|
}
|
||||||
}
|
}
|
||||||
char num[] = "+ROOM 00";
|
char num[] = "+ROOM 00";
|
||||||
num[6] = int(i/10)+48;
|
num[6] = int(i/10)+48;
|
||||||
num[7] = (i%10)+48;
|
num[7] = (i%10)+48;
|
||||||
draw::print(num, 10, 4+line*9, LIGHT+WHITE, BLACK); line++;
|
draw::print(num, 6, 4+line*9, LIGHT+WHITE, BLACK); line++;
|
||||||
|
}
|
||||||
if (i==room::editor::getCurrentRoom())
|
}
|
||||||
|
} 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();
|
act = actor::getFirst();
|
||||||
while (act) {
|
while (act)
|
||||||
|
{
|
||||||
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) {
|
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) {
|
||||||
if (section==SECTION_ACTOR && act==actor::getSelected()) {
|
if (act==actor::getSelected()) {
|
||||||
draw::color(LIGHT+BLUE);
|
draw::color(LIGHT+BLUE);
|
||||||
draw::fillrect(4, 2+line*9, 92, 9);
|
draw::fillrect(4, 2+line*9, 92, 9);
|
||||||
}
|
}
|
||||||
@@ -470,9 +489,6 @@ namespace modules
|
|||||||
}
|
}
|
||||||
act = act->next;
|
act = act->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((line+treeview_scroll)>24)
|
if ((line+treeview_scroll)>24)
|
||||||
|
|||||||
@@ -23,36 +23,42 @@ namespace modules
|
|||||||
if (parts[0]==nullptr)
|
if (parts[0]==nullptr)
|
||||||
{
|
{
|
||||||
parts[0] = actor::createFromTemplate("P-ELBOW");
|
parts[0] = actor::createFromTemplate("P-ELBOW");
|
||||||
|
parts[0]->flags=0;
|
||||||
parts[0]->inner_x=166+16;
|
parts[0]->inner_x=166+16;
|
||||||
parts[0]->inner_y=68+8;
|
parts[0]->inner_y=68+8;
|
||||||
}
|
}
|
||||||
if (parts[1]==nullptr)
|
if (parts[1]==nullptr)
|
||||||
{
|
{
|
||||||
parts[1] = actor::createFromTemplate("P-PIPE");
|
parts[1] = actor::createFromTemplate("P-PIPE");
|
||||||
|
parts[1]->flags=0;
|
||||||
parts[1]->inner_x=148+16;
|
parts[1]->inner_x=148+16;
|
||||||
parts[1]->inner_y=75+8;
|
parts[1]->inner_y=75+8;
|
||||||
}
|
}
|
||||||
if (parts[2]==nullptr)
|
if (parts[2]==nullptr)
|
||||||
{
|
{
|
||||||
parts[2] = actor::createFromTemplate("P-SALT");
|
parts[2] = actor::createFromTemplate("P-SALT");
|
||||||
|
parts[2]->flags=0;
|
||||||
parts[2]->inner_x=123+16;
|
parts[2]->inner_x=123+16;
|
||||||
parts[2]->inner_y=84+8;
|
parts[2]->inner_y=84+8;
|
||||||
}
|
}
|
||||||
if (parts[3]==nullptr)
|
if (parts[3]==nullptr)
|
||||||
{
|
{
|
||||||
parts[3] = actor::createFromTemplate("P-FILTER");
|
parts[3] = actor::createFromTemplate("P-FILTER");
|
||||||
|
parts[3]->flags=0;
|
||||||
parts[3]->inner_x=144+16;
|
parts[3]->inner_x=144+16;
|
||||||
parts[3]->inner_y=45+8;
|
parts[3]->inner_y=45+8;
|
||||||
}
|
}
|
||||||
if (parts[4]==nullptr)
|
if (parts[4]==nullptr)
|
||||||
{
|
{
|
||||||
parts[4] = actor::createFromTemplate("P-PUMP");
|
parts[4] = actor::createFromTemplate("P-PUMP");
|
||||||
|
parts[4]->flags=0;
|
||||||
parts[4]->inner_x=121+16;
|
parts[4]->inner_x=121+16;
|
||||||
parts[4]->inner_y=54+8;
|
parts[4]->inner_y=54+8;
|
||||||
}
|
}
|
||||||
if (parts[5]==nullptr)
|
if (parts[5]==nullptr)
|
||||||
{
|
{
|
||||||
parts[5] = actor::createFromTemplate("P-TIMER");
|
parts[5] = actor::createFromTemplate("P-TIMER");
|
||||||
|
parts[5]->flags=0;
|
||||||
parts[5]->inner_x=96+16;
|
parts[5]->inner_x=96+16;
|
||||||
parts[5]->inner_y=69+8;
|
parts[5]->inner_y=69+8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 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)
|
void load(int room, const int door)
|
||||||
{
|
{
|
||||||
if (room > 64 || room < 0) {
|
if (room > MAX_ROOMS || room < 0) {
|
||||||
room = find_next_room();
|
room = find_next_room();
|
||||||
exits[inverse_door(door)] = room;
|
exits[inverse_door(door)] = room;
|
||||||
if (door<4 && door_height[door]==-1) door_height[door]=0;
|
if (door<4 && door_height[door]==-1) door_height[door]=0;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#define MAX_ROOMS 64
|
||||||
|
|
||||||
#define NO_DOOR 0
|
#define NO_DOOR 0
|
||||||
#define DOOR_XP 1
|
#define DOOR_XP 1
|
||||||
#define DOOR_XN 2
|
#define DOOR_XN 2
|
||||||
|
|||||||
Reference in New Issue
Block a user