Moved sci_ffs() inside iterator.cpp, the only place where it's actually used, and removed tools.*. Also, removed all the unused includes to tools.h from several places

svn-id: r45176
This commit is contained in:
Filippos Karapetis 2009-10-16 23:29:00 +00:00
parent 0479964ad7
commit e4c23834dd
34 changed files with 21 additions and 120 deletions

View file

@ -161,8 +161,6 @@
<File RelativePath="..\..\engines\sci\seq_decoder.cpp" /> <File RelativePath="..\..\engines\sci\seq_decoder.cpp" />
<File RelativePath="..\..\engines\sci\seq_decoder.h" /> <File RelativePath="..\..\engines\sci\seq_decoder.h" />
<File RelativePath="..\..\engines\sci\engine\script.cpp" /> <File RelativePath="..\..\engines\sci\engine\script.cpp" />
<File RelativePath="..\..\engines\sci\tools.cpp" />
<File RelativePath="..\..\engines\sci\tools.h" />
<File RelativePath="..\..\engines\sci\uinput.h" /> <File RelativePath="..\..\engines\sci\uinput.h" />
<File RelativePath="..\..\engines\sci\vocabulary.cpp" /> <File RelativePath="..\..\engines\sci\vocabulary.cpp" />
<File RelativePath="..\..\engines\sci\vocabulary.h" /> <File RelativePath="..\..\engines\sci\vocabulary.h" />

View file

@ -162,8 +162,6 @@
<File RelativePath="..\..\engines\sci\seq_decoder.cpp" /> <File RelativePath="..\..\engines\sci\seq_decoder.cpp" />
<File RelativePath="..\..\engines\sci\seq_decoder.h" /> <File RelativePath="..\..\engines\sci\seq_decoder.h" />
<File RelativePath="..\..\engines\sci\engine\script.cpp" /> <File RelativePath="..\..\engines\sci\engine\script.cpp" />
<File RelativePath="..\..\engines\sci\tools.cpp" />
<File RelativePath="..\..\engines\sci\tools.h" />
<File RelativePath="..\..\engines\sci\uinput.h" /> <File RelativePath="..\..\engines\sci\uinput.h" />
<File RelativePath="..\..\engines\sci\vocabulary.cpp" /> <File RelativePath="..\..\engines\sci\vocabulary.cpp" />
<File RelativePath="..\..\engines\sci\vocabulary.h" /> <File RelativePath="..\..\engines\sci\vocabulary.h" />

View file

@ -28,7 +28,6 @@
** that grammar, writing an appropriate node tree if successful. ** that grammar, writing an appropriate node tree if successful.
*/ */
#include "sci/tools.h"
#include "sci/vocabulary.h" #include "sci/vocabulary.h"
#include "sci/console.h" #include "sci/console.h"

View file

@ -26,7 +26,6 @@
#include "sci/engine/message.h" #include "sci/engine/message.h"
#include "sci/engine/kernel.h" #include "sci/engine/kernel.h"
#include "sci/engine/seg_manager.h" #include "sci/engine/seg_manager.h"
#include "sci/tools.h"
namespace Sci { namespace Sci {

View file

@ -29,7 +29,6 @@
#include "sci/engine/segment.h" #include "sci/engine/segment.h"
#include "sci/engine/seg_manager.h" #include "sci/engine/seg_manager.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
namespace Sci { namespace Sci {

View file

@ -28,7 +28,6 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/rect.h" #include "common/rect.h"
#include "sci/tools.h"
#include "sci/gfx/palette.h" #include "sci/gfx/palette.h"
namespace Sci { namespace Sci {

View file

@ -23,6 +23,7 @@
* *
*/ */
#include "common/endian.h"
#include "sci/gfx/gfx_system.h" #include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h" #include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h" #include "sci/gfx/gfx_tools.h"

View file

@ -24,6 +24,9 @@
*/ */
#include <time.h> // for time() to seed rand() via srand() #include <time.h> // for time() to seed rand() via srand()
#include "common/endian.h"
#include "sci/gfx/gfx_resource.h" #include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h" #include "sci/gfx/gfx_tools.h"
#include "sci/sci.h" // for kDebugLevelSci0Pic #include "sci/sci.h" // for kDebugLevelSci0Pic

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/debug.h" // for g_debug_sleeptime_factor #include "sci/debug.h" // for g_debug_sleeptime_factor
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui.h" #include "sci/gui/gui.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_gfx.h" #include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_view.h" #include "sci/gui/gui_view.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"
#include "sci/gui/gui_view.h" #include "sci/gui/gui_view.h"
#include "sci/gui/gui_cursor.h" #include "sci/gui/gui_cursor.h"

View file

@ -25,7 +25,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_font.h" #include "sci/gui/gui_font.h"

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_gfx.h" #include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_animate.h" #include "sci/gui/gui_animate.h"
#include "sci/gui/gui_font.h" #include "sci/gui/gui_font.h"

View file

@ -28,7 +28,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"

View file

@ -26,7 +26,6 @@
#include "common/stack.h" #include "common/stack.h"
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"
#include "sci/gui/gui_gfx.h" #include "sci/gui/gui_gfx.h"

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
namespace Sci { namespace Sci {

View file

@ -29,7 +29,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui.h" #include "sci/gui/gui.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"

View file

@ -25,7 +25,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_gfx.h" #include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h" #include "sci/gui/gui_palette.h"

View file

@ -27,7 +27,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/gui/gui_screen.h" #include "sci/gui/gui_screen.h"
#include "sci/gui/gui_gfx.h" #include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_animate.h" #include "sci/gui/gui_animate.h"

View file

@ -28,7 +28,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/tools.h"
#include "sci/debug.h" // for g_debug_sleeptime_factor #include "sci/debug.h" // for g_debug_sleeptime_factor
#include "sci/resource.h" #include "sci/resource.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"

View file

@ -7,7 +7,6 @@ MODULE_OBJS = \
resource.o \ resource.o \
sci.o \ sci.o \
seq_decoder.o \ seq_decoder.o \
tools.o \
vocabulary.o \ vocabulary.o \
engine/game.o \ engine/game.o \
engine/gc.o \ engine/gc.o \

View file

@ -31,7 +31,6 @@
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/engine/state.h" #include "sci/engine/state.h"
#include "sci/engine/kernel.h" #include "sci/engine/kernel.h"
#include "sci/tools.h"
#include "sci/resource.h" #include "sci/resource.h"
#include "sci/vocabulary.h" #include "sci/vocabulary.h"
#include "sci/decompressor.h" #include "sci/decompressor.h"

View file

@ -132,8 +132,8 @@ Common::Error SciEngine::run() {
return Common::kUnknownError; return Common::kUnknownError;
// Gui change // Gui change
//_gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor); // new _gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor); // new
_gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor); // old //_gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor); // old
if (game_init(_gamestate)) { /* Initialize */ if (game_init(_gamestate)) { /* Initialize */
warning("Game initialization failed: Aborting..."); warning("Game initialization failed: Aborting...");

View file

@ -25,7 +25,6 @@
/* Sound subsystem core: Event handler, sound player dispatching */ /* Sound subsystem core: Event handler, sound player dispatching */
#include "sci/tools.h"
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/sfx/core.h" #include "sci/sfx/core.h"
#include "sci/sfx/iterator.h" #include "sci/sfx/iterator.h"

View file

@ -31,7 +31,6 @@
#include "sci/sfx/iterator_internal.h" #include "sci/sfx/iterator_internal.h"
#include "sci/engine/state.h" // for sfx_player_tell_synth :/ #include "sci/engine/state.h" // for sfx_player_tell_synth :/
#include "sci/sfx/core.h" // for sfx_player_tell_synth #include "sci/sfx/core.h" // for sfx_player_tell_synth
#include "sci/tools.h"
#include "sound/audiostream.h" #include "sound/audiostream.h"
#include "sound/mixer.h" #include "sound/mixer.h"
@ -46,6 +45,21 @@ static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0,
/*#define DEBUG_DECODING*/ /*#define DEBUG_DECODING*/
/*#define DEBUG_VERBOSE*/ /*#define DEBUG_VERBOSE*/
/** Find first set bit in bits and return its index. Returns 0 if bits is 0. */
static int sci_ffs(int bits) {
if (!bits)
return 0;
int retval = 1;
while (!(bits & 1)) {
retval++;
bits >>= 1;
}
return retval;
}
static void print_tabs_id(int nr, songit_id_t id) { static void print_tabs_id(int nr, songit_id_t id) {
while (nr-- > 0) while (nr-- > 0)
fprintf(stderr, "\t"); fprintf(stderr, "\t");

View file

@ -25,7 +25,6 @@
#include "common/util.h" #include "common/util.h"
#include "sci/tools.h"
#include "sci/sfx/sequencer.h" #include "sci/sfx/sequencer.h"
#include "sci/sfx/device.h" #include "sci/sfx/device.h"
#include "sci/sfx/seq/instrument-map.h" #include "sci/sfx/seq/instrument-map.h"

View file

@ -28,7 +28,6 @@
#ifndef SCI_SFX_SEQ_INSTRUMENT_MAP_H #ifndef SCI_SFX_SEQ_INSTRUMENT_MAP_H
#define SCI_SFX_SEQ_INSTRUMENT_MAP_H #define SCI_SFX_SEQ_INSTRUMENT_MAP_H
#include "sci/tools.h"
#include "sci/sfx/device.h" #include "sci/sfx/device.h"
namespace Sci { namespace Sci {

View file

@ -24,7 +24,6 @@
*/ */
#include "../sequencer.h" #include "../sequencer.h"
#include "sci/tools.h"
namespace Sci { namespace Sci {

View file

@ -29,7 +29,6 @@
#include "common/error.h" #include "common/error.h"
#include "sci/sfx/sfx_pcm.h" #include "sci/sfx/sfx_pcm.h"
#include "sci/sfx/sequencer.h" #include "sci/sfx/sequencer.h"
#include "sci/tools.h"
namespace Sci { namespace Sci {

View file

@ -24,7 +24,6 @@
*/ */
#include "sci/sci.h" #include "sci/sci.h"
#include "sci/tools.h"
#include "sci/sfx/iterator.h" #include "sci/sfx/iterator.h"
#include "sound/fmopl.h" #include "sound/fmopl.h"

View file

@ -23,7 +23,6 @@
* *
*/ */
#include "sci/tools.h"
#include "sci/sfx/softseq.h" #include "sci/sfx/softseq.h"
#include "common/file.h" #include "common/file.h"

View file

@ -23,7 +23,6 @@
* *
*/ */
#include "sci/tools.h"
#include "sci/sfx/core.h" #include "sci/sfx/core.h"
#include "sci/sfx/iterator.h" #include "sci/sfx/iterator.h"

View file

@ -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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#include "sci/tools.h"
#include "sci/engine/state.h"
#include "sci/sci.h" // For _console only
#include "sci/console.h" // For _console only
namespace Sci {
int sci_ffs(int bits) {
if (!bits)
return 0;
int retval = 1;
while (!(bits & 1)) {
retval++;
bits >>= 1;
}
return retval;
}
} // End of namespace Sci

View file

@ -1,39 +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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#ifndef SCI_TOOLS_H
#define SCI_TOOLS_H
#include "common/scummsys.h"
#include "common/endian.h"
namespace Sci {
/** Find first set bit in bits and return its index. Returns 0 if bits is 0. */
int sci_ffs(int bits);
} // End of namespace Sci
#endif // SCI_TOOLS_H