#define _IRR_STATIC_LIB_ #include using namespace irr; using namespace video; #ifdef _IRR_WINDOWS_ #pragma comment(lib, "Irrlicht.lib") #endif class events: public irr::IEventReceiver { public: bool OnEvent(const irr::SEvent &e) { switch(e.EventType) { case EET_LOG_TEXT_EVENT: if (e.LogEvent.Level >= ELL_WARNING) return false; } return true; } }; int main(int argc, char **argv) { events er; IrrlichtDevice *device = createDevice(video::EDT_NULL, core::dimension2d(1, 1), 16, false, false, false, &er); if (!device) return 1; IVideoDriver* driver = device->getVideoDriver(); core::vector2d crop(45,200); core::dimension2du dim(16, 12); core::dimension2du imageSize = dim*256; imageSize.Width -= crop.X*2; imageSize.Height-= crop.Y*2; IImage *output = driver->createImage(video::ECF_R8G8B8, imageSize); for (u32 y=0; ycreateImageFromFile(filename); if (img) { img->copyTo(output, core::vector2di(x*256 - crop.X, y*256 - crop.Y)); img->drop(); } } driver->writeImageToFile(output, core::stringw(argv[1]) + ".jpg"); output->drop(); device->drop(); return 0; }