Skip to content

Commit

Permalink
Assorted fixes to auto resolution. Fixes too low resolution and also #…
Browse files Browse the repository at this point in the history
…8002, plus notification spam
  • Loading branch information
hrydgard committed Sep 25, 2015
1 parent eed2f9d commit 70cb437
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion GPU/Common/FramebufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,5 +847,5 @@ void FramebufferManagerCommon::ShowScreenResolution() {
messageStream << gr->T("Window Size") << ": ";
messageStream << PSP_CoreParameter().pixelWidth << "x" << PSP_CoreParameter().pixelHeight;

osm.Show(messageStream.str(), 2.0f);
osm.Show(messageStream.str(), 2.0f, 0xFFFFFF, -1, true, "resize");
}
6 changes: 3 additions & 3 deletions GPU/Directx9/FramebufferDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,10 +1115,10 @@ namespace DX9 {
int zoom = g_Config.iInternalResolution;
if (zoom == 0) { // auto mode
// Use the longest dimension
if (g_Config.IsPortrait()) {
zoom = (pixelWidth_ + 479) / 480;
if (!g_Config.IsPortrait()) {
zoom = (PSP_CoreParameter().pixelWidth + 479) / 480;
} else {
zoom = (pixelHeight_ + 479) / 480;
zoom = (PSP_CoreParameter().pixelHeight + 479) / 480;
}
}
if (zoom <= 1)
Expand Down
6 changes: 3 additions & 3 deletions GPU/GLES/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,10 +1667,10 @@ void FramebufferManager::EndFrame() {
int zoom = g_Config.iInternalResolution;
if (zoom == 0) { // auto mode
// Use the longest dimension
if (g_Config.IsPortrait()) {
zoom = (pixelWidth_ + 479) / 480;
if (!g_Config.IsPortrait()) {
zoom = (PSP_CoreParameter().pixelWidth + 479) / 480;
} else {
zoom = (pixelHeight_ + 479) / 480;
zoom = (PSP_CoreParameter().pixelHeight + 479) / 480;
}
}
if (zoom <= 1)
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/TransformPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,8 @@ void TransformDrawEngine::DoFlush() {
prim, decoded, indexGen.VertexCount(),
dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(),
maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result, 1.0);

ApplyDrawStateLate();

LinkedShader *program = shaderManager_->ApplyFragmentShader(vshader, prim, lastVType_);

if (result.action == SW_DRAW_PRIMITIVES) {
Expand Down
9 changes: 6 additions & 3 deletions UI/OnScreenDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,28 @@ void OnScreenMessages::Clean() {
}
}

void OnScreenMessages::Show(const std::string &message, float duration_s, uint32_t color, int icon, bool checkUnique) {
void OnScreenMessages::Show(const std::string &text, float duration_s, uint32_t color, int icon, bool checkUnique, const char *id) {
double now = time_now_d();
std::lock_guard<std::recursive_mutex> guard(mutex_);
if (checkUnique) {
for (auto iter = messages_.begin(); iter != messages_.end(); ++iter) {
if (iter->text == message) {
if (iter->text == text || (id && !strcmp(iter->id, id))) {
Message msg = *iter;
msg.endTime = now + duration_s;
msg.text = text;
msg.color = color;
messages_.erase(iter);
messages_.insert(messages_.begin(), msg);
return;
}
}
}
Message msg;
msg.text = message;
msg.text = text;
msg.color = color;
msg.endTime = now + duration_s;
msg.icon = icon;
msg.id = id;
messages_.insert(messages_.begin(), msg);
}

Expand Down
3 changes: 2 additions & 1 deletion UI/OnScreenDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DrawBuffer;

class OnScreenMessages {
public:
void Show(const std::string &message, float duration_s = 1.0f, uint32_t color = 0xFFFFFF, int icon = -1, bool checkUnique = true);
void Show(const std::string &message, float duration_s = 1.0f, uint32_t color = 0xFFFFFF, int icon = -1, bool checkUnique = true, const char *id = nullptr);
void ShowOnOff(const std::string &message, bool b, float duration_s = 1.0f, uint32_t color = 0xFFFFFF, int icon = -1);
bool IsEmpty() const { return messages_.empty(); }

Expand All @@ -30,6 +30,7 @@ class OnScreenMessages {
int icon;
uint32_t color;
std::string text;
const char *id;
double endTime;
double duration;
};
Expand Down

0 comments on commit 70cb437

Please sign in to comment.