aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/labmusic.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2015-07-17 10:36:20 +0300
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit79ed1e1f05dc1537f666018bc7240a5d96835b5b (patch)
treef89e11d715c89ce3e2e0940091f32af022b06b7f /engines/lab/labmusic.cpp
parent884b80f2150c4509912988b19e0106aa15e1008f (diff)
downloadscummvm-rg350-79ed1e1f05dc1537f666018bc7240a5d96835b5b.tar.gz
scummvm-rg350-79ed1e1f05dc1537f666018bc7240a5d96835b5b.tar.bz2
scummvm-rg350-79ed1e1f05dc1537f666018bc7240a5d96835b5b.zip
LAB: Get rid of numtostr(), and simplify most uses of sizeOfFile()
Diffstat (limited to 'engines/lab/labmusic.cpp')
-rw-r--r--engines/lab/labmusic.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/lab/labmusic.cpp b/engines/lab/labmusic.cpp
index 5222cd9af6..a435710078 100644
--- a/engines/lab/labmusic.cpp
+++ b/engines/lab/labmusic.cpp
@@ -331,6 +331,11 @@ void Music::resetMusic() {
_tFile = 0;
}
+byte **Music::newOpen(const char *name) {
+ uint32 unused;
+ return newOpen(name, unused);
+}
+
/*****************************************************************************/
/* Checks whether or note enough memory in music buffer before loading any */
/* files. Fills it if not. Does not take into account the current buffer */
@@ -339,20 +344,14 @@ void Music::resetMusic() {
/* */
/* Here, the seconds are multipled by 10. */
/*****************************************************************************/
-byte **Music::newOpen(const char *name) {
+byte **Music::newOpen(const char *name, uint32 &size) {
byte **file;
- if (name == NULL) {
+ if (!name || !strcmp(name, "") || !strcmp(name, " "))
return NULL;
- }
- if ((strcmp(name, "") == 0) || (strcmp(name, " ") == 0)) {
- return NULL;
- }
-
- if ((file = isBuffered(name))) {
+ if (file = isBuffered(name))
return file;
- }
if (_musicOn) {
updateMusic();
@@ -362,7 +361,7 @@ byte **Music::newOpen(const char *name) {
if (!_doNotFilestopSoundEffect && isSoundEffectActive())
stopSoundEffect();
- file = openFile(name);
+ file = openFile(name, size);
checkMusic();
return file;
}