mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-09-28 00:58:36 +02:00
Add function to convert images to textures.
This commit is contained in:
parent
0ca7b8a344
commit
6a775c1f89
@ -26,9 +26,11 @@ void OSScreenEnableEx(uint32_t bufferNum, int32_t enable);
|
|||||||
void OSScreenPutPixelEx(uint32_t bufferNum, uint32_t posX, uint32_t posY, uint32_t color);
|
void OSScreenPutPixelEx(uint32_t bufferNum, uint32_t posX, uint32_t posY, uint32_t color);
|
||||||
|
|
||||||
static OverlayOpenFunction overlayfunction_ptr __attribute__((section(".data"))) = NULL;
|
static OverlayOpenFunction overlayfunction_ptr __attribute__((section(".data"))) = NULL;
|
||||||
|
static ConvertTextureFunction textureconvertfunction_ptr __attribute__((section(".data"))) = NULL;
|
||||||
|
|
||||||
void WUPS_InitOverlay(wups_loader_init_overlay_args_t args) {
|
void WUPS_InitOverlay(wups_loader_init_overlay_args_t args) {
|
||||||
overlayfunction_ptr = args.overlayfunction_ptr;
|
overlayfunction_ptr = args.overlayfunction_ptr;
|
||||||
|
textureconvertfunction_ptr = args.textureconvertfunction_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WUPS_Overlay_PrintTextOnScreen(wups_overlay_options_type_t screen, int x,int y, const char * msg, ...) {
|
void WUPS_Overlay_PrintTextOnScreen(wups_overlay_options_type_t screen, int x,int y, const char * msg, ...) {
|
||||||
@ -85,6 +87,12 @@ void WUPS_OpenOverlay(wups_overlay_options_type_t screen, overlay_callback callb
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WUPS_ConvertImageToTexture(const uint8_t *img, int32_t imgSize, void * texture) {
|
||||||
|
if(textureconvertfunction_ptr != NULL) {
|
||||||
|
return textureconvertfunction_ptr(img, imgSize, texture);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,9 +36,11 @@ wups_overlay_options_type_t;
|
|||||||
typedef void (*overlay_callback)(wups_overlay_options_type_t, void*);
|
typedef void (*overlay_callback)(wups_overlay_options_type_t, void*);
|
||||||
|
|
||||||
typedef void (*OverlayOpenFunction)(wups_overlay_options_type_t screen, overlay_callback callback, void*);
|
typedef void (*OverlayOpenFunction)(wups_overlay_options_type_t screen, overlay_callback callback, void*);
|
||||||
|
typedef bool (*ConvertTextureFunction)(const uint8_t *img, int32_t imgSize, void * texture);
|
||||||
|
|
||||||
typedef struct wups_loader_init_overlay_args_t {
|
typedef struct wups_loader_init_overlay_args_t {
|
||||||
OverlayOpenFunction overlayfunction_ptr;
|
OverlayOpenFunction overlayfunction_ptr;
|
||||||
|
ConvertTextureFunction textureconvertfunction_ptr;
|
||||||
} wups_loader_init_overlay_args_t;
|
} wups_loader_init_overlay_args_t;
|
||||||
|
|
||||||
typedef int (*OpenFunction) (const char *pathname, int flags);
|
typedef int (*OpenFunction) (const char *pathname, int flags);
|
||||||
@ -125,6 +127,9 @@ void WUPS_Overlay_FlipBuffers(wups_overlay_options_type_t screen);
|
|||||||
|
|
||||||
void WUPS_OpenOverlay(wups_overlay_options_type_t screen, overlay_callback callback, void* args);
|
void WUPS_OpenOverlay(wups_overlay_options_type_t screen, overlay_callback callback, void* args);
|
||||||
|
|
||||||
|
// texture needs to be a GX2Texture
|
||||||
|
bool WUPS_ConvertImageToTexture(const uint8_t *img, int32_t imgSize, void * texture);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads a 32bit value from a given address with kernel rights.
|
Reads a 32bit value from a given address with kernel rights.
|
||||||
This function only has an effect if the plugin has the "WUPS_ALLOW_KERNEL" hook and the loader is NOT blocking the kernel access.
|
This function only has an effect if the plugin has the "WUPS_ALLOW_KERNEL" hook and the loader is NOT blocking the kernel access.
|
||||||
|
Loading…
Reference in New Issue
Block a user