Assorted fixes to auto resolution. Fixes too low resolution and also #8002, plus notification spam

This commit is contained in:
Henrik Rydgard 2015-09-25 19:08:48 +02:00
parent eed2f9d9d5
commit 70cb4372c1
6 changed files with 16 additions and 12 deletions

View File

@ -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");
}

View File

@ -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)

View File

@ -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)

View File

@ -807,8 +807,8 @@ rotateVBO:
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) {

View File

@ -53,14 +53,16 @@ restart:
}
}
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;
@ -68,10 +70,11 @@ void OnScreenMessages::Show(const std::string &message, float duration_s, uint32
}
}
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);
}

View File

@ -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(); }
@ -30,6 +30,7 @@ public:
int icon;
uint32_t color;
std::string text;
const char *id;
double endTime;
double duration;
};