diff --git a/shader/hue.frag b/shader/hue.frag index 416ee9b..405c91b 100644 --- a/shader/hue.frag +++ b/shader/hue.frag @@ -29,7 +29,11 @@ void main () /* Make the user's adjustments */ hue += hueAdjust; - // Convert back to YIQ + /* Remember old I and color */ + float IOriginal = I; + vec4 coOriginal = color; + + /* Convert back to YIQ */ Q = chroma * sin (hue); I = chroma * cos (hue); @@ -40,5 +44,5 @@ void main () color.b = dot (yIQ, kYIQToB); /* Save the result */ - gl_FragColor = color; + gl_FragColor = (IOriginal == 0.0) ? coOriginal : color; } diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 37b3984..fa499ad 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -51,8 +51,6 @@ "Operation not supported for mega surfaces"); \ } -#define OUTLINE_SIZE 1 - /* Normalize (= ensure width and * height are positive) */ static IntRect normalizedRect(const IntRect &rect) @@ -944,7 +942,6 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align) TTF_Font *font = p->font->getSdlFont(); const Color &fontColor = p->font->getColor(); - const Color &outColor = p->font->getOutColor(); SDL_Color c = fontColor.toSDLColor(); c.a = 255; @@ -960,33 +957,11 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align) p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888); - if (p->font->getShadow()) + // While real outlining is not yet here, use shadow + // as a replacement to at least make text legible + if (p->font->getShadow() || p->font->getOutline()) applyShadow(txtSurf, *p->format, c); - /* outline using TTF_Outline and blending it together with SDL_BlitSurface - * FIXME: outline is forced to have the same opacity as the font color */ - if (p->font->getOutline()) { - SDL_Color co = outColor.toSDLColor(); - co.a = 255; - SDL_Surface *outline; - /* set the next font render to render the outline */ - TTF_SetFontOutline(font, OUTLINE_SIZE); - if (shState->rtData().config.solidFonts) - outline = TTF_RenderUTF8_Solid(font, str, co); - else - outline = TTF_RenderUTF8_Blended(font, str, co); - - p->ensureFormat(outline, SDL_PIXELFORMAT_ABGR8888); - SDL_Rect outRect = {OUTLINE_SIZE, OUTLINE_SIZE, txtSurf->w, txtSurf->h}; - - SDL_SetSurfaceBlendMode(txtSurf, SDL_BLENDMODE_BLEND); - SDL_BlitSurface(txtSurf, NULL, outline, &outRect); - SDL_FreeSurface(txtSurf); - txtSurf = outline; - /* reset outline to 0 */ - TTF_SetFontOutline(font, 0); - } - int alignX = rect.x; switch (align) diff --git a/src/main.cpp b/src/main.cpp index bdcd7ad..6185e58 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -321,6 +321,11 @@ int main(int argc, char *argv[]) /* Clean up any remainin events */ eventThread.cleanup(); + /* Store key bindings */ + BDescVec keyBinds; + rtData.bindingUpdateMsg.get(keyBinds); + storeBindings(keyBinds, rtData.config); + Debug() << "Shutting down."; SDL_DestroyWindow(win); diff --git a/src/settingsmenu.cpp b/src/settingsmenu.cpp index a734ffa..ad3b9fd 100644 --- a/src/settingsmenu.cpp +++ b/src/settingsmenu.cpp @@ -678,9 +678,6 @@ struct SettingsMenuPrivate rtData.bindingUpdateMsg.post(binds); - /* Store the key bindings to disk as well to prevent config loss */ - storeBindings(binds, rtData.config); - destroyReq = true; }