JANITORIAL: Replace spaces in indentation with tabs

This commit is contained in:
Eugene Sandulenko 2021-04-15 21:20:04 +02:00
parent 71888ad4db
commit 5e7fe2dc57
No known key found for this signature in database
GPG key ID: 014D387312D34F08
780 changed files with 37372 additions and 37372 deletions

View file

@ -1405,7 +1405,7 @@ MidiDriver_ADLIB::MidiDriver_ADLIB() {
_timerThreshold = 0x411B;
_opl = 0;
_adlibTimerProc = 0;
_adlibTimerParam = 0;
_adlibTimerParam = 0;
_isOpen = false;
}

View file

@ -92,7 +92,7 @@ SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &b
#pragma mark -
LoopingAudioStream::LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse, bool rewind)
: _parent(stream, disposeAfterUse), _loops(loops), _completeIterations(0) {
: _parent(stream, disposeAfterUse), _loops(loops), _completeIterations(0) {
assert(stream);
if (rewind && !stream->rewind()) {
@ -171,15 +171,15 @@ AudioStream *makeLoopingAudioStream(SeekableAudioStream *stream, Timestamp start
#pragma mark -
SubLoopingAudioStream::SubLoopingAudioStream(SeekableAudioStream *stream,
uint loops,
const Timestamp loopStart,
const Timestamp loopEnd,
DisposeAfterUse::Flag disposeAfterUse)
: _parent(stream, disposeAfterUse), _loops(loops),
_pos(0, getRate() * (isStereo() ? 2 : 1)),
_loopStart(convertTimeToStreamPos(loopStart, getRate(), isStereo())),
_loopEnd(convertTimeToStreamPos(loopEnd, getRate(), isStereo())),
_done(false) {
uint loops,
const Timestamp loopStart,
const Timestamp loopEnd,
DisposeAfterUse::Flag disposeAfterUse)
: _parent(stream, disposeAfterUse), _loops(loops),
_pos(0, getRate() * (isStereo() ? 2 : 1)),
_loopStart(convertTimeToStreamPos(loopStart, getRate(), isStereo())),
_loopEnd(convertTimeToStreamPos(loopEnd, getRate(), isStereo())),
_done(false) {
assert(loopStart < loopEnd);
if (!_parent->rewind())
@ -238,10 +238,10 @@ bool SubLoopingAudioStream::endOfStream() const {
#pragma mark -
SubSeekableAudioStream::SubSeekableAudioStream(SeekableAudioStream *parent, const Timestamp start, const Timestamp end, DisposeAfterUse::Flag disposeAfterUse)
: _parent(parent, disposeAfterUse),
_start(convertTimeToStreamPos(start, getRate(), isStereo())),
_pos(0, getRate() * (isStereo() ? 2 : 1)),
_length(convertTimeToStreamPos(end, getRate(), isStereo()) - _start) {
: _parent(parent, disposeAfterUse),
_start(convertTimeToStreamPos(start, getRate(), isStereo())),
_pos(0, getRate() * (isStereo() ? 2 : 1)),
_length(convertTimeToStreamPos(end, getRate(), isStereo()) - _start) {
assert(_length.totalNumberOfFrames() % (isStereo() ? 2 : 1) == 0);
_parent->seek(_start);
@ -472,10 +472,10 @@ AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp
*/
class NullAudioStream : public AudioStream {
public:
bool isStereo() const { return false; }
int getRate() const;
int readBuffer(int16 *data, const int numSamples) { return 0; }
bool endOfData() const { return true; }
bool isStereo() const { return false; }
int getRate() const;
int readBuffer(int16 *data, const int numSamples) { return 0; }
bool endOfData() const { return true; }
};
int NullAudioStream::getRate() const {

View file

@ -82,7 +82,7 @@ bool AC3Stream::init(Common::SeekableReadStream &firstPacket) {
deinit();
// In theory, I should pass mm_accel() to a52_init(), but I don't know
// where that's supposed to be defined.
// where that's supposed to be defined.
_a52State = a52_init(0);
// Go through the header to find sync

View file

@ -77,12 +77,12 @@ enum ADPCMType {
* @return a new RewindableAudioStream, or NULL, if an error occurred
*/
SeekableAudioStream *makeADPCMStream(
Common::SeekableReadStream *stream,
DisposeAfterUse::Flag disposeAfterUse,
uint32 size, ADPCMType type,
int rate,
int channels,
uint32 blockAlign = 0);
Common::SeekableReadStream *stream,
DisposeAfterUse::Flag disposeAfterUse,
uint32 size, ADPCMType type,
int rate,
int channels,
uint32 blockAlign = 0);
/**
* Creates a PacketizedAudioStream that will automatically queue

View file

@ -253,9 +253,9 @@ private:
// half mpeg encoding window (full precision)
const int32 ff_mpa_enwindow[257] = {
0, -1, -1, -1, -1, -1, -1, -2,
-2, -2, -2, -3, -3, -4, -4, -5,
-5, -6, -7, -7, -8, -9, -10, -11,
0, -1, -1, -1, -1, -1, -1, -2,
-2, -2, -2, -3, -3, -4, -4, -5,
-5, -6, -7, -7, -8, -9, -10, -11,
-13, -14, -16, -17, -19, -21, -24, -26,
-29, -31, -35, -38, -41, -45, -49, -53,
-58, -63, -68, -73, -79, -85, -91, -97,
@ -278,7 +278,7 @@ const int32 ff_mpa_enwindow[257] = {
-9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750,
-9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134,
6574, 5959, 5288, 4561, 3776, 2935, 2037, 1082,
70, -998, -2122, -3300, -4533, -5818, -7154, -8540,
70, -998, -2122, -3300, -4533, -5818, -7154, -8540,
-9975,-11455,-12980,-14548,-16155,-17799,-19478,-21189,
-22929,-24694,-26482,-28289,-30112,-31947,-33791,-35640,
-37489,-39336,-41176,-43006,-44821,-46617,-48390,-50137,
@ -595,9 +595,9 @@ static void dct32(int32 *out, int32 *tab) {
// 32 samples.
// XXX: optimize by avoiding ring buffer usage
void ff_mpa_synth_filter(int16 *synth_buf_ptr, int *synth_buf_offset,
int16 *window, int *dither_state,
int16 *samples, int incr,
int32 sb_samples[32])
int16 *window, int *dither_state,
int16 *samples, int incr,
int32 sb_samples[32])
{
int16 *synth_buf;
const int16 *w, *w2, *p;
@ -733,11 +733,11 @@ static int allocTable(VLC *vlc, int size, int use_static) {
}
static int build_table(VLC *vlc, int table_nb_bits,
int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
const void *symbols, int symbols_wrap, int symbols_size,
int code_prefix, int n_prefix, int flags)
int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
const void *symbols, int symbols_wrap, int symbols_size,
int code_prefix, int n_prefix, int flags)
{
int i, j, k, n, table_size, table_index, nb, n1, index, code_prefix2, symbol;
uint32 code;
@ -1479,8 +1479,8 @@ void QDM2Stream::fill_tone_level_array(int flag) {
* @param cm_table_select q->cm_table_select
*/
void QDM2Stream::fill_coding_method_array(sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp,
sb_int8_array coding_method, int nb_channels,
int c, int superblocktype_2_3, int cm_table_select) {
sb_int8_array coding_method, int nb_channels,
int c, int superblocktype_2_3, int cm_table_select) {
int ch, sb, j;
int tmp, acc, esp_40, comp;
int add1, add2, add3, add4;
@ -2160,7 +2160,7 @@ void QDM2Stream::qdm2_decode_super_block(void) {
}
void QDM2Stream::qdm2_fft_init_coefficient(int sub_packet, int offset, int duration,
int channel, int exp, int phase) {
int channel, int exp, int phase) {
if (_fftCoefsMinIndex[duration] < 0)
_fftCoefsMinIndex[duration] = _fftCoefsIndex;

View file

@ -44,7 +44,7 @@ class Codec;
* @return a new Codec, or NULL, if an error occurred
*/
Codec *makeQDM2Decoder(Common::SeekableReadStream *extraData,
DisposeAfterUse::Flag disposeExtraData = DisposeAfterUse::NO);
DisposeAfterUse::Flag disposeExtraData = DisposeAfterUse::NO);
} // End of namespace Audio

View file

@ -201,8 +201,8 @@ bool RawStream<bytesPerSample, isUnsigned, isLE>::seek(const Timestamp &where) {
return new RawStream<1, UNSIGNED, false>(rate, isStereo, disposeAfterUse, stream)
SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse) {
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse) {
const bool isStereo = (flags & Audio::FLAG_STEREO) != 0;
const int bytesPerSample = (flags & Audio::FLAG_24BITS ? 3 : (flags & Audio::FLAG_16BITS ? 2 : 1));
const bool isUnsigned = (flags & Audio::FLAG_UNSIGNED) != 0;
@ -218,8 +218,8 @@ SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
}
SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size,
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse) {
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse) {
return makeRawStream(new Common::MemoryReadStream(buffer, size, disposeAfterUse), rate, flags, DisposeAfterUse::YES);
}

View file

@ -76,8 +76,8 @@ enum RawFlags {
* @return The new SeekableAudioStream (or 0 on failure).
*/
SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size,
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
/**
* Creates an audio stream, which plays from the given stream.
@ -90,8 +90,8 @@ SeekableAudioStream *makeRawStream(const byte *buffer, uint32 size,
* @return The new SeekableAudioStream (or 0 on failure).
*/
SeekableAudioStream *makeRawStream(Common::SeekableReadStream *stream,
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
int rate, byte flags,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
/**
* Creates a PacketizedAudioStream that will automatically queue

View file

@ -35,7 +35,7 @@ static inline int16 floatToInt16(float src) {
// Convert planar float samples into interleaved int16 samples
static inline void floatToInt16Interleave(int16 *dst, const float **src,
uint32 length, uint8 channels) {
uint32 length, uint8 channels) {
if (channels == 2) {
for (uint32 i = 0; i < length; i++) {
dst[2 * i ] = floatToInt16(src[0][i]);

View file

@ -50,13 +50,13 @@ static inline void butterflyFloats(float *v1, float *v2, int len) {
}
static inline void vectorFMulAdd(float *dst, const float *src0,
const float *src1, const float *src2, int len) {
const float *src1, const float *src2, int len) {
while (len-- > 0)
*dst++ = *src0++ * *src1++ + *src2++;
}
static inline void vectorFMulReverse(float *dst, const float *src0,
const float *src1, int len) {
const float *src1, int len) {
src1 += len - 1;
while (len-- > 0)
@ -767,7 +767,7 @@ int WMACodec::decodeBlock(Common::BitStream8MSB &bits) {
}
bool WMACodec::decodeChannels(Common::BitStream8MSB &bits, int bSize,
bool msStereo, bool *hasChannel) {
bool msStereo, bool *hasChannel) {
int totalGain = readTotalGain(bits);
int coefBitCount = totalGainToBits(totalGain);
@ -899,7 +899,7 @@ void WMACodec::calculateCoefCount(int *coefCount, int bSize) const {
}
bool WMACodec::decodeNoise(Common::BitStream8MSB &bits, int bSize,
bool *hasChannel, int *coefCount) {
bool *hasChannel, int *coefCount) {
if (!_useNoiseCoding)
return true;
@ -973,7 +973,7 @@ bool WMACodec::decodeExponents(Common::BitStream8MSB &bits, int bSize, bool *has
}
bool WMACodec::decodeSpectralCoef(Common::BitStream8MSB &bits, bool msStereo, bool *hasChannel,
int *coefCount, int coefBitCount) {
int *coefCount, int coefBitCount) {
// Simple RLE encoding
for (int i = 0; i < _channels; i++) {
@ -1009,7 +1009,7 @@ float WMACodec::getNormalizedMDCTLength() const {
}
void WMACodec::calculateMDCTCoefficients(int bSize, bool *hasChannel,
int *coefCount, int totalGain, float mdctNorm) {
int *coefCount, int totalGain, float mdctNorm) {
for (int i = 0; i < _channels; i++) {
if (!hasChannel[i])
@ -1132,84 +1132,84 @@ void WMACodec::calculateMDCTCoefficients(int bSize, bool *hasChannel,
}
static const float powTab[] = {
1.7782794100389e-04, 2.0535250264571e-04,
2.3713737056617e-04, 2.7384196342644e-04,
3.1622776601684e-04, 3.6517412725484e-04,
4.2169650342858e-04, 4.8696752516586e-04,
5.6234132519035e-04, 6.4938163157621e-04,
7.4989420933246e-04, 8.6596432336006e-04,
1.0000000000000e-03, 1.1547819846895e-03,
1.3335214321633e-03, 1.5399265260595e-03,
1.7782794100389e-03, 2.0535250264571e-03,
2.3713737056617e-03, 2.7384196342644e-03,
3.1622776601684e-03, 3.6517412725484e-03,
4.2169650342858e-03, 4.8696752516586e-03,
5.6234132519035e-03, 6.4938163157621e-03,
7.4989420933246e-03, 8.6596432336006e-03,
1.0000000000000e-02, 1.1547819846895e-02,
1.3335214321633e-02, 1.5399265260595e-02,
1.7782794100389e-02, 2.0535250264571e-02,
2.3713737056617e-02, 2.7384196342644e-02,
3.1622776601684e-02, 3.6517412725484e-02,
4.2169650342858e-02, 4.8696752516586e-02,
5.6234132519035e-02, 6.4938163157621e-02,
7.4989420933246e-02, 8.6596432336007e-02,
1.0000000000000e-01, 1.1547819846895e-01,
1.3335214321633e-01, 1.5399265260595e-01,
1.7782794100389e-01, 2.0535250264571e-01,
2.3713737056617e-01, 2.7384196342644e-01,
3.1622776601684e-01, 3.6517412725484e-01,
4.2169650342858e-01, 4.8696752516586e-01,
5.6234132519035e-01, 6.4938163157621e-01,
7.4989420933246e-01, 8.6596432336007e-01,
1.0000000000000e+00, 1.1547819846895e+00,
1.3335214321633e+00, 1.5399265260595e+00,
1.7782794100389e+00, 2.0535250264571e+00,
2.3713737056617e+00, 2.7384196342644e+00,
3.1622776601684e+00, 3.6517412725484e+00,
4.2169650342858e+00, 4.8696752516586e+00,
5.6234132519035e+00, 6.4938163157621e+00,
7.4989420933246e+00, 8.6596432336007e+00,
1.0000000000000e+01, 1.1547819846895e+01,
1.3335214321633e+01, 1.5399265260595e+01,
1.7782794100389e+01, 2.0535250264571e+01,
2.3713737056617e+01, 2.7384196342644e+01,
3.1622776601684e+01, 3.6517412725484e+01,
4.2169650342858e+01, 4.8696752516586e+01,
5.6234132519035e+01, 6.4938163157621e+01,
7.4989420933246e+01, 8.6596432336007e+01,
1.0000000000000e+02, 1.1547819846895e+02,
1.3335214321633e+02, 1.5399265260595e+02,
1.7782794100389e+02, 2.0535250264571e+02,
2.3713737056617e+02, 2.7384196342644e+02,
3.1622776601684e+02, 3.6517412725484e+02,
4.2169650342858e+02, 4.8696752516586e+02,
5.6234132519035e+02, 6.4938163157621e+02,
7.4989420933246e+02, 8.6596432336007e+02,
1.0000000000000e+03, 1.1547819846895e+03,
1.3335214321633e+03, 1.5399265260595e+03,
1.7782794100389e+03, 2.0535250264571e+03,
2.3713737056617e+03, 2.7384196342644e+03,
3.1622776601684e+03, 3.6517412725484e+03,
4.2169650342858e+03, 4.8696752516586e+03,
5.6234132519035e+03, 6.4938163157621e+03,
7.4989420933246e+03, 8.6596432336007e+03,
1.0000000000000e+04, 1.1547819846895e+04,
1.3335214321633e+04, 1.5399265260595e+04,
1.7782794100389e+04, 2.0535250264571e+04,
2.3713737056617e+04, 2.7384196342644e+04,
3.1622776601684e+04, 3.6517412725484e+04,
4.2169650342858e+04, 4.8696752516586e+04,
5.6234132519035e+04, 6.4938163157621e+04,
7.4989420933246e+04, 8.6596432336007e+04,
1.0000000000000e+05, 1.1547819846895e+05,
1.3335214321633e+05, 1.5399265260595e+05,
1.7782794100389e+05, 2.0535250264571e+05,
2.3713737056617e+05, 2.7384196342644e+05,
3.1622776601684e+05, 3.6517412725484e+05,
4.2169650342858e+05, 4.8696752516586e+05,
5.6234132519035e+05, 6.4938163157621e+05,
7.4989420933246e+05, 8.6596432336007e+05,
1.7782794100389e-04, 2.0535250264571e-04,
2.3713737056617e-04, 2.7384196342644e-04,
3.1622776601684e-04, 3.6517412725484e-04,
4.2169650342858e-04, 4.8696752516586e-04,
5.6234132519035e-04, 6.4938163157621e-04,
7.4989420933246e-04, 8.6596432336006e-04,
1.0000000000000e-03, 1.1547819846895e-03,
1.3335214321633e-03, 1.5399265260595e-03,
1.7782794100389e-03, 2.0535250264571e-03,
2.3713737056617e-03, 2.7384196342644e-03,
3.1622776601684e-03, 3.6517412725484e-03,
4.2169650342858e-03, 4.8696752516586e-03,
5.6234132519035e-03, 6.4938163157621e-03,
7.4989420933246e-03, 8.6596432336006e-03,
1.0000000000000e-02, 1.1547819846895e-02,
1.3335214321633e-02, 1.5399265260595e-02,
1.7782794100389e-02, 2.0535250264571e-02,
2.3713737056617e-02, 2.7384196342644e-02,
3.1622776601684e-02, 3.6517412725484e-02,
4.2169650342858e-02, 4.8696752516586e-02,
5.6234132519035e-02, 6.4938163157621e-02,
7.4989420933246e-02, 8.6596432336007e-02,
1.0000000000000e-01, 1.1547819846895e-01,
1.3335214321633e-01, 1.5399265260595e-01,
1.7782794100389e-01, 2.0535250264571e-01,
2.3713737056617e-01, 2.7384196342644e-01,
3.1622776601684e-01, 3.6517412725484e-01,
4.2169650342858e-01, 4.8696752516586e-01,
5.6234132519035e-01, 6.4938163157621e-01,
7.4989420933246e-01, 8.6596432336007e-01,
1.0000000000000e+00, 1.1547819846895e+00,
1.3335214321633e+00, 1.5399265260595e+00,
1.7782794100389e+00, 2.0535250264571e+00,
2.3713737056617e+00, 2.7384196342644e+00,
3.1622776601684e+00, 3.6517412725484e+00,
4.2169650342858e+00, 4.8696752516586e+00,
5.6234132519035e+00, 6.4938163157621e+00,
7.4989420933246e+00, 8.6596432336007e+00,
1.0000000000000e+01, 1.1547819846895e+01,
1.3335214321633e+01, 1.5399265260595e+01,
1.7782794100389e+01, 2.0535250264571e+01,
2.3713737056617e+01, 2.7384196342644e+01,
3.1622776601684e+01, 3.6517412725484e+01,
4.2169650342858e+01, 4.8696752516586e+01,
5.6234132519035e+01, 6.4938163157621e+01,
7.4989420933246e+01, 8.6596432336007e+01,
1.0000000000000e+02, 1.1547819846895e+02,
1.3335214321633e+02, 1.5399265260595e+02,
1.7782794100389e+02, 2.0535250264571e+02,
2.3713737056617e+02, 2.7384196342644e+02,
3.1622776601684e+02, 3.6517412725484e+02,
4.2169650342858e+02, 4.8696752516586e+02,
5.6234132519035e+02, 6.4938163157621e+02,
7.4989420933246e+02, 8.6596432336007e+02,
1.0000000000000e+03, 1.1547819846895e+03,
1.3335214321633e+03, 1.5399265260595e+03,
1.7782794100389e+03, 2.0535250264571e+03,
2.3713737056617e+03, 2.7384196342644e+03,
3.1622776601684e+03, 3.6517412725484e+03,
4.2169650342858e+03, 4.8696752516586e+03,
5.6234132519035e+03, 6.4938163157621e+03,
7.4989420933246e+03, 8.6596432336007e+03,
1.0000000000000e+04, 1.1547819846895e+04,
1.3335214321633e+04, 1.5399265260595e+04,
1.7782794100389e+04, 2.0535250264571e+04,
2.3713737056617e+04, 2.7384196342644e+04,
3.1622776601684e+04, 3.6517412725484e+04,
4.2169650342858e+04, 4.8696752516586e+04,
5.6234132519035e+04, 6.4938163157621e+04,
7.4989420933246e+04, 8.6596432336007e+04,
1.0000000000000e+05, 1.1547819846895e+05,
1.3335214321633e+05, 1.5399265260595e+05,
1.7782794100389e+05, 2.0535250264571e+05,
2.3713737056617e+05, 2.7384196342644e+05,
3.1622776601684e+05, 3.6517412725484e+05,
4.2169650342858e+05, 4.8696752516586e+05,
5.6234132519035e+05, 6.4938163157621e+05,
7.4989420933246e+05, 8.6596432336007e+05,
};
bool WMACodec::decodeExpHuffman(Common::BitStream8MSB &bits, int ch) {

View file

@ -497,11 +497,11 @@ int MixerImpl::getVolumeForSoundType(SoundType type) const {
#pragma mark -
Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *stream,
DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent)
: _type(type), _mixer(mixer), _id(id), _permanent(permanent), _volume(Mixer::kMaxChannelVolume),
_balance(0), _pauseLevel(0), _samplesConsumed(0), _samplesDecoded(0), _mixerTimeStamp(0),
_pauseStartTime(0), _pauseTime(0), _converter(0), _volL(0), _volR(0),
_stream(stream, autofreeStream) {
DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent)
: _type(type), _mixer(mixer), _id(id), _permanent(permanent), _volume(Mixer::kMaxChannelVolume),
_balance(0), _pauseLevel(0), _samplesConsumed(0), _samplesDecoded(0), _mixerTimeStamp(0),
_pauseStartTime(0), _pauseTime(0), _converter(0), _volL(0), _volR(0),
_stream(stream, autofreeStream) {
assert(mixer);
assert(stream);

View file

@ -77,10 +77,10 @@ void SdlAudioCDManager::close() {
DefaultAudioCDManager::close();
if (_cdrom) {
SDL_CDStop(_cdrom);
SDL_CDClose(_cdrom);
SDL_CDStop(_cdrom);
SDL_CDClose(_cdrom);
_cdrom = 0;
}
}
}
void SdlAudioCDManager::stop() {

View file

@ -230,8 +230,8 @@ typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK {
UCHAR BlockNumber : 3;
UCHAR Unicode : 1;
_ANONYMOUS_UNION union {
UCHAR Text[12];
WCHAR WText[6];
UCHAR Text[12];
WCHAR WText[6];
} DUMMYUNIONNAME;
UCHAR CRC[2];
} CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;

View file

@ -71,7 +71,7 @@ Common::DialogManager::DialogResult MorphosDialogManager::showFileBrowser(const
Common::String utf8Title = title.encode();
struct Library *AslBase = OpenLibrary(AslName, 39);
if (AslBase) {
if (AslBase) {
struct FileRequester *fr = NULL;

View file

@ -32,7 +32,7 @@
#include <swis.h>
RISCOSSdlEventSource::RISCOSSdlEventSource()
: SdlEventSource() {
: SdlEventSource() {
int messages[2];
messages[0] = 3; // Message_DataLoad
messages[1] = 0;

View file

@ -73,12 +73,12 @@ void SdlEventSource::loadGameControllerMappingFile() {
#endif
SdlEventSource::SdlEventSource()
: EventSource(), _scrollLock(false), _joystick(0), _lastScreenID(0), _graphicsManager(0), _queuedFakeMouseMove(false),
_lastHatPosition(SDL_HAT_CENTERED), _mouseX(0), _mouseY(0), _engineRunning(false)
: EventSource(), _scrollLock(false), _joystick(0), _lastScreenID(0), _graphicsManager(0), _queuedFakeMouseMove(false),
_lastHatPosition(SDL_HAT_CENTERED), _mouseX(0), _mouseY(0), _engineRunning(false)
#if SDL_VERSION_ATLEAST(2, 0, 0)
, _queuedFakeKeyUp(false), _fakeKeyUp(), _controller(nullptr)
, _queuedFakeKeyUp(false), _fakeKeyUp(), _controller(nullptr)
#endif
{
{
int joystick_num = ConfMan.getInt("joystick_num");
if (joystick_num >= 0) {
// Initialize SDL joystick subsystem
@ -757,9 +757,9 @@ void SdlEventSource::openJoystick(int joystickIndex) {
_joystick = SDL_JoystickOpen(joystickIndex);
debug("Using joystick: %s",
#if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_JoystickName(_joystick)
SDL_JoystickName(_joystick)
#else
SDL_JoystickName(joystickIndex)
SDL_JoystickName(joystickIndex)
#endif
);
}

View file

@ -34,9 +34,9 @@
#define JOY_DEADZONE 3200
SymbianSdlEventSource::zoneDesc SymbianSdlEventSource::_zones[TOTAL_ZONES] = {
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
{ 150, 145, 170, 55 }
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
{ 150, 145, 170, 55 }
};
SymbianSdlEventSource::SymbianSdlEventSource()

View file

@ -171,10 +171,10 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayNam
_bIsValid = true;
}
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
} else {
debug(6, "IDOS->ExamineData() failed - ExamineDosObject returned NULL!");
}
}
LEAVE();
}

View file

@ -35,7 +35,7 @@
#include "backends/fs/chroot/chroot-fs.h"
ChRootFilesystemFactory::ChRootFilesystemFactory(const Common::String &root)
: _root(root) {
: _root(root) {
}
AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const {

View file

@ -149,7 +149,7 @@ MorphOSFilesystemNode::MorphOSFilesystemNode(BPTR pLock, const char *pDisplayNam
} else {
_bIsValid = true;
}
}
}
FreeDosObject(DOS_FIB, fib);
}

View file

@ -157,7 +157,7 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
char drive_root[] = "A:/";
drive_root[0] += i;
POSIXFilesystemNode *entry = new POSIXFilesystemNode();
POSIXFilesystemNode *entry = new POSIXFilesystemNode();
entry->_isDirectory = true;
entry->_isValid = true;
entry->_path = drive_root;

View file

@ -27,8 +27,8 @@
namespace OpenGL {
Framebuffer::Framebuffer()
: _viewport(), _projectionMatrix(), _isActive(false), _clearColor(),
_blendState(kBlendModeDisabled), _scissorTestState(false), _scissorBox() {
: _viewport(), _projectionMatrix(), _isActive(false), _clearColor(),
_blendState(kBlendModeDisabled), _scissorTestState(false), _scissorBox() {
}
void Framebuffer::activate() {
@ -187,7 +187,7 @@ void Backbuffer::setDimensions(uint width, uint height) {
#if !USE_FORCED_GLES
TextureTarget::TextureTarget()
: _texture(new GLTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE)), _glFBO(0), _needUpdate(true) {
: _texture(new GLTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE)), _glFBO(0), _needUpdate(true) {
}
TextureTarget::~TextureTarget() {

View file

@ -59,19 +59,19 @@
namespace OpenGL {
OpenGLGraphicsManager::OpenGLGraphicsManager()
: _currentState(), _oldState(), _transactionMode(kTransactionNone), _screenChangeID(1 << (sizeof(int) * 8 - 2)),
_pipeline(nullptr), _stretchMode(STRETCH_FIT),
_defaultFormat(), _defaultFormatAlpha(),
_gameScreen(nullptr), _overlay(nullptr),
_cursor(nullptr),
_cursorHotspotX(0), _cursorHotspotY(0),
_cursorHotspotXScaled(0), _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0),
_cursorKeyColor(0), _cursorDontScale(false), _cursorPaletteEnabled(false)
: _currentState(), _oldState(), _transactionMode(kTransactionNone), _screenChangeID(1 << (sizeof(int) * 8 - 2)),
_pipeline(nullptr), _stretchMode(STRETCH_FIT),
_defaultFormat(), _defaultFormatAlpha(),
_gameScreen(nullptr), _overlay(nullptr),
_cursor(nullptr),
_cursorHotspotX(0), _cursorHotspotY(0),
_cursorHotspotXScaled(0), _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0),
_cursorKeyColor(0), _cursorDontScale(false), _cursorPaletteEnabled(false)
#ifdef USE_OSD
, _osdMessageChangeRequest(false), _osdMessageAlpha(0), _osdMessageFadeStartTime(0), _osdMessageSurface(nullptr),
_osdIconSurface(nullptr)
, _osdMessageChangeRequest(false), _osdMessageAlpha(0), _osdMessageFadeStartTime(0), _osdMessageSurface(nullptr),
_osdIconSurface(nullptr)
#endif
{
{
memset(_gamePalette, 0, sizeof(_gamePalette));
g_context.reset();
}
@ -655,8 +655,8 @@ void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) const {
namespace {
template<typename SrcColor, typename DstColor>
void multiplyColorWithAlpha(const byte *src, byte *dst, const uint w, const uint h,
const Graphics::PixelFormat &srcFmt, const Graphics::PixelFormat &dstFmt,
const uint srcPitch, const uint dstPitch, const SrcColor keyColor) {
const Graphics::PixelFormat &srcFmt, const Graphics::PixelFormat &dstFmt,
const uint srcPitch, const uint dstPitch, const SrcColor keyColor) {
for (uint y = 0; y < h; ++y) {
for (uint x = 0; x < w; ++x) {
const uint32 color = *(const SrcColor *)src;

View file

@ -28,7 +28,7 @@ namespace OpenGL {
#if !USE_FORCED_GLES
CLUT8LookUpPipeline::CLUT8LookUpPipeline()
: ShaderPipeline(ShaderMan.query(ShaderManager::kCLUT8LookUp)), _paletteTexture(nullptr) {
: ShaderPipeline(ShaderMan.query(ShaderManager::kCLUT8LookUp)), _paletteTexture(nullptr) {
}
void CLUT8LookUpPipeline::drawTexture(const GLTexture &texture, const GLfloat *coordinates) {

View file

@ -26,7 +26,7 @@
namespace OpenGL {
Pipeline::Pipeline()
: _activeFramebuffer(nullptr), _isActive(false) {
: _activeFramebuffer(nullptr), _isActive(false) {
}
void Pipeline::activate() {

View file

@ -28,7 +28,7 @@ namespace OpenGL {
#if !USE_FORCED_GLES
ShaderPipeline::ShaderPipeline(Shader *shader)
: _activeShader(shader), _colorAttributes() {
: _activeShader(shader), _colorAttributes() {
_vertexAttribLocation = shader->getAttributeLocation("position");
_texCoordAttribLocation = shader->getAttributeLocation("texCoordIn");
_colorAttribLocation = shader->getAttributeLocation("blendColorIn");

View file

@ -111,7 +111,7 @@ void ShaderUniformMatrix44::set(GLint location) const {
#pragma mark - Shader Implementation -
Shader::Shader(const Common::String &vertex, const Common::String &fragment)
: _vertex(vertex), _fragment(fragment), _isActive(false), _program(0), _uniforms() {
: _vertex(vertex), _fragment(fragment), _isActive(false), _program(0), _uniforms() {
recreate();
}

View file

@ -34,10 +34,10 @@
namespace OpenGL {
GLTexture::GLTexture(GLenum glIntFormat, GLenum glFormat, GLenum glType)
: _glIntFormat(glIntFormat), _glFormat(glFormat), _glType(glType),
_width(0), _height(0), _logicalWidth(0), _logicalHeight(0),
_texCoords(), _glFilter(GL_NEAREST),
_glTexture(0) {
: _glIntFormat(glIntFormat), _glFormat(glFormat), _glType(glType),
_width(0), _height(0), _logicalWidth(0), _logicalHeight(0),
_texCoords(), _glFilter(GL_NEAREST),
_glTexture(0) {
create();
}
@ -162,7 +162,7 @@ void GLTexture::updateArea(const Common::Rect &area, const Graphics::Surface &sr
//
Surface::Surface()
: _allDirty(false), _dirtyArea() {
: _allDirty(false), _dirtyArea() {
}
void Surface::copyRectToTexture(uint x, uint y, uint w, uint h, const void *srcPtr, uint srcPitch) {
@ -216,8 +216,8 @@ Common::Rect Surface::getDirtyArea() const {
//
Texture::Texture(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
: Surface(), _format(format), _glTexture(glIntFormat, glFormat, glType),
_textureData(), _userPixelData() {
: Surface(), _format(format), _glTexture(glIntFormat, glFormat, glType),
_textureData(), _userPixelData() {
}
Texture::~Texture() {
@ -306,7 +306,7 @@ void Texture::updateGLTexture() {
}
TextureCLUT8::TextureCLUT8(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
: Texture(glIntFormat, glFormat, glType, format), _clut8Data(), _palette(new byte[256 * format.bytesPerPixel]) {
: Texture(glIntFormat, glFormat, glType, format), _clut8Data(), _palette(new byte[256 * format.bytesPerPixel]) {
memset(_palette, 0, sizeof(byte) * format.bytesPerPixel);
}
@ -421,8 +421,8 @@ void TextureCLUT8::updateGLTexture() {
#if !USE_FORCED_GL
FakeTexture::FakeTexture(GLenum glIntFormat, GLenum glFormat, GLenum glType, const Graphics::PixelFormat &format)
: Texture(glIntFormat, glFormat, glType, format),
_rgbData() {
: Texture(glIntFormat, glFormat, glType, format),
_rgbData() {
}
FakeTexture::~FakeTexture() {
@ -443,7 +443,7 @@ void FakeTexture::allocate(uint width, uint height) {
}
TextureRGB555::TextureRGB555()
: FakeTexture(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) {
: FakeTexture(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) {
}
Graphics::PixelFormat TextureRGB555::getFormat() const {
@ -485,11 +485,11 @@ void TextureRGB555::updateGLTexture() {
TextureRGBA8888Swap::TextureRGBA8888Swap()
#ifdef SCUMM_LITTLE_ENDIAN
: FakeTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) // ABGR8888
: FakeTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) // ABGR8888
#else
: FakeTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) // RGBA8888
: FakeTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) // RGBA8888
#endif
{
{
}
Graphics::PixelFormat TextureRGBA8888Swap::getFormat() const {
@ -540,11 +540,11 @@ void TextureRGBA8888Swap::updateGLTexture() {
// problems, we need to switch to GL_R8 and GL_RED, but that is only supported
// for ARB_texture_rg and GLES3+ (EXT_rexture_rg does not support GL_R8).
TextureCLUT8GPU::TextureCLUT8GPU()
: _clut8Texture(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE),
_paletteTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE),
_target(new TextureTarget()), _clut8Pipeline(new CLUT8LookUpPipeline()),
_clut8Vertices(), _clut8Data(), _userPixelData(), _palette(),
_paletteDirty(false) {
: _clut8Texture(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE),
_paletteTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE),
_target(new TextureTarget()), _clut8Pipeline(new CLUT8LookUpPipeline()),
_clut8Vertices(), _clut8Data(), _userPixelData(), _palette(),
_paletteDirty(false) {
// Allocate space for 256 colors.
_paletteTexture.setSize(256, 1);

View file

@ -33,14 +33,14 @@
#endif
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *eventSource, SdlWindow *window)
: SdlGraphicsManager(eventSource, window), _lastRequestedHeight(0),
: SdlGraphicsManager(eventSource, window), _lastRequestedHeight(0),
#if SDL_VERSION_ATLEAST(2, 0, 0)
_glContext(),
_glContext(),
#else
_lastVideoModeLoad(0),
_lastVideoModeLoad(0),
#endif
_graphicsScale(2), _ignoreLoadVideoMode(false), _gotResize(false), _wantsFullScreen(false), _ignoreResizeEvents(0),
_desiredFullscreenWidth(0), _desiredFullscreenHeight(0) {
_graphicsScale(2), _ignoreLoadVideoMode(false), _gotResize(false), _wantsFullScreen(false), _ignoreResizeEvents(0),
_desiredFullscreenWidth(0), _desiredFullscreenHeight(0) {
// Setup OpenGL attributes for SDL
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);

View file

@ -275,7 +275,7 @@ static void initGraphicsModes() {
// 0 should be the normal1x mode
s_defaultGraphicsMode = 0;
for (uint i = 0; i < plugins.size(); ++i) {
ScalerPluginObject &plugin = plugins[i]->get<ScalerPluginObject>();
ScalerPluginObject &plugin = plugins[i]->get<ScalerPluginObject>();
const Common::Array<uint> &factors = plugin.getFactors();
const char *name = plugin.getName();
const char *prettyName = plugin.getPrettyName();
@ -1891,7 +1891,7 @@ void SurfaceSdlGraphicsManager::setMouseCursor(const void *buf, uint w, uint h,
} else {
assert(!_mouseOrigSurface);
// Allocate bigger surface because scalers will read past the boudaries.
// Allocate bigger surface because scalers will read past the boudaries.
_mouseOrigSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA,
_mouseCurState.w + _maxExtraPixels * 2,
_mouseCurState.h + _maxExtraPixels * 2,
@ -2108,10 +2108,10 @@ void SurfaceSdlGraphicsManager::blitCursor() {
// HACK: AdvMame4x requires a height of at least 4 pixels, so we
// fall back on the Normal scaler when a smaller cursor is supplied.
if (_scalerPlugin->canDrawCursor() && (uint)_mouseCurState.h >= _extraPixels) {
_scalerPlugin->scale(
(byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch * _maxExtraPixels + _maxExtraPixels * _mouseOrigSurface->format->BytesPerPixel,
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
_mouseCurState.w, _mouseCurState.h, 0, 0);
_scalerPlugin->scale(
(byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch * _maxExtraPixels + _maxExtraPixels * _mouseOrigSurface->format->BytesPerPixel,
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
_mouseCurState.w, _mouseCurState.h, 0, 0);
} else
#endif
{

View file

@ -305,7 +305,7 @@ void OpenGLSdlGraphics3dManager::createOrUpdateScreen() {
}
Math::Rect2d OpenGLSdlGraphics3dManager::computeGameRect(bool renderToFrameBuffer, uint gameWidth, uint gameHeight,
uint screenWidth, uint screenHeight) {
uint screenWidth, uint screenHeight) {
if (renderToFrameBuffer) {
if (_lockAspectRatio) {
// The game is scaled to fit the screen, keeping the same aspect ratio
@ -382,9 +382,9 @@ OpenGLSdlGraphics3dManager::OpenGLPixelFormat::OpenGLPixelFormat(uint screenByte
}
bool OpenGLSdlGraphics3dManager::createOrUpdateGLContext(uint gameWidth, uint gameHeight,
uint effectiveWidth, uint effectiveHeight,
bool renderToFramebuffer,
bool engineSupportsArbitraryResolutions) {
uint effectiveWidth, uint effectiveHeight,
bool renderToFramebuffer,
bool engineSupportsArbitraryResolutions) {
// Build a list of OpenGL pixel formats usable by ScummVM
Common::Array<OpenGLPixelFormat> pixelFormats;
if (_antialiasing > 0 && !renderToFramebuffer) {

View file

@ -242,43 +242,43 @@ const ModifierTableEntry defaultModifiers[] = {
};
const HardwareInputTableEntry defaultMouseButtons[] = {
{ "MOUSE_LEFT", MOUSE_BUTTON_LEFT, _s("Left Mouse Button") },
{ "MOUSE_RIGHT", MOUSE_BUTTON_RIGHT, _s("Right Mouse Button") },
{ "MOUSE_MIDDLE", MOUSE_BUTTON_MIDDLE, _s("Middle Mouse Button") },
{ "MOUSE_WHEEL_UP", MOUSE_WHEEL_UP, _s("Mouse Wheel Up") },
{ "MOUSE_WHEEL_DOWN", MOUSE_WHEEL_DOWN, _s("Mouse Wheel Down") },
{ "MOUSE_X1", MOUSE_BUTTON_X1, _s("X1 Mouse Button") },
{ "MOUSE_X2", MOUSE_BUTTON_X2, _s("X2 Mouse Button") },
{ nullptr, 0, nullptr }
{ "MOUSE_LEFT", MOUSE_BUTTON_LEFT, _s("Left Mouse Button") },
{ "MOUSE_RIGHT", MOUSE_BUTTON_RIGHT, _s("Right Mouse Button") },
{ "MOUSE_MIDDLE", MOUSE_BUTTON_MIDDLE, _s("Middle Mouse Button") },
{ "MOUSE_WHEEL_UP", MOUSE_WHEEL_UP, _s("Mouse Wheel Up") },
{ "MOUSE_WHEEL_DOWN", MOUSE_WHEEL_DOWN, _s("Mouse Wheel Down") },
{ "MOUSE_X1", MOUSE_BUTTON_X1, _s("X1 Mouse Button") },
{ "MOUSE_X2", MOUSE_BUTTON_X2, _s("X2 Mouse Button") },
{ nullptr, 0, nullptr }
};
const HardwareInputTableEntry defaultJoystickButtons[] = {
{ "JOY_A", JOYSTICK_BUTTON_A, _s("Joy A") },
{ "JOY_B", JOYSTICK_BUTTON_B, _s("Joy B") },
{ "JOY_X", JOYSTICK_BUTTON_X, _s("Joy X") },
{ "JOY_Y", JOYSTICK_BUTTON_Y, _s("Joy Y") },
{ "JOY_BACK", JOYSTICK_BUTTON_BACK, _s("Joy Back") },
{ "JOY_GUIDE", JOYSTICK_BUTTON_GUIDE, _s("Joy Guide") },
{ "JOY_START", JOYSTICK_BUTTON_START, _s("Joy Start") },
{ "JOY_LEFT_STICK", JOYSTICK_BUTTON_LEFT_STICK, _s("Left Stick") },
{ "JOY_RIGHT_STICK", JOYSTICK_BUTTON_RIGHT_STICK, _s("Right Stick") },
{ "JOY_LEFT_SHOULDER", JOYSTICK_BUTTON_LEFT_SHOULDER, _s("Left Shoulder") },
{ "JOY_RIGHT_SHOULDER", JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("Right Shoulder") },
{ "JOY_UP", JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", JOYSTICK_BUTTON_A, _s("Joy A") },
{ "JOY_B", JOYSTICK_BUTTON_B, _s("Joy B") },
{ "JOY_X", JOYSTICK_BUTTON_X, _s("Joy X") },
{ "JOY_Y", JOYSTICK_BUTTON_Y, _s("Joy Y") },
{ "JOY_BACK", JOYSTICK_BUTTON_BACK, _s("Joy Back") },
{ "JOY_GUIDE", JOYSTICK_BUTTON_GUIDE, _s("Joy Guide") },
{ "JOY_START", JOYSTICK_BUTTON_START, _s("Joy Start") },
{ "JOY_LEFT_STICK", JOYSTICK_BUTTON_LEFT_STICK, _s("Left Stick") },
{ "JOY_RIGHT_STICK", JOYSTICK_BUTTON_RIGHT_STICK, _s("Right Stick") },
{ "JOY_LEFT_SHOULDER", JOYSTICK_BUTTON_LEFT_SHOULDER, _s("Left Shoulder") },
{ "JOY_RIGHT_SHOULDER", JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("Right Shoulder") },
{ "JOY_UP", JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
const AxisTableEntry defaultJoystickAxes[] = {
{ "JOY_LEFT_TRIGGER", JOYSTICK_AXIS_LEFT_TRIGGER, kAxisTypeHalf, _s("Left Trigger") },
{ "JOY_RIGHT_TRIGGER", JOYSTICK_AXIS_RIGHT_TRIGGER, kAxisTypeHalf, _s("Right Trigger") },
{ "JOY_LEFT_STICK_X", JOYSTICK_AXIS_LEFT_STICK_X, kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", JOYSTICK_AXIS_LEFT_STICK_Y, kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", JOYSTICK_AXIS_RIGHT_STICK_X, kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", JOYSTICK_AXIS_RIGHT_STICK_Y, kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, kAxisTypeFull, nullptr }
{ "JOY_LEFT_TRIGGER", JOYSTICK_AXIS_LEFT_TRIGGER, kAxisTypeHalf, _s("Left Trigger") },
{ "JOY_RIGHT_TRIGGER", JOYSTICK_AXIS_RIGHT_TRIGGER, kAxisTypeHalf, _s("Right Trigger") },
{ "JOY_LEFT_STICK_X", JOYSTICK_AXIS_LEFT_STICK_X, kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", JOYSTICK_AXIS_LEFT_STICK_Y, kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", JOYSTICK_AXIS_RIGHT_STICK_X, kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", JOYSTICK_AXIS_RIGHT_STICK_Y, kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, kAxisTypeFull, nullptr }
};
HardwareInputSet::~HardwareInputSet() {

View file

@ -32,7 +32,7 @@ namespace Backends {
namespace Log {
Log::Log(OSystem *system)
: _system(system), _stream(0), _startOfLine(true) {
: _system(system), _stream(0), _startOfLine(true) {
assert(system);
}

View file

@ -45,32 +45,32 @@ static InputMode savedInputMode = MODE_DRAG;
static aptHookCookie cookie;
static const Common::HardwareInputTableEntry ctrJoystickButtons[] = {
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("A") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("B") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("X") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Y") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("ZL") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("ZR") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("A") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("B") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("X") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Y") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("ZL") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("ZR") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
static const Common::AxisTableEntry ctrJoystickAxes[] = {
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("C-Pad X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("C-Pad Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("C-Pad X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("C-Pad Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
};
const Common::HardwareInputTableEntry ctrMouseButtons[] = {
{ "MOUSE_LEFT", Common::MOUSE_BUTTON_LEFT, _s("Touch") },
{ nullptr, 0, nullptr }
{ "MOUSE_LEFT", Common::MOUSE_BUTTON_LEFT, _s("Touch") },
{ nullptr, 0, nullptr }
};
static const int16 CIRCLE_MAX = 160;

View file

@ -31,27 +31,27 @@
// Used to transfer the final rendered display to the framebuffer
#define DISPLAY_TRANSFER_FLAGS \
(GX_TRANSFER_FLIP_VERT(0) | GX_TRANSFER_OUT_TILED(0) | \
GX_TRANSFER_RAW_COPY(0) | GX_TRANSFER_IN_FORMAT(GX_TRANSFER_FMT_RGBA8) | \
GX_TRANSFER_OUT_FORMAT(GX_TRANSFER_FMT_RGB8) | \
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
(GX_TRANSFER_FLIP_VERT(0) | GX_TRANSFER_OUT_TILED(0) | \
GX_TRANSFER_RAW_COPY(0) | GX_TRANSFER_IN_FORMAT(GX_TRANSFER_FMT_RGBA8) | \
GX_TRANSFER_OUT_FORMAT(GX_TRANSFER_FMT_RGB8) | \
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
#define TEXTURE_TRANSFER_FLAGS(fmt) \
(GX_TRANSFER_FLIP_VERT(1) | GX_TRANSFER_OUT_TILED(1) | \
GX_TRANSFER_RAW_COPY(0) | GX_TRANSFER_IN_FORMAT(fmt) | \
GX_TRANSFER_OUT_FORMAT(fmt) | GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
(GX_TRANSFER_FLIP_VERT(1) | GX_TRANSFER_OUT_TILED(1) | \
GX_TRANSFER_RAW_COPY(0) | GX_TRANSFER_IN_FORMAT(fmt) | \
GX_TRANSFER_OUT_FORMAT(fmt) | GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
#define DEFAULT_MODE _modeRGBA8
namespace N3DS {
/* Group the various enums, values, etc. needed for
* each graphics mode into instaces of GfxMode3DS */
static const GfxMode3DS _modeRGBA8 = { Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0),
GPU_RGBA8, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGBA8) };
GPU_RGBA8, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGBA8) };
static const GfxMode3DS _modeRGB565 = { Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),
GPU_RGB565, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB565) };
GPU_RGB565, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB565) };
static const GfxMode3DS _modeRGB555 = { Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0),
GPU_RGBA5551, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB5A1) };
GPU_RGBA5551, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB5A1) };
static const GfxMode3DS _modeRGB5A1 = { Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0),
GPU_RGBA5551, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB5A1) };
GPU_RGBA5551, TEXTURE_TRANSFER_FLAGS(GX_TRANSFER_FMT_RGB5A1) };
static const GfxMode3DS _modeCLUT8 = _modeRGBA8;
static const GfxMode3DS *gfxModes[] = { &_modeRGBA8, &_modeRGB565, &_modeRGB555, &_modeRGB5A1, &_modeCLUT8 };
@ -187,7 +187,7 @@ bool OSystem_3DS::setGraphicsMode(GraphicsModeID modeID) {
}
void OSystem_3DS::initSize(uint width, uint height,
const Graphics::PixelFormat *format) {
const Graphics::PixelFormat *format) {
debug("3ds initsize w:%d h:%d", width, height);
int oldScreen = config.screen;
loadConfig();
@ -361,7 +361,7 @@ static void copyRect555To5551(const Graphics::Surface &srcSurface, Graphics::Sur
}
void OSystem_3DS::copyRectToScreen(const void *buf, int pitch, int x,
int y, int w, int h) {
int y, int w, int h) {
Common::Rect rect(x, y, x+w, y+h);
_gameScreen.copyRectToSurface(buf, pitch, x, y, w, h);
Graphics::Surface subSurface = _gameScreen.getSubArea(rect);
@ -636,7 +636,7 @@ void OSystem_3DS::grabOverlay(void *buf, int pitch) {
}
void OSystem_3DS::copyRectToOverlay(const void *buf, int pitch, int x,
int y, int w, int h) {
int y, int w, int h) {
_overlay.copyRectToSurface(buf, pitch, x, y, w, h);
_overlay.markDirty();
}
@ -760,9 +760,9 @@ void OSystem_3DS::setCursorDelta(float deltaX, float deltaY) {
}
void OSystem_3DS::setMouseCursor(const void *buf, uint w, uint h,
int hotspotX, int hotspotY,
uint32 keycolor, bool dontScale,
const Graphics::PixelFormat *format) {
int hotspotX, int hotspotY,
uint32 keycolor, bool dontScale,
const Graphics::PixelFormat *format) {
_cursorScalable = !dontScale;
_cursorHotspotX = hotspotX;
_cursorHotspotY = hotspotY;

View file

@ -100,10 +100,10 @@ void OSystem_Android::scaleMouse(Common::Point &p, int x, int y, bool touchpadMo
}
void OSystem_Android::updateEventScale(const GLESBaseTexture *tex) {
if (tex && (tex->height() != 0) && (tex->width() != 0)) {
if (tex && (tex->height() != 0) && (tex->width() != 0)) {
_eventScaleY = 100 * 480 / tex->height();
_eventScaleX = 100 * 640 / tex->width();
}
}
}
void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,

View file

@ -42,35 +42,35 @@ void OSystem_Dreamcast::checkSound()
int curr_ring_buffer_samples;
if (!_mixer)
return;
return;
if (read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY)
start_sound();
start_sound();
curr_ring_buffer_samples = read_sound_int(&SOUNDSTATUS->ring_length);
n = read_sound_int(&SOUNDSTATUS->samplepos);
if ((n-=fillpos)<0)
n += curr_ring_buffer_samples;
n += curr_ring_buffer_samples;
n = ADJUST_BUFFER_SIZE(n-10);
if (n<100)
return;
return;
_mixer->mixCallback((byte *)temp_sound_buffer,
2*SAMPLES_TO_BYTES(n));
if (fillpos+n > curr_ring_buffer_samples) {
int r = curr_ring_buffer_samples - fillpos;
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r));
fillpos = 0;
n -= r;
memcpy4s(RING_BUF, temp_sound_buffer+r, SAMPLES_TO_BYTES(n));
int r = curr_ring_buffer_samples - fillpos;
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r));
fillpos = 0;
n -= r;
memcpy4s(RING_BUF, temp_sound_buffer+r, SAMPLES_TO_BYTES(n));
} else {
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n));
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n));
}
if ((fillpos += n) >= curr_ring_buffer_samples)
fillpos = 0;
fillpos = 0;
}

View file

@ -115,17 +115,17 @@ static void purge_copyback()
{
int i;
for (i=0; i!=(1<<14); i+=(1<<5))
*(volatile unsigned int *)(0xf4000000+i) &= ~3;
*(volatile unsigned int *)(0xf4000000+i) &= ~3;
}
void DLObject::seterror(const char *fmt, ...)
{
if (errbuf) {
va_list va;
va_start(va, fmt);
vsnprintf(errbuf, MAXDLERRLEN, fmt, va);
va_end(va);
va_list va;
va_start(va, fmt);
vsnprintf(errbuf, MAXDLERRLEN, fmt, va);
va_end(va);
}
}
@ -150,34 +150,34 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size)
Elf32_Rela *rela;
if (!(rela = (Elf32_Rela *)malloc(size))) {
seterror("Out of memory.");
return false;
seterror("Out of memory.");
return false;
}
if (lseek(fd, offset, SEEK_SET)<0 ||
read(fd, rela, size) != (ssize_t)size) {
seterror("Relocation table load failed.");
free(rela);
return false;
read(fd, rela, size) != (ssize_t)size) {
seterror("Relocation table load failed.");
free(rela);
return false;
}
int cnt = size / sizeof(*rela);
for (int i=0; i<cnt; i++) {
Elf32_Sym *sym = (Elf32_Sym *)(void *)(((char *)symtab)+(rela[i].r_info>>4));
Elf32_Sym *sym = (Elf32_Sym *)(void *)(((char *)symtab)+(rela[i].r_info>>4));
void *target = ((char *)segment)+rela[i].r_offset;
void *target = ((char *)segment)+rela[i].r_offset;
switch(rela[i].r_info & 0xf) {
case 1: /* DIR32 */
if (sym->st_shndx < 0xff00)
switch(rela[i].r_info & 0xf) {
case 1: /* DIR32 */
if (sym->st_shndx < 0xff00)
*(unsigned long *)target += (unsigned long)segment;
break;
default:
seterror("Unknown relocation type %d.", rela[i].r_info & 0xf);
free(rela);
return false;
}
break;
default:
seterror("Unknown relocation type %d.", rela[i].r_info & 0xf);
free(rela);
return false;
}
}
@ -194,105 +194,105 @@ bool DLObject::load(int fd)
int symtab_sect = -1;
if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
ehdr.e_type != 2 || ehdr.e_machine != 42 ||
ehdr.e_phentsize < sizeof(phdr) || ehdr.e_shentsize != sizeof(*shdr) ||
ehdr.e_phnum != 1) {
seterror("Invalid file type.");
return false;
memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
ehdr.e_type != 2 || ehdr.e_machine != 42 ||
ehdr.e_phentsize < sizeof(phdr) || ehdr.e_shentsize != sizeof(*shdr) ||
ehdr.e_phnum != 1) {
seterror("Invalid file type.");
return false;
}
DBG(("phoff = %d, phentsz = %d, phnum = %d\n",
ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum));
ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum));
if (lseek(fd, ehdr.e_phoff, SEEK_SET)<0 ||
read(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) {
seterror("Program header load failed.");
return false;
read(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) {
seterror("Program header load failed.");
return false;
}
if (phdr.p_type != 1 || phdr.p_vaddr != 0 || phdr.p_paddr != 0 ||
phdr.p_filesz > phdr.p_memsz) {
seterror("Invalid program header.");
return false;
phdr.p_filesz > phdr.p_memsz) {
seterror("Invalid program header.");
return false;
}
DBG(("offs = %d, filesz = %d, memsz = %d, align = %d\n",
phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align));
phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align));
if (!(segment = memalign(phdr.p_align, phdr.p_memsz))) {
seterror("Out of memory.");
return false;
seterror("Out of memory.");
return false;
}
DBG(("segment @ %p\n", segment));
if (phdr.p_memsz > phdr.p_filesz)
memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz);
memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz);
if (lseek(fd, phdr.p_offset, SEEK_SET)<0 ||
read(fd, segment, phdr.p_filesz) != (ssize_t)phdr.p_filesz) {
seterror("Segment load failed.");
return false;
read(fd, segment, phdr.p_filesz) != (ssize_t)phdr.p_filesz) {
seterror("Segment load failed.");
return false;
}
DBG(("shoff = %d, shentsz = %d, shnum = %d\n",
ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum));
ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum));
if (!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) {
seterror("Out of memory.");
return false;
seterror("Out of memory.");
return false;
}
if (lseek(fd, ehdr.e_shoff, SEEK_SET)<0 ||
read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) !=
(ssize_t)(ehdr.e_shnum * sizeof(*shdr))) {
seterror("Section headers load failed.");
free(shdr);
return false;
read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) !=
(ssize_t)(ehdr.e_shnum * sizeof(*shdr))) {
seterror("Section headers load failed.");
free(shdr);
return false;
}
for (int i=0; i<ehdr.e_shnum; i++) {
DBG(("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
DBG(("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
i, shdr[i].sh_type, shdr[i].sh_size, shdr[i].sh_entsize, shdr[i].sh_link));
if (shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
shdr[i].sh_link < ehdr.e_shnum && shdr[shdr[i].sh_link].sh_type == 3 &&
symtab_sect < 0)
symtab_sect = i;
if (shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
shdr[i].sh_link < ehdr.e_shnum && shdr[shdr[i].sh_link].sh_type == 3 &&
symtab_sect < 0)
symtab_sect = i;
}
if (symtab_sect < 0) {
seterror("No symbol table.");
free(shdr);
return false;
seterror("No symbol table.");
free(shdr);
return false;
}
if (!(symtab = malloc(shdr[symtab_sect].sh_size))) {
seterror("Out of memory.");
free(shdr);
return false;
seterror("Out of memory.");
free(shdr);
return false;
}
if (lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
read(fd, symtab, shdr[symtab_sect].sh_size) !=
(ssize_t)shdr[symtab_sect].sh_size){
seterror("Symbol table load failed.");
free(shdr);
return false;
read(fd, symtab, shdr[symtab_sect].sh_size) !=
(ssize_t)shdr[symtab_sect].sh_size){
seterror("Symbol table load failed.");
free(shdr);
return false;
}
if (!(strtab = (char *)malloc(shdr[shdr[symtab_sect].sh_link].sh_size))) {
seterror("Out of memory.");
free(shdr);
return false;
seterror("Out of memory.");
free(shdr);
return false;
}
if (lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
(ssize_t)shdr[shdr[symtab_sect].sh_link].sh_size){
seterror("Symbol table strings load failed.");
free(shdr);
return false;
read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
(ssize_t)shdr[shdr[symtab_sect].sh_link].sh_size){
seterror("Symbol table strings load failed.");
free(shdr);
return false;
}
symbol_cnt = shdr[symtab_sect].sh_size / sizeof(Elf32_Sym);
@ -300,17 +300,17 @@ bool DLObject::load(int fd)
Elf32_Sym *s = (Elf32_Sym *)symtab;
for (int c = symbol_cnt; c--; s++)
if (s->st_shndx < 0xff00)
s->st_value += (Elf32_Addr)segment;
if (s->st_shndx < 0xff00)
s->st_value += (Elf32_Addr)segment;
for (int i=0; i<ehdr.e_shnum; i++)
if (shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
if (shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
(int)shdr[i].sh_link == symtab_sect && shdr[i].sh_info < ehdr.e_shnum &&
(shdr[shdr[i].sh_info].sh_flags & 2))
if (!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
if (!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
free(shdr);
return false;
}
}
free(shdr);
@ -325,14 +325,14 @@ bool DLObject::open(const char *path)
DBG(("open(\"%s\")\n", path));
if ((fd = ::open(path, O_RDONLY))<0) {
seterror("%s not found.", path);
return false;
seterror("%s not found.", path);
return false;
}
if (!load(fd)) {
::close(fd);
unload();
return false;
::close(fd);
unload();
return false;
}
::close(fd);
@ -350,16 +350,16 @@ bool DLObject::open(const char *path)
dso_handle = symbol("__dso_handle");
if (ctors_start == NULL || ctors_end == NULL || dtors_start == NULL ||
dtors_end == NULL) {
seterror("Missing ctors/dtors.");
dtors_start = dtors_end = NULL;
unload();
return false;
dtors_end == NULL) {
seterror("Missing ctors/dtors.");
dtors_start = dtors_end = NULL;
unload();
return false;
}
DBG(("Calling constructors.\n"));
for (void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
(**f)();
(**f)();
DBG(("%s opened ok.\n", path));
return true;
@ -368,12 +368,12 @@ bool DLObject::open(const char *path)
bool DLObject::close()
{
if (dso_handle != NULL) {
__cxxabiv1::__cxa_finalize(dso_handle);
dso_handle = NULL;
__cxxabiv1::__cxa_finalize(dso_handle);
dso_handle = NULL;
}
if (dtors_start != NULL && dtors_end != NULL)
for (void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
(**f)();
for (void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
(**f)();
dtors_start = dtors_end = NULL;
unload();
return true;
@ -384,17 +384,17 @@ void *DLObject::symbol(const char *name)
DBG(("symbol(\"%s\")\n", name));
if (symtab == NULL || strtab == NULL || symbol_cnt < 1) {
seterror("No symbol table loaded.");
return NULL;
seterror("No symbol table loaded.");
return NULL;
}
Elf32_Sym *s = (Elf32_Sym *)symtab;
for (int c = symbol_cnt; c--; s++)
if ((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) {
DBG(("=> %p\n", (void *)s->st_value));
return (void *)s->st_value;
}
if ((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) {
DBG(("=> %p\n", (void *)s->st_value));
return (void *)s->st_value;
}
seterror("Symbol \"%s\" not found.", name);
return NULL;
@ -407,7 +407,7 @@ void *dlopen(const char *filename, int flags)
{
DLObject *obj = new DLObject(dlerr);
if (obj->open(filename))
return (void *)obj;
return (void *)obj;
delete obj;
return NULL;
}
@ -416,12 +416,12 @@ int dlclose(void *handle)
{
DLObject *obj = (DLObject *)handle;
if (obj == NULL) {
strcpy(dlerr, "Handle is NULL.");
return -1;
strcpy(dlerr, "Handle is NULL.");
return -1;
}
if (obj->close()) {
delete obj;
return 0;
delete obj;
return 0;
}
return -1;
}
@ -429,8 +429,8 @@ int dlclose(void *handle)
void *dlsym(void *handle, const char *symbol)
{
if (handle == NULL) {
strcpy(dlerr, "Handle is NULL.");
return NULL;
strcpy(dlerr, "Handle is NULL.");
return NULL;
}
return ((DLObject *)handle)->symbol(symbol);
}
@ -443,5 +443,5 @@ const char *dlerror()
void dlforgetsyms(void *handle)
{
if (handle != NULL)
((DLObject *)handle)->discard_symtab();
((DLObject *)handle)->discard_symtab();
}

View file

@ -48,7 +48,7 @@ class DLObject {
void discard_symtab();
DLObject(char *_errbuf = NULL) : errbuf(_errbuf), segment(NULL),symtab(NULL),
strtab(NULL), symbol_cnt(0), dtors_start(NULL), dtors_end(NULL) {}
strtab(NULL), symbol_cnt(0), dtors_start(NULL), dtors_end(NULL) {}
};
#define RTLD_LAZY 0

View file

@ -42,9 +42,9 @@ char gGameName[32];
OSystem_Dreamcast::OSystem_Dreamcast()
: _devpoll(0), screen(NULL), mouse(NULL), overlay(NULL), _softkbd(this),
_ms_buf(NULL), _mixer(NULL),
_current_shake_x_pos(0), _current_shake_y_pos(0), _aspect_stretch(false), _softkbd_on(false),
_softkbd_motion(0), _enable_cursor_palette(false), _screenFormat(0)
_ms_buf(NULL), _mixer(NULL),
_current_shake_x_pos(0), _current_shake_y_pos(0), _aspect_stretch(false), _softkbd_on(false),
_softkbd_motion(0), _enable_cursor_palette(false), _screenFormat(0)
{
memset(screen_tx, 0, sizeof(screen_tx));
memset(mouse_tx, 0, sizeof(mouse_tx));
@ -73,21 +73,21 @@ static bool find_track(int track, int &first_sec, int &last_sec)
{
struct TOC *toc = cdfs_gettoc();
if (!toc)
return false;
return false;
int i, first, last;
first = TOC_TRACK(toc->first);
last = TOC_TRACK(toc->last);
if (first < 1 || last > 99 || first > last)
return false;
return false;
for (i=first; i<=last; i++)
if (!(TOC_CTRL(toc->entry[i-1])&4)) {
if (track==1) {
if (!(TOC_CTRL(toc->entry[i-1])&4)) {
if (track==1) {
first_sec = TOC_LBA(toc->entry[i-1]);
last_sec = TOC_LBA(toc->entry[i]);
return true;
} else
} else
--track;
}
}
return false;
}
@ -179,9 +179,9 @@ bool OSystem_Dreamcast::hasFeature(Feature f)
case kFeatureVirtualKeyboard:
case kFeatureOverlaySupportsAlpha:
case kFeatureCursorPalette:
return true;
return true;
default:
return false;
return false;
}
}
@ -189,18 +189,18 @@ void OSystem_Dreamcast::setFeatureState(Feature f, bool enable)
{
switch(f) {
case kFeatureAspectRatioCorrection:
_aspect_stretch = enable;
if (screen)
setScaling();
break;
_aspect_stretch = enable;
if (screen)
setScaling();
break;
case kFeatureVirtualKeyboard:
_softkbd_on = enable;
break;
_softkbd_on = enable;
break;
case kFeatureCursorPalette:
_enable_cursor_palette = enable;
break;
_enable_cursor_palette = enable;
break;
default:
break;
break;
}
}
@ -208,13 +208,13 @@ bool OSystem_Dreamcast::getFeatureState(Feature f)
{
switch(f) {
case kFeatureAspectRatioCorrection:
return _aspect_stretch;
return _aspect_stretch;
case kFeatureVirtualKeyboard:
return _softkbd_on;
return _softkbd_on;
case kFeatureCursorPalette:
return _enable_cursor_palette;
return _enable_cursor_palette;
default:
return false;
return false;
}
}
@ -250,53 +250,53 @@ void OSystem_Dreamcast::logMessage(LogMessageType::Type type, const char *messag
namespace DC_Flash {
static int syscall_info_flash(int sect, int *info)
{
return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0);
return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0);
}
static int syscall_read_flash(int offs, void *buf, int cnt)
{
return (*(int (**)(int, void*, int, int))0x8c0000b8)(offs,buf,cnt,1);
return (*(int (**)(int, void*, int, int))0x8c0000b8)(offs,buf,cnt,1);
}
static int flash_crc(const char *buf, int size)
{
int i, c, n = -1;
for(i=0; i<size; i++) {
n ^= (buf[i]<<8);
for(c=0; c<8; c++)
int i, c, n = -1;
for(i=0; i<size; i++) {
n ^= (buf[i]<<8);
for(c=0; c<8; c++)
if(n & 0x8000)
n = (n << 1) ^ 4129;
else
n <<= 1;
}
return (unsigned short)~n;
}
return (unsigned short)~n;
}
static int flash_read_sector(int partition, int sec, unsigned char *dst)
{
int s, r, n, b, bmb, got=0;
int info[2];
char buf[64];
char bm[64];
int s, r, n, b, bmb, got=0;
int info[2];
char buf[64];
char bm[64];
if((r = syscall_info_flash(partition, info))<0)
return r;
if((r = syscall_info_flash(partition, info))<0)
return r;
if((r = syscall_read_flash(info[0], buf, 64))<0)
return r;
if((r = syscall_read_flash(info[0], buf, 64))<0)
return r;
if(memcmp(buf, "KATANA_FLASH", 12) ||
buf[16] != partition || buf[17] != 0)
return -2;
if(memcmp(buf, "KATANA_FLASH", 12) ||
buf[16] != partition || buf[17] != 0)
return -2;
n = (info[1]>>6)-1-((info[1] + 0x7fff)>>15);
bmb = n+1;
for(b = 0; b < n; b++) {
if(!(b&511)) {
n = (info[1]>>6)-1-((info[1] + 0x7fff)>>15);
bmb = n+1;
for(b = 0; b < n; b++) {
if(!(b&511)) {
if((r = syscall_read_flash(info[0] + (bmb++ << 6), bm, 64))<0)
return r;
}
if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) {
}
if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) {
if((r = syscall_read_flash(info[0] + ((b+1) << 6), buf, 64))<0)
return r;
else if((s=READ_LE_UINT16(buf+0)) == sec &&
@ -304,33 +304,33 @@ namespace DC_Flash {
memcpy(dst+(s-sec)*60, buf+2, 60);
got=1;
}
}
}
return got;
}
}
return got;
}
static int get_locale_setting()
{
unsigned char data[60];
if (flash_read_sector(2,5,data) == 1)
return data[5];
else
return -1;
unsigned char data[60];
if (flash_read_sector(2,5,data) == 1)
return data[5];
else
return -1;
}
} // End of namespace DC_Flash
Common::String OSystem_Dreamcast::getSystemLanguage() const {
static const char *languages[] = {
"ja_JP",
"en_US",
"de_DE",
"fr_FR",
"es_ES",
"it_IT"
"ja_JP",
"en_US",
"de_DE",
"fr_FR",
"es_ES",
"it_IT"
};
int l = DC_Flash::get_locale_setting();
if (l<0 || ((unsigned)l)>=sizeof(languages)/sizeof(languages[0]))
l = 1;
l = 1;
return Common::String(languages[l]);
}
@ -374,7 +374,7 @@ int DCLauncherDialog::runModal()
Common::Platform platform = Common::kPlatformUnknown;
if (!selectGame(engineId, gameId, dir, language, platform, icon))
g_system->quit();
g_system->quit();
// Set the game path.
ConfMan.addGameDomain(gameId);
@ -382,15 +382,15 @@ int DCLauncherDialog::runModal()
ConfMan.set("gameid", gameId, gameId);
if (dir != NULL)
ConfMan.set("path", dir, gameId);
ConfMan.set("path", dir, gameId);
// Set the game language.
if (language != Common::UNK_LANG)
ConfMan.set("language", Common::getLanguageCode(language), gameId);
ConfMan.set("language", Common::getLanguageCode(language), gameId);
// Set the game platform.
if (platform != Common::kPlatformUnknown)
ConfMan.set("platform", Common::getPlatformCode(platform), gameId);
ConfMan.set("platform", Common::getPlatformCode(platform), gameId);
// Set the target.
ConfMan.setActiveDomain(gameId);

View file

@ -44,8 +44,8 @@ static const struct {
operator const Graphics::PixelFormat&() const { return pixelFormat; }
} screenFormats[] = {
/* Note: These are ordered by _increasing_ preference, so that
CLUT8 appears at index 0. getSupportedFormats() will return
them in reversed order. */
CLUT8 appears at index 0. getSupportedFormats() will return
them in reversed order. */
{ Graphics::PixelFormat::createFormatCLUT8(), TA_TEXTUREMODE_ARGB1555 },
{ Graphics::PixelFormat(2,4,4,4,4,8,4,0,12), TA_TEXTUREMODE_ARGB4444 },
{ Graphics::PixelFormat(2,5,5,5,1,10,5,0,15), TA_TEXTUREMODE_ARGB1555 },
@ -67,32 +67,32 @@ static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short
{
unsigned char *s = (unsigned char *)src;
unsigned int *d = (unsigned int *)(void *)
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
QACR0 = ((0xa4000000>>26)<<2)&0x1c;
QACR1 = ((0xa4000000>>26)<<2)&0x1c;
while (cnt--) {
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
COPYPIXEL(6);
COPYPIXEL(7);
asm("pref @%0" : : "r" (d));
d += 8;
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
COPYPIXEL(6);
COPYPIXEL(7);
asm("pref @%0" : : "r" (d));
d += 8;
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
COPYPIXEL(6);
COPYPIXEL(7);
asm("pref @%0" : : "r" (d));
d += 8;
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
COPYPIXEL(6);
COPYPIXEL(7);
asm("pref @%0" : : "r" (d));
d += 8;
}
}
@ -100,32 +100,32 @@ static void texture_memcpy64(void *dest, void *src, int cnt)
{
unsigned int *s = (unsigned int *)src;
unsigned int *d = (unsigned int *)(void *)
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
(0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
QACR0 = ((0xa4000000>>26)<<2)&0x1c;
QACR1 = ((0xa4000000>>26)<<2)&0x1c;
while (cnt--) {
d[0] = *s++;
d[1] = *s++;
d[2] = *s++;
d[3] = *s++;
asm("pref @%0" : : "r" (s+16));
d[4] = *s++;
d[5] = *s++;
d[6] = *s++;
d[7] = *s++;
asm("pref @%0" : : "r" (d));
d += 8;
d[0] = *s++;
d[1] = *s++;
d[2] = *s++;
d[3] = *s++;
asm("pref @%0" : : "r" (s+16));
d[4] = *s++;
d[5] = *s++;
d[6] = *s++;
d[7] = *s++;
asm("pref @%0" : : "r" (d));
d += 8;
d[0] = *s++;
d[1] = *s++;
d[2] = *s++;
d[3] = *s++;
asm("pref @%0" : : "r" (s+16));
d[4] = *s++;
d[5] = *s++;
d[6] = *s++;
d[7] = *s++;
asm("pref @%0" : : "r" (d));
d += 8;
d[0] = *s++;
d[1] = *s++;
d[2] = *s++;
d[3] = *s++;
asm("pref @%0" : : "r" (s+16));
d[4] = *s++;
d[5] = *s++;
d[6] = *s++;
d[7] = *s++;
asm("pref @%0" : : "r" (d));
d += 8;
}
}
@ -134,12 +134,12 @@ void commit_dummy_transpoly()
struct polygon_list mypoly;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA;
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA;
mypoly.texture = 0;
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
ta_commit_list(&mypoly);
@ -150,12 +150,12 @@ void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
{
unsigned short *dst = palette + start;
if (num>0)
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
((colors[1]<<2)&0x03e0)|
((colors[2]>>3)&0x001f);
colors += 3;
}
colors += 3;
}
_screen_dirty = true;
}
@ -163,12 +163,12 @@ void OSystem_Dreamcast::setCursorPalette(const byte *colors, uint start, uint nu
{
unsigned short *dst = cursor_palette + start;
if (num>0)
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
while ( num-- ) {
*dst++ = ((colors[0]<<7)&0x7c00)|
((colors[1]<<2)&0x03e0)|
((colors[2]>>3)&0x001f);
colors += 3;
}
colors += 3;
}
_enable_cursor_palette = true;
}
@ -176,13 +176,13 @@ void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num) const
{
const unsigned short *src = palette + start;
if (num>0)
while ( num-- ) {
unsigned short p = *src++;
colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
colors[2] = ((p&0x001f)<<3)|((p&0x001c)>>2);
colors += 3;
}
while ( num-- ) {
unsigned short p = *src++;
colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
colors[2] = ((p&0x001f)<<3)|((p&0x001c)>>2);
colors += 3;
}
}
Graphics::PixelFormat OSystem_Dreamcast::getScreenFormat() const
@ -195,22 +195,22 @@ Common::List<Graphics::PixelFormat> OSystem_Dreamcast::getSupportedFormats() con
Common::List<Graphics::PixelFormat> list;
unsigned i;
for (i=0; i<NUM_FORMATS; i++)
list.push_front(screenFormats[i]);
list.push_front(screenFormats[i]);
return list;
}
void OSystem_Dreamcast::setScaling()
{
if (_screen_w > 400) {
_xscale = _yscale = 1.0;
_top_offset = (SCREEN_H-_screen_h)>>1;
_xscale = _yscale = 1.0;
_top_offset = (SCREEN_H-_screen_h)>>1;
} else if (_aspect_stretch && _screen_w == 320 && _screen_h == 200) {
_xscale = SCREEN_W/320.0;
_yscale = SCREEN_H/200.0;
_top_offset = 0;
_xscale = SCREEN_W/320.0;
_yscale = SCREEN_H/200.0;
_top_offset = 0;
} else {
_xscale = _yscale = 2.0;
_top_offset = (SCREEN_H>>1)-_screen_h;
_xscale = _yscale = 2.0;
_top_offset = (SCREEN_H>>1)-_screen_h;
}
}
@ -220,8 +220,8 @@ void OSystem_Dreamcast::initSize(uint w, uint h, const Graphics::PixelFormat *fo
int i = 0;
if (format != NULL)
for (i=NUM_FORMATS-1; i>0; --i)
if (*format == screenFormats[i])
for (i=NUM_FORMATS-1; i>0; --i)
if (*format == screenFormats[i])
break;
_screenFormat = i;
@ -236,18 +236,18 @@ void OSystem_Dreamcast::initSize(uint w, uint h, const Graphics::PixelFormat *fo
setScaling();
ta_sync();
if (!screen)
screen = new unsigned char[SCREEN_W*SCREEN_H*2];
screen = new unsigned char[SCREEN_W*SCREEN_H*2];
if (!overlay)
overlay = new unsigned short[OVL_W*OVL_H];
overlay = new unsigned short[OVL_W*OVL_H];
for (i=0; i<NUM_BUFFERS; i++)
if (!screen_tx[i])
screen_tx[i] = ta_txalloc(SCREEN_W*SCREEN_H*2);
if (!screen_tx[i])
screen_tx[i] = ta_txalloc(SCREEN_W*SCREEN_H*2);
for (i=0; i<NUM_BUFFERS; i++)
if (!mouse_tx[i])
mouse_tx[i] = ta_txalloc(MOUSE_W*MOUSE_H*2);
if (!mouse_tx[i])
mouse_tx[i] = ta_txalloc(MOUSE_W*MOUSE_H*2);
for (i=0; i<NUM_BUFFERS; i++)
if (!ovl_tx[i])
ovl_tx[i] = ta_txalloc(OVL_TXSTRIDE*OVL_H*2);
if (!ovl_tx[i])
ovl_tx[i] = ta_txalloc(OVL_TXSTRIDE*OVL_H*2);
_screen_buffer = 0;
_mouse_buffer = 0;
_overlay_buffer = 0;
@ -265,16 +265,16 @@ void OSystem_Dreamcast::copyRectToScreen(const void *buf, int pitch, int x, int
int w, int h)
{
if (w<1 || h<1)
return;
return;
if (_screenFormat != 0) {
x<<=1; w<<=1;
x<<=1; w<<=1;
}
unsigned char *dst = screen + y*SCREEN_W*2 + x;
const byte *src = (const byte *)buf;
do {
memcpy(dst, src, w);
dst += SCREEN_W*2;
src += pitch;
memcpy(dst, src, w);
dst += SCREEN_W*2;
src += pitch;
} while (--h);
_screen_dirty = true;
}
@ -307,15 +307,15 @@ void OSystem_Dreamcast::setMouseCursor(const void *buf, uint w, uint h,
int i = 0;
if (format != NULL)
for (i=NUM_FORMATS-1; i>0; --i)
if (*format == screenFormats[i])
for (i=NUM_FORMATS-1; i>0; --i)
if (*format == screenFormats[i])
break;
_mouseFormat = i;
free(_ms_buf);
if (_mouseFormat != 0)
w <<= 1;
w <<= 1;
_ms_buf = (byte *)malloc(w * h);
memcpy(_ms_buf, buf, w * h);
@ -331,49 +331,49 @@ void OSystem_Dreamcast::updateScreenTextures(void)
{
if (_screen_dirty) {
_screen_buffer++;
_screen_buffer &= NUM_BUFFERS-1;
_screen_buffer++;
_screen_buffer &= NUM_BUFFERS-1;
unsigned short *dst = (unsigned short *)screen_tx[_screen_buffer];
unsigned char *src = screen;
unsigned short *dst = (unsigned short *)screen_tx[_screen_buffer];
unsigned char *src = screen;
// while ((*((volatile unsigned int *)(void *)0xa05f810c) & 0x3ff) != 200);
// *((volatile unsigned int *)(void *)0xa05f8040) = 0xff0000;
// while ((*((volatile unsigned int *)(void *)0xa05f810c) & 0x3ff) != 200);
// *((volatile unsigned int *)(void *)0xa05f8040) = 0xff0000;
if (_screenFormat == 0)
for ( int y = 0; y<_screen_h; y++ )
{
if (_screenFormat == 0)
for ( int y = 0; y<_screen_h; y++ )
{
texture_memcpy64_pal( dst, src, _screen_w>>5, palette );
src += SCREEN_W*2;
dst += SCREEN_W;
}
else
for ( int y = 0; y<_screen_h; y++ )
{
}
else
for ( int y = 0; y<_screen_h; y++ )
{
texture_memcpy64( dst, src, _screen_w>>5 );
src += SCREEN_W*2;
dst += SCREEN_W;
}
}
_screen_dirty = false;
_screen_dirty = false;
}
if ( _overlay_visible && _overlay_dirty ) {
_overlay_buffer++;
_overlay_buffer &= NUM_BUFFERS-1;
_overlay_buffer++;
_overlay_buffer &= NUM_BUFFERS-1;
unsigned short *dst = (unsigned short *)ovl_tx[_overlay_buffer];
unsigned short *src = overlay;
unsigned short *dst = (unsigned short *)ovl_tx[_overlay_buffer];
unsigned short *src = overlay;
for ( int y = 0; y<OVL_H; y++ )
{
texture_memcpy64( dst, src, OVL_W>>5 );
src += OVL_W;
dst += OVL_TXSTRIDE;
}
for ( int y = 0; y<OVL_H; y++ )
{
texture_memcpy64( dst, src, OVL_W>>5 );
src += OVL_W;
dst += OVL_TXSTRIDE;
}
_overlay_dirty = false;
_overlay_dirty = false;
}
}
@ -385,15 +385,15 @@ void OSystem_Dreamcast::updateScreenPolygons(void)
// *((volatile unsigned int *)(void *)0xa05f8040) = 0x00ff00;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE|
TA_POLYMODE2_U_SIZE_1024|TA_POLYMODE2_V_SIZE_1024;
TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE|
TA_POLYMODE2_U_SIZE_1024|TA_POLYMODE2_V_SIZE_1024;
mypoly.texture = screenFormats[_screenFormat].textureFormat|
TA_TEXTUREMODE_NON_TWIDDLED|TA_TEXTUREMODE_STRIDE|
TA_TEXTUREMODE_ADDRESS(screen_tx[_screen_buffer]);
TA_TEXTUREMODE_NON_TWIDDLED|TA_TEXTUREMODE_STRIDE|
TA_TEXTUREMODE_ADDRESS(screen_tx[_screen_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
@ -430,70 +430,70 @@ void OSystem_Dreamcast::updateScreenPolygons(void)
ta_commit_end();
if (_overlay_visible) {
if (_overlay_fade < 1.0)
_overlay_fade += 0.125;
if (_overlay_fade < 1.0)
_overlay_fade += 0.125;
} else {
if (_overlay_fade > 0)
_overlay_fade -= 0.125;
if (_overlay_fade > 0)
_overlay_fade -= 0.125;
}
if (_overlay_fade > 0.0) {
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC/*_ALPHA*/|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|
TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512;
mypoly.texture = TA_TEXTUREMODE_ARGB4444|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(ovl_tx[_overlay_buffer]);
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC/*_ALPHA*/|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|
TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512;
mypoly.texture = TA_TEXTUREMODE_ARGB4444|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(ovl_tx[_overlay_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0.0;
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0.0;
ta_commit_list(&mypoly);
ta_commit_list(&mypoly);
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
myvertex.colour = 0xffffff|(((int)(255*_overlay_fade))<<24);
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
myvertex.colour = 0xffffff|(((int)(255*_overlay_fade))<<24);
myvertex.z = 0.5;
myvertex.u = 0.0;
myvertex.v = 0.0;
myvertex.z = 0.5;
myvertex.u = 0.0;
myvertex.v = 0.0;
myvertex.x = _overlay_x*_xscale+LEFT_OFFSET;
myvertex.y = _overlay_y*_yscale+TOP_OFFSET;
ta_commit_list(&myvertex);
myvertex.x = _overlay_x*_xscale+LEFT_OFFSET;
myvertex.y = _overlay_y*_yscale+TOP_OFFSET;
ta_commit_list(&myvertex);
myvertex.x += OVL_W*_xscale;
myvertex.u = OVL_W*(1.0/512.0);
ta_commit_list(&myvertex);
myvertex.x += OVL_W*_xscale;
myvertex.u = OVL_W*(1.0/512.0);
ta_commit_list(&myvertex);
myvertex.x = _overlay_x*_xscale;
myvertex.y += OVL_H*_yscale;
myvertex.u = 0.0;
myvertex.v = OVL_H*(1.0/512.0);
ta_commit_list(&myvertex);
myvertex.x = _overlay_x*_xscale;
myvertex.y += OVL_H*_yscale;
myvertex.u = 0.0;
myvertex.v = OVL_H*(1.0/512.0);
ta_commit_list(&myvertex);
myvertex.x += OVL_W*_xscale;
myvertex.u = OVL_W*(1.0/512.0);
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
myvertex.x += OVL_W*_xscale;
myvertex.u = OVL_W*(1.0/512.0);
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
}
if (_softkbd_on)
if (_softkbd_motion < 120)
_softkbd_motion += 10;
else
;
if (_softkbd_motion < 120)
_softkbd_motion += 10;
else
;
else
if (_softkbd_motion > 0)
_softkbd_motion -= 10;
if (_softkbd_motion > 0)
_softkbd_motion -= 10;
if (_softkbd_motion)
_softkbd.draw(330.0*sin(0.013*_softkbd_motion) - 320.0, 200.0,
_softkbd.draw(330.0*sin(0.013*_softkbd_motion) - 320.0, 200.0,
120-_softkbd_motion);
// *((volatile unsigned int *)(void *)0xa05f8040) = 0xffff00;
@ -516,15 +516,15 @@ void OSystem_Dreamcast::maybeRefreshScreen(void)
{
unsigned int t = Timer();
if((int)(t-_last_screen_refresh) > USEC_TO_TIMER(30000))
updateScreenPolygons();
updateScreenPolygons();
}
void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
unsigned char *buf, bool visible)
{
if (!visible || buf == NULL || !w || !h || w>MOUSE_W || h>MOUSE_H) {
commit_dummy_transpoly();
return;
commit_dummy_transpoly();
return;
}
struct polygon_list mypoly;
@ -537,26 +537,26 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
unsigned int texturemode = screenFormats[_mouseFormat].textureFormat;
if (_mouseFormat == 0) {
unsigned short *pal = _enable_cursor_palette? cursor_palette : palette;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
unsigned short *pal = _enable_cursor_palette? cursor_palette : palette;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
if (*buf == _ms_keycolor) {
*dst++ = 0;
buf++;
} else
*dst++ = pal[*buf++]|0x8000;
dst += MOUSE_W-x;
}
dst += MOUSE_W-x;
}
} else if(texturemode == TA_TEXTUREMODE_RGB565 &&
_ms_keycolor<=0xffff) {
/* Special handling when doing colorkey on RGB565; we need
to convert to ARGB1555 to get an alpha channel... */
texturemode = TA_TEXTUREMODE_ARGB1555;
unsigned short *bufs = (unsigned short *)buf;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
/* Special handling when doing colorkey on RGB565; we need
to convert to ARGB1555 to get an alpha channel... */
texturemode = TA_TEXTUREMODE_ARGB1555;
unsigned short *bufs = (unsigned short *)buf;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
if (*bufs == _ms_keycolor) {
*dst++ = 0;
bufs++;
@ -564,32 +564,32 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
unsigned short p = *bufs++;
*dst++ = (p&0x1f)|((p&0xffc0)>>1)|0x8000;
}
dst += MOUSE_W-x;
}
dst += MOUSE_W-x;
}
} else {
unsigned short *bufs = (unsigned short *)buf;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
unsigned short *bufs = (unsigned short *)buf;
for (int y=0; y<h; y++) {
int x;
for (x=0; x<w; x++)
if (*bufs == _ms_keycolor) {
*dst++ = 0;
bufs++;
} else
*dst++ = *bufs++;
dst += MOUSE_W-x;
}
dst += MOUSE_W-x;
}
}
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE|
TA_POLYMODE2_U_SIZE_128|TA_POLYMODE2_V_SIZE_128;
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE|
TA_POLYMODE2_U_SIZE_128|TA_POLYMODE2_V_SIZE_128;
mypoly.texture = texturemode|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(mouse_tx[_mouse_buffer]);
TA_TEXTUREMODE_ADDRESS(mouse_tx[_mouse_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
@ -625,11 +625,11 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
void OSystem_Dreamcast::mouseToSoftKbd(int x, int y, int &rx, int &ry) const
{
if (_softkbd_motion) {
rx = (int)(x*_xscale - (330.0*sin(0.013*_softkbd_motion) + LEFT_OFFSET - 320.0));
ry = (int)(y*_yscale + TOP_OFFSET - 200.0);
rx = (int)(x*_xscale - (330.0*sin(0.013*_softkbd_motion) + LEFT_OFFSET - 320.0));
ry = (int)(y*_yscale + TOP_OFFSET - 200.0);
} else {
rx = -1;
ry = -1;
rx = -1;
ry = -1;
}
}
@ -648,7 +648,7 @@ void OSystem_Dreamcast::hideOverlay()
void OSystem_Dreamcast::clearOverlay()
{
if (!_overlay_visible)
return;
return;
memset(overlay, 0, OVL_W*OVL_H*sizeof(unsigned short));
@ -661,9 +661,9 @@ void OSystem_Dreamcast::grabOverlay(void *buf, int pitch)
unsigned short *src = overlay;
unsigned char *dst = (unsigned char *)buf;
do {
memcpy(dst, src, OVL_W*sizeof(int16));
src += OVL_W;
dst += pitch;
memcpy(dst, src, OVL_W*sizeof(int16));
src += OVL_W;
dst += pitch;
} while (--h);
}
@ -671,13 +671,13 @@ void OSystem_Dreamcast::copyRectToOverlay(const void *buf, int pitch,
int x, int y, int w, int h)
{
if (w<1 || h<1)
return;
return;
unsigned short *dst = overlay + y*OVL_W + x;
const unsigned char *src = (const unsigned char *)buf;
do {
memcpy(dst, src, w*sizeof(int16));
dst += OVL_W;
src += pitch;
memcpy(dst, src, w*sizeof(int16));
dst += OVL_W;
src += pitch;
} while (--h);
_overlay_dirty = true;
}
@ -685,7 +685,7 @@ void OSystem_Dreamcast::copyRectToOverlay(const void *buf, int pitch,
Graphics::Surface *OSystem_Dreamcast::lockScreen()
{
if (!screen)
return 0;
return 0;
_framebuffer.init(_screen_w, _screen_h, SCREEN_W*2, screen, screenFormats[_screenFormat]);

View file

@ -31,17 +31,17 @@ void Icon::create_vmicon(void *buffer)
unsigned char *pix = ((unsigned char *)buffer)+32;
for (int n = 0; n<16; n++) {
int p = palette[n];
pal[n] =
((p>>16)&0xf000)|
((p>>12)&0x0f00)|
((p>> 8)&0x00f0)|
((p>> 4)&0x000f);
int p = palette[n];
pal[n] =
((p>>16)&0xf000)|
((p>>12)&0x0f00)|
((p>> 8)&0x00f0)|
((p>> 4)&0x000f);
}
for (int line = 0; line < 32; line++) {
memcpy(pix, &bitmap[32/2*(31-line)], 32/2);
pix += 32/2;
memcpy(pix, &bitmap[32/2*(31-line)], 32/2);
pix += 32/2;
}
}
@ -53,10 +53,10 @@ void Icon::create_texture()
unsigned short *linebase;
unsigned char *src = bitmap+sizeof(bitmap)-17;
for (int y=0; y<16; y++) {
linebase = tex + (tt[y]<<1);
for (int x=0; x<16; x++, --src)
linebase[tt[x]] = src[16]|(src[0]<<8);
src -= 16;
linebase = tex + (tt[y]<<1);
for (int x=0; x<16; x++, --src)
linebase[tt[x]] = src[16]|(src[0]<<8);
src -= 16;
}
texture = tex;
}
@ -65,7 +65,7 @@ void Icon::setPalette(int pal)
{
unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000;
for (int n = 0; n<16; n++)
(*hwpal)[pal][n] = palette[n];
(*hwpal)[pal][n] = palette[n];
}
void Icon::draw(float x1, float y1, float x2, float y2, int pal,
@ -75,16 +75,16 @@ void Icon::draw(float x1, float y1, float x2, float y2, int pal,
struct packed_colour_vertex_list myvertex;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_U_SIZE_32|
TA_POLYMODE2_V_SIZE_32;
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_U_SIZE_32|
TA_POLYMODE2_V_SIZE_32;
mypoly.texture = TA_TEXTUREMODE_CLUT4|TA_TEXTUREMODE_CLUTBANK4(pal)|
TA_TEXTUREMODE_ADDRESS(texture);
TA_TEXTUREMODE_ADDRESS(texture);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
@ -123,59 +123,59 @@ int Icon::find_unused_pixel(const unsigned char *mask)
memset(use, 0, sizeof(use));
unsigned char *p = bitmap;
for (int n=0; n<32*32/2/4; n++) {
unsigned char mbits = ~*mask++;
for (int i=0; i<4; i++) {
unsigned char pix = *p++;
if(mbits & 64)
unsigned char mbits = ~*mask++;
for (int i=0; i<4; i++) {
unsigned char pix = *p++;
if(mbits & 64)
use[pix&0xf]++;
if(mbits & 128)
if(mbits & 128)
use[pix>>4]++;
mbits <<= 2;
}
mbits <<= 2;
}
}
for (int i=0; i<16; i++)
if (!use[i])
return i;
if (!use[i])
return i;
return -1;
}
bool Icon::load_image2(const void *data, int len)
{
struct {
int size, w, h;
short pla, bitcnt;
int comp, sizeimg, xres, yres, used, imp;
int size, w, h;
short pla, bitcnt;
int comp, sizeimg, xres, yres, used, imp;
} hdr;
if (len < 40)
return false;
return false;
memcpy(&hdr, data, 40);
if (hdr.size != 40 || /* hdr.sizeimg<=0 || */ hdr.w<0 || hdr.h<0 ||
hdr.bitcnt<0 || hdr.used<0)
return false;
hdr.bitcnt<0 || hdr.used<0)
return false;
if (!hdr.used)
hdr.used = 1<<hdr.bitcnt;
hdr.used = 1<<hdr.bitcnt;
hdr.h >>= 1;
/* Fix incorrect sizeimg (The Dig) */
if (hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
hdr.sizeimg = ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3);
hdr.sizeimg = ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3);
if (hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3) */)
return false;
hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3) */)
return false;
if (hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
return false;
return false;
memcpy(palette, ((const char *)data)+hdr.size, hdr.used<<2);
memcpy(bitmap, ((const char *)data)+hdr.size+(hdr.used<<2), 32*32/2);
for (int i=0; i<16; i++)
palette[i] |= 0xff000000;
palette[i] |= 0xff000000;
for (int i=hdr.used; i<16; i++)
palette[i] = 0;
palette[i] = 0;
const unsigned char *mask =
((const unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2;
((const unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2;
int unused = find_unused_pixel(mask);
if (unused >= 0) {
unsigned char *pix = bitmap;
for (int y=0; y<32; y++)
for (int x=0; x<32/8; x++) {
unsigned char *pix = bitmap;
for (int y=0; y<32; y++)
for (int x=0; x<32/8; x++) {
unsigned char mbits = *mask++;
for (int z=0; z<4; z++) {
unsigned char pbits = *pix;
@ -184,8 +184,8 @@ bool Icon::load_image2(const void *data, int len)
*pix++ = pbits;
mbits <<= 2;
}
}
palette[unused] = 0;
}
palette[unused] = 0;
}
return true;
}
@ -193,17 +193,17 @@ bool Icon::load_image2(const void *data, int len)
bool Icon::load_image1(const void *data, int len, int offs)
{
struct {
char w, h, colors, rsrv;
short pla, bitcnt;
int bytes, offs;
char w, h, colors, rsrv;
short pla, bitcnt;
int bytes, offs;
} hdr;
if (len < offs+16)
return false;
return false;
memcpy(&hdr, ((const char *)data)+offs, 16);
if (hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len)
return load_image2(((const char *)data)+hdr.offs, hdr.bytes);
return load_image2(((const char *)data)+hdr.offs, hdr.bytes);
else
return false;
return false;
}
bool Icon::load(const void *data, int len, int offs)
@ -213,13 +213,13 @@ bool Icon::load(const void *data, int len, int offs)
memset(palette, 0, sizeof(palette));
texture = NULL;
if (len < offs+6)
return false;
return false;
memcpy(&hdr, ((const char *)data)+offs, 6);
if (hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len)
return false;
return false;
for (int i=0; i<hdr.cnt; i++)
if (load_image1(data, len, offs+6+(i<<4)))
return true;
if (load_image1(data, len, offs+6+(i<<4)))
return true;
return false;
}
@ -228,11 +228,11 @@ bool Icon::load(const char *filename)
char buf[2048];
int fd;
if ((fd = open(filename, O_RDONLY))>=0) {
int sz;
sz = read(fd, buf, sizeof(buf));
close(fd);
if (sz>0)
return load(buf, sz);
int sz;
sz = read(fd, buf, sizeof(buf));
close(fd);
if (sz>0)
return load(buf, sz);
}
return false;
}

View file

@ -38,49 +38,49 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
static int8 mouse_wheel = 0, lastwheel = 0;
shiftFlags = 0;
for (int i=0; i<4; i++, pad++)
if (pad->func & MAPLE_FUNC_CONTROLLER) {
int buttons = pad->cond.controller.buttons;
if (pad->func & MAPLE_FUNC_CONTROLLER) {
int buttons = pad->cond.controller.buttons;
if (!(buttons & 0x060e)) exit(0);
if (!(buttons & 0x060e)) exit(0);
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
else if (!(buttons & 512)) newkey = ' ';
else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
else if (!(buttons & 512)) newkey = ' ';
else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
if (!(buttons & 128)) { if (inter) newkey = 1001; else mouse_x++; }
if (!(buttons & 64)) { if (inter) newkey = 1002; else mouse_x--; }
if (!(buttons & 32)) { if (inter) newkey = 1003; else mouse_y++; }
if (!(buttons & 16)) { if (inter) newkey = 1004; else mouse_y--; }
if (!(buttons & 128)) { if (inter) newkey = 1001; else mouse_x++; }
if (!(buttons & 64)) { if (inter) newkey = 1002; else mouse_x--; }
if (!(buttons & 32)) { if (inter) newkey = 1003; else mouse_y++; }
if (!(buttons & 16)) { if (inter) newkey = 1004; else mouse_y--; }
mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
if (pad->cond.controller.ltrigger > 200) newkey = 1005;
else if (pad->cond.controller.rtrigger > 200) newkey = 1006;
if (pad->cond.controller.ltrigger > 200) newkey = 1005;
else if (pad->cond.controller.rtrigger > 200) newkey = 1006;
} else if (pad->func & MAPLE_FUNC_MOUSE) {
int buttons = pad->cond.mouse.buttons;
} else if (pad->func & MAPLE_FUNC_MOUSE) {
int buttons = pad->cond.mouse.buttons;
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if (!(buttons & 4)) lmb++;
if (!(buttons & 2)) rmb++;
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
mouse_x += pad->cond.mouse.axis1;
mouse_y += pad->cond.mouse.axis2;
mouse_wheel += pad->cond.mouse.axis3;
mouse_x += pad->cond.mouse.axis1;
mouse_y += pad->cond.mouse.axis2;
mouse_wheel += pad->cond.mouse.axis3;
if (inter)
if (inter)
inter->mouse(mouse_x, mouse_y);
pad->cond.mouse.axis1 = 0;
pad->cond.mouse.axis2 = 0;
pad->cond.mouse.axis3 = 0;
} else if (pad->func & MAPLE_FUNC_KEYBOARD) {
for (int p=0; p<6; p++) {
pad->cond.mouse.axis1 = 0;
pad->cond.mouse.axis2 = 0;
pad->cond.mouse.axis3 = 0;
} else if (pad->func & MAPLE_FUNC_KEYBOARD) {
for (int p=0; p<6; p++) {
int shift = pad->cond.kbd.shift;
int key = pad->cond.kbd.key[p];
if (shift & 0x08) lmb++;
@ -134,56 +134,56 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
case 0x89:
newkey = ((shift & 0x22)? '|' : '?'); break;
}
}
}
}
}
if (lmb && inter && !lastlmb) {
newkey = 1000;
lmb = 0;
newkey = 1000;
lmb = 0;
}
if (lmb && !lastlmb) {
lastlmb = 1;
return -Common::EVENT_LBUTTONDOWN;
lastlmb = 1;
return -Common::EVENT_LBUTTONDOWN;
} else if (lastlmb && !lmb) {
lastlmb = 0;
return -Common::EVENT_LBUTTONUP;
lastlmb = 0;
return -Common::EVENT_LBUTTONUP;
}
if (rmb && !lastrmb) {
lastrmb = 1;
return -Common::EVENT_RBUTTONDOWN;
lastrmb = 1;
return -Common::EVENT_RBUTTONDOWN;
} else if (lastrmb && !rmb) {
lastrmb = 0;
return -Common::EVENT_RBUTTONUP;
lastrmb = 0;
return -Common::EVENT_RBUTTONUP;
}
if (mouse_wheel != lastwheel) {
if (((int8)(mouse_wheel - lastwheel)) > 0) {
lastwheel++;
return -Common::EVENT_WHEELDOWN;
} else {
--lastwheel;
return -Common::EVENT_WHEELUP;
}
if (((int8)(mouse_wheel - lastwheel)) > 0) {
lastwheel++;
return -Common::EVENT_WHEELDOWN;
} else {
--lastwheel;
return -Common::EVENT_WHEELUP;
}
}
if (newkey && inter && newkey != lastkey) {
int transkey = inter->key(newkey, shiftFlags);
if (transkey) {
newkey = transkey;
inter = NULL;
}
int transkey = inter->key(newkey, shiftFlags);
if (transkey) {
newkey = transkey;
inter = NULL;
}
}
if (!newkey || (lastkey && newkey != lastkey)) {
int upkey = lastkey;
lastkey = 0;
if (upkey)
return upkey | (1<<30);
int upkey = lastkey;
lastkey = 0;
if (upkey)
return upkey | (1<<30);
} else if (!lastkey) {
lastkey = newkey;
if (newkey >= 1000 || !inter)
return newkey;
lastkey = newkey;
if (newkey >= 1000 || !inter)
return newkey;
}
return 0;
@ -194,13 +194,13 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event)
unsigned int t = Timer();
if (_timerManager != NULL)
((DefaultTimerManager *)_timerManager)->handler();
((DefaultTimerManager *)_timerManager)->handler();
if (((int)(t-_devpoll))<0)
return false;
return false;
_devpoll += USEC_TO_TIMER(17000);
if (((int)(t-_devpoll))>=0)
_devpoll = t + USEC_TO_TIMER(17000);
_devpoll = t + USEC_TO_TIMER(17000);
maybeRefreshScreen();
@ -217,36 +217,36 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event)
event.mouse.x = _ms_cur_x;
event.mouse.y = _ms_cur_y;
if (_overlay_visible) {
event.mouse.x -= _overlay_x;
event.mouse.y -= _overlay_y;
event.mouse.x -= _overlay_x;
event.mouse.y -= _overlay_y;
}
event.kbd.ascii = 0;
event.kbd.keycode = Common::KEYCODE_INVALID;
if (e<0) {
event.type = (Common::EventType)-e;
return true;
event.type = (Common::EventType)-e;
return true;
} else if (e>0) {
bool processed = false, down = !(e&(1<<30));
e &= ~(1<<30);
if (e < 1000) {
event.type = (down? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP);
event.kbd.keycode = (Common::KeyCode)e;
event.kbd.ascii = (e>='a' && e<='z' && (event.kbd.flags & Common::KBD_SHIFT)?
bool processed = false, down = !(e&(1<<30));
e &= ~(1<<30);
if (e < 1000) {
event.type = (down? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP);
event.kbd.keycode = (Common::KeyCode)e;
event.kbd.ascii = (e>='a' && e<='z' && (event.kbd.flags & Common::KBD_SHIFT)?
e &~ 0x20 : e);
processed = true;
} else if (down) {
if (e == 1005)
processed = true;
} else if (down) {
if (e == 1005)
setFeatureState(kFeatureVirtualKeyboard,
!getFeatureState(kFeatureVirtualKeyboard));
}
return processed;
}
return processed;
} else if (_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) {
event.type = Common::EVENT_MOUSEMOVE;
_ms_old_x = _ms_cur_x;
_ms_old_y = _ms_cur_y;
return true;
event.type = Common::EVENT_MOUSEMOVE;
_ms_old_x = _ms_cur_x;
_ms_old_y = _ms_cur_y;
return true;
} else {
event.type = (Common::EventType)0;
return false;
event.type = (Common::EventType)0;
return false;
}
}

View file

@ -30,11 +30,11 @@ void *get_romfont_address() __asm__(".get_romfont_address");
__asm__("\
\n\
.get_romfont_address: \n\
mov.l 1f,r0 \n\
mov.l @r0,r0 \n\
jmp @r0 \n\
mov #0,r1 \n\
.align 2 \n\
mov.l 1f,r0 \n\
mov.l @r0,r0 \n\
jmp @r0 \n\
mov #0,r1 \n\
.align 2 \n\
1: .long 0x8c0000b4 \n\
\n\
");
@ -48,26 +48,26 @@ static void draw_char(unsigned short *dst, int mod, int c, void *font_base)
if (c<128) c -= 32; else c -= 64;
src = c*36 + (unsigned char *)font_base;
for (i=0; i<12; i++) {
int n = (src[0]<<16)|(src[1]<<8)|src[2];
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
int n = (src[0]<<16)|(src[1]<<8)|src[2];
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
dst[j] = 0xffff;
dst[j+1] = 0xffff;
dst[j+2] = 0xa108;
dst[j+mod] = 0xa108;
dst[j+mod+1] = 0xa108;
}
dst += mod;
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
}
dst += mod;
for (j=0; j<12; j++, n<<=1)
if (n & (1<<23)) {
dst[j] = 0xffff;
dst[j+1] = 0xffff;
dst[j+2] = 0xa108;
dst[j+mod] = 0xa108;
dst[j+mod+1] = 0xa108;
}
dst += mod;
src += 3;
}
dst += mod;
src += 3;
}
}
@ -81,10 +81,10 @@ void Label::create_texture(const char *text)
int tsz = u*32;
unsigned short *tex = (unsigned short *)ta_txalloc(tsz*2);
for (int i=0; i<tsz; i++)
tex[i] = 0;
tex[i] = 0;
int p=l*14;
while (l>0)
draw_char(tex+(p-=14), u, text[--l], font);
draw_char(tex+(p-=14), u, text[--l], font);
texture = tex;
}
@ -94,15 +94,15 @@ void Label::draw(float x, float y, unsigned int argb, float scale)
struct packed_colour_vertex_list myvertex;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_V_SIZE_32|tex_u;
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_V_SIZE_32|tex_u;
mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(texture);
TA_TEXTUREMODE_ADDRESS(texture);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;

View file

@ -134,7 +134,7 @@ void OSystem_Dreamcast::addCustomDirectories(Common::FSList &dirs) const
{
FilePluginProvider::addCustomDirectories(dirs);
if (pluginCustomDirectory != NULL)
dirs.push_back(Common::FSNode(pluginCustomDirectory));
dirs.push_back(Common::FSNode(pluginCustomDirectory));
}
PluginList OSystem_Dreamcast::getPlugins()
@ -142,12 +142,12 @@ PluginList OSystem_Dreamcast::getPlugins()
pluginCustomDirectory = NULL;
PluginList list = FilePluginProvider::getPlugins();
if (list.empty()) {
Common::String selection;
if (selectPluginDir(selection, Common::FSNode("plugins"))) {
pluginCustomDirectory = selection.c_str();
list = FilePluginProvider::getPlugins();
pluginCustomDirectory = NULL;
}
Common::String selection;
if (selectPluginDir(selection, Common::FSNode("plugins"))) {
pluginCustomDirectory = selection.c_str();
list = FilePluginProvider::getPlugins();
pluginCustomDirectory = NULL;
}
}
return list;
}

View file

@ -49,12 +49,12 @@ void draw_solid_quad(float x1, float y1, float x2, float y2,
struct packed_colour_vertex_list myvertex;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|
TA_CMD_POLYGON_GOURAUD_SHADING;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|
TA_CMD_POLYGON_GOURAUD_SHADING;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED;
TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED;
mypoly.texture = 0;
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
@ -94,13 +94,13 @@ void draw_trans_quad(float x1, float y1, float x2, float y2,
struct packed_colour_vertex_list myvertex;
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|
TA_CMD_POLYGON_GOURAUD_SHADING;
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|
TA_CMD_POLYGON_GOURAUD_SHADING;
mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA;
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA;
mypoly.texture = 0;
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
@ -165,15 +165,15 @@ static bool loadIcon(Game &game, Dir *dirs, int num_dirs)
char icofn[520];
sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base);
if (game.icon.load(icofn))
return true;
for (int i=0; i<num_dirs; i++)
if (!strcmp(dirs[i].name, game.dir) &&
dirs[i].deficon[0]) {
sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
if (game.icon.load(icofn))
return true;
break;
}
for (int i=0; i<num_dirs; i++)
if (!strcmp(dirs[i].name, game.dir) &&
dirs[i].deficon[0]) {
sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
if (game.icon.load(icofn))
return true;
break;
}
return false;
}
@ -187,9 +187,9 @@ static bool sameOrSubdir(const char *dir1, const char *dir2)
{
int l1 = strlen(dir1), l2 = strlen(dir2);
if (l1<=l2)
return !strcmp(dir1, dir2);
return !strcmp(dir1, dir2);
else
return !memcmp(dir1, dir2, l2);
return !memcmp(dir1, dir2, l2);
}
static bool uniqueGame(const char *base, const char *dir,
@ -197,16 +197,16 @@ static bool uniqueGame(const char *base, const char *dir,
Game *games, int cnt)
{
while (cnt--)
if (/*Don't detect the same game in a subdir,
if (/*Don't detect the same game in a subdir,
this is a workaround for the detector bug in toon... */
sameOrSubdir(dir, games->dir) &&
/*!strcmp(dir, games->dir) &&*/
!scumm_stricmp(base, games->filename_base) &&
lang == games->language &&
plf == games->platform)
return false;
else
games++;
return false;
else
games++;
return true;
}
@ -216,23 +216,23 @@ static int findGames(Game *games, int max, bool use_ini)
int curr_game = 0, curr_dir = 0, num_dirs = 0;
if (use_ini) {
ConfMan.loadDefaultConfigFile();
const Common::ConfigManager::DomainMap &game_domains = ConfMan.getGameDomains();
for(Common::ConfigManager::DomainMap::const_iterator i =
ConfMan.loadDefaultConfigFile();
const Common::ConfigManager::DomainMap &game_domains = ConfMan.getGameDomains();
for(Common::ConfigManager::DomainMap::const_iterator i =
game_domains.begin(); curr_game < max && i != game_domains.end(); i++) {
Common::String path = (*i)._value["path"];
if (path.size() && path.lastChar() != '/')
Common::String path = (*i)._value["path"];
if (path.size() && path.lastChar() != '/')
path += "/";
int j;
for (j=0; j<num_dirs; j++)
int j;
for (j=0; j<num_dirs; j++)
if (path.equals(dirs[j].node.getPath()))
break;
if (j >= num_dirs) {
if (j >= num_dirs) {
if (num_dirs >= MAX_DIR)
continue;
dirs[j = num_dirs++].node = Common::FSNode(path);
}
if (curr_game < max) {
}
if (curr_game < max) {
strcpy(games[curr_game].filename_base, (*i)._key.c_str());
strncpy(games[curr_game].engine_id, (*i)._value["engineid"].c_str(), 256);
games[curr_game].engine_id[255] = '\0';
@ -242,24 +242,24 @@ static int findGames(Game *games, int max, bool use_ini)
games[curr_game].platform = Common::kPlatformUnknown;
strcpy(games[curr_game].text, (*i)._value["description"].c_str());
curr_game++;
}
}
}
}
} else {
dirs[num_dirs++].node = Common::FSNode("");
dirs[num_dirs++].node = Common::FSNode("");
}
while ((curr_game < max || use_ini) && curr_dir < num_dirs) {
strncpy(dirs[curr_dir].name, dirs[curr_dir].node.getPath().c_str(), 251);
dirs[curr_dir].name[250] = '\0';
if (!dirs[curr_dir].name[0] ||
strncpy(dirs[curr_dir].name, dirs[curr_dir].node.getPath().c_str(), 251);
dirs[curr_dir].name[250] = '\0';
if (!dirs[curr_dir].name[0] ||
dirs[curr_dir].name[strlen(dirs[curr_dir].name)-1] != '/')
strcat(dirs[curr_dir].name, "/");
dirs[curr_dir].deficon[0] = '\0';
Common::FSList files, fslist;
dirs[curr_dir++].node.getChildren(fslist, Common::FSNode::kListAll);
for (Common::FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
strcat(dirs[curr_dir].name, "/");
dirs[curr_dir].deficon[0] = '\0';
Common::FSList files, fslist;
dirs[curr_dir++].node.getChildren(fslist, Common::FSNode::kListAll);
for (Common::FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) {
if (entry->isDirectory()) {
if (entry->isDirectory()) {
if (!use_ini && num_dirs < MAX_DIR) {
dirs[num_dirs].node = *entry;
num_dirs++;
@ -267,18 +267,18 @@ static int findGames(Game *games, int max, bool use_ini)
/* Toonstruck detector needs directories to be present too */
if(!use_ini)
files.push_back(*entry);
} else
} else
if (isIcon(*entry))
strcpy(dirs[curr_dir-1].deficon, entry->getDisplayName().c_str());
else if(!use_ini)
files.push_back(*entry);
}
}
if (!use_ini) {
DetectionResults detectionResults = EngineMan.detectGames(files);
DetectedGames candidates = detectionResults.listRecognizedGames();
if (!use_ini) {
DetectionResults detectionResults = EngineMan.detectGames(files);
DetectedGames candidates = detectionResults.listRecognizedGames();
for (DetectedGames::const_iterator ge = candidates.begin();
for (DetectedGames::const_iterator ge = candidates.begin();
ge != candidates.end(); ++ge)
if (curr_game < max) {
strcpy(games[curr_game].engine_id, ge->engineId.c_str());
@ -303,12 +303,12 @@ static int findGames(Game *games, int max, bool use_ini)
curr_game++;
}
}
}
}
}
for (int i=0; i<curr_game; i++)
if (!loadIcon(games[i], dirs, num_dirs))
makeDefIcon(games[i].icon);
if (!loadIcon(games[i], dirs, num_dirs))
makeDefIcon(games[i].icon);
delete[] dirs;
return curr_game;
}
@ -335,35 +335,35 @@ void waitForDisk()
lab.create_texture("Please insert game CD.");
//printf("waitForDisk, cdstate = %d\n", getCdState());
for (;;) {
int s = getCdState();
if (s >= 6)
wasopen = 1;
if (s > 0 && s < 6 && wasopen) {
cdfs_reinit();
chdir("/");
chdir("/");
ta_sync();
ta_txrelease(mark);
return;
}
int s = getCdState();
if (s >= 6)
wasopen = 1;
if (s > 0 && s < 6 && wasopen) {
cdfs_reinit();
chdir("/");
chdir("/");
ta_sync();
ta_txrelease(mark);
return;
}
ta_begin_frame();
ta_begin_frame();
drawBackground();
drawBackground();
ta_commit_end();
ta_commit_end();
lab.draw(166.0, 200.0, 0xffff2020);
lab.draw(166.0, 200.0, 0xffff2020);
ta_commit_frame();
ta_commit_frame();
int mousex = 0, mousey = 0;
byte shiftFlags;
int mousex = 0, mousey = 0;
byte shiftFlags;
int mask = getimask();
setimask(15);
handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
int mask = getimask();
setimask(15);
handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
}
}
@ -383,47 +383,47 @@ int gameMenu(Game *games, int num_games)
float y;
if (!num_games)
return -1;
return -1;
for (;;) {
if (getCdState()>=6)
return -1;
if (getCdState()>=6)
return -1;
ta_begin_frame();
ta_begin_frame();
drawBackground();
drawBackground();
ta_commit_end();
ta_commit_end();
y = 40.0;
for (int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
y = 40.0;
for (int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
if (cnt == selector_pos)
if (cnt == selector_pos)
draw_trans_quad(100.0, y, 590.0, y+32.0,
0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00);
games[i].icon.setPalette(pal);
drawGameLabel(games[i], pal, 50.0, y, (cnt == selector_pos?
games[i].icon.setPalette(pal);
drawGameLabel(games[i], pal, 50.0, y, (cnt == selector_pos?
0xffff00 : 0xffffff));
y += 40.0;
}
y += 40.0;
}
ta_commit_frame();
ta_commit_frame();
byte shiftFlags;
int event;
byte shiftFlags;
int event;
int mask = getimask();
setimask(15);
event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
int mask = getimask();
setimask(15);
event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
if (event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_RETURN || event==Common::KEYCODE_F5) {
int selected_game = top_game + selector_pos;
if (event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_RETURN || event==Common::KEYCODE_F5) {
int selected_game = top_game + selector_pos;
for (int fade=0; fade<=256; fade+=4) {
for (int fade=0; fade<=256; fade+=4) {
ta_begin_frame();
@ -447,25 +447,25 @@ int gameMenu(Game *games, int num_games)
0xffff00, 0, scale);
ta_commit_frame();
}
return selected_game;
}
}
return selected_game;
}
if (mousey>=16) {
if (selector_pos + top_game + 1 < num_games)
if (mousey>=16) {
if (selector_pos + top_game + 1 < num_games)
if (++selector_pos >= 10) {
--selector_pos;
++top_game;
}
mousey -= 16;
} else if (mousey<=-16) {
if (selector_pos + top_game > 0)
mousey -= 16;
} else if (mousey<=-16) {
if (selector_pos + top_game > 0)
if (--selector_pos < 0) {
++selector_pos;
--top_game;
}
mousey += 16;
}
mousey += 16;
}
}
}
@ -478,50 +478,50 @@ bool selectGame(char *&engineId, char *&ret, char *&dir_ret, Common::Language &l
void *mark = ta_txmark();
for (;;) {
num_games = findGames(games, MAX_GAMES, true);
if (!num_games)
num_games = findGames(games, MAX_GAMES, false);
num_games = findGames(games, MAX_GAMES, true);
if (!num_games)
num_games = findGames(games, MAX_GAMES, false);
for (int i=0; i<num_games; i++) {
games[i].icon.create_texture();
games[i].label.create_texture(games[i].text);
}
for (int i=0; i<num_games; i++) {
games[i].icon.create_texture();
games[i].label.create_texture(games[i].text);
}
selected = gameMenu(games, num_games);
selected = gameMenu(games, num_games);
ta_sync();
ta_txrelease(mark);
ta_sync();
ta_txrelease(mark);
if (selected == -1)
waitForDisk();
else
break;
if (selected == -1)
waitForDisk();
else
break;
}
if (selected >= num_games)
selected = -1;
selected = -1;
if (selected >= 0)
the_game = games[selected];
the_game = games[selected];
delete[] games;
if (selected>=0) {
#if 0
chdir(the_game.dir);
chdir(the_game.dir);
#else
chdir("/");
dir_ret = the_game.dir;
chdir("/");
dir_ret = the_game.dir;
#endif
engineId = the_game.engine_id;
ret = the_game.filename_base;
lang_ret = the_game.language;
plf_ret = the_game.platform;
icon = the_game.icon;
return true;
engineId = the_game.engine_id;
ret = the_game.filename_base;
lang_ret = the_game.language;
plf_ret = the_game.platform;
icon = the_game.icon;
return true;
} else
return false;
return false;
}
#ifdef DYNAMIC_MODULES
@ -531,15 +531,15 @@ static int findPluginDirs(Game *plugin_dirs, int max, const Common::FSNode &base
int curr_dir = 0;
base.getChildren(fslist, Common::FSNode::kListDirectoriesOnly);
for (Common::FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) {
if (entry->isDirectory()) {
if (curr_dir >= max)
++entry) {
if (entry->isDirectory()) {
if (curr_dir >= max)
break;
strncpy(plugin_dirs[curr_dir].dir, (*entry).getPath().c_str(), 256);
strncpy(plugin_dirs[curr_dir].text, (*entry).getDisplayName().c_str(), 256);
plugin_dirs[curr_dir].icon.load(NULL, 0, 0);
curr_dir++;
}
strncpy(plugin_dirs[curr_dir].dir, (*entry).getPath().c_str(), 256);
strncpy(plugin_dirs[curr_dir].text, (*entry).getDisplayName().c_str(), 256);
plugin_dirs[curr_dir].icon.load(NULL, 0, 0);
curr_dir++;
}
}
return curr_dir;
}
@ -555,8 +555,8 @@ bool selectPluginDir(Common::String &selection, const Common::FSNode &base)
num_plugin_dirs = findPluginDirs(plugin_dirs, MAX_PLUGIN_DIRS, base);
for (int i=0; i<num_plugin_dirs; i++) {
plugin_dirs[i].icon.create_texture();
plugin_dirs[i].label.create_texture(plugin_dirs[i].text);
plugin_dirs[i].icon.create_texture();
plugin_dirs[i].label.create_texture(plugin_dirs[i].text);
}
selected = gameMenu(plugin_dirs, num_plugin_dirs);
@ -565,10 +565,10 @@ bool selectPluginDir(Common::String &selection, const Common::FSNode &base)
ta_txrelease(mark);
if (selected >= num_plugin_dirs)
selected = -1;
selected = -1;
if (selected >= 0)
selection = plugin_dirs[selected].dir;
selection = plugin_dirs[selected].dir;
delete[] plugin_dirs;

View file

@ -48,16 +48,16 @@ static const char key_names[] =
static const short key_codes[] =
{
Common::KEYCODE_ESCAPE, Common::KEYCODE_F1, Common::KEYCODE_F2, Common::KEYCODE_F3, Common::KEYCODE_F4, Common::KEYCODE_F5, Common::KEYCODE_F6, Common::KEYCODE_F7, Common::KEYCODE_F8, Common::KEYCODE_F9, Common::KEYCODE_F10,
K('1','!'), K('2','"'), K('3','#'), K('4','$'), K('5','%'),
K('6','&'), K('7','\''), K('8','('), K('9',')'), K('0','~'), K('-','='),
K('q','Q'), K('w','W'), K('e','E'), K('r','R'), K('t','T'),
K('y','Y'), K('u','U'), K('i','I'), K('o','O'), K('p','P'), K('@','`'),
K('a','A'), K('s','S'), K('d','D'), K('f','F'), K('g','G'),
K('h','H'), K('j','J'), K('k','K'), K('l','L'), K(';','+'), K(':','*'),
K('z','Z'), K('x','X'), K('c','C'), K('v','V'), K('b','B'),
K('n','N'), K('m','M'), K(',','<'), K('.','>'), K('/','?'), K('\\','_'),
~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', Common::KEYCODE_BACKSPACE, Common::KEYCODE_RETURN
Common::KEYCODE_ESCAPE, Common::KEYCODE_F1, Common::KEYCODE_F2, Common::KEYCODE_F3, Common::KEYCODE_F4, Common::KEYCODE_F5, Common::KEYCODE_F6, Common::KEYCODE_F7, Common::KEYCODE_F8, Common::KEYCODE_F9, Common::KEYCODE_F10,
K('1','!'), K('2','"'), K('3','#'), K('4','$'), K('5','%'),
K('6','&'), K('7','\''), K('8','('), K('9',')'), K('0','~'), K('-','='),
K('q','Q'), K('w','W'), K('e','E'), K('r','R'), K('t','T'),
K('y','Y'), K('u','U'), K('i','I'), K('o','O'), K('p','P'), K('@','`'),
K('a','A'), K('s','S'), K('d','D'), K('f','F'), K('g','G'),
K('h','H'), K('j','J'), K('k','K'), K('l','L'), K(';','+'), K(':','*'),
K('z','Z'), K('x','X'), K('c','C'), K('v','V'), K('b','B'),
K('n','N'), K('m','M'), K(',','<'), K('.','>'), K('/','?'), K('\\','_'),
~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', Common::KEYCODE_BACKSPACE, Common::KEYCODE_RETURN
};
SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os)
@ -67,12 +67,12 @@ SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os)
const char *np = key_names;
for (int i=0; i<SK_NUM_KEYS; i++) {
labels[0][i].create_texture(np);
np += strlen(np)+1;
if (key_codes[i]>8192) {
labels[1][i].create_texture(np);
np += strlen(np)+1;
}
labels[0][i].create_texture(np);
np += strlen(np)+1;
if (key_codes[i]>8192) {
labels[1][i].create_texture(np);
np += strlen(np)+1;
}
}
}
@ -89,22 +89,22 @@ void SoftKeyboard::draw(float x, float y, int transp)
x0 = x += 4.0;
y += 4.0;
for (int i=0; i<SK_NUM_KEYS; i++) {
float w = (i == 58? 164.0 : 24.0);
unsigned int bg = (i == keySel? bg_alpha_mask|0xffff00 :
float w = (i == 58? 164.0 : 24.0);
unsigned int bg = (i == keySel? bg_alpha_mask|0xffff00 :
bg_alpha_mask|0xc0c0ff);
draw_trans_quad(x, y, x+w, y+24.0, bg, bg, bg, bg);
if (key_codes[i]<0 && (shiftState & ~key_codes[i]))
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0xffffff, 0.5);
else if (key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
labels[1][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
else
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
x += w+4.0;
if (++c == 11) {
c = 0;
x = x0;
y += 28.0;
}
draw_trans_quad(x, y, x+w, y+24.0, bg, bg, bg, bg);
if (key_codes[i]<0 && (shiftState & ~key_codes[i]))
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0xffffff, 0.5);
else if (key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
labels[1][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
else
labels[0][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
x += w+4.0;
if (++c == 11) {
c = 0;
x = x0;
y += 28.0;
}
}
}
@ -112,47 +112,47 @@ int SoftKeyboard::key(int k, byte &shiftFlags)
{
switch(k) {
case 1001:
if (++keySel == SK_NUM_KEYS)
keySel = 0;
break;
if (++keySel == SK_NUM_KEYS)
keySel = 0;
break;
case 1002:
if (--keySel < 0)
keySel = SK_NUM_KEYS - 1;
break;
if (--keySel < 0)
keySel = SK_NUM_KEYS - 1;
break;
case 1003:
if (keySel >= 55) {
if (keySel > 58)
if (keySel >= 55) {
if (keySel > 58)
keySel += 5;
keySel -= 55;
} else if (keySel > 47) {
if ((keySel += 6) < 59)
keySel -= 55;
} else if (keySel > 47) {
if ((keySel += 6) < 59)
keySel = 59;
} else
keySel += 11;
break;
} else
keySel += 11;
break;
case 1004:
if (keySel > 58)
keySel -= 6;
else if ((keySel -= 11) < 0)
if ((keySel += 66) > 58)
if (keySel > 58)
keySel -= 6;
else if ((keySel -= 11) < 0)
if ((keySel += 66) > 58)
if ((keySel -= 5) < 59)
keySel = 59;
break;
break;
case 1000:
case 13:
case 32:
case 319:
if (key_codes[keySel]<0)
shiftState ^= ~key_codes[keySel];
else {
shiftFlags = shiftState;
if (key_codes[keySel] > 8192)
if (key_codes[keySel]<0)
shiftState ^= ~key_codes[keySel];
else {
shiftFlags = shiftState;
if (key_codes[keySel] > 8192)
return ((shiftState & Common::KBD_SHIFT)? (key_codes[keySel]>>8):
key_codes[keySel]) & 0xff;
else
else
return key_codes[keySel];
}
break;
}
break;
}
return 0;
}
@ -161,8 +161,8 @@ void SoftKeyboard::mouse(int x, int y)
{
os->mouseToSoftKbd(x, y, x, y);
if (x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
x%28 >= 4 && y%28 >= 4)
if ((keySel = 11*(y/28)+(x/28)) > 58)
if ((keySel -= 5) < 59)
x%28 >= 4 && y%28 >= 4)
if ((keySel = 11*(y/28)+(x/28)) > 58)
if ((keySel -= 5) < 59)
keySel = 58;
}

View file

@ -48,9 +48,9 @@ void OSystem_Dreamcast::delayMillis(uint msecs)
unsigned int t, start = Timer();
int time = (((unsigned int)msecs)*3125U)>>6;
while (((int)((t = Timer())-start))<time) {
if (_timerManager != NULL)
((DefaultTimerManager *)_timerManager)->handler();
checkSound();
if (_timerManager != NULL)
((DefaultTimerManager *)_timerManager)->handler();
checkSound();
}
getMillis();
}

View file

@ -52,20 +52,20 @@ static void displaySaveResult(vmsaveResult res)
switch(res) {
case VMSAVE_OK:
sprintf(buf, "Game saved on unit %c%d", 'A'+(lastvm/6), lastvm%6);
break;
sprintf(buf, "Game saved on unit %c%d", 'A'+(lastvm/6), lastvm%6);
break;
case VMSAVE_NOVM:
strcpy(buf, "No memory card present!");
break;
strcpy(buf, "No memory card present!");
break;
case VMSAVE_NOSPACE:
strcpy(buf, "Not enough space available!");
break;
strcpy(buf, "Not enough space available!");
break;
case VMSAVE_WRITEERROR:
strcpy(buf, "Write error!!!");
break;
strcpy(buf, "Write error!!!");
break;
default:
strcpy(buf, "Unknown error!!!");
break;
strcpy(buf, "Unknown error!!!");
break;
}
GUI::MessageDialog dialog(buf);
@ -85,14 +85,14 @@ static vmsaveResult trySave(const char *gamename, const char *data, int size,
unsigned char iconbuffer[512+32];
if (!vmsfs_check_unit(vm, 0, &info))
return VMSAVE_NOVM;
return VMSAVE_NOVM;
if (!vmsfs_get_superblock(&info, &super))
return VMSAVE_NOVM;
return VMSAVE_NOVM;
int free_cnt = vmsfs_count_free(&super);
if (vmsfs_open_file(&super, filename, &file))
free_cnt += file.blks;
free_cnt += file.blks;
if (((128+512+size+511)>>9) > free_cnt)
return VMSAVE_NOSPACE;
return VMSAVE_NOSPACE;
memset(&header, 0, sizeof(header));
strncpy(header.shortdesc, "ScummVM savegame", 16);
@ -117,9 +117,9 @@ static vmsaveResult trySave(const char *gamename, const char *data, int size,
if (!vmsfs_create_file(&super, filename, &header,
iconbuffer+sizeof(header.palette), NULL,
data, size, &tstamp)) {
fprintf(stderr, "%s\n", vmsfs_describe_error());
vmsfs_beep(&info, 0);
return VMSAVE_WRITEERROR;
fprintf(stderr, "%s\n", vmsfs_describe_error());
vmsfs_beep(&info, 0);
return VMSAVE_WRITEERROR;
}
vmsfs_beep(&info, 0);
@ -133,16 +133,16 @@ static bool tryLoad(char *&buffer, int &size, const char *filename, int vm)
struct vms_file file;
if (!vmsfs_check_unit(vm, 0, &info))
return false;
return false;
if (!vmsfs_get_superblock(&info, &super))
return false;
return false;
if (!vmsfs_open_file(&super, filename, &file))
return false;
return false;
buffer = new char[size = file.size];
if (vmsfs_read_file(&file, (unsigned char *)buffer, size))
return true;
return true;
delete[] buffer;
buffer = NULL;
@ -155,12 +155,12 @@ static bool tryDelete(const char *filename, int vm)
struct superblock super;
if (!vmsfs_check_unit(vm, 0, &info))
return false;
return false;
if (!vmsfs_get_superblock(&info, &super))
return false;
return false;
if (!vmsfs_delete_file(&super, filename))
return false;
return false;
return true;
}
@ -173,18 +173,18 @@ static void tryList(const Common::String &glob, int vm, Common::StringArray &lis
struct dir_entry de;
if (!vmsfs_check_unit(vm, 0, &info))
return;
return;
if (!vmsfs_get_superblock(&info, &super))
return;
return;
vmsfs_open_dir(&super, &iter);
while (vmsfs_next_dir_entry(&iter, &de))
if (de.entry[0]) {
char buf[16];
strncpy(buf, (char *)de.entry+4, 12);
buf[12] = 0;
if (Common::matchString(buf, glob.c_str()))
if (de.entry[0]) {
char buf[16];
strncpy(buf, (char *)de.entry+4, 12);
buf[12] = 0;
if (Common::matchString(buf, glob.c_str()))
list.push_back(buf);
}
}
}
vmsaveResult writeSaveGame(const char *gamename, const char *data, int size,
@ -193,15 +193,15 @@ vmsaveResult writeSaveGame(const char *gamename, const char *data, int size,
vmsaveResult r, res = VMSAVE_NOVM;
if (lastvm >= 0 &&
(res = trySave(gamename, data, size, filename, icon, lastvm)) == VMSAVE_OK)
return res;
(res = trySave(gamename, data, size, filename, icon, lastvm)) == VMSAVE_OK)
return res;
for (int i=0; i<24; i++)
if ((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
lastvm = i;
return r;
} else if (r > res)
res = r;
if ((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
lastvm = i;
return r;
} else if (r > res)
res = r;
return res;
}
@ -209,14 +209,14 @@ vmsaveResult writeSaveGame(const char *gamename, const char *data, int size,
bool readSaveGame(char *&buffer, int &size, const char *filename)
{
if (lastvm >= 0 &&
tryLoad(buffer, size, filename, lastvm))
return true;
tryLoad(buffer, size, filename, lastvm))
return true;
for (int i=0; i<24; i++)
if (tryLoad(buffer, size, filename, i)) {
lastvm = i;
return true;
}
if (tryLoad(buffer, size, filename, i)) {
lastvm = i;
return true;
}
return false;
}
@ -224,14 +224,14 @@ bool readSaveGame(char *&buffer, int &size, const char *filename)
bool deleteSaveGame(const char *filename)
{
if (lastvm >= 0 &&
tryDelete(filename, lastvm))
return true;
tryDelete(filename, lastvm))
return true;
for (int i=0; i<24; i++)
if (tryDelete(filename, i)) {
lastvm = i;
return true;
}
if (tryDelete(filename, i)) {
lastvm = i;
return true;
}
return false;
}
@ -249,12 +249,12 @@ private:
public:
InVMSave()
: _pos(0), buffer(NULL), _eos(false)
: _pos(0), buffer(NULL), _eos(false)
{ }
~InVMSave()
{
delete[] buffer;
delete[] buffer;
}
bool eos() const override { return _eos; }
@ -278,10 +278,10 @@ public:
virtual int32 pos() const { return _pos; }
OutVMSave(const char *_filename)
: _pos(0), committed(-1), iofailed(false)
: _pos(0), committed(-1), iofailed(false)
{
strncpy(filename, _filename, 16);
buffer = new char[size = MAX_SAVE_SIZE];
strncpy(filename, _filename, 16);
buffer = new char[size = MAX_SAVE_SIZE];
}
~OutVMSave();
@ -344,7 +344,7 @@ void OutVMSave::finalize()
extern Icon icon;
if (committed >= _pos)
return;
return;
char *data = buffer;
int len = _pos;
@ -352,7 +352,7 @@ void OutVMSave::finalize()
vmsaveResult r = writeSaveGame(gGameName, data, len, filename, icon);
committed = _pos;
if (r != VMSAVE_OK)
iofailed = true;
iofailed = true;
displaySaveResult(r);
}
@ -366,12 +366,12 @@ uint32 InVMSave::read(void *buf, uint32 cnt)
{
int nbyt = cnt;
if (_pos + nbyt > _size) {
cnt = (_size - _pos);
_eos = true;
nbyt = cnt;
cnt = (_size - _pos);
_eos = true;
nbyt = cnt;
}
if (nbyt)
memcpy(buf, buffer + _pos, nbyt);
memcpy(buf, buffer + _pos, nbyt);
_pos += nbyt;
return cnt;
}
@ -380,7 +380,7 @@ bool InVMSave::skip(uint32 offset)
{
int nbyt = offset;
if (_pos + nbyt > _size)
nbyt = (_size - _pos);
nbyt = (_size - _pos);
_pos += nbyt;
return true;
}
@ -389,19 +389,19 @@ bool InVMSave::seek(int32 offs, int whence)
{
switch(whence) {
case SEEK_SET:
_pos = offs;
break;
_pos = offs;
break;
case SEEK_CUR:
_pos += offs;
break;
_pos += offs;
break;
case SEEK_END:
_pos = _size + offs;
break;
_pos = _size + offs;
break;
}
if (_pos < 0)
_pos = 0;
_pos = 0;
else if (_pos > _size)
_pos = _size;
_pos = _size;
_eos = false;
return true;
}
@ -410,11 +410,11 @@ uint32 OutVMSave::write(const void *buf, uint32 cnt)
{
int nbyt = cnt;
if (_pos + nbyt > size) {
cnt = (size - _pos);
nbyt = cnt;
cnt = (size - _pos);
nbyt = cnt;
}
if (nbyt)
memcpy(buffer + _pos, buf, nbyt);
memcpy(buffer + _pos, buf, nbyt);
_pos += nbyt;
return cnt;
}
@ -425,7 +425,7 @@ Common::StringArray VMSaveManager::listSavefiles(const Common::String &pattern)
Common::StringArray list;
for (int i=0; i<24; i++)
tryList(pattern, i, list);
tryList(pattern, i, list);
return list;
}

View file

@ -158,7 +158,7 @@ void Background::init(Background *surface, int layer, bool isSub, int mapBase, b
}
static void dmaBlit(uint16 *dst, const uint dstPitch, const uint16 *src, const uint srcPitch,
const uint w, const uint h, const uint bytesPerPixel) {
const uint w, const uint h, const uint bytesPerPixel) {
if (dstPitch == srcPitch && ((w * bytesPerPixel) == dstPitch)) {
dmaCopy(src, dst, dstPitch * h);
return;

View file

@ -137,28 +137,28 @@ void OSystem_DS::logMessage(LogMessageType::Type type, const char *message) {
}
static const Common::HardwareInputTableEntry ndsJoystickButtons[] = {
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("A") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("B") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("X") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Y") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("A") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("B") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("X") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Y") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
static const Common::AxisTableEntry ndsJoystickAxes[] = {
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
};
const Common::HardwareInputTableEntry ndsMouseButtons[] = {
{ "MOUSE_LEFT", Common::MOUSE_BUTTON_LEFT, _s("Touch") },
{ nullptr, 0, nullptr }
{ "MOUSE_LEFT", Common::MOUSE_BUTTON_LEFT, _s("Touch") },
{ nullptr, 0, nullptr }
};
Common::HardwareInputSet *OSystem_DS::getHardwareInputSet() {

View file

@ -139,7 +139,7 @@ public:
virtual int16 getHeight() override;
virtual int16 getWidth() override;
bool touchpadModeEnabled() const;
bool touchpadModeEnabled() const;
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const override { return _framebuffer.format; }

View file

@ -97,20 +97,20 @@ bool Mp3PspStream::initDecoder() {
// Based on PSP firmware version, we need to do different things to do Media Engine processing
uint32 firmware = sceKernelDevkitVersion();
PSP_DEBUG_PRINT("Firmware version 0x%x\n", firmware);
if (firmware == 0x01050001){
if (firmware == 0x01050001){
if (!loadStartAudioModule("flash0:/kd/me_for_vsh.prx",
PSP_MEMORY_PARTITION_KERNEL)) {
PSP_ERROR("failed to load me_for_vsh.prx. ME cannot start.\n");
_decoderFail = true;
return false;
}
if (!loadStartAudioModule("flash0:/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL)) {
if (!loadStartAudioModule("flash0:/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL)) {
PSP_ERROR("failed to load audiocodec.prx. ME cannot start.\n");
_decoderFail = true;
return false;
}
} else {
if (sceUtilityLoadAvModule(PSP_AV_MODULE_AVCODEC) < 0) {
} else {
if (sceUtilityLoadAvModule(PSP_AV_MODULE_AVCODEC) < 0) {
PSP_ERROR("failed to load AVCODEC module. ME cannot start.\n");
_decoderFail = true;
return false;
@ -130,15 +130,15 @@ bool Mp3PspStream::stopDecoder() {
return true;
// Based on PSP firmware version, we need to do different things to do Media Engine processing
if (sceKernelDevkitVersion() == 0x01050001){ // TODO: how do we unload?
if (sceKernelDevkitVersion() == 0x01050001){ // TODO: how do we unload?
/* if (!unloadAudioModule("flash0:/kd/me_for_vsh.prx", PSP_MEMORY_PARTITION_KERNEL) ||
!unloadAudioModule("flash0:/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL) {
PSP_ERROR("failed to unload audio module\n");
return false;
}
*/
}else{
if (sceUtilityUnloadModule(PSP_MODULE_AV_AVCODEC) < 0) {
}else{
if (sceUtilityUnloadModule(PSP_MODULE_AV_AVCODEC) < 0) {
PSP_ERROR("failed to unload avcodec module\n");
return false;
}
@ -152,26 +152,26 @@ bool Mp3PspStream::stopDecoder() {
bool Mp3PspStream::loadStartAudioModule(const char *modname, int partition){
DEBUG_ENTER_FUNC();
SceKernelLMOption option;
SceUID modid;
SceKernelLMOption option;
SceUID modid;
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = partition;
option.mpiddata = partition;
option.position = 0;
option.access = 1;
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = partition;
option.mpiddata = partition;
option.position = 0;
option.access = 1;
modid = sceKernelLoadModule(modname, 0, &option);
if (modid < 0) {
modid = sceKernelLoadModule(modname, 0, &option);
if (modid < 0) {
PSP_ERROR("Failed to load module %s. Got error 0x%x\n", modname, modid);
return false;
return false;
}
int ret = sceKernelStartModule(modid, 0, NULL, NULL, NULL);
int ret = sceKernelStartModule(modid, 0, NULL, NULL, NULL);
if (ret < 0) {
PSP_ERROR("Failed to start module %s. Got error 0x%x\n", modname, ret);
return false;
return false;
}
return true;
}

View file

@ -67,9 +67,9 @@ void PSPPixelFormat::set(Type type, bool swap /* = false */) {
// Convert from ScummVM general PixelFormat to our pixel format
// For buffer and palette.
void PSPPixelFormat::convertFromScummvmPixelFormat(const Graphics::PixelFormat *pf,
PSPPixelFormat::Type &bufferType,
PSPPixelFormat::Type &paletteType,
bool &swapRedBlue) {
PSPPixelFormat::Type &bufferType,
PSPPixelFormat::Type &paletteType,
bool &swapRedBlue) {
swapRedBlue = false; // no red-blue swap by default
PSPPixelFormat::Type *target = 0; // which one we'll be filling

View file

@ -193,38 +193,38 @@ bool PspMutex::unlock() {
// Release all threads waiting on the condition
void PspCondition::releaseAll() {
_mutex.lock();
if (_waitingThreads > _signaledThreads) { // we have signals to issue
int numWaiting = _waitingThreads - _signaledThreads; // threads we haven't signaled
_signaledThreads = _waitingThreads;
_mutex.lock();
if (_waitingThreads > _signaledThreads) { // we have signals to issue
int numWaiting = _waitingThreads - _signaledThreads; // threads we haven't signaled
_signaledThreads = _waitingThreads;
_waitSem.give(numWaiting);
_mutex.unlock();
for (int i=0; i<numWaiting; i++) // wait for threads to tell us they're awake
_mutex.unlock();
for (int i=0; i<numWaiting; i++) // wait for threads to tell us they're awake
_doneSem.take();
} else {
_mutex.unlock();
}
} else {
_mutex.unlock();
}
}
// Mutex must be taken before entering wait
void PspCondition::wait(PspMutex &externalMutex) {
_mutex.lock();
_waitingThreads++;
_mutex.unlock();
_mutex.lock();
_waitingThreads++;
_mutex.unlock();
externalMutex.unlock(); // must unlock external mutex
externalMutex.unlock(); // must unlock external mutex
_waitSem.take(); // sleep on the wait semaphore
// let the signaling thread know we're done
_mutex.lock();
if (_signaledThreads > 0 ) {
_doneSem.give(); // let the thread know
_signaledThreads--;
}
_waitingThreads--;
_mutex.unlock();
if (_signaledThreads > 0 ) {
_doneSem.give(); // let the thread know
_signaledThreads--;
}
_waitingThreads--;
_mutex.unlock();
externalMutex.lock(); // must lock external mutex here for continuation
externalMutex.lock(); // must lock external mutex here for continuation
}

View file

@ -60,13 +60,13 @@ extern int psp_debug_indent;
//
class PSPStackDebugFuncs {
Common::String _name;
Common::String _name;
public:
PSPStackDebugFuncs(const char *name) : _name(name) {
PSP_INFO_PRINT_INDENT("++ %s\n", _name.c_str());
psp_debug_indent++;
}
}
~PSPStackDebugFuncs() {
psp_debug_indent--;

View file

@ -150,9 +150,9 @@ bool OSystem_MacOSX::displayLogFile() {
if (_logFilePath.empty())
return false;
CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (const UInt8 *)_logFilePath.c_str(), _logFilePath.size(), false);
OSStatus err = LSOpenCFURLRef(url, NULL);
CFRelease(url);
CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (const UInt8 *)_logFilePath.c_str(), _logFilePath.size(), false);
OSStatus err = LSOpenCFURLRef(url, NULL);
CFRelease(url);
return err != noErr;
}

View file

@ -38,32 +38,32 @@
#include <sys/stat.h>
static const Common::HardwareInputTableEntry playstationJoystickButtons[] = {
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("Cross") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("Circle") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Square") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Triangle") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_GUIDE", Common::JOYSTICK_BUTTON_GUIDE, _s("PS") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("L3") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("R3") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L1") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R1") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("Cross") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("Circle") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Square") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Triangle") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_GUIDE", Common::JOYSTICK_BUTTON_GUIDE, _s("PS") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("L3") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("R3") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L1") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R1") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
static const Common::AxisTableEntry playstationJoystickAxes[] = {
{ "JOY_LEFT_TRIGGER", Common::JOYSTICK_AXIS_LEFT_TRIGGER, Common::kAxisTypeHalf, _s("L2") },
{ "JOY_RIGHT_TRIGGER", Common::JOYSTICK_AXIS_RIGHT_TRIGGER, Common::kAxisTypeHalf, _s("R2") },
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
{ "JOY_LEFT_TRIGGER", Common::JOYSTICK_AXIS_LEFT_TRIGGER, Common::kAxisTypeHalf, _s("L2") },
{ "JOY_RIGHT_TRIGGER", Common::JOYSTICK_AXIS_RIGHT_TRIGGER, Common::kAxisTypeHalf, _s("R2") },
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
};
int access(const char *pathname, int mode) {

View file

@ -41,27 +41,27 @@
#endif
static const Common::HardwareInputTableEntry psp2JoystickButtons[] = {
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("Cross") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("Circle") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Square") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Triangle") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("Cross") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("Circle") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Square") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("Triangle") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Select") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Start") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
static const Common::AxisTableEntry psp2JoystickAxes[] = {
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
};
int access(const char *pathname, int mode) {

View file

@ -728,9 +728,9 @@ AudioCDManager *OSystem_SDL::createAudioCDManager() {
Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
#ifdef ENABLE_EVENTRECORDER
return g_eventRec.getSaveManager(_savefileManager);
return g_eventRec.getSaveManager(_savefileManager);
#else
return _savefileManager;
return _savefileManager;
#endif
}

View file

@ -35,32 +35,32 @@
#include "backends/keymapper/hardware-input.h"
static const Common::HardwareInputTableEntry switchJoystickButtons[] = {
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("B") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("A") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Y") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("X") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Minus") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Plus") },
{ "JOY_GUIDE", Common::JOYSTICK_BUTTON_START, _s("Plus") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("L3") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("R3") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
{ "JOY_A", Common::JOYSTICK_BUTTON_A, _s("B") },
{ "JOY_B", Common::JOYSTICK_BUTTON_B, _s("A") },
{ "JOY_X", Common::JOYSTICK_BUTTON_X, _s("Y") },
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("X") },
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Minus") },
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Plus") },
{ "JOY_GUIDE", Common::JOYSTICK_BUTTON_START, _s("Plus") },
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("L3") },
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("R3") },
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
{ "JOY_RIGHT_SHOULDER", Common::JOYSTICK_BUTTON_RIGHT_SHOULDER, _s("R") },
{ "JOY_UP", Common::JOYSTICK_BUTTON_DPAD_UP, _s("D-pad Up") },
{ "JOY_DOWN", Common::JOYSTICK_BUTTON_DPAD_DOWN, _s("D-pad Down") },
{ "JOY_LEFT", Common::JOYSTICK_BUTTON_DPAD_LEFT, _s("D-pad Left") },
{ "JOY_RIGHT", Common::JOYSTICK_BUTTON_DPAD_RIGHT, _s("D-pad Right") },
{ nullptr, 0, nullptr }
};
static const Common::AxisTableEntry switchJoystickAxes[] = {
{ "JOY_LEFT_TRIGGER", Common::JOYSTICK_AXIS_LEFT_TRIGGER, Common::kAxisTypeHalf, _s("ZL") },
{ "JOY_RIGHT_TRIGGER", Common::JOYSTICK_AXIS_RIGHT_TRIGGER, Common::kAxisTypeHalf, _s("ZR") },
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
{ "JOY_LEFT_TRIGGER", Common::JOYSTICK_AXIS_LEFT_TRIGGER, Common::kAxisTypeHalf, _s("ZL") },
{ "JOY_RIGHT_TRIGGER", Common::JOYSTICK_AXIS_RIGHT_TRIGGER, Common::kAxisTypeHalf, _s("ZR") },
{ "JOY_LEFT_STICK_X", Common::JOYSTICK_AXIS_LEFT_STICK_X, Common::kAxisTypeFull, _s("Left Stick X") },
{ "JOY_LEFT_STICK_Y", Common::JOYSTICK_AXIS_LEFT_STICK_Y, Common::kAxisTypeFull, _s("Left Stick Y") },
{ "JOY_RIGHT_STICK_X", Common::JOYSTICK_AXIS_RIGHT_STICK_X, Common::kAxisTypeFull, _s("Right Stick X") },
{ "JOY_RIGHT_STICK_Y", Common::JOYSTICK_AXIS_RIGHT_STICK_Y, Common::kAxisTypeFull, _s("Right Stick Y") },
{ nullptr, 0, Common::kAxisTypeFull, nullptr }
};
void OSystem_Switch::init() {

View file

@ -37,15 +37,15 @@ namespace GUI {
#define ACTION_VERSION 7
enum actionType {
ACTION_UP = 0,
ACTION_DOWN,
ACTION_LEFT,
ACTION_RIGHT,
ACTION_LEFTCLICK,
ACTION_RIGHTCLICK,
ACTION_SAVE,
ACTION_SKIP,
ACTION_ZONE,
ACTION_UP = 0,
ACTION_DOWN,
ACTION_LEFT,
ACTION_RIGHT,
ACTION_LEFTCLICK,
ACTION_RIGHTCLICK,
ACTION_SAVE,
ACTION_SKIP,
ACTION_ZONE,
ACTION_MULTI,
ACTION_SWAPCHAR,
ACTION_SKIP_TEXT,

View file

@ -175,9 +175,9 @@ namespace std
#ifndef signbit
#define signbit(x) \
((sizeof (x) == sizeof (float)) ? __signbitf(x) \
: (sizeof (x) == sizeof (double)) ? __signbit(x) \
: __signbitl(x))
((sizeof (x) == sizeof (float)) ? __signbitf(x) \
: (sizeof (x) == sizeof (double)) ? __signbit(x) \
: __signbitl(x))
#endif
// Functions from openlibm not declared in Symbian math.h

View file

@ -213,15 +213,15 @@
#define fast_memcpy(d,s,n) \
{ size_t nn = (size_t)(n); \
if (nn >= breakeven_point) memcpy((d), (s), nn); \
else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
if (nn >= breakeven_point) memcpy((d), (s), nn); \
else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
char *dd; const char *ss; \
for (ss=(s), dd=(d); nn>0; nn--) *dd++ = *ss++; } }
#define fast_memset(d,c,n) \
{ size_t nn = (size_t)(n); \
if (nn >= breakeven_point) memset((d), (int)(c), nn); \
else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
if (nn >= breakeven_point) memset((d), (int)(c), nn); \
else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
char *dd; const int cc=(int)(c); \
for (dd=(d); nn>0; nn--) *dd++ = cc; } }

View file

@ -54,8 +54,8 @@ bool reset_btn_pressed = false;
bool power_btn_pressed = false;
#if ((_V_MAJOR_ > 1) || \
(_V_MAJOR_ == 1 && _V_MINOR_ > 8 ) || \
(_V_MAJOR_ == 1 && _V_MINOR_ == 8 && _V_PATCH_ >= 18))
(_V_MAJOR_ == 1 && _V_MINOR_ > 8 ) || \
(_V_MAJOR_ == 1 && _V_MINOR_ == 8 && _V_PATCH_ >= 18))
void reset_cb(u32, void *) {
#else
void reset_cb(void) {

View file

@ -43,7 +43,7 @@ public:
virtual void setCount(int count);
// Implementation of the EventSource interface
virtual bool pollEvent(Common::Event &event);
virtual bool pollEvent(Common::Event &event);
private:
GMainLoop *_loop;

View file

@ -60,79 +60,79 @@ Win32UpdateManager::Win32UpdateManager(SdlWindow_Win32 *window) {
win_sparkle_set_appcast_url(appcastUrl);
win_sparkle_set_can_shutdown_callback(canShutdownCallback);
win_sparkle_set_shutdown_request_callback(shutdownRequestCallback);
win_sparkle_init();
win_sparkle_init();
if (!ConfMan.hasKey("updates_check")
|| ConfMan.getInt("updates_check") == Common::UpdateManager::kUpdateIntervalNotSupported) {
setAutomaticallyChecksForUpdates(kUpdateStateDisabled);
} else {
setAutomaticallyChecksForUpdates(kUpdateStateEnabled);
setUpdateCheckInterval(normalizeInterval(ConfMan.getInt("updates_check")));
}
if (!ConfMan.hasKey("updates_check")
|| ConfMan.getInt("updates_check") == Common::UpdateManager::kUpdateIntervalNotSupported) {
setAutomaticallyChecksForUpdates(kUpdateStateDisabled);
} else {
setAutomaticallyChecksForUpdates(kUpdateStateEnabled);
setUpdateCheckInterval(normalizeInterval(ConfMan.getInt("updates_check")));
}
}
Win32UpdateManager::~Win32UpdateManager() {
win_sparkle_cleanup();
win_sparkle_cleanup();
}
void Win32UpdateManager::checkForUpdates() {
win_sparkle_check_update_with_ui();
win_sparkle_check_update_with_ui();
}
void Win32UpdateManager::setAutomaticallyChecksForUpdates(UpdateManager::UpdateState state) {
if (state == kUpdateStateNotSupported)
return;
if (state == kUpdateStateNotSupported)
return;
win_sparkle_set_automatic_check_for_updates(state == kUpdateStateEnabled ? 1 : 0);
win_sparkle_set_automatic_check_for_updates(state == kUpdateStateEnabled ? 1 : 0);
}
Common::UpdateManager::UpdateState Win32UpdateManager::getAutomaticallyChecksForUpdates() {
if (win_sparkle_get_automatic_check_for_updates() == 1)
return kUpdateStateEnabled;
else
return kUpdateStateDisabled;
if (win_sparkle_get_automatic_check_for_updates() == 1)
return kUpdateStateEnabled;
else
return kUpdateStateDisabled;
}
void Win32UpdateManager::setUpdateCheckInterval(int interval) {
if (interval == kUpdateIntervalNotSupported)
return;
if (interval == kUpdateIntervalNotSupported)
return;
interval = normalizeInterval(interval);
interval = normalizeInterval(interval);
win_sparkle_set_update_check_interval(interval);
win_sparkle_set_update_check_interval(interval);
}
int Win32UpdateManager::getUpdateCheckInterval() {
// This is kind of a hack but necessary, as the value stored by Sparkle
// might have been changed outside of ScummVM (in which case we return the
// default interval of one day)
// This is kind of a hack but necessary, as the value stored by Sparkle
// might have been changed outside of ScummVM (in which case we return the
// default interval of one day)
int updateInterval = win_sparkle_get_update_check_interval();
switch (updateInterval) {
case kUpdateIntervalOneDay:
case kUpdateIntervalOneWeek:
case kUpdateIntervalOneMonth:
return updateInterval;
int updateInterval = win_sparkle_get_update_check_interval();
switch (updateInterval) {
case kUpdateIntervalOneDay:
case kUpdateIntervalOneWeek:
case kUpdateIntervalOneMonth:
return updateInterval;
default:
// Return the default value (one day)
return kUpdateIntervalOneDay;
}
default:
// Return the default value (one day)
return kUpdateIntervalOneDay;
}
}
bool Win32UpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) {
time_t updateTime = win_sparkle_get_last_check_time();
tm *ut = localtime(&updateTime);
time_t updateTime = win_sparkle_get_last_check_time();
tm *ut = localtime(&updateTime);
t.tm_wday = ut->tm_wday;
t.tm_year = ut->tm_year;
t.tm_mon = ut->tm_mon;
t.tm_mday = ut->tm_mday;
t.tm_hour = ut->tm_hour;
t.tm_min = ut->tm_min;
t.tm_sec = ut->tm_sec;
t.tm_wday = ut->tm_wday;
t.tm_year = ut->tm_year;
t.tm_mon = ut->tm_mon;
t.tm_mday = ut->tm_mday;
t.tm_hour = ut->tm_hour;
t.tm_min = ut->tm_min;
t.tm_sec = ut->tm_sec;
return true;
return true;
}
// WinSparkle calls this to ask if we can shut down.

View file

@ -32,9 +32,9 @@
/**
***************************************
** Virtual Keyboard Pack File Format **
***************************************
***************************************
** Virtual Keyboard Pack File Format **
***************************************
The new virtual keyboard for ScummVM is implemented in the same way as a HTML
ImageMap. It uses a single bitmap of the entire keyboard layout and then a
@ -45,42 +45,42 @@ keyboard. The HTML image map description is contained in a larger XML file that
can describe all the different modes of the keyboard, and also different
keyboard layouts for different screen resolutions.
********************************************
** Example keyboard pack description file **
********************************************
********************************************
** Example keyboard pack description file **
********************************************
<keyboard modes="normal,caps" initial_mode="normal" v_align="bottom" h_align="center">
<mode name="normal" resolutions="640x400,320x200">
<layout resolution="640x400" bitmap="normal_640x400.bmp" transparent_color="255,0,255">
<map>
<area shape="poly" coords="65,50,67,48,94,48,96,50,96,77,94,79,67,79,65,77" target="q" />
<area shape="poly" coords="105,50,107,48,134,48,136,50,136,77,134,79,107,79,105,77" target="w" />
<area shape="poly" coords="146,50,148,48,174,48,176,50,176,77,174,79,148,79,146,77" target="e" />
...
<area shape="poly" coords="11,89,12,88,69,88,70,89,70,116,69,117,12,117,11,116" target="caps" />
</map>
</layout>
<layout resolution="320x200" bitmap="normal_320x200.bmp" transparent_color="255,0,255">
...
</layout>
<event name="a" type="key" code="97" ascii="97" modifiers="" />
<event name="b" type="key" code="98" ascii="98" modifiers="" />
<event name="c" type="key" code="99" ascii="99" modifiers="" />
...
<event name="caps" type="switch_mode" mode="caps" />
<layout resolution="640x400" bitmap="normal_640x400.bmp" transparent_color="255,0,255">
<map>
<area shape="poly" coords="65,50,67,48,94,48,96,50,96,77,94,79,67,79,65,77" target="q" />
<area shape="poly" coords="105,50,107,48,134,48,136,50,136,77,134,79,107,79,105,77" target="w" />
<area shape="poly" coords="146,50,148,48,174,48,176,50,176,77,174,79,148,79,146,77" target="e" />
...
<area shape="poly" coords="11,89,12,88,69,88,70,89,70,116,69,117,12,117,11,116" target="caps" />
</map>
</layout>
<layout resolution="320x200" bitmap="normal_320x200.bmp" transparent_color="255,0,255">
...
</layout>
<event name="a" type="key" code="97" ascii="97" modifiers="" />
<event name="b" type="key" code="98" ascii="98" modifiers="" />
<event name="c" type="key" code="99" ascii="99" modifiers="" />
...
<event name="caps" type="switch_mode" mode="caps" />
</mode>
<mode name="caps" resolutions="640x400">
<layout resolution="640x400" bitmap="caps_640x480.bmp" transparent_color="255,0,255">
<map>
<area shape="poly" coords="65,50,67,48,94,48,96,50,96,77,94,79,67,79,65,77" target="Q" />
...
</map>
</layout>
<event name="A" type="key" code="97" ascii="65" modifiers="shift" />
<event name="B" type="key" code="98" ascii="66" modifiers="shift" />
<event name="C" type="key" code="99" ascii="67" modifiers="shift" />
...
<layout resolution="640x400" bitmap="caps_640x480.bmp" transparent_color="255,0,255">
<map>
<area shape="poly" coords="65,50,67,48,94,48,96,50,96,77,94,79,67,79,65,77" target="Q" />
...
</map>
</layout>
<event name="A" type="key" code="97" ascii="65" modifiers="shift" />
<event name="B" type="key" code="98" ascii="66" modifiers="shift" />
<event name="C" type="key" code="99" ascii="67" modifiers="shift" />
...
</mode>
</keyboard>

View file

@ -227,16 +227,16 @@ void VirtualKeyboard::handleMouseUp(int16 x, int16 y) {
// If no GUI opened before the virtual keyboard, kKeymapTypeGui is not yet initialized
// Check and do it if needed
void VirtualKeyboard::initKeymap() {
using namespace Common;
using namespace Common;
Keymapper *mapper = _system->getEventManager()->getKeymapper();
Keymapper *mapper = _system->getEventManager()->getKeymapper();
// Do not try to recreate same keymap over again
if (mapper->getKeymap(kGuiKeymapName) != 0)
return;
// Do not try to recreate same keymap over again
if (mapper->getKeymap(kGuiKeymapName) != 0)
return;
Keymap *guiMap = g_gui.getKeymap();
mapper->addGlobalKeymap(guiMap);
Keymap *guiMap = g_gui.getKeymap();
mapper->addGlobalKeymap(guiMap);
}
void VirtualKeyboard::show() {

View file

@ -144,12 +144,12 @@ static const char HELP_STRING[] =
" --output-rate=RATE Select output sample rate in Hz (e.g. 22050)\n"
" --opl-driver=DRIVER Select AdLib (OPL) emulator (db, mame"
#ifndef DISABLE_NUKED_OPL
", nuked"
", nuked"
#endif
#ifdef ENABLE_OPL2LPT
", opl2lpt"
", opl2lpt"
#endif
")\n"
")\n"
" --show-fps Set the turn on display FPS info in 3D games\n"
" --no-show-fps Set the turn off display FPS info in 3D games\n"
" --renderer=RENDERER Select 3D renderer (software, opengl, opengl_shaders)\n"

View file

@ -30,25 +30,25 @@
class DetectionDynamic : public Detection {
public:
DetectionDynamic() {}
~DetectionDynamic() {}
DetectionDynamic() {}
~DetectionDynamic() {}
const char *getName() const override {
return "detection";
}
const char *getName() const override {
return "detection";
}
PluginList getPlugins() const override {
PluginList pl;
PluginList getPlugins() const override {
PluginList pl;
#define LINK_PLUGIN(ID) \
#define LINK_PLUGIN(ID) \
extern PluginType g_##ID##_type; \
extern PluginObject *g_##ID##_getObject(); \
pl.push_back(new StaticPlugin(g_##ID##_getObject(), g_##ID##_type));
#include "engines/detection_table.h"
#include "engines/detection_table.h"
return pl;
}
return pl;
}
};
REGISTER_PLUGIN_DYNAMIC(DETECTION_DYNAMIC, PLUGIN_TYPE_DETECTION, DetectionDynamic);

View file

@ -24,9 +24,9 @@
class Detection : public PluginObject {
public:
Detection() {}
virtual ~Detection() {}
Detection() {}
virtual ~Detection() {}
virtual const char *getName() const = 0;
virtual PluginList getPlugins() const = 0;
virtual const char *getName() const = 0;
virtual PluginList getPlugins() const = 0;
};

View file

@ -385,10 +385,10 @@ T nextHigher2(T v) {
template<class It, class Dat>
void replace(It begin, It end, const Dat &original, const Dat &replaced) {
for (; begin != end; ++begin) {
if (*begin == original) {
*begin = replaced;
}
}
if (*begin == original) {
*begin = replaced;
}
}
}
/** @} */

View file

@ -81,9 +81,9 @@ SearchSet::ArchiveNodeList::const_iterator SearchSet::find(const String &name) c
}
/*
Keep the nodes sorted according to descending priorities.
In case two or node nodes have the same priority, insertion
order prevails.
Keep the nodes sorted according to descending priorities.
In case two or node nodes have the same priority, insertion
order prevails.
*/
void SearchSet::insert(const Node &node) {
ArchiveNodeList::iterator it = _list.begin();

View file

@ -150,7 +150,7 @@ public:
insert_aux(end(), &element, &element + 1);
}
/** Append an element to the end of the array. */
/** Append an element to the end of the array. */
void push_back(const Array<T> &array) {
if (_size + array.size() <= _capacity) {
uninitialized_copy(array.begin(), array.end(), end());
@ -201,12 +201,12 @@ public:
return _storage[_size-1];
}
/** Insert an element into the array at the given position. */
/** Insert an element into the array at the given position. */
void insert_at(size_type idx, const T &element) {
assert(idx <= _size);
insert_aux(_storage + idx, &element, &element + 1);
}
/** Insert copies of all the elements from the given array into this array at the given position. */
void insert_at(size_type idx, const Array<T> &array) {
assert(idx <= _size);
@ -219,7 +219,7 @@ public:
void insert(iterator pos, const T &element) {
insert_aux(pos, &element, &element + 1);
}
/** Remove an element at the given position from the array and return the value of that element. */
T remove_at(size_type idx) {
assert(idx < _size);
@ -239,13 +239,13 @@ public:
return _storage[idx];
}
/** Return a const reference to the element at the given position in the array. */
/** Return a const reference to the element at the given position in the array. */
const T &operator[](size_type idx) const {
assert(idx < _size);
return _storage[idx];
}
/** Assign the given @p array to this array. */
/** Assign the given @p array to this array. */
Array<T> &operator=(const Array<T> &array) {
if (this == &array)
return *this;
@ -259,7 +259,7 @@ public:
}
#ifdef USE_CXX11
/** Assign the given array to this array using the C++11 move semantic. */
/** Assign the given array to this array using the C++11 move semantic. */
Array &operator=(Array<T> &&old) {
if (this == &old)
return *this;
@ -277,12 +277,12 @@ public:
}
#endif
/** Return the size of the array. */
/** Return the size of the array. */
size_type size() const {
return _size;
}
/** Clear the array of all its elements. */
/** Clear the array of all its elements. */
void clear() {
freeStorage(_storage, _size);
_storage = nullptr;
@ -290,7 +290,7 @@ public:
_capacity = 0;
}
/** Erase the element at @p pos position and return an iterator pointing to the next element in the array. */
/** Erase the element at @p pos position and return an iterator pointing to the next element in the array. */
iterator erase(iterator pos) {
copy(pos + 1, _storage + _size, pos);
_size--;
@ -298,13 +298,13 @@ public:
_storage[_size].~T();
return pos;
}
/** Check whether the array is empty. */
/** Check whether the array is empty. */
bool empty() const {
return (_size == 0);
}
/** Check whether two arrays are identical. */
/** Check whether two arrays are identical. */
bool operator==(const Array<T> &other) const {
if (this == &other)
return true;
@ -317,32 +317,32 @@ public:
return true;
}
/** Check if two arrays are different. */
/** Check if two arrays are different. */
bool operator!=(const Array<T> &other) const {
return !(*this == other);
}
/** Return an iterator pointing to the first element in the array. */
/** Return an iterator pointing to the first element in the array. */
iterator begin() {
return _storage;
}
/** Return an iterator pointing past the last element in the array. */
/** Return an iterator pointing past the last element in the array. */
iterator end() {
return _storage + _size;
}
/** Return a const iterator pointing to the first element in the array. */
/** Return a const iterator pointing to the first element in the array. */
const_iterator begin() const {
return _storage;
}
/** Return a const iterator pointing past the last element in the array. */
/** Return a const iterator pointing past the last element in the array. */
const_iterator end() const {
return _storage + _size;
}
/** Reserve enough memory in the array so that it can store at least the given number of elements.
/** Reserve enough memory in the array so that it can store at least the given number of elements.
* The current content of the array is not modified.
*/
void reserve(size_type newCapacity) {
@ -359,7 +359,7 @@ public:
}
}
/** Change the size of the array. */
/** Change the size of the array. */
void resize(size_type newSize) {
reserve(newSize);
for (size_type i = newSize; i < _size; ++i)
@ -369,7 +369,7 @@ public:
_size = newSize;
}
/** Assign to this array the elements between the given iterators from another array,
/** Assign to this array the elements between the given iterators from another array,
* from @p first included to @p last excluded.
*/
void assign(const_iterator first, const_iterator last) {
@ -380,7 +380,7 @@ public:
}
protected:
/** Round up capacity to the next power of 2.
/** Round up capacity to the next power of 2.
* A minimal capacity of 8 is used.
*/
static size_type roundUpCapacity(size_type capacity) {
@ -390,7 +390,7 @@ protected:
return capa;
}
/** Allocate a specific capacity for the array. */
/** Allocate a specific capacity for the array. */
void allocCapacity(size_type capacity) {
_capacity = capacity;
if (capacity) {
@ -402,7 +402,7 @@ protected:
}
}
/** Free the storage used by the array. */
/** Free the storage used by the array. */
void freeStorage(T *storage, const size_type elements) {
for (size_type i = 0; i < elements; ++i)
storage[i].~T();

View file

@ -69,7 +69,7 @@ static uint32 computeCapacity(uint32 len) {
TEMPLATE
BASESTRING::BaseString(const BASESTRING &str)
: _size(str._size) {
: _size(str._size) {
if (str.isStorageIntern()) {
// String in internal storage: just copy it
memcpy(_storage, str._storage, _builtinCapacity * sizeof(value_type));

View file

@ -70,7 +70,7 @@ public:
bool empty() const { return _entries.empty(); } /*!< Return true if the configuration is empty, i.e. has no [key, value] pairs, and false otherwise. */
bool contains(const String &key) const { return _entries.contains(key); } /*!< Check whether the domain contains a @p key. */
/** Return the configuration value for the given key.
/** Return the configuration value for the given key.
* If no entry exists for the given key in the configuration, it is created.
*/
/** Return the configuration value for the given key.
@ -84,11 +84,11 @@ public:
String &getOrCreateVal(const String &key) { return _entries.getOrCreateVal(key); }
String &getVal(const String &key) { return _entries.getVal(key); } /*!< Retrieve the value of a @p key. */
const String &getVal(const String &key) const { return _entries.getVal(key); } /*!< @overload */
/**
* Retrieve the value of @p key if it exists and leave the referenced variable unchanged if the key does not exist.
* @return True if the key exists, false otherwise.
* You can use this method if you frequently attempt to access keys that do not exist.
*/
/**
* Retrieve the value of @p key if it exists and leave the referenced variable unchanged if the key does not exist.
* @return True if the key exists, false otherwise.
* You can use this method if you frequently attempt to access keys that do not exist.
*/
const String &getValOrDefault(const String &key) const { return _entries.getValOrDefault(key); }
bool tryGetVal(const String &key, String &out) const { return _entries.tryGetVal(key, out); }
@ -133,7 +133,7 @@ public:
const Domain *getDomain(const String &domName) const; /*!< @overload */
/**
/**
* @name Generic access methods
* @brief No domain specified, use the values from the
* various domains in the order of their priority.
@ -143,7 +143,7 @@ public:
bool hasKey(const String &key) const; /*!< Check if a given @p key exists. */
const String &get(const String &key) const; /*!< Get the value of a @p key. */
void set(const String &key, const String &value); /*!< Assign a @p value to a @p key. */
/** @} */
/** @} */
/**
* Update a configuration entry for the active domain and flush
@ -152,7 +152,7 @@ public:
void setAndFlush(const String &key, const Common::String &value);
#if 1
/**
/**
* @name Domain-specific access methods
* @brief Access one specific domain and modify it.
*
@ -170,7 +170,7 @@ public:
/** @} */
#endif
/**
/**
* @name Additional convenience accessors
* @{
*/

View file

@ -399,7 +399,7 @@ void CoroutineScheduler::waitForSingleObject(CORO_PARAM, int pid, uint32 duratio
}
void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 *pidList, bool bWaitAll,
uint32 duration, bool *expired) {
uint32 duration, bool *expired) {
if (!pCurrent)
error("Called CoroutineScheduler::waitForMultipleObjects from the main process");

View file

@ -363,7 +363,7 @@ private:
Common::List<EVENT *> _events;
#ifdef DEBUG
/** Diagnostic process counters. */
/** Diagnostic process counters. */
int numProcs;
int maxProcs;

View file

@ -65,7 +65,7 @@ enum ErrorCode {
/** Failed to find a MetaEnginePlugin. This should never happen, because all MetaEngines must always
* be built into the executable, regardless if the engine plugins are present or not.
*/
*/
kMetaEnginePluginNotFound,
kEnginePluginNotFound, ///< Failed to find an Engine plugin to handle target.

View file

@ -75,8 +75,8 @@ enum EventType {
/**
* The backend requests the AGI engine's predictive dialog to be shown.
*
* @todo Fingolfin suggests that it would be of better value to expand
*
* @todo Fingolfin suggests that it would be of better value to expand
* on this notion by generalizing its use. For example the backend could
* use events to ask for the save game dialog or to pause the engine.
* An associated enumerated type can accomplish this.
@ -219,7 +219,7 @@ struct Event {
* screen area as defined by the most recent call to initSize().
*/
Point mouse;
/** Refers to an event generated by @ref ArtificialEventSource. */
CustomEventType customType;
@ -287,7 +287,7 @@ class ArtificialEventSource : public EventSource {
protected:
Queue<Event> _artificialEventQueue;
public:
/** Put the specified event into the queue. */
/** Put the specified event into the queue. */
void addEvent(const Event &ev) {
_artificialEventQueue.push(ev);
}
@ -518,7 +518,7 @@ public:
// TODO: Consider removing OSystem::getScreenChangeID and
// replacing it by a generic getScreenChangeID method here
/** Return the @ref Keymapper object. */
/** Return the @ref Keymapper object. */
virtual Keymapper *getKeymapper() = 0;
/** Return the global @ref Keymap object. */
virtual Keymap *getGlobalKeymap() = 0;

View file

@ -174,22 +174,22 @@ FSDirectory::FSDirectory(const FSNode &node, int depth, bool flat, bool ignoreCl
}
FSDirectory::FSDirectory(const String &prefix, const FSNode &node, int depth, bool flat,
bool ignoreClashes, bool includeDirectories)
bool ignoreClashes, bool includeDirectories)
: _node(node), _cached(false), _depth(depth), _flat(flat), _ignoreClashes(ignoreClashes),
_includeDirectories(includeDirectories) {
_includeDirectories(includeDirectories) {
setPrefix(prefix);
}
FSDirectory::FSDirectory(const String &name, int depth, bool flat, bool ignoreClashes, bool includeDirectories)
: _node(name), _cached(false), _depth(depth), _flat(flat), _ignoreClashes(ignoreClashes),
_includeDirectories(includeDirectories) {
_includeDirectories(includeDirectories) {
}
FSDirectory::FSDirectory(const String &prefix, const String &name, int depth, bool flat,
bool ignoreClashes, bool includeDirectories)
bool ignoreClashes, bool includeDirectories)
: _node(name), _cached(false), _depth(depth), _flat(flat), _ignoreClashes(ignoreClashes),
_includeDirectories(includeDirectories) {
_includeDirectories(includeDirectories) {
setPrefix(prefix);
}
@ -264,7 +264,7 @@ FSDirectory *FSDirectory::getSubDirectory(const String &name, int depth, bool fl
}
FSDirectory *FSDirectory::getSubDirectory(const String &prefix, const String &name, int depth,
bool flat, bool ignoreClashes) {
bool flat, bool ignoreClashes) {
if (name.empty() || !_node.isDirectory())
return nullptr;

View file

@ -300,7 +300,7 @@ public:
}
// TODO: insert() method?
/** Return true if hashmap is empty. */
/** Return true if hashmap is empty. */
bool empty() const {
return (_size == 0);
}

View file

@ -33,7 +33,7 @@ namespace Common {
*
* @brief API for managing doubly linked lists.
*
*
*
* @{
*/
@ -176,7 +176,7 @@ public:
return static_cast<Node *>(_anchor._prev)->_data;
}
/** Assign a given @p list to this list. */
/** Assign a given @p list to this list. */
List<t_T> &operator=(const List<t_T> &list) {
if (this != &list) {
iterator i;
@ -197,7 +197,7 @@ public:
return *this;
}
/** Return the size of the list. */
/** Return the size of the list. */
size_type size() const {
size_type n = 0;
for (const NodeBase *cur = _anchor._next; cur != &_anchor; cur = cur->_next)
@ -205,7 +205,7 @@ public:
return n;
}
/** Remove all elements from the list. */
/** Remove all elements from the list. */
void clear() {
NodeBase *pos = _anchor._next;
while (pos != &_anchor) {
@ -218,12 +218,12 @@ public:
_anchor._next = &_anchor;
}
/** Check whether the list is empty. */
/** Check whether the list is empty. */
bool empty() const {
return (&_anchor == _anchor._next);
}
/** Return an iterator to the start of the list.
/** Return an iterator to the start of the list.
* This can be used, for example, to iterate from the first element
* of the list to the last element of the list.
*/
@ -231,7 +231,7 @@ public:
return iterator(_anchor._next);
}
/** Return a reverse iterator to the start of the list.
/** Return a reverse iterator to the start of the list.
* This can be used, for example, to iterate from the last element
* of the list to the first element of the list.
*/
@ -239,12 +239,12 @@ public:
return iterator(_anchor._prev);
}
/** Return an iterator to the end of the list. */
/** Return an iterator to the end of the list. */
iterator end() {
return iterator(&_anchor);
}
/** Return a const iterator to the start of the list.
/** Return a const iterator to the start of the list.
* This can be used, for example, to iterate from the first element
* of the list to the last element of the list.
*/
@ -252,7 +252,7 @@ public:
return const_iterator(_anchor._next);
}
/** Return a const reverse iterator to the start of the list.
/** Return a const reverse iterator to the start of the list.
* This can be used, for example, to iterate from the last element
* of the list to the first element of the list.
*/
@ -260,13 +260,13 @@ public:
return const_iterator(_anchor._prev);
}
/** Return a const iterator to the end of the list. */
/** Return a const iterator to the end of the list. */
const_iterator end() const {
return const_iterator(const_cast<NodeBase *>(&_anchor));
}
protected:
/**
/**
* Erase an element at @p pos.
*/
NodeBase erase(NodeBase *pos) {

View file

@ -111,7 +111,7 @@ inline int intLog2(uint32 v) {
// Input and Output type can be different
template<class InputT, class OutputT>
inline OutputT trunc(InputT x) {
return (x > 0) ? floor(x) : ceil(x);
return (x > 0) ? floor(x) : ceil(x);
}
// Round a number towards zero

View file

@ -50,53 +50,53 @@ struct Point {
Point() : x(0), y(0) {}
/**
* Create a point with position defined by @p x1 and @p y1.
*/
* Create a point with position defined by @p x1 and @p y1.
*/
Point(int16 x1, int16 y1) : x(x1), y(y1) {}
/**
* Determine whether the position of two points is the same.
*/
* Determine whether the position of two points is the same.
*/
bool operator==(const Point &p) const { return x == p.x && y == p.y; }
/**
* Determine whether the position of two points is not the same.
*/
* Determine whether the position of two points is not the same.
*/
bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
/**
* Create a point by adding the @p delta value to a point.
*/
* Create a point by adding the @p delta value to a point.
*/
Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
/**
* Create a point by subtracting the @p delta value from a point.
*/
* Create a point by subtracting the @p delta value from a point.
*/
Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
/**
* Create a point by dividing a point by the (int) @p divisor value.
*/
* Create a point by dividing a point by the (int) @p divisor value.
*/
Point operator/(int divisor) const { return Point(x / divisor, y / divisor); }
/**
* Create a point by multiplying a point by the (int) @p multiplier value.
*/
* Create a point by multiplying a point by the (int) @p multiplier value.
*/
Point operator*(int multiplier) const { return Point(x * multiplier, y * multiplier); }
/**
* Create a point by dividing a point by the (double) @p divisor value.
*/
* Create a point by dividing a point by the (double) @p divisor value.
*/
Point operator/(double divisor) const { return Point(x / divisor, y / divisor); }
/**
* Create a point by multiplying a point by the (double) @p multiplier value.
*/
* Create a point by multiplying a point by the (double) @p multiplier value.
*/
Point operator*(double multiplier) const { return Point(x * multiplier, y * multiplier); }
/**
* Change a point's position by adding @p delta to its x and y coordinates.
*/
/**
* Change a point's position by adding @p delta to its x and y coordinates.
*/
void operator+=(const Point &delta) {
x += delta.x;
y += delta.y;
}
/**
* Change a point's position by subtracting @p delta from its x and y arguments.
*/
/**
* Change a point's position by subtracting @p delta from its x and y arguments.
*/
void operator-=(const Point &delta) {
x -= delta.x;
y -= delta.y;
@ -148,29 +148,29 @@ struct Rect {
Rect() : top(0), left(0), bottom(0), right(0) {}
/**
* Create a rectangle with the top-left corner at position (0, 0) and the given width @p w and height @p h.
*/
* Create a rectangle with the top-left corner at position (0, 0) and the given width @p w and height @p h.
*/
Rect(int16 w, int16 h) : top(0), left(0), bottom(h), right(w) {}
/**
* Create a rectangle with the top-left corner at the given position (x1, y1)
* Create a rectangle with the top-left corner at the given position (x1, y1)
* and the bottom-right corner at the position (x2, y2).
*
* The @p x2 value must be greater or equal @p x1 and @p y2 must be greater or equal @p y1.
*/
*/
Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) {
assert(isValidRect());
}
/**
* Check if two rectangles are identical.
* Check if two rectangles are identical.
*
* @return True if the rectangles are identical, false otherwise.
*/
*/
bool operator==(const Rect &rhs) const { return equals(rhs); }
/**
* Check if two rectangles are different.
/**
* Check if two rectangles are different.
*
* @return True if the rectangles are different, false otherwise.
*/
*/
bool operator!=(const Rect &rhs) const { return !equals(rhs); }
int16 width() const { return right - left; } /*!< Return the width of a rectangle. */
@ -316,14 +316,14 @@ struct Rect {
return (left >= right || top >= bottom);
}
/**
/**
* Check if this is a valid rectangle.
*/
bool isValidRect() const {
return (left <= right && top <= bottom);
}
/**
/**
* Move this rectangle to the position defined by @p x, @p y.
*/
void moveTo(int16 x, int16 y) {
@ -341,14 +341,14 @@ struct Rect {
top += dy; bottom += dy;
}
/**
/**
* Move this rectangle to the position of the point @p p.
*/
void moveTo(const Point &p) {
moveTo(p.x, p.y);
}
/**
/**
* Print debug messages related to this class.
*/
void debugPrint(int debuglevel = 0, const char *caption = "Rect:") const {

View file

@ -40,14 +40,14 @@ namespace Common {
};
}
/**
* @defgroup common_safe_bool Safe Boolean
* @ingroup common
*
* @brief Template for a SafeBool function.
*
* @{
*/
/**
* @defgroup common_safe_bool Safe Boolean
* @ingroup common
*
* @brief Template for a SafeBool function.
*
* @{
*/
/**
* Prevents `operator bool` from implicitly converting to other types.

View file

@ -60,14 +60,14 @@ public:
OutSaveFile(WriteStream *w); /*!< Create an OutSaveFile that uses the given WriteStream to write the data. */
virtual ~OutSaveFile();
/**
/**
* Return true if an I/O failure occurred.
* This flag is never cleared automatically. In order to clear it,
* you must call clearErr() explicitly.
*/
virtual bool err() const;
/**
/**
* Reset the I/O error status as returned by err().
*/
virtual void clearErr();
@ -93,11 +93,11 @@ public:
virtual bool flush();
/**
* Write data into the stream.
* Write data into the stream.
*
* @param dataPtr Pointer to the data to be written.
* @param dataSize Number of bytes to be written.
*/
*/
virtual uint32 write(const void *dataPtr, uint32 dataSize);
/**

View file

@ -777,7 +777,7 @@ getReverseConversionTable(CodePage page) {
}
void U32String::decodeOneByte(const char *src, uint32 len, CodePage page) {
const uint16 *conversionTable = getConversionTable(page);
const uint16 *conversionTable = getConversionTable(page);
if (conversionTable == nullptr) {
conversionTable = kASCIIConversionTable;

View file

@ -635,7 +635,7 @@ public:
virtual const GraphicsMode *getSupportedGraphicsModes() const {
static const GraphicsMode noGraphicsModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
return noGraphicsModes;
}
}
/**
* Return the ID of the 'default' graphics mode. What exactly this means
@ -1517,7 +1517,7 @@ public:
* @param icon The icon to display on the screen.
*/
virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) = 0;
/** @} */
/** @} */
/**
* @addtogroup common_system_module
@ -1584,7 +1584,7 @@ public:
* @return The FSNode factory for the current architecture.
*/
virtual FilesystemFactory *getFilesystemFactory();
/** @} */
/** @} */
/**
* @addtogroup common_system_misc

View file

@ -78,7 +78,7 @@ typedef Array<TLanguage> TLangArray;
struct PoMessageEntry {
int msgid; /*!< ID of the message. */
String msgctxt; /*!< Context of the message. It can be empty.
Can be used to solve ambiguities. */
Can be used to solve ambiguities. */
U32String msgstr; /*!< Message string. */
};

View file

@ -96,9 +96,9 @@ typedef long z_off_t;
typedef unsigned char Byte;
typedef Byte Bytef;
typedef struct {
Bytef *next_in, *next_out;
uInt avail_in, avail_out;
uLong total_out;
Bytef *next_in, *next_out;
uInt avail_in, avail_out;
uLong total_out;
} z_stream;
#endif // !USE_ZLIB
@ -149,23 +149,23 @@ typedef struct {
/* unz_file_info contain information about a file in the zipfile */
typedef struct {
uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */
uLong flag; /* general purpose bit flag 2 bytes */
uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
uLong compressed_size; /* compressed size 4 bytes */
uLong uncompressed_size; /* uncompressed size 4 bytes */
uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */
uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */
uLong flag; /* general purpose bit flag 2 bytes */
uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
uLong compressed_size; /* compressed size 4 bytes */
uLong uncompressed_size; /* uncompressed size 4 bytes */
uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */
uLong disk_num_start; /* disk number start 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
uLong disk_num_start; /* disk number start 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
tm_unz tmu_date;
tm_unz tmu_date;
} unz_file_info;
int unzStringFileNameCompare(const char* fileName1,
@ -183,11 +183,11 @@ int unzStringFileNameCompare(const char* fileName1,
/*
Open a Zip file. path contain the full pathname (by example,
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
"zlib/zlib111.zip".
If the zipfile cannot be opened (file don't exist or in not valid), the
return value is NULL.
Else, the return value is a unzFile Handle, usable with other function
Else, the return value is a unzFile Handle, usable with other function
of this unzip package.
*/
@ -195,7 +195,7 @@ int unzClose(unzFile file);
/*
Close a ZipFile opened with unzipOpen.
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
return UNZ_OK if there is no problem. */
int unzGetGlobalInfo(unzFile file,
@ -289,7 +289,7 @@ int unzReadCurrentFile(unzFile file, voidp buf, unsigned len);
return the number of byte copied if somes bytes are copied
return 0 if the end of file was reached
return <0 with error code if there is an error
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
*/
z_off_t unztell(unzFile file);
@ -306,7 +306,7 @@ int unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len);
/*
Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is
more info in the local-header version than in the central-header)
more info in the local-header version than in the central-header)
if buf==NULL, it return the size of the local extra field
@ -317,7 +317,7 @@ int unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len);
*/
#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \
!defined(CASESENSITIVITYDEFAULT_NO)
!defined(CASESENSITIVITYDEFAULT_NO)
#define CASESENSITIVITYDEFAULT_NO
#endif
@ -341,12 +341,12 @@ const char unz_copyright[] =
/* unz_file_info_interntal contain internal info about a file in zipfile*/
typedef struct {
uLong offset_curfile;/* relative offset of local header 4 bytes */
uLong offset_curfile;/* relative offset of local header 4 bytes */
} unz_file_info_internal;
/* file_in_zip_read_info_s contain internal information about a file in zipfile,
when reading and decompress it */
when reading and decompress it */
typedef struct {
char *read_buffer; /* internal buffer for compressed data */
z_stream stream; /* zLib stream structure for inflate */
@ -401,22 +401,22 @@ typedef struct {
} unz_s;
/* ===========================================================================
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
for end of file.
IN assertion: the stream s has been successfully opened for reading.
*/
/*static int unzlocal_getByte(Common::SeekableReadStream &fin, int *pi) {
unsigned char c = fin.readByte();
*pi = (int)c;
return UNZ_OK;
} else {
if (fin.err())
return UNZ_ERRNO;
else
return UNZ_EOF;
}
unsigned char c = fin.readByte();
*pi = (int)c;
return UNZ_OK;
} else {
if (fin.err())
return UNZ_ERRNO;
else
return UNZ_EOF;
}
}*/
@ -444,9 +444,9 @@ static int unzlocal_getLong(Common::SeekableReadStream *fin, uLong *pX) {
Compare two filename (fileName1,fileName2).
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
or strcasecmp)
or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
(like 1 on Unix, 2 on Windows)
(like 1 on Unix, 2 on Windows)
*/
int unzStringFileNameCompare(const char* fileName1, const char* fileName2, int iCaseSensitivity) {
@ -463,7 +463,7 @@ int unzStringFileNameCompare(const char* fileName1, const char* fileName2, int i
/*
Locate the Central directory of a zipfile (at the end, just before
the global comment)
the global comment)
*/
static uLong unzlocal_SearchCentralDir(Common::SeekableReadStream &fin) {
unsigned char* buf;
@ -494,7 +494,7 @@ static uLong unzlocal_SearchCentralDir(Common::SeekableReadStream &fin) {
uReadPos = uSizeFile-uBackRead;
uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
(BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
(BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
fin.seek(uReadPos, SEEK_SET);
if (fin.err())
break;
@ -502,7 +502,7 @@ static uLong unzlocal_SearchCentralDir(Common::SeekableReadStream &fin) {
if (fin.read(buf,(uInt)uReadSize)!=uReadSize)
break;
for (i=(int)uReadSize-3; (i--)>0;)
for (i=(int)uReadSize-3; (i--)>0;)
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
{
@ -519,11 +519,11 @@ static uLong unzlocal_SearchCentralDir(Common::SeekableReadStream &fin) {
/*
Open a Zip file. path contain the full pathname (by example,
on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer
on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer
"zlib/zlib109.zip".
If the zipfile cannot be opened (file don't exist or in not valid), the
return value is NULL.
Else, the return value is a unzFile Handle, usable with other function
Else, the return value is a unzFile Handle, usable with other function
of this unzip package.
*/
unzFile unzOpen(Common::SeekableReadStream *stream) {
@ -633,7 +633,7 @@ unzFile unzOpen(Common::SeekableReadStream *stream) {
/*
Close a ZipFile opened with unzipOpen.
If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
return UNZ_OK if there is no problem. */
int unzClose(unzFile file) {
unz_s *s;
@ -683,22 +683,22 @@ static void unzlocal_DosDateToTmuDate(uLong ulDosDate, tm_unz* ptm) {
Get Info about the current file in the zipfile, with internal only info
*/
static int unzlocal_GetCurrentFileInfoInternal(unzFile file,
unz_file_info *pfile_info,
unz_file_info_internal
*pfile_info_internal,
char *szFileName,
unz_file_info *pfile_info,
unz_file_info_internal
*pfile_info_internal,
char *szFileName,
uLong fileNameBufferSize,
void *extraField,
void *extraField,
uLong extraFieldBufferSize,
char *szComment,
char *szComment,
uLong commentBufferSize);
static int unzlocal_GetCurrentFileInfoInternal(unzFile file,
unz_file_info *pfile_info,
unz_file_info_internal *pfile_info_internal,
char *szFileName, uLong fileNameBufferSize,
void *extraField, uLong extraFieldBufferSize,
char *szComment, uLong commentBufferSize)
unz_file_info *pfile_info,
unz_file_info_internal *pfile_info_internal,
char *szFileName, uLong fileNameBufferSize,
void *extraField, uLong extraFieldBufferSize,
char *szComment, uLong commentBufferSize)
{
unz_s* s;
unz_file_info file_info;
@ -848,10 +848,10 @@ static int unzlocal_GetCurrentFileInfoInternal(unzFile file,
return UNZ_OK if there is no problem.
*/
int unzGetCurrentFileInfo(unzFile file,
unz_file_info *pfile_info,
char *szFileName, uLong fileNameBufferSize,
void *extraField, uLong extraFieldBufferSize,
char *szComment, uLong commentBufferSize)
unz_file_info *pfile_info,
char *szFileName, uLong fileNameBufferSize,
void *extraField, uLong extraFieldBufferSize,
char *szComment, uLong commentBufferSize)
{
return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,nullptr,
szFileName,fileNameBufferSize,
@ -947,9 +947,9 @@ int unzLocateFile(unzFile file, const char *szFileName, int iCaseSensitivity) {
/*
Read the local header of the current zipfile
Check the coherency of the local header and info in the end of central
directory about this file
directory about this file
store in *piSizeVar the size of extra info in local header
(filename and size of extra field data)
(filename and size of extra field data)
*/
static int unzlocal_CheckCurrentFileCoherencyHeader(unz_s* s, uInt* piSizeVar,
uLong *poffset_local_extrafield,
@ -1133,7 +1133,7 @@ int unzOpenCurrentFile (unzFile file) {
return the number of byte copied if somes bytes are copied
return 0 if the end of file was reached
return <0 with error code if there is an error
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
*/
int unzReadCurrentFile(unzFile file, voidp buf, unsigned len) {
int err=UNZ_OK;
@ -1295,7 +1295,7 @@ int unzeof(unzFile file) {
/*
Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is
more info in the local-header version than in the central-header)
more info in the local-header version than in the central-header)
if buf==NULL, it return the size of the local extra field that can be read

View file

@ -186,9 +186,9 @@ public:
private:
void decodeInternal(const char *str, uint32 len, CodePage page);
void decodeOneByte(const char *str, uint32 len, CodePage page);
void decodeWindows932(const char *src, uint32 len);
void decodeWindows932(const char *src, uint32 len);
void decodeWindows949(const char *src, uint32 len);
void decodeWindows950(const char *src, uint32 len);
void decodeWindows950(const char *src, uint32 len);
void decodeUTF8(const char *str, uint32 len);
friend class String;

View file

@ -40,7 +40,7 @@
* Note that 'alignment' must be a power of two!
*/
#define IS_ALIGNED(value, alignment) \
((((size_t)value) & ((alignment) - 1)) == 0)
((((size_t)value) & ((alignment) - 1)) == 0)
#ifdef ABS
#undef ABS

View file

@ -32,13 +32,13 @@
#if defined(USE_ZLIB)
#ifdef __SYMBIAN32__
#include <zlib\zlib.h>
#include <zlib\zlib.h>
#elif defined(__MORPHOS__)
#define _NO_PPCINLINE
#include <zlib.h>
#undef _NO_PPCINLINE
#else
#include <zlib.h>
#include <zlib.h>
#endif
#if ZLIB_VERNUM < 0x1204

View file

@ -43,11 +43,11 @@ struct Parts {
};
#define DEFINE_GAME_PLATFORM_LANG_FUNCS(game, platform, lang) \
size_t write ## game ## _ ## platform ## _ ## lang ## _Header(FILE *f, \
uint32 offset, uint32 size); \
size_t write ## game ## _ ## platform ## _ ## lang ## _Data(FILE *f);
size_t write ## game ## _ ## platform ## _ ## lang ## _Header(FILE *f, \
uint32 offset, uint32 size); \
size_t write ## game ## _ ## platform ## _ ## lang ## _Data(FILE *f);
#define GAME_PLATFORM_LANG_PART(game, platform, lang) { write ## game ## _ ## platform ## _ ## lang ## _Header, \
write ## game ## _ ## platform ## _ ## lang ## _Data, 0, 0 }
write ## game ## _ ## platform ## _ ## lang ## _Data, 0, 0 }
DEFINE_GAME_PLATFORM_LANG_FUNCS(Versailles, ALL, FR)
DEFINE_GAME_PLATFORM_LANG_FUNCS(Versailles, ALL, BR)
@ -86,7 +86,7 @@ size_t writeFileHeader(FILE *f, uint16 games) {
}
size_t writeGameHeader(FILE *f, uint32 gameId, uint16 version, uint16 lang, uint32 platforms,
uint32 offset, uint32 size) {
uint32 offset, uint32 size) {
size_t headerSize = 0;
headerSize += writeUint32BE(f, gameId); // BE to keep the tag readable
headerSize += writeUint16LE(f, version);

View file

@ -29,7 +29,7 @@
size_t writeFileHeader(FILE *f, uint16 games = 0xdead);
size_t writeGameHeader(FILE *f, uint32 gameId, uint16 version, uint16 lang, uint32 platforms,
uint32 offset = 0xdeadfeed, uint32 size = 0xdeadfeed);
uint32 offset = 0xdeadfeed, uint32 size = 0xdeadfeed);
#define PLATFORM_WIN 0x1
#define PLATFORM_DOS 0x2

View file

@ -59,67 +59,67 @@ size_t writeVersaillesSubtitles16(FILE *fp, Subtitle const *subtitles, uint16 el
// In Versailles platform doesn't seem to change anything
#define DEFINE_FUNCS(lang) \
size_t writeVersailles_ALL_ ## lang ## _Header(FILE *f, uint32 offset, uint32 size) { \
return writeGameHeader(f, VERSAILLES_GAMEID, VERSAILLES_VERSION, LANG_ ## lang, PLATFORM_ALL, \
offset, size); \
} \
\
size_t writeVersailles_ALL_ ## lang ## _Data(FILE *f) { \
size_t size = 0; \
\
assert(VERSAILLES_LOCALIZED_FILENAMES_COUNT == ARRAYSIZE(versailles ## lang ## localizedFilenames)); \
size += writeString16Array16(f, versailles ## lang ## localizedFilenames, \
VERSAILLES_LOCALIZED_FILENAMES_COUNT); \
\
size += writeString16(f, versailles ## lang ## EpilMsg); \
size += writeString16(f, versailles ## lang ## EpilPwd); \
\
size += writeString16(f, versailles ## lang ## BombPwd); \
\
assert(VERSAILLES_MESSAGES_COUNT == ARRAYSIZE(versailles ## lang ## messages)); \
size += writeString16Array16(f, versailles ## lang ## messages, ARRAYSIZE(versailles ## lang ## messages)); \
\
assert(VERSAILLES_PAINTINGS_COUNT == ARRAYSIZE(versailles ## lang ## paintings)); \
size += writeString16Array16(f, versailles ## lang ## paintings, ARRAYSIZE(versailles ## lang ## paintings)); \
\
size += writePadding(f); \
return size; \
}
size_t writeVersailles_ALL_ ## lang ## _Header(FILE *f, uint32 offset, uint32 size) { \
return writeGameHeader(f, VERSAILLES_GAMEID, VERSAILLES_VERSION, LANG_ ## lang, PLATFORM_ALL, \
offset, size); \
} \
\
size_t writeVersailles_ALL_ ## lang ## _Data(FILE *f) { \
size_t size = 0; \
\
assert(VERSAILLES_LOCALIZED_FILENAMES_COUNT == ARRAYSIZE(versailles ## lang ## localizedFilenames)); \
size += writeString16Array16(f, versailles ## lang ## localizedFilenames, \
VERSAILLES_LOCALIZED_FILENAMES_COUNT); \
\
size += writeString16(f, versailles ## lang ## EpilMsg); \
size += writeString16(f, versailles ## lang ## EpilPwd); \
\
size += writeString16(f, versailles ## lang ## BombPwd); \
\
assert(VERSAILLES_MESSAGES_COUNT == ARRAYSIZE(versailles ## lang ## messages)); \
size += writeString16Array16(f, versailles ## lang ## messages, ARRAYSIZE(versailles ## lang ## messages)); \
\
assert(VERSAILLES_PAINTINGS_COUNT == ARRAYSIZE(versailles ## lang ## paintings)); \
size += writeString16Array16(f, versailles ## lang ## paintings, ARRAYSIZE(versailles ## lang ## paintings)); \
\
size += writePadding(f); \
return size; \
}
#define DEFINE_FUNCS_CJK(lang) \
size_t writeVersailles_ALL_ ## lang ## _Header(FILE *f, uint32 offset, uint32 size) { \
return writeGameHeader(f, VERSAILLES_GAMEID, VERSAILLES_VERSION, LANG_ ## lang, PLATFORM_ALL, \
offset, size); \
} \
\
size_t writeVersailles_ALL_ ## lang ## _Data(FILE *f) { \
size_t size = 0; \
\
assert(VERSAILLES_LOCALIZED_FILENAMES_COUNT == ARRAYSIZE(versailles ## lang ## localizedFilenames)); \
size += writeString16Array16(f, versailles ## lang ## localizedFilenames, \
VERSAILLES_LOCALIZED_FILENAMES_COUNT); \
\
size += writeString16(f, versailles ## lang ## EpilMsg); \
size += writeString16(f, versailles ## lang ## EpilPwd); \
\
if ((LANG_ ## lang == LANG_JA)) { \
assert(VERSAILLES_JA_BOMB_ALPHABET_SIZE + 1 == sizeof(versaillesJABombAlphabet)); \
size += writeString16(f, versaillesJABombAlphabet); \
} \
size += writeString16(f, versailles ## lang ## BombPwd); \
\
assert(VERSAILLES_MESSAGES_COUNT_CJK == ARRAYSIZE(versailles ## lang ## messages)); \
size += writeString16Array16(f, versailles ## lang ## messages, ARRAYSIZE(versailles ## lang ## messages)); \
\
assert(VERSAILLES_PAINTINGS_COUNT == ARRAYSIZE(versailles ## lang ## paintings)); \
size += writeString16Array16(f, versailles ## lang ## paintings, ARRAYSIZE(versailles ## lang ## paintings)); \
\
/* No need to assert as we don't expect a fixed count in engine */ \
size += writeVersaillesSubtitles16(f, versailles ## lang ## subtitles, ARRAYSIZE(versailles ## lang ## subtitles)); \
\
size += writePadding(f); \
return size; \
}
size_t writeVersailles_ALL_ ## lang ## _Header(FILE *f, uint32 offset, uint32 size) { \
return writeGameHeader(f, VERSAILLES_GAMEID, VERSAILLES_VERSION, LANG_ ## lang, PLATFORM_ALL, \
offset, size); \
} \
\
size_t writeVersailles_ALL_ ## lang ## _Data(FILE *f) { \
size_t size = 0; \
\
assert(VERSAILLES_LOCALIZED_FILENAMES_COUNT == ARRAYSIZE(versailles ## lang ## localizedFilenames)); \
size += writeString16Array16(f, versailles ## lang ## localizedFilenames, \
VERSAILLES_LOCALIZED_FILENAMES_COUNT); \
\
size += writeString16(f, versailles ## lang ## EpilMsg); \
size += writeString16(f, versailles ## lang ## EpilPwd); \
\
if ((LANG_ ## lang == LANG_JA)) { \
assert(VERSAILLES_JA_BOMB_ALPHABET_SIZE + 1 == sizeof(versaillesJABombAlphabet)); \
size += writeString16(f, versaillesJABombAlphabet); \
} \
size += writeString16(f, versailles ## lang ## BombPwd); \
\
assert(VERSAILLES_MESSAGES_COUNT_CJK == ARRAYSIZE(versailles ## lang ## messages)); \
size += writeString16Array16(f, versailles ## lang ## messages, ARRAYSIZE(versailles ## lang ## messages)); \
\
assert(VERSAILLES_PAINTINGS_COUNT == ARRAYSIZE(versailles ## lang ## paintings)); \
size += writeString16Array16(f, versailles ## lang ## paintings, ARRAYSIZE(versailles ## lang ## paintings)); \
\
/* No need to assert as we don't expect a fixed count in engine */ \
size += writeVersaillesSubtitles16(f, versailles ## lang ## subtitles, ARRAYSIZE(versailles ## lang ## subtitles)); \
\
size += writePadding(f); \
return size; \
}
DEFINE_FUNCS(FR)
DEFINE_FUNCS(BR)

View file

@ -126,123 +126,123 @@ static char const versaillesZTEpilPwd[] = "FOXANDCRANE";
static char const versaillesFRBombPwd[] = "JEMENVAISMAISLETATDEMEURERATOUJOURS";
static char const versaillesBRBombPwd[] = "O PODER DE UM REI NAO O TORNA IMORTAL";
static char const versaillesDEBombPwd[] =
"MONARCHEN IST ES NICHT GEGEBEN VOLLKOMMENHEIT ZU ERREICHEN";
"MONARCHEN IST ES NICHT GEGEBEN VOLLKOMMENHEIT ZU ERREICHEN";
static char const versaillesENBombPwd[] = "IT IS NOT IN THE POWER OF KINGS TO ATTAIN PERFECTION";
static char const versaillesESBombPwd[] = "NO ES PODER DE REYES EL ALCANZAR LA PERFECCION";
static char const versaillesITBombPwd[] = "AI SOVRANI NON E DATO RAGGIUNGERE LA PERFEZIONE";
static char const versaillesJABombPwd[] = "\203V\203A\203K\203\212\203m\203_\203\223\203J\203C"
"\203j\203C\203^\203c\203^\203m\203K\203R\203N\203I\203E\203^\203`\203j\203`\203J\203\211\203K"
"\203A\203\213\203R\203g\203j\203i\203\211\203i\203C\203m\203_";
"\203j\203C\203^\203c\203^\203m\203K\203R\203N\203I\203E\203^\203`\203j\203`\203J\203\211\203K"
"\203A\203\213\203R\203g\203j\203i\203\211\203i\203C\203m\203_";
static char const versaillesKOBombPwd[] = "IT IS NOT IN THE POWER OF KINGS TO ATTAIN PERFECTION";
static char const versaillesZTBombPwd[] = "IT IS NOT IN THE POWER OF KINGS TO ATTAIN PERFECTION";
#define VERSAILLES_JA_BOMB_ALPHABET_SIZE 2490
static char const versaillesJABombAlphabet[] =
"\202\323\202\255\202\353\202\244\202\306\221\274\202\314\222\271\202\275\202\277\210\253\202\242"
"\202\323\202\255\202\353\202\244\202\252\222\213\212\324\201A\222\271\202\275\202\277\202\360"
"\212l\202\350\202\311\217o\202\251\202\257\222\271\202\275\202\277\202\315\217W\202\334"
"\202\301\202\304\211\236\220\355\217X\202\255\202\267\202\254\202\270\224\374\202\265\202\267"
"\202\254\202\270\223\313\202\301\202\302\202\253\201A\220\330\202\350\227\364\202\253\201A"
"\215\217\202\361\202\305\202\277\202\254\202\351\227Y\214{\202\306\203_\203C\203A"
"\203\202\203\223\203h\227Y\214{\202\252\201A\345v\222\216\202\360\222T\202\265"
"\202\304\222n\226\312\202\360\214@\202\301\202\304\202\242\202\351\202\306\203_\203C"
"\203A\203\202\203\223\203h\202\360\214@\202\350\223\226\202\304\202\275\227Y\214{"
"\202\252\214\276\202\244\202\311\202\315\201A\202\261\202\361\202\310\220\316\202\261\202\353"
"\202\252\211\275\202\314\226\360\202\311\202\275\202\302\201H\224a\202\314\202\331\202\244"
"\202\252\202\334\202\276\202\334\202\265\202\310\202\314\202\311\224L\202\306\203l\203Y"
"\203~\224L\202\252\216\200\202\361\202\276\202\323\202\350\202\360\202\265\202\304\203l"
"\203Y\203~\202\360\202\275\202\255\202\263\202\361\225\337\202\334\202\246\202\275\202\340"
"\202\301\202\306\225\337\202\334\202\246\202\346\202\244\202\306\201A\217\254\224\236\225\262"
"\202\311\202\334\202\335\202\352\202\304\211B\202\352\202\304\202\242\202\351\202\306\224N"
"\212\361\202\350\203l\203Y\203~\202\252\225@\202\360\202\255\202\361\202\255\202\361"
"\224L\202\346\202\350\217\254\224\236\225\262\202\314\202\331\202\244\202\252\202\250\202\242"
"\202\265\202\273\202\244\202\276\227\263\202\306\202\342\202\267\202\350\227\263\202\252\202\342"
"\202\267\202\350\202\360\202\251\202\266\202\301\202\304\202\242\202\351\202\306\202\342\202\267"
"\202\350\202\252\220\324\226\332\202\314\227\263\202\311\220q\202\313\202\275\202\310\202\272"
"\214\343\220\346\202\340\215l\202\246\202\270\201A\341\222\341\233\202\360\213N\202\261"
"\202\265\202\304\226l\202\360\202\251\202\266\202\351\202\314\201H\214\253\202\242\202\240"
"\202\310\202\275\202\314\216\225\202\252\202\310\202\255\202\310\202\301\202\304\202\265\202\334"
"\202\244\202\346\202\253\202\302\202\313\202\306\222\337\202\253\202\302\202\313\202\252\222\337"
"\202\360\220H\216\226\202\311\217\265\202\242\202\304\225\275\202\327\202\301\202\275\202\242"
"\216M\202\311\223\374\202\352\202\304\217o\202\265\202\275\216\251\225\252\202\315\202\346"
"\202\276\202\352\202\360\202\275\202\347\202\265\202\310\202\252\202\347\216M\202\360\202\330"
"\202\353\202\330\202\353\232{\202\314\222\267\202\242\222\337\202\315\202\275\202\276\202\267"
"\202\267\202\351\202\276\202\257\201B\222\337\202\306\202\253\202\302\202\313\202\261\202\361"
"\202\307\202\315\222\337\202\252\202\253\202\302\202\313\202\360\217\265\202\242\202\304\215\327"
"\222\267\202\242\202\302\202\332\202\311\223\374\202\352\202\304\217o\202\265\202\275\222\337"
"\202\315\202\250\225\240\210\352\224t\220H\202\327\202\275\202\350\210\371\202\361\202\276"
"\202\350\202\251\202\255\202\265\202\304\225\234\217Q\202\315\220\213\202\260\202\347\202\352"
"\202\275\201B\216\223\214{\202\306\203q\203\210\203R\202\275\202\277\202\306\202\361"
"\202\321\202\252\227\326\202\360\202\251\202\242\202\304\224\362\202\361\202\305\202\242\202\351"
"\202\314\202\360\214\251\202\302\202\257\202\275\216\223\214{\202\240\202\355\202\304\202\304"
"\203q\203\210\203R\202\275\202\277\202\360\214{\217\254\211\256\202\326\202\265\202\251"
"\202\265\216\251\225\252\202\252\220H\202\327\202\347\202\352\202\304\202\240\202\355\202\352"
"\202\310\203q\203\210\203R\202\275\202\277\202\315\212O\202\326\202\340\217o\202\347"
"\202\352\202\270\201A\225\302\202\266\202\261\202\337\202\347\202\352\202\275\202\334\202\334"
"\230V\202\242\202\304\202\242\202\255\201B\230T\202\306\222\337\230T\202\252\215\234"
"\202\360\202\314\202\335\202\261\202\361\202\305\201A\202\314\202\307\202\311\216h\202\263"
"\202\301\202\304\222\311\202\255\202\304\202\275\202\334\202\347\202\310\202\242\202\273\202\261"
"\202\305\222\337\202\311\201A\202\250\212\350\202\242\202\276\202\251\202\347\202\261\202\314"
"\215\234\202\360\202\306\202\301\202\304\202\277\202\345\202\244\202\276\202\242\201A\202\273"
"\202\314\202\251\202\355\202\350\215\234\202\360\202\306\202\301\202\304\202\340\202\347\202\301"
"\202\304\202\340\214N\202\314\202\261\202\306\202\360\220H\202\327\202\275\202\350\202\265"
"\202\310\202\242\202\251\202\347\230T\202\315\201A\202\273\202\244\214\276\202\242\202\310"
"\202\252\202\347\202\340\202\323\202\255\202\352\202\301\226\312\221\351\202\306\217\254\222\271"
"\202\275\202\277\221\351\202\252\217\254\222\271\202\275\202\277\202\360\220H\216\226\202\311"
"\217\265\202\242\202\275\222a\220\266\223\372\202\314\202\250\217j\202\242\202\360\202\267"
"\202\351\202\251\202\347\221\201\202\255\227\210\202\304\211\272\202\263\202\242\217\254\222\271"
"\202\275\202\277\202\252\217W\202\334\202\301\202\304\217j\202\242\202\314\220\310\202\311"
"\202\302\202\255\202\306\221\351\202\315\202\267\202\256\202\263\202\334\217P\202\242\202\251"
"\202\251\202\350\201A\202\262\202\277\202\273\202\244\202\311\202\240\202\350\202\302\202\242"
"\202\275\202\251\202\246\202\351\202\306\203W\203\205\203s\203^\201[\211\244\227l"
"\202\276\202\346\201A\202\306\203W\203\205\203s\203^\201[\202\252\202\255\202\352"
"\202\275\212\333\221\276\202\315\221\345\202\265\202\275\225\250\202\266\202\341\202\310\202\251"
"\202\301\202\275\202\306\202\251\202\246\202\351\202\275\202\277\202\315\203K\201[\203K"
"\201[\225\266\213\345\202\316\202\251\202\350\202\273\202\261\202\305\203W\203\205\203s"
"\203^\201[\202\315\203R\203E\203m\203g\203\212\202\360\202\302\202\251\202\355"
"\202\265\202\304\202\251\202\246\202\351\202\275\202\277\202\360\202\335\202\361\202\310\220H"
"\202\327\202\263\202\271\202\275\230h\202\306\202\244\202\263\202\254\202\306\202\251\202\324"
"\202\306\222\216\230h\202\252\202\244\202\263\202\254\202\360\202\302\202\251\202\334\202\246"
"\202\275\202\244\202\263\202\254\202\314\227F\222B\202\314\202\251\202\324\202\306\222\216"
"\202\252\201A\202\307\202\244\202\251\202\244\202\263\202\254\202\360\217\225\202\257\202\304"
"\202\342\202\301\202\304\211\272\202\263\202\242\202\265\202\251\202\265\230h\202\315\202\244"
"\202\263\202\254\202\360\220H\202\327\202\304\202\265\202\334\202\242\202\251\202\324\202\306"
"\222\216\202\315\230h\202\360\215\246\202\361\202\305\201A\230h\202\314\216Y\202\361"
"\202\276\227\221\202\360\221S\225\224\225\262\201X\202\311\215\323\202\242\202\304\202\265"
"\202\334\202\301\202\275\203l\203Y\203~\202\306\224L\202\306\217\254\202\263\202\310"
"\227Y\214{\216q\203l\203Y\203~\202\252\202\250\225\352\202\263\202\361\202\311"
"\201A\202\332\202\255\202\315\227Y\214{\202\315\202\253\202\347\202\242\202\276\202\257"
"\202\307\224L\202\315\221\345\215D\202\253\202\267\202\351\202\306\202\250\225\352\202\263"
"\202\361\202\315\201A\211\275\202\360\214\276\202\244\202\314\202\250\202\277\202\321\202\277"
"\202\341\202\361\201A\224L\202\315\216\204\202\275\202\277\202\360\220H\202\327\202\304"
"\202\240\202\361\202\310\202\311\221\276\202\301\202\304\202\251\202\301\202\261\202\346\202\255"
"\202\310\202\301\202\275\202\314\202\346\202\305\202\340\227Y\214{\202\252\202\342\202\271"
"\202\304\212i\215D\202\252\210\253\202\242\202\314\202\315\201A\216\204\202\275\202\277"
"\203l\203Y\203~\202\360\202\302\202\251\202\334\202\246\202\347\202\352\202\310\202\242"
"\202\251\202\347\202\310\202\314\202\346\224\222\222\271\202\306\203R\203E\203m\203g"
"\203\212\224\222\222\271\202\252\220\205\225\323\202\305\224\374\202\265\202\242\220\272\202\305"
"\211\314\202\301\202\304\202\242\202\351\202\306\202\307\202\244\202\265\202\304\211\314\202\301"
"\202\304\202\242\202\351\202\314\201H\202\306\222m\202\350\202\275\202\252\202\350\211\256"
"\202\314\203R\203E\203m\203g\203\212\202\276\202\301\202\304\216\204\202\315\202\340"
"\202\244\202\267\202\256\216\200\202\312\202\361\202\276\202\301\202\304\214\374\202\261\202\244"
"\202\251\202\347\202\242\202\242\222m\202\347\202\271\202\252\223\315\202\242\202\275\202\361"
"\202\305\202\267\202\340\202\314\202\250\202\250\202\251\202\335\202\306\222\244\221\234\214\216"
"\202\314\214\365\202\305\201A\222\244\221\234\202\252\223\256\202\242\202\275\202\346\202\244"
"\202\311\214\251\202\246\202\275\202\314\202\305\201A\202\250\202\250\202\251\202\335\202\315"
"\225\337\202\334\202\246\202\346\202\244\202\306\220g\215\\\202\246\202\275\202\305\202\340"
"\216c\224O\202\310\202\252\202\347\222\244\221\234\202\311\202\315\220\316\202\314\221\314"
"\202\360\223\256\202\251\202\267\202\275\202\337\202\314\220S\202\340\202\310\202\242\202\265"
"\212\264\217\356\202\340\202\310\202\242\201A\215l\202\246\202\340\217\356\224M\202\340"
"\201A\210\244\202\340\202\310\202\242\202\240\202\320\202\351\202\306\203X\203p\203j"
"\203G\203\213\214\242\203X\203p\203j\203G\203\213\214\242\202\252\226\260\202\301"
"\202\304\202\242\202\351\203A\203q\203\213\202\311\202\251\202\335\202\302\202\261\202\244"
"\202\306\202\267\202\351\202\306\203A\203q\203\213\202\315\202\267\202\316\202\342\202\255"
"\223\246\202\260\202\304\203K\201[\203K\201[\226\302\202\253\202\310\202\252\202\347"
"\214\242\202\360\202\261\202\244\224l\202\301\202\275\216\251\225\252\202\314\216\350\202\311"
"\223\315\202\251\202\310\202\242\202\340\202\314\202\360\222\307\202\242\202\251\202\257\202\351"
"\202\310\202\361\202\304\201A\214N\202\315\211\275\202\304\202\244\202\312\202\332\202\352"
"\202\342\202\305\202\250\202\353\202\251\216\322\202\310\202\361\202\276";
"\202\323\202\255\202\353\202\244\202\306\221\274\202\314\222\271\202\275\202\277\210\253\202\242"
"\202\323\202\255\202\353\202\244\202\252\222\213\212\324\201A\222\271\202\275\202\277\202\360"
"\212l\202\350\202\311\217o\202\251\202\257\222\271\202\275\202\277\202\315\217W\202\334"
"\202\301\202\304\211\236\220\355\217X\202\255\202\267\202\254\202\270\224\374\202\265\202\267"
"\202\254\202\270\223\313\202\301\202\302\202\253\201A\220\330\202\350\227\364\202\253\201A"
"\215\217\202\361\202\305\202\277\202\254\202\351\227Y\214{\202\306\203_\203C\203A"
"\203\202\203\223\203h\227Y\214{\202\252\201A\345v\222\216\202\360\222T\202\265"
"\202\304\222n\226\312\202\360\214@\202\301\202\304\202\242\202\351\202\306\203_\203C"
"\203A\203\202\203\223\203h\202\360\214@\202\350\223\226\202\304\202\275\227Y\214{"
"\202\252\214\276\202\244\202\311\202\315\201A\202\261\202\361\202\310\220\316\202\261\202\353"
"\202\252\211\275\202\314\226\360\202\311\202\275\202\302\201H\224a\202\314\202\331\202\244"
"\202\252\202\334\202\276\202\334\202\265\202\310\202\314\202\311\224L\202\306\203l\203Y"
"\203~\224L\202\252\216\200\202\361\202\276\202\323\202\350\202\360\202\265\202\304\203l"
"\203Y\203~\202\360\202\275\202\255\202\263\202\361\225\337\202\334\202\246\202\275\202\340"
"\202\301\202\306\225\337\202\334\202\246\202\346\202\244\202\306\201A\217\254\224\236\225\262"
"\202\311\202\334\202\335\202\352\202\304\211B\202\352\202\304\202\242\202\351\202\306\224N"
"\212\361\202\350\203l\203Y\203~\202\252\225@\202\360\202\255\202\361\202\255\202\361"
"\224L\202\346\202\350\217\254\224\236\225\262\202\314\202\331\202\244\202\252\202\250\202\242"
"\202\265\202\273\202\244\202\276\227\263\202\306\202\342\202\267\202\350\227\263\202\252\202\342"
"\202\267\202\350\202\360\202\251\202\266\202\301\202\304\202\242\202\351\202\306\202\342\202\267"
"\202\350\202\252\220\324\226\332\202\314\227\263\202\311\220q\202\313\202\275\202\310\202\272"
"\214\343\220\346\202\340\215l\202\246\202\270\201A\341\222\341\233\202\360\213N\202\261"
"\202\265\202\304\226l\202\360\202\251\202\266\202\351\202\314\201H\214\253\202\242\202\240"
"\202\310\202\275\202\314\216\225\202\252\202\310\202\255\202\310\202\301\202\304\202\265\202\334"
"\202\244\202\346\202\253\202\302\202\313\202\306\222\337\202\253\202\302\202\313\202\252\222\337"
"\202\360\220H\216\226\202\311\217\265\202\242\202\304\225\275\202\327\202\301\202\275\202\242"
"\216M\202\311\223\374\202\352\202\304\217o\202\265\202\275\216\251\225\252\202\315\202\346"
"\202\276\202\352\202\360\202\275\202\347\202\265\202\310\202\252\202\347\216M\202\360\202\330"
"\202\353\202\330\202\353\232{\202\314\222\267\202\242\222\337\202\315\202\275\202\276\202\267"
"\202\267\202\351\202\276\202\257\201B\222\337\202\306\202\253\202\302\202\313\202\261\202\361"
"\202\307\202\315\222\337\202\252\202\253\202\302\202\313\202\360\217\265\202\242\202\304\215\327"
"\222\267\202\242\202\302\202\332\202\311\223\374\202\352\202\304\217o\202\265\202\275\222\337"
"\202\315\202\250\225\240\210\352\224t\220H\202\327\202\275\202\350\210\371\202\361\202\276"
"\202\350\202\251\202\255\202\265\202\304\225\234\217Q\202\315\220\213\202\260\202\347\202\352"
"\202\275\201B\216\223\214{\202\306\203q\203\210\203R\202\275\202\277\202\306\202\361"
"\202\321\202\252\227\326\202\360\202\251\202\242\202\304\224\362\202\361\202\305\202\242\202\351"
"\202\314\202\360\214\251\202\302\202\257\202\275\216\223\214{\202\240\202\355\202\304\202\304"
"\203q\203\210\203R\202\275\202\277\202\360\214{\217\254\211\256\202\326\202\265\202\251"
"\202\265\216\251\225\252\202\252\220H\202\327\202\347\202\352\202\304\202\240\202\355\202\352"
"\202\310\203q\203\210\203R\202\275\202\277\202\315\212O\202\326\202\340\217o\202\347"
"\202\352\202\270\201A\225\302\202\266\202\261\202\337\202\347\202\352\202\275\202\334\202\334"
"\230V\202\242\202\304\202\242\202\255\201B\230T\202\306\222\337\230T\202\252\215\234"
"\202\360\202\314\202\335\202\261\202\361\202\305\201A\202\314\202\307\202\311\216h\202\263"
"\202\301\202\304\222\311\202\255\202\304\202\275\202\334\202\347\202\310\202\242\202\273\202\261"
"\202\305\222\337\202\311\201A\202\250\212\350\202\242\202\276\202\251\202\347\202\261\202\314"
"\215\234\202\360\202\306\202\301\202\304\202\277\202\345\202\244\202\276\202\242\201A\202\273"
"\202\314\202\251\202\355\202\350\215\234\202\360\202\306\202\301\202\304\202\340\202\347\202\301"
"\202\304\202\340\214N\202\314\202\261\202\306\202\360\220H\202\327\202\275\202\350\202\265"
"\202\310\202\242\202\251\202\347\230T\202\315\201A\202\273\202\244\214\276\202\242\202\310"
"\202\252\202\347\202\340\202\323\202\255\202\352\202\301\226\312\221\351\202\306\217\254\222\271"
"\202\275\202\277\221\351\202\252\217\254\222\271\202\275\202\277\202\360\220H\216\226\202\311"
"\217\265\202\242\202\275\222a\220\266\223\372\202\314\202\250\217j\202\242\202\360\202\267"
"\202\351\202\251\202\347\221\201\202\255\227\210\202\304\211\272\202\263\202\242\217\254\222\271"
"\202\275\202\277\202\252\217W\202\334\202\301\202\304\217j\202\242\202\314\220\310\202\311"
"\202\302\202\255\202\306\221\351\202\315\202\267\202\256\202\263\202\334\217P\202\242\202\251"
"\202\251\202\350\201A\202\262\202\277\202\273\202\244\202\311\202\240\202\350\202\302\202\242"
"\202\275\202\251\202\246\202\351\202\306\203W\203\205\203s\203^\201[\211\244\227l"
"\202\276\202\346\201A\202\306\203W\203\205\203s\203^\201[\202\252\202\255\202\352"
"\202\275\212\333\221\276\202\315\221\345\202\265\202\275\225\250\202\266\202\341\202\310\202\251"
"\202\301\202\275\202\306\202\251\202\246\202\351\202\275\202\277\202\315\203K\201[\203K"
"\201[\225\266\213\345\202\316\202\251\202\350\202\273\202\261\202\305\203W\203\205\203s"
"\203^\201[\202\315\203R\203E\203m\203g\203\212\202\360\202\302\202\251\202\355"
"\202\265\202\304\202\251\202\246\202\351\202\275\202\277\202\360\202\335\202\361\202\310\220H"
"\202\327\202\263\202\271\202\275\230h\202\306\202\244\202\263\202\254\202\306\202\251\202\324"
"\202\306\222\216\230h\202\252\202\244\202\263\202\254\202\360\202\302\202\251\202\334\202\246"
"\202\275\202\244\202\263\202\254\202\314\227F\222B\202\314\202\251\202\324\202\306\222\216"
"\202\252\201A\202\307\202\244\202\251\202\244\202\263\202\254\202\360\217\225\202\257\202\304"
"\202\342\202\301\202\304\211\272\202\263\202\242\202\265\202\251\202\265\230h\202\315\202\244"
"\202\263\202\254\202\360\220H\202\327\202\304\202\265\202\334\202\242\202\251\202\324\202\306"
"\222\216\202\315\230h\202\360\215\246\202\361\202\305\201A\230h\202\314\216Y\202\361"
"\202\276\227\221\202\360\221S\225\224\225\262\201X\202\311\215\323\202\242\202\304\202\265"
"\202\334\202\301\202\275\203l\203Y\203~\202\306\224L\202\306\217\254\202\263\202\310"
"\227Y\214{\216q\203l\203Y\203~\202\252\202\250\225\352\202\263\202\361\202\311"
"\201A\202\332\202\255\202\315\227Y\214{\202\315\202\253\202\347\202\242\202\276\202\257"
"\202\307\224L\202\315\221\345\215D\202\253\202\267\202\351\202\306\202\250\225\352\202\263"
"\202\361\202\315\201A\211\275\202\360\214\276\202\244\202\314\202\250\202\277\202\321\202\277"
"\202\341\202\361\201A\224L\202\315\216\204\202\275\202\277\202\360\220H\202\327\202\304"
"\202\240\202\361\202\310\202\311\221\276\202\301\202\304\202\251\202\301\202\261\202\346\202\255"
"\202\310\202\301\202\275\202\314\202\346\202\305\202\340\227Y\214{\202\252\202\342\202\271"
"\202\304\212i\215D\202\252\210\253\202\242\202\314\202\315\201A\216\204\202\275\202\277"
"\203l\203Y\203~\202\360\202\302\202\251\202\334\202\246\202\347\202\352\202\310\202\242"
"\202\251\202\347\202\310\202\314\202\346\224\222\222\271\202\306\203R\203E\203m\203g"
"\203\212\224\222\222\271\202\252\220\205\225\323\202\305\224\374\202\265\202\242\220\272\202\305"
"\211\314\202\301\202\304\202\242\202\351\202\306\202\307\202\244\202\265\202\304\211\314\202\301"
"\202\304\202\242\202\351\202\314\201H\202\306\222m\202\350\202\275\202\252\202\350\211\256"
"\202\314\203R\203E\203m\203g\203\212\202\276\202\301\202\304\216\204\202\315\202\340"
"\202\244\202\267\202\256\216\200\202\312\202\361\202\276\202\301\202\304\214\374\202\261\202\244"
"\202\251\202\347\202\242\202\242\222m\202\347\202\271\202\252\223\315\202\242\202\275\202\361"
"\202\305\202\267\202\340\202\314\202\250\202\250\202\251\202\335\202\306\222\244\221\234\214\216"
"\202\314\214\365\202\305\201A\222\244\221\234\202\252\223\256\202\242\202\275\202\346\202\244"
"\202\311\214\251\202\246\202\275\202\314\202\305\201A\202\250\202\250\202\251\202\335\202\315"
"\225\337\202\334\202\246\202\346\202\244\202\306\220g\215\\\202\246\202\275\202\305\202\340"
"\216c\224O\202\310\202\252\202\347\222\244\221\234\202\311\202\315\220\316\202\314\221\314"
"\202\360\223\256\202\251\202\267\202\275\202\337\202\314\220S\202\340\202\310\202\242\202\265"
"\212\264\217\356\202\340\202\310\202\242\201A\215l\202\246\202\340\217\356\224M\202\340"
"\201A\210\244\202\340\202\310\202\242\202\240\202\320\202\351\202\306\203X\203p\203j"
"\203G\203\213\214\242\203X\203p\203j\203G\203\213\214\242\202\252\226\260\202\301"
"\202\304\202\242\202\351\203A\203q\203\213\202\311\202\251\202\335\202\302\202\261\202\244"
"\202\306\202\267\202\351\202\306\203A\203q\203\213\202\315\202\267\202\316\202\342\202\255"
"\223\246\202\260\202\304\203K\201[\203K\201[\226\302\202\253\202\310\202\252\202\347"
"\214\242\202\360\202\261\202\244\224l\202\301\202\275\216\251\225\252\202\314\216\350\202\311"
"\223\315\202\251\202\310\202\242\202\340\202\314\202\360\222\307\202\242\202\251\202\257\202\351"
"\202\310\202\361\202\304\201A\214N\202\315\211\275\202\304\202\244\202\312\202\332\202\352"
"\202\342\202\305\202\250\202\353\202\251\216\322\202\310\202\361\202\276";
#define VERSAILLES_MESSAGES_COUNT 146
#define VERSAILLES_MESSAGES_COUNT_CJK 151

View file

@ -234,7 +234,7 @@ void CMakeProvider::writeSubEngines(const BuildSetup &setup, std::ofstream &work
}
void CMakeProvider::createProjectFile(const std::string &name, const std::string &, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList) {
const StringList &includeList, const StringList &excludeList) {
const std::string projectFile = setup.outputDir + "/CMakeLists.txt";
std::ofstream project(projectFile.c_str(), std::ofstream::out | std::ofstream::app);
@ -320,7 +320,7 @@ void CMakeProvider::writeDefines(const BuildSetup &setup, std::ofstream &output)
}
void CMakeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation,
const std::string &objPrefix, const std::string &filePrefix) {
const std::string &objPrefix, const std::string &filePrefix) {
std::string lastName;
for (FileNode::NodeList::const_iterator i = dir.children.begin(); i != dir.children.end(); ++i) {

Some files were not shown because too many files have changed in this diff Show more