From 9131a50795172bcefd87f101e9169d5444489c22 Mon Sep 17 00:00:00 2001 From: a/ Date: Sat, 3 Jul 2021 01:08:40 +0900 Subject: [PATCH] SAGA2: Remove audiores.h --- engines/saga2/audio.cpp | 23 ++++++++++++ engines/saga2/audio.h | 4 ++ engines/saga2/audiores.cpp | 77 -------------------------------------- engines/saga2/audiores.h | 48 ------------------------ engines/saga2/module.mk | 1 - engines/saga2/noise.cpp | 1 - 6 files changed, 27 insertions(+), 127 deletions(-) delete mode 100644 engines/saga2/audiores.cpp delete mode 100644 engines/saga2/audiores.h diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp index 6874d778497..0c313f8ab0d 100644 --- a/engines/saga2/audio.cpp +++ b/engines/saga2/audio.cpp @@ -219,4 +219,27 @@ audioAttenuationFunction audioInterface::setAttenuator(audioAttenuationFunction return nullptr; } +bool bufCheckResID(hResContext *hrc, uint32 s) { + return s != 0; +} + +bool hResCheckResID(hResContext *hrc, uint32 s) { + if (hrc != NULL) + return hrc->seek(s); + return false; +} + +bool hResCheckResID(hResContext *hrc, uint32 s[]) { + if (s != NULL) { + if (s[0] == 0) + return false; + + for (int i = 0; s[i]; i++) { + if (!hResCheckResID(hrc, s[i])) + return false; + } + } + return true; +} + } // end of namespace Saga2 diff --git a/engines/saga2/audio.h b/engines/saga2/audio.h index 78438570f70..3d0c1f391bc 100644 --- a/engines/saga2/audio.h +++ b/engines/saga2/audio.h @@ -29,6 +29,8 @@ #include "audio/mixer.h" +namespace Saga2 { + /* ===================================================================== * the library(s) must be recompiled if you change these settings * ===================================================================== */ @@ -79,4 +81,6 @@ inline void audioFatal(char *msg) { error("Sound error %s", msg); } +} // end of namespace Saga2 + #endif diff --git a/engines/saga2/audiores.cpp b/engines/saga2/audiores.cpp deleted file mode 100644 index d63835f3e4d..00000000000 --- a/engines/saga2/audiores.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * aint32 with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * - * Based on the original sources - * Faery Tale II -- The Halls of the Dead - * (c) 1993-1996 The Wyrmkeep Entertainment Co. - */ - -#include "saga2/saga2.h" -#include "saga2/audio.h" -#include "saga2/hresmgr.h" -#include "saga2/rect.h" - -#include "saga2/queues.h" -#include "saga2/idtypes.h" -#include "saga2/audiosmp.h" -#include "saga2/audiobuf.h" - -namespace Saga2 { - -#define ASYNCH_AUDIO 0 -#define ASYNCH_READ_SIZE 65536L - -/* ===================================================================== * - Imports - * ===================================================================== */ - -extern audioInterface *audio; -extern bool debugStatuses; -extern bool debugResource; -extern uint32 maxClicks; -extern int32 clickSizes[]; -extern uint8 *clickData[]; - - -bool bufCheckResID(hResContext *hrc, uint32 s) { - return s != 0; -} - -bool hResCheckResID(hResContext *hrc, uint32 s) { - if (hrc != NULL) - return hrc->seek(s); - return false; -} - -bool hResCheckResID(hResContext *hrc, uint32 s[]) { - if (s != NULL) { - if (s[0] == 0) - return false; - - for (int i = 0; s[i]; i++) { - if (!hResCheckResID(hrc, s[i])) - return false; - } - } - return true; -} - -} // end of namespace Saga2 diff --git a/engines/saga2/audiores.h b/engines/saga2/audiores.h deleted file mode 100644 index d92726652ba..00000000000 --- a/engines/saga2/audiores.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * aint32 with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * - * Based on the original sources - * Faery Tale II -- The Halls of the Dead - * (c) 1993-1996 The Wyrmkeep Entertainment Co. - */ - -#ifndef SAGA2_AUDIORES_H -#define SAGA2_AUDIORES_H - -namespace Saga2 { - -class Buffer; -class soundSample; - -int16 hResSeek(Buffer &sb, soundSample &ss, hResContext *hrc, bool Cheksize); -int16 hResRead(Buffer &sb, soundSample &ss, hResContext *hrc); -int16 hResFlush(Buffer &sb, soundSample &ss, hResContext *hrc); - -//----------------------------------------------------------------------- -// Buffer readers - -int16 bufSeek(Buffer &sb, soundSample &ss); -int16 bufRead(Buffer &sb, soundSample &ss); -int16 bufFlush(Buffer &sb, soundSample &ss); - -} // end of namespace Saga2 - -#endif diff --git a/engines/saga2/module.mk b/engines/saga2/module.mk index 8bf3135f3cf..e064a4dbcf3 100644 --- a/engines/saga2/module.mk +++ b/engines/saga2/module.mk @@ -6,7 +6,6 @@ MODULE_OBJS := \ assign.o \ audio.o \ audiobuf.o \ - audiores.o \ automap.o \ band.o \ beegee.o \ diff --git a/engines/saga2/noise.cpp b/engines/saga2/noise.cpp index 6afe9d48a58..649203b9c59 100644 --- a/engines/saga2/noise.cpp +++ b/engines/saga2/noise.cpp @@ -30,7 +30,6 @@ #include "saga2/saga2.h" #include "saga2/fta.h" #include "saga2/audio.h" -#include "saga2/audiores.h" #include "saga2/annoy.h" #include "saga2/player.h" #include "saga2/queues.h"