[Scummvm-cvs-logs] SF.net SVN: scummvm: [25505] scummvm/trunk/engines/agos
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Mon Feb 12 04:59:29 CET 2007
Revision: 25505
http://scummvm.svn.sourceforge.net/scummvm/?rev=25505&view=rev
Author: kirben
Date: 2007-02-11 19:59:29 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
Pass VC10_state directly to convertclip, to reduce arguments.
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.h
scummvm/trunk/engines/agos/res_ami.cpp
scummvm/trunk/engines/agos/vga.cpp
Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h 2007-02-12 01:07:27 UTC (rev 25504)
+++ scummvm/trunk/engines/agos/agos.h 2007-02-12 03:59:29 UTC (rev 25505)
@@ -1337,7 +1337,7 @@
byte *getBackGround();
byte *getScaleBuf();
- byte *convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags);
+ byte *convertclip(VC10_state *state, byte flags);
bool decrunchFile(byte *src, byte *dst, uint32 size);
void loadVGABeardFile(uint id);
Modified: scummvm/trunk/engines/agos/res_ami.cpp
===================================================================
--- scummvm/trunk/engines/agos/res_ami.cpp 2007-02-12 01:07:27 UTC (rev 25504)
+++ scummvm/trunk/engines/agos/res_ami.cpp 2007-02-12 03:59:29 UTC (rev 25505)
@@ -115,10 +115,20 @@
}
}
-byte *AGOSEngine::convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags) {
+byte *AGOSEngine::convertclip(VC10_state *state, byte flags) {
int length, i, j;
- uint8 colorDepth = is32Colors ? 5 : 4;
+ uint8 colorDepth = 4;
+ if (getGameType() == GType_SIMON1) {
+ if (((_lockWord & 0x20) && !state->palette) || (getFeatures() & GF_32COLOR)) {
+ colorDepth = 5;
+ }
+ }
+
+ const byte *src = state->depack_src;
+ int width = state->width * 16;
+ int height = state->height;
+
free(_planarBuf);
_planarBuf = (byte *)malloc(width * height);
byte *dst = _planarBuf;
@@ -129,7 +139,7 @@
length = (width + 15) / 16 * height;
for (i = 0; i < length; i++) {
uint16 w[kMaxColorDepth];
- if (getGameType() == GType_SIMON1 && !is32Colors) {
+ if (getGameType() == GType_SIMON1 && colorDepth == 4) {
for (j = 0; j < colorDepth; ++j) {
w[j] = READ_BE_UINT16(src + j * length * 2);
}
Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp 2007-02-12 01:07:27 UTC (rev 25504)
+++ scummvm/trunk/engines/agos/vga.cpp 2007-02-12 03:59:29 UTC (rev 25505)
@@ -630,17 +630,17 @@
if (_dumpImages)
dumpSingleBitmap(_vgaCurZoneNum, state.image, state.depack_src, width, height,
state.palette);
- if (getFeatures() & GF_PLANAR) {
- bool is32Colors = false;
- if (getGameType() == GType_SIMON1) {
- if (((_lockWord & 0x20) && !state.palette) || state.palette == 0xC0 ||
- (getFeatures() & GF_32COLOR)) {
- is32Colors = true;
- }
- }
+ state.width = state.draw_width = width; /* cl */
+ state.height = state.draw_height = height; /* ch */
- state.depack_src = convertclip(state.depack_src, is32Colors, height, width * 16, flags);
+ state.depack_cont = -0x80;
+ state.x_skip = 0; /* colums to skip = bh */
+ state.y_skip = 0; /* rows to skip = bl */
+
+ if (getFeatures() & GF_PLANAR) {
+ state.depack_src = convertclip(&state, flags);
+
// converted planar clip is already uncompressed
if (state.flags & kDFCompressedFlip) {
state.flags &= ~kDFCompressedFlip;
@@ -664,14 +664,6 @@
}
}
- state.width = state.draw_width = width; /* cl */
- state.height = state.draw_height = height; /* ch */
-
- state.depack_cont = -0x80;
-
- state.x_skip = 0; /* colums to skip = bh */
- state.y_skip = 0; /* rows to skip = bl */
-
uint maxWidth = (getGameType() == GType_FF || getGameType() == GType_PP) ? 640 : 20;
if ((getGameType() == GType_SIMON2 || getGameType() == GType_FF) && width > maxWidth) {
horizontalScroll(&state);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list