mirror of
https://github.com/mogzol/sharpii.git
synced 2024-11-13 06:05:05 +01:00
bc65416cf7
- You can now download an IOS with -ios # in NUSD - Downloaded IOS wads are now named like so: IOS##-64-####.wad - Under certain conditions, when downloading a wad with NUS, it will not be saved in a folder, just as the WAD (see ReadMe) - If missing dll's are detected (WadInstaller or libWiiSharp), Sharpii will ask to download them, if they are required. - You can now use a .dol file instead of a .wad with the '-dol' in the WAD editor/packer - Probably a few other little things I have forgotten - Even more code cleanup and bug fixes
63 lines
946 B
C
63 lines
946 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <ogcsys.h>
|
|
|
|
#include "video.h"
|
|
|
|
/* Constants */
|
|
#define CONSOLE_XCOORD 96
|
|
#define CONSOLE_YCOORD 118
|
|
#define CONSOLE_WIDTH 496
|
|
#define CONSOLE_HEIGHT 236
|
|
|
|
|
|
s32 __Gui_DrawPng(void *img, u32 x, u32 y)
|
|
{
|
|
IMGCTX ctx = NULL;
|
|
PNGUPROP imgProp;
|
|
|
|
s32 ret;
|
|
|
|
/* Select PNG data */
|
|
ctx = PNGU_SelectImageFromBuffer(img);
|
|
if (!ctx) {
|
|
ret = -1;
|
|
goto out;
|
|
}
|
|
|
|
/* Get image properties */
|
|
ret = PNGU_GetImageProperties(ctx, &imgProp);
|
|
if (ret != PNGU_OK) {
|
|
ret = -1;
|
|
goto out;
|
|
}
|
|
|
|
/* Draw image */
|
|
Video_DrawPng(ctx, imgProp, x, y);
|
|
|
|
/* Success */
|
|
ret = 0;
|
|
|
|
out:
|
|
/* Free memory */
|
|
if (ctx)
|
|
PNGU_ReleaseImageContext(ctx);
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
void Gui_InitConsole(void)
|
|
{
|
|
/* Initialize console */
|
|
Con_Init(CONSOLE_XCOORD, CONSOLE_YCOORD, CONSOLE_WIDTH, CONSOLE_HEIGHT);
|
|
}
|
|
|
|
void Gui_DrawBackground(void)
|
|
{
|
|
extern char bgData[];
|
|
|
|
/* Draw background */
|
|
__Gui_DrawPng(bgData, 0, 0);
|
|
}
|