mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 05:34:27 +00:00
SCI: created isAmiga32color(), using this method instead of comparing against viewType
svn-id: r47554
This commit is contained in:
parent
e7e0810c9c
commit
5fa0718356
@ -176,7 +176,7 @@ int16 SciGui::priorityToCoordinate(int16 priority) {
|
||||
reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
|
||||
Window *wnd = NULL;
|
||||
|
||||
if (_s->resMan->getViewType() == kViewAmiga) {
|
||||
if (_s->resMan->isAmiga32color()) {
|
||||
colorPen = _palette->mapAmigaColor(colorPen);
|
||||
colorBack = _palette->mapAmigaColor(colorBack);
|
||||
}
|
||||
@ -237,14 +237,14 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
|
||||
break;
|
||||
case SCI_DISPLAY_SETPENCOLOR:
|
||||
colorPen = argv[0].toUint16();
|
||||
if (_s->resMan->getViewType() == kViewAmiga)
|
||||
if (_s->resMan->isAmiga32color())
|
||||
colorPen = _palette->mapAmigaColor(colorPen);
|
||||
_gfx->PenColor(colorPen);
|
||||
argc--; argv++;
|
||||
break;
|
||||
case SCI_DISPLAY_SETBACKGROUNDCOLOR:
|
||||
colorBack = argv[0].toUint16();
|
||||
if (_s->resMan->getViewType() == kViewAmiga)
|
||||
if (_s->resMan->isAmiga32color())
|
||||
colorBack = _palette->mapAmigaColor(colorBack);
|
||||
argc--; argv++;
|
||||
break;
|
||||
@ -324,7 +324,7 @@ void SciGui::textColors(int argc, reg_t *argv) {
|
||||
void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
|
||||
Port *oldPort = _gfx->SetPort(_gfx->_menuPort);
|
||||
|
||||
if (_s->resMan->getViewType() == kViewAmiga) {
|
||||
if (_s->resMan->isAmiga32color()) {
|
||||
colorPen = _palette->mapAmigaColor(colorPen);
|
||||
colorBack = _palette->mapAmigaColor(colorBack);
|
||||
}
|
||||
@ -506,14 +506,14 @@ void SciGui::graphFillBoxBackground(Common::Rect rect) {
|
||||
}
|
||||
|
||||
void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
|
||||
if (_s->resMan->getViewType() == kViewAmiga)
|
||||
if (_s->resMan->isAmiga32color())
|
||||
color = _palette->mapAmigaColor(color);
|
||||
_gfx->FillRect(rect, colorMask, color, priority, control);
|
||||
}
|
||||
|
||||
void SciGui::graphFrameBox(Common::Rect rect, int16 color) {
|
||||
int16 oldColor = _gfx->GetPort()->penClr;
|
||||
if (_s->resMan->getViewType() == kViewAmiga)
|
||||
if (_s->resMan->isAmiga32color())
|
||||
color = _palette->mapAmigaColor(color);
|
||||
_gfx->PenColor(color);
|
||||
_gfx->FrameRect(rect);
|
||||
@ -521,7 +521,7 @@ void SciGui::graphFrameBox(Common::Rect rect, int16 color) {
|
||||
}
|
||||
|
||||
void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
|
||||
if (_s->resMan->getViewType() == kViewAmiga)
|
||||
if (_s->resMan->isAmiga32color())
|
||||
color = _palette->mapAmigaColor(color);
|
||||
_gfx->OffsetLine(startPoint, endPoint);
|
||||
_screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
|
||||
|
@ -58,7 +58,7 @@ SciPalette::SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPale
|
||||
if (autoSetPalette) {
|
||||
if (_resMan->getViewType() == kViewEga)
|
||||
setEGA();
|
||||
else if (_resMan->getViewType() == kViewAmiga)
|
||||
else if (_resMan->isAmiga32color())
|
||||
setAmiga();
|
||||
else
|
||||
setFromResource(999, 2);
|
||||
@ -311,7 +311,7 @@ void SciPalette::setOnScreen() {
|
||||
// if (pal != &_sysPalette)
|
||||
// memcpy(&_sysPalette,pal,sizeof(Palette));
|
||||
// We dont change palette at all times for amiga
|
||||
if (_resMan->getViewType() == kViewAmiga)
|
||||
if (_resMan->isAmiga32color())
|
||||
return;
|
||||
_screen->setPalette(&_sysPalette);
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
|
||||
}
|
||||
break;
|
||||
case PIC_OPX_VGA_SET_PALETTE:
|
||||
if (_resMan->getViewType() == kViewAmiga) {
|
||||
if (_resMan->isAmiga32color()) {
|
||||
if ((data[curPos] == 0x00) && (data[curPos + 1] == 0x01) && ((data[curPos + 32] & 0xF0) != 0xF0)) {
|
||||
// Left-Over VGA palette, we simply ignore it
|
||||
curPos += 256 + 4 + 768;
|
||||
|
@ -58,9 +58,8 @@ Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaled
|
||||
_picNotValidSci11 = 0;
|
||||
_unditherState = true;
|
||||
|
||||
if (_resMan->isVGA() || (_resMan->getViewType() == kViewAmiga)) {
|
||||
// It's not 100% accurate to set white to be 255 for amiga games
|
||||
// The problem is: there are 16-color and 32-color amiga games, so we would need to jump around
|
||||
if (_resMan->isVGA() || (_resMan->isAmiga32color())) {
|
||||
// It's not 100% accurate to set white to be 255 for amiga 32-color games
|
||||
// 255 is defined as white in our sci at all times, so it doesnt matter
|
||||
_colorWhite = 255;
|
||||
if (getSciVersion() >= SCI_VERSION_1_1)
|
||||
|
@ -307,7 +307,7 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount)
|
||||
|
||||
rlePtr = _resourceData + celInfo->offsetRLE;
|
||||
if (!celInfo->offsetLiteral) { // no additional literal data
|
||||
if (_resMan->getViewType() == kViewAmiga) {
|
||||
if (_resMan->isAmiga32color()) {
|
||||
// decompression for amiga views
|
||||
while (pixelNo < pixelCount) {
|
||||
pixel = *rlePtr++;
|
||||
|
@ -271,6 +271,7 @@ public:
|
||||
|
||||
void setAudioLanguage(int language);
|
||||
bool isVGA() const { return (_viewType == kViewVga) || (_viewType == kViewVga11); }
|
||||
bool isAmiga32color() const { return _viewType == kViewAmiga; }
|
||||
ViewType getViewType() const { return _viewType; }
|
||||
const char *getMapVersionDesc() const { return versionDescription(_mapVersion); }
|
||||
const char *getVolVersionDesc() const { return versionDescription(_volVersion); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user