Skip to content

Commit

Permalink
Initialize a bunch of Dialog structs
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 9, 2022
1 parent dab4365 commit 024f8ef
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 42 deletions.
10 changes: 5 additions & 5 deletions Core/Dialog/PSPDialog.h
Expand Up @@ -99,7 +99,7 @@ class PSPDialog
void ChangeStatus(DialogStatus newStatus, int delayUs);
void ChangeStatusInit(int delayUs);
void ChangeStatusShutdown(int delayUs);
DialogStatus ReadStatus() {
DialogStatus ReadStatus() const {
return status;
}

Expand All @@ -117,10 +117,10 @@ class PSPDialog
unsigned int lastButtons = 0;
unsigned int buttons = 0;

float fadeTimer;
bool isFading;
bool fadeIn;
u32 fadeValue;
float fadeTimer = 0.0f;
bool isFading = false;
bool fadeIn = false;
u32 fadeValue = 0;

ImageID okButtonImg;
ImageID cancelButtonImg;
Expand Down
18 changes: 9 additions & 9 deletions Core/Dialog/PSPGamedataInstallDialog.h
Expand Up @@ -59,16 +59,16 @@ class PSPGamedataInstallDialog: public PSPDialog {
void CloseCurrentFile();
void WriteSfoFile();

SceUtilityGamedataInstallParam request;
SceUtilityGamedataInstallParam request{};
PSPPointer<SceUtilityGamedataInstallParam> param;
std::vector<std::string> inFileNames;
int numFiles;
int readFiles;
u64 allFilesSize; // use this to calculate progress value.
u64 allReadSize; // use this to calculate progress value.
int progressValue;
int numFiles = 0;
int readFiles = 0;
u64 allFilesSize = 0; // use this to calculate progress value.
u64 allReadSize = 0; // use this to calculate progress value.
int progressValue = 0;

int currentInputFile;
u32 currentInputBytesLeft;
int currentOutputFile;
int currentInputFile = 0;
u32 currentInputBytesLeft = 0;
int currentOutputFile = 0;
};
6 changes: 3 additions & 3 deletions Core/Dialog/PSPMsgDialog.h
Expand Up @@ -94,11 +94,11 @@ class PSPMsgDialog: public PSPDialog {

u32 flag = 0;

pspMessageDialog messageDialog;
int messageDialogAddr;
pspMessageDialog messageDialog{};
int messageDialogAddr = 0;

char msgText[512];
int yesnoChoice;
int yesnoChoice = 0;
float scrollPos_ = 0.0f;
int framesUpHeld_ = 0;
int framesDownHeld_ = 0;
Expand Down
9 changes: 4 additions & 5 deletions Core/Dialog/PSPOskDialog.h
Expand Up @@ -148,7 +148,6 @@ struct SceUtilityOskParams
SceUtilityOskState_le state;
// Maybe just padding?
s32_le unk_60;

};

// Internal enum, not from PSP.
Expand Down Expand Up @@ -245,16 +244,16 @@ class PSPOskDialog: public PSPDialog {
std::string oskIntext;
std::string oskOuttext;

int selectedChar;
int selectedChar = 0;
std::u16string inputChars;
OskKeyboardDisplay currentKeyboard;
OskKeyboardLanguage currentKeyboardLanguage;
bool isCombinated;
bool isCombinated = false;

std::mutex nativeMutex_;
PSPOskNativeStatus nativeStatus_ = PSPOskNativeStatus::IDLE;
std::string nativeValue_;

int i_level; // for Korean Keyboard support
int i_value[3]; // for Korean Keyboard support
int i_level = 0; // for Korean Keyboard support
int i_value[3]{}; // for Korean Keyboard support
};
6 changes: 3 additions & 3 deletions Core/Dialog/PSPSaveDialog.h
Expand Up @@ -139,13 +139,13 @@ class PSPSaveDialog: public PSPDialog {
DisplayState display = DS_NONE;

SavedataParam param;
SceUtilitySavedataParam request;
SceUtilitySavedataParam request{};
// For detecting changes made by the game.
SceUtilitySavedataParam originalRequest;
SceUtilitySavedataParam originalRequest{};
u32 requestAddr = 0;
int currentSelectedSave = 0;

int yesnoChoice;
int yesnoChoice = 0;

enum SaveIOStatus
{
Expand Down
11 changes: 1 addition & 10 deletions Core/Dialog/SavedataParam.cpp
Expand Up @@ -193,16 +193,7 @@ void SaveFileInfo::DoState(PointerWrap &p)
}
}

SavedataParam::SavedataParam()
: pspParam(0)
, selectedSave(0)
, saveDataList(0)
, noSaveIcon(0)
, saveDataListCount(0)
, saveNameListDataCount(0)
{

}
SavedataParam::SavedataParam() { }

void SavedataParam::Init()
{
Expand Down
13 changes: 6 additions & 7 deletions Core/Dialog/SavedataParam.h
Expand Up @@ -265,7 +265,6 @@ struct SceUtilitySavedataParam

// Function 22 GETSIZES
PSPPointer<PspUtilitySavedataSizeInfo> sizeInfo;

};

// Non native, this one we can reorganize as we like
Expand Down Expand Up @@ -377,10 +376,10 @@ class SavedataParam
std::set<std::string> GetSecureFileNames(const std::string &dirPath);
bool GetExpectedHash(const std::string &dirPath, const std::string &filename, u8 hash[16]);

SceUtilitySavedataParam* pspParam;
int selectedSave;
SaveFileInfo *saveDataList;
SaveFileInfo *noSaveIcon;
int saveDataListCount;
int saveNameListDataCount;
SceUtilitySavedataParam* pspParam = nullptr;
int selectedSave = 0;
SaveFileInfo *saveDataList = nullptr;
SaveFileInfo *noSaveIcon = nullptr;
int saveDataListCount = 0;
int saveNameListDataCount = 0;
};

0 comments on commit 024f8ef

Please sign in to comment.