diff --git a/dists/msvc8/sci.vcproj b/dists/msvc8/sci.vcproj
index 9065c2ce7bc..9b30e0ba415 100644
--- a/dists/msvc8/sci.vcproj
+++ b/dists/msvc8/sci.vcproj
@@ -161,8 +161,6 @@
-
-
diff --git a/dists/msvc9/sci.vcproj b/dists/msvc9/sci.vcproj
index 9ecffa953ce..0613d5100dd 100644
--- a/dists/msvc9/sci.vcproj
+++ b/dists/msvc9/sci.vcproj
@@ -162,8 +162,6 @@
-
-
diff --git a/engines/sci/engine/grammar.cpp b/engines/sci/engine/grammar.cpp
index 89d550dafc3..cdc508d8a4d 100644
--- a/engines/sci/engine/grammar.cpp
+++ b/engines/sci/engine/grammar.cpp
@@ -28,7 +28,6 @@
** that grammar, writing an appropriate node tree if successful.
*/
-#include "sci/tools.h"
#include "sci/vocabulary.h"
#include "sci/console.h"
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index b7e0c00fbe2..8dc893db644 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -26,7 +26,6 @@
#include "sci/engine/message.h"
#include "sci/engine/kernel.h"
#include "sci/engine/seg_manager.h"
-#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 38af3e8b299..b683fd4d8bb 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -29,7 +29,6 @@
#include "sci/engine/segment.h"
#include "sci/engine/seg_manager.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h
index 37b915f5188..7dd779ca01a 100644
--- a/engines/sci/gfx/gfx_system.h
+++ b/engines/sci/gfx/gfx_system.h
@@ -28,7 +28,6 @@
#include "common/scummsys.h"
#include "common/rect.h"
-#include "sci/tools.h"
#include "sci/gfx/palette.h"
namespace Sci {
diff --git a/engines/sci/gfx/res_font.cpp b/engines/sci/gfx/res_font.cpp
index fd2cae08e68..65335583887 100644
--- a/engines/sci/gfx/res_font.cpp
+++ b/engines/sci/gfx/res_font.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/endian.h"
#include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 0196ad57a42..4ecec280113 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -24,6 +24,9 @@
*/
#include // for time() to seed rand() via srand()
+
+#include "common/endian.h"
+
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
#include "sci/sci.h" // for kDebugLevelSci0Pic
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index f8e083b2ca1..5728ffd2d12 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/debug.h" // for g_debug_sleeptime_factor
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h"
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp
index 19bcc418a0f..8f26cfd9716 100644
--- a/engines/sci/gui/gui_animate.cpp
+++ b/engines/sci/gui/gui_animate.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_view.h"
#include "sci/gui/gui_screen.h"
diff --git a/engines/sci/gui/gui_cursor.cpp b/engines/sci/gui/gui_cursor.cpp
index ba55fe75e2f..81b390e3b61 100644
--- a/engines/sci/gui/gui_cursor.cpp
+++ b/engines/sci/gui/gui_cursor.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_palette.h"
#include "sci/gui/gui_view.h"
#include "sci/gui/gui_cursor.h"
diff --git a/engines/sci/gui/gui_font.cpp b/engines/sci/gui/gui_font.cpp
index a341bb9dec6..d903d18f4c2 100644
--- a/engines/sci/gui/gui_font.cpp
+++ b/engines/sci/gui/gui_font.cpp
@@ -25,7 +25,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_font.h"
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 1bdb1bbd8f7..b4f2e224b02 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_animate.h"
#include "sci/gui/gui_font.h"
diff --git a/engines/sci/gui/gui_palette.cpp b/engines/sci/gui/gui_palette.cpp
index bc02f2332e4..e5a81406b96 100644
--- a/engines/sci/gui/gui_palette.cpp
+++ b/engines/sci/gui/gui_palette.cpp
@@ -28,7 +28,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h"
diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp
index 7f4d19555b9..6fca4d6542c 100644
--- a/engines/sci/gui/gui_picture.cpp
+++ b/engines/sci/gui/gui_picture.cpp
@@ -26,7 +26,6 @@
#include "common/stack.h"
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h"
#include "sci/gui/gui_gfx.h"
diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp
index df5b9831d32..90f7875a9f8 100644
--- a/engines/sci/gui/gui_screen.cpp
+++ b/engines/sci/gui/gui_screen.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_screen.h"
namespace Sci {
diff --git a/engines/sci/gui/gui_transitions.cpp b/engines/sci/gui/gui_transitions.cpp
index da260deb840..09e58e0e711 100644
--- a/engines/sci/gui/gui_transitions.cpp
+++ b/engines/sci/gui/gui_transitions.cpp
@@ -29,7 +29,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h"
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp
index bff2e38e3b2..83c80d5f594 100644
--- a/engines/sci/gui/gui_view.cpp
+++ b/engines/sci/gui/gui_view.cpp
@@ -25,7 +25,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_palette.h"
diff --git a/engines/sci/gui/gui_windowmgr.cpp b/engines/sci/gui/gui_windowmgr.cpp
index 2909a318456..d58d2d677c3 100644
--- a/engines/sci/gui/gui_windowmgr.cpp
+++ b/engines/sci/gui/gui_windowmgr.cpp
@@ -27,7 +27,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/gui/gui_screen.h"
#include "sci/gui/gui_gfx.h"
#include "sci/gui/gui_animate.h"
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 66b8bc696ae..8cf6d2cfa1d 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -28,7 +28,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/tools.h"
#include "sci/debug.h" // for g_debug_sleeptime_factor
#include "sci/resource.h"
#include "sci/engine/state.h"
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index 26962db9c21..8c9ef94cc17 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -7,7 +7,6 @@ MODULE_OBJS = \
resource.o \
sci.o \
seq_decoder.o \
- tools.o \
vocabulary.o \
engine/game.o \
engine/gc.o \
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 8b741a12283..743ee27165e 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -31,7 +31,6 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/tools.h"
#include "sci/resource.h"
#include "sci/vocabulary.h"
#include "sci/decompressor.h"
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 3edf76d9ebd..e7b06e5e571 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -132,8 +132,8 @@ Common::Error SciEngine::run() {
return Common::kUnknownError;
// Gui change
- //_gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor); // new
- _gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor); // old
+ _gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor); // new
+ //_gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor); // old
if (game_init(_gamestate)) { /* Initialize */
warning("Game initialization failed: Aborting...");
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index f985fef7aa6..1831ae14fcd 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -25,7 +25,6 @@
/* Sound subsystem core: Event handler, sound player dispatching */
-#include "sci/tools.h"
#include "sci/sci.h"
#include "sci/sfx/core.h"
#include "sci/sfx/iterator.h"
diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp
index 5c458b42002..12f6850e7f4 100644
--- a/engines/sci/sfx/iterator.cpp
+++ b/engines/sci/sfx/iterator.cpp
@@ -31,7 +31,6 @@
#include "sci/sfx/iterator_internal.h"
#include "sci/engine/state.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/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_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) {
while (nr-- > 0)
fprintf(stderr, "\t");
diff --git a/engines/sci/sfx/seq/gm.cpp b/engines/sci/sfx/seq/gm.cpp
index 40f6a602b8f..2fe5675150c 100644
--- a/engines/sci/sfx/seq/gm.cpp
+++ b/engines/sci/sfx/seq/gm.cpp
@@ -25,7 +25,6 @@
#include "common/util.h"
-#include "sci/tools.h"
#include "sci/sfx/sequencer.h"
#include "sci/sfx/device.h"
#include "sci/sfx/seq/instrument-map.h"
diff --git a/engines/sci/sfx/seq/instrument-map.h b/engines/sci/sfx/seq/instrument-map.h
index c223e68a33a..1e8a63076b7 100644
--- a/engines/sci/sfx/seq/instrument-map.h
+++ b/engines/sci/sfx/seq/instrument-map.h
@@ -28,7 +28,6 @@
#ifndef SCI_SFX_SEQ_INSTRUMENT_MAP_H
#define SCI_SFX_SEQ_INSTRUMENT_MAP_H
-#include "sci/tools.h"
#include "sci/sfx/device.h"
namespace Sci {
diff --git a/engines/sci/sfx/seq/sequencers.cpp b/engines/sci/sfx/seq/sequencers.cpp
index 1a0cd68c2d9..98dde97652e 100644
--- a/engines/sci/sfx/seq/sequencers.cpp
+++ b/engines/sci/sfx/seq/sequencers.cpp
@@ -24,7 +24,6 @@
*/
#include "../sequencer.h"
-#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/sfx/softseq.h b/engines/sci/sfx/softseq.h
index 32ad98f4b98..31741785ae3 100644
--- a/engines/sci/sfx/softseq.h
+++ b/engines/sci/sfx/softseq.h
@@ -29,7 +29,6 @@
#include "common/error.h"
#include "sci/sfx/sfx_pcm.h"
#include "sci/sfx/sequencer.h"
-#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/sfx/softseq/adlib.cpp b/engines/sci/sfx/softseq/adlib.cpp
index 7343ba12375..15e1ed90897 100644
--- a/engines/sci/sfx/softseq/adlib.cpp
+++ b/engines/sci/sfx/softseq/adlib.cpp
@@ -24,7 +24,6 @@
*/
#include "sci/sci.h"
-#include "sci/tools.h"
#include "sci/sfx/iterator.h"
#include "sound/fmopl.h"
diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp
index ff4057be3af..60942011697 100644
--- a/engines/sci/sfx/softseq/amiga.cpp
+++ b/engines/sci/sfx/softseq/amiga.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sci/tools.h"
#include "sci/sfx/softseq.h"
#include "common/file.h"
diff --git a/engines/sci/sfx/songlib.cpp b/engines/sci/sfx/songlib.cpp
index 0fe6440e7a4..7cf26ff4534 100644
--- a/engines/sci/sfx/songlib.cpp
+++ b/engines/sci/sfx/songlib.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sci/tools.h"
#include "sci/sfx/core.h"
#include "sci/sfx/iterator.h"
diff --git a/engines/sci/tools.cpp b/engines/sci/tools.cpp
deleted file mode 100644
index b35c6ce7b62..00000000000
--- a/engines/sci/tools.cpp
+++ /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
- * 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
diff --git a/engines/sci/tools.h b/engines/sci/tools.h
deleted file mode 100644
index b0d30aadb76..00000000000
--- a/engines/sci/tools.h
+++ /dev/null
@@ -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