Formatting

This commit is contained in:
Maschell 2019-03-01 19:31:45 +01:00
parent 9442c5d62a
commit 16fb3a7080
24 changed files with 177 additions and 178 deletions

View File

@ -28,8 +28,7 @@ DefaultGuiSelectBox::DefaultGuiSelectBox(std::string caption, GuiFrame *parent)
,valueImageData(Resources::GetImageData("gameSettingsButtonEx.png"))
,valueSelectedImageData(Resources::GetImageData("gameSettingsButtonExSelected.png"))
,valueHighlightedImageData(Resources::GetImageData("gameSettingsButtonExHighlighted.png"))
,buttonClickSound(Resources::GetSound("settings_click_2.mp3"))
{
,buttonClickSound(Resources::GetSound("settings_click_2.mp3")) {
setSize(topBackgroundImg_img.getWidth(),topBackgroundImg_img.getHeight());
this->setImageTopBackground(&topBackgroundImg_img);
this->setImageTopHighlighted(&topHighlightedImg_img);
@ -41,8 +40,7 @@ DefaultGuiSelectBox::DefaultGuiSelectBox(std::string caption, GuiFrame *parent)
/**
* Destructor for the DefaultGuiSelectBox class.
*/
DefaultGuiSelectBox::~DefaultGuiSelectBox()
{
DefaultGuiSelectBox::~DefaultGuiSelectBox() {
Resources::RemoveImageData(topBackgroundImg_imgdata);
Resources::RemoveImageData(topHighlightedImg_imgdata);
Resources::RemoveImageData(valueImageData);

View File

@ -28,8 +28,7 @@ DefaultGuiSwitch::DefaultGuiSwitch(bool checked)
,switchOn_imgdata(Resources::GetImageData("switchIconOn.png"))
,switchOn_img(switchOn_imgdata)
,switchOff_imgdata(Resources::GetImageData("switchIconOff.png"))
,switchOff_img(switchOff_imgdata)
{
,switchOff_img(switchOff_imgdata) {
setSize(switchbase_img.getWidth(),switchbase_img.getHeight());
this->setImageBackground(&switchbase_img);
this->setImageHighlighted(&switchbase_highlighted_img);
@ -39,8 +38,7 @@ DefaultGuiSwitch::DefaultGuiSwitch(bool checked)
/**
* Destructor for the DefaultGuiSwitch class.
*/
DefaultGuiSwitch::~DefaultGuiSwitch()
{
DefaultGuiSwitch::~DefaultGuiSwitch() {
Resources::RemoveImageData(switchbase_imgdata);
Resources::RemoveImageData(switchbase_highlighted_imgdata);
Resources::RemoveImageData(switchOn_imgdata);

View File

@ -8,20 +8,17 @@
extern "C" {
#endif
typedef struct _sr_table_t
{
typedef struct _sr_table_t {
uint32_t value[16];
uint32_t sdr1;
} sr_table_t;
typedef struct _bat_t
{
typedef struct _bat_t {
uint32_t h;
uint32_t l;
} bat_t;
typedef struct _bat_table_t
{
typedef struct _bat_table_t {
bat_t bat[8];
} bat_table_t;

View File

@ -66,7 +66,8 @@ static void KernelWriteSRs(sr_table_t * table) {
asm volatile("mtsr 5, %0" : : "r" (table->value[i])); i++;*/
//asm volatile("mtsr 6, %0" : : "r" (table->value[6])); i++;
/*asm volatile("mtsr 7, %0" : : "r" (table->value[i])); i++;*/
asm volatile("mtsr 8, %0" : : "r" (table->value[8])); i++;
asm volatile("mtsr 8, %0" : : "r" (table->value[8]));
i++;
/*asm volatile("mtsr 9, %0" : : "r" (table->value[i])); i++;
asm volatile("mtsr 10, %0" : : "r" (table->value[i])); i++;
asm volatile("mtsr 11, %0" : : "r" (table->value[i])); i++;

View File

@ -18,8 +18,12 @@ uint32_t * getFromGX2Buffer(struct buffer_store store, uint32_t size) {
}
void overlay_helper(wups_overlay_options_type_t screen, overlay_callback callback, void * args) {
if(callback == NULL) return;
if(!OSIsHomeButtonMenuEnabled()) return; // This pauses the game. Make sure to only do it when the home button is allowed.
if(callback == NULL) {
return;
}
if(!OSIsHomeButtonMenuEnabled()) {
return; // This pauses the game. Make sure to only do it when the home button is allowed.
}
//TODO: Make sure this actually pauses the game (Hook on GX2VSync?) . Currently only tested from VPADRead which also pauses the game.

View File

@ -23,14 +23,13 @@
#include "mem_utils.h"
void gdImageToUnormR8G8B8A8(gdImagePtr gdImg, u32 *imgBuffer, u32 width, u32 height, u32 pitch) {
for(u32 y = 0; y < height; ++y)
{
for(u32 x = 0; x < width; ++x)
{
for(u32 y = 0; y < height; ++y) {
for(u32 x = 0; x < width; ++x) {
u32 pixel = gdImageGetPixel(gdImg, x, y);
u8 a = 254 - 2*((u8)gdImageAlpha(gdImg, pixel));
if(a == 254) a++;
if(a == 254)
a++;
u8 r = gdImageRed(gdImg, pixel);
u8 g = gdImageGreen(gdImg, pixel);

View File

@ -494,7 +494,8 @@ bool ElfTools::elfLinkOne(char type, size_t offset, int32_t addend, void *destin
result = true;
exit_error:
if (!result) DEBUG_FUNCTION_LINE("Plugin_ElfLinkOne: exit_error\n");
if (!result)
DEBUG_FUNCTION_LINE("Plugin_ElfLinkOne: exit_error\n");
return result;
}

View File

@ -54,8 +54,7 @@ extern const uint32_t switchIconOn_png_size;
extern const uint8_t TwitterIcon_png[];
extern const uint32_t TwitterIcon_png_size;
static ResourceFile ResourceList[] =
{
static ResourceFile ResourceList[] = {
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
{"gameSettingsButton.png", gameSettingsButton_png, gameSettingsButton_png_size, NULL, 0},
{"gameSettingsButtonEx.png", gameSettingsButtonEx_png, gameSettingsButtonEx_png_size, NULL, 0},
@ -74,5 +73,7 @@ static ResourceFile ResourceList[] =
{NULL, NULL, 0, NULL, 0}
};
ResourceFile * getResourceList(){ return ResourceList; }
ResourceFile * getResourceList() {
return ResourceList;
}