[Scummvm-cvs-logs] SF.net SVN: scummvm:[38396] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Feb 17 10:15:18 CET 2009


Revision: 38396
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38396&view=rev
Author:   thebluegr
Date:     2009-02-17 09:15:17 +0000 (Tue, 17 Feb 2009)

Log Message:
-----------
Removed unused SFX code

Modified Paths:
--------------
    scummvm/trunk/engines/sci/include/sfx_pcm.h
    scummvm/trunk/engines/sci/include/sfx_timer.h
    scummvm/trunk/engines/sci/sfx/core.cpp
    scummvm/trunk/engines/sci/sfx/pcm_device.cpp
    scummvm/trunk/engines/sci/sfx/timer.cpp

Modified: scummvm/trunk/engines/sci/include/sfx_pcm.h
===================================================================
--- scummvm/trunk/engines/sci/include/sfx_pcm.h	2009-02-17 09:05:50 UTC (rev 38395)
+++ scummvm/trunk/engines/sci/include/sfx_pcm.h	2009-02-17 09:15:17 UTC (rev 38396)
@@ -33,13 +33,6 @@
 #include "sci/include/sfx_time.h"
 #include "sci/include/scitypes.h"
 
-/* A number of standard options most devices will support */
-#define SFX_PCM_OPTION_RATE "rate"            /* Sampling rate: Number of samples per second */
-#define SFX_PCM_OPTION_BITS "bits"            /* Sample size in bits */
-#define SFX_PCM_OPTION_STEREO "stereo"        /* Whether to support stereo output */
-#define SFX_PCM_OPTION_BUF_SIZE "buffer-size" /* Requested buffer size */
-/* Device implementors are advised to use these constants whenever possible. */
-
 #define SFX_PCM_MONO 0
 #define SFX_PCM_STEREO_LR 1 /* left sample, then right sample */
 #define SFX_PCM_STEREO_RL 2 /* right sample, then left sample */
@@ -91,9 +84,6 @@
 	** endianness/signedness/bit size/mono-vs-stereo conversions.
 	*/
 
-	const char *name;
-	const char *version;
-
 	int (*init)(struct _sfx_pcm_device *self);
 	/* Initializes the device
 	** Parameters: (sfx_pcm_device_t *) self: Self reference
@@ -103,20 +93,6 @@
 	** specified beforehand.
 	*/
 
-	void (*exit)(struct _sfx_pcm_device *self);
-	/* Uninitialises the device
-	** Parameters: (sfx_pcm_device_t *) self: Self reference
-	*/
-
-	int (*set_option)(struct _sfx_pcm_device *self, char *name, char *value);
-	/* Sets an option for the device
-	** Parameters: (sfx_pcm_device_t *) self: Self reference
-	**             (char *) name: Name of the option to set
-	**             (char *) value: Value of the option to set
-	** Returns   : (int) SFX_OK on success, SFX_ERROR otherwise (unsupported option)
-	** May be NULL
-	*/
-
 	int (*output)(struct _sfx_pcm_device *self, byte *buf,
 	              int count, sfx_timestamp_t *timestamp);
 	/* Writes output to the device
@@ -153,18 +129,6 @@
 		      ** output() will block or fail, drained according
 		      ** to conf.rate  */
 
-	/* The following are optional */
-	sfx_timer_t *timer;
-	/* Many PCM drivers use a callback mechanism, which can be
-	** exploited as a timer. Such a timer may be exported here and
-	** will be preferred over other timers.  */
-	/* This is an _optional_ timer provided by the PCM
-	** subsystem (may be NULL). It is checked for afer
-	** initialisation, and used in preference to any
-	** other timers available.
-	*/
-	void *internal; /* The private bits */
-
 } sfx_pcm_device_t;
 
 

Modified: scummvm/trunk/engines/sci/include/sfx_timer.h
===================================================================
--- scummvm/trunk/engines/sci/include/sfx_timer.h	2009-02-17 09:05:50 UTC (rev 38395)
+++ scummvm/trunk/engines/sci/include/sfx_timer.h	2009-02-17 09:15:17 UTC (rev 38396)
@@ -31,22 +31,9 @@
 #include "sci/include/sfx_core.h"
 
 typedef struct {
-	const char *name;
-	const char *version;
-
 	int delay_ms; /* Approximate delay (in milliseconds) between calls */
-	int flags;
 
 	int
-	(*set_option)(char *name, char *value);
-	/* Sets an option for the timing mechanism
-	** Parameters: (char *) name: The name describing what to set
-	**             (char *) value: The value to set
-	** Returns   : (int) SFX_OK, or SFX_ERROR if the name wasn't understood
-	** May be NULL
-	*/
-
-	int
 	(*init)(void (*callback)(void *data), void *data);
 	/* Initializes the timer
 	** Parameters: (void* -> void) callback:
@@ -64,23 +51,6 @@
 	** All resources allocated with the timer should be freed as an effect
 	** of this.
 	*/
-
-	int
-	(*block)(void);
-	/* Blocks the timer
-	** Returns   : (int) SFX_OK on success, SFX_ERROR on failure
-	** When this function returns it is guaranteed that no timer callback is
-	** currently being executed and that no new timer callback will occur
-	** until unblock() is called.
-	*/
-
-	int
-	(*unblock)(void);
-	/* Unblocks the timer
-	** Returns   : (int) SFX_OK on success, SFX_ERROR on failure
-	** Any callbacks that were blocked should be executed immediately when
-	** possible.
-	*/
 } sfx_timer_t;
 
 #endif /* !_FREESCI_SFX_TIMER_H_ */

Modified: scummvm/trunk/engines/sci/sfx/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/core.cpp	2009-02-17 09:05:50 UTC (rev 38395)
+++ scummvm/trunk/engines/sci/sfx/core.cpp	2009-02-17 09:15:17 UTC (rev 38396)
@@ -460,10 +460,7 @@
 	/*------------------*/
 
 	if (pcm_device || player->maintenance) {
-		if (pcm_device && pcm_device->timer)
-			timer = pcm_device->timer;
-		else
-			timer = &sfx_timer_scummvm;
+		timer = &sfx_timer_scummvm;
 
 		if (!timer) {
 			fprintf(stderr, "[SFX] " __FILE__": Could not find timing mechanism\n");
@@ -483,9 +480,6 @@
 			mixer = NULL;
 			return;
 		}
-
-		sciprintf("[SFX] Initialised timer '%s', v%s\n",
-		          timer->name, timer->version);
 	} /* With no PCM device and no player, we don't need a timer */
 
 	/*----------------*/
@@ -504,7 +498,6 @@
 			if (mixer->init(mixer, pcm_device)) {
 				sciprintf("[SFX] Failed to initialise PCM mixer; disabling PCM support\n");
 				mixer = NULL;
-				pcm_device->exit(pcm_device);
 				pcm_device = NULL;
 			}
 		}
@@ -540,10 +533,8 @@
 
 	song_lib_free(self->songlib);
 
-	if (pcm_device) {
-		pcm_device->exit(pcm_device);
-		pcm_device = NULL;
-	}
+	pcm_device = NULL;
+
 	if (timer && timer->exit())
 		fprintf(stderr, "[SFX] Timer reported error on exit\n");
 

Modified: scummvm/trunk/engines/sci/sfx/pcm_device.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/pcm_device.cpp	2009-02-17 09:05:50 UTC (rev 38395)
+++ scummvm/trunk/engines/sci/sfx/pcm_device.cpp	2009-02-17 09:15:17 UTC (rev 38396)
@@ -29,9 +29,6 @@
 	return SFX_OK;
 }
 
-static void pcmout_scummvm_exit(sfx_pcm_device_t *self) {
-}
-
 static int pcmout_scummvm_output(sfx_pcm_device_t *self, byte *buf, int count,
                                  sfx_timestamp_t *timestamp) {
 
@@ -46,15 +43,9 @@
 
 
 sfx_pcm_device_t sfx_pcm_driver_scummvm = {
-	"ScummVM",
-	"0.1",
 	&pcmout_scummvm_init,
-	&pcmout_scummvm_exit,
-	NULL,
 	&pcmout_scummvm_output,
 	NULL,
 	{0, 0, 0},
-	0,
-	NULL,
-	NULL
+	0
 };

Modified: scummvm/trunk/engines/sci/sfx/timer.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/timer.cpp	2009-02-17 09:05:50 UTC (rev 38395)
+++ scummvm/trunk/engines/sci/sfx/timer.cpp	2009-02-17 09:15:17 UTC (rev 38396)
@@ -43,12 +43,7 @@
 
 
 sfx_timer_t sfx_timer_scummvm = {
-	"ScummVM",
-	"0.1",
-	DELAY / 1000, 0,
-	NULL,
+	DELAY / 1000,
 	&scummvm_timer_start,
-	&scummvm_timer_stop,
-	0,
-	0
+	&scummvm_timer_stop
 };


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list