Unrolled a loop.
Misc fixes. svn-id: r34604
This commit is contained in:
parent
81715eae04
commit
c7e07102b6
3 changed files with 17 additions and 11 deletions
|
@ -372,16 +372,27 @@ applyScreenShading(GUI::Theme::ShadingStyle shadingStyle) {
|
||||||
uint8 r, g, b;
|
uint8 r, g, b;
|
||||||
uint lum;
|
uint lum;
|
||||||
|
|
||||||
uint32 shiftMask = (uint32)(
|
const uint32 shiftMask = (uint32)~(
|
||||||
(1 << PixelFormat::kGreenShift) |
|
(1 << PixelFormat::kGreenShift) |
|
||||||
(1 << PixelFormat::kRedShift) |
|
(1 << PixelFormat::kRedShift) |
|
||||||
(1 << PixelFormat::kBlueShift));
|
(1 << PixelFormat::kBlueShift)) >> 1;
|
||||||
|
|
||||||
shiftMask = (~shiftMask) >> 1;
|
|
||||||
|
|
||||||
if (shadingStyle == GUI::Theme::kShadingDim) {
|
if (shadingStyle == GUI::Theme::kShadingDim) {
|
||||||
while (pixels--)
|
|
||||||
*ptr++ = (*ptr >> 1) & shiftMask;
|
int n = (pixels + 7) >> 3;
|
||||||
|
switch (pixels % 8) {
|
||||||
|
case 0: do {
|
||||||
|
*ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 7: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 6: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 5: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 4: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 3: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 2: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
case 1: *ptr++ = (*ptr >> 1) & shiftMask;
|
||||||
|
} while (--n > 0);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (shadingStyle == GUI::Theme::kShadingLuminance) {
|
} else if (shadingStyle == GUI::Theme::kShadingLuminance) {
|
||||||
while (pixels--) {
|
while (pixels--) {
|
||||||
colorToRGB<PixelFormat>(*ptr, r, g, b);
|
colorToRGB<PixelFormat>(*ptr, r, g, b);
|
||||||
|
|
|
@ -462,8 +462,6 @@ bool ThemeEngine::addDrawData(const Common::String &data, bool cached) {
|
||||||
bool ThemeEngine::loadTheme(Common::String fileName) {
|
bool ThemeEngine::loadTheme(Common::String fileName) {
|
||||||
unloadTheme();
|
unloadTheme();
|
||||||
|
|
||||||
warning("Loading theme: %s.\n", fileName.c_str());
|
|
||||||
|
|
||||||
if (fileName != "builtin") {
|
if (fileName != "builtin") {
|
||||||
if (fileName.hasSuffix(".zip"))
|
if (fileName.hasSuffix(".zip"))
|
||||||
ImageMan.addArchive(fileName);
|
ImageMan.addArchive(fileName);
|
||||||
|
|
|
@ -92,9 +92,6 @@ NewGui::NewGui() : _redrawStatus(kRedrawDisabled),
|
||||||
if (themefile.compareToIgnoreCase("default") == 0)
|
if (themefile.compareToIgnoreCase("default") == 0)
|
||||||
themefile = "builtin";
|
themefile = "builtin";
|
||||||
|
|
||||||
// if (themefile != "builtin" && !themefile.hasSuffix(".zip"))
|
|
||||||
// themefile += ".zip";
|
|
||||||
|
|
||||||
ConfMan.registerDefault("gui_renderer", 2);
|
ConfMan.registerDefault("gui_renderer", 2);
|
||||||
ThemeEngine::GraphicsMode gfxMode = (ThemeEngine::GraphicsMode)ConfMan.getInt("gui_renderer");
|
ThemeEngine::GraphicsMode gfxMode = (ThemeEngine::GraphicsMode)ConfMan.getInt("gui_renderer");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue