Codechange: Change ScreenshotCallback into a std::function, so there is no need for void* user data.

This commit is contained in:
frosch
2025-04-18 20:37:35 +02:00
committed by frosch
parent c09e825e0b
commit 0eb6964311
5 changed files with 47 additions and 50 deletions

View File

@@ -43,7 +43,7 @@ class ScreenshotProvider_Bmp : public ScreenshotProvider {
public:
ScreenshotProvider_Bmp() : ScreenshotProvider("bmp", "BMP", 10) {}
bool MakeImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette) override
bool MakeImage(const char *name, const ScreenshotCallback &callb, uint w, uint h, int pixelformat, const Colour *palette) override
{
uint bpp; // bytes per pixel
switch (pixelformat) {
@@ -117,7 +117,7 @@ public:
h -= n;
/* Render the pixels */
callb(userdata, buff.data(), h, w, n);
callb(buff.data(), h, w, n);
/* Write each line */
while (n-- != 0) {