mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-06-23 13:08:30 +02:00
ae5ef9753c
Using the Steamworks API, we can hook the screenshot function and listen for a screenshot request callback to send in our own screenshot. This applies the screenshot improvements to Steam screenshots as well. Doing this requires adding some C wrapper functions, as our interface with the Steam API is only conducted through C.
43 lines
771 B
C++
43 lines
771 B
C++
#include "CWrappers.h"
|
|
|
|
#include <SDL.h>
|
|
|
|
#include "Graphics.h"
|
|
#include "GraphicsUtil.h"
|
|
#include "Localization.h"
|
|
#include "UtilityClass.h"
|
|
|
|
extern "C"
|
|
{
|
|
|
|
char* HELP_number_words(int _t, const char* number_class)
|
|
{
|
|
/* C wrapper for UtilityClass::number_words.
|
|
* Caller must VVV_free. */
|
|
|
|
std::string str = help.number_words(_t, number_class);
|
|
|
|
char* buffer = (char*) SDL_malloc(str.size() + 1);
|
|
str.copy(buffer, str.size());
|
|
buffer[str.size()] = '\0';
|
|
|
|
return buffer;
|
|
}
|
|
|
|
uint32_t LOC_toupper_ch(uint32_t ch)
|
|
{
|
|
return loc::toupper_ch(ch);
|
|
}
|
|
|
|
SDL_Surface* GRAPHICS_tempScreenshot(void)
|
|
{
|
|
return graphics.tempScreenshot;
|
|
}
|
|
|
|
uint8_t UTIL_TakeScreenshot(SDL_Surface** surface)
|
|
{
|
|
return TakeScreenshot(surface);
|
|
}
|
|
|
|
} /* extern "C" */
|