Merge remote-tracking branch 'origin/master' into tony
Conflicts: common/coroutines.cpp common/coroutines.h devtools/create_project/msbuild.cpp devtools/create_project/visualstudio.cpp
This commit is contained in:
commit
31801137b5
878 changed files with 55300 additions and 30742 deletions
16
AUTHORS
16
AUTHORS
|
@ -89,7 +89,9 @@ ScummVM Team
|
|||
DreamWeb:
|
||||
Torbjorn Andersson
|
||||
Bertrand Augereau
|
||||
Filippos Karapetis
|
||||
Vladimir Menshakov - (retired)
|
||||
Willem Jan Palenstijn
|
||||
|
||||
Gob:
|
||||
Torbjorn Andersson
|
||||
|
@ -406,6 +408,9 @@ Other contributions
|
|||
French:
|
||||
Thierry Crozat
|
||||
|
||||
Galician:
|
||||
Santiago G. Sanz
|
||||
|
||||
German:
|
||||
Simon Sawatzki
|
||||
Lothar Serra Mari
|
||||
|
@ -418,10 +423,10 @@ Other contributions
|
|||
Matteo Angelino
|
||||
|
||||
Norwegian (Bokmaal):
|
||||
Einar Johan T. Somaae
|
||||
Einar Johan Somaaen
|
||||
|
||||
Norwegian (Nynorsk):
|
||||
Einar Johan T. Somaae
|
||||
Einar Johan Somaaen
|
||||
|
||||
Polish:
|
||||
GrajPoPolsku.pl Team
|
||||
|
@ -597,3 +602,10 @@ Special thanks to
|
|||
Broken Sword 2.5 team for providing sources of their engine and their
|
||||
great support.
|
||||
|
||||
Neil Dodwell and David Dew from Creative Reality for providing the source
|
||||
of Dreamweb and for their tremendous support.
|
||||
|
||||
Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe
|
||||
Avalon for providing full source code for Soltys and letting us to
|
||||
redistribute the game.
|
||||
|
||||
|
|
41
NEWS
41
NEWS
|
@ -1,9 +1,28 @@
|
|||
For a more comprehensive changelog of the latest experimental code, see:
|
||||
https://github.com/scummvm/scummvm/commits/
|
||||
|
||||
1.5.0 (????-??-??)
|
||||
1.6.0 (????-??-??)
|
||||
General:
|
||||
- Added a new save/load chooser based on a grid of thumbnails. This is only
|
||||
supported for resolutions bigger than 640x400. The old chooser is still
|
||||
available and used for games without thumbnail support. It is possible to
|
||||
select the old one as default too.
|
||||
- Rewrote VideoDecoder subsystem.
|
||||
- Added Galician translation.
|
||||
|
||||
1.5.0 (2012-07-27)
|
||||
New Games:
|
||||
- Added support for Backyard Baseball 2003.
|
||||
- Added support for Blue Force.
|
||||
- Added support for Darby the Dragon.
|
||||
- Added support for Dreamweb.
|
||||
- Added support for Geisha.
|
||||
- Added support for Gregory and the Hot Air Balloon.
|
||||
- Added support for Magic Tales: Liam Finds a Story.
|
||||
- Added support for Once Upon A Time: Little Red Riding Hood
|
||||
- Added support for Sleeping Cub's Test of Courage.
|
||||
- Added support for Soltys.
|
||||
- Added support for The Princess and the Crab.
|
||||
|
||||
General:
|
||||
- Updated MT-32 emulation code to latest munt project snapshot. The emulation
|
||||
|
@ -17,13 +36,13 @@ For a more comprehensive changelog of the latest experimental code, see:
|
|||
Engine tab when adding or editing a configuration for a game. In most
|
||||
cases, you will have to run each game once or readd them all in ScummVM's
|
||||
launcher in order to get the custom options tab.
|
||||
|
||||
SDL ports:
|
||||
- Added support for OpenGL (GSoC Task).
|
||||
- Improved predictive dialog look.
|
||||
- Various GUI improvements.
|
||||
|
||||
Broken Sword 1:
|
||||
- Fixed incorrect sound effects in the DOS/Windows demo.
|
||||
- Added support for PlayStation videos.
|
||||
- Fixed missing subtitles in the demo.
|
||||
|
||||
Broken Sword 2:
|
||||
- Added support for PlayStation videos.
|
||||
|
@ -31,9 +50,19 @@ For a more comprehensive changelog of the latest experimental code, see:
|
|||
Cine:
|
||||
- Implemented Roland MT-32 output driver.
|
||||
|
||||
Drascula:
|
||||
- Added Spanish subtitles in the Von Braun cutscene (#3069981: no subtitles
|
||||
in scene with "von Braun").
|
||||
|
||||
Gob:
|
||||
- Fixed a crash in Lost in Time
|
||||
- Rewrote the AdLib player. Enabled the now working MDY player in
|
||||
Fascination and Geisha.
|
||||
|
||||
SCUMM:
|
||||
- Added support for the Macintosh version of SPY Fox in Hold the Mustard.
|
||||
- Added a difficulty selection dialog for Loom FM-TOWNS.
|
||||
- Fixed graphical glitches in HE98 version of Pajama Sam's Lost & Found.
|
||||
|
||||
iPhone port:
|
||||
- Changed "F5 (menu)" gesture to open up the global main menu instead.
|
||||
|
@ -42,6 +71,10 @@ For a more comprehensive changelog of the latest experimental code, see:
|
|||
- Added aspect ratio correction feature.
|
||||
- Implemented 16 bits per pixel support for games.
|
||||
|
||||
Maemo port:
|
||||
- Added support for Nokia 770 running OS2008 HE.
|
||||
- Added configurable keymap.
|
||||
|
||||
Windows port:
|
||||
- Changed default savegames location for Windows NT4/2000/XP/Vista/7.
|
||||
(The migration batch file can be used to copy savegames from the old
|
||||
|
|
11
README
11
README
|
@ -235,13 +235,18 @@ AGOS Games by Adventuresoft/Horrorsoft:
|
|||
The Feeble Files [feeble]
|
||||
|
||||
GOB Games by Coktel Vision:
|
||||
Bambou le sauveur de la jungle [bambou]
|
||||
Bargon Attack [bargon]
|
||||
Fascination [fascination]
|
||||
Geisha [geisha]
|
||||
Gobliiins [gob1]
|
||||
Gobliins 2 [gob2]
|
||||
Goblins 3 [gob3]
|
||||
Lost in Time [lostintime]
|
||||
Once Upon A Time: Little Red Riding Hood [littlered]
|
||||
The Bizarre Adventures of Woodruff
|
||||
and the Schnibble [woodruff]
|
||||
Urban Runner [urban]
|
||||
Ween: The Prophecy [ween]
|
||||
|
||||
MADE Games by Activision:
|
||||
|
@ -272,6 +277,7 @@ Other Games:
|
|||
SCUMM Games by Humongous Entertainment:
|
||||
Backyard Baseball [baseball]
|
||||
Backyard Baseball 2001 [baseball2001]
|
||||
Backyard Baseball 2003 [baseball2003]
|
||||
Backyard Football [football]
|
||||
Big Thinkers First Grade [thinker1]
|
||||
Big Thinkers Kindergarten [thinkerk]
|
||||
|
@ -342,7 +348,6 @@ these at your own risk, and please do not file bug reports about them.
|
|||
If you want the latest updates on game compatibility, visit our web site
|
||||
and view the compatibility chart.
|
||||
|
||||
Backyard Baseball 2003 [baseball2003]
|
||||
Backyard Football 2002 [football2002]
|
||||
Backyard Soccer [soccer]
|
||||
Backyard Soccer MLS [soccermls]
|
||||
|
@ -2079,7 +2084,7 @@ Sierra games using the SCI engine add the following non-standard keywords:
|
|||
originalsaveload bool If true, the original save/load screens are
|
||||
used instead of the enhanced ScummVM ones
|
||||
native_fb01 bool If true, the music driver for an IBM Music
|
||||
Feature card or a Yahama FB-01 FM synth module
|
||||
Feature card or a Yamaha FB-01 FM synth module
|
||||
is used for MIDI output
|
||||
|
||||
Broken Sword II adds the following non-standard keywords:
|
||||
|
@ -2120,7 +2125,7 @@ Lands of Lore: The Throne of Chaos adds the following non-standard keywords:
|
|||
Space Quest IV CD adds the following non-standard keyword:
|
||||
|
||||
silver_cursors bool If true, an alternate set of silver mouse cursors
|
||||
is used instead of the original golden ones
|
||||
is used instead of the original golden ones
|
||||
|
||||
Simon the Sorcerer 1 and 2 add the following non-standard keywords:
|
||||
|
||||
|
|
|
@ -386,4 +386,42 @@ Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo
|
|||
return Timestamp(result.secs(), result.numberOfFrames(), result.framerate());
|
||||
}
|
||||
|
||||
/**
|
||||
* An AudioStream wrapper that cuts off the amount of samples read after a
|
||||
* given time length is reached.
|
||||
*/
|
||||
class LimitingAudioStream : public AudioStream {
|
||||
public:
|
||||
LimitingAudioStream(AudioStream *parentStream, const Audio::Timestamp &length, DisposeAfterUse::Flag disposeAfterUse) :
|
||||
_parentStream(parentStream), _samplesRead(0), _disposeAfterUse(disposeAfterUse),
|
||||
_totalSamples(length.convertToFramerate(getRate()).totalNumberOfFrames() * getChannels()) {}
|
||||
|
||||
~LimitingAudioStream() {
|
||||
if (_disposeAfterUse == DisposeAfterUse::YES)
|
||||
delete _parentStream;
|
||||
}
|
||||
|
||||
int readBuffer(int16 *buffer, const int numSamples) {
|
||||
// Cap us off so we don't read past _totalSamples
|
||||
int samplesRead = _parentStream->readBuffer(buffer, MIN<int>(numSamples, _totalSamples - _samplesRead));
|
||||
_samplesRead += samplesRead;
|
||||
return samplesRead;
|
||||
}
|
||||
|
||||
bool endOfData() const { return _parentStream->endOfData() || _samplesRead >= _totalSamples; }
|
||||
bool isStereo() const { return _parentStream->isStereo(); }
|
||||
int getRate() const { return _parentStream->getRate(); }
|
||||
|
||||
private:
|
||||
int getChannels() const { return isStereo() ? 2 : 1; }
|
||||
|
||||
AudioStream *_parentStream;
|
||||
DisposeAfterUse::Flag _disposeAfterUse;
|
||||
uint32 _totalSamples, _samplesRead;
|
||||
};
|
||||
|
||||
AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse) {
|
||||
return new LimitingAudioStream(parentStream, length, disposeAfterUse);
|
||||
}
|
||||
|
||||
} // End of namespace Audio
|
||||
|
|
|
@ -356,6 +356,16 @@ QueuingAudioStream *makeQueuingAudioStream(int rate, bool stereo);
|
|||
*/
|
||||
Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo);
|
||||
|
||||
/**
|
||||
* Factory function for an AudioStream wrapper that cuts off the amount of samples read after a
|
||||
* given time length is reached.
|
||||
*
|
||||
* @param parentStream The stream to limit
|
||||
* @param length The time length to limit the stream to
|
||||
* @param disposeAfterUse Whether the parent stream object should be destroyed on destruction of the returned stream
|
||||
*/
|
||||
AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
|
||||
|
||||
} // End of namespace Audio
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,13 +71,19 @@ int Oki_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
|
|||
int samples;
|
||||
byte data;
|
||||
|
||||
assert(numSamples % 2 == 0);
|
||||
for (samples = 0; samples < numSamples && !endOfData(); samples++) {
|
||||
if (_decodedSampleCount == 0) {
|
||||
data = _stream->readByte();
|
||||
_decodedSamples[0] = decodeOKI((data >> 4) & 0x0f);
|
||||
_decodedSamples[1] = decodeOKI((data >> 0) & 0x0f);
|
||||
_decodedSampleCount = 2;
|
||||
}
|
||||
|
||||
for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples += 2) {
|
||||
data = _stream->readByte();
|
||||
buffer[samples] = decodeOKI((data >> 4) & 0x0f);
|
||||
buffer[samples + 1] = decodeOKI(data & 0x0f);
|
||||
// (1 - (count - 1)) ensures that _decodedSamples acts as a FIFO of depth 2
|
||||
buffer[samples] = _decodedSamples[1 - (_decodedSampleCount - 1)];
|
||||
_decodedSampleCount--;
|
||||
}
|
||||
|
||||
return samples;
|
||||
}
|
||||
|
||||
|
@ -117,13 +123,19 @@ int DVI_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
|
|||
int samples;
|
||||
byte data;
|
||||
|
||||
assert(numSamples % 2 == 0);
|
||||
for (samples = 0; samples < numSamples && !endOfData(); samples++) {
|
||||
if (_decodedSampleCount == 0) {
|
||||
data = _stream->readByte();
|
||||
_decodedSamples[0] = decodeIMA((data >> 4) & 0x0f, 0);
|
||||
_decodedSamples[1] = decodeIMA((data >> 0) & 0x0f, _channels == 2 ? 1 : 0);
|
||||
_decodedSampleCount = 2;
|
||||
}
|
||||
|
||||
for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples += 2) {
|
||||
data = _stream->readByte();
|
||||
buffer[samples] = decodeIMA((data >> 4) & 0x0f);
|
||||
buffer[samples + 1] = decodeIMA(data & 0x0f, _channels == 2 ? 1 : 0);
|
||||
// (1 - (count - 1)) ensures that _decodedSamples acts as a FIFO of depth 2
|
||||
buffer[samples] = _decodedSamples[1 - (_decodedSampleCount - 1)];
|
||||
_decodedSampleCount--;
|
||||
}
|
||||
|
||||
return samples;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "common/stream.h"
|
||||
#include "common/textconsole.h"
|
||||
|
||||
|
||||
namespace Audio {
|
||||
|
||||
class ADPCMStream : public RewindableAudioStream {
|
||||
|
@ -64,12 +63,11 @@ public:
|
|||
ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign);
|
||||
|
||||
virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos); }
|
||||
virtual bool isStereo() const { return _channels == 2; }
|
||||
virtual int getRate() const { return _rate; }
|
||||
virtual bool isStereo() const { return _channels == 2; }
|
||||
virtual int getRate() const { return _rate; }
|
||||
|
||||
virtual bool rewind();
|
||||
|
||||
|
||||
/**
|
||||
* This table is used by some ADPCM variants (IMA and OKI) to adjust the
|
||||
* step for use on the next sample.
|
||||
|
@ -83,12 +81,18 @@ public:
|
|||
class Oki_ADPCMStream : public ADPCMStream {
|
||||
public:
|
||||
Oki_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
|
||||
: ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {}
|
||||
: ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { _decodedSampleCount = 0; }
|
||||
|
||||
virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos) && (_decodedSampleCount == 0); }
|
||||
|
||||
virtual int readBuffer(int16 *buffer, const int numSamples);
|
||||
|
||||
protected:
|
||||
int16 decodeOKI(byte);
|
||||
|
||||
private:
|
||||
uint8 _decodedSampleCount;
|
||||
int16 _decodedSamples[2];
|
||||
};
|
||||
|
||||
class Ima_ADPCMStream : public ADPCMStream {
|
||||
|
@ -108,9 +112,15 @@ public:
|
|||
class DVI_ADPCMStream : public Ima_ADPCMStream {
|
||||
public:
|
||||
DVI_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
|
||||
: Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {}
|
||||
: Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { _decodedSampleCount = 0; }
|
||||
|
||||
virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos) && (_decodedSampleCount == 0); }
|
||||
|
||||
virtual int readBuffer(int16 *buffer, const int numSamples);
|
||||
|
||||
private:
|
||||
uint8 _decodedSampleCount;
|
||||
int16 _decodedSamples[2];
|
||||
};
|
||||
|
||||
class Apple_ADPCMStream : public Ima_ADPCMStream {
|
||||
|
|
|
@ -689,7 +689,7 @@ static int getVlc2(Common::BitStream *s, int16 (*table)[2], int bits, int maxDep
|
|||
code = table[index][0];
|
||||
n = table[index][1];
|
||||
|
||||
if(maxDepth > 2 && n < 0) {
|
||||
if (maxDepth > 2 && n < 0) {
|
||||
s->skip(nbBits);
|
||||
index = s->getBits(-n) + code;
|
||||
code = table[index][0];
|
||||
|
@ -861,9 +861,9 @@ void initVlcSparse(VLC *vlc, int nb_bits, int nb_codes,
|
|||
const void *symbols, int symbols_wrap, int symbols_size) {
|
||||
vlc->bits = nb_bits;
|
||||
|
||||
if(vlc->table_size && vlc->table_size == vlc->table_allocated) {
|
||||
if (vlc->table_size && vlc->table_size == vlc->table_allocated) {
|
||||
return;
|
||||
} else if(vlc->table_size) {
|
||||
} else if (vlc->table_size) {
|
||||
error("called on a partially initialized table");
|
||||
}
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ void QDM2Stream::fix_coding_method_array(int sb, int channels, sb_int8_array cod
|
|||
|
||||
for (ch = 0; ch < channels; ch++) {
|
||||
for (j = 0; j < 64; ) {
|
||||
if((coding_method[ch][sb][j] - 8) > 22) {
|
||||
if ((coding_method[ch][sb][j] - 8) > 22) {
|
||||
run = 1;
|
||||
case_val = 8;
|
||||
} else {
|
||||
|
|
|
@ -61,41 +61,6 @@ private:
|
|||
bool _isStereo;
|
||||
};
|
||||
|
||||
/**
|
||||
* An AudioStream wrapper that cuts off the amount of samples read after a
|
||||
* given time length is reached.
|
||||
*/
|
||||
class LimitingAudioStream : public AudioStream {
|
||||
public:
|
||||
LimitingAudioStream(AudioStream *parentStream, const Audio::Timestamp &length,
|
||||
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES) :
|
||||
_parentStream(parentStream), _samplesRead(0), _disposeAfterUse(disposeAfterUse),
|
||||
_totalSamples(length.convertToFramerate(getRate()).totalNumberOfFrames() * getChannels()) {}
|
||||
|
||||
~LimitingAudioStream() {
|
||||
if (_disposeAfterUse == DisposeAfterUse::YES)
|
||||
delete _parentStream;
|
||||
}
|
||||
|
||||
int readBuffer(int16 *buffer, const int numSamples) {
|
||||
// Cap us off so we don't read past _totalSamples
|
||||
int samplesRead = _parentStream->readBuffer(buffer, MIN<int>(numSamples, _totalSamples - _samplesRead));
|
||||
_samplesRead += samplesRead;
|
||||
return samplesRead;
|
||||
}
|
||||
|
||||
bool endOfData() const { return _parentStream->endOfData() || _samplesRead >= _totalSamples; }
|
||||
bool isStereo() const { return _parentStream->isStereo(); }
|
||||
int getRate() const { return _parentStream->getRate(); }
|
||||
|
||||
private:
|
||||
int getChannels() const { return isStereo() ? 2 : 1; }
|
||||
|
||||
AudioStream *_parentStream;
|
||||
DisposeAfterUse::Flag _disposeAfterUse;
|
||||
uint32 _totalSamples, _samplesRead;
|
||||
};
|
||||
|
||||
/**
|
||||
* An AudioStream wrapper that forces audio to be played in mono.
|
||||
* It currently just ignores the right channel if stereo.
|
||||
|
@ -263,7 +228,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::queueAudio(const Timestamp &len
|
|||
_skipSamples = Timestamp();
|
||||
}
|
||||
|
||||
queueStream(new LimitingAudioStream(new SilentAudioStream(getRate(), isStereo()), editLength), editLength);
|
||||
queueStream(makeLimitingAudioStream(new SilentAudioStream(getRate(), isStereo()), editLength), editLength);
|
||||
_curEdit++;
|
||||
enterNewEdit(nextEditTime);
|
||||
} else {
|
||||
|
@ -289,7 +254,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::queueAudio(const Timestamp &len
|
|||
// we move on to the next edit
|
||||
if (trackPosition >= nextEditTime || _curChunk >= _parentTrack->chunkCount) {
|
||||
chunkLength = nextEditTime.convertToFramerate(getRate()) - getCurrentTrackTime();
|
||||
stream = new LimitingAudioStream(stream, chunkLength);
|
||||
stream = makeLimitingAudioStream(stream, chunkLength);
|
||||
_curEdit++;
|
||||
enterNewEdit(nextEditTime);
|
||||
|
||||
|
@ -338,7 +303,7 @@ bool QuickTimeAudioDecoder::QuickTimeAudioTrack::seek(const Timestamp &where) {
|
|||
_queue = createStream();
|
||||
_samplesQueued = 0;
|
||||
|
||||
if (where > getLength()) {
|
||||
if (where >= getLength()) {
|
||||
// We're done
|
||||
_curEdit = _parentTrack->editCount;
|
||||
return true;
|
||||
|
@ -449,7 +414,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::skipSamples(const Timestamp &le
|
|||
}
|
||||
|
||||
void QuickTimeAudioDecoder::QuickTimeAudioTrack::findEdit(const Timestamp &position) {
|
||||
for (_curEdit = 0; _curEdit < _parentTrack->editCount && position < Timestamp(0, _parentTrack->editList[_curEdit].timeOffset, _decoder->_timeScale); _curEdit++)
|
||||
for (_curEdit = 0; _curEdit < _parentTrack->editCount - 1 && position > Timestamp(0, _parentTrack->editList[_curEdit].timeOffset, _decoder->_timeScale); _curEdit++)
|
||||
;
|
||||
|
||||
enterNewEdit(position);
|
||||
|
|
|
@ -321,9 +321,14 @@ void VocStream::preProcess() {
|
|||
// In case we hit a "Terminator" block we also break here.
|
||||
if (_stream->eos() || block.code == 0)
|
||||
break;
|
||||
// We also allow 128 as terminator, since Simon 1 Amiga CD32 uses it.
|
||||
if (block.code == 128) {
|
||||
debug(3, "VocStream::preProcess: Caught 128 as terminator");
|
||||
// We will allow invalid block numbers as terminators. This is needed,
|
||||
// since some games ship broken VOC files. The following occasions are
|
||||
// known:
|
||||
// - 128 is used as terminator in Simon 1 Amiga CD32
|
||||
// - Full Throttle contains a VOC file with an incorrect block length
|
||||
// resulting in a sample (127) to be read as block code.
|
||||
if (block.code > 9) {
|
||||
warning("VocStream::preProcess: Caught %d as terminator", block.code);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -482,7 +487,8 @@ void VocStream::preProcess() {
|
|||
|
||||
default:
|
||||
warning("Unhandled code %d in VOC file (len %d)", block.code, block.length);
|
||||
return;
|
||||
// Skip the whole block and try to use the next one.
|
||||
skip = block.length;
|
||||
}
|
||||
|
||||
// Premature end of stream => error!
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
* @param stream the actual AudioStream to be played
|
||||
* @param id a unique id assigned to this stream
|
||||
* @param volume the volume with which to play the sound, ranging from 0 to 255
|
||||
* @param balance the balance with which to play the sound, ranging from -128 to 127
|
||||
* @param balance the balance with which to play the sound, ranging from -127 to 127 (full left to full right), 0 is balanced, -128 is invalid
|
||||
* @param autofreeStream a flag indicating whether the stream should be
|
||||
* freed after playback finished
|
||||
* @param permanent a flag indicating whether a plain stopAll call should
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// see if all engines using this class are DISABLED
|
||||
#if !defined(ENABLE_KYRA)
|
||||
|
||||
// normal Header Guard
|
||||
#elif !defined(AUDIO_MODS_MAXTRAX_H)
|
||||
// Only compiled if Kyra is built-in or we're building for dynamic modules
|
||||
#if !defined(AUDIO_MODS_MAXTRAX_H) && (defined(ENABLE_KYRA) || defined(DYNAMIC_MODULES))
|
||||
#define AUDIO_MODS_MAXTRAX_H
|
||||
|
||||
// #define MAXTRAX_HAS_MODULATION
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
|
||||
struct {
|
||||
byte sample;
|
||||
byte lastSample;
|
||||
uint16 period;
|
||||
Offset offset;
|
||||
|
||||
|
@ -184,6 +185,7 @@ void ProtrackerStream::updateRow() {
|
|||
_track[track].vibratoPos = 0;
|
||||
}
|
||||
_track[track].sample = note.sample;
|
||||
_track[track].lastSample = note.sample;
|
||||
_track[track].finetune = _module.sample[note.sample - 1].finetune;
|
||||
_track[track].vol = _module.sample[note.sample - 1].vol;
|
||||
}
|
||||
|
@ -194,7 +196,9 @@ void ProtrackerStream::updateRow() {
|
|||
_track[track].period = _module.noteToPeriod(note.note, _track[track].finetune);
|
||||
else
|
||||
_track[track].period = note.period;
|
||||
|
||||
_track[track].offset = Offset(0);
|
||||
_track[track].sample = _track[track].lastSample;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
* Sound decoder used in engines:
|
||||
* - agos
|
||||
* - parallaction
|
||||
* - gob
|
||||
*/
|
||||
|
||||
#ifndef AUDIO_MODS_PROTRACKER_H
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// see if all engines using this class are DISABLED
|
||||
#if !defined(ENABLE_SCUMM)
|
||||
|
||||
// normal Header Guard
|
||||
#elif !defined(AUDIO_MODS_TFMX_H)
|
||||
// Only compiled if SCUMM is built-in or we're building for dynamic modules
|
||||
#if !defined(AUDIO_MODS_TFMX_H) && (defined(ENABLE_SCUMM) || defined(DYNAMIC_MODULES))
|
||||
#define AUDIO_MODS_TFMX_H
|
||||
|
||||
#include "audio/mods/paula.h"
|
||||
|
|
|
@ -161,49 +161,6 @@ GPHEventSource::GPHEventSource()
|
|||
: _buttonStateL(false) {
|
||||
}
|
||||
|
||||
void GPHEventSource::moveStick() {
|
||||
bool stickBtn[32];
|
||||
|
||||
memcpy(stickBtn, _stickBtn, sizeof(stickBtn));
|
||||
|
||||
if ((stickBtn[0]) || (stickBtn[2]) || (stickBtn[4]) || (stickBtn[6]))
|
||||
stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0;
|
||||
|
||||
if ((stickBtn[1]) || (stickBtn[2]) || (stickBtn[3])) {
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = -1;
|
||||
_km.x_down_count = 1;
|
||||
} else
|
||||
_km.x_vel = -4;
|
||||
} else if ((stickBtn[5]) || (stickBtn[6]) || (stickBtn[7])) {
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = 1;
|
||||
_km.x_down_count = 1;
|
||||
} else
|
||||
_km.x_vel = 4;
|
||||
} else {
|
||||
_km.x_vel = 0;
|
||||
_km.x_down_count = 0;
|
||||
}
|
||||
|
||||
if ((stickBtn[0]) || (stickBtn[1]) || (stickBtn[7])) {
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = -1;
|
||||
_km.y_down_count = 1;
|
||||
} else
|
||||
_km.y_vel = -4;
|
||||
} else if ((stickBtn[3]) || (stickBtn[4]) || (stickBtn[5])) {
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = 1;
|
||||
_km.y_down_count = 1;
|
||||
} else
|
||||
_km.y_vel = 4;
|
||||
} else {
|
||||
_km.y_vel = 0;
|
||||
_km.y_down_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom handleMouseButtonDown/handleMouseButtonUp to deal with 'Tap Mode' for the touchscreen */
|
||||
|
||||
bool GPHEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
|
||||
|
@ -268,19 +225,110 @@ bool GPHEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||
|
||||
bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
||||
|
||||
_stickBtn[ev.jbutton.button] = 1;
|
||||
event.kbd.flags = 0;
|
||||
|
||||
switch (ev.jbutton.button) {
|
||||
case BUTTON_UP:
|
||||
case BUTTON_UPLEFT:
|
||||
case BUTTON_LEFT:
|
||||
case BUTTON_DOWNLEFT:
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = -1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = -4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_DOWN:
|
||||
case BUTTON_DOWNRIGHT:
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = 1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = 4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_LEFT:
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = -1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = -4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_RIGHT:
|
||||
if (_km.x_down_count != 3) {
|
||||
_km.x_vel = 1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = 4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_UPLEFT:
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = -1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = -4;
|
||||
}
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = -1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = -4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_UPRIGHT:
|
||||
moveStick();
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = 1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = 4;
|
||||
}
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = -1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = -4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_DOWNLEFT:
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = -1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = -4;
|
||||
}
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = 1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = 4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
case BUTTON_DOWNRIGHT:
|
||||
if (_km.x_down_count != 2) {
|
||||
_km.x_vel = 1;
|
||||
_km.x_down_count = 1;
|
||||
} else {
|
||||
_km.x_vel = 4;
|
||||
}
|
||||
if (_km.y_down_count != 2) {
|
||||
_km.y_vel = 1;
|
||||
_km.y_down_count = 1;
|
||||
} else {
|
||||
_km.y_vel = 4;
|
||||
}
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
|
@ -391,7 +439,6 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||
|
||||
bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
||||
|
||||
_stickBtn[ev.jbutton.button] = 0;
|
||||
event.kbd.flags = 0;
|
||||
|
||||
switch (ev.jbutton.button) {
|
||||
|
@ -403,7 +450,10 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||
case BUTTON_DOWNRIGHT:
|
||||
case BUTTON_RIGHT:
|
||||
case BUTTON_UPRIGHT:
|
||||
moveStick();
|
||||
_km.y_vel = 0;
|
||||
_km.y_down_count = 0;
|
||||
_km.x_vel = 0;
|
||||
_km.x_down_count = 0;
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
processMouseEvent(event, _km.x, _km.y);
|
||||
break;
|
||||
|
|
|
@ -34,18 +34,11 @@ public:
|
|||
GPHEventSource();
|
||||
|
||||
protected:
|
||||
bool _stickBtn[32];
|
||||
|
||||
/**
|
||||
* Button state for L button modifier
|
||||
*/
|
||||
bool _buttonStateL;
|
||||
|
||||
/**
|
||||
* Handles the stick movement
|
||||
*/
|
||||
void moveStick();
|
||||
|
||||
bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
|
||||
bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
|
||||
bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
|
||||
|
|
|
@ -432,7 +432,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() {
|
|||
// Forcefully disable aspect ratio correction for games
|
||||
// which starts with a native 240px height resolution.
|
||||
// This fixes games with weird resolutions, like MM Nes (256x240)
|
||||
if(_videoMode.screenHeight == 240) {
|
||||
if (_videoMode.screenHeight == 240) {
|
||||
_videoMode.aspectRatioCorrection = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -486,7 +486,13 @@ bool GPHGraphicsManager::loadGFXMode() {
|
|||
if (_videoMode.aspectRatioCorrection)
|
||||
_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
|
||||
}
|
||||
return SurfaceSdlGraphicsManager::loadGFXMode();
|
||||
SurfaceSdlGraphicsManager::loadGFXMode();
|
||||
|
||||
// The old GP2X hacked SDL needs this after any call to SDL_SetVideoMode
|
||||
// and it does not hurt other devices.
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GPHGraphicsManager::hasFeature(OSystem::Feature f) {
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
virtual int16 getWidth() = 0;
|
||||
virtual void setPalette(const byte *colors, uint start, uint num) = 0;
|
||||
virtual void grabPalette(byte *colors, uint start, uint num) = 0;
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) = 0;
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) = 0;
|
||||
virtual Graphics::Surface *lockScreen() = 0;
|
||||
virtual void unlockScreen() = 0;
|
||||
virtual void fillScreen(uint32 col) = 0;
|
||||
|
@ -73,14 +73,14 @@ public:
|
|||
virtual void hideOverlay() = 0;
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const = 0;
|
||||
virtual void clearOverlay() = 0;
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch) = 0;
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h)= 0;
|
||||
virtual void grabOverlay(void *buf, int pitch) = 0;
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h)= 0;
|
||||
virtual int16 getOverlayHeight() = 0;
|
||||
virtual int16 getOverlayWidth() = 0;
|
||||
|
||||
virtual bool showMouse(bool visible) = 0;
|
||||
virtual void warpMouse(int x, int y) = 0;
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) = 0;
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0;
|
||||
|
||||
virtual void displayMessageOnOSD(const char *msg) {}
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
int16 getWidth() { return 0; }
|
||||
void setPalette(const byte *colors, uint start, uint num) {}
|
||||
void grabPalette(byte *colors, uint start, uint num) {}
|
||||
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {}
|
||||
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {}
|
||||
Graphics::Surface *lockScreen() { return NULL; }
|
||||
void unlockScreen() {}
|
||||
void fillScreen(uint32 col) {}
|
||||
|
@ -71,14 +71,14 @@ public:
|
|||
void hideOverlay() {}
|
||||
Graphics::PixelFormat getOverlayFormat() const { return Graphics::PixelFormat(); }
|
||||
void clearOverlay() {}
|
||||
void grabOverlay(OverlayColor *buf, int pitch) {}
|
||||
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {}
|
||||
void grabOverlay(void *buf, int pitch) {}
|
||||
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {}
|
||||
int16 getOverlayHeight() { return 0; }
|
||||
int16 getOverlayWidth() { return 0; }
|
||||
|
||||
bool showMouse(bool visible) { return !visible; }
|
||||
void warpMouse(int x, int y) {}
|
||||
void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) {}
|
||||
void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) {}
|
||||
void setCursorPalette(const byte *colors, uint start, uint num) {}
|
||||
};
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
|
|||
_transactionMode(kTransactionNone),
|
||||
_cursorNeedsRedraw(false), _cursorPaletteDisabled(true),
|
||||
_cursorVisible(false), _cursorKeyColor(0),
|
||||
_cursorTargetScale(1),
|
||||
_cursorDontScale(false),
|
||||
_formatBGR(false),
|
||||
_displayX(0), _displayY(0), _displayWidth(0), _displayHeight(0) {
|
||||
|
||||
|
@ -70,6 +70,11 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
|
|||
free(_gamePalette);
|
||||
free(_cursorPalette);
|
||||
|
||||
_screenData.free();
|
||||
_overlayData.free();
|
||||
_cursorData.free();
|
||||
_osdSurface.free();
|
||||
|
||||
delete _gameTexture;
|
||||
delete _overlayTexture;
|
||||
delete _cursorTexture;
|
||||
|
@ -344,14 +349,14 @@ void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
|
|||
memcpy(colors, _gamePalette + start * 3, num * 3);
|
||||
}
|
||||
|
||||
void OpenGLGraphicsManager::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OpenGLGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(x >= 0 && x < _screenData.w);
|
||||
assert(y >= 0 && y < _screenData.h);
|
||||
assert(h > 0 && y + h <= _screenData.h);
|
||||
assert(w > 0 && x + w <= _screenData.w);
|
||||
|
||||
// Copy buffer data to game screen internal buffer
|
||||
const byte *src = buf;
|
||||
const byte *src = (const byte *)buf;
|
||||
byte *dst = (byte *)_screenData.pixels + y * _screenData.pitch + x * _screenData.format.bytesPerPixel;
|
||||
for (int i = 0; i < h; i++) {
|
||||
memcpy(dst, src, w * _screenData.format.bytesPerPixel);
|
||||
|
@ -462,33 +467,35 @@ void OpenGLGraphicsManager::clearOverlay() {
|
|||
_overlayNeedsRedraw = true;
|
||||
}
|
||||
|
||||
void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
assert(_overlayData.format.bytesPerPixel == sizeof(buf[0]));
|
||||
void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) {
|
||||
const byte *src = (byte *)_overlayData.pixels;
|
||||
byte *dst = (byte *)buf;
|
||||
for (int i = 0; i < _overlayData.h; i++) {
|
||||
// Copy overlay data to buffer
|
||||
memcpy(buf, src, _overlayData.pitch);
|
||||
buf += pitch;
|
||||
memcpy(dst, src, _overlayData.pitch);
|
||||
dst += pitch;
|
||||
src += _overlayData.pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OpenGLGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
|
||||
if (_overlayTexture == NULL)
|
||||
return;
|
||||
|
||||
const byte *src = (const byte *)buf;
|
||||
|
||||
// Clip the coordinates
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * 2;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -502,11 +509,10 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch
|
|||
return;
|
||||
|
||||
// Copy buffer data to internal overlay surface
|
||||
const byte *src = (const byte *)buf;
|
||||
byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch;
|
||||
for (int i = 0; i < h; i++) {
|
||||
memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel);
|
||||
src += pitch * sizeof(buf[0]);
|
||||
src += pitch;
|
||||
dst += _overlayData.pitch;
|
||||
}
|
||||
|
||||
|
@ -586,7 +592,7 @@ void OpenGLGraphicsManager::warpMouse(int x, int y) {
|
|||
setInternalMousePosition(scaledX, scaledY);
|
||||
}
|
||||
|
||||
void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (format)
|
||||
_cursorFormat = *format;
|
||||
|
@ -611,7 +617,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
|
|||
_cursorState.hotX = hotspotX;
|
||||
_cursorState.hotY = hotspotY;
|
||||
_cursorKeyColor = keycolor;
|
||||
_cursorTargetScale = cursorTargetScale;
|
||||
_cursorDontScale = dontScale;
|
||||
_cursorNeedsRedraw = true;
|
||||
|
||||
refreshCursorScale();
|
||||
|
@ -824,28 +830,19 @@ void OpenGLGraphicsManager::refreshCursor() {
|
|||
}
|
||||
|
||||
void OpenGLGraphicsManager::refreshCursorScale() {
|
||||
// Calculate the scale factors of the screen. We limit ourselves to 3 at
|
||||
// most here to avoid really big (and ugly) cursors for big resolutions.
|
||||
// It might be noteworthy that 3 is the (current) target scale for the
|
||||
// modern theme and thus assures the cursor is *never* scaled.
|
||||
// Calculate the scale factors of the screen.
|
||||
// We also totally ignore the aspect of the overlay cursor, since aspect
|
||||
// ratio correction only applies to the game screen.
|
||||
uint screenScaleFactorX = MIN(30000, _videoMode.hardwareWidth * 10000 / _videoMode.screenWidth);
|
||||
uint screenScaleFactorY = MIN(30000, _videoMode.hardwareHeight * 10000 / _videoMode.screenHeight);
|
||||
// TODO: It might make sense to always ignore scaling of the mouse cursor
|
||||
// when the overlay is visible.
|
||||
uint screenScaleFactorX = _videoMode.hardwareWidth * 10000 / _videoMode.screenWidth;
|
||||
uint screenScaleFactorY = _videoMode.hardwareHeight * 10000 / _videoMode.screenHeight;
|
||||
|
||||
// Apply the target scale factor to the cursor.
|
||||
// It might be noteworthy we only apply any scaling to the cursor in case
|
||||
// the current scale factor is bigger than the target scale to match
|
||||
// SurfaceSdlGraphicsManager's behavior. Otherwise we would downscale the
|
||||
// GUI cursor of the modern theme for example.
|
||||
if (screenScaleFactorX > uint(_cursorTargetScale * 10000))
|
||||
screenScaleFactorX /= _cursorTargetScale;
|
||||
else
|
||||
// Ignore scaling when the cursor should not be scaled.
|
||||
if (_cursorDontScale) {
|
||||
screenScaleFactorX = 10000;
|
||||
if (screenScaleFactorY > uint(_cursorTargetScale * 10000))
|
||||
screenScaleFactorY /= _cursorTargetScale;
|
||||
else
|
||||
screenScaleFactorY = 10000;
|
||||
}
|
||||
|
||||
// Apply them (without any possible) aspect ratio correction to the
|
||||
// overlay.
|
||||
|
@ -854,16 +851,19 @@ void OpenGLGraphicsManager::refreshCursorScale() {
|
|||
_cursorState.rHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
|
||||
_cursorState.rHotY = (int16)(_cursorState.hotY * screenScaleFactorY / 10000);
|
||||
|
||||
// Make sure we properly scale the cursor according to the desired aspect.
|
||||
// It might be noteworthy that, unlike with the overlay, we do not limit
|
||||
// the scale factor here to avoid odd looks if the game uses items as
|
||||
// mouse cursor, which would otherwise suddenly be smaller.
|
||||
int width, height;
|
||||
calculateDisplaySize(width, height);
|
||||
screenScaleFactorX = (width * 10000 / _videoMode.screenWidth) / _cursorTargetScale;
|
||||
screenScaleFactorY = (height * 10000 / _videoMode.screenHeight) / _cursorTargetScale;
|
||||
// Only apply scaling when it's desired.
|
||||
if (_cursorDontScale) {
|
||||
screenScaleFactorX = 10000;
|
||||
screenScaleFactorY = 10000;
|
||||
} else {
|
||||
// Make sure we properly scale the cursor according to the desired aspect.
|
||||
int width, height;
|
||||
calculateDisplaySize(width, height);
|
||||
screenScaleFactorX = (width * 10000 / _videoMode.screenWidth);
|
||||
screenScaleFactorY = (height * 10000 / _videoMode.screenHeight);
|
||||
}
|
||||
|
||||
// Always scale the cursor for the game.
|
||||
// Apply the scale cursor scaling for the game screen.
|
||||
_cursorState.vW = (int16)(_cursorState.w * screenScaleFactorX / 10000);
|
||||
_cursorState.vH = (int16)(_cursorState.h * screenScaleFactorY / 10000);
|
||||
_cursorState.vHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
|
||||
|
@ -902,7 +902,7 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat,
|
|||
bpp = 4;
|
||||
intFormat = GL_RGBA;
|
||||
glFormat = GL_RGBA;
|
||||
gltype = GL_UNSIGNED_BYTE;
|
||||
gltype = GL_UNSIGNED_INT_8_8_8_8;
|
||||
} else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) { // RGB888
|
||||
bpp = 3;
|
||||
intFormat = GL_RGB;
|
||||
|
@ -918,11 +918,6 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat,
|
|||
intFormat = GL_RGBA;
|
||||
glFormat = GL_RGBA;
|
||||
gltype = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
|
||||
bpp = 2;
|
||||
intFormat = GL_RGB;
|
||||
glFormat = GL_BGRA;
|
||||
gltype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
|
||||
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)) { // RGBA4444
|
||||
bpp = 2;
|
||||
intFormat = GL_RGBA;
|
||||
|
@ -936,6 +931,13 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat,
|
|||
glFormat = GL_RGB;
|
||||
gltype = GL_UNSIGNED_BYTE;
|
||||
#ifndef USE_GLES
|
||||
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
|
||||
// GL_BGRA does not exist in every GLES implementation so should not be configured if
|
||||
// USE_GLES is set.
|
||||
bpp = 2;
|
||||
intFormat = GL_RGB;
|
||||
glFormat = GL_BGRA;
|
||||
gltype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
|
||||
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)) { // ARGB8888
|
||||
bpp = 4;
|
||||
intFormat = GL_RGBA;
|
||||
|
|
|
@ -84,7 +84,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
public:
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
virtual void fillScreen(uint32 col);
|
||||
|
@ -97,14 +97,14 @@ public:
|
|||
virtual void hideOverlay();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const;
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
virtual void displayMessageOnOSD(const char *msg);
|
||||
|
@ -283,7 +283,7 @@ protected:
|
|||
MousePos _cursorState;
|
||||
bool _cursorVisible;
|
||||
uint32 _cursorKeyColor;
|
||||
int _cursorTargetScale;
|
||||
bool _cursorDontScale;
|
||||
bool _cursorNeedsRedraw;
|
||||
|
||||
/**
|
||||
|
|
|
@ -160,7 +160,7 @@ void OpenGLSdlGraphicsManager::detectSupportedFormats() {
|
|||
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
|
||||
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
|
||||
|
||||
// Workaround to MacOSX SDL not providing an accurate Aloss value.
|
||||
// Workaround to SDL not providing an accurate Aloss value on Mac OS X.
|
||||
if (_hwscreen->format->Amask == 0)
|
||||
format.aLoss = 8;
|
||||
|
||||
|
|
|
@ -26,28 +26,59 @@
|
|||
|
||||
#include "backends/graphics/openpandora/op-graphics.h"
|
||||
#include "backends/events/openpandora/op-events.h"
|
||||
//#include "backends/platform/openpandora/op-sdl.h"
|
||||
#include "graphics/scaler/aspect.h"
|
||||
#include "common/mutex.h"
|
||||
#include "common/textconsole.h"
|
||||
|
||||
static SDL_Cursor *hiddenCursor;
|
||||
|
||||
OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource)
|
||||
: SurfaceSdlGraphicsManager(sdlEventSource) {
|
||||
}
|
||||
|
||||
bool OPGraphicsManager::loadGFXMode() {
|
||||
/* FIXME: For now we just cheat and set the overlay to 640*480 not 800*480 and let SDL
|
||||
deal with the boarders (it saves cleaning up the overlay when the game screen is
|
||||
smaller than the overlay ;)
|
||||
|
||||
uint8_t hiddenCursorData = 0;
|
||||
hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
|
||||
|
||||
/* On the OpenPandora we need to work around an SDL assumption that
|
||||
returns relative mouse coordinates when you get to the screen
|
||||
edges using the touchscreen. The workaround is to set a blank
|
||||
SDL cursor and not disable it (Hackish I know).
|
||||
|
||||
The root issues likes in the Windows Manager GRAB code in SDL.
|
||||
That is why the issue is not seen on framebuffer devices like the
|
||||
GP2X (there is no X window manager ;)).
|
||||
*/
|
||||
_videoMode.overlayWidth = 640;
|
||||
_videoMode.overlayHeight = 480;
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
SDL_SetCursor(hiddenCursor);
|
||||
|
||||
_videoMode.fullscreen = true;
|
||||
|
||||
_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
|
||||
_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
|
||||
|
||||
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
|
||||
_videoMode.aspectRatioCorrection = false;
|
||||
|
||||
if (_videoMode.aspectRatioCorrection)
|
||||
_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
|
||||
|
||||
_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
|
||||
_videoMode.hardwareHeight = effectiveScreenHeight();
|
||||
|
||||
return SurfaceSdlGraphicsManager::loadGFXMode();
|
||||
}
|
||||
|
||||
void OPGraphicsManager::unloadGFXMode() {
|
||||
|
||||
uint8_t hiddenCursorData = 0;
|
||||
hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
|
||||
|
||||
// Free the hidden SDL cursor created in loadGFXMode
|
||||
SDL_FreeCursor(hiddenCursor);
|
||||
|
||||
SurfaceSdlGraphicsManager::unloadGFXMode();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#define BACKENDS_GRAPHICS_OP_H
|
||||
|
||||
#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
|
||||
#include "graphics/scaler/aspect.h" // for aspect2Real
|
||||
#include "graphics/scaler/downscaler.h"
|
||||
|
||||
enum {
|
||||
|
@ -35,28 +34,8 @@ class OPGraphicsManager : public SurfaceSdlGraphicsManager {
|
|||
public:
|
||||
OPGraphicsManager(SdlEventSource *sdlEventSource);
|
||||
|
||||
// bool hasFeature(OSystem::Feature f);
|
||||
// void setFeatureState(OSystem::Feature f, bool enable);
|
||||
// bool getFeatureState(OSystem::Feature f);
|
||||
// int getDefaultGraphicsMode() const;
|
||||
|
||||
// void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL);
|
||||
// const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
|
||||
// bool setGraphicsMode(const char *name);
|
||||
// bool setGraphicsMode(int mode);
|
||||
// void setGraphicsModeIntern();
|
||||
// void internUpdateScreen();
|
||||
// void showOverlay();
|
||||
// void hideOverlay();
|
||||
bool loadGFXMode();
|
||||
// void drawMouse();
|
||||
// void undrawMouse();
|
||||
// virtual void warpMouse(int x, int y);
|
||||
|
||||
// SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
|
||||
// SurfaceSdlGraphicsManager::VideoState *getVideoMode();
|
||||
|
||||
// virtual void adjustMouseEvent(const Common::Event &event);
|
||||
void unloadGFXMode();
|
||||
};
|
||||
|
||||
#endif /* BACKENDS_GRAPHICS_OP_H */
|
||||
|
|
|
@ -63,17 +63,12 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
|
|||
|
||||
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Normal (no scaling)", "lowres")
|
||||
|
||||
// Table of relative scalers magnitudes
|
||||
// [definedScale - 1][scaleFactor - 1]
|
||||
static ScalerProc *scalersMagn[3][3] = {
|
||||
// Table of the cursor scalers [scaleFactor - 1]
|
||||
static ScalerProc *scalersMagn[3] = {
|
||||
#ifdef USE_SCALERS
|
||||
{ Normal1x, AdvMame2x, AdvMame3x },
|
||||
{ Normal1x, Normal1x, Normal1o5x },
|
||||
{ Normal1x, Normal1x, Normal1x }
|
||||
Normal1x, AdvMame2x, AdvMame3x
|
||||
#else // remove dependencies on other scalers
|
||||
{ Normal1x, Normal1x, Normal1x },
|
||||
{ Normal1x, Normal1x, Normal1x },
|
||||
{ Normal1x, Normal1x, Normal1x }
|
||||
Normal1x, Normal1x, Normal1x
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -135,7 +130,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
|
|||
_overlayscreen(0), _tmpscreen2(0),
|
||||
_scalerProc(0), _screenChangeCount(0),
|
||||
_mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0),
|
||||
_mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true),
|
||||
_mouseOrigSurface(0), _cursorDontScale(false), _cursorPaletteDisabled(true),
|
||||
_currentShakePos(0), _newShakePos(0),
|
||||
_paletteDirtyStart(0), _paletteDirtyEnd(0),
|
||||
_screenIsLocked(false),
|
||||
|
@ -458,7 +453,7 @@ void SurfaceSdlGraphicsManager::detectSupportedFormats() {
|
|||
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
|
||||
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
|
||||
|
||||
// Workaround to MacOSX SDL not providing an accurate Aloss value.
|
||||
// Workaround to SDL not providing an accurate Aloss value on Mac OS X.
|
||||
if (_hwscreen->format->Amask == 0)
|
||||
format.aLoss = 8;
|
||||
|
||||
|
@ -1232,9 +1227,9 @@ void SurfaceSdlGraphicsManager::setAspectRatioCorrection(bool enable) {
|
|||
}
|
||||
}
|
||||
|
||||
void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
|
||||
void SurfaceSdlGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
assert(src);
|
||||
assert(buf);
|
||||
|
||||
if (_screen == NULL) {
|
||||
warning("SurfaceSdlGraphicsManager::copyRectToScreen: _screen == NULL");
|
||||
|
@ -1257,8 +1252,9 @@ void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int
|
|||
#ifdef USE_RGB_COLOR
|
||||
byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x * _screenFormat.bytesPerPixel;
|
||||
if (_videoMode.screenWidth == w && pitch == _screen->pitch) {
|
||||
memcpy(dst, src, h*pitch);
|
||||
memcpy(dst, buf, h*pitch);
|
||||
} else {
|
||||
const byte *src = (const byte *)buf;
|
||||
do {
|
||||
memcpy(dst, src, w * _screenFormat.bytesPerPixel);
|
||||
src += pitch;
|
||||
|
@ -1268,8 +1264,9 @@ void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int
|
|||
#else
|
||||
byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x;
|
||||
if (_screen->pitch == pitch && pitch == w) {
|
||||
memcpy(dst, src, h*w);
|
||||
memcpy(dst, buf, h*w);
|
||||
} else {
|
||||
const byte *src = (const byte *)buf;
|
||||
do {
|
||||
memcpy(dst, src, w);
|
||||
src += pitch;
|
||||
|
@ -1600,7 +1597,7 @@ void SurfaceSdlGraphicsManager::clearOverlay() {
|
|||
_forceFull = true;
|
||||
}
|
||||
|
||||
void SurfaceSdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void SurfaceSdlGraphicsManager::grabOverlay(void *buf, int pitch) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
|
||||
if (_overlayscreen == NULL)
|
||||
|
@ -1610,31 +1607,35 @@ void SurfaceSdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
|
|||
error("SDL_LockSurface failed: %s", SDL_GetError());
|
||||
|
||||
byte *src = (byte *)_overlayscreen->pixels;
|
||||
byte *dst = (byte *)buf;
|
||||
int h = _videoMode.overlayHeight;
|
||||
do {
|
||||
memcpy(buf, src, _videoMode.overlayWidth * 2);
|
||||
memcpy(dst, src, _videoMode.overlayWidth * 2);
|
||||
src += _overlayscreen->pitch;
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
|
||||
SDL_UnlockSurface(_overlayscreen);
|
||||
}
|
||||
|
||||
void SurfaceSdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void SurfaceSdlGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
|
||||
if (_overlayscreen == NULL)
|
||||
return;
|
||||
|
||||
const byte *src = (const byte *)buf;
|
||||
|
||||
// Clip the coordinates
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * 2;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y; buf -= y * pitch;
|
||||
h += y;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -1657,9 +1658,9 @@ void SurfaceSdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int p
|
|||
|
||||
byte *dst = (byte *)_overlayscreen->pixels + y * _overlayscreen->pitch + x * 2;
|
||||
do {
|
||||
memcpy(dst, buf, w * 2);
|
||||
memcpy(dst, src, w * 2);
|
||||
dst += _overlayscreen->pitch;
|
||||
buf += pitch;
|
||||
src += pitch;
|
||||
} while (--h);
|
||||
|
||||
SDL_UnlockSurface(_overlayscreen);
|
||||
|
@ -1718,7 +1719,7 @@ void SurfaceSdlGraphicsManager::warpMouse(int x, int y) {
|
|||
}
|
||||
}
|
||||
|
||||
void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
void SurfaceSdlGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (!format)
|
||||
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
|
||||
|
@ -1739,7 +1740,7 @@ void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h,
|
|||
|
||||
_mouseKeyColor = keycolor;
|
||||
|
||||
_cursorTargetScale = cursorTargetScale;
|
||||
_cursorDontScale = dontScale;
|
||||
|
||||
if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) {
|
||||
_mouseCurState.w = w;
|
||||
|
@ -1847,51 +1848,34 @@ void SurfaceSdlGraphicsManager::blitCursor() {
|
|||
}
|
||||
|
||||
int rW, rH;
|
||||
int cursorScale;
|
||||
|
||||
if (_cursorTargetScale >= _videoMode.scaleFactor) {
|
||||
// The cursor target scale is greater or equal to the scale at
|
||||
// which the rest of the screen is drawn. We do not downscale
|
||||
// the cursor image, we draw it at its original size. It will
|
||||
// appear too large on screen.
|
||||
|
||||
rW = w;
|
||||
rH = h;
|
||||
_mouseCurState.rHotX = _mouseCurState.hotX;
|
||||
_mouseCurState.rHotY = _mouseCurState.hotY;
|
||||
|
||||
// The virtual dimensions may be larger than the original.
|
||||
|
||||
_mouseCurState.vW = w * _cursorTargetScale / _videoMode.scaleFactor;
|
||||
_mouseCurState.vH = h * _cursorTargetScale / _videoMode.scaleFactor;
|
||||
_mouseCurState.vHotX = _mouseCurState.hotX * _cursorTargetScale /
|
||||
_videoMode.scaleFactor;
|
||||
_mouseCurState.vHotY = _mouseCurState.hotY * _cursorTargetScale /
|
||||
_videoMode.scaleFactor;
|
||||
if (_cursorDontScale) {
|
||||
// Don't scale the cursor at all if the user requests this behavior.
|
||||
cursorScale = 1;
|
||||
} else {
|
||||
// The cursor target scale is smaller than the scale at which
|
||||
// the rest of the screen is drawn. We scale up the cursor
|
||||
// image to make it appear correct.
|
||||
|
||||
rW = w * _videoMode.scaleFactor / _cursorTargetScale;
|
||||
rH = h * _videoMode.scaleFactor / _cursorTargetScale;
|
||||
_mouseCurState.rHotX = _mouseCurState.hotX * _videoMode.scaleFactor /
|
||||
_cursorTargetScale;
|
||||
_mouseCurState.rHotY = _mouseCurState.hotY * _videoMode.scaleFactor /
|
||||
_cursorTargetScale;
|
||||
|
||||
// The virtual dimensions will be the same as the original.
|
||||
|
||||
_mouseCurState.vW = w;
|
||||
_mouseCurState.vH = h;
|
||||
_mouseCurState.vHotX = _mouseCurState.hotX;
|
||||
_mouseCurState.vHotY = _mouseCurState.hotY;
|
||||
// Scale the cursor with the game screen scale factor.
|
||||
cursorScale = _videoMode.scaleFactor;
|
||||
}
|
||||
|
||||
// Adapt the real hotspot according to the scale factor.
|
||||
rW = w * cursorScale;
|
||||
rH = h * cursorScale;
|
||||
_mouseCurState.rHotX = _mouseCurState.hotX * cursorScale;
|
||||
_mouseCurState.rHotY = _mouseCurState.hotY * cursorScale;
|
||||
|
||||
// The virtual dimensions will be the same as the original.
|
||||
|
||||
_mouseCurState.vW = w;
|
||||
_mouseCurState.vH = h;
|
||||
_mouseCurState.vHotX = _mouseCurState.hotX;
|
||||
_mouseCurState.vHotY = _mouseCurState.hotY;
|
||||
|
||||
#ifdef USE_SCALERS
|
||||
int rH1 = rH; // store original to pass to aspect-correction function later
|
||||
#endif
|
||||
|
||||
if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) {
|
||||
if (!_cursorDontScale && _videoMode.aspectRatioCorrection) {
|
||||
rH = real2Aspect(rH - 1) + 1;
|
||||
_mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY);
|
||||
}
|
||||
|
@ -1922,21 +1906,25 @@ void SurfaceSdlGraphicsManager::blitCursor() {
|
|||
|
||||
ScalerProc *scalerProc;
|
||||
|
||||
// If possible, use the same scaler for the cursor as for the rest of
|
||||
// the game. This only works well with the non-blurring scalers so we
|
||||
// actually only use the 1x, 1.5x, 2x and AdvMame scalers.
|
||||
|
||||
if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE))
|
||||
scalerProc = _scalerProc;
|
||||
else
|
||||
scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1];
|
||||
// Only apply scaling, when the user allows it.
|
||||
if (!_cursorDontScale) {
|
||||
// If possible, use the same scaler for the cursor as for the rest of
|
||||
// the game. This only works well with the non-blurring scalers so we
|
||||
// actually only use the 1x, 2x and AdvMame scalers.
|
||||
if (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE)
|
||||
scalerProc = _scalerProc;
|
||||
else
|
||||
scalerProc = scalersMagn[_videoMode.scaleFactor - 1];
|
||||
} else {
|
||||
scalerProc = Normal1x;
|
||||
}
|
||||
|
||||
scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2,
|
||||
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
|
||||
_mouseCurState.w, _mouseCurState.h);
|
||||
|
||||
#ifdef USE_SCALERS
|
||||
if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1)
|
||||
if (!_cursorDontScale && _videoMode.aspectRatioCorrection)
|
||||
cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
public:
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
virtual void fillScreen(uint32 col);
|
||||
|
@ -124,14 +124,14 @@ public:
|
|||
virtual void hideOverlay();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; }
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight() { return _videoMode.overlayHeight; }
|
||||
virtual int16 getOverlayWidth() { return _videoMode.overlayWidth; }
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
#ifdef USE_OSD
|
||||
|
@ -281,7 +281,7 @@ protected:
|
|||
#else
|
||||
byte _mouseKeyColor;
|
||||
#endif
|
||||
int _cursorTargetScale;
|
||||
bool _cursorDontScale;
|
||||
bool _cursorPaletteDisabled;
|
||||
SDL_Surface *_mouseOrigSurface;
|
||||
SDL_Surface *_mouseSurface;
|
||||
|
|
|
@ -1023,22 +1023,24 @@ bool WINCESdlGraphicsManager::saveScreenshot(const char *filename) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void WINCESdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void WINCESdlGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
|
||||
if (_overlayscreen == NULL)
|
||||
return;
|
||||
|
||||
const byte *src = (const byte *)buf;
|
||||
|
||||
// Clip the coordinates
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * 2;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -1063,23 +1065,24 @@ void WINCESdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pit
|
|||
|
||||
byte *dst = (byte *)_overlayscreen->pixels + y * _overlayscreen->pitch + x * 2;
|
||||
do {
|
||||
memcpy(dst, buf, w * 2);
|
||||
memcpy(dst, src, w * 2);
|
||||
dst += _overlayscreen->pitch;
|
||||
buf += pitch;
|
||||
src += pitch;
|
||||
} while (--h);
|
||||
|
||||
SDL_UnlockSurface(_overlayscreen);
|
||||
}
|
||||
|
||||
void WINCESdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
|
||||
void WINCESdlGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
assert(_transactionMode == kTransactionNone);
|
||||
assert(src);
|
||||
assert(buf);
|
||||
|
||||
if (_screen == NULL)
|
||||
return;
|
||||
|
||||
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
|
||||
|
||||
const byte *src = (const byte *)buf;
|
||||
/* Clip the coordinates */
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
|
@ -1128,7 +1131,7 @@ void WINCESdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x
|
|||
SDL_UnlockSurface(_screen);
|
||||
}
|
||||
|
||||
void WINCESdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
void WINCESdlGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
|
||||
undrawMouse();
|
||||
if (w == 0 || h == 0)
|
||||
|
|
|
@ -73,9 +73,9 @@ public:
|
|||
void internDrawMouse();
|
||||
void undrawMouse();
|
||||
bool showMouse(bool visible);
|
||||
void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); // overloaded by CE backend
|
||||
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME)
|
||||
void setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); // overloaded by CE backend
|
||||
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME)
|
||||
Graphics::Surface *lockScreen();
|
||||
void unlockScreen();
|
||||
void blitCursor();
|
||||
|
|
152
backends/midi/sndio.cpp
Normal file
152
backends/midi/sndio.cpp
Normal file
|
@ -0,0 +1,152 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// Disable symbol overrides so that we can use system headers.
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#include "common/scummsys.h"
|
||||
|
||||
#if defined(USE_SNDIO)
|
||||
|
||||
#include "common/error.h"
|
||||
#include "common/textconsole.h"
|
||||
#include "common/util.h"
|
||||
#include "audio/musicplugin.h"
|
||||
#include "audio/mpu401.h"
|
||||
|
||||
#include <sndio.h>
|
||||
|
||||
////////////////////////////////////////
|
||||
//
|
||||
// sndio MIDI driver
|
||||
//
|
||||
////////////////////////////////////////
|
||||
|
||||
class MidiDriver_Sndio : public MidiDriver_MPU401 {
|
||||
public:
|
||||
MidiDriver_Sndio();
|
||||
int open();
|
||||
bool isOpen() const { return hdl != NULL; }
|
||||
void close();
|
||||
void send(uint32 b);
|
||||
void sysEx(const byte *msg, uint16 length);
|
||||
|
||||
private:
|
||||
struct mio_hdl *hdl;
|
||||
};
|
||||
|
||||
MidiDriver_Sndio::MidiDriver_Sndio() {
|
||||
hdl = NULL;
|
||||
}
|
||||
|
||||
int MidiDriver_Sndio::open() {
|
||||
if (hdl != NULL)
|
||||
return MERR_ALREADY_OPEN;
|
||||
|
||||
hdl = ::mio_open(NULL, MIO_OUT, 0);
|
||||
if (hdl == NULL)
|
||||
warning("Could open MIDI port (no music)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MidiDriver_Sndio::close() {
|
||||
MidiDriver_MPU401::close();
|
||||
if (!hdl)
|
||||
return;
|
||||
mio_close(hdl);
|
||||
hdl = NULL;
|
||||
}
|
||||
|
||||
void MidiDriver_Sndio::send(uint32 b) {
|
||||
unsigned char buf[4];
|
||||
unsigned int len;
|
||||
|
||||
if (!hdl)
|
||||
return;
|
||||
buf[0] = b & 0xff;
|
||||
buf[1] = (b >> 8) & 0xff;
|
||||
buf[2] = (b >> 16) & 0xff;
|
||||
buf[3] = (b >> 24) & 0xff;
|
||||
switch (buf[0] & 0xf0) {
|
||||
case 0xf0:
|
||||
return;
|
||||
case 0xc0:
|
||||
case 0xd0:
|
||||
len = 2;
|
||||
break;
|
||||
default:
|
||||
len = 3;
|
||||
}
|
||||
mio_write(hdl, buf, len);
|
||||
}
|
||||
|
||||
void MidiDriver_Sndio::sysEx(const byte *msg, uint16 length) {
|
||||
if (!hdl)
|
||||
return;
|
||||
|
||||
unsigned char buf[266];
|
||||
|
||||
assert(length + 2 <= ARRAYSIZE(buf));
|
||||
|
||||
// Add SysEx frame
|
||||
buf[0] = 0xF0;
|
||||
memcpy(buf + 1, msg, length);
|
||||
buf[length + 1] = 0xF7;
|
||||
|
||||
mio_write(hdl, buf, length + 2);
|
||||
}
|
||||
|
||||
|
||||
// Plugin interface
|
||||
|
||||
class SndioMusicPlugin : public MusicPluginObject {
|
||||
public:
|
||||
const char *getName() const {
|
||||
return "Sndio";
|
||||
}
|
||||
|
||||
const char *getId() const {
|
||||
return "sndio";
|
||||
}
|
||||
|
||||
MusicDevices getDevices() const;
|
||||
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
|
||||
};
|
||||
|
||||
MusicDevices SndioMusicPlugin::getDevices() const {
|
||||
MusicDevices devices;
|
||||
devices.push_back(MusicDevice(this, "", MT_GM));
|
||||
return devices;
|
||||
}
|
||||
|
||||
Common::Error SndioMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
|
||||
*mididriver = new MidiDriver_Sndio();
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
//#if PLUGIN_ENABLED_DYNAMIC(Sndio)
|
||||
//REGISTER_PLUGIN_DYNAMIC(SNDIO, PLUGIN_TYPE_MUSIC, SndioMusicPlugin);
|
||||
//#else
|
||||
REGISTER_PLUGIN_STATIC(SNDIO, PLUGIN_TYPE_MUSIC, SndioMusicPlugin);
|
||||
//#endif
|
||||
|
||||
#endif
|
|
@ -124,7 +124,7 @@ PaletteManager *ModularBackend::getPaletteManager() {
|
|||
return _graphicsManager;
|
||||
}
|
||||
|
||||
void ModularBackend::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void ModularBackend::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
_graphicsManager->copyRectToScreen(buf, pitch, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -171,11 +171,11 @@ void ModularBackend::clearOverlay() {
|
|||
_graphicsManager->clearOverlay();
|
||||
}
|
||||
|
||||
void ModularBackend::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void ModularBackend::grabOverlay(void *buf, int pitch) {
|
||||
_graphicsManager->grabOverlay(buf, pitch);
|
||||
}
|
||||
|
||||
void ModularBackend::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void ModularBackend::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
_graphicsManager->copyRectToOverlay(buf, pitch, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -195,8 +195,8 @@ void ModularBackend::warpMouse(int x, int y) {
|
|||
_graphicsManager->warpMouse(x, y);
|
||||
}
|
||||
|
||||
void ModularBackend::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
_graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
|
||||
void ModularBackend::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
_graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, dontScale, format);
|
||||
}
|
||||
|
||||
void ModularBackend::setCursorPalette(const byte *colors, uint start, uint num) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
virtual int16 getHeight();
|
||||
virtual int16 getWidth();
|
||||
virtual PaletteManager *getPaletteManager();
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
virtual void fillScreen(uint32 col);
|
||||
|
@ -93,14 +93,14 @@ public:
|
|||
virtual void hideOverlay();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const;
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
//@}
|
||||
|
|
|
@ -11,6 +11,7 @@ MODULE_OBJS := \
|
|||
midi/alsa.o \
|
||||
midi/dmedia.o \
|
||||
midi/seq.o \
|
||||
midi/sndio.o \
|
||||
midi/stmidi.o \
|
||||
midi/timidity.o \
|
||||
saves/savefile.o \
|
||||
|
|
|
@ -554,6 +554,7 @@ void OSystem_Android::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = tm.tm_mday;
|
||||
td.tm_mon = tm.tm_mon;
|
||||
td.tm_year = tm.tm_year;
|
||||
td.tm_wday = tm.tm_wday;
|
||||
}
|
||||
|
||||
void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s,
|
||||
|
|
|
@ -244,7 +244,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
public:
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y,
|
||||
int w, int h);
|
||||
virtual void updateScreen();
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
|
@ -257,8 +257,8 @@ public:
|
|||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch,
|
||||
int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
|
@ -267,9 +267,9 @@ public:
|
|||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
|
||||
int hotspotY, uint32 keycolor,
|
||||
int cursorTargetScale,
|
||||
bool dontScale,
|
||||
const Graphics::PixelFormat *format);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
|
|
|
@ -130,7 +130,18 @@ $(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png: $(PATH_RESOURCES)/drawable/scum
|
|||
$(FILE_RESOURCES_MAIN): $(FILE_MANIFEST) $(RESOURCES) $(ANDROID_JAR8) $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA)
|
||||
$(INSTALL) -d $(PATH_BUILD_ASSETS)
|
||||
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(PATH_BUILD_ASSETS)/
|
||||
$(AAPT) package -f -M $< -S $(PATH_RESOURCES) -A $(PATH_BUILD_ASSETS) -I $(ANDROID_JAR8) -F $@
|
||||
work_dir=`pwd`; \
|
||||
for i in $(PATH_BUILD_ASSETS)/*.zip; do \
|
||||
echo "recompress $$i"; \
|
||||
cd $$work_dir; \
|
||||
$(RM) -rf $(PATH_BUILD_ASSETS)/tmp; \
|
||||
$(MKDIR) $(PATH_BUILD_ASSETS)/tmp; \
|
||||
unzip -q $$i -d $(PATH_BUILD_ASSETS)/tmp; \
|
||||
cd $(PATH_BUILD_ASSETS)/tmp; \
|
||||
zip -r ../`basename $$i` *; \
|
||||
done
|
||||
@$(RM) -rf $(PATH_BUILD_ASSETS)/tmp
|
||||
$(AAPT) package -f -0 zip -M $< -S $(PATH_RESOURCES) -A $(PATH_BUILD_ASSETS) -I $(ANDROID_JAR8) -F $@
|
||||
|
||||
$(PATH_BUILD)/%/$(FILE_RESOURCES): $(PATH_BUILD)/%/AndroidManifest.xml $(PATH_STAGE_PREFIX).%/res/values/strings.xml $(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png plugins/lib%.so $(ANDROID_JAR8)
|
||||
$(AAPT) package -f -M $< -S $(PATH_STAGE_PREFIX).$*/res -I $(ANDROID_JAR8) -F $@
|
||||
|
|
|
@ -421,7 +421,7 @@ void OSystem_Android::grabPalette(byte *colors, uint start, uint num) {
|
|||
pf.colorToRGB(READ_UINT16(p), colors[0], colors[1], colors[2]);
|
||||
}
|
||||
|
||||
void OSystem_Android::copyRectToScreen(const byte *buf, int pitch,
|
||||
void OSystem_Android::copyRectToScreen(const void *buf, int pitch,
|
||||
int x, int y, int w, int h) {
|
||||
ENTER("%p, %d, %d, %d, %d, %d", buf, pitch, x, y, w, h);
|
||||
|
||||
|
@ -636,33 +636,32 @@ void OSystem_Android::clearOverlay() {
|
|||
_overlay_texture->fillBuffer(0);
|
||||
}
|
||||
|
||||
void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_Android::grabOverlay(void *buf, int pitch) {
|
||||
ENTER("%p, %d", buf, pitch);
|
||||
|
||||
GLTHREADCHECK;
|
||||
|
||||
const Graphics::Surface *surface = _overlay_texture->surface_const();
|
||||
assert(surface->format.bytesPerPixel == sizeof(buf[0]));
|
||||
assert(surface->format.bytesPerPixel == sizeof(uint16));
|
||||
|
||||
byte *dst = (byte *)buf;
|
||||
const byte *src = (const byte *)surface->pixels;
|
||||
uint h = surface->h;
|
||||
|
||||
do {
|
||||
memcpy(buf, src, surface->w * surface->format.bytesPerPixel);
|
||||
memcpy(dst, src, surface->w * surface->format.bytesPerPixel);
|
||||
src += surface->pitch;
|
||||
// This 'pitch' is pixels not bytes
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void OSystem_Android::copyRectToOverlay(const OverlayColor *buf, int pitch,
|
||||
void OSystem_Android::copyRectToOverlay(const void *buf, int pitch,
|
||||
int x, int y, int w, int h) {
|
||||
ENTER("%p, %d, %d, %d, %d, %d", buf, pitch, x, y, w, h);
|
||||
|
||||
GLTHREADCHECK;
|
||||
|
||||
// This 'pitch' is pixels not bytes
|
||||
_overlay_texture->updateBuffer(x, y, w, h, buf, pitch * sizeof(buf[0]));
|
||||
_overlay_texture->updateBuffer(x, y, w, h, buf, pitch);
|
||||
}
|
||||
|
||||
int16 OSystem_Android::getOverlayHeight() {
|
||||
|
@ -685,12 +684,12 @@ bool OSystem_Android::showMouse(bool visible) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
|
||||
void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h,
|
||||
int hotspotX, int hotspotY,
|
||||
uint32 keycolor, int cursorTargetScale,
|
||||
uint32 keycolor, bool dontScale,
|
||||
const Graphics::PixelFormat *format) {
|
||||
ENTER("%p, %u, %u, %d, %d, %u, %d, %p", buf, w, h, hotspotX, hotspotY,
|
||||
keycolor, cursorTargetScale, format);
|
||||
keycolor, dontScale, format);
|
||||
|
||||
GLTHREADCHECK;
|
||||
|
||||
|
@ -741,7 +740,7 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
|
|||
byte *tmp = new byte[pitch * h];
|
||||
|
||||
// meh, a 16bit cursor without alpha bits... this is so silly
|
||||
if (!crossBlit(tmp, buf, pitch, w * 2, w, h,
|
||||
if (!crossBlit(tmp, (const byte *)buf, pitch, w * 2, w, h,
|
||||
_mouse_texture->getPixelFormat(),
|
||||
*format)) {
|
||||
LOGE("crossblit failed");
|
||||
|
@ -766,7 +765,8 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
|
|||
}
|
||||
|
||||
_mouse_hotspot = Common::Point(hotspotX, hotspotY);
|
||||
_mouse_targetscale = cursorTargetScale;
|
||||
// TODO: Adapt to the new "do not scale" cursor logic.
|
||||
_mouse_targetscale = 1;
|
||||
}
|
||||
|
||||
void OSystem_Android::setCursorPaletteInternal(const byte *colors,
|
||||
|
|
|
@ -52,9 +52,6 @@
|
|||
|
||||
// Supported GL extensions
|
||||
static bool npot_supported = false;
|
||||
#ifdef GL_OES_draw_texture
|
||||
static bool draw_tex_supported = false;
|
||||
#endif
|
||||
|
||||
static inline GLfixed xdiv(int numerator, int denominator) {
|
||||
assert(numerator < (1 << 16));
|
||||
|
@ -85,11 +82,6 @@ void GLESBaseTexture::initGLExtensions() {
|
|||
|
||||
if (token == "GL_ARB_texture_non_power_of_two")
|
||||
npot_supported = true;
|
||||
|
||||
#ifdef GL_OES_draw_texture
|
||||
if (token == "GL_OES_draw_texture")
|
||||
draw_tex_supported = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,45 +172,28 @@ void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) {
|
|||
void GLESBaseTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
|
||||
GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name));
|
||||
|
||||
#ifdef GL_OES_draw_texture
|
||||
// Great extension, but only works under specific conditions.
|
||||
// Still a work-in-progress - disabled for now.
|
||||
if (false && draw_tex_supported && !hasPalette()) {
|
||||
//GLCALL(glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE));
|
||||
const GLint crop[4] = { 0, _surface.h, _surface.w, -_surface.h };
|
||||
const GLfixed tex_width = xdiv(_surface.w, _texture_width);
|
||||
const GLfixed tex_height = xdiv(_surface.h, _texture_height);
|
||||
const GLfixed texcoords[] = {
|
||||
0, 0,
|
||||
tex_width, 0,
|
||||
0, tex_height,
|
||||
tex_width, tex_height,
|
||||
};
|
||||
|
||||
GLCALL(glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop));
|
||||
GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords));
|
||||
|
||||
// Android GLES bug?
|
||||
GLCALL(glColor4ub(0xff, 0xff, 0xff, 0xff));
|
||||
const GLshort vertices[] = {
|
||||
x, y,
|
||||
x + w, y,
|
||||
x, y + h,
|
||||
x + w, y + h,
|
||||
};
|
||||
|
||||
GLCALL(glDrawTexiOES(x, y, 0, w, h));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
const GLfixed tex_width = xdiv(_surface.w, _texture_width);
|
||||
const GLfixed tex_height = xdiv(_surface.h, _texture_height);
|
||||
const GLfixed texcoords[] = {
|
||||
0, 0,
|
||||
tex_width, 0,
|
||||
0, tex_height,
|
||||
tex_width, tex_height,
|
||||
};
|
||||
GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices));
|
||||
|
||||
GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords));
|
||||
|
||||
const GLshort vertices[] = {
|
||||
x, y,
|
||||
x + w, y,
|
||||
x, y + h,
|
||||
x + w, y + h,
|
||||
};
|
||||
|
||||
GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices));
|
||||
|
||||
assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords));
|
||||
GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2));
|
||||
}
|
||||
assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords));
|
||||
GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2));
|
||||
|
||||
clearDirty();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <FUiCtrlMessageBox.h>
|
||||
#include <FLocales.h>
|
||||
|
||||
#include "common/config-manager.h"
|
||||
#include "common/file.h"
|
||||
|
@ -42,7 +43,9 @@
|
|||
|
||||
using namespace Osp::Base;
|
||||
using namespace Osp::Base::Runtime;
|
||||
using namespace Osp::Locales;
|
||||
using namespace Osp::Ui::Controls;
|
||||
using namespace Osp::System;
|
||||
|
||||
#define DEFAULT_CONFIG_FILE "/Home/scummvm.ini"
|
||||
#define RESOURCE_PATH "/Res"
|
||||
|
@ -305,7 +308,7 @@ void BadaSystem::initBackend() {
|
|||
ConfMan.registerDefault("aspect_ratio", false);
|
||||
ConfMan.setBool("confirm_exit", false);
|
||||
|
||||
Osp::System::SystemTime::GetTicks(_epoch);
|
||||
SystemTime::GetTicks(_epoch);
|
||||
|
||||
if (E_SUCCESS != initModules()) {
|
||||
AppLog("initModules failed");
|
||||
|
@ -372,7 +375,7 @@ bool BadaSystem::pollEvent(Common::Event &event) {
|
|||
|
||||
uint32 BadaSystem::getMillis() {
|
||||
long long result, ticks = 0;
|
||||
Osp::System::SystemTime::GetTicks(ticks);
|
||||
SystemTime::GetTicks(ticks);
|
||||
result = ticks - _epoch;
|
||||
return result;
|
||||
}
|
||||
|
@ -392,13 +395,18 @@ void BadaSystem::updateScreen() {
|
|||
void BadaSystem::getTimeAndDate(TimeDate &td) const {
|
||||
DateTime currentTime;
|
||||
|
||||
if (E_SUCCESS == Osp::System::SystemTime::GetCurrentTime(currentTime)) {
|
||||
if (E_SUCCESS == SystemTime::GetCurrentTime(WALL_TIME, currentTime)) {
|
||||
td.tm_sec = currentTime.GetSecond();
|
||||
td.tm_min = currentTime.GetMinute();
|
||||
td.tm_hour = currentTime.GetHour();
|
||||
td.tm_mday = currentTime.GetDay();
|
||||
td.tm_mon = currentTime.GetMonth();
|
||||
td.tm_year = currentTime.GetYear();
|
||||
|
||||
Calendar *calendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
|
||||
calendar->SetTime(currentTime);
|
||||
td.tm_wday = calendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK) - 1;
|
||||
delete calendar;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
// Draw a bitmap to screen.
|
||||
// The screen will not be updated to reflect the new bitmap
|
||||
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
void warpMouse(int x, int y);
|
||||
|
||||
// Set the bitmap that's used when drawing the cursor.
|
||||
void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
|
||||
void setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
|
||||
|
||||
// Replace the specified range of cursor the palette with new colors.
|
||||
void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
@ -172,8 +172,8 @@ public:
|
|||
void showOverlay();
|
||||
void hideOverlay();
|
||||
void clearOverlay();
|
||||
void grabOverlay(OverlayColor *buf, int pitch);
|
||||
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
void grabOverlay(void *buf, int pitch);
|
||||
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); }
|
||||
|
||||
// Mutex handling
|
||||
|
|
|
@ -213,6 +213,7 @@ void OSystem_Dreamcast::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *OSystem_Dreamcast::createConfigReadStream() {
|
||||
|
|
|
@ -260,7 +260,7 @@ void OSystem_Dreamcast::initSize(uint w, uint h, const Graphics::PixelFormat *fo
|
|||
_devpoll = Timer();
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
||||
void OSystem_Dreamcast::copyRectToScreen(const void *buf, int pitch, int x, int y,
|
||||
int w, int h)
|
||||
{
|
||||
if (w<1 || h<1)
|
||||
|
@ -269,10 +269,11 @@ void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int
|
|||
x<<=1; w<<=1;
|
||||
}
|
||||
unsigned char *dst = screen + y*SCREEN_W*2 + x;
|
||||
const byte *src = (const byte *)buf;
|
||||
do {
|
||||
memcpy(dst, buf, w);
|
||||
memcpy(dst, src, w);
|
||||
dst += SCREEN_W*2;
|
||||
buf += pitch;
|
||||
src += pitch;
|
||||
} while (--h);
|
||||
_screen_dirty = true;
|
||||
}
|
||||
|
@ -291,9 +292,9 @@ void OSystem_Dreamcast::warpMouse(int x, int y)
|
|||
_ms_cur_y = y;
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
|
||||
void OSystem_Dreamcast::setMouseCursor(const void *buf, uint w, uint h,
|
||||
int hotspot_x, int hotspot_y,
|
||||
uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
|
||||
uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format)
|
||||
{
|
||||
_ms_cur_w = w;
|
||||
_ms_cur_h = h;
|
||||
|
@ -652,27 +653,29 @@ void OSystem_Dreamcast::clearOverlay()
|
|||
_overlay_dirty = true;
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::grabOverlay(OverlayColor *buf, int pitch)
|
||||
void OSystem_Dreamcast::grabOverlay(void *buf, int pitch)
|
||||
{
|
||||
int h = OVL_H;
|
||||
unsigned short *src = overlay;
|
||||
unsigned char *dst = (unsigned char *)buf;
|
||||
do {
|
||||
memcpy(buf, src, OVL_W*sizeof(int16));
|
||||
memcpy(dst, src, OVL_W*sizeof(int16));
|
||||
src += OVL_W;
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::copyRectToOverlay(const OverlayColor *buf, int pitch,
|
||||
void OSystem_Dreamcast::copyRectToOverlay(const void *buf, int pitch,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
if (w<1 || h<1)
|
||||
return;
|
||||
unsigned short *dst = overlay + y*OVL_W + x;
|
||||
const unsigned char *src = (const unsigned char *)buf;
|
||||
do {
|
||||
memcpy(dst, buf, w*sizeof(int16));
|
||||
memcpy(dst, src, w*sizeof(int16));
|
||||
dst += OVL_W;
|
||||
buf += pitch;
|
||||
src += pitch;
|
||||
} while (--h);
|
||||
_overlay_dirty = true;
|
||||
}
|
||||
|
|
|
@ -316,8 +316,9 @@ public:
|
|||
class VMSaveManager : public Common::SaveFileManager {
|
||||
public:
|
||||
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
|
||||
return Common::wrapCompressedWriteStream(new OutVMSave(filename.c_str()));
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
|
||||
OutVMSave *s = new OutVMSave(filename.c_str());
|
||||
return compress ? Common::wrapCompressedWriteStream(s) : s;
|
||||
}
|
||||
|
||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename) {
|
||||
|
|
|
@ -29,10 +29,27 @@ file included into the scummvm directory you copied to the SD card, and then lau
|
|||
|
||||
Building from binaries
|
||||
==============================
|
||||
* ToDO *
|
||||
It's pretty simple if you are running Linux on an x86/amd64 machine:
|
||||
1. Download and install the OpenDingux toolchain (http://www.treewalker.org/opendingux/)
|
||||
2. Download ScummVM sources and uncompress them
|
||||
3. Create a build directory and run configure specifying the correct library path. Eg.
|
||||
mkdir build_dingux
|
||||
LDFLAGS="-L/path-to-toolchain/usr/lib" ../path-to-scummvm-sources/configure --host=dingux --enable-plugins --default-dynamic
|
||||
make
|
||||
4. Prepare the distribution directory
|
||||
make dingux-dist
|
||||
5. Copy the distribution directory located in dingux-dist/scummvm to your SD card
|
||||
6. Enjoy
|
||||
|
||||
Kernel and rootfs WARNINGS
|
||||
==============================
|
||||
|
||||
*** A WARNING about the WARNING! ***
|
||||
The info below should no longer be valid relating to the new OpenDingux (http://www.treewalker.org/opendingux/)
|
||||
toolchain. When using OpenDingux you don't need custom kernels or libraries,
|
||||
after some checking I will remove the following warnings and keep OpenDingux
|
||||
as the only supported toolchain.
|
||||
|
||||
All the dingux root images (rootfs) i found floating on the net have
|
||||
broken tremor libraries, which make scummvm crash in a bad way.
|
||||
One solution is to replace the libraries in your rootfs by injecting these fixed ones:
|
||||
|
|
|
@ -28,3 +28,4 @@ endif
|
|||
$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip $(bundle_name)/
|
||||
$(CP) $(srcdir)/backends/platform/dingux/scummvm.gpe $(bundle_name)/
|
||||
$(CP) $(srcdir)/backends/platform/dingux/README.DINGUX $(bundle_name)/
|
||||
$(CP) $(srcdir)/backends/platform/dingux/scummvm.png $(bundle_name)/
|
||||
|
|
BIN
backends/platform/dingux/scummvm.png
Normal file
BIN
backends/platform/dingux/scummvm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
|
@ -45,7 +45,7 @@ static Common::String getSavePath() {
|
|||
// GBAMP Save File Manager
|
||||
//////////////////////////
|
||||
|
||||
Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename) {
|
||||
Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename, bool compress) {
|
||||
Common::String fileSpec = getSavePath();
|
||||
if (fileSpec.lastChar() != '/')
|
||||
fileSpec += '/';
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
class GBAMPSaveFileManager : public Common::SaveFileManager {
|
||||
public:
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
|
||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
|
||||
|
||||
virtual bool removeSavefile(const Common::String &filename);
|
||||
|
|
|
@ -280,7 +280,7 @@ void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
|
|||
|
||||
#define MISALIGNED16(ptr) (((u32) (ptr) & 1) != 0)
|
||||
|
||||
void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_DS::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
if (!_graphicsEnable) return;
|
||||
if (w <= 1) return;
|
||||
if (h < 0) return;
|
||||
|
@ -509,13 +509,13 @@ void OSystem_DS::clearOverlay() {
|
|||
// consolePrintf("clearovl\n");
|
||||
}
|
||||
|
||||
void OSystem_DS::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_DS::grabOverlay(void *buf, int pitch) {
|
||||
// consolePrintf("grabovl\n")
|
||||
u16 *start = DS::get16BitBackBuffer();
|
||||
|
||||
for (int y = 0; y < 200; y++) {
|
||||
u16 *src = start + (y * 320);
|
||||
u16 *dest = ((u16 *) (buf)) + (y * pitch);
|
||||
u16 *dest = (u16 *)((u8 *)buf + (y * pitch));
|
||||
|
||||
for (int x = 0; x < 320; x++) {
|
||||
*dest++ = *src++;
|
||||
|
@ -524,9 +524,9 @@ void OSystem_DS::grabOverlay(OverlayColor *buf, int pitch) {
|
|||
|
||||
}
|
||||
|
||||
void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_DS::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
u16 *bg = (u16 *) DS::get16BitBackBuffer();
|
||||
const u16 *src = (const u16 *) buf;
|
||||
const u8 *source = (const u8 *)buf;
|
||||
|
||||
// if (x + w > 256) w = 256 - x;
|
||||
//if (x + h > 256) h = 256 - y;
|
||||
|
@ -536,7 +536,7 @@ void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, in
|
|||
|
||||
|
||||
for (int dy = y; dy < y + h; dy++) {
|
||||
|
||||
const u16 *src = (const u16 *)source;
|
||||
|
||||
// Slow but save copy:
|
||||
for (int dx = x; dx < x + w; dx++) {
|
||||
|
@ -546,7 +546,7 @@ void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, in
|
|||
//consolePrintf("%d,", *src);
|
||||
src++;
|
||||
}
|
||||
src += (pitch - w);
|
||||
source += pitch;
|
||||
|
||||
// Fast but broken copy: (why?)
|
||||
/*
|
||||
|
@ -580,7 +580,7 @@ bool OSystem_DS::showMouse(bool visible) {
|
|||
void OSystem_DS::warpMouse(int x, int y) {
|
||||
}
|
||||
|
||||
void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, int targetCursorScale, const Graphics::PixelFormat *format) {
|
||||
void OSystem_DS::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
if ((w > 0) && (w < 64) && (h > 0) && (h < 64)) {
|
||||
memcpy(_cursorImage, buf, w * h);
|
||||
_cursorW = w;
|
||||
|
@ -588,7 +588,9 @@ void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, i
|
|||
_cursorHotX = hotspotX;
|
||||
_cursorHotY = hotspotY;
|
||||
_cursorKey = keycolor;
|
||||
_cursorScale = targetCursorScale;
|
||||
// TODO: The old target scales was saved, but never used. Should the
|
||||
// new "do not scale" logic be implemented?
|
||||
//_cursorScale = targetCursorScale;
|
||||
refreshCursor();
|
||||
}
|
||||
}
|
||||
|
@ -688,6 +690,7 @@ void OSystem_DS::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
FilesystemFactory *OSystem_DS::getFilesystemFactory() {
|
||||
|
|
|
@ -98,15 +98,15 @@ protected:
|
|||
public:
|
||||
void restoreHardwarePalette();
|
||||
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void updateScreen();
|
||||
virtual void setShakePos(int shakeOffset);
|
||||
|
||||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<1555>(); }
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, int targetCursorScale, const Graphics::PixelFormat *format);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
|
||||
|
||||
virtual bool pollEvent(Common::Event &event);
|
||||
virtual uint32 getMillis();
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if defined(GPH_DEVICE)
|
||||
|
||||
// Disable symbol overrides so that we can use system headers.
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
|
@ -32,8 +34,6 @@
|
|||
#include "backends/saves/default/default-saves.h"
|
||||
#include "backends/timer/default/default-timer.h"
|
||||
|
||||
#include "base/main.h"
|
||||
|
||||
#include "common/archive.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "common/debug.h"
|
||||
|
@ -64,23 +64,6 @@ void OSystem_GPH::initBackend() {
|
|||
|
||||
assert(!_inited);
|
||||
|
||||
// Create the events manager
|
||||
if (_eventSource == 0)
|
||||
_eventSource = new GPHEventSource();
|
||||
|
||||
// Create the graphics manager
|
||||
if (_graphicsManager == 0) {
|
||||
_graphicsManager = new GPHGraphicsManager(_eventSource);
|
||||
}
|
||||
|
||||
// Create the mixer manager
|
||||
if (_mixer == 0) {
|
||||
_mixerManager = new DoubleBufferSDLMixerManager();
|
||||
|
||||
// Setup and start mixer
|
||||
_mixerManager->init();
|
||||
}
|
||||
|
||||
/* Setup default save path to be workingdir/saves */
|
||||
|
||||
char savePath[PATH_MAX+1];
|
||||
|
@ -165,16 +148,42 @@ void OSystem_GPH::initBackend() {
|
|||
/* Make sure that aspect ratio correction is enabled on the 1st run to stop
|
||||
users asking me what the 'wasted space' at the bottom is ;-). */
|
||||
ConfMan.registerDefault("aspect_ratio", true);
|
||||
ConfMan.registerDefault("fullscreen", true);
|
||||
|
||||
/* Make sure SDL knows that we have a joystick we want to use. */
|
||||
ConfMan.setInt("joystick_num", 0);
|
||||
|
||||
// Create the events manager
|
||||
if (_eventSource == 0)
|
||||
_eventSource = new GPHEventSource();
|
||||
|
||||
// Create the graphics manager
|
||||
if (_graphicsManager == 0) {
|
||||
_graphicsManager = new GPHGraphicsManager(_eventSource);
|
||||
}
|
||||
|
||||
/* Pass to POSIX method to do the heavy lifting */
|
||||
OSystem_POSIX::initBackend();
|
||||
|
||||
_inited = true;
|
||||
}
|
||||
|
||||
void OSystem_GPH::initSDL() {
|
||||
// Check if SDL has not been initialized
|
||||
if (!_initedSDL) {
|
||||
|
||||
uint32 sdlFlags = SDL_INIT_EVENTTHREAD;
|
||||
if (ConfMan.hasKey("disable_sdl_parachute"))
|
||||
sdlFlags |= SDL_INIT_NOPARACHUTE;
|
||||
|
||||
// Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers)
|
||||
if (SDL_Init(sdlFlags) == -1)
|
||||
error("Could not initialize SDL: %s", SDL_GetError());
|
||||
|
||||
_initedSDL = true;
|
||||
}
|
||||
}
|
||||
|
||||
void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
|
||||
|
||||
/* Setup default extra data paths for engine data files and plugins */
|
||||
|
@ -222,3 +231,5 @@ void OSystem_GPH::quit() {
|
|||
|
||||
OSystem_POSIX::quit();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include "backends/platform/gph/gph.h"
|
||||
#include "backends/plugins/posix/posix-provider.h"
|
||||
#include "backends/plugins/sdl/sdl-provider.h"
|
||||
#include "base/main.h"
|
||||
|
||||
#if defined(GPH_DEVICE)
|
||||
|
@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
|
|||
((OSystem_GPH *)g_system)->init();
|
||||
|
||||
#ifdef DYNAMIC_MODULES
|
||||
PluginManager::instance().addPluginProvider(new POSIXPluginProvider());
|
||||
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
|
||||
#endif
|
||||
|
||||
// Invoke the actual ScummVM main entry point:
|
||||
|
|
|
@ -26,13 +26,11 @@
|
|||
#if defined(GPH_DEVICE)
|
||||
|
||||
#include "backends/base-backend.h"
|
||||
#include "backends/platform/sdl/sdl.h"
|
||||
#include "backends/platform/sdl/sdl-sys.h"
|
||||
#include "backends/platform/sdl/posix/posix.h"
|
||||
#include "backends/events/gph/gph-events.h"
|
||||
#include "backends/graphics/gph/gph-graphics.h"
|
||||
|
||||
#define __GP2XWIZ__
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 255
|
||||
#endif
|
||||
|
@ -45,6 +43,11 @@ public:
|
|||
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
|
||||
void initBackend();
|
||||
void quit();
|
||||
|
||||
protected:
|
||||
bool _inited;
|
||||
bool _initedSDL;
|
||||
virtual void initSDL();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -235,6 +235,7 @@ void OSystem_IPHONE::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
Audio::Mixer *OSystem_IPHONE::getMixer() {
|
||||
|
|
|
@ -143,7 +143,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
public:
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void updateScreen();
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
|
@ -152,8 +152,8 @@ public:
|
|||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<5551>(); }
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
virtual bool pollEvent(Common::Event &event);
|
||||
|
|
|
@ -161,18 +161,19 @@ void OSystem_IPHONE::grabPalette(byte *colors, uint start, uint num) {
|
|||
}
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_IPHONE::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
//printf("copyRectToScreen(%p, %d, %i, %i, %i, %i)\n", buf, pitch, x, y, w, h);
|
||||
//Clip the coordinates
|
||||
const byte *src = (const byte *)buf;
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -193,11 +194,11 @@ void OSystem_IPHONE::copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
|||
|
||||
byte *dst = (byte *)_framebuffer.getBasePtr(x, y);
|
||||
if (_framebuffer.pitch == pitch && _framebuffer.w == w) {
|
||||
memcpy(dst, buf, h * pitch);
|
||||
memcpy(dst, src, h * pitch);
|
||||
} else {
|
||||
do {
|
||||
memcpy(dst, buf, w * _framebuffer.format.bytesPerPixel);
|
||||
buf += pitch;
|
||||
memcpy(dst, src, w * _framebuffer.format.bytesPerPixel);
|
||||
src += pitch;
|
||||
dst += _framebuffer.pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
@ -308,31 +309,33 @@ void OSystem_IPHONE::clearOverlay() {
|
|||
dirtyFullOverlayScreen();
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_IPHONE::grabOverlay(void *buf, int pitch) {
|
||||
//printf("grabOverlay()\n");
|
||||
int h = _videoContext->overlayHeight;
|
||||
|
||||
byte *dst = (byte *)buf;
|
||||
const byte *src = (const byte *)_videoContext->overlayTexture.getBasePtr(0, 0);
|
||||
do {
|
||||
memcpy(buf, src, _videoContext->overlayWidth * sizeof(OverlayColor));
|
||||
memcpy(dst, src, _videoContext->overlayWidth * sizeof(uint16));
|
||||
src += _videoContext->overlayTexture.pitch;
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_IPHONE::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
//printf("copyRectToOverlay(%p, pitch=%i, x=%i, y=%i, w=%i, h=%i)\n", (const void *)buf, pitch, x, y, w, h);
|
||||
const byte *src = (const byte *)buf;
|
||||
|
||||
//Clip the coordinates
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * sizeof(uint16);
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -351,8 +354,8 @@ void OSystem_IPHONE::copyRectToOverlay(const OverlayColor *buf, int pitch, int x
|
|||
|
||||
byte *dst = (byte *)_videoContext->overlayTexture.getBasePtr(x, y);
|
||||
do {
|
||||
memcpy(dst, buf, w * sizeof(OverlayColor));
|
||||
buf += pitch;
|
||||
memcpy(dst, src, w * sizeof(uint16));
|
||||
src += pitch;
|
||||
dst += _videoContext->overlayTexture.pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
@ -398,8 +401,8 @@ void OSystem_IPHONE::dirtyFullOverlayScreen() {
|
|||
}
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
//printf("setMouseCursor(%p, %u, %u, %i, %i, %u, %d, %p)\n", (const void *)buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, (const void *)format);
|
||||
void OSystem_IPHONE::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
//printf("setMouseCursor(%p, %u, %u, %i, %i, %u, %d, %p)\n", (const void *)buf, w, h, hotspotX, hotspotY, keycolor, dontScale, (const void *)format);
|
||||
|
||||
const Graphics::PixelFormat pixelFormat = format ? *format : Graphics::PixelFormat::createFormatCLUT8();
|
||||
#if 0
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
scummvm (1.5.0~git) unstable; urgency=low
|
||||
scummvm (1.6.0~git) unstable; urgency=low
|
||||
|
||||
* Development snapshot
|
||||
|
||||
-- Tarek Soliman <tsoliman@scummvm.org> Tue, 15 Nov 2011 14:56:57 -0600
|
||||
-- Tarek Soliman <tsoliman@scummvm.org> Tue, 10 Jul 2012 23:02:00 -0500
|
||||
|
||||
scummvm (1.5.0) unstable; urgency=low
|
||||
|
||||
* 1.5.0 release
|
||||
|
||||
-- Tarek Soliman <tsoliman@scummvm.org> Fri, 20 Jul 2012 14:48:44 -0500
|
||||
|
||||
scummvm (1.4.1) unstable; urgency=low
|
||||
|
||||
* 1.4.1 release
|
||||
|
||||
-- Tarek Soliman <tsoliman@scummvm.org> Wed, 11 Jan 2012 17:17:26 -0600
|
||||
|
||||
scummvm (1.4.0) unstable; urgency=low
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ Source: scummvm
|
|||
Section: user/games
|
||||
Priority: optional
|
||||
Maintainer: Tarek Soliman <tsoliman@scummvm.org>
|
||||
Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libz-dev, quilt
|
||||
Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libfreetype6-dev, libz-dev, quilt
|
||||
|
||||
Standards-Version: 3.6.1.1
|
||||
Package: scummvm
|
||||
|
|
|
@ -50,7 +50,7 @@ install: build
|
|||
install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share
|
||||
|
||||
install -m0644 -d debian/scummvm/usr/share/doc/scummvm
|
||||
install -m0644 NEWS README COPYRIGHT debian/scummvm/usr/share/doc/scummvm
|
||||
install -m0644 AUTHORS COPYING COPYING.BSD COPYING.FREEFONT COPYING.LGPL COPYRIGHT NEWS README debian/scummvm/usr/share/doc/scummvm
|
||||
binary: binary-arch
|
||||
|
||||
binary-arch: build install
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace Maemo {
|
|||
|
||||
OSystem_SDL_Maemo::OSystem_SDL_Maemo()
|
||||
:
|
||||
_eventObserver(0),
|
||||
OSystem_POSIX() {
|
||||
}
|
||||
|
||||
|
@ -84,6 +85,9 @@ static void registerDefaultKeyBindings(Common::KeymapperDefaultBindings *_keymap
|
|||
#endif
|
||||
|
||||
void OSystem_SDL_Maemo::initBackend() {
|
||||
ConfMan.registerDefault("fullscreen", true);
|
||||
ConfMan.registerDefault("aspect_ratio", true);
|
||||
|
||||
// Create the events manager
|
||||
if (_eventSource == 0)
|
||||
_eventSource = new MaemoSdlEventSource();
|
||||
|
@ -180,6 +184,7 @@ void OSystem_SDL_Maemo::setupIcon() {
|
|||
// http://bugzilla.libsdl.org/show_bug.cgi?id=586
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
static const Common::KeyTableEntry maemoKeys[] = {
|
||||
// Function keys
|
||||
{"MENU", Common::KEYCODE_F11, 0, "Menu", false},
|
||||
|
@ -191,7 +196,6 @@ static const Common::KeyTableEntry maemoKeys[] = {
|
|||
{0, Common::KEYCODE_INVALID, 0, 0, false}
|
||||
};
|
||||
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() {
|
||||
return new Common::HardwareInputSet(true, maemoKeys);
|
||||
}
|
||||
|
|
|
@ -100,10 +100,10 @@ public:
|
|||
class FRAMSaveManager : public Common::SaveFileManager {
|
||||
public:
|
||||
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
|
||||
OutFRAMSave *s = new OutFRAMSave(filename.c_str());
|
||||
if (!s->err()) {
|
||||
return Common::wrapCompressedWriteStream(s);
|
||||
return compress ? Common::wrapCompressedWriteStream(s) : s;
|
||||
} else {
|
||||
delete s;
|
||||
return 0;
|
||||
|
|
|
@ -81,7 +81,7 @@ protected:
|
|||
|
||||
uint16 *_offscreen_hic; // Offscreen converted to 16bit surface
|
||||
uint8 *_offscreen_pal; // Offscreen with palette indexes
|
||||
OverlayColor *_overlayBuffer; // Offscreen for the overlay (16 bit)
|
||||
uint16 *_overlayBuffer; // Offscreen for the overlay (16 bit)
|
||||
|
||||
uint16 *_screenPalette; // Array for palette entries (256 colors max)
|
||||
|
||||
|
@ -162,7 +162,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
public:
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void updateScreen();
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
|
@ -171,8 +171,8 @@ public:
|
|||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const {
|
||||
|
@ -182,7 +182,7 @@ public:
|
|||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
virtual bool pollEvent(Common::Event &event);
|
||||
|
|
|
@ -95,7 +95,7 @@ OSystem_N64::OSystem_N64() {
|
|||
// Allocate memory for offscreen buffers
|
||||
_offscreen_hic = (uint16 *)memalign(8, _screenWidth * _screenHeight * 2);
|
||||
_offscreen_pal = (uint8 *)memalign(8, _screenWidth * _screenHeight);
|
||||
_overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
|
||||
_overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(uint16));
|
||||
|
||||
_cursor_pal = NULL;
|
||||
_cursor_hic = NULL;
|
||||
|
@ -108,7 +108,7 @@ OSystem_N64::OSystem_N64() {
|
|||
// Clean offscreen buffers
|
||||
memset(_offscreen_hic, 0, _screenWidth * _screenHeight * 2);
|
||||
memset(_offscreen_pal, 0, _screenWidth * _screenHeight);
|
||||
memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
|
||||
memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(uint16));
|
||||
|
||||
// Default graphic mode
|
||||
_graphicMode = OVERS_NTSC_340X240;
|
||||
|
@ -442,17 +442,18 @@ void OSystem_N64::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
_dirtyOffscreen = true;
|
||||
}
|
||||
|
||||
void OSystem_N64::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_N64::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
//Clip the coordinates
|
||||
const byte *src = (const byte *)buf;
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -472,14 +473,14 @@ void OSystem_N64::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
|
|||
|
||||
do {
|
||||
for (int hor = 0; hor < w; hor++) {
|
||||
if (dst_pal[hor] != buf[hor]) {
|
||||
uint16 color = _screenPalette[buf[hor]];
|
||||
if (dst_pal[hor] != src[hor]) {
|
||||
uint16 color = _screenPalette[src[hor]];
|
||||
dst_hicol[hor] = color; // Save image converted to 16-bit
|
||||
dst_pal[hor] = buf[hor]; // Save palettized display
|
||||
dst_pal[hor] = src[hor]; // Save palettized display
|
||||
}
|
||||
}
|
||||
|
||||
buf += pitch;
|
||||
src += pitch;
|
||||
dst_pal += _screenWidth;
|
||||
dst_hicol += _screenWidth;
|
||||
} while (--h);
|
||||
|
@ -666,7 +667,7 @@ void OSystem_N64::hideOverlay() {
|
|||
}
|
||||
|
||||
void OSystem_N64::clearOverlay() {
|
||||
memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
|
||||
memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(uint16));
|
||||
|
||||
uint8 skip_lines = (_screenHeight - _gameHeight) / 4;
|
||||
uint8 skip_pixels = (_screenWidth - _gameWidth) / 2; // Center horizontally the image
|
||||
|
@ -682,28 +683,30 @@ void OSystem_N64::clearOverlay() {
|
|||
_dirtyOffscreen = true;
|
||||
}
|
||||
|
||||
void OSystem_N64::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_N64::grabOverlay(void *buf, int pitch) {
|
||||
int h = _overlayHeight;
|
||||
OverlayColor *src = _overlayBuffer;
|
||||
uint16 *src = _overlayBuffer;
|
||||
byte *dst = (byte *)buf;
|
||||
|
||||
do {
|
||||
memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
|
||||
memcpy(dst, src, _overlayWidth * sizeof(uint16));
|
||||
src += _overlayWidth;
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void OSystem_N64::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_N64::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
const byte *src = (const byte *)buf;
|
||||
//Clip the coordinates
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * sizeof(uint16);
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -719,14 +722,14 @@ void OSystem_N64::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, i
|
|||
return;
|
||||
|
||||
|
||||
OverlayColor *dst = _overlayBuffer + (y * _overlayWidth + x);
|
||||
uint16 *dst = _overlayBuffer + (y * _overlayWidth + x);
|
||||
|
||||
if (_overlayWidth == pitch && pitch == w) {
|
||||
memcpy(dst, buf, h * w * sizeof(OverlayColor));
|
||||
if (_overlayWidth == w && pitch == _overlayWidth * sizeof(uint16)) {
|
||||
memcpy(dst, src, h * pitch);
|
||||
} else {
|
||||
do {
|
||||
memcpy(dst, buf, w * sizeof(OverlayColor));
|
||||
buf += pitch;
|
||||
memcpy(dst, src, w * sizeof(uint16));
|
||||
src += pitch;
|
||||
dst += _overlayWidth;
|
||||
} while (--h);
|
||||
}
|
||||
|
@ -773,7 +776,7 @@ void OSystem_N64::warpMouse(int x, int y) {
|
|||
_dirtyOffscreen = true;
|
||||
}
|
||||
|
||||
void OSystem_N64::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
void OSystem_N64::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
if (!w || !h) return;
|
||||
|
||||
_mouseHotspotX = hotspotX;
|
||||
|
@ -866,6 +869,7 @@ void OSystem_N64::getTimeAndDate(TimeDate &t) const {
|
|||
t.tm_mday = 1;
|
||||
t.tm_mon = 0;
|
||||
t.tm_year = 110;
|
||||
t.tm_wday = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -101,10 +101,10 @@ public:
|
|||
class PAKSaveManager : public Common::SaveFileManager {
|
||||
public:
|
||||
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename) {
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) {
|
||||
OutPAKSave *s = new OutPAKSave(filename.c_str());
|
||||
if (!s->err()) {
|
||||
return Common::wrapCompressedWriteStream(s);
|
||||
return compress ? Common::wrapCompressedWriteStream(s) : s;
|
||||
} else {
|
||||
delete s;
|
||||
return NULL;
|
||||
|
|
|
@ -54,53 +54,15 @@
|
|||
/* Dump console info to files. */
|
||||
#define DUMP_STDOUT
|
||||
|
||||
static SDL_Cursor *hiddenCursor;
|
||||
|
||||
OSystem_OP::OSystem_OP()
|
||||
:
|
||||
OSystem_POSIX() {
|
||||
}
|
||||
|
||||
//static Uint32 timer_handler(Uint32 interval, void *param) {
|
||||
// ((DefaultTimerManager *)param)->handler();
|
||||
// return interval;
|
||||
//}
|
||||
|
||||
void OSystem_OP::initBackend() {
|
||||
|
||||
assert(!_inited);
|
||||
|
||||
// Create the events manager
|
||||
if (_eventSource == 0)
|
||||
_eventSource = new OPEventSource();
|
||||
|
||||
// Create the graphics manager
|
||||
if (_graphicsManager == 0) {
|
||||
_graphicsManager = new OPGraphicsManager(_eventSource);
|
||||
}
|
||||
|
||||
// int joystick_num = ConfMan.getInt("joystick_num");
|
||||
// uint32 sdlFlags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
|
||||
//
|
||||
// if (ConfMan.hasKey("disable_sdl_parachute"))
|
||||
// sdlFlags |= SDL_INIT_NOPARACHUTE;
|
||||
//
|
||||
// if (joystick_num > -1)
|
||||
// sdlFlags |= SDL_INIT_JOYSTICK;
|
||||
//
|
||||
// if (SDL_Init(sdlFlags) == -1) {
|
||||
// error("Could not initialize SDL: %s", SDL_GetError());
|
||||
// }
|
||||
//
|
||||
|
||||
// Create the mixer manager
|
||||
// if (_mixer == 0) {
|
||||
// _mixerManager = new DoubleBufferSDLMixerManager();
|
||||
|
||||
// Setup and start mixer
|
||||
// _mixerManager->init();
|
||||
// }
|
||||
|
||||
/* Setup default save path to be workingdir/saves */
|
||||
|
||||
char savePath[PATH_MAX+1];
|
||||
|
@ -179,7 +141,14 @@ void OSystem_OP::initBackend() {
|
|||
/* Make sure SDL knows that we have a joystick we want to use. */
|
||||
ConfMan.setInt("joystick_num", 0);
|
||||
|
||||
// _graphicsMutex = createMutex();
|
||||
// Create the events manager
|
||||
if (_eventSource == 0)
|
||||
_eventSource = new OPEventSource();
|
||||
|
||||
// Create the graphics manager
|
||||
if (_graphicsManager == 0) {
|
||||
_graphicsManager = new OPGraphicsManager(_eventSource);
|
||||
}
|
||||
|
||||
/* Pass to POSIX method to do the heavy lifting */
|
||||
OSystem_POSIX::initBackend();
|
||||
|
@ -187,24 +156,6 @@ void OSystem_OP::initBackend() {
|
|||
_inited = true;
|
||||
}
|
||||
|
||||
// enable joystick
|
||||
// if (joystick_num > -1 && SDL_NumJoysticks() > 0) {
|
||||
// printf("Using joystick: %s\n", SDL_JoystickName(0));
|
||||
// _joystick = SDL_JoystickOpen(joystick_num);
|
||||
// }
|
||||
//
|
||||
// setupMixer();
|
||||
|
||||
// Note: We could implement a custom SDLTimerManager by using
|
||||
// SDL_AddTimer. That might yield better timer resolution, but it would
|
||||
// also change the semantics of a timer: Right now, ScummVM timers
|
||||
// *never* run in parallel, due to the way they are implemented. If we
|
||||
// switched to SDL_AddTimer, each timer might run in a separate thread.
|
||||
// However, not all our code is prepared for that, so we can't just
|
||||
// switch. Still, it's a potential future change to keep in mind.
|
||||
// _timer = new DefaultTimerManager();
|
||||
// _timerID = SDL_AddTimer(10, &timer_handler, _timer);
|
||||
|
||||
void OSystem_OP::initSDL() {
|
||||
// Check if SDL has not been initialized
|
||||
if (!_initedSDL) {
|
||||
|
@ -217,38 +168,7 @@ void OSystem_OP::initSDL() {
|
|||
if (SDL_Init(sdlFlags) == -1)
|
||||
error("Could not initialize SDL: %s", SDL_GetError());
|
||||
|
||||
uint8_t hiddenCursorData = 0;
|
||||
|
||||
hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
|
||||
|
||||
/* On the OpenPandora we need to work around an SDL assumption that
|
||||
returns relative mouse coordinates when you get to the screen
|
||||
edges using the touchscreen. The workaround is to set a blank
|
||||
SDL cursor and not disable it (Hackish I know).
|
||||
|
||||
The root issues likes in the Windows Manager GRAB code in SDL.
|
||||
That is why the issue is not seen on framebuffer devices like the
|
||||
GP2X (there is no X window manager ;)).
|
||||
*/
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
SDL_SetCursor(hiddenCursor);
|
||||
SDL_EnableUNICODE(1);
|
||||
|
||||
// memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
|
||||
// memset(&_videoMode, 0, sizeof(_videoMode));
|
||||
// memset(&_transactionDetails, 0, sizeof(_transactionDetails));
|
||||
|
||||
// _videoMode.mode = GFX_DOUBLESIZE;
|
||||
// _videoMode.scaleFactor = 2;
|
||||
// _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio");
|
||||
// _scalerProc = Normal2x;
|
||||
// _scalerType = 0;
|
||||
|
||||
// _videoMode.fullscreen = true;
|
||||
|
||||
_initedSDL = true;
|
||||
|
||||
// OSystem_POSIX::initSDL();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,8 +195,6 @@ void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
|
|||
|
||||
void OSystem_OP::quit() {
|
||||
|
||||
SDL_FreeCursor(hiddenCursor);
|
||||
|
||||
#ifdef DUMP_STDOUT
|
||||
printf("%s\n", "Debug: STDOUT and STDERR text files closed.");
|
||||
fclose(stdout);
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "backends/events/openpandora/op-events.h"
|
||||
#include "backends/graphics/openpandora/op-graphics.h"
|
||||
|
||||
//#define MIXER_DOUBLE_BUFFERING 1
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 255
|
||||
#endif
|
||||
|
|
|
@ -564,7 +564,7 @@ void Gs2dScreen::clearPrintfOverlay(void) {
|
|||
free(tmpBuf);
|
||||
}
|
||||
|
||||
void Gs2dScreen::copyOverlayRect(const uint16 *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h) {
|
||||
void Gs2dScreen::copyOverlayRect(const byte *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h) {
|
||||
WaitSema(g_DmacSema);
|
||||
|
||||
// warning("_overlayBuf [dst] = %x", _overlayBuf);
|
||||
|
@ -601,7 +601,7 @@ void Gs2dScreen::clearOverlay(void) {
|
|||
SignalSema(g_DmacSema);
|
||||
}
|
||||
|
||||
void Gs2dScreen::grabOverlay(uint16 *buf, uint16 pitch) {
|
||||
void Gs2dScreen::grabOverlay(byte *buf, uint16 pitch) {
|
||||
uint16 *src = _overlayBuf;
|
||||
for (uint32 cnt = 0; cnt < _height; cnt++) {
|
||||
memcpy(buf, src, _width * 2);
|
||||
|
|
|
@ -62,8 +62,8 @@ public:
|
|||
void updateScreen(void);
|
||||
void grabPalette(uint8 *pal, uint8 start, uint16 num);
|
||||
//- overlay routines
|
||||
void copyOverlayRect(const uint16 *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h);
|
||||
void grabOverlay(uint16 *buf, uint16 pitch);
|
||||
void copyOverlayRect(const byte *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h);
|
||||
void grabOverlay(byte *buf, uint16 pitch);
|
||||
void clearOverlay(void);
|
||||
void showOverlay(void);
|
||||
void hideOverlay(void);
|
||||
|
|
|
@ -105,8 +105,14 @@ void OSystem_PS2::readRtcTime(void) {
|
|||
g_day, g_month, g_year + 2000);
|
||||
}
|
||||
|
||||
void OSystem_PS2::getTimeAndDate(TimeDate &t) const {
|
||||
// Tomohiko Sakamoto's 1993 algorithm for any Gregorian date
|
||||
static int dayOfWeek(int y, int m, int d) {
|
||||
static const int t[] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
|
||||
y -= m < 3;
|
||||
return (y + y / 4 - y / 100 + y / 400 + t[m - 1] + d) % 7;
|
||||
}
|
||||
|
||||
void OSystem_PS2::getTimeAndDate(TimeDate &t) const {
|
||||
uint32 currentSecs = g_timeSecs + (msecCount - g_lastTimeCheck) / 1000;
|
||||
if (currentSecs >= SECONDS_PER_DAY) {
|
||||
buildNewDate(+1);
|
||||
|
@ -120,4 +126,5 @@ void OSystem_PS2::getTimeAndDate(TimeDate &t) const {
|
|||
t.tm_year = g_year + 100;
|
||||
t.tm_mday = g_day;
|
||||
t.tm_mon = g_month - 1;
|
||||
t.tm_wday = dayOfWeek(t.tm_year, t.tm_mon, t.tm_mday);
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil
|
|||
return Common::wrapCompressedReadStream(sf);
|
||||
}
|
||||
|
||||
Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename) {
|
||||
Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename, bool compress) {
|
||||
Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast?
|
||||
Common::WriteStream *sf;
|
||||
|
||||
|
@ -193,7 +193,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
|
|||
}
|
||||
|
||||
_screen->wantAnim(false);
|
||||
return Common::wrapCompressedWriteStream(sf);
|
||||
return compress ? Common::wrapCompressedWriteStream(sf) : sf;
|
||||
}
|
||||
|
||||
bool Ps2SaveFileManager::removeSavefile(const Common::String &filename) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual ~Ps2SaveFileManager();
|
||||
|
||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
|
||||
virtual Common::StringArray listSavefiles(const Common::String &pattern);
|
||||
virtual bool removeSavefile(const Common::String &filename);
|
||||
|
||||
|
|
|
@ -554,7 +554,7 @@ void OSystem_PS2::grabPalette(byte *colors, uint start, uint num) {
|
|||
_screen->grabPalette(colors, (uint8)start, (uint16)num);
|
||||
}
|
||||
|
||||
void OSystem_PS2::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_PS2::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
_screen->copyScreenRect((const uint8*)buf, pitch, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -618,8 +618,8 @@ void OSystem_PS2::warpMouse(int x, int y) {
|
|||
_screen->setMouseXy(x, y);
|
||||
}
|
||||
|
||||
void OSystem_PS2::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
_screen->setMouseOverlay(buf, w, h, hotspot_x, hotspot_y, keycolor);
|
||||
void OSystem_PS2::setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
_screen->setMouseOverlay((const byte *)buf, w, h, hotspot_x, hotspot_y, keycolor);
|
||||
}
|
||||
|
||||
void OSystem_PS2::showOverlay(void) {
|
||||
|
@ -634,12 +634,12 @@ void OSystem_PS2::clearOverlay(void) {
|
|||
_screen->clearOverlay();
|
||||
}
|
||||
|
||||
void OSystem_PS2::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
_screen->grabOverlay((uint16 *)buf, (uint16)pitch);
|
||||
void OSystem_PS2::grabOverlay(void *buf, int pitch) {
|
||||
_screen->grabOverlay((byte *)buf, (uint16)pitch);
|
||||
}
|
||||
|
||||
void OSystem_PS2::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
_screen->copyOverlayRect((const uint16*)buf, (uint16)pitch, (uint16)x, (uint16)y, (uint16)w, (uint16)h);
|
||||
void OSystem_PS2::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
_screen->copyOverlayRect((const byte *)buf, (uint16)pitch, (uint16)x, (uint16)y, (uint16)w, (uint16)h);
|
||||
}
|
||||
|
||||
Graphics::PixelFormat OSystem_PS2::getOverlayFormat(void) const {
|
||||
|
|
|
@ -62,7 +62,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
public:
|
||||
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void setShakePos(int shakeOffset);
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
|
@ -72,15 +72,15 @@ public:
|
|||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual int16 getOverlayWidth(void);
|
||||
virtual int16 getOverlayHeight(void);
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = 0);
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = 0);
|
||||
|
||||
virtual uint32 getMillis();
|
||||
virtual void delayMillis(uint msecs);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ScummVM-PSP 1.5.0git README
|
||||
ScummVM-PSP 1.6.0git README
|
||||
==============================================================================
|
||||
|
||||
Installation
|
||||
|
|
|
@ -123,15 +123,15 @@ void Overlay::setSize(uint32 width, uint32 height) {
|
|||
_renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw
|
||||
}
|
||||
|
||||
void Overlay::copyToArray(OverlayColor *buf, int pitch) {
|
||||
void Overlay::copyToArray(void *buf, int pitch) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
_buffer.copyToArray((byte *)buf, pitch * sizeof(OverlayColor)); // Change to bytes
|
||||
_buffer.copyToArray((byte *)buf, pitch); // Change to bytes
|
||||
}
|
||||
|
||||
void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void Overlay::copyFromRect(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
|
||||
_buffer.copyFromRect((byte *)buf, pitch * sizeof(OverlayColor), x, y, w, h); // Change to bytes
|
||||
_buffer.copyFromRect((byte *)buf, pitch, x, y, w, h); // Change to bytes
|
||||
// debug
|
||||
//_buffer.print(0xFF);
|
||||
setDirty();
|
||||
|
|
|
@ -69,8 +69,8 @@ public:
|
|||
bool allocate();
|
||||
void setBytesPerPixel(uint32 size);
|
||||
void setSize(uint32 width, uint32 height);
|
||||
void copyToArray(OverlayColor *buf, int pitch);
|
||||
void copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
void copyToArray(void *buf, int pitch);
|
||||
void copyFromRect(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -302,7 +302,7 @@ void DisplayManager::init() {
|
|||
|
||||
// Init overlay since we never change the size
|
||||
_overlay->deallocate();
|
||||
_overlay->setBytesPerPixel(sizeof(OverlayColor));
|
||||
_overlay->setBytesPerPixel(sizeof(uint16));
|
||||
_overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
|
||||
_overlay->allocate();
|
||||
}
|
||||
|
|
|
@ -204,11 +204,11 @@ void OSystem_PSP::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
_cursor.clearKeyColor(); // Do we need this?
|
||||
}
|
||||
|
||||
void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_PSP::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
_displayManager.waitUntilRenderFinished();
|
||||
_pendingUpdate = false;
|
||||
_screen.copyFromRect(buf, pitch, x, y, w, h);
|
||||
_screen.copyFromRect((const byte *)buf, pitch, x, y, w, h);
|
||||
}
|
||||
|
||||
Graphics::Surface *OSystem_PSP::lockScreen() {
|
||||
|
@ -260,12 +260,12 @@ void OSystem_PSP::clearOverlay() {
|
|||
_overlay.clearBuffer();
|
||||
}
|
||||
|
||||
void OSystem_PSP::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_PSP::grabOverlay(void *buf, int pitch) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
_overlay.copyToArray(buf, pitch);
|
||||
}
|
||||
|
||||
void OSystem_PSP::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
void OSystem_PSP::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
_displayManager.waitUntilRenderFinished();
|
||||
_pendingUpdate = false;
|
||||
|
@ -303,7 +303,7 @@ void OSystem_PSP::warpMouse(int x, int y) {
|
|||
_cursor.setXY(x, y);
|
||||
}
|
||||
|
||||
void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
void OSystem_PSP::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
|
||||
DEBUG_ENTER_FUNC();
|
||||
_displayManager.waitUntilRenderFinished();
|
||||
_pendingUpdate = false;
|
||||
|
@ -314,11 +314,13 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
}
|
||||
|
||||
_cursor.setKeyColor(keycolor);
|
||||
_cursor.setCursorTargetScale(cursorTargetScale);
|
||||
// TODO: The old target scale was saved but never used. Should the new
|
||||
// "do not scale" logic be implemented?
|
||||
//_cursor.setCursorTargetScale(cursorTargetScale);
|
||||
_cursor.setSizeAndScummvmPixelFormat(w, h, format);
|
||||
_cursor.setHotspot(hotspotX, hotspotY);
|
||||
_cursor.clearKeyColor();
|
||||
_cursor.copyFromArray(buf);
|
||||
_cursor.copyFromArray((const byte *)buf);
|
||||
}
|
||||
|
||||
bool OSystem_PSP::pollEvent(Common::Event &event) {
|
||||
|
@ -444,6 +446,7 @@ void OSystem_PSP::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
Common::String OSystem_PSP::getDefaultConfigFileName() {
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
||||
// Screen related
|
||||
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
|
||||
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
Graphics::Surface *lockScreen();
|
||||
void unlockScreen();
|
||||
void updateScreen();
|
||||
|
@ -109,8 +109,8 @@ public:
|
|||
void showOverlay();
|
||||
void hideOverlay();
|
||||
void clearOverlay();
|
||||
void grabOverlay(OverlayColor *buf, int pitch);
|
||||
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
|
||||
void grabOverlay(void *buf, int pitch);
|
||||
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
int16 getOverlayHeight();
|
||||
int16 getOverlayWidth();
|
||||
Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); }
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
// Mouse related
|
||||
bool showMouse(bool visible);
|
||||
void warpMouse(int x, int y);
|
||||
void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
|
||||
void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
|
||||
|
||||
// Events and input
|
||||
bool pollEvent(Common::Event &event);
|
||||
|
|
|
@ -486,6 +486,7 @@ void OSystem_SDL::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
Audio::Mixer *OSystem_SDL::getMixer() {
|
||||
|
|
|
@ -45,24 +45,4 @@ void OSystem_SDL_WebOS::initBackend() {
|
|||
OSystem_SDL::initBackend();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the original SDL hardware key set, adds WebOS specific keys and
|
||||
* returns the new key set.
|
||||
*
|
||||
* @return The hardware key set with added webOS specific keys.
|
||||
*/
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
HardwareInputSet *OSystem_SDL_WebOS::getHardwareInputSet() {
|
||||
// Get the original SDL hardware key set
|
||||
HardwareInputSet *inputSet = OSystem_SDL::getHardwareInputSet();
|
||||
|
||||
// Add WebOS specific keys
|
||||
inputSet->addHardwareInput(new HardwareInput("FORWARD",
|
||||
KeyState((KeyCode) 229, 229, 0), "Forward"));
|
||||
|
||||
// Return the modified hardware key set
|
||||
return inputSet;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,9 +31,6 @@ public:
|
|||
OSystem_SDL_WebOS();
|
||||
|
||||
virtual void initBackend();
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
virtual Common::HardwareInputSet *getHardwareInputSet();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
OSystem_Wii::OSystem_Wii() :
|
||||
_startup_time(0),
|
||||
|
||||
_cursorScale(1),
|
||||
_cursorDontScale(true),
|
||||
_cursorPaletteDisabled(true),
|
||||
_cursorPalette(NULL),
|
||||
_cursorPaletteDirty(false),
|
||||
|
@ -269,6 +269,7 @@ void OSystem_Wii::getTimeAndDate(TimeDate &td) const {
|
|||
td.tm_mday = t.tm_mday;
|
||||
td.tm_mon = t.tm_mon;
|
||||
td.tm_year = t.tm_year;
|
||||
td.tm_wday = t.tm_wday;
|
||||
}
|
||||
|
||||
void OSystem_Wii::showOptionsDialog() {
|
||||
|
|
|
@ -56,7 +56,7 @@ class OSystem_Wii : public EventsBaseBackend, public PaletteManager {
|
|||
private:
|
||||
s64 _startup_time;
|
||||
|
||||
int _cursorScale;
|
||||
bool _cursorDontScale;
|
||||
bool _cursorPaletteDisabled;
|
||||
u16 *_cursorPalette;
|
||||
bool _cursorPaletteDirty;
|
||||
|
@ -72,7 +72,7 @@ private:
|
|||
bool _overlayVisible;
|
||||
u16 _overlayWidth, _overlayHeight;
|
||||
u32 _overlaySize;
|
||||
OverlayColor *_overlayPixels;
|
||||
uint16 *_overlayPixels;
|
||||
gfx_screen_coords_t _coordsOverlay;
|
||||
gfx_tex_t _texOverlay;
|
||||
bool _overlayDirty;
|
||||
|
@ -167,7 +167,7 @@ protected:
|
|||
virtual void grabPalette(byte *colors, uint start, uint num);
|
||||
public:
|
||||
virtual void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
||||
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y,
|
||||
int w, int h);
|
||||
virtual void updateScreen();
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
|
@ -177,8 +177,8 @@ public:
|
|||
virtual void showOverlay();
|
||||
virtual void hideOverlay();
|
||||
virtual void clearOverlay();
|
||||
virtual void grabOverlay(OverlayColor *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
|
||||
virtual void grabOverlay(void *buf, int pitch);
|
||||
virtual void copyRectToOverlay(const void *buf, int pitch,
|
||||
int x, int y, int w, int h);
|
||||
virtual int16 getOverlayWidth();
|
||||
virtual int16 getOverlayHeight();
|
||||
|
@ -187,9 +187,9 @@ public:
|
|||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
||||
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
|
||||
int hotspotY, uint32 keycolor,
|
||||
int cursorTargetScale,
|
||||
bool dontScale,
|
||||
const Graphics::PixelFormat *format);
|
||||
|
||||
virtual bool pollEvent(Common::Event &event);
|
||||
|
|
|
@ -74,7 +74,7 @@ void OSystem_Wii::initGfx() {
|
|||
#endif
|
||||
|
||||
_overlaySize = _overlayWidth * _overlayHeight * 2;
|
||||
_overlayPixels = (OverlayColor *) memalign(32, _overlaySize);
|
||||
_overlayPixels = (uint16 *) memalign(32, _overlaySize);
|
||||
|
||||
memset(&_texMouse, 0, sizeof(gfx_tex_t));
|
||||
memset(&_texOverlay, 0, sizeof(gfx_tex_t));
|
||||
|
@ -395,7 +395,7 @@ void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
_cursorPaletteDirty = true;
|
||||
}
|
||||
|
||||
void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
||||
void OSystem_Wii::copyRectToScreen(const void *buf, int pitch, int x, int y,
|
||||
int w, int h) {
|
||||
assert(x >= 0 && x < _gameWidth);
|
||||
assert(y >= 0 && y < _gameHeight);
|
||||
|
@ -407,7 +407,7 @@ void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
|||
if (!Graphics::crossBlit(_gamePixels +
|
||||
y * _gameWidth * _pfGame.bytesPerPixel +
|
||||
x * _pfGame.bytesPerPixel,
|
||||
buf, _gameWidth * _pfGame.bytesPerPixel,
|
||||
(const byte *)buf, _gameWidth * _pfGame.bytesPerPixel,
|
||||
pitch, w, h, _pfGameTexture, _pfGame)) {
|
||||
printf("crossBlit failed\n");
|
||||
::abort();
|
||||
|
@ -418,9 +418,10 @@ void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
|
|||
if (_gameWidth == pitch && pitch == w) {
|
||||
memcpy(dst, buf, h * w);
|
||||
} else {
|
||||
const byte *src = (const byte *)buf;
|
||||
do {
|
||||
memcpy(dst, buf, w);
|
||||
buf += pitch;
|
||||
memcpy(dst, src, w);
|
||||
src += pitch;
|
||||
dst += _gameWidth;
|
||||
} while (--h);
|
||||
}
|
||||
|
@ -450,7 +451,7 @@ bool OSystem_Wii::needsScreenUpdate() {
|
|||
void OSystem_Wii::updateScreen() {
|
||||
static f32 ar;
|
||||
static gfx_screen_coords_t cc;
|
||||
static int cs;
|
||||
static f32 csx, csy;
|
||||
|
||||
u32 now = getMillis();
|
||||
if (now - _lastScreenUpdate < 1000 / MAX_FPS)
|
||||
|
@ -465,7 +466,6 @@ void OSystem_Wii::updateScreen() {
|
|||
wii_memstats();
|
||||
#endif
|
||||
|
||||
cs = _cursorScale;
|
||||
_lastScreenUpdate = now;
|
||||
|
||||
if (_overlayVisible || _consoleVisible)
|
||||
|
@ -487,12 +487,6 @@ void OSystem_Wii::updateScreen() {
|
|||
if (_gameRunning)
|
||||
ar = gfx_set_ar(4.0 / 3.0);
|
||||
|
||||
// ugly, but the modern theme sets a factor of 3, only god knows why
|
||||
if (cs > 2)
|
||||
cs = 1;
|
||||
else
|
||||
cs *= 2;
|
||||
|
||||
if (_overlayDirty) {
|
||||
gfx_tex_convert(&_texOverlay, _overlayPixels);
|
||||
_overlayDirty = false;
|
||||
|
@ -502,10 +496,18 @@ void OSystem_Wii::updateScreen() {
|
|||
}
|
||||
|
||||
if (_mouseVisible) {
|
||||
cc.x = f32(_mouseX - cs * _mouseHotspotX) * _currentXScale;
|
||||
cc.y = f32(_mouseY - cs * _mouseHotspotY) * _currentYScale;
|
||||
cc.w = f32(_texMouse.width) * _currentXScale * cs;
|
||||
cc.h = f32(_texMouse.height) * _currentYScale * cs;
|
||||
if (_cursorDontScale) {
|
||||
csx = 1.0f / _currentXScale;
|
||||
csy = 1.0f / _currentYScale;
|
||||
} else {
|
||||
csx = 1.0f;
|
||||
csy = 1.0f;
|
||||
}
|
||||
|
||||
cc.x = f32(_mouseX - csx * _mouseHotspotX) * _currentXScale;
|
||||
cc.y = f32(_mouseY - csy * _mouseHotspotY) * _currentYScale;
|
||||
cc.w = f32(_texMouse.width) * _currentXScale * csx;
|
||||
cc.h = f32(_texMouse.height) * _currentYScale * csy;
|
||||
|
||||
if (_texMouse.palette && _cursorPaletteDirty) {
|
||||
_texMouse.palette[_mouseKeyColor] = 0;
|
||||
|
@ -570,28 +572,30 @@ void OSystem_Wii::clearOverlay() {
|
|||
_overlayDirty = true;
|
||||
}
|
||||
|
||||
void OSystem_Wii::grabOverlay(OverlayColor *buf, int pitch) {
|
||||
void OSystem_Wii::grabOverlay(void *buf, int pitch) {
|
||||
int h = _overlayHeight;
|
||||
OverlayColor *src = _overlayPixels;
|
||||
uint16 *src = _overlayPixels;
|
||||
byte *dst = (byte *)buf;
|
||||
|
||||
do {
|
||||
memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
|
||||
memcpy(dst, src, _overlayWidth * sizeof(uint16));
|
||||
src += _overlayWidth;
|
||||
buf += pitch;
|
||||
dst += pitch;
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void OSystem_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
|
||||
void OSystem_Wii::copyRectToOverlay(const void *buf, int pitch, int x,
|
||||
int y, int w, int h) {
|
||||
const byte *src = (const byte *)buf;
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
buf -= x;
|
||||
src -= x * sizeof(uint16);
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
buf -= y * pitch;
|
||||
src -= y * pitch;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
|
@ -604,13 +608,13 @@ void OSystem_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
|
|||
if (w <= 0 || h <= 0)
|
||||
return;
|
||||
|
||||
OverlayColor *dst = _overlayPixels + (y * _overlayWidth + x);
|
||||
if (_overlayWidth == pitch && pitch == w) {
|
||||
memcpy(dst, buf, h * w * sizeof(OverlayColor));
|
||||
uint16 *dst = _overlayPixels + (y * _overlayWidth + x);
|
||||
if (_overlayWidth == w && pitch == _overlayWidth * sizeof(uint16)) {
|
||||
memcpy(dst, src, h * pitch);
|
||||
} else {
|
||||
do {
|
||||
memcpy(dst, buf, w * sizeof(OverlayColor));
|
||||
buf += pitch;
|
||||
memcpy(dst, src, w * sizeof(uint16));
|
||||
src += pitch;
|
||||
dst += _overlayWidth;
|
||||
} while (--h);
|
||||
}
|
||||
|
@ -642,9 +646,9 @@ void OSystem_Wii::warpMouse(int x, int y) {
|
|||
_mouseY = y;
|
||||
}
|
||||
|
||||
void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
||||
void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
|
||||
int hotspotY, uint32 keycolor,
|
||||
int cursorTargetScale,
|
||||
bool dontScale,
|
||||
const Graphics::PixelFormat *format) {
|
||||
gfx_tex_format_t tex_format = GFX_TF_PALETTE_RGB5A3;
|
||||
uint tw, th;
|
||||
|
@ -685,7 +689,7 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
tmpBuf = true;
|
||||
|
||||
if (!tmpBuf) {
|
||||
gfx_tex_convert(&_texMouse, buf);
|
||||
gfx_tex_convert(&_texMouse, (const byte *)buf);
|
||||
} else {
|
||||
u8 bpp = _texMouse.bpp >> 3;
|
||||
byte *tmp = (byte *) malloc(tw * th * bpp);
|
||||
|
@ -702,7 +706,7 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (bpp > 1) {
|
||||
if (!Graphics::crossBlit(tmp, buf,
|
||||
if (!Graphics::crossBlit(tmp, (const byte *)buf,
|
||||
tw * _pfRGB3444.bytesPerPixel,
|
||||
w * _pfCursor.bytesPerPixel,
|
||||
tw, th, _pfRGB3444, _pfCursor)) {
|
||||
|
@ -726,10 +730,10 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
} else {
|
||||
#endif
|
||||
byte *dst = tmp;
|
||||
|
||||
const byte *src = (const byte *)buf;
|
||||
do {
|
||||
memcpy(dst, buf, w * bpp);
|
||||
buf += w * bpp;
|
||||
memcpy(dst, src, w * bpp);
|
||||
src += w * bpp;
|
||||
dst += tw * bpp;
|
||||
} while (--h);
|
||||
#ifdef USE_RGB_COLOR
|
||||
|
@ -742,7 +746,7 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
|
||||
_mouseHotspotX = hotspotX;
|
||||
_mouseHotspotY = hotspotY;
|
||||
_cursorScale = cursorTargetScale;
|
||||
_cursorDontScale = dontScale;
|
||||
|
||||
if ((_texMouse.palette) && (oldKeycolor != _mouseKeyColor))
|
||||
_cursorPaletteDirty = true;
|
||||
|
|
|
@ -622,6 +622,7 @@ void OSystem_WINCE3::getTimeAndDate(TimeDate &t) const {
|
|||
t.tm_hour = systime.wHour;
|
||||
t.tm_min = systime.wMinute;
|
||||
t.tm_sec = systime.wSecond;
|
||||
t.tm_wday = systime.wDayOfWeek;
|
||||
}
|
||||
|
||||
Common::String OSystem_WINCE3::getSystemLanguage() const {
|
||||
|
|
|
@ -97,7 +97,7 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const Common::String
|
|||
return Common::wrapCompressedReadStream(sf);
|
||||
}
|
||||
|
||||
Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename) {
|
||||
Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename, bool compress) {
|
||||
// Ensure that the savepath is valid. If not, generate an appropriate error.
|
||||
Common::String savePathName = getSavePath();
|
||||
checkPath(Common::FSNode(savePathName));
|
||||
|
@ -112,7 +112,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String
|
|||
// Open the file for saving
|
||||
Common::WriteStream *sf = file.createWriteStream();
|
||||
|
||||
return Common::wrapCompressedWriteStream(sf);
|
||||
return compress ? Common::wrapCompressedWriteStream(sf) : sf;
|
||||
}
|
||||
|
||||
bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
|
||||
virtual Common::StringArray listSavefiles(const Common::String &pattern);
|
||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename);
|
||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
|
||||
virtual bool removeSavefile(const Common::String &filename);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -26,8 +26,12 @@
|
|||
|
||||
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
|
||||
|
||||
#if defined(ARRAYSIZE)
|
||||
#undef ARRAYSIZE
|
||||
#endif
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
|
||||
|
||||
#include "common/config-manager.h"
|
||||
#include "common/savefile.h"
|
||||
|
|
|
@ -59,7 +59,6 @@ void insertPrioQueue(TimerSlot *head, TimerSlot *newSlot) {
|
|||
|
||||
|
||||
DefaultTimerManager::DefaultTimerManager() :
|
||||
_timerHandler(0),
|
||||
_head(0) {
|
||||
|
||||
_head = new TimerSlot();
|
||||
|
|
|
@ -34,7 +34,6 @@ private:
|
|||
typedef Common::HashMap<Common::String, TimerProc, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> TimerSlotMap;
|
||||
|
||||
Common::Mutex _mutex;
|
||||
void *_timerHandler;
|
||||
TimerSlot *_head;
|
||||
TimerSlotMap _callbacks;
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ void VirtualKeyboardGUI::run() {
|
|||
_system->clearOverlay();
|
||||
}
|
||||
_overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat());
|
||||
_system->grabOverlay((OverlayColor *)_overlayBackup.pixels, _overlayBackup.w);
|
||||
_system->grabOverlay(_overlayBackup.pixels, _overlayBackup.pitch);
|
||||
|
||||
setupCursor();
|
||||
|
||||
|
@ -171,7 +171,7 @@ void VirtualKeyboardGUI::run() {
|
|||
|
||||
removeCursor();
|
||||
|
||||
_system->copyRectToOverlay((OverlayColor *)_overlayBackup.pixels, _overlayBackup.w, 0, 0, _overlayBackup.w, _overlayBackup.h);
|
||||
_system->copyRectToOverlay(_overlayBackup.pixels, _overlayBackup.pitch, 0, 0, _overlayBackup.w, _overlayBackup.h);
|
||||
if (!g_gui.isActive()) _system->hideOverlay();
|
||||
|
||||
_overlayBackup.free();
|
||||
|
@ -262,7 +262,7 @@ void VirtualKeyboardGUI::screenChanged() {
|
|||
_screenH = newScreenH;
|
||||
|
||||
_overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat());
|
||||
_system->grabOverlay((OverlayColor *)_overlayBackup.pixels, _overlayBackup.w);
|
||||
_system->grabOverlay(_overlayBackup.pixels, _overlayBackup.pitch);
|
||||
|
||||
if (!_kbd->checkModeResolutions()) {
|
||||
_displaying = false;
|
||||
|
@ -371,7 +371,7 @@ void VirtualKeyboardGUI::redraw() {
|
|||
blit(&surf, &_dispSurface, _dispX - _dirtyRect.left,
|
||||
_dispY - _dirtyRect.top, _dispBackColor);
|
||||
}
|
||||
_system->copyRectToOverlay((OverlayColor *)surf.pixels, surf.w,
|
||||
_system->copyRectToOverlay(surf.pixels, surf.pitch,
|
||||
_dirtyRect.left, _dirtyRect.top, surf.w, surf.h);
|
||||
|
||||
surf.free();
|
||||
|
|
|
@ -237,6 +237,8 @@ void registerDefaults() {
|
|||
ConfMan.registerDefault("record_temp_file_name", "record.tmp");
|
||||
ConfMan.registerDefault("record_time_file_name", "record.time");
|
||||
|
||||
ConfMan.registerDefault("gui_saveload_chooser", "grid");
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
#define SCUMMVM_REVISION
|
||||
#endif
|
||||
|
||||
#define SCUMMVM_VERSION "1.5.0git" SCUMMVM_REVISION
|
||||
#define SCUMMVM_VERSION "1.6.0git" SCUMMVM_REVISION
|
||||
|
|
|
@ -55,6 +55,12 @@
|
|||
#include "audio/mididrv.h"
|
||||
#include "audio/musicplugin.h" /* for music manager */
|
||||
|
||||
#include "graphics/cursorman.h"
|
||||
#include "graphics/fontman.h"
|
||||
#ifdef USE_FREETYPE2
|
||||
#include "graphics/fonts/ttf.h"
|
||||
#endif
|
||||
|
||||
#include "backends/keymapper/keymapper.h"
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
|
@ -493,10 +499,18 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
|||
PluginManager::destroy();
|
||||
GUI::GuiManager::destroy();
|
||||
Common::ConfigManager::destroy();
|
||||
Common::DebugManager::destroy();
|
||||
Common::EventRecorder::destroy();
|
||||
Common::SearchManager::destroy();
|
||||
#ifdef USE_TRANSLATION
|
||||
Common::TranslationManager::destroy();
|
||||
#endif
|
||||
MusicManager::destroy();
|
||||
Graphics::CursorManager::destroy();
|
||||
Graphics::FontManager::destroy();
|
||||
#ifdef USE_FREETYPE2
|
||||
Graphics::shutdownTTF();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,9 @@ public:
|
|||
#if defined(USE_SEQ_MIDI)
|
||||
LINK_PLUGIN(SEQ)
|
||||
#endif
|
||||
#if defined(USE_SNDIO)
|
||||
LINK_PLUGIN(SNDIO)
|
||||
#endif
|
||||
#if defined(__MINT__)
|
||||
LINK_PLUGIN(STMIDI)
|
||||
#endif
|
||||
|
|
|
@ -205,6 +205,10 @@ typedef Common::Array<Plugin *> PluginList;
|
|||
template<class PO_t>
|
||||
class PluginSubclass : public Plugin {
|
||||
public:
|
||||
PO_t &operator*() const {
|
||||
return *(PO_t *)_pluginObject;
|
||||
}
|
||||
|
||||
PO_t *operator->() const {
|
||||
return (PO_t *)_pluginObject;
|
||||
}
|
||||
|
|
|
@ -94,6 +94,10 @@ const char *gScummVMFeatures = ""
|
|||
"SEQ "
|
||||
#endif
|
||||
|
||||
#ifdef USE_SNDIO
|
||||
"sndio "
|
||||
#endif
|
||||
|
||||
#ifdef USE_TIMIDITY
|
||||
"TiMidity "
|
||||
#endif
|
||||
|
|
|
@ -34,14 +34,17 @@ CoroContext nullContext = NULL;
|
|||
|
||||
DECLARE_SINGLETON(CoroutineScheduler);
|
||||
|
||||
|
||||
#ifdef COROUTINE_DEBUG
|
||||
namespace {
|
||||
/** Count of active coroutines */
|
||||
static int s_coroCount = 0;
|
||||
|
||||
typedef Common::HashMap<Common::String, int> CoroHashMap;
|
||||
static CoroHashMap *s_coroFuncs = 0;
|
||||
|
||||
/**
|
||||
* Change the current coroutine status
|
||||
*/
|
||||
static void changeCoroStats(const char *func, int change) {
|
||||
if (!s_coroFuncs)
|
||||
s_coroFuncs = new CoroHashMap();
|
||||
|
@ -49,6 +52,9 @@ static void changeCoroStats(const char *func, int change) {
|
|||
(*s_coroFuncs)[func] += change;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the details of active coroutines
|
||||
*/
|
||||
static void displayCoroStats() {
|
||||
debug("%d active coros", s_coroCount);
|
||||
|
||||
|
@ -56,13 +62,13 @@ static void displayCoroStats() {
|
|||
if (!s_coroFuncs)
|
||||
return;
|
||||
for (CoroHashMap::const_iterator it = s_coroFuncs->begin();
|
||||
it != s_coroFuncs->end(); ++it) {
|
||||
it != s_coroFuncs->end(); ++it) {
|
||||
if (it->_value != 0)
|
||||
debug(" %3d x %s", it->_value, it->_key.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // End of anonymous namespace
|
||||
#endif
|
||||
|
||||
CoroBaseContext::CoroBaseContext(const char *func)
|
||||
|
@ -79,7 +85,7 @@ CoroBaseContext::~CoroBaseContext() {
|
|||
s_coroCount--;
|
||||
changeCoroStats(_funcName, -1);
|
||||
debug("Deleting coro in %s at %p (subctx %p)",
|
||||
_funcName, (void *)this, (void *)_subctx);
|
||||
_funcName, (void *)this, (void *)_subctx);
|
||||
displayCoroStats();
|
||||
#endif
|
||||
delete _subctx;
|
||||
|
@ -87,9 +93,6 @@ CoroBaseContext::~CoroBaseContext() {
|
|||
|
||||
//--------------------- Scheduler Class ------------------------
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
CoroutineScheduler::CoroutineScheduler() {
|
||||
processList = NULL;
|
||||
pFreeProcesses = NULL;
|
||||
|
@ -111,9 +114,6 @@ CoroutineScheduler::CoroutineScheduler() {
|
|||
reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
CoroutineScheduler::~CoroutineScheduler() {
|
||||
// Kill all running processes (i.e. free memory allocated for their state).
|
||||
PROCESS *pProc = active->pNext;
|
||||
|
@ -132,14 +132,10 @@ CoroutineScheduler::~CoroutineScheduler() {
|
|||
// Clear the event list
|
||||
Common::List<EVENT *>::iterator i;
|
||||
for (i = _events.begin(); i != _events.end(); ++i)
|
||||
delete (*i);
|
||||
delete *i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kills all processes and places them on the free list.
|
||||
*/
|
||||
void CoroutineScheduler::reset() {
|
||||
|
||||
#ifdef DEBUG
|
||||
// clear number of process in use
|
||||
numProcs = 0;
|
||||
|
@ -181,21 +177,14 @@ void CoroutineScheduler::reset() {
|
|||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Shows the maximum number of process used at once.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
void CoroutineScheduler::printStats() {
|
||||
debug("%i process of %i used", maxProcs, CORO_NUM_PROCESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Checks both the active and free process list to insure all the links are valid,
|
||||
* and that no processes have been lost
|
||||
*/
|
||||
void CoroutineScheduler::CheckStack() {
|
||||
void CoroutineScheduler::checkStack() {
|
||||
Common::List<PROCESS *> pList;
|
||||
|
||||
// Check both the active and free process lists
|
||||
|
@ -229,9 +218,6 @@ void CoroutineScheduler::CheckStack() {
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Give all active processes a chance to run
|
||||
*/
|
||||
void CoroutineScheduler::schedule() {
|
||||
// start dispatching active process list
|
||||
PROCESS *pNext;
|
||||
|
@ -270,9 +256,6 @@ void CoroutineScheduler::schedule() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reschedules all the processes to run again this query
|
||||
*/
|
||||
void CoroutineScheduler::rescheduleAll() {
|
||||
assert(pCurrent);
|
||||
|
||||
|
@ -288,10 +271,6 @@ void CoroutineScheduler::rescheduleAll() {
|
|||
pCurrent->pPrevious = active;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the specified process has already run on this tick, make it run
|
||||
* again on the current tick.
|
||||
*/
|
||||
void CoroutineScheduler::reschedule(PPROCESS pReSchedProc) {
|
||||
// If not currently processing the schedule list, then no action is needed
|
||||
if (!pCurrent)
|
||||
|
@ -329,11 +308,6 @@ void CoroutineScheduler::reschedule(PPROCESS pReSchedProc) {
|
|||
pReSchedProc->pNext = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the specified process to the end of the dispatch queue
|
||||
* allowing it to run again within the current game cycle.
|
||||
* @param pGiveProc Which process
|
||||
*/
|
||||
void CoroutineScheduler::giveWay(PPROCESS pReSchedProc) {
|
||||
// If not currently processing the schedule list, then no action is needed
|
||||
if (!pCurrent)
|
||||
|
@ -367,13 +341,6 @@ void CoroutineScheduler::giveWay(PPROCESS pReSchedProc) {
|
|||
pReSchedProc->pNext = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Continously makes a given process wait for another process to finish or event to signal.
|
||||
*
|
||||
* @param pid Process/Event identifier
|
||||
* @param duration Duration in milliseconds
|
||||
* @param expired If specified, set to true if delay period expired
|
||||
*/
|
||||
void CoroutineScheduler::waitForSingleObject(CORO_PARAM, int pid, uint32 duration, bool *expired) {
|
||||
if (!pCurrent)
|
||||
error("Called CoroutineScheduler::waitForSingleObject from the main process");
|
||||
|
@ -394,7 +361,7 @@ void CoroutineScheduler::waitForSingleObject(CORO_PARAM, int pid, uint32 duratio
|
|||
// Presume it will expire
|
||||
*expired = true;
|
||||
|
||||
// Outer loop for doing checks until expiry
|
||||
// Outer loop for doing checks until expiry
|
||||
while (g_system->getMillis() <= _ctx->endTime) {
|
||||
// Check to see if a process or event with the given Id exists
|
||||
_ctx->pProcess = getProcess(pid);
|
||||
|
@ -408,7 +375,7 @@ void CoroutineScheduler::waitForSingleObject(CORO_PARAM, int pid, uint32 duratio
|
|||
break;
|
||||
}
|
||||
|
||||
// If a process was found, don't go into the if statement, and keep waiting.
|
||||
// If a process was found, don't go into the if statement, and keep waiting.
|
||||
// Likewise if it's an event that's not yet signalled
|
||||
if ((_ctx->pEvent != NULL) && _ctx->pEvent->signalled) {
|
||||
// Unless the event is flagged for manual reset, reset it now
|
||||
|
@ -430,19 +397,10 @@ void CoroutineScheduler::waitForSingleObject(CORO_PARAM, int pid, uint32 duratio
|
|||
CORO_END_CODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Continously makes a given process wait for given prcesses to finished or events to be set
|
||||
*
|
||||
* @param nCount Number of Id's being passed
|
||||
* @param evtList List of pids to wait for
|
||||
* @param bWaitAll Specifies whether all or any of the processes/events
|
||||
* @param duration Duration in milliseconds
|
||||
* @param expired Set to true if delay period expired
|
||||
*/
|
||||
void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 *pidList, bool bWaitAll,
|
||||
uint32 duration, bool *expired) {
|
||||
void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 *pidList, bool bWaitAll,
|
||||
uint32 duration, bool *expired) {
|
||||
if (!pCurrent)
|
||||
error("Called CoroutineScheduler::waitForMultipleEvents from the main process");
|
||||
error("Called CoroutineScheduler::waitForMultipleObjects from the main process");
|
||||
|
||||
CORO_BEGIN_CONTEXT;
|
||||
uint32 endTime;
|
||||
|
@ -464,7 +422,7 @@ void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 *
|
|||
// Presume that delay will expire
|
||||
*expired = true;
|
||||
|
||||
// Outer loop for doing checks until expiry
|
||||
// Outer loop for doing checks until expiry
|
||||
while (g_system->getMillis() <= _ctx->endTime) {
|
||||
_ctx->signalled = bWaitAll;
|
||||
|
||||
|
@ -506,15 +464,9 @@ void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 *
|
|||
CORO_END_CODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the active process sleep for the given duration in milliseconds
|
||||
* @param duration Duration in milliseconds
|
||||
* @remarks This duration won't be precise, since it relies on the frequency the
|
||||
* scheduler is called.
|
||||
*/
|
||||
void CoroutineScheduler::sleep(CORO_PARAM, uint32 duration) {
|
||||
if (!pCurrent)
|
||||
error("Called CoroutineScheduler::waitForSingleObject from the main process");
|
||||
error("Called CoroutineScheduler::sleep from the main process");
|
||||
|
||||
CORO_BEGIN_CONTEXT;
|
||||
uint32 endTime;
|
||||
|
@ -526,7 +478,7 @@ void CoroutineScheduler::sleep(CORO_PARAM, uint32 duration) {
|
|||
|
||||
_ctx->endTime = g_system->getMillis() + duration;
|
||||
|
||||
// Outer loop for doing checks until expiry
|
||||
// Outer loop for doing checks until expiry
|
||||
while (g_system->getMillis() < _ctx->endTime) {
|
||||
// Sleep until the next cycle
|
||||
CORO_SLEEP(1);
|
||||
|
@ -535,14 +487,6 @@ void CoroutineScheduler::sleep(CORO_PARAM, uint32 duration) {
|
|||
CORO_END_CODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new process.
|
||||
*
|
||||
* @param pid process identifier
|
||||
* @param CORO_ADDR coroutine start address
|
||||
* @param pParam process specific info
|
||||
* @param sizeParam size of process specific info
|
||||
*/
|
||||
PROCESS *CoroutineScheduler::createProcess(uint32 pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam) {
|
||||
PROCESS *pProc;
|
||||
|
||||
|
@ -573,7 +517,7 @@ PROCESS *CoroutineScheduler::createProcess(uint32 pid, CORO_ADDR coroAddr, const
|
|||
pCurrent->pNext = pProc;
|
||||
pProc->pPrevious = pCurrent;
|
||||
|
||||
} else { // no active processes, place process at head of list
|
||||
} else { // no active processes, place process at head of list
|
||||
pProc->pNext = active->pNext;
|
||||
pProc->pPrevious = active;
|
||||
|
||||
|
@ -607,35 +551,15 @@ PROCESS *CoroutineScheduler::createProcess(uint32 pid, CORO_ADDR coroAddr, const
|
|||
return pProc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new process with an auto-incrementing Process Id.
|
||||
*
|
||||
* @param CORO_ADDR coroutine start address
|
||||
* @param pParam process specific info
|
||||
* @param sizeParam size of process specific info
|
||||
*/
|
||||
uint32 CoroutineScheduler::createProcess(CORO_ADDR coroAddr, const void *pParam, int sizeParam) {
|
||||
PROCESS *pProc = createProcess(++pidCounter, coroAddr, pParam, sizeParam);
|
||||
return pProc->pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new process with an auto-incrementing Process Id, and a single pointer parameter.
|
||||
*
|
||||
* @param CORO_ADDR coroutine start address
|
||||
* @param pParam process specific info
|
||||
* @param sizeParam size of process specific info
|
||||
*/
|
||||
uint32 CoroutineScheduler::createProcess(CORO_ADDR coroAddr, const void *pParam) {
|
||||
return createProcess(coroAddr, &pParam, sizeof(void *));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Kills the specified process.
|
||||
*
|
||||
* @param pKillProc which process to kill
|
||||
*/
|
||||
void CoroutineScheduler::killProcess(PROCESS *pKillProc) {
|
||||
// make sure a valid process pointer
|
||||
assert(pKillProc >= processList && pKillProc <= processList + CORO_NUM_PROCESS - 1);
|
||||
|
@ -671,20 +595,10 @@ void CoroutineScheduler::killProcess(PROCESS *pKillProc) {
|
|||
pFreeProcesses = pKillProc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns a pointer to the currently running process.
|
||||
*/
|
||||
PROCESS *CoroutineScheduler::getCurrentProcess() {
|
||||
return pCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the process identifier of the specified process.
|
||||
*
|
||||
* @param pProc which process
|
||||
*/
|
||||
int CoroutineScheduler::getCurrentPID() const {
|
||||
PROCESS *pProc = pCurrent;
|
||||
|
||||
|
@ -695,17 +609,9 @@ int CoroutineScheduler::getCurrentPID() const {
|
|||
return pProc->pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kills any process matching the specified PID. The current
|
||||
* process cannot be killed.
|
||||
*
|
||||
* @param pidKill process identifier of process to kill
|
||||
* @param pidMask mask to apply to process identifiers before comparison
|
||||
* @return The number of processes killed is returned.
|
||||
*/
|
||||
int CoroutineScheduler::killMatchingProcess(uint32 pidKill, int pidMask) {
|
||||
int numKilled = 0;
|
||||
PROCESS *pProc, *pPrev; // process list pointers
|
||||
PROCESS *pProc, *pPrev; // process list pointers
|
||||
|
||||
for (pProc = active->pNext, pPrev = active; pProc != NULL; pPrev = pProc, pProc = pProc->pNext) {
|
||||
if ((pProc->pid & (uint32)pidMask) == pidKill) {
|
||||
|
@ -752,15 +658,6 @@ int CoroutineScheduler::killMatchingProcess(uint32 pidKill, int pidMask) {
|
|||
return numKilled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set pointer to a function to be called by killProcess().
|
||||
*
|
||||
* May be called by a resource allocator, the function supplied is
|
||||
* called by killProcess() to allow the resource allocator to free
|
||||
* resources allocated to the dying process.
|
||||
*
|
||||
* @param pFunc Function to be called by killProcess()
|
||||
*/
|
||||
void CoroutineScheduler::setResourceCallback(VFPTRPP pFunc) {
|
||||
pRCfunction = pFunc;
|
||||
}
|
||||
|
@ -785,12 +682,6 @@ EVENT *CoroutineScheduler::getEvent(uint32 pid) {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new event object
|
||||
* @param bManualReset Events needs to be manually reset. Otherwise, events
|
||||
* will be automatically reset after a process waits on the event finishes
|
||||
* @param bInitialState Specifies whether the event is signalled or not initially
|
||||
*/
|
||||
uint32 CoroutineScheduler::createEvent(bool bManualReset, bool bInitialState) {
|
||||
EVENT *evt = new EVENT();
|
||||
evt->pid = ++pidCounter;
|
||||
|
@ -802,10 +693,6 @@ uint32 CoroutineScheduler::createEvent(bool bManualReset, bool bInitialState) {
|
|||
return evt->pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the given event
|
||||
* @param pidEvent Event PID
|
||||
*/
|
||||
void CoroutineScheduler::closeEvent(uint32 pidEvent) {
|
||||
EVENT *evt = getEvent(pidEvent);
|
||||
if (evt) {
|
||||
|
@ -814,33 +701,18 @@ void CoroutineScheduler::closeEvent(uint32 pidEvent) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the event
|
||||
* @param pidEvent Event PID
|
||||
*/
|
||||
void CoroutineScheduler::setEvent(uint32 pidEvent) {
|
||||
EVENT *evt = getEvent(pidEvent);
|
||||
if (evt)
|
||||
evt->signalled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the event
|
||||
* @param pidEvent Event PID
|
||||
*/
|
||||
void CoroutineScheduler::resetEvent(uint32 pidEvent) {
|
||||
EVENT *evt = getEvent(pidEvent);
|
||||
if (evt)
|
||||
evt->signalled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporarily sets a given event to true, and then runs all waiting processes, allowing any
|
||||
* processes waiting on the event to be fired. It then immediately resets the event again.
|
||||
* @param pidEvent Event PID
|
||||
*
|
||||
* @remarks Should not be run inside of another process
|
||||
*/
|
||||
void CoroutineScheduler::pulseEvent(uint32 pidEvent) {
|
||||
EVENT *evt = getEvent(pidEvent);
|
||||
if (!evt)
|
||||
|
@ -856,5 +728,4 @@ void CoroutineScheduler::pulseEvent(uint32 pidEvent) {
|
|||
rescheduleAll();
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace Common
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue