[Scummvm-cvs-logs] CVS: scummvm bundle.h,1.4,1.5 insane.cpp,1.54,1.55 scumm.h,1.202,1.203 scummvm.cpp,1.203,1.204 sound.cpp,1.125,1.126 timer.cpp,1.5,1.6 timer.h,1.5,1.6
Pawe? Ko?odziejski
aquadran at users.sourceforge.net
Wed Aug 14 09:19:06 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv14533
Modified Files:
bundle.h insane.cpp scumm.h scummvm.cpp sound.cpp timer.cpp
timer.h
Log Message:
some cleanup, changed type timer procedure - passed Scumm pointer
Index: bundle.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bundle.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- bundle.h 14 Aug 2002 09:52:43 -0000 1.4
+++ bundle.h 14 Aug 2002 16:18:44 -0000 1.5
@@ -23,6 +23,12 @@
#include "scummsys.h"
+class Scumm;
+
+class Bundle {
+
+private:
+
struct CompTable {
int32 offset;
int32 size;
@@ -35,12 +41,6 @@
int32 offset;
};
-class Scumm;
-
-class Bundle {
-protected:
-
-private:
int32 compDecode(byte *src, byte *dst);
int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size);
CompTable _compVoiceTable[50];
Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/insane.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- insane.cpp 12 Aug 2002 07:06:07 -0000 1.54
+++ insane.cpp 14 Aug 2002 16:18:44 -0000 1.55
@@ -41,9 +41,8 @@
SmushPlayer::~SmushPlayer() {
}
-static int smush_handler (int t) {
+static void smush_handler (Scumm * _scumm) {
h_sp->update();
- return t;
}
byte * SmushPlayer::loadTres() {
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -d -r1.202 -r1.203
--- scumm.h 14 Aug 2002 10:18:03 -0000 1.202
+++ scumm.h 14 Aug 2002 16:18:44 -0000 1.203
@@ -775,7 +775,7 @@
void playBundleMusic(int32 song);
void pauseBundleMusic(bool state);
void stopBundleMusic();
- int bundleMusicHandler(int t);
+ void bundleMusicHandler(Scumm * scumm);
void decompressBundleSound(int index);
int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned = false);
int playSfxSound_MP3(void *sound, uint32 size);
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- scummvm.cpp 14 Aug 2002 10:18:03 -0000 1.203
+++ scummvm.cpp 14 Aug 2002 16:18:44 -0000 1.204
@@ -38,10 +38,9 @@
extern void GraphicsOff(void);
#endif
-int autosave(int interval) /* Not in class to prevent being bound */
+void autosave(Scumm * scumm) /* Not in class to prevent being bound */
{
- g_scumm->_doAutosave = true;
- return interval;
+ scumm->_doAutosave = true;
}
void Scumm::initRandSeeds()
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- sound.cpp 14 Aug 2002 09:47:21 -0000 1.125
+++ sound.cpp 14 Aug 2002 16:18:44 -0000 1.126
@@ -625,7 +625,7 @@
char ident[8];
int block_type;
byte work[8];
- uint size = 0, i;
+ uint size = 0;
int rate, comp;
byte *data;
@@ -775,11 +775,8 @@
return !_mixer->has_active_channel();
}
-static Scumm * h_scumm;
-
-static int music_handler (int t) {
- h_scumm->bundleMusicHandler(t);
- return t;
+static void music_handler (Scumm * scumm) {
+ scumm->bundleMusicHandler(scumm);
}
#define OUTPUT_SIZE 66150 // ((22050 * 2 * 2) / 4) * 3
@@ -791,7 +788,6 @@
sprintf(buf, "%s%smusic.bun", _gameDataPath, _exe_name);
if (_bundle->openMusicFile((char*)&buf) == false)
return;
- h_scumm = this;
_musicBundleBufFinal = (byte*)malloc(OUTPUT_SIZE);
_musicBundleBufOutput = (byte*)malloc(10 * 0x2000);
_currentSampleBundleMusic = 0;
@@ -829,7 +825,7 @@
}
}
-int Scumm::bundleMusicHandler(int t) {
+void Scumm::bundleMusicHandler(Scumm * scumm) {
byte * ptr;
int32 l, num = _numberSamplesBundleMusic, length, k;
int32 rate = 22050;
@@ -838,7 +834,7 @@
ptr = _musicBundleBufOutput;
if (_pauseBundleMusic)
- return t;
+ return;
for (k = 0, l = _currentSampleBundleMusic; l < num; k++) {
length = _bundle->decompressMusicSampleByIndex(_numberBundleMusic, l, (_musicBundleBufOutput + ((k * 0x2000) + _offsetBufBundleMusic)));
@@ -849,7 +845,7 @@
if (tag != MKID_BE('iMUS')) {
warning("Decompression of bundle sound failed");
_numberBundleMusic = -1;
- return t;
+ return;
}
ptr += 12;
@@ -876,7 +872,7 @@
if (size < 0) {
warning("Decompression sound failed (no size field)");
_numberBundleMusic = -1;
- return t;
+ return;
}
header_size = (ptr - _musicBundleBufOutput);
}
@@ -916,8 +912,6 @@
}
_mixer->play_raw(NULL, buffer, s_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO);
-
- return t;
}
void Scumm::playBundleSound(char *sound)
Index: timer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/timer.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- timer.cpp 14 Aug 2002 00:14:50 -0000 1.5
+++ timer.cpp 14 Aug 2002 16:18:45 -0000 1.6
@@ -44,8 +44,6 @@
int Timer::handler(int * t) {
uint32 interval, l;
- _osystem->lock_mutex(_mutex);
-
if (_timerRunning) {
_lastTime = _thisTime;
_thisTime = _osystem->get_msecs();
@@ -56,14 +54,12 @@
_timerSlots[l].counter -= interval;
if (_timerSlots[l].counter <= 0) {
_timerSlots[l].counter += _timerSlots[l].interval;
- _timerSlots[l].procedure (0);
+ _timerSlots[l].procedure (_scumm);
}
}
}
}
- _osystem->unlock_mutex(_mutex);
-
return *t;
}
@@ -85,7 +81,6 @@
_timerSlots[l].counter = 0;
}
- _mutex = _osystem->create_mutex();
_thisTime = _osystem->get_msecs();
_osystem->set_timer (10, &timer_handler);
@@ -101,6 +96,7 @@
return;
_timerRunning = false;
+ _osystem->set_timer (0, NULL);
_initialized = false;
for (l = 0; l < MAX_TIMERS; l++) {
@@ -108,11 +104,9 @@
_timerSlots[l].interval = 0;
_timerSlots[l].counter = 0;
}
- _osystem->delete_mutex(_mutex);
-
}
-bool Timer::installProcedure (int ((*procedure)(int)), int32 interval) {
+bool Timer::installProcedure (TimerProc procedure, int32 interval) {
int32 l;
bool found = false;
@@ -141,7 +135,7 @@
return true;
}
-void Timer::releaseProcedure (int ((*procedure)(int))) {
+void Timer::releaseProcedure (TimerProc procedure) {
int32 l;
if (_initialized == false) {
Index: timer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/timer.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- timer.h 14 Aug 2002 00:14:50 -0000 1.5
+++ timer.h 14 Aug 2002 16:18:45 -0000 1.6
@@ -23,9 +23,9 @@
#include "scummsys.h"
-#define MAX_TIMERS 3
+#define MAX_TIMERS 5
-typedef int (*TimerProc)(int);
+typedef void (*TimerProc)(Scumm *);
#ifdef __MORPHOS__
#include "morphos/morphos_timer.h"
@@ -43,10 +43,9 @@
void *_timerHandler;
int32 _thisTime;
int32 _lastTime;
- void *_mutex;
struct TimerSlots {
- int ((*procedure) (int));
+ TimerProc procedure;
int32 interval;
int32 counter;
} _timerSlots[MAX_TIMERS];
More information about the Scummvm-git-logs
mailing list