Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: scummvm/scummvm
Choose a Base Repository
scummvm/scummvm
0xf1sh/scummvm
AlbanBedel/scummvm
Alphard-o/scummvm
AndywinXp/scummvm
BLooperZ/scummvm
BenCastricum/scummvm
CatalystG/scummvm
CeRiAl/scummvm
Coworker/scummvm
Cpasjuste/scummvm
Cruel/scummvm
Deledrius/scummvm
DrItanium/scummvm
DrMcCoy/scummvm
Drenn1/scummvm
Fyre91/scummvm
GNUtoo/scummvm
Henne/scummvm
Joefish/scummvm
JoshTheAggie/scummvm
LubomirR/scummvm
Lybr4/scummvm
MaddTheSane/scummvm
Marisa-Chan/scummvm
MestreLion/scummvm
MrHuu/scummvm-3ds
Nitrus/scummvm
OmerMor/scummvm
Prilkop/scummvm-pink
PyrokinesisStudio/scummvm
RichieSams/scummvm
Risca/scummvm
ShaunOfTheLive/scummvm
SimSaw/scummvm
St0rmcrow/scummvm
Strangerke/scummvm
SupSuper/scummvm
Tea23/scummvm
Templier/scummvm
Termimad/scummvm
Tkachov/scummvm
TomFrost/scummvm
VonBluebaugh/scummvm
WayneRSH/scummvm
YakBizzarro/scummvm
ZsKokos/scummvm
adventuregamestudio/scummvm
ajax16384/scummvm
albrechtf/scummvm
alcherk/scummvm
alexbevi/scummvm
angjerden/scummvm-opensky
anguslees/scummvm
antoniou79/scummvm
athrxx/scummvm
bSr43/scummvm
beholdnec/scummvm-funhouse
berenm/scummvm
bgK/scummvm
bluddy/scummvm
bluegr/scummvm
byunsangho/scummvm
chkr-private/scummvm
chrilith/scummvm
chrisws/scummvm
clone2727/scummvm
craigsc/scummvm-rg350
crazyp/scummvm
criezy/scummvm
danzat/scummvm
dhewg/scummvm
digitall/scummvm
dividedmind/scummvm
djwillis/scummvm
dmgamm/scummvm
dreammaster/scummvm
dyllad/scummvm
edheldil/scummvm
enginmanap/scummvm
eriktorbjorn/scummvm
fivearrows/scummvm
fuzzie/scummvm
gbraad/scummvm
geunyul/scummvm
gitter-badger/scummvm
giucam/scummvm
goldmojo/scummvm-rg350
goops17/scummvm
grayfoxier/scummvm
hchen1014/scummvm
heather162/scummvm
hooby3dfx/scummvm
hoteacristi/scummvm
idimiter/scummvm
infernuslord/scummvm
inisider/scummvm
jakimushka/scummvm
jammm/scummvm
jasonschroeder/scummvm
javisar/scummvm
jbanes/scummvm
jcwilk/scummvm
jenshnielsen/scummvm
jhhoward/scummvm
jiskattema/scummvm
jmglogow/scummvm
jnourry/scummvm
johndoe123/scummvm
johndrinkwater/scummvm-steamlink
juj/emscripten-scummvm
jvprat/scummvm
jweinberg/scummvm
kelmer44/scummvm
khbecker/scummvm
kintera/scummvm
klusark/scummvm
kpeatt/emscripten-scummvm
krawler602/scummvm
libretro/scummvm
lordhoto/scummvm
lukecharman/scummvm
madmoose/scummvm
mauimauer/scummvm
mborjesson/scummvm
mcb30/scummvm
mcgamez88/scummvm
mcnicholls/scummvm
megaboy/scummvm
michailBs/scummvm
midstream/scummvm
miguelgonz/scummvm
mikeconley/emscripten-scummvm
mikicompany/scummvm
mokerjoke/scummvm
monnerat/scummvm
monocodus-demonstrations/scummvm
murgo/scummvm
mynameisfashanu/scummvm
nakioman/scummvm
nexapps/scummvm
nikitin23/scummvm
norbertbajko/scummvm
nukeykt/scummvm
onlyjob/scummvm
peres/scummvm
phoenixtail26/scummvm
qwzybug/scummvm
rasky/scummvm
rayzer86/scummvm
remmythical/emscripten-scummvm
ress/scummvm
rkmarvin/scummvm
robertmegone/scummvm
rofl0r/scummvm
rolph-recto/scummvm
roman5566/scummvm
rsn8887/scummvm
rundfunk47/scummvm
sact/scummvm
salty-horse/scummvm
sathieu/scummvm
saucjedi/scummvm
scott-t/scummvm
scummvm-director/scummvm
seriesParallel/scummvm
sev-/scummvm
singron/scummvm
sirlemonhead/scummvm
skristiansson/scummvm
somaen/scummvm
ssilverm/scummvm
stevenhoefel/scummvm
superg/scummvm
swkim01/scummvm-kor
tafuri/scummvm
tcarey/scummvm-1
timofonic/scummvm
tiqpit/scummvm
tobiatesan/scummvm
tobigun/scummvm
tommimi/scummvm
tsoliman/scummvm
ttcremers/scummvm
upthorn/scummvm
vanfanel/scummvm
vcosta/scummvm
vinterstum/scummvm
vladborovtsov/scummvm
vyadh/scummvm
weakdancer/scummvm
whiterandrek/scummvm
widar/scummvm
wjp/scummvm
xesf/scummvm-asylum
yaz0r/scummvm
yinsimei/scummvm
zach-morris/scummvm
zekizeki2010/scummvm
zeldin/scummvm
Nothing to show
base: 9948d3ca16ce
head repository: scummvm/scummvm
Choose a Head Repository
scummvm/scummvm
0xf1sh/scummvm
AlbanBedel/scummvm
Alphard-o/scummvm
AndywinXp/scummvm
BLooperZ/scummvm
BenCastricum/scummvm
CatalystG/scummvm
CeRiAl/scummvm
Coworker/scummvm
Cpasjuste/scummvm
Cruel/scummvm
Deledrius/scummvm
DrItanium/scummvm
DrMcCoy/scummvm
Drenn1/scummvm
Fyre91/scummvm
GNUtoo/scummvm
Henne/scummvm
Joefish/scummvm
JoshTheAggie/scummvm
LubomirR/scummvm
Lybr4/scummvm
MaddTheSane/scummvm
Marisa-Chan/scummvm
MestreLion/scummvm
MrHuu/scummvm-3ds
Nitrus/scummvm
OmerMor/scummvm
Prilkop/scummvm-pink
PyrokinesisStudio/scummvm
RichieSams/scummvm
Risca/scummvm
ShaunOfTheLive/scummvm
SimSaw/scummvm
St0rmcrow/scummvm
Strangerke/scummvm
SupSuper/scummvm
Tea23/scummvm
Templier/scummvm
Termimad/scummvm
Tkachov/scummvm
TomFrost/scummvm
VonBluebaugh/scummvm
WayneRSH/scummvm
YakBizzarro/scummvm
ZsKokos/scummvm
adventuregamestudio/scummvm
ajax16384/scummvm
albrechtf/scummvm
alcherk/scummvm
alexbevi/scummvm
angjerden/scummvm-opensky
anguslees/scummvm
antoniou79/scummvm
athrxx/scummvm
bSr43/scummvm
beholdnec/scummvm-funhouse
berenm/scummvm
bgK/scummvm
bluddy/scummvm
bluegr/scummvm
byunsangho/scummvm
chkr-private/scummvm
chrilith/scummvm
chrisws/scummvm
clone2727/scummvm
craigsc/scummvm-rg350
crazyp/scummvm
criezy/scummvm
danzat/scummvm
dhewg/scummvm
digitall/scummvm
dividedmind/scummvm
djwillis/scummvm
dmgamm/scummvm
dreammaster/scummvm
dyllad/scummvm
edheldil/scummvm
enginmanap/scummvm
eriktorbjorn/scummvm
fivearrows/scummvm
fuzzie/scummvm
gbraad/scummvm
geunyul/scummvm
gitter-badger/scummvm
giucam/scummvm
goldmojo/scummvm-rg350
goops17/scummvm
grayfoxier/scummvm
hchen1014/scummvm
heather162/scummvm
hooby3dfx/scummvm
hoteacristi/scummvm
idimiter/scummvm
infernuslord/scummvm
inisider/scummvm
jakimushka/scummvm
jammm/scummvm
jasonschroeder/scummvm
javisar/scummvm
jbanes/scummvm
jcwilk/scummvm
jenshnielsen/scummvm
jhhoward/scummvm
jiskattema/scummvm
jmglogow/scummvm
jnourry/scummvm
johndoe123/scummvm
johndrinkwater/scummvm-steamlink
juj/emscripten-scummvm
jvprat/scummvm
jweinberg/scummvm
kelmer44/scummvm
khbecker/scummvm
kintera/scummvm
klusark/scummvm
kpeatt/emscripten-scummvm
krawler602/scummvm
libretro/scummvm
lordhoto/scummvm
lukecharman/scummvm
madmoose/scummvm
mauimauer/scummvm
mborjesson/scummvm
mcb30/scummvm
mcgamez88/scummvm
mcnicholls/scummvm
megaboy/scummvm
michailBs/scummvm
midstream/scummvm
miguelgonz/scummvm
mikeconley/emscripten-scummvm
mikicompany/scummvm
mokerjoke/scummvm
monnerat/scummvm
monocodus-demonstrations/scummvm
murgo/scummvm
mynameisfashanu/scummvm
nakioman/scummvm
nexapps/scummvm
nikitin23/scummvm
norbertbajko/scummvm
nukeykt/scummvm
onlyjob/scummvm
peres/scummvm
phoenixtail26/scummvm
qwzybug/scummvm
rasky/scummvm
rayzer86/scummvm
remmythical/emscripten-scummvm
ress/scummvm
rkmarvin/scummvm
robertmegone/scummvm
rofl0r/scummvm
rolph-recto/scummvm
roman5566/scummvm
rsn8887/scummvm
rundfunk47/scummvm
sact/scummvm
salty-horse/scummvm
sathieu/scummvm
saucjedi/scummvm
scott-t/scummvm
scummvm-director/scummvm
seriesParallel/scummvm
sev-/scummvm
singron/scummvm
sirlemonhead/scummvm
skristiansson/scummvm
somaen/scummvm
ssilverm/scummvm
stevenhoefel/scummvm
superg/scummvm
swkim01/scummvm-kor
tafuri/scummvm
tcarey/scummvm-1
timofonic/scummvm
tiqpit/scummvm
tobiatesan/scummvm
tobigun/scummvm
tommimi/scummvm
tsoliman/scummvm
ttcremers/scummvm
upthorn/scummvm
vanfanel/scummvm
vcosta/scummvm
vinterstum/scummvm
vladborovtsov/scummvm
vyadh/scummvm
weakdancer/scummvm
whiterandrek/scummvm
widar/scummvm
wjp/scummvm
xesf/scummvm-asylum
yaz0r/scummvm
yinsimei/scummvm
zach-morris/scummvm
zekizeki2010/scummvm
zeldin/scummvm
Nothing to show
compare: 702adaf9f807
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
@@ -36,35 +36,6 @@ ZorkCursor::ZorkCursor()
_hotspotY(0) {
}

ZorkCursor::ZorkCursor(const Common::String &fileName)
: _width(0),
_height(0),
_hotspotX(0),
_hotspotY(0) {
Common::File file;
if (!file.open(fileName))
return;

uint32 magic = file.readUint32BE();
if (magic != MKTAG('Z', 'C', 'R', '1')) {
warning("%s is not a Zork Cursor file", fileName.c_str());
return;
}

_hotspotX = file.readUint16LE();
_hotspotY = file.readUint16LE();
_width = file.readUint16LE();
_height = file.readUint16LE();

uint dataSize = _width * _height * sizeof(uint16);
_surface.create(_width, _height, Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
uint32 bytesRead = file.read(_surface.getPixels(), dataSize);
assert(bytesRead == dataSize);

// Convert to RGB 565
_surface.convertToInPlace(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
}

ZorkCursor::ZorkCursor(ZVision *engine, const Common::String &fileName)
: _width(0),
_height(0),
@@ -39,7 +39,6 @@ namespace ZVision {
class ZorkCursor {
public:
ZorkCursor();
ZorkCursor(const Common::String &fileName);
ZorkCursor(ZVision *engine, const Common::String &fileName);
ZorkCursor(const ZorkCursor &other);
~ZorkCursor();
@@ -162,97 +162,8 @@ void RenderManager::renderImageToBackground(const Common::String &fileName, int1
}

void RenderManager::readImageToSurface(const Common::String &fileName, Graphics::Surface &destination) {
Common::File file;

if (!_engine->getSearchManager()->openFile(file, fileName)) {
warning("Could not open file %s", fileName.c_str());
return;
}

// Read the magic number
// Some files are true TGA, while others are TGZ
uint32 fileType = file.readUint32BE();

uint32 imageWidth;
uint32 imageHeight;
Image::TGADecoder tga;
uint16 *buffer;
bool isTransposed = _renderTable.getRenderState() == RenderTable::PANORAMA;
// All ZVision images are in RGB 555
Graphics::PixelFormat pixelFormat555 = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
destination.format = pixelFormat555;

bool isTGZ;

// Check for TGZ files
if (fileType == MKTAG('T', 'G', 'Z', '\0')) {
isTGZ = true;

// TGZ files have a header and then Bitmap data that is compressed with LZSS
uint32 decompressedSize = file.readSint32LE();
imageWidth = file.readSint32LE();
imageHeight = file.readSint32LE();

LzssReadStream lzssStream(&file);
buffer = (uint16 *)(new uint16[decompressedSize]);
lzssStream.read(buffer, decompressedSize);
} else {
isTGZ = false;

// Reset the cursor
file.seek(0);

// Decode
if (!tga.loadStream(file)) {
warning("Error while reading TGA image");
return;
}

Graphics::Surface tgaSurface = *(tga.getSurface());
imageWidth = tgaSurface.w;
imageHeight = tgaSurface.h;

buffer = (uint16 *)tgaSurface.getPixels();
}

// Flip the width and height if transposed
if (isTransposed) {
uint16 temp = imageHeight;
imageHeight = imageWidth;
imageWidth = temp;
}

// If the destination internal buffer is the same size as what we're copying into it,
// there is no need to free() and re-create
if (imageWidth != destination.w || imageHeight != destination.h) {
destination.create(imageWidth, imageHeight, pixelFormat555);
}

// If transposed, 'un-transpose' the data while copying it to the destination
// Otherwise, just do a simple copy
if (isTransposed) {
uint16 *dest = (uint16 *)destination.getPixels();

for (uint32 y = 0; y < imageHeight; ++y) {
uint32 columnIndex = y * imageWidth;

for (uint32 x = 0; x < imageWidth; ++x) {
dest[columnIndex + x] = buffer[x * imageHeight + y];
}
}
} else {
memcpy(destination.getPixels(), buffer, imageWidth * imageHeight * _pixelFormat.bytesPerPixel);
}

// Cleanup
if (isTGZ) {
delete[] buffer;
} else {
tga.destroy();
}

// Convert in place to RGB 565 from RGB 555
destination.convertToInPlace(_pixelFormat);
readImageToSurface(fileName, destination, isTransposed);
}

void RenderManager::readImageToSurface(const Common::String &fileName, Graphics::Surface &destination, bool transposed) {

No commit comments for this range

You can’t perform that action at this time.