Fixed lots of compiler warnings reported by the -Wall and -Wpedantic flags.

This commit is contained in:
Leon Styhre 2021-09-18 09:53:26 +02:00
parent 9ae62cca4d
commit 0b6d987263
50 changed files with 126 additions and 125 deletions

View file

@ -33,16 +33,15 @@ FileData::FileData(FileType type,
const std::string& path,
SystemEnvironmentData* envData,
SystemData* system)
: mType(type)
, mPath(path)
, mSystem(system)
, mEnvData(envData)
: metadata(type == GAME ? GAME_METADATA : FOLDER_METADATA)
, mSourceFileData(nullptr)
, mParent(nullptr)
, mType(type)
, mPath(path)
, mEnvData(envData)
, mSystem(system)
, mOnlyFolders(false)
, mDeletionFlag(false)
// Metadata is set in the constructor.
, metadata(type == GAME ? GAME_METADATA : FOLDER_METADATA)
{
// Metadata needs at least a name field (since that's what getName() will return).
if (metadata.get("name").empty()) {

View file

@ -279,7 +279,7 @@ void FileFilterIndex::setTextFilter(std::string textFilter)
mFilterByText = false;
else
mFilterByText = true;
};
}
void FileFilterIndex::clearAllFilters()
{

View file

@ -234,4 +234,4 @@ namespace FileSorts
return system1.compare(system2) > 0;
}
}; // namespace FileSorts
} // namespace FileSorts

View file

@ -38,6 +38,6 @@ namespace FileSorts
bool compareSystemDescending(const FileData* file1, const FileData* file2);
extern const std::vector<FileData::SortType> SortTypes;
}; // namespace FileSorts
} // namespace FileSorts
#endif // ES_APP_FILE_SORTS_H

View file

@ -149,11 +149,6 @@ public:
void setupSystemSortType(FileData* mRootFolder);
private:
bool mIsCollectionSystem;
bool mIsCustomCollectionSystem;
bool mIsGroupedCustomCollectionSystem;
bool mIsGameSystem;
bool mScrapeFlag; // Only used by scraper GUI to remember which systems to scrape.
std::string mName;
std::string mFullName;
SystemEnvironmentData* mEnvData;
@ -161,6 +156,12 @@ private:
std::string mThemeFolder;
std::shared_ptr<ThemeData> mTheme;
bool mIsCollectionSystem;
bool mIsCustomCollectionSystem;
bool mIsGroupedCustomCollectionSystem;
bool mIsGameSystem;
bool mScrapeFlag; // Only used by scraper GUI to remember which systems to scrape.
bool populateFolder(FileData* folder);
void indexAllGameFilters(const FileData* folder);
void setIsGameSystemStatus();

View file

@ -22,10 +22,10 @@ GuiGameScraper::GuiGameScraper(Window* window,
ScraperSearchParams params,
std::function<void(const ScraperSearchResult&)> doneFunc)
: GuiComponent(window)
, mClose(false)
, mGrid(window, glm::ivec2{1, 7})
, mBox(window, ":/graphics/frame.svg")
, mSearchParams(params)
, mClose(false)
{
addChild(&mBox);
addChild(&mGrid);

View file

@ -27,8 +27,8 @@
GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
: GuiComponent(window)
, mSystem(system)
, mMenu(window, "OPTIONS")
, mSystem(system)
, mFiltersChanged(false)
, mCancelled(false)
, mIsCustomCollection(false)

View file

@ -16,10 +16,10 @@
GuiLaunchScreen::GuiLaunchScreen(Window* window)
: GuiComponent(window)
, mWindow(window)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(nullptr)
, mMarquee(nullptr)
, mWindow(window)
{
addChild(&mBackground);
mWindow->setLaunchScreen(this);
@ -169,7 +169,6 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
mMarquee->setOrigin(0.5f, 0.5f);
glm::vec3 currentPos{mMarquee->getPosition()};
glm::vec2 currentSize{mMarquee->getSize()};
// Position the image in the middle of row four.
currentPos.x = mSize.x / 2.0f;

View file

@ -34,8 +34,8 @@ public:
private:
Window* mWindow;
ComponentGrid* mGrid;
NinePatchComponent mBackground;
ComponentGrid* mGrid;
std::shared_ptr<TextComponent> mTitle;
std::shared_ptr<TextComponent> mGameName;

View file

@ -40,9 +40,9 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
std::function<void()> clearGameFunc,
std::function<void()> deleteGameFunc)
: GuiComponent(window)
, mScraperParams(scraperParams)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2{1, 3})
, mScraperParams(scraperParams)
, mMetaDataDecl(mdd)
, mMetaData(md)
, mSavedCallback(saveCallback)
@ -188,7 +188,6 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()});
row.addElement(bracket, false);
bool multiLine = false;
const std::string title = iter->displayPrompt;
// OK callback (apply new value to ed).

View file

@ -15,9 +15,9 @@
GuiOfflineGenerator::GuiOfflineGenerator(Window* window, const std::queue<FileData*>& gameQueue)
: GuiComponent(window)
, mGameQueue(gameQueue)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2{6, 13})
, mGameQueue(gameQueue)
{
addChild(&mBackground);
addChild(&mGrid);

View file

@ -40,12 +40,12 @@
GuiScraperSearch::GuiScraperSearch(Window* window, SearchType type, unsigned int scrapeCount)
: GuiComponent(window)
, mGrid(window, glm::ivec2{4, 3})
, mBusyAnim(window)
, mSearchType(type)
, mScrapeCount(scrapeCount)
, mScrapeRatings(false)
, mRefinedSearch(false)
, mFoundGame(false)
, mScrapeRatings(false)
, mBusyAnim(window)
{
addChild(&mGrid);

View file

@ -24,6 +24,7 @@
GuiSettings::GuiSettings(Window* window, std::string title)
: GuiComponent(window)
, mMenu(window, title)
, mGoToSystem(nullptr)
, mNeedsSaving(false)
, mNeedsReloadHelpPrompts(false)
, mNeedsCollectionsUpdate(false)
@ -35,7 +36,6 @@ GuiSettings::GuiSettings(Window* window, std::string title)
, mNeedsGoToSystem(false)
, mNeedsGoToGroupedCollections(false)
, mInvalidateCachedBackground(false)
, mGoToSystem(nullptr)
{
addChild(&mMenu);
mMenu.addButton("BACK", "back", [this] { delete this; });

View file

@ -373,11 +373,11 @@ MediaDownloadHandle::MediaDownloadHandle(const std::string& url,
const std::string& mediaType,
const bool resizeFile,
bool& savedNewMedia)
: mSavePath(path)
: mReq(new HttpReq(url))
, mSavePath(path)
, mExistingMediaFile(existingMediaPath)
, mMediaType(mediaType)
, mResizeFile(resizeFile)
, mReq(new HttpReq(url))
{
mSavedNewMediaPtr = &savedNewMedia;
}

View file

@ -28,10 +28,10 @@ const int logoBuffersRight[] = {1, 2, 5};
SystemView::SystemView(Window* window)
: IList<SystemViewData, SystemData*>(window, LIST_SCROLL_STYLE_SLOW, LIST_ALWAYS_LOOP)
, mSystemInfo(window, "SYSTEM INFO", Font::get(FONT_SIZE_SMALL), 0x33333300, ALIGN_CENTER)
, mPreviousScrollVelocity(0)
, mUpdatedGameCount(false)
, mViewNeedsReload(true)
, mSystemInfo(window, "SYSTEM INFO", Font::get(FONT_SIZE_SMALL), 0x33333300, ALIGN_CENTER)
{
mCamOffset = 0;
mExtrasCamOffset = 0;
@ -182,7 +182,6 @@ void SystemView::goToSystem(SystemData* system, bool animate)
bool SystemView::input(InputConfig* config, Input input)
{
auto it = SystemData::sSystemVector.cbegin();
const std::shared_ptr<ThemeData>& theme = (*it)->getTheme();
if (input.value != 0) {
if (config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_r &&

View file

@ -69,9 +69,11 @@ void ViewController::init(Window* window)
ViewController::ViewController(Window* window)
: GuiComponent(window)
, mNoGamesMessageBox(nullptr)
, mCurrentView(nullptr)
, mPreviousView(nullptr)
, mSkipView(nullptr)
, mGameToLaunch(nullptr)
, mCamera(Renderer::getIdentity())
, mSystemViewTransition(false)
, mWrappedViews(false)
@ -79,8 +81,6 @@ ViewController::ViewController(Window* window)
, mCancelledTransition(false)
, mLockInput(false)
, mNextSystem(false)
, mGameToLaunch(nullptr)
, mNoGamesMessageBox(nullptr)
{
mState.viewing = NOTHING;
mState.viewstyle = AUTOMATIC;

View file

@ -18,9 +18,6 @@
DetailedGameListView::DetailedGameListView(Window* window, FileData* root)
: BasicGameListView(window, root)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
, mThumbnail(window)
, mMarquee(window)
, mImage(window)
@ -41,6 +38,9 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root)
, mLastPlayed(window)
, mPlayCount(window)
, mName(window)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
, mLastUpdated(nullptr)
{
const float padding = 0.01f;

View file

@ -24,9 +24,6 @@ GridGameListView::GridGameListView(Window* window, FileData* root)
, mGrid(window)
, mMarquee(window)
, mImage(window)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
, mLblRating(window)
, mLblReleaseDate(window)
, mLblDeveloper(window)
@ -44,6 +41,9 @@ GridGameListView::GridGameListView(Window* window, FileData* root)
, mLastPlayed(window)
, mPlayCount(window)
, mName(window)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
{
const float padding = 0.01f;

View file

@ -76,6 +76,9 @@ private:
void initMDLabels();
void initMDValues();
ImageComponent mMarquee;
ImageComponent mImage;
TextComponent mLblRating;
TextComponent mLblReleaseDate;
TextComponent mLblDeveloper;
@ -85,8 +88,6 @@ private:
TextComponent mLblLastPlayed;
TextComponent mLblPlayCount;
ImageComponent mMarquee;
ImageComponent mImage;
RatingComponent mRating;
DateTimeComponent mReleaseDate;
TextComponent mDeveloper;

View file

@ -24,14 +24,10 @@
VideoGameListView::VideoGameListView(Window* window, FileData* root)
: BasicGameListView(window, root)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
, mThumbnail(window)
, mMarquee(window)
, mImage(window)
, mVideo(nullptr)
, mVideoPlaying(false)
, mLblRating(window)
, mLblReleaseDate(window)
, mLblDeveloper(window)
@ -49,6 +45,10 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root)
, mLastPlayed(window)
, mPlayCount(window)
, mName(window)
, mDescContainer(window)
, mDescription(window)
, mGamelistInfo(window)
, mVideoPlaying(false)
, mLastUpdated(nullptr)
{
const float padding = 0.01f;

View file

@ -38,8 +38,8 @@ private:
ImageComponent mThumbnail;
ImageComponent mMarquee;
VideoComponent* mVideo;
ImageComponent mImage;
VideoComponent* mVideo;
TextComponent mLblRating;
TextComponent mLblReleaseDate;

View file

@ -19,19 +19,19 @@
GuiComponent::GuiComponent(Window* window)
: mWindow(window)
, mParent(nullptr)
, mOpacity(255)
, mColor(0)
, mSaturation(1.0f)
, mColorShift(0)
, mColorShiftEnd(0)
, mOpacity(255)
, mSaturation(1.0f)
, mPosition({})
, mOrigin({})
, mRotationOrigin(0.5f, 0.5f)
, mSize({})
, mTransform(Renderer::getIdentity())
, mIsProcessing(false)
, mVisible(true)
, mEnabled(true)
, mTransform(Renderer::getIdentity())
{
for (unsigned char i = 0; i < MAX_ANIMATIONS; i++)
mAnimationMap[i] = nullptr;

View file

@ -234,6 +234,11 @@ protected:
void updateSelf(int deltaTime); // Updates animations.
void updateChildren(int deltaTime); // Updates animations.
Window* mWindow;
GuiComponent* mParent;
std::vector<GuiComponent*> mChildren;
unsigned char mOpacity;
unsigned int mColor;
float mSaturation;
@ -243,11 +248,6 @@ protected:
unsigned int mColorOriginalValue;
unsigned int mColorChangedValue;
Window* mWindow;
GuiComponent* mParent;
std::vector<GuiComponent*> mChildren;
glm::vec3 mPosition;
glm::vec2 mOrigin;
glm::vec2 mRotationOrigin;

View file

@ -79,8 +79,8 @@ private:
static CURLM* s_multi_handle;
CURL* mHandle;
Status mStatus;
CURL* mHandle;
std::stringstream mContent;
std::string mErrorMsg;

View file

@ -414,7 +414,7 @@ void Settings::loadFile()
}
// Parameters for the macro defined above.
SETTINGS_GETSET(bool, mBoolMap, getBool, getDefaultBool, setBool);
SETTINGS_GETSET(int, mIntMap, getInt, getDefaultInt, setInt);
SETTINGS_GETSET(float, mFloatMap, getFloat, getDefaultFloat, setFloat);
SETTINGS_GETSET(const std::string&, mStringMap, getString, getDefaultString, setString);
SETTINGS_GETSET(bool, mBoolMap, getBool, getDefaultBool, setBool)
SETTINGS_GETSET(int, mIntMap, getInt, getDefaultInt, setInt)
SETTINGS_GETSET(float, mFloatMap, getFloat, getDefaultFloat, setFloat)
SETTINGS_GETSET(const std::string&, mStringMap, getString, getDefaultString, setString)

View file

@ -30,13 +30,14 @@ Window::Window()
, mMediaViewer(nullptr)
, mLaunchScreen(nullptr)
, mInfoPopup(nullptr)
, mNormalizeNextUpdate(false)
, mListScrollOpacity(0)
, mFrameTimeElapsed(0)
, mFrameCountElapsed(0)
, mAverageDeltaTime(10)
, mTimeSinceLastInput(0)
, mNormalizeNextUpdate(false)
, mAllowSleep(true)
, mSleeping(false)
, mTimeSinceLastInput(0)
, mRenderScreensaver(false)
, mRenderMediaViewer(false)
, mRenderLaunchScreen(false)
@ -46,7 +47,6 @@ Window::Window()
, mInvalidatedCachedBackground(false)
, mVideoPlayerCount(0)
, mTopScale(0.5)
, mListScrollOpacity(0)
, mChangedThemeSet(false)
{
mHelp = new HelpComponent(this);
@ -792,7 +792,7 @@ int Window::getVideoPlayerCount()
videoPlayerCount = mVideoPlayerCount;
mVideoCountMutex.unlock();
return videoPlayerCount;
};
}
void Window::setLaunchedGame()
{

View file

@ -158,31 +158,31 @@ private:
HelpComponent* mHelp;
ImageComponent* mBackgroundOverlay;
unsigned char mBackgroundOverlayOpacity;
Screensaver* mScreensaver;
InfoPopup* mInfoPopup;
std::vector<GuiComponent*> mGuiStack;
std::vector<std::shared_ptr<Font>> mDefaultFonts;
std::unique_ptr<TextCache> mFrameDataText;
Screensaver* mScreensaver;
MediaViewer* mMediaViewer;
bool mRenderMediaViewer;
GuiLaunchScreen* mLaunchScreen;
bool mRenderLaunchScreen;
InfoPopup* mInfoPopup;
std::string mListScrollText;
std::shared_ptr<Font> mListScrollFont;
unsigned char mListScrollOpacity;
bool mNormalizeNextUpdate;
int mFrameTimeElapsed;
int mFrameCountElapsed;
int mAverageDeltaTime;
bool mAllowSleep;
bool mSleeping;
unsigned int mTimeSinceLastInput;
bool mNormalizeNextUpdate;
bool mAllowSleep;
bool mSleeping;
bool mRenderScreensaver;
bool mRenderMediaViewer;
bool mRenderLaunchScreen;
bool mGameLaunchedState;
bool mAllowTextScrolling;
bool mCachedBackground;

View file

@ -17,8 +17,8 @@ class MoveCameraAnimation : public Animation
public:
MoveCameraAnimation(glm::mat4& camera, const glm::vec3& target)
: mCameraStart(camera)
, mTarget(target)
, cameraPosition(camera)
, mTarget(target)
{
}

View file

@ -27,7 +27,7 @@ namespace GridFlags
BORDER_LEFT = 4,
BORDER_RIGHT = 8
};
}; // namespace GridFlags
} // namespace GridFlags
// Provides basic layout of components in an X*Y grid.
class ComponentGrid : public GuiComponent

View file

@ -20,9 +20,9 @@ DateTimeEditComponent::DateTimeEditComponent(Window* window, bool alignRight, Di
, mRelativeUpdateAccumulator(0)
, mColor(0x777777FF)
, mFont(Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT))
, mAlignRight(alignRight)
, mUppercase(false)
, mAutoSize(true)
, mAlignRight(alignRight)
{
updateTextCache();
}

View file

@ -315,7 +315,7 @@ std::shared_ptr<TextureResource> GridTileComponent::getTexture()
return mImage->getTexture();
return nullptr;
};
}
void GridTileComponent::forceSize(glm::vec2 size, float selectedZoom)
{

View file

@ -29,20 +29,20 @@ glm::vec2 ImageComponent::getSize() const
ImageComponent::ImageComponent(Window* window, bool forceLoad, bool dynamic)
: GuiComponent(window)
, mTargetIsMax(false)
, mTargetIsMin(false)
, mTargetSize({})
, mFlipX(false)
, mFlipY(false)
, mTargetSize(0, 0)
, mTargetIsMax(false)
, mTargetIsMin(false)
, mColorShift(0xFFFFFFFF)
, mColorShiftEnd(0xFFFFFFFF)
, mColorGradientHorizontal(true)
, mForceLoad(forceLoad)
, mDynamic(dynamic)
, mFadeOpacity(0)
, mFading(false)
, mForceLoad(forceLoad)
, mDynamic(dynamic)
, mRotateByTargetSize(false)
, mTopLeftCrop(0.0f, 0.0f)
, mTopLeftCrop({})
, mBottomRightCrop(1.0f, 1.0f)
{
updateColors();

View file

@ -101,7 +101,10 @@ public:
private:
glm::vec2 mTargetSize;
bool mFlipX, mFlipY, mTargetIsMax, mTargetIsMin;
bool mFlipX;
bool mFlipY;
bool mTargetIsMax;
bool mTargetIsMin;
// Calculates the correct mSize from our resizing information (set by setResize/setMaxSize).
// Used internally whenever the resizing parameters or texture change.

View file

@ -17,11 +17,11 @@ NinePatchComponent::NinePatchComponent(Window* window,
unsigned int edgeColor,
unsigned int centerColor)
: GuiComponent(window)
, mVertices(nullptr)
, mPath(path)
, mCornerSize(16.0f, 16.0f)
, mEdgeColor(edgeColor)
, mCenterColor(centerColor)
, mPath(path)
, mVertices(nullptr)
{
if (!mPath.empty())
buildVertices();

View file

@ -288,9 +288,9 @@ private:
OptionListComponent<T>* parent,
const std::string& title)
: GuiComponent(window)
, mHelpStyle(helpstyle)
, mMenu(window, title.c_str())
, mParent(parent)
, mHelpStyle(helpstyle)
{
auto font = Font::get(FONT_SIZE_MEDIUM);
ComponentListRow row;

View file

@ -15,12 +15,12 @@
RatingComponent::RatingComponent(Window* window, bool colorizeChanges)
: GuiComponent(window)
, mColorOriginalValue(DEFAULT_COLORSHIFT)
, mColorChangedValue(DEFAULT_COLORSHIFT)
, mColorShift(DEFAULT_COLORSHIFT)
, mColorShiftEnd(DEFAULT_COLORSHIFT)
, mUnfilledColor(DEFAULT_COLORSHIFT)
, mColorizeChanges(colorizeChanges)
, mColorOriginalValue(DEFAULT_COLORSHIFT)
, mColorChangedValue(DEFAULT_COLORSHIFT)
{
mFilledTexture = TextureResource::get(":/graphics/star_filled.svg", true);
mUnfilledTexture = TextureResource::get(":/graphics/star_unfilled.svg", true);

View file

@ -16,13 +16,13 @@
ScrollableContainer::ScrollableContainer(Window* window)
: GuiComponent(window)
, mScrollPos({})
, mScrollDir({})
, mFontSize(0.0f)
, mAutoScrollDelay(0)
, mAutoScrollSpeed(0)
, mAutoScrollAccumulator(0)
, mScrollPos(0, 0)
, mScrollDir(0, 0)
, mAutoScrollResetAccumulator(0)
, mFontSize(0.0f)
{
// Set the modifier to get equivalent scrolling speed regardless of screen resolution.
mResolutionModifier = Renderer::getScreenHeightModifier();

View file

@ -15,16 +15,16 @@
TextComponent::TextComponent(Window* window)
: GuiComponent(window)
, mFont(Font::get(FONT_SIZE_MEDIUM))
, mUppercase(false)
, mColor(0x000000FF)
, mBgColor(0)
, mMargin(0.0f)
, mRenderBackground(false)
, mUppercase(false)
, mAutoCalcExtent(true, true)
, mHorizontalAlignment(ALIGN_LEFT)
, mVerticalAlignment(ALIGN_CENTER)
, mLineSpacing(1.5f)
, mNoTopMargin(false)
, mBgColor(0)
, mMargin(0.0f)
, mRenderBackground(false)
{
}
@ -39,16 +39,16 @@ TextComponent::TextComponent(Window* window,
float margin)
: GuiComponent(window)
, mFont(nullptr)
, mUppercase(false)
, mColor(0x000000FF)
, mBgColor(0)
, mMargin(margin)
, mRenderBackground(false)
, mUppercase(false)
, mAutoCalcExtent(true, true)
, mHorizontalAlignment(align)
, mVerticalAlignment(ALIGN_CENTER)
, mLineSpacing(1.5f)
, mNoTopMargin(false)
, mBgColor(0)
, mMargin(margin)
, mRenderBackground(false)
{
setFont(font);
setColor(color);

View file

@ -20,14 +20,14 @@
TextEditComponent::TextEditComponent(Window* window)
: GuiComponent{window}
, mBox{window, ":/graphics/textinput.svg"}
, mFocused{false}
, mScrollOffset{0.0f, 0.0f}
, mCursor{0}
, mEditing{false}
, mFont{Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)}
, mCursorRepeatDir{0}
, mCursor{0}
, mBlinkTime{0}
, mCursorRepeatDir{0}
, mScrollOffset{0.0f, 0.0f}
, mBox{window, ":/graphics/textinput.svg"}
, mFont{Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)}
{
addChild(&mBox);
onFocusLost();

View file

@ -22,8 +22,11 @@ VideoComponent::VideoComponent(Window* window)
: GuiComponent(window)
, mWindow(window)
, mStaticImage(window)
, mVideoHeight(0)
, mVideoWidth(0)
, mVideoHeight(0)
, mTargetSize(0, 0)
, mVideoAreaPos(0, 0)
, mVideoAreaSize(0, 0)
, mStartDelayed(false)
, mIsPlaying(false)
, mIsActuallyPlaying(false)
@ -37,9 +40,6 @@ VideoComponent::VideoComponent(Window* window)
, mBlockPlayer(false)
, mTargetIsMax(false)
, mFadeIn(1.0)
, mTargetSize(0, 0)
, mVideoAreaPos(0, 0)
, mVideoAreaSize(0, 0)
{
// Setup the default configuration.
mConfig.showSnapshotDelay = false;

View file

@ -108,6 +108,8 @@ private:
protected:
Window* mWindow;
ImageComponent mStaticImage;
unsigned mVideoWidth;
unsigned mVideoHeight;
glm::vec2 mTargetSize;
@ -115,7 +117,6 @@ protected:
glm::vec2 mVideoAreaSize;
std::shared_ptr<TextureResource> mTexture;
std::string mStaticImagePath;
ImageComponent mStaticImage;
std::string mVideoPath;
std::string mPlayingVideoPath;

View file

@ -44,9 +44,9 @@ VideoFFmpegComponent::VideoFFmpegComponent(Window* window)
, mAFilterGraph(nullptr)
, mAFilterInputs(nullptr)
, mAFilterOutputs(nullptr)
, mVideoTimeBase(0.0l)
, mVideoTargetQueueSize(0)
, mAudioTargetQueueSize(0)
, mVideoTimeBase(0.0l)
, mAccumulatedTime(0)
, mStartTimeAccumulation(false)
, mDecodedFrame(false)

View file

@ -34,8 +34,8 @@ libvlc_instance_t* VideoVlcComponent::mVLC = nullptr;
VideoVlcComponent::VideoVlcComponent(Window* window)
: VideoComponent(window)
, mMediaPlayer(nullptr)
, mMedia(nullptr)
, mMediaPlayer(nullptr)
, mContext({})
, mHasSetAudioVolume(false)
{

View file

@ -26,9 +26,9 @@ GuiMsgBox::GuiMsgBox(Window* window,
bool disableBackButton,
bool deleteOnButtonPress)
: GuiComponent(window)
, mHelpStyle(helpstyle)
, mBackground(window, ":/graphics/frame.svg")
, mGrid(window, glm::ivec2{1, 2})
, mHelpStyle(helpstyle)
, mDisableBackButton(disableBackButton)
, mDeleteOnButtonPress(deleteOnButtonPress)
{

View file

@ -89,17 +89,17 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
const std::string& clearBtnHelpText,
const std::string& cancelBtnHelpText)
: GuiComponent{window}
, mBackground{window, ":/graphics/frame.svg"}
, mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 8 : 6)}}
, mHelpStyle{helpstyle}
, mInitValue{initValue}
, mOkCallback{okCallback}
, mMultiLine{multiLine}
, mAcceptBtnHelpText{acceptBtnHelpText}
, mSaveConfirmationText{saveConfirmationText}
, mLoadBtnHelpText{loadBtnHelpText}
, mClearBtnHelpText{clearBtnHelpText}
, mCancelBtnHelpText{cancelBtnHelpText}
, mBackground{window, ":/graphics/frame.svg"}
, mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 8 : 6)}}
, mOkCallback{okCallback}
, mMultiLine{multiLine}
, mComplexMode{(infoString != "" && defaultValue != "")}
, mDeleteRepeat{false}
, mShift{false}
@ -346,7 +346,7 @@ bool GuiTextEditKeyboardPopup::input(InputConfig* config, Input input)
// Pressing back (or the escape key if using keyboard input) closes us.
if ((config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_ESCAPE) ||
(!keyboardBackspace && config->isMappedTo("b", input)) && input.value) {
(!keyboardBackspace && input.value && config->isMappedTo("b", input))) {
if (mText->getValue() != mInitValue) {
// Changes were made, ask if the user wants to save them.
mWindow->pushGui(new GuiMsgBox(

View file

@ -29,17 +29,17 @@ GuiTextEditPopup::GuiTextEditPopup(Window* window,
const std::string& clearBtnHelpText,
const std::string& cancelBtnHelpText)
: GuiComponent{window}
, mBackground{window, ":/graphics/frame.svg"}
, mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 5 : 3)}}
, mHelpStyle{helpstyle}
, mInitValue{initValue}
, mOkCallback{okCallback}
, mMultiLine{multiLine}
, mAcceptBtnText{acceptBtnText}
, mSaveConfirmationText{saveConfirmationText}
, mLoadBtnHelpText{loadBtnHelpText}
, mClearBtnHelpText{clearBtnHelpText}
, mCancelBtnHelpText{cancelBtnHelpText}
, mBackground{window, ":/graphics/frame.svg"}
, mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 5 : 3)}}
, mOkCallback{okCallback}
, mMultiLine{multiLine}
, mComplexMode{(infoString != "" && defaultValue != "")}
, mDeleteRepeat{false}
, mDeleteRepeatTimer{0}
@ -175,7 +175,7 @@ bool GuiTextEditPopup::input(InputConfig* config, Input input)
// Pressing back (or the escape key if using keyboard input) closes us.
if ((config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_ESCAPE) ||
(!keyboardBackspace && config->isMappedTo("b", input)) && input.value) {
(!keyboardBackspace && input.value && config->isMappedTo("b", input))) {
if (mText->getValue() != mInitValue) {
// Changes were made, ask if the user wants to save them.
mWindow->pushGui(new GuiMsgBox(

View file

@ -539,7 +539,7 @@ namespace Renderer
return sShaderProgramVector[index - 1];
else
return nullptr;
};
}
const glm::mat4 getProjectionMatrix() { return mProjectionMatrix; }
SDL_Window* getSDLWindow() { return sdlWindow; }

View file

@ -18,7 +18,6 @@
#include <fstream>
auto array_deleter = [](unsigned char* p) { delete[] p; };
auto nop_deleter = [](unsigned char* /*p*/) {};
std::shared_ptr<ResourceManager> ResourceManager::sInstance = nullptr;

View file

@ -26,13 +26,13 @@ TextureData::TextureData(bool tile)
: mTile(tile)
, mTextureID(0)
, mDataRGBA({})
, mScaleDuringLoad(1.0f)
, mScalable(false)
, mLinearMagnify(false)
, mWidth(0)
, mHeight(0)
, mSourceWidth(0.0f)
, mSourceHeight(0.0f)
, mScaleDuringLoad(1.0f)
, mScalable(false)
, mLinearMagnify(false)
{
}

View file

@ -260,8 +260,8 @@ namespace Utils
std::string getPreferredPath(const std::string& path)
{
std::string preferredPath = path;
size_t offset = std::string::npos;
#if defined(_WIN64)
size_t offset = std::string::npos;
// Convert '/' to '\\'
while ((offset = preferredPath.find('/')) != std::string::npos)
preferredPath.replace(offset, 1, "\\");