Tons of misc. GFX fixes.

svn-id: r33911
This commit is contained in:
Vicent Marti 2008-08-15 19:10:37 +00:00
parent 9ae82653ef
commit 7c213ab110
16 changed files with 91 additions and 31 deletions

View file

@ -951,6 +951,9 @@ void SubtitleSettingsDialog::cycleValue() {
if (_value > 2) if (_value > 2)
_value = 0; _value = 0;
if (_value == 1 && g_system->getOverlayWidth() <= 320)
setInfoText("Speech & Subs");
else
setInfoText(subtitleDesc[_value]); setInfoText(subtitleDesc[_value]);
_timer = getMillis() + 1500; _timer = getMillis() + 1500;

View file

@ -370,15 +370,21 @@ drawLine(int x1, int y1, int x2, int y2) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1); PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
int pitch = Base::surfacePitch(); int pitch = Base::surfacePitch();
int st = Base::_strokeWidth >> 1;
if (dy == 0) { // horizontal lines if (dy == 0) { // horizontal lines
// these can be filled really fast with a single memset. // these can be filled really fast with a single memset.
colorFill(ptr, ptr + dx + 1, (PixelType)_fgColor); colorFill(ptr, ptr + dx + 1, (PixelType)_fgColor);
for (int i = 0, p = pitch; i < st; ++i, p += pitch) {
colorFill(ptr + p, ptr + dx + 1 + p, (PixelType)_fgColor);
colorFill(ptr - p, ptr + dx + 1 - p, (PixelType)_fgColor);
}
} else if (dx == 0) { // vertical lines } else if (dx == 0) { // vertical lines
// these ones use a static pitch increase. // these ones use a static pitch increase.
while (y1++ <= y2) { while (y1++ <= y2) {
*ptr = (PixelType)_fgColor; colorFill(ptr - st, ptr + st, (PixelType)_fgColor);
ptr += pitch; ptr += pitch;
} }
@ -387,7 +393,7 @@ drawLine(int x1, int y1, int x2, int y2) {
pitch += (x2 > x1) ? 1 : -1; pitch += (x2 > x1) ? 1 : -1;
while (dy--) { while (dy--) {
*ptr = (PixelType)_fgColor; colorFill(ptr - st, ptr + st, (PixelType)_fgColor);
ptr += pitch; ptr += pitch;
} }

View file

@ -212,6 +212,15 @@ public:
*/ */
virtual void drawTab(int x, int y, int r, int w, int h) = 0; virtual void drawTab(int x, int y, int r, int w, int h) = 0;
/**
* Simple helper function to draw a cross.
*/
virtual void drawCross(int x, int y, int w, int h) {
drawLine(x, y, x + w, y + w);
drawLine(x + w, y, x, y + h);
}
/** /**
* Gets the pixel pitch for the current drawing surface. * Gets the pixel pitch for the current drawing surface.
* Note: This is a real pixel-pitch, not a byte-pitch. * Note: This is a real pixel-pitch, not a byte-pitch.
@ -420,6 +429,12 @@ public:
blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, x + w, y + h)); blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, x + w, y + h));
} }
void drawCallback_CROSS(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
drawCross(x, y, w, h);
}
void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {} void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {}
/** /**

View file

@ -52,6 +52,7 @@ ThemeParser::ThemeParser(ThemeRenderer *parent) : XMLParser() {
_drawFunctions["tab"] = &Graphics::VectorRenderer::drawCallback_TAB; _drawFunctions["tab"] = &Graphics::VectorRenderer::drawCallback_TAB;
_drawFunctions["void"] = &Graphics::VectorRenderer::drawCallback_VOID; _drawFunctions["void"] = &Graphics::VectorRenderer::drawCallback_VOID;
_drawFunctions["bitmap"] = &Graphics::VectorRenderer::drawCallback_BITMAP; _drawFunctions["bitmap"] = &Graphics::VectorRenderer::drawCallback_BITMAP;
_drawFunctions["cross"] = &Graphics::VectorRenderer::drawCallback_CROSS;
_defaultStepGlobal = defaultDrawStep(); _defaultStepGlobal = defaultDrawStep();
_defaultStepLocal = 0; _defaultStepLocal = 0;

View file

@ -29,6 +29,7 @@
#include "common/system.h" #include "common/system.h"
#include "common/events.h" #include "common/events.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#include "common/fs.h"
#include "graphics/imageman.h" #include "graphics/imageman.h"
#include "graphics/cursorman.h" #include "graphics/cursorman.h"
#include "gui/launcher.h" #include "gui/launcher.h"
@ -461,7 +462,7 @@ bool ThemeRenderer::loadThemeXML(Common::String themeName) {
if (parser()->loadStream(stream) == false || parser()->parse() == false) { if (parser()->loadStream(stream) == false || parser()->parse() == false) {
warning("Failed to load stream for zipped file '%s'", fileNameBuffer); warning("Failed to load stream for zipped file '%s'", fileNameBuffer);
unzClose(zipFile); unzClose(zipFile);
delete stream; // delete stream;
return false; return false;
} }
} }
@ -474,6 +475,9 @@ bool ThemeRenderer::loadThemeXML(Common::String themeName) {
} }
} }
// FilesystemNode dir(themeName);
// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
unzClose(zipFile); unzClose(zipFile);
return (parseCount > 0 && _themeName.empty() == false); return (parseCount > 0 && _themeName.empty() == false);
#else #else
@ -705,6 +709,9 @@ void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int slider
r2.right -= 1; r2.right -= 1;
r2.top += sliderY; r2.top += sliderY;
r2.bottom = r2.top + sliderHeight - 1; r2.bottom = r2.top + sliderHeight - 1;
r2.top += r.width() / 5;
r2.bottom -= r.width() / 5;
queueDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2); queueDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
} }

View file

@ -423,6 +423,7 @@ void NewGui::screenChange() {
// redrawn before redraw() has been called. // redrawn before redraw() has been called.
_redrawStatus = kRedrawFull; _redrawStatus = kRedrawFull;
redraw(); redraw();
_system->showOverlay();
_system->updateScreen(); _system->updateScreen();
} }

View file

@ -88,6 +88,12 @@ const char *OptionsDialog::_subModeDesc[] = {
"Subtitles Only" "Subtitles Only"
}; };
const char *OptionsDialog::_lowresSubModeDesc[] = {
"Speech Only",
"Speech & Subs",
"Subtitles Only"
};
void OptionsDialog::init() { void OptionsDialog::init() {
_enableGraphicSettings = false; _enableGraphicSettings = false;
_gfxPopUp = 0; _gfxPopUp = 0;
@ -417,7 +423,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
else else
_subMode = 0; _subMode = 0;
_subToggleButton->setLabel(_subModeDesc[_subMode]); _subToggleButton->setLabel(g_system->getOverlayWidth() > 320 ? _subModeDesc[_subMode] : _lowresSubModeDesc[_subMode]);
_subToggleButton->draw(); _subToggleButton->draw();
_subSpeedDesc->draw(); _subSpeedDesc->draw();
_subSpeedSlider->draw(); _subSpeedSlider->draw();

View file

@ -122,6 +122,7 @@ private:
ButtonWidget *_subToggleButton; ButtonWidget *_subToggleButton;
int _subMode; int _subMode;
static const char *_subModeDesc[]; static const char *_subModeDesc[];
static const char *_lowresSubModeDesc[];
StaticTextWidget *_subSpeedDesc; StaticTextWidget *_subSpeedDesc;
SliderWidget *_subSpeedSlider; SliderWidget *_subSpeedSlider;
StaticTextWidget *_subSpeedLabel; StaticTextWidget *_subSpeedLabel;

View file

@ -282,6 +282,11 @@
"bevel = '2' " "bevel = '2' "
"fill = 'none' " "fill = 'none' "
"/> " "/> "
"<drawstep func = 'cross' "
"fill = 'foreground' "
"stroke = '2' "
"fg_color = 'green' "
"/> "
"</drawdata> " "</drawdata> "
"<drawdata id = 'checkbox_default' cache = false> " "<drawdata id = 'checkbox_default' cache = false> "
"<text font = 'text_default' " "<text font = 'text_default' "

Binary file not shown.

View file

@ -338,7 +338,11 @@
bevel = '2' bevel = '2'
fill = 'none' fill = 'none'
/> />
/* TODO */ <drawstep func = 'cross'
fill = 'foreground'
stroke = '2'
fg_color = 'green'
/>
</drawdata> </drawdata>
<drawdata id = 'checkbox_default' cache = false> <drawdata id = 'checkbox_default' cache = false>

View file

@ -250,13 +250,13 @@
<widget name = 'mcFontButton' <widget name = 'mcFontButton'
type = 'Button' type = 'Button'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
<widget name = 'mcFontClearButton' <widget name = 'mcFontClearButton'
height = 'Globals.Line.Height' height = 'Globals.Line.Height'
width = 'Globals.Line.Height' width = 'Globals.Line.Height'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
</layout> </layout>
<widget name = 'mcMixedCheckbox' <widget name = 'mcMixedCheckbox'
type = 'Checkbox' type = 'Checkbox'

View file

@ -248,13 +248,13 @@
<widget name = 'mcFontButton' <widget name = 'mcFontButton'
type = 'Button' type = 'Button'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
<widget name = 'mcFontClearButton' <widget name = 'mcFontClearButton'
height = 'Globals.Line.Height' height = 'Globals.Line.Height'
width = 'Globals.Line.Height' width = 'Globals.Line.Height'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
</layout> </layout>
<widget name = 'mcMixedCheckbox' <widget name = 'mcMixedCheckbox'
type = 'Checkbox' type = 'Checkbox'

Binary file not shown.

View file

@ -26,22 +26,19 @@
<render_info> <render_info>
<palette> <palette>
<color name = 'darkred' <color name = 'darkred'
rgb = '168, 42, 12' rgb = '169, 42, 12'
/> />
<color name = 'brightred' <color name = 'brightred'
rgb = '200, 124, 104' rgb = '203, 126, 107'
/> />
<color name = 'xtrabrightred' <color name = 'xtrabrightred'
rgb = '251, 241, 206' rgb = '255, 210, 200'
/> />
<color name = 'blandyellow' <color name = 'blandyellow'
rgb = '247, 228, 166' rgb = '247, 228, 166'
/> />
<color name = 'bgreen' <color name = 'bgreen'
rgb = '96, 160, 8' rgb = '100, 162, 8'
/>
<color name = 'blue'
rgb = '0, 255, 255'
/> />
<color name = 'black' <color name = 'black'
rgb = '0, 0, 0' rgb = '0, 0, 0'
@ -232,7 +229,7 @@
<drawdata id = 'tab_background' cache = false> <drawdata id = 'tab_background' cache = false>
<drawstep func = 'tab' <drawstep func = 'tab'
radius = '8' radius = '6'
stroke = '0' stroke = '0'
fill = 'foreground' fill = 'foreground'
fg_color = '232, 180, 81' fg_color = '232, 180, 81'
@ -273,6 +270,17 @@
/> />
</drawdata> </drawdata>
<drawdata id = 'slider_disabled' cache = false>
<drawstep func = 'roundedsq'
stroke = 1
radius = 4
fill = 'gradient'
fg_color = '123, 112, 56'
gradient_start = 'xtrabrightred'
gradient_end = 'darkred'
/>
</drawdata>
<drawdata id = 'popup_idle' cache = false> <drawdata id = 'popup_idle' cache = false>
<drawstep func = 'roundedsq' <drawstep func = 'roundedsq'
stroke = 0 stroke = 0
@ -334,7 +342,7 @@
<drawdata id = 'plain_bg' cache = false> <drawdata id = 'plain_bg' cache = false>
<drawstep func = 'roundedsq' <drawstep func = 'roundedsq'
radius = 8 radius = 6
stroke = 0 stroke = 0
gradient_start = 'blandyellow' gradient_start = 'blandyellow'
gradient_end = 'xtrabrightred' gradient_end = 'xtrabrightred'
@ -366,7 +374,7 @@
horizontal_align = 'center' horizontal_align = 'center'
/> />
<drawstep func = 'roundedsq' <drawstep func = 'roundedsq'
radius = '6' radius = '3'
stroke = 1 stroke = 1
fill = 'gradient' fill = 'gradient'
shadow = 0 shadow = 0
@ -383,7 +391,7 @@
horizontal_align = 'center' horizontal_align = 'center'
/> />
<drawstep func = 'roundedsq' <drawstep func = 'roundedsq'
radius = '6' radius = '3'
gradient_factor = 1 gradient_factor = 1
stroke = 1 stroke = 1
fill = 'gradient' fill = 'gradient'
@ -402,11 +410,14 @@
horizontal_align = 'center' horizontal_align = 'center'
/> />
<drawstep func = 'roundedsq' <drawstep func = 'roundedsq'
radius = '8' radius = '3'
stroke = 0 stroke = 1
fill = 'foreground' fill = 'gradient'
fg_color = '200, 200, 200' shadow = 0
shadow = 3 fg_color = 'shadowcolor'
gradient_start = 'brightred'
gradient_end = 'darkred'
bevel = 1
/> />
</drawdata> </drawdata>

View file

@ -245,13 +245,13 @@
<widget name = 'mcFontButton' <widget name = 'mcFontButton'
type = 'Button' type = 'Button'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
<widget name = 'mcFontClearButton' <widget name = 'mcFontClearButton'
height = 'Globals.Line.Height' height = 'Globals.Line.Height'
width = 'Globals.Line.Height' width = 'Globals.Line.Height'
/> />
<widget name = 'mcFontPath'
height = 'Globals.Line.Height'
/>
</layout> </layout>
<widget name = 'mcMixedCheckbox' <widget name = 'mcMixedCheckbox'
type = 'Checkbox' type = 'Checkbox'