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 22:43:41 +02:00
committed by frosch
parent c09e825e0b
commit 0eb6964311
5 changed files with 47 additions and 50 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ class ScreenshotProvider_Pcx : public ScreenshotProvider {
public:
ScreenshotProvider_Pcx() : ScreenshotProvider("pcx", "PCX", 20) {}
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 maxlines;
uint y;
@@ -93,7 +93,7 @@ public:
uint i;
/* render the pixels into the buffer */
callb(userdata, buff.data(), y, w, n);
callb(buff.data(), y, w, n);
y += n;
/* write them to pcx */