diff --git a/src/gba/serialize.c b/src/gba/serialize.c index ba5b952aa..1a428576c 100644 --- a/src/gba/serialize.c +++ b/src/gba/serialize.c @@ -614,29 +614,3 @@ void GBADeallocateState(struct GBASerializedState* state) { } // TODO: Put back rewind - -void GBATakeScreenshot(struct GBA* gba, struct VDir* dir) { -#ifdef USE_PNG - unsigned stride; - const void* pixels = 0; - char basename[PATH_MAX]; - separatePath(gba->activeFile, 0, basename, 0); - struct VFile* vf = VDirFindNextAvailable(dir, basename, "-", ".png", O_CREAT | O_TRUNC | O_WRONLY); - bool success = false; - if (vf) { - gba->video.renderer->getPixels(gba->video.renderer, &stride, &pixels); - png_structp png = PNGWriteOpen(vf); - png_infop info = PNGWriteHeader(png, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); - success = PNGWritePixels(png, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS, stride, pixels); - PNGWriteClose(png, info); - vf->close(vf); - } - if (success) { - mLOG(STATUS, INFO, "Screenshot saved"); - return; - } -#else - UNUSED(dir); -#endif - mLOG(STATUS, WARN, "Failed to take screenshot"); -} diff --git a/src/gba/serialize.h b/src/gba/serialize.h index 0c4e83c82..e4eecd282 100644 --- a/src/gba/serialize.h +++ b/src/gba/serialize.h @@ -382,6 +382,4 @@ struct GBASerializedState* GBAExtractState(struct VFile* vf, struct GBAExtdata* struct GBASerializedState* GBAAllocateState(void); void GBADeallocateState(struct GBASerializedState* state); -void GBATakeScreenshot(struct GBA* gba, struct VDir* dir); - #endif