- Se pot moure el actor seleccionat
This commit is contained in:
@@ -102,11 +102,30 @@ void btn(const char* label, const int x, const int y, int &var, int min, int max
|
||||
|
||||
int section = 0;
|
||||
|
||||
void editor_move_selected()
|
||||
{
|
||||
actor::actor_t *selected = actor::getSelected();
|
||||
if (!selected) return;
|
||||
|
||||
vec3_t min = room::getMin();
|
||||
vec3_t max = room::getMax();
|
||||
|
||||
if ( input::keyDown(SDL_SCANCODE_LEFT) && selected->pos.x>min.x ) selected->pos.x--;
|
||||
if ( input::keyDown(SDL_SCANCODE_RIGHT) && selected->pos.x<max.x ) selected->pos.x++;
|
||||
if ( input::keyDown(SDL_SCANCODE_UP) && selected->pos.y>min.y ) selected->pos.y--;
|
||||
if ( input::keyDown(SDL_SCANCODE_DOWN) && selected->pos.y<max.y ) selected->pos.y++;
|
||||
if ( input::keyDown(SDL_SCANCODE_PAGEDOWN) && selected->pos.z>min.z ) selected->pos.z--;
|
||||
if ( input::keyDown(SDL_SCANCODE_PAGEUP) /*&& selected->pos.z<max.z*/ ) selected->pos.z++;
|
||||
}
|
||||
|
||||
bool game::loop()
|
||||
{
|
||||
if (input::keyDown(SDL_SCANCODE_ESCAPE)) return false;
|
||||
|
||||
actor::update(actor::getFirst());
|
||||
// WHILE EDITING...
|
||||
editor_move_selected();
|
||||
//actor::update(actor::getFirst());
|
||||
|
||||
actor::reorder();
|
||||
|
||||
draw::cls(2);
|
||||
|
||||
Reference in New Issue
Block a user