- [NEW] mòdul editor per a handlechar tot lo relacionat en l'editor
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "jfile.h"
|
||||
#include "jutil.h"
|
||||
#include "room.h"
|
||||
#include "editor.h"
|
||||
#include <vector>
|
||||
|
||||
namespace actor
|
||||
@@ -792,9 +793,9 @@ namespace actor
|
||||
void draw(actor_t *act, const bool draw_all)
|
||||
{
|
||||
if (!act) return;
|
||||
//if (act==first)order=0;
|
||||
//order++;
|
||||
|
||||
if (!editor::isEditing() || ( (act->flags&FLAG_HERO)==0))
|
||||
{
|
||||
const int x = 148-act->bmp_offset.x + act->pos.x*2 - act->pos.y*2;
|
||||
const int y = 91-act->bmp_offset.y + act->pos.x + act->pos.y - act->pos.z*2;
|
||||
|
||||
@@ -814,7 +815,7 @@ namespace actor
|
||||
//print(x+5,y+12,act->pos.z);
|
||||
//print(x+5,y+12,order);
|
||||
//print(x+5,y,act->flags);
|
||||
|
||||
}
|
||||
if (draw_all && act->next) draw(act->next);
|
||||
}
|
||||
|
||||
|
||||
16
source/editor.cpp
Normal file
16
source/editor.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "editor.h"
|
||||
|
||||
namespace editor
|
||||
{
|
||||
static bool editing = true;
|
||||
|
||||
void setEditing(const bool value)
|
||||
{
|
||||
editing = value;
|
||||
}
|
||||
|
||||
const bool isEditing()
|
||||
{
|
||||
return editing;
|
||||
}
|
||||
}
|
||||
7
source/editor.h
Normal file
7
source/editor.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
namespace editor
|
||||
{
|
||||
void setEditing(const bool value);
|
||||
const bool isEditing();
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "actor.h"
|
||||
#include "room.h"
|
||||
#include "jui.h"
|
||||
|
||||
#include "editor.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
@@ -26,8 +26,6 @@ int room_walldoors = 0;
|
||||
|
||||
std::vector<std::string> gifs;
|
||||
|
||||
bool editing = true;
|
||||
|
||||
void restart()
|
||||
{
|
||||
room::load(0); //room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color, room_floor, room_walls, room_doors, room_walldoors);
|
||||
@@ -291,7 +289,7 @@ bool game::loop()
|
||||
|
||||
|
||||
// WHILE EDITING...
|
||||
if (editing)
|
||||
if (editor::isEditing())
|
||||
{
|
||||
editor_move_selected();
|
||||
actor::updateEditor(actor::getFirst());
|
||||
|
||||
Reference in New Issue
Block a user