Skip to content

Commit

Permalink
verbosity check frame dimensions warn and minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 1, 2018
1 parent d338256 commit 49baed2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/RageBitmapTexture.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "global.h"
#include "global.h"
#include "RageBitmapTexture.h"
#include "RageDisplay.h"
#include "RageLog.h"
Expand All @@ -12,9 +12,10 @@
#include "RageUtil.h"
#include "StepMania.h"
#include "arch/Dialog/Dialog.h"
#include "PrefsManager.h"

static void
GetResolutionFromFileName(RString sPath, int& iWidth, int& iHeight)
GetResolutionFromFileName(RString& sPath, int& iWidth, int& iHeight)
{
/* Match:
* Foo (res 512x128).png
Expand Down Expand Up @@ -76,22 +77,22 @@ RageBitmapTexture::Create()

/* Load the image into a RageSurface. */
RString error;
RageSurface* pImg = NULL;
RageSurface* pImg = nullptr;
if (actualID.filename == TEXTUREMAN->GetScreenTextureID().filename) {
pImg = TEXTUREMAN->GetScreenSurface();
} else {
pImg = RageSurfaceUtils::LoadFile(actualID.filename, error);
}

/* Tolerate corrupt/unknown images. */
if (pImg == NULL) {
if (pImg == nullptr) {
RString warning = ssprintf("RageBitmapTexture: Couldn't load %s: %s",
actualID.filename.c_str(),
error.c_str());
LOG->Warn("%s", warning.c_str());
Dialog::OK(warning, "missing_texture");
pImg = RageSurfaceUtils::MakeDummySurface(64, 64);
ASSERT(pImg != NULL);
ASSERT(pImg != nullptr);
}

if (actualID.bHotPinkColorKey)
Expand Down Expand Up @@ -316,7 +317,7 @@ RageBitmapTexture::Create()
bRunCheck = false;
}

if (bRunCheck) {
if (bRunCheck && PREFSMAN->m_verbose_log > 1) {
float fFrameWidth = this->GetSourceWidth() /
static_cast<float>(this->GetFramesWide());
float fFrameHeight = this->GetSourceHeight() /
Expand Down

0 comments on commit 49baed2

Please sign in to comment.