#include "m_editor_bitmap_file.h" #include "jdraw.h" #include "jinput.h" #include #include "room.h" #include "actor.h" #include "m_game.h" namespace modules { namespace editor_bitmap_file { std::vector gifs = { "abad.gif", "altres.gif", "caixes.gif", "gat.gif", "gat2.gif", "objectes.gif", "obrer.gif" }; void init() { draw::resetViewport(); //gifs = game::getGifs(); } bool loop() { if (input::keyPressed(SDL_SCANCODE_ESCAPE)) return false; if (input::mouseClk(1)) { const int x = input::mouseX()/80; const int y = input::mouseY()/80; const int selected = x+y*6; actor::actor_t* act = actor::getSelected(); strcpy(act->bmp, gifs[selected].c_str()); act->surface = draw::getSurface(gifs[selected]); return false; } draw::cls(2); int bx = 0; int by = 0; for (int i=0; iw) / float(surf->h); const int width = 64.0f*aspect; draw::draw(2+80*bx, 2+by*80, surf->w, surf->h, 0, 0, 0, 64, 64); draw::print(gifs[i].c_str(), 2+80*bx + 32 - (gifs[0].size()/2)*4, 70+by*80, LIGHT+WHITE, PAPER); bx++; if (bx>5) { bx=0; by++; } } draw::render(); return true; } } }