[Scummvm-git-logs] scummvm master -> 35515585df56966b08cc1d4ac3bda6c6735f403f

bluegr noreply at scummvm.org
Sat Mar 5 15:26:45 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
35515585df CHEWY: Switch to the new video code


Commit: 35515585df56966b08cc1d4ac3bda6c6735f403f
    https://github.com/scummvm/scummvm/commit/35515585df56966b08cc1d4ac3bda6c6735f403f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-05T17:26:29+02:00

Commit Message:
CHEWY: Switch to the new video code

This simplifies the video code significantly and allows us to
remove the old video code

Changed paths:
  R engines/chewy/file.cpp
  R engines/chewy/file.h
  R engines/chewy/flic.cpp
  R engines/chewy/flic.h
    engines/chewy/atds.cpp
    engines/chewy/data.cpp
    engines/chewy/data.h
    engines/chewy/defines.h
    engines/chewy/detail.cpp
    engines/chewy/detail.h
    engines/chewy/dialogs/cinema.cpp
    engines/chewy/dialogs/cinema.h
    engines/chewy/dialogs/credits.cpp
    engines/chewy/dialogs/files.cpp
    engines/chewy/dialogs/inventory.cpp
    engines/chewy/dialogs/main_menu.cpp
    engines/chewy/dialogs/main_menu.h
    engines/chewy/dialogs/options.cpp
    engines/chewy/globals.h
    engines/chewy/inits.cpp
    engines/chewy/io_game.cpp
    engines/chewy/main.cpp
    engines/chewy/module.mk
    engines/chewy/ngshext.h
    engines/chewy/ngstypes.cpp
    engines/chewy/ngstypes.h
    engines/chewy/r_event.cpp
    engines/chewy/room.cpp
    engines/chewy/room.h
    engines/chewy/rooms/room28.cpp
    engines/chewy/rooms/room28.h
    engines/chewy/rooms/room37.cpp
    engines/chewy/rooms/room37.h
    engines/chewy/rooms/room43.cpp
    engines/chewy/rooms/room43.h
    engines/chewy/rooms/room46.cpp
    engines/chewy/rooms/room51.cpp
    engines/chewy/rooms/room51.h
    engines/chewy/rooms/room54.cpp
    engines/chewy/rooms/room54.h
    engines/chewy/rooms/room55.cpp
    engines/chewy/rooms/room55.h
    engines/chewy/rooms/room56.cpp
    engines/chewy/rooms/room56.h
    engines/chewy/rooms/room64.cpp
    engines/chewy/rooms/room64.h
    engines/chewy/rooms/room87.cpp
    engines/chewy/rooms/room87.h
    engines/chewy/rooms/room90.cpp
    engines/chewy/rooms/room90.h
    engines/chewy/sound_player.cpp
    engines/chewy/video/cfo_decoder.cpp
    engines/chewy/video/video_player.cpp
    engines/chewy/video/video_player.h


diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index f308d00f02d..7de9976b109 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -24,7 +24,6 @@
 #include "chewy/atds.h"
 #include "chewy/defines.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/main.h"
 #include "chewy/sound.h"
@@ -317,7 +316,7 @@ void Atdsys::set_split_win(int16 nr, SplitStringInit *ssinit) {
 	_ssi[nr] = ssinit[0];
 }
 
-Stream *Atdsys::pool_handle(const char *fname) {
+Common::Stream *Atdsys::pool_handle(const char *fname) {
 	Common::File *f = new Common::File();
 	f->open(fname);
 	if (f->isOpen()) {
@@ -328,7 +327,7 @@ Stream *Atdsys::pool_handle(const char *fname) {
 	return f;
 }
 
-void Atdsys::set_handle(const char *fname, int16 mode, Stream *handle, int16 chunk_start, int16 chunk_anz) {
+void Atdsys::set_handle(const char *fname, int16 mode, Common::Stream *handle, int16 chunk_start, int16 chunk_anz) {
 	Common::SeekableReadStream *rs = dynamic_cast<Common::SeekableReadStream *>(handle);
 	ChunkHead Ch;
 	char *tmp_adr = atds_adr(fname, chunk_start, chunk_anz);
@@ -394,7 +393,7 @@ void Atdsys::open_handle(const char *fname, int16 mode) {
 }
 
 void Atdsys::close_handle(int16 mode) {
-	Stream *stream = _atdshandle[mode];
+	Common::Stream *stream = _atdshandle[mode];
 	if (stream) {
 		delete _atdshandle[mode];
 		_atdshandle[mode] = nullptr;
diff --git a/engines/chewy/data.cpp b/engines/chewy/data.cpp
index b9e591a10c4..da15be69111 100644
--- a/engines/chewy/data.cpp
+++ b/engines/chewy/data.cpp
@@ -24,7 +24,6 @@
 #include "chewy/data.h"
 #include "chewy/chewy.h"
 #include "chewy/defines.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 
 namespace Chewy {
@@ -35,7 +34,7 @@ Data::Data() {
 Data::~Data() {
 }
 
-uint16 Data::select_pool_item(Stream *stream, uint16 nr) {
+uint16 Data::select_pool_item(Common::Stream *stream, uint16 nr) {
 	Common::SeekableReadStream *rs = dynamic_cast<Common::SeekableReadStream *>(stream);
 
 	if (rs) {
@@ -57,7 +56,7 @@ uint16 Data::select_pool_item(Stream *stream, uint16 nr) {
 	return nr;
 }
 
-uint32 Data::load_tmf(Stream *handle, TmfHeader *song) {
+uint32 Data::load_tmf(Common::Stream *handle, TmfHeader *song) {
 	Common::SeekableReadStream *rs = dynamic_cast<Common::SeekableReadStream *>(handle);
 	uint32 size = 0;
 
diff --git a/engines/chewy/data.h b/engines/chewy/data.h
index 903ce69903d..3173197e972 100644
--- a/engines/chewy/data.h
+++ b/engines/chewy/data.h
@@ -36,8 +36,8 @@ public:
 	Data();
 	~Data();
 
-	uint16 select_pool_item(Stream *stream, uint16 nr);
-	uint32 load_tmf(Stream *stream, TmfHeader *song);
+	uint16 select_pool_item(Common::Stream *stream, uint16 nr);
+	uint32 load_tmf(Common::Stream *stream, TmfHeader *song);
 
 	uint32 get_poolsize(const char *fname, int16 chunk_start, int16 chunk_anz);
 };
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 16973b564dd..ecdb3e4e66b 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -549,7 +549,7 @@ enum SetupScreenMode {
 #define FCUT_132 132 // Wagon moving
 #define FCUT_133 133 // Howard and Chewy on wagon
 #define FCUT_134 134 // Red spaceships (custom callback: flic_user_function)
-#define FCUT_135 135 // Red spaceships (custom callback: flic_user_function)
+#define FCUT_135 135 // Intro - red spaceships (custom callback: flic_user_function)
 #define FCUT_136 136 // Red spaceship shooting spaceship (custom callback: flic_user_function)
 #define FCUT_137 137 // Dogfight between red spaceship and spaceship (custom callback: flic_user_function)
 #define FCUT_138 138 // Spaceships flying from F5 (custom callback: flic_user_function)
diff --git a/engines/chewy/detail.cpp b/engines/chewy/detail.cpp
index b502af22beb..e709371486d 100644
--- a/engines/chewy/detail.cpp
+++ b/engines/chewy/detail.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "chewy/detail.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/sound.h"
 #include "chewy/resource.h"
diff --git a/engines/chewy/detail.h b/engines/chewy/detail.h
index 0c517350d9a..3cd015a01e6 100644
--- a/engines/chewy/detail.h
+++ b/engines/chewy/detail.h
@@ -23,7 +23,6 @@
 #define CHEWY_DETAIL_H
 
 #include "chewy/defines.h"
-#include "chewy/file.h"
 #include "chewy/ngshext.h"
 
 namespace Chewy {
diff --git a/engines/chewy/dialogs/cinema.cpp b/engines/chewy/dialogs/cinema.cpp
index cae7ab12496..0fc7b7897d8 100644
--- a/engines/chewy/dialogs/cinema.cpp
+++ b/engines/chewy/dialogs/cinema.cpp
@@ -21,7 +21,6 @@
 
 #include "chewy/dialogs/cinema.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/main.h"
 #include "chewy/sound.h"
@@ -165,9 +164,7 @@ void Cinema::execute() {
 			_G(fx)->blende1(_G(workptr), _G(screen0), _G(pal), 150, 0, 0);
 			print_rows(546 + topIndex);
 
-			_G(flc)->set_custom_user_function(cut_serv);
 			flic_cut(CINEMA_FLICS[topIndex + selected]);
-			_G(flc)->remove_custom_user_function();
 			_G(fontMgr)->setFont(_G(font6));
 			showCur();
 			delay = 0;
@@ -206,15 +203,5 @@ void Cinema::execute() {
 	_G(uhr)->resetTimer(0, 5);
 }
 
-int16 Cinema::cut_serv(int16 frame) {
-	if (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE) {
-		_G(sndPlayer)->stopMod();
-		g_engine->_sound->stopAllSounds();
-		return -1;
-	}
-
-	return 0;
-}
-
 } // namespace Dialogs
 } // namespace Chewy
diff --git a/engines/chewy/dialogs/cinema.h b/engines/chewy/dialogs/cinema.h
index 9896169021c..80474d506ee 100644
--- a/engines/chewy/dialogs/cinema.h
+++ b/engines/chewy/dialogs/cinema.h
@@ -28,9 +28,6 @@ namespace Chewy {
 namespace Dialogs {
 
 class Cinema {
-private:
-	static int16 cut_serv(int16 frame);
-
 public:
 	static void execute();
 };
diff --git a/engines/chewy/dialogs/credits.cpp b/engines/chewy/dialogs/credits.cpp
index 28e0177e1c4..82235b14814 100644
--- a/engines/chewy/dialogs/credits.cpp
+++ b/engines/chewy/dialogs/credits.cpp
@@ -21,7 +21,6 @@
 
 #include "chewy/dialogs/credits.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/main.h"
 #include "chewy/text.h"
diff --git a/engines/chewy/dialogs/files.cpp b/engines/chewy/dialogs/files.cpp
index 1172ba2e223..dc257629caf 100644
--- a/engines/chewy/dialogs/files.cpp
+++ b/engines/chewy/dialogs/files.cpp
@@ -23,7 +23,6 @@
 #include "chewy/dialogs/files.h"
 #include "chewy/dialogs/options.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 
 namespace Chewy {
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 5de0e5aadec..a3e5772bfa1 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -23,7 +23,6 @@
 #include "chewy/rooms/room44.h"
 #include "chewy/rooms/room58.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/main.h"
 #include "chewy/menus.h"
diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp
index f163f8a35e3..3143e4836f8 100644
--- a/engines/chewy/dialogs/main_menu.cpp
+++ b/engines/chewy/dialogs/main_menu.cpp
@@ -172,22 +172,6 @@ void MainMenu::animate() {
 	g_events->update();
 }
 
-int16 MainMenu::creditsFn(int16 key) {
-	if (key == 32 || key == 72 || key == 92 ||
-		key == 128 || key == 165 || key == 185 ||
-		key == 211 || key == 248 || key == 266) {
-		for (int idx = 0; idx < 2000; ++idx) {
-			if (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE)
-				return -1;
-			g_events->update();
-		}
-		return 0;
-
-	} else {
-		return _G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE ? -1 : 0;
-	}
-}
-
 void MainMenu::startGame() {
 	hideCur();
 	animate();
diff --git a/engines/chewy/dialogs/main_menu.h b/engines/chewy/dialogs/main_menu.h
index 41ef16e5453..97489cdf4ff 100644
--- a/engines/chewy/dialogs/main_menu.h
+++ b/engines/chewy/dialogs/main_menu.h
@@ -82,11 +82,6 @@ public:
 	 * Plays the game
 	 */
 	static void playGame();
-
-	/**
-	 * Support function for controlling the credits flic playback
-	 */
-	static int16 creditsFn(int16 key);
 };
 
 } // namespace Dialogs
diff --git a/engines/chewy/dialogs/options.cpp b/engines/chewy/dialogs/options.cpp
index 090c436b739..e28275e5b33 100644
--- a/engines/chewy/dialogs/options.cpp
+++ b/engines/chewy/dialogs/options.cpp
@@ -21,7 +21,6 @@
 
 #include "chewy/dialogs/options.h"
 #include "chewy/events.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/sound.h"
 
diff --git a/engines/chewy/file.cpp b/engines/chewy/file.cpp
deleted file mode 100644
index 68a0c582db8..00000000000
--- a/engines/chewy/file.cpp
+++ /dev/null
@@ -1,43 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "chewy/defines.h"
-#include "chewy/events.h"
-#include "chewy/file.h"
-#include "chewy/globals.h"
-#include "chewy/resource.h"
-
-namespace Chewy {
-
-bool File::readArray(Common::SeekableReadStream *src, uint16 *arr, size_t size) {
-	Common::SeekableReadStream *rs = src->readStream(size * 2);
-
-	bool result = (uint32)rs->size() == (size * 2);
-	if (result) {
-		for (; size > 0; --size, ++arr)
-			*arr = rs->readUint16LE();
-	}
-
-	delete rs;
-	return result;
-}
-
-} // namespace Chewy
diff --git a/engines/chewy/file.h b/engines/chewy/file.h
deleted file mode 100644
index 6ca8ddcca63..00000000000
--- a/engines/chewy/file.h
+++ /dev/null
@@ -1,44 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef CHEWY_FILE_H
-#define CHEWY_FILE_H
-
-#include "common/algorithm.h"
-#include "common/file.h"
-#include "common/textconsole.h"
-
-namespace Chewy {
-
-using Common::Stream;
-
-class File {
-public:
-	/**
-	 * Reads an array of uint16 values
-	 */
-	static bool readArray(Common::SeekableReadStream *src,
-		uint16 *arr, size_t size);
-};
-
-} // namespace Chewy
-
-#endif
diff --git a/engines/chewy/flic.cpp b/engines/chewy/flic.cpp
deleted file mode 100644
index aa5ea950f56..00000000000
--- a/engines/chewy/flic.cpp
+++ /dev/null
@@ -1,682 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "common/system.h"
-#include "common/memstream.h"
-#include "chewy/chewy.h"
-#include "chewy/events.h"
-#include "chewy/file.h"
-#include "chewy/flic.h"
-#include "chewy/globals.h"
-#include "chewy/sound.h"
-
-namespace Chewy {
-
-#define SOUND_SLOT_SIZE 500000
-
-void decode_flc(byte *vscr, const byte *dbuf) {
-	Common::MemoryReadStream src(dbuf, 0xffffffff);
-	int h = src.readUint16LE();
-	int val;
-
-	for (; h > 0; --h, vscr += SCREEN_WIDTH) {
-		// Get value, and handle any line skips if needed
-		for (val = src.readUint16LE(); val & 0x4000; val = src.readUint16LE()) {
-			vscr += (-val * SCREEN_WIDTH) & 0xffff;
-		}
-
-		// Iteration for pixels within the line
-		byte *dest = vscr;
-		for (; val > 0; --val) {
-			dest += src.readByte();
-			int8 b = src.readSByte();
-
-			if (b < 0) {
-				b = -b;
-				int pair = src.readUint16LE();
-				for (; b > 0; --b, dest += 2)
-					WRITE_LE_UINT16(dest, pair);
-
-			} else {
-				for (; b > 0; --b, dest += 2)
-					WRITE_LE_UINT16(dest, src.readUint16LE());
-			}
-		}
-	}
-}
-
-void decode_rle(byte *vscr, const byte *dbuf, int br, int h) {
-	for (; h > 0; --h, vscr += SCREEN_WIDTH) {
-		byte *dest = vscr;
-		++dbuf;		// Skip number of entries in line
-
-		int x;
-		for (x = 0; x < br; ) {
-			int8 len = (int8)*dbuf++;
-			if (len < 0) {
-				// Copy a number of bytes specified in lower 7 bits
-				len = -len;
-				Common::copy(dbuf, dbuf + len, dest);
-				dbuf += len;
-				dest += len;
-				x += len;
-			} else {
-				// Run length in the lower 7 bits of the next byte
-				byte v = *dbuf++;
-				if (len) {
-					Common::fill(dest, dest + len, v);
-					x += len;
-					dest += len;
-				}
-			}
-		}
-
-		assert(x == br);
-	}
-}
-
-
-Flic::Flic() {
-	Common::fill(&_sounds[0], &_sounds[50], (byte *)nullptr);
-	_soundBuffer = new byte[SOUND_SLOT_SIZE];
-}
-
-Flic::~Flic() {
-	delete[] _soundBuffer;
-}
-
-int16 Flic::decode_frame() {
-	ChunkHead chunk_header;
-	int16 action_ret = 0;
-
-	byte *tmp_buf = _loadBuffer;
-	if (_frameHeader.chunks != 0) {
-		_fadeFlag = false;
-		bool update_flag = false;
-		for (uint16 i = 0; i < _frameHeader.chunks; i++) {
-			Common::MemoryReadStream rs(tmp_buf, ChunkHead::SIZE());
-			chunk_header.load(&rs);
-
-			tmp_buf += ChunkHead::SIZE();
-			chunk_header.size -= ChunkHead::SIZE();
-
-			switch (chunk_header.type) {
-			case COLOR_256:
-				col256_chunk(tmp_buf);
-				break;
-
-			case COLOR_64:
-				col64_chunk(tmp_buf);
-				break;
-
-			case BYTE_RUN:
-				decode_rle(_virtScreen, tmp_buf,
-				           (int)_flicHeader.width,
-				           (int)_flicHeader.height);
-				update_flag = true;
-				break;
-
-			case DELTA_FLC:
-				decode_flc(_virtScreen, tmp_buf);
-				update_flag = true;
-				break;
-
-			case DELTA_FLI:
-				delta_chunk_byte(tmp_buf);
-
-				update_flag = true;
-				break;
-
-			case CLS:
-				_G(out)->setPointer(_virtScreen);
-				_G(out)->cls();
-				_G(out)->setPointer(nullptr);
-
-				update_flag = true;
-				break;
-
-			case UNPRESSED:
-				_G(out)->back2back(_loadBuffer, _virtScreen);
-
-				update_flag = true;
-				break;
-
-			case PSTAMP:
-				break;
-
-			default:
-				update_flag = true;
-				break;
-			}
-
-			tmp_buf += chunk_header.size;
-		}
-		if (update_flag != false) {
-			if (_flicUser) {
-				_G(out)->setPointer(_virtScreen);
-				action_ret = _flicUser(_currentFrame);
-				_G(out)->setPointer(nullptr);
-			}
-			_G(out)->back2screen(_virtScreen - 4);
-			if (_fadeFlag != false) {
-				_G(out)->einblenden(_fadePal, _fadeDelay);
-				_fadeFlag = false;
-			}
-		}
-	}
-
-	return action_ret;
-}
-
-void Flic::col256_chunk(byte *tmp) {
-	int packets = *(int16 *)tmp;
-	tmp += 2;
-
-	if (_clsFlag == true)
-		_G(out)->cls();
-	else
-		_clsFlag = true;
-
-	if (tmp[1] == 0) {
-		tmp += 2;
-		for (int i = 0; i < PALETTE_SIZE; i++)
-			tmp[i] >>= 2;
-		if (_fadeFlag == false)
-			_G(out)->setPalette(tmp);
-		else {
-			memset(_fadePal, 0, PALETTE_SIZE);
-			_G(out)->setPalette(_fadePal);
-			memcpy(_fadePal, tmp, PALETTE_SIZE);
-		}
-	} else {
-		byte col = 0;
-		for (int count = 0; count < packets; count++) {
-			col += *tmp++;
-			byte anz = *tmp++;
-			for (int i = 0; i < anz; i++) {
-				byte r = *tmp++ >> 2;
-				byte g = *tmp++ >> 2;
-				byte b = *tmp++ >> 2;
-				_G(out)->raster_col(col, r, g, b);
-				++col;
-			}
-		}
-	}
-}
-
-void Flic::col64_chunk(byte *tmp) {
-	int packets = *((int16 *)tmp);
-	tmp += 2;
-
-	if (_clsFlag == true)
-		_G(out)->cls();
-	else
-		_clsFlag = true;
-
-	if (!tmp[1]) {
-		if (_fadeFlag == false)
-			_G(out)->setPalette(tmp + 2);
-		else {
-			memset(_fadePal, 0, PALETTE_SIZE);
-			_G(out)->setPalette(_fadePal);
-			memcpy(_fadePal, tmp + 2, PALETTE_SIZE);
-		}
-	} else {
-		byte col = 0;
-		for (int count = 0; count < packets; count++) {
-			col += *tmp++;
-			byte anz = *tmp++;
-			for (int i = 0; i < anz; i++) {
-				byte r = *tmp++ >> 2;
-				byte g = *tmp++ >> 2;
-				byte b = *tmp++ >> 2;
-				_G(out)->raster_col(col, r, g, b);
-				++col;
-			}
-		}
-	}
-}
-
-void Flic::delta_chunk_byte(byte *tmp) {
-	byte last_byte = 0;
-	bool last_flag;
-	byte *abl = _virtScreen;
-	short int *ipo = (short int *)tmp;
-	short int rest_height = *ipo++;
-	tmp += 2;
-	for (short int i = 0; (i < rest_height) && (i < 200); i++) {
-		byte *tabl = abl;
-		short int mode_word = *ipo++;
-		if (mode_word & 0x4000) {
-			mode_word = -mode_word;
-			abl += (int16)(mode_word * _flicHeader.width);
-			tabl = abl;
-			mode_word = *ipo++;
-		}
-		if (mode_word & 0x8000) {
-			last_byte = (byte)(mode_word & 0xff);
-			last_flag = true;
-			mode_word = *ipo++;
-		} else
-			last_flag = false;
-		tmp = (byte *)ipo;
-		if (mode_word) {
-			short int pcount = 0;
-			for (short int j = 0; (pcount < mode_word) && (j <= _flicHeader.width); ++pcount) {
-				byte skip = *tmp++;
-				abl += skip;
-				signed char tmp_count = (signed char)*tmp++;
-				short signed int count = (short signed int)tmp_count;
-				if (count > 0) {
-					count <<= 1;
-					while ((count) && (j < _flicHeader.width)) {
-						*abl++ = *tmp++;
-						++j;
-						--count;
-					}
-				} else {
-					count = -count;
-					short int data = *(short int *)tmp;
-					tmp += 2;
-					while ((count > 0) && (j < _flicHeader.width)) {
-						*((short int *)abl) = data;
-						abl += 2;
-						j += 2;
-						--count;
-					}
-				}
-			}
-			if (last_flag)
-				*abl++ = last_byte;
-		}
-		abl = tabl + _flicHeader.width;
-		ipo = (short int *)tmp;
-	}
-}
-
-int16 Flic::custom_play(CustomInfo *ci) {
-	int16 ret = 0;
-
-	_cInfo = ci;
-	_loadBuffer = ci->TempArea;
-	_virtScreen = ci->VirtScreen + 4;
-	_music = ci->MusicSlot;
-	_sound = _soundBuffer;
-
-	Common::SeekableReadStream *rs = dynamic_cast<Common::SeekableReadStream *>(ci->Handle);
-	if (rs) {
-		if (_customHeader.load(rs)) {
-			if (!scumm_strnicmp(_customHeader.id, "CFO", 4)) {
-				_clsFlag = false;
-				_fadeFlag = false;
-				_fadeDelay = 0;
-				_currentFrame = 0;
-
-				for (uint16 i = 0; (i < _customHeader.frames) && (ret >= 0); i++) {
-					if (!_customFrame.load(rs)) {
-						error("flic error");
-					} else {
-						if ((_customFrame.type != PREFIX) && (_customFrame.type != CUSTOM)) {
-							uint32 start = g_system->getMillis() + _customHeader.speed;
-							if (_customFrame.size) {
-								if (rs->read(_loadBuffer, _customFrame.size) != _customFrame.size) {
-									error("flic error");
-								} else {
-									ret = decode_cframe();
-								}
-							}
-
-							// Show the next frame
-							g_screen->update();
-
-							// Loop until the frame time expires
-							uint32 ende;
-							do {
-								ende = g_system->getMillis();
-								g_events->update();
-								SHOULD_QUIT_RETURN0;
-							} while (ende <= start);
-							++_currentFrame;
-
-						} else if (_customFrame.type == CUSTOM) {
-							decode_custom_frame(
-								dynamic_cast<Common::SeekableReadStream *>(ci->Handle));
-
-						} else {
-							_G(out)->raster_col(255, 63, 63, 63);
-							_G(out)->printxy(0, 0, 255, 0, 0, "Unknown Frame Type");
-							taste;
-						}
-					}
-				}
-			}
-		}
-	} else {
-		error("flic error");
-	}
-
-	return ret;
-}
-
-void Flic::decode_custom_frame(Common::SeekableReadStream *handle) {
-	uint16 para[10];
-	TmfHeader *th = (TmfHeader *)_music;
-
-	for (uint16 i = 0; (i < _customFrame.chunks); i++) {
-		ChunkHead chead;
-		if (!chead.load(handle)) {
-			error("flic error");
-		}
-
-		switch (chead.type) {
-		case FADE_IN:
-			error("decode_custom_frame: Unused frame type FADE_IN found");
-			break;
-
-		case FADE_OUT:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				_G(out)->ausblenden(para[0]);
-			break;
-
-		case LOAD_MUSIC:
-			if (handle->read(_music, chead.size) != chead.size) {
-				error("flic error");
-			} else {
-				byte *tmp = _music;
-				tmp += sizeof(TmfHeader);
-				tmp += ((uint32)th->pattern_anz) * 1024l;
-				for (uint16 j = 0; j < 31; j++) {
-					if (th->instrument[j].laenge) {
-						th->ipos[j] = tmp;
-						tmp += th->instrument[j].laenge;
-					}
-				}
-			}
-
-			break;
-
-		case LOAD_RAW:
-			error("decode_custom_frame: Unused frame type LOAD_RAW found");
-			break;
-
-		case LOAD_VOC:
-			if (!File::readArray(handle, &para[0], 1) ||
-				handle->read(_sound, chead.size - 2) != (chead.size - 2)) {
-				error("flic error");
-			} else {
-				_sounds[para[0]] = _sound;
-				_sSize[para[0]] = chead.size - 2;
-				_sound += chead.size;
-			}
-			break;
-
-		case PLAY_MUSIC:
-			if (!strncmp(th->id, "TMF", 4))
-#ifndef AIL
-				snd->playMod(th);
-#else
-				_G(sndPlayer)->playMod(th);
-#endif
-
-			break;
-
-		case PLAY_SEQ:
-			error("decode_custom_frame: Unused frame type PLAY_SEQ found");
-			break;
-
-		case PLAY_PATTERN:
-			error("decode_custom_frame: Unused frame type PLAY_PATTERN found");
-			break;
-
-		case STOP_MUSIC:
-#ifndef AIL
-			snd->stopMod();
-#else
-			_G(sndPlayer)->stopMod();
-#endif
-			break;
-
-		case WAIT_MSTOP: {
-			musik_info mi;
-			do {
-#ifndef AIL
-				snd->getMusicInfo(&mi);
-#else
-				_G(sndPlayer)->getMusicInfo(&mi);
-#endif
-			} while (mi.musik_playing != 0);
-			}
-			break;
-
-		case SET_MVOL:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				g_engine->_sound->setMusicVolume(para[0] * Audio::Mixer::kMaxChannelVolume / 120);
-			break;
-
-		case SET_LOOPMODE:
-			error("decode_custom_frame: Unused frame type SET_LOOPMODE found");
-			break;
-
-		case PLAY_RAW:
-			break;
-
-		case PLAY_VOC:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else {
-				uint16 number = para[0];
-				uint16 channel = para[1];
-				uint16 volume = para[2] * Audio::Mixer::kMaxChannelVolume / 63;
-				uint16 repeat = para[3];
-				assert(number < MAX_SOUND_EFFECTS);
-
-				Chewy::Sound *sound = g_engine->_sound;
-				sound->setSoundVolume(volume);
-				sound->playSound(_sounds[number], _sSize[number], channel, repeat, DisposeAfterUse::NO);
-			}
-			break;
-
-		case SET_SVOL:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				g_engine->_sound->setSoundVolume(para[0]);
-			break;
-
-		case SET_CVOL:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				g_engine->_sound->setSoundChannelVolume(para[0], para[1]);
-			break;
-
-		case FREE_EFFECT:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				free_sound(para[0]);
-			break;
-
-		case MFADE_IN:
-			error("decode_custom_frame: Unused frame type MFADE_IN found");
-			break;
-
-		case MFADE_OUT:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-#ifndef AIL
-				snd->fadeOut(para[0]);
-#else
-				_G(sndPlayer)->fadeOut(para[0]);
-#endif
-			break;
-
-		case SET_STEREO:
-			if (!File::readArray(handle, &para[0], chead.size / 2)) {
-				error("flic error");
-			} else
-				g_engine->_sound->setSoundChannelBalance(para[0], para[1]);
-			break;
-
-		case SET_SPEED:
-			error("decode_custom_frame: Unused frame type SET_SPEED found");
-			break;
-
-		case CLEAR_SCREEN:
-			_G(out)->setPointer(_virtScreen);
-			_G(out)->cls();
-			_G(out)->setPointer(nullptr);
-			_G(out)->cls();
-			break;
-
-		default: {
-			Common::String err = Common::String::format("Unknown Chunk %d ", chead.type);
-			_G(out)->printxy(0, 10, 255, 0, 0, err.c_str());
-			break;
-		}
-		}
-	}
-}
-
-int16 Flic::decode_cframe() {
-	byte *tmp_buf = _loadBuffer;
-	int16 update_flag = false;
-	int16 action_ret = 0;
-
-	if (_customFrame.chunks != 0) {
-		for (uint16 i = 0; i < _customFrame.chunks; i++) {
-			Common::MemoryReadStream rs(tmp_buf, ChunkHead::SIZE());
-			ChunkHead chunk_header;
-			chunk_header.load(&rs);
-
-			tmp_buf += ChunkHead::SIZE();
-			chunk_header.size -= ChunkHead::SIZE();
-
-			switch (chunk_header.type) {
-			case COLOR_256:
-				col256_chunk(tmp_buf);
-				break;
-
-			case COLOR_64:
-				break;
-
-			case BYTE_RUN:
-				decode_rle(_virtScreen, tmp_buf,
-				    _customHeader.width, _customHeader.height);
-				update_flag = true;
-				break;
-
-			case DELTA_FLC:
-				decode_flc(_virtScreen, tmp_buf);
-				update_flag = true;
-
-				break;
-			case DELTA_FLI:
-				break;
-
-			case CLS:
-				_G(out)->setPointer(_virtScreen);
-				_G(out)->cls();
-				_G(out)->setPointer(nullptr);
-
-				update_flag = true;
-				break;
-
-			case UNPRESSED:
-				_G(out)->back2back(_loadBuffer, _virtScreen);
-
-				update_flag = true;
-				break;
-
-			case PSTAMP:
-				break;
-
-			default:
-				_G(out)->raster_col(255, 63, 63, 63);
-				_G(out)->printxy(0, 0, 255, 0, 0, "Unknown CHUNK");
-
-				update_flag = true;
-				break;
-			}
-
-			tmp_buf += chunk_header.size;
-		}
-
-		if (update_flag != false) {
-			if (_customUser) {
-				_G(out)->back2back(_virtScreen, _loadBuffer);
-				_G(out)->setPointer(_virtScreen);
-				action_ret = _customUser(_currentFrame);
-				_G(out)->setPointer(nullptr);
-				_G(out)->back2screen(_virtScreen - 4);
-				_G(out)->back2back(_loadBuffer, _virtScreen);
-			} else
-				_G(out)->back2screen(_virtScreen - 4);
-			if (_fadeFlag != false) {
-				_G(out)->einblenden(_fadePal, _fadeDelay);
-				_fadeFlag = false;
-			}
-		}
-	}
-
-	return action_ret;
-}
-
-void Flic::free_sound(int16 nr) {
-	byte *fsound = _sounds[nr];
-	long fsize = _sSize[nr];
-	if ((fsound != 0) && (fsize != 0)) {
-		long copysize = SOUND_SLOT_SIZE;
-		copysize -= (long)(fsound - _soundBuffer);
-		memmove(fsound, fsound + fsize, copysize);
-		for (int16 i = 0; i < 50; i++) {
-			if (_sounds[i] == fsound) {
-				_sounds[i] = 0;
-				_sSize[i] = 0;
-			} else if (_sounds[i] > fsound)
-				_sounds[i] -= fsize;
-		}
-		_sound -= fsize;
-	}
-}
-
-void Flic::set_custom_user_function(int16(*user_funktion)(int16 frame)) {
-	_customUser = user_funktion;
-}
-
-void Flic::remove_custom_user_function() {
-	_customUser = nullptr;
-}
-
-void Flic::set_flic_user_function(int16(*user_funktion)(int16 frame)) {
-	_flicUser = user_funktion;
-}
-
-void Flic::remove_flic_user_function() {
-	_flicUser = nullptr;
-}
-
-} // namespace Chewy
diff --git a/engines/chewy/flic.h b/engines/chewy/flic.h
deleted file mode 100644
index 54e17b03109..00000000000
--- a/engines/chewy/flic.h
+++ /dev/null
@@ -1,122 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef CHEWY_FLIC_H
-#define CHEWY_FLIC_H 1
-
-#include "chewy/ngshext.h"
-#include "chewy/ngstypes.h"
-
-namespace Chewy {
-
-#define taste error("aborted")
-
-#define FLI 0xAF11
-#define FLC 0xAF12
-#define BEENDEN 1
-#define LOOPEN 2
-#define PREFIX 0xF100
-#define FRAME 0xF1FA
-enum ChunkTypes {
-	COLOR_256 = 4,
-	DELTA_FLC = 7,
-	COLOR_64 = 11,
-	DELTA_FLI = 12,
-	CLS = 13,
-	BYTE_RUN = 15,
-	UNPRESSED = 16,
-	PSTAMP = 18
-};
-
-#define CUSTOM 0xFAF1
-enum CustomTypes {
-	FADE_IN = 0,
-	FADE_OUT = 1,
-	LOAD_MUSIC = 2,
-	LOAD_RAW = 3,
-	LOAD_VOC = 4,
-	PLAY_MUSIC = 5,
-	PLAY_SEQ = 6,
-	PLAY_PATTERN = 7,
-	STOP_MUSIC = 8,
-	WAIT_MSTOP = 9,
-	SET_MVOL = 10,
-	SET_LOOPMODE = 11,
-	PLAY_RAW = 12,
-	PLAY_VOC = 13,
-	SET_SVOL = 14,
-	SET_CVOL = 15,
-	FREE_EFFECT = 16,
-	MFADE_IN = 17,
-	MFADE_OUT = 18,
-	SET_STEREO = 19,
-	SET_SPEED = 20,
-	CLEAR_SCREEN = 21
-};
-
-extern void decode_flc(byte *vscr, const byte *dbuf);
-extern void decode_rle(byte *vscr, const byte *dbuf, int br, int h);
-
-class Flic {
-public:
-	Flic();
-	~Flic();
-
-	void set_flic_user_function(int16(*user_funktion)(int16 key));
-	void remove_flic_user_function();
-	int16 custom_play(CustomInfo *ci);
-	void set_custom_user_function(int16(*user_funktion)(int16 key));
-	void remove_custom_user_function();
-
-private:
-	int16 decode_frame();
-	int16 decode_cframe();
-	void col256_chunk(byte *tmp);
-	void col64_chunk(byte *tmp);
-	void delta_chunk_byte(byte *tmp);
-
-	void decode_custom_frame(Common::SeekableReadStream *handle);
-	void free_sound(int16 nr);
-
-	byte *_loadBuffer;
-	byte *_virtScreen;
-	byte *_music;
-	byte *_sound;
-	byte *_soundBuffer;
-	CustomInfo *_cInfo;
-	FlicHead _flicHeader;
-	CustomFlicHead _customHeader;
-	CustomFrameHead _customFrame;
-	FrameHead _frameHeader;
-	bool _fadeFlag;
-	bool _clsFlag;
-	byte _fadePal[PALETTE_SIZE];
-	int16 _fadeDelay;
-	byte *_sounds[50];
-	uint32 _sSize[50];
-	int16 _currentFrame;
-	int16(*_customUser)(int16) = nullptr;
-	int16(*_flicUser)(int16) = nullptr;
-};
-
-} // namespace Chewy
-
-#endif
diff --git a/engines/chewy/globals.h b/engines/chewy/globals.h
index 08a1b79e63f..7489051f47f 100644
--- a/engines/chewy/globals.h
+++ b/engines/chewy/globals.h
@@ -164,7 +164,7 @@ public:
 	int16 _frequenz = 0;
 	int16 _currentSong = -1;
 	bool _savegameFlag = false;
-	Stream *_music_handle = nullptr;
+	Common::Stream *_music_handle = nullptr;
 	int16 _EndOfPool = 0;
 	int _timer_action_ctr = 0;
 
@@ -204,7 +204,6 @@ public:
 	Detail *_det = nullptr;
 	Effect *_fx = nullptr;
 	Atdsys *_atds = nullptr;
-	Flic *_flc = nullptr;
 	MovClass *_mov = nullptr;
 
 	ObjMov _spieler_vector[MAX_PERSON];
@@ -290,9 +289,6 @@ public:
 	int16 _tmp_menu = 0;
 	int16 _show_invent_menu = 0;
 
-	// r_event.cpp
-	int16 _flic_val1 = 0, _flic_val2 = 0;
-
 	// sprite.cpp
 	int16 _z_count = 0;
 	ZObjSort _z_obj_sort[MAX_ZOBJ];
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index 813cbfe4a79..152f41e24ce 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -23,7 +23,6 @@
 #include "common/memstream.h"
 #include "chewy/chewy.h"
 #include "chewy/defines.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/main.h"
 #include "chewy/sound.h"
@@ -44,7 +43,6 @@ void standard_init() {
 	_G(det) = new Detail();
 	_G(atds) = new Atdsys();
 	_G(sndPlayer) = new SoundPlayer();
-	_G(flc) = new Flic();
 	_G(mov) = new MovClass();
 
 	_G(out)->init();
@@ -197,7 +195,7 @@ void init_atds() {
 	_G(atds)->close_handle(ATDS_HANDLE);
 
 	// New set up
-	Stream *handle = _G(atds)->pool_handle(ATDS_TXT);
+	Common::Stream *handle = _G(atds)->pool_handle(ATDS_TXT);
 	_G(atds)->set_handle(ATDS_TXT, ATS_DATA, handle, ATS_TAP_OFF, ATS_TAP_MAX);
 	_G(atds)->init_ats_mode(ATS_DATA, _G(spieler).Ats);
 	_G(atds)->set_handle(ATDS_TXT, INV_ATS_DATA, handle, INV_TAP_OFF, INV_TAP_MAX);
@@ -287,7 +285,6 @@ void tidy() {
 	delete _G(iog);
 	delete _G(cur);
 	delete _G(mov);
-	delete _G(flc);
 	delete _G(sndPlayer);
 	delete _G(atds);
 	delete _G(det);
@@ -305,7 +302,6 @@ void tidy() {
 	_G(iog) = nullptr;
 	_G(cur) = nullptr;
 	_G(mov) = nullptr;
-	_G(flc) = nullptr;
 	_G(sndPlayer) = nullptr;
 	_G(atds) = nullptr;
 	_G(det) = nullptr;
diff --git a/engines/chewy/io_game.cpp b/engines/chewy/io_game.cpp
index 547c32555c8..fe8f6535abb 100644
--- a/engines/chewy/io_game.cpp
+++ b/engines/chewy/io_game.cpp
@@ -23,7 +23,6 @@
 #include "chewy/chewy.h"
 #include "chewy/events.h"
 #include "chewy/globals.h"
-#include "chewy/file.h"
 #include "chewy/io_game.h"
 
 namespace Chewy {
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index cfaa370c724..86ff013f709 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -75,7 +75,6 @@ void alloc_buffers() {
 	_G(workpage) = (byte *)MALLOC(64004l);
 	_G(pal) = (byte *)MALLOC(768l);
 	_G(cur_back) = (byte *)MALLOC(16 * 16 + 4);
-	_G(Ci).VirtScreen = _G(workpage);
 	_G(Ci).TempArea = (byte *)MALLOC(64004l);
 	_G(det)->set_taf_ani_mem(_G(Ci).TempArea);
 	_G(Ci).MusicSlot = (byte *)MALLOC(MUSIC_SLOT_SIZE);
diff --git a/engines/chewy/module.mk b/engines/chewy/module.mk
index 8c03be8cfab..e93810a2839 100644
--- a/engines/chewy/module.mk
+++ b/engines/chewy/module.mk
@@ -10,8 +10,6 @@ MODULE_OBJS = \
 	effect.o \
 	events.o \
 	events_base.o \
-	file.o \
-	flic.o \
 	gedclass.o \
 	globals.o \
 	inits.o \
diff --git a/engines/chewy/ngshext.h b/engines/chewy/ngshext.h
index 79864da89fa..791f0ee65c9 100644
--- a/engines/chewy/ngshext.h
+++ b/engines/chewy/ngshext.h
@@ -27,7 +27,6 @@
 #include "chewy/mouse.h"
 #include "chewy/io_game.h"
 #include "chewy/cursor.h"
-#include "chewy/flic.h"
 #include "chewy/sound_player.h"
 
 #endif
diff --git a/engines/chewy/ngstypes.cpp b/engines/chewy/ngstypes.cpp
index 9ed3036a0de..b6dfb5e61d5 100644
--- a/engines/chewy/ngstypes.cpp
+++ b/engines/chewy/ngstypes.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "common/stream.h"
 #include "chewy/ngstypes.h"
 
 namespace Chewy {
@@ -70,39 +71,6 @@ bool GedChunkHeader::load(Common::SeekableReadStream *src) {
 	return true;
 }
 
-bool FlicHead::load(Common::SeekableReadStream *src) {
-	size = src->readUint32LE();
-	type = src->readUint16LE();
-	frames = src->readUint16LE();
-	width = src->readUint16LE();
-	height = src->readUint16LE();
-	depth = src->readUint16LE();
-	flags = src->readUint16LE();
-	speed = src->readUint32LE();
-	reserved1 = src->readUint16LE();
-	created = src->readUint32LE();
-	creator = src->readUint32LE();
-	updated = src->readUint32LE();
-	updater = src->readUint32LE();
-	aspect_dx = src->readUint16LE();
-	aspect_dy = src->readUint16LE();
-	src->read(reserved2, 38);
-	oframe1 = src->readUint32LE();
-	oframe2 = src->readUint32LE();
-	src->read(reserved3, 40);
-
-	return true;
-}
-
-bool FrameHead::load(Common::SeekableReadStream *src) {
-	size = src->readUint32LE();
-	type = src->readUint16LE();
-	chunks = src->readUint16LE();
-	src->read(reserved, 8);
-
-	return true;
-}
-
 bool ChunkHead::load(Common::SeekableReadStream *src) {
 	size = src->readUint32LE();
 	type = src->readUint16LE();
@@ -110,24 +78,4 @@ bool ChunkHead::load(Common::SeekableReadStream *src) {
 	return true;
 }
 
-bool CustomFlicHead::load(Common::SeekableReadStream *src) {
-	src->read(id, 4);
-	size = src->readUint32LE();
-	frames = src->readUint16LE();
-	width = src->readUint16LE();
-	height = src->readUint16LE();
-	speed = src->readUint32LE();
-	oframe1 = src->readUint32LE();
-
-	return true;
-}
-
-bool CustomFrameHead::load(Common::SeekableReadStream *src) {
-	size = src->readUint32LE();
-	type = src->readUint16LE();
-	chunks = src->readUint16LE();
-
-	return true;
-}
-
 } // namespace Chewy
diff --git a/engines/chewy/ngstypes.h b/engines/chewy/ngstypes.h
index 243916867c1..94b30903685 100644
--- a/engines/chewy/ngstypes.h
+++ b/engines/chewy/ngstypes.h
@@ -24,7 +24,6 @@
 
 #include "graphics/screen.h"
 #include "chewy/ngsdefs.h"
-#include "chewy/file.h"
 
 namespace Chewy {
 
@@ -142,40 +141,6 @@ struct CurAni {
 	int16 _delay = 0;
 };
 
-struct FlicHead {
-	uint32 size = 0;
-	uint16 type = 0;
-	uint16 frames = 0;
-	uint16 width = 0;
-	uint16 height = 0;
-	uint16 depth = 0;
-	uint16 flags = 0;
-	uint32 speed = 0;
-	uint16 reserved1 = 0;
-	uint32 created = 0;
-	uint32 creator = 0;
-	uint32 updated = 0;
-	uint32 updater = 0;
-	uint16 aspect_dx = 0;
-	uint16 aspect_dy = 0;
-	uint8 reserved2[38] = { 0 };
-	uint32 oframe1 = 0;
-	uint32 oframe2 = 0;
-	uint8 reserved3[40] = { 0 };
-
-	bool load(Common::SeekableReadStream *src);
-};
-
-struct FrameHead {
-	uint32 size = 0;
-	uint16 type = 0;
-	uint16 chunks = 0;
-	uint8 reserved[8] = { 0 };
-
-	bool load(Common::SeekableReadStream *src);
-	static constexpr int SIZE() { return 16; }
-};
-
 struct ChunkHead {
 	uint32 size = 0;
 	uint16 type = 0;
@@ -184,29 +149,7 @@ struct ChunkHead {
 	static constexpr int SIZE() { return 6; }
 };
 
-struct CustomFlicHead {
-	char id[4] = { 0 };
-	uint32 size = 0;
-	uint16 frames = 0;
-	uint16 width = 0;
-	uint16 height = 0;
-	uint32 speed = 0;
-	uint32 oframe1 = 0;
-
-	bool load(Common::SeekableReadStream *src);
-};
-
-struct CustomFrameHead {
-	uint32 size = 0;
-	uint16 type = 0;
-	uint16 chunks = 0;
-
-	bool load(Common::SeekableReadStream *src);
-};
-
 struct CustomInfo {
-	Stream *Handle = nullptr;
-	byte *VirtScreen = 0;
 	byte *TempArea = 0;
 	byte *MusicSlot = 0;
 	uint32 MaxMusicSize = 0;
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index 26734329139..4b8ca471e23 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -789,101 +789,47 @@ void print_rows(int16 id) {
 	}
 }
 
-int16 flic_user_function(int16 keys) {
-	if (_G(atds)->aadGetStatus() != -1) {
-		switch (_G(flic_val1)) {
-		case 579:
-		case 584:
-		case 588:
-		case 591:
-			_G(out)->raster_col(254, 63, 12, 46);
-			break;
-		default:
-			break;
-		}
-	}
-
-	_G(atds)->print_aad(_G(spieler).scrollx, _G(spieler).scrolly);
-	if (_G(flic_val1) == 593 && keys == 35)
-		_G(atds)->stopAad();
-	if (_G(flic_val1) == 594 && keys == 18)
-		_G(atds)->stopAad();
-
-	int ret = _G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE ? -1 : 0;
-	if (_G(flic_val2) == 140 && keys == 15)
-		ret = -2;
-	if (_G(flic_val2) == 144 && keys == 7)
-		ret = -2;
-	if (_G(flic_val2) == 145 || _G(flic_val2) == 142 ||
-			_G(flic_val2) == 141 || _G(flic_val2) == 146) {
-		if (_G(atds)->aadGetStatus() == -1)
-			ret = -2;
-	}
-
-	return ret;
-}
-
-static void flic_proc1() {
-	const int16 VALS1[] = {
-		135,  145,  142,  140,  145,  144,  142,  134,  148,  138,
-		143,  142,  146,  154,  142,  139,  146,  156,  157,  147,
-		153,  152,  141,  137,  136,  151,  151,  149,  150
-	};
-	const byte VALS2[] = {
-		1,  1,  0,  0,  0,  0,  0,  1,  1,  1,
-		1,  0,  0,  1,  1,  1,  1,  1,  0,  1,
-		1,  1,  1,  1,  0,  1,  0,  1,  0
+static void playIntroSequence() {
+	const int16 introVideo[] = {
+		FCUT_135, FCUT_145, FCUT_142, FCUT_140, FCUT_145,
+		FCUT_144, FCUT_142, FCUT_134, FCUT_148, FCUT_138,
+		FCUT_143, FCUT_142, FCUT_146, FCUT_154, FCUT_142,
+		FCUT_139, FCUT_146, FCUT_156, FCUT_157, FCUT_147,
+		FCUT_153, FCUT_152, FCUT_141, FCUT_137, FCUT_136,
+		FCUT_151, FCUT_151, FCUT_149, FCUT_150
 	};
-	const int16 VALS3[] = {
-		579, 580, 581,  -1, 582, -1, 583, 584, -1, -1,
-		585, 586, 587, 588, 589, -1, 590, 591, -1, -1,
-		 -1,  -1, 592, 593, 594, -1,  -1,  -1, -1
-	};
-	const byte VALS4[] = {
-		0,  1,  1,  0,  1,  0,  1,  0,  0,  0,
-		1,  1,  1,  0,  1,  0,  1,  0,  0,  0,
-		0,  0,  1,  0,  0,  0,  0,  0,  0
+	const int16 introDialog[] = {
+		579, 580, 581,  -1, 582,
+		 -1, 583, 584,  -1,  -1,
+		585, 586, 587, 588, 589,
+		 -1, 590, 591,  -1,  -1,
+		 -1,  -1, 592, 593, 594,
+		 -1,  -1,  -1,  -1
 	};
 	int16 ret = 0;
 
 	_G(atds)->load_atds(98, AAD_DATA);
-	_G(flc)->set_custom_user_function(flic_user_function);
-	load_room_music(258);
+
+	_G(out)->setPointer(nullptr);
+	_G(out)->cls();
 
 	for (int i = 0; i < 29 && ret != -1; ++i) {
-		if (VALS1[i] == 148)
+		if (introVideo[i] == FCUT_135)
+			load_room_music(258);
+		else if (introVideo[i] == FCUT_148)
 			load_room_music(259);
-		else if (VALS1[i] == 143)
+		else if (introVideo[i] == FCUT_143)
 			load_room_music(260);
-		if (VALS2[i]) {
-			_G(out)->setPointer(nullptr);
-			_G(out)->cls();
-		}
 
-		_G(flic_val1) = 0;
-		if (VALS3[i] != -1) {
-			start_aad(VALS3[i], -1);
-			_G(flic_val1) = VALS3[i];
-		}
-
-		bool flag;
-		do {
-			SHOULD_QUIT_RETURN;
-			_G(flic_val2) = VALS1[i];
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, _G(flic_val2));
-			ret = _G(flc)->custom_play(&_G(Ci));
-#else
-			g_engine->_video->playVideo(_G(flic_val2));
-#endif
-			flag = VALS4[i] && _G(atds)->aadGetStatus() != -1;
-		} while (flag && ret != -1 && ret != -2);
+		if (introDialog[i] != -1)
+			start_aad(introDialog[i], -1);
 
+		ret = g_engine->_video->playVideo(introVideo[i]) ? 0 : -1;
 		_G(atds)->stopAad();
+		SHOULD_QUIT_RETURN;
 	}
 
-	_G(flc)->remove_custom_user_function();
-	if (ret == -1) {
+	//if (ret == -1) {
 		_G(out)->setPointer(nullptr);
 		_G(out)->cls();
 		_G(out)->raster_col(254, 62, 35, 7);
@@ -895,7 +841,7 @@ static void flic_proc1() {
 		} else {
 			delay(6000);
 		}
-	}
+	//}
 
 	_G(out)->setPointer(_G(workptr));
 	_G(out)->cls();
@@ -915,256 +861,74 @@ void flic_cut(int16 nr) {
 	_G(det)->disable_room_sound();
 	g_engine->_sound->stopAllSounds();
 	g_events->delay(50);
-//#ifndef NEW_VIDEO_CODE
-	Common::File *f = new Common::File();
-	f->open("cut/cut.tap");
-	_G(Ci).Handle = f;
-//#endif
-
-	if (_G(Ci).Handle) {
-		switch (nr) {
-		case FCUT_SPACECHASE_18:
-			_G(sndPlayer)->setLoopMode(1);
-
-			for (i = 0; i < 11 && keepPlaying; i++) {
-				keepPlaying = g_engine->_video->playVideo(FCUT_SPACECHASE_18 + i);
-			}
-
-			_G(sndPlayer)->fadeOut(0);
-			_G(out)->ausblenden(1);
-			_G(out)->cls();
-			while (_G(sndPlayer)->musicPlaying());
-			_G(sndPlayer)->setLoopMode(_G(spieler).soundLoopMode);
-			break;
-
-		case FCUT_047:
-		case FCUT_048:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(nr == FCUT_047 ? Room37::cut_serv1 : Room37::cut_serv2);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_053:
-			for (i = 0; i < 3; ++i) {
-				g_engine->_video->playVideo(nr);
-				SHOULD_QUIT_RETURN;
-			}
-			break;
-
-		case FCUT_054:
-			g_engine->_video->playVideo(nr);
-			g_engine->_video->playVideo(nr);
-			break;
-
-		case FCUT_055:
-		case FCUT_056:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(nr == FCUT_055 ? Room28::cut_serv2 : Room28::cut_serv1);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_058:
-			load_room_music(255);
-			g_engine->_video->playVideo(FCUT_058);
-			g_engine->_video->playVideo(FCUT_059);
-
-			if (!_G(spieler).R43GetPgLady) {
-				g_engine->_video->playVideo(FCUT_060);
-			} else {
-					start_aad(623, -1);
-#ifndef NEW_VIDEO_CODE
-				_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-				_G(flc)->set_custom_user_function(Room43::setup_func);
-				_G(flc)->custom_play(&_G(Ci));
-				_G(flc)->remove_custom_user_function();
-#else
-				g_engine->_video->playVideo(FCUT_061);
-#endif
-
-				g_engine->_video->playVideo(FCUT_062);
-			}
-			_G(sndPlayer)->fadeOut(0);
-			_G(out)->ausblenden(1);
-			_G(out)->cls();
-			while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT);
-			break;
-
-		case FCUT_064:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_custom_user_function(Room28::cut_serv1);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_custom_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_065:
-			_G(sndPlayer)->stopMod();
-			_G(currentSong) = -1;
-			load_room_music(256);
-			_G(sndPlayer)->setLoopMode(1);
-			Room46::kloppe();
-			_G(sndPlayer)->setLoopMode(_G(spieler).soundLoopMode);
-			_G(currentSong) = -1;
-			break;
 
-		case FCUT_068:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(Room51::cut_serv);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_069:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(Room54::cut_serv);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_070:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(Room55::cut_serv);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_071:
-			_G(sndPlayer)->stopMod();
-			_G(currentSong) = -1;
-			g_engine->_video->playVideo(nr);
-			break;
-
-		case FCUT_078:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_flic_user_function(Room64::cut_sev);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_flic_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-		case FCUT_083:
-		case 1083:
-			for (i = 0; i < 2 && ret != -1; ++i) {
-				g_engine->_video->playVideo(FCUT_083);
-				SHOULD_QUIT_RETURN;
-			}
-			break;
+	switch (nr) {
+	case FCUT_SPACECHASE_18:
+		_G(sndPlayer)->setLoopMode(1);
 
-		case FCUT_089:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_custom_user_function(Room87::proc5);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_custom_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
-
-		case FCUT_095:
-			_G(flc)->set_custom_user_function(Room87::proc5);
-
-			while (_G(atds)->aadGetStatus() != -1 && !SHOULD_QUIT) {
-#ifndef NEW_VIDEO_CODE
-				_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-				_G(flc)->custom_play(&_G(Ci));
-#else
-				g_engine->_video->playVideo(nr);
-#endif
-			}
-
-			_G(flc)->remove_custom_user_function();
-			break;
+		for (i = 0; i < 11 && keepPlaying; i++) {
+			keepPlaying = g_engine->_video->playVideo(FCUT_SPACECHASE_18 + i);
+		}
 
-		case FCUT_107:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_custom_user_function(Room90::proc5);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_custom_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
+		_G(sndPlayer)->fadeOut(0);
+		_G(out)->ausblenden(1);
+		_G(out)->cls();
+		while (_G(sndPlayer)->musicPlaying());
+		_G(sndPlayer)->setLoopMode(_G(spieler).soundLoopMode);
+		break;
 
-		case FCUT_112:
-			g_engine->_sound->setMusicVolume(32 * Audio::Mixer::kMaxChannelVolume / 120);
-			g_engine->_video->playVideo(nr);
-			g_engine->_video->playVideo(nr);
-			g_engine->_sound->setMusicVolume(5 * Audio::Mixer::kMaxChannelVolume / 120);
-			break;
+	case FCUT_058:
+		load_room_music(255);
+		g_engine->_video->playVideo(FCUT_058);
+		g_engine->_video->playVideo(FCUT_059);
 
-		case FCUT_116:
-			for (i = 0; i < 6; ++i) {
-				g_engine->_video->playVideo(nr);
-				SHOULD_QUIT_RETURN;
-			}
-			break;
+		if (!_G(spieler).R43GetPgLady) {
+			g_engine->_video->playVideo(FCUT_060);
+		} else {
+			start_aad(623, -1);
+			g_engine->_video->playVideo(FCUT_061);
+			g_engine->_video->playVideo(FCUT_062);
+		}
 
-		case FCUT_133:
-		case 1123:
-			for (i = 0; i < 13 && ret != -1; ++i) {
-				ret = g_engine->_video->playVideo(FLIC_CUT_133[i]) ? 0 : -1;
-				SHOULD_QUIT_RETURN;
+		_G(sndPlayer)->fadeOut(0);
+		_G(out)->ausblenden(1);
+		_G(out)->cls();
+		while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT);
+		break;
 
-				if (i == 0 || i == 1) {
-					_G(out)->setPointer(nullptr);
-					_G(out)->cls();
-				}
-			}
-			break;
+	case FCUT_065:
+		_G(sndPlayer)->stopMod();
+		_G(currentSong) = -1;
+		load_room_music(256);
+		_G(sndPlayer)->setLoopMode(1);
+		Room46::kloppe();
+		_G(sndPlayer)->setLoopMode(_G(spieler).soundLoopMode);
+		_G(currentSong) = -1;
+		break;
 
-		case FCUT_135:
-			flic_proc1();
-			break;
+	case FCUT_112:
+		g_engine->_sound->setMusicVolume(32 * Audio::Mixer::kMaxChannelVolume / 120);
+		g_engine->_video->playVideo(nr);
+		g_engine->_sound->setMusicVolume(5 * Audio::Mixer::kMaxChannelVolume / 120);
+		break;
 
-		case FCUT_159:
-#ifndef NEW_VIDEO_CODE
-			_G(mem)->file->select_pool_item(_G(Ci).Handle, nr);
-			_G(flc)->set_custom_user_function(Dialogs::MainMenu::creditsFn);
-			_G(flc)->custom_play(&_G(Ci));
-			_G(flc)->remove_custom_user_function();
-#else
-			g_engine->_video->playVideo(nr);
-#endif
-			break;
+	case FCUT_133:
+		_G(out)->setPointer(nullptr);
+		_G(out)->cls();
 
-		default:
-			g_engine->_video->playVideo(nr);
-			break;
+		for (i = 0; i < 13 && ret != -1; ++i) {
+			ret = g_engine->_video->playVideo(FLIC_CUT_133[i]) ? 0 : -1;
+			SHOULD_QUIT_RETURN;
 		}
+		break;
 
-		delete _G(Ci).Handle;
-		_G(Ci).Handle = nullptr;
-	} else {
-		error("flic_cut error");
+	case FCUT_135:
+		playIntroSequence();
+		break;
+
+	default:
+		g_engine->_video->playVideo(nr);
+		break;
 	}
 
 	g_engine->_sound->stopSound();
@@ -1174,7 +938,7 @@ void flic_cut(int16 nr) {
 	g_engine->_sound->setSoundVolume(_G(spieler).SoundVol * Audio::Mixer::kMaxChannelVolume / 120);
 	g_engine->_sound->setMusicVolume(_G(spieler).MusicVol * Audio::Mixer::kMaxChannelVolume / 120);
 
-	if (nr < 1000 && nr != 135) {
+	if (nr != FCUT_135) {
 		load_room_music(_G(spieler)._personRoomNr[0]);
 
 		if (_G(spieler).SpeechSwitch)
diff --git a/engines/chewy/room.cpp b/engines/chewy/room.cpp
index 9fa311becbb..149790017bb 100644
--- a/engines/chewy/room.cpp
+++ b/engines/chewy/room.cpp
@@ -159,7 +159,7 @@ Room::~Room() {
 	free_ablage();
 }
 
-Stream *Room::open_handle(const char *fname1, int16 mode) {
+Common::Stream *Room::open_handle(const char *fname1, int16 mode) {
 	Common::File *f = new Common::File();
 	f->open(fname1);
 	if (f->isOpen()) {
diff --git a/engines/chewy/room.h b/engines/chewy/room.h
index 08eaaf58c20..ce296fa0893 100644
--- a/engines/chewy/room.h
+++ b/engines/chewy/room.h
@@ -84,7 +84,7 @@ public:
 	Room();
 	~Room();
 
-	Stream *open_handle(const char *fname, int16 mode);
+	Common::Stream *open_handle(const char *fname, int16 mode);
 	void loadRoom(RaumBlk *Rb, int16 room_nr, Spieler *player);
 	int16 load_tgp(int16 nr, RaumBlk *Rb, int16 tgp_idx, int16 mode, const char *fileName);
 	byte *get_ablage(int16 nr);
@@ -122,7 +122,7 @@ private:
 	int16 _ablageInfo[MAX_ABLAGE][2];
 
 	byte *_gedMem[MAX_ABLAGE];
-	Stream *_roomHandle[MAX_ROOM_HANDLE];
+	Common::Stream *_roomHandle[MAX_ROOM_HANDLE];
 };
 
 extern void load_chewy_taf(int16 taf_nr);
diff --git a/engines/chewy/rooms/room28.cpp b/engines/chewy/rooms/room28.cpp
index 94861946223..a2cf613425e 100644
--- a/engines/chewy/rooms/room28.cpp
+++ b/engines/chewy/rooms/room28.cpp
@@ -337,21 +337,5 @@ int16 Room28::use_breifkasten() {
 	return action_flag;
 }
 
-int16 Room28::cut_serv1(int16 frame) {
-	if (_G(spieler).R28Briefkasten) {
-		_G(det)->plot_static_details(0, 0, 8, 9);
-	} else {
-		_G(det)->plot_static_details(0, 0, 7, 7);
-	}
-	return 0;
-}
-
-int16 Room28::cut_serv2(int16 frame) {
-	if (frame < 23)
-		cut_serv1(frame);
-
-	return 0;
-}
-
 } // namespace Rooms
 } // namespace Chewy
diff --git a/engines/chewy/rooms/room28.h b/engines/chewy/rooms/room28.h
index 196e627103b..19f4291271a 100644
--- a/engines/chewy/rooms/room28.h
+++ b/engines/chewy/rooms/room28.h
@@ -41,9 +41,6 @@ public:
 	static void use_surimy();
 	static void set_pump();
 	static int16 use_breifkasten();
-
-	static int16 cut_serv1(int16 frame);
-	static int16 cut_serv2(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room37.cpp b/engines/chewy/rooms/room37.cpp
index 27d1dc9aee7..4bbf7f5434a 100644
--- a/engines/chewy/rooms/room37.cpp
+++ b/engines/chewy/rooms/room37.cpp
@@ -130,37 +130,6 @@ short Room37::use_wippe() {
 	return action_flag;
 }
 
-int16 Room37::cut_serv1(int16 frame) {
-	const int16 scrollx = _G(spieler).scrollx;
-	const int16 scrolly = _G(spieler).scrolly;
-
-	if (!_G(spieler).R37Kloppe) {
-		if (!_G(spieler).R37Gebiss) {
-			_G(det)->plot_static_details(scrollx, scrolly, 9, 9);
-			_G(det)->plot_static_details(scrollx, scrolly, 11, 11);
-			_G(det)->showStaticSpr(11);
-		} else {
-			_G(det)->plot_static_details(scrollx, scrolly, 8, 8);
-			_G(det)->plot_static_details(scrollx, scrolly, 0, 0);
-		}
-	}
-
-	_G(det)->plot_static_details(scrollx, scrolly, 7, 7);
-	_G(det)->plot_static_details(scrollx, scrolly, 14, 14);
-	return 0;
-}
-
-int16 Room37::cut_serv2(int16 frame) {
-	static const int16 STATIC_NR[] = { 7, 14, 12, 10 };
-
-	_G(det)->showStaticSpr(12);
-	_G(det)->showStaticSpr(10);
-	for (short i = 0; i < 4; i++)
-		_G(det)->plot_static_details(_G(spieler).scrollx, _G(spieler).scrolly, STATIC_NR[i], STATIC_NR[i]);
-
-	return 0;
-}
-
 int16 Room37::use_glas() {
 	int16 action_flag = false;
 
diff --git a/engines/chewy/rooms/room37.h b/engines/chewy/rooms/room37.h
index 743f556a337..74c3676fd53 100644
--- a/engines/chewy/rooms/room37.h
+++ b/engines/chewy/rooms/room37.h
@@ -41,9 +41,6 @@ public:
 	static int16 use_glas();
 	static void talk_hahn();
 	static void use_hahn();
-
-	static int16 cut_serv1(int16 frame);
-	static int16 cut_serv2(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room43.cpp b/engines/chewy/rooms/room43.cpp
index 30087593989..db86be59b9b 100644
--- a/engines/chewy/rooms/room43.cpp
+++ b/engines/chewy/rooms/room43.cpp
@@ -93,11 +93,5 @@ void Room43::catch_pg() {
 	show_person();
 }
 
-int16 Room43::setup_func(int16 frame) {
-	_G(atds)->print_aad(_G(spieler).scrollx, _G(spieler).scrolly);
-
-	return 0;
-}
-
 } // namespace Rooms
 } // namespace Chewy
diff --git a/engines/chewy/rooms/room43.h b/engines/chewy/rooms/room43.h
index 14805bc0c4c..a481f4459cc 100644
--- a/engines/chewy/rooms/room43.h
+++ b/engines/chewy/rooms/room43.h
@@ -29,7 +29,6 @@ class Room43 {
 public:
 	static void night_small();
 	static void catch_pg();
-	static int16 setup_func(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room46.cpp b/engines/chewy/rooms/room46.cpp
index 2fcb1a4fa5f..7dfa635a743 100644
--- a/engines/chewy/rooms/room46.cpp
+++ b/engines/chewy/rooms/room46.cpp
@@ -25,6 +25,7 @@
 #include "chewy/room.h"
 #include "chewy/rooms/room46.h"
 #include "chewy/sound.h"
+#include "chewy/video/video_player.h"
 
 namespace Chewy {
 namespace Rooms {
@@ -151,8 +152,7 @@ void Room46::bodo() {
 
 void Room46::kloppe() {
 	for (int16 i = 0; i < 4; i++) {
-		_G(mem)->file->select_pool_item(_G(Ci).Handle, FCUT_065);
-		_G(flc)->custom_play(&_G(Ci));
+		g_engine->_video->playVideo(FCUT_065);
 		
 		_G(out)->setPointer(nullptr);
 		_G(out)->cls();
@@ -171,8 +171,7 @@ void Room46::kloppe() {
 		}
 	}
 
-	_G(mem)->file->select_pool_item(_G(Ci).Handle, 66);
-	_G(flc)->custom_play(&_G(Ci));
+	g_engine->_video->playVideo(FCUT_066);
 	_G(sndPlayer)->fadeOut(0);
 	_G(out)->cls();
 
diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp
index fd3721b7568..c1a27e78c5e 100644
--- a/engines/chewy/rooms/room51.cpp
+++ b/engines/chewy/rooms/room51.cpp
@@ -345,11 +345,6 @@ int16 Room51::use_door(int16 txt_nr) {
 	return action_ret;
 }
 
-int16 Room51::cut_serv(int16 frame) {
-	_G(det)->plot_static_details(0, 0, 16, 16);
-	return 0;
-}
-
 void Room51::timer_action(int16 t_nr, int16 obj_nr) {
 	if (obj_nr == 9 || obj_nr == 10) {
 		if (!_enemyFlag[obj_nr - 9]) {
diff --git a/engines/chewy/rooms/room51.h b/engines/chewy/rooms/room51.h
index d525bd501d4..76e7208f1ba 100644
--- a/engines/chewy/rooms/room51.h
+++ b/engines/chewy/rooms/room51.h
@@ -41,7 +41,6 @@ public:
 	static bool timer(int16 t_nr, int16 ani_nr);
 
 	static int16 use_door(int16 txt_nr);
-	static int16 cut_serv(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room54.cpp b/engines/chewy/rooms/room54.cpp
index 7a603cac02f..157a383db35 100644
--- a/engines/chewy/rooms/room54.cpp
+++ b/engines/chewy/rooms/room54.cpp
@@ -268,11 +268,6 @@ int16 Room54::use_zelle() {
 	return action_ret;
 }
 
-int16 Room54::cut_serv(int16 frame) {
-	_G(det)->plot_static_details(176, 0, 9, 9);
-	return 0;
-}
-
 int16 Room54::use_azug() {
 	int16 action_ret = false;
 
diff --git a/engines/chewy/rooms/room54.h b/engines/chewy/rooms/room54.h
index 18af93e58cb..99c72214ed3 100644
--- a/engines/chewy/rooms/room54.h
+++ b/engines/chewy/rooms/room54.h
@@ -38,8 +38,6 @@ public:
 	static int16 use_zelle();
 	static short use_taxi();
 	static int16 use_azug();
-
-	static int16 cut_serv(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room55.cpp b/engines/chewy/rooms/room55.cpp
index 276eaa53e03..46cf2c80b8e 100644
--- a/engines/chewy/rooms/room55.cpp
+++ b/engines/chewy/rooms/room55.cpp
@@ -389,13 +389,6 @@ int16 Room55::use_kammeraus() {
 	return action_ret;
 }
 
-int16 Room55::cut_serv(int16 frame) {
-	if (frame < 29 )
-		_G(det)->plot_static_details(136, 0, 10, 10);
-
-	return 0;
-}
-
 void Room55::setup_func() {
 	if (_G(spieler)._personRoomNr[P_HOWARD] == 55) {
 		calc_person_look();
diff --git a/engines/chewy/rooms/room55.h b/engines/chewy/rooms/room55.h
index 6370762598a..ef689dc12c2 100644
--- a/engines/chewy/rooms/room55.h
+++ b/engines/chewy/rooms/room55.h
@@ -44,8 +44,6 @@ public:
 	static int16 use_kammeraus();
 	static void strasse(int16 mode);
 	static void talk_line();
-
-	static int16 cut_serv(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room56.cpp b/engines/chewy/rooms/room56.cpp
index da4e54c6522..6af9c22fdf0 100644
--- a/engines/chewy/rooms/room56.cpp
+++ b/engines/chewy/rooms/room56.cpp
@@ -367,15 +367,6 @@ int16 Room56::use_kneipe() {
 	return action_ret;
 }
 
-int16 Room56::proc1(int16 key) {
-	int16 retVal = 0;
-
-	if (_G(in)->getSwitchCode() == 1)
-		retVal = -1;
-
-	return retVal;
-}
-
 void Room56::start_flug() {
 	if (!_G(spieler).flags32_10 && !_G(r56koch_flug)) {
 		_G(r56koch_flug) = 12;
diff --git a/engines/chewy/rooms/room56.h b/engines/chewy/rooms/room56.h
index 779e19bb782..58e19ef4c02 100644
--- a/engines/chewy/rooms/room56.h
+++ b/engines/chewy/rooms/room56.h
@@ -39,8 +39,6 @@ public:
 	static void talk_man();
 	static int16 use_man();
 	static int16 use_kneipe();
-
-	static int16 proc1(int16 key);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room64.cpp b/engines/chewy/rooms/room64.cpp
index aa2962827c8..d411865f32d 100644
--- a/engines/chewy/rooms/room64.cpp
+++ b/engines/chewy/rooms/room64.cpp
@@ -56,16 +56,6 @@ void Room64::entry() {
 		chewy_entry();
 }
 
-int16 Room64::cut_sev(int16 frame) {
-	const int16 spr_nr = _G(chewy_ph)[_G(spieler_vector)[P_CHEWY].Phase * 8 + _G(spieler_vector)[P_CHEWY].PhNr];
-	const int16 x = _G(spieler_mi)[P_CHEWY].XyzStart[0] + _G(chewy_kor)[spr_nr * 2] - _G(spieler).scrollx;
-	const int16 y = _G(spieler_mi)[P_CHEWY].XyzStart[1] + _G(chewy_kor)[spr_nr * 2 + 1] - _G(spieler).scrolly;
-	
-	calc_zoom(_G(spieler_mi)[P_CHEWY].XyzStart[1], (int16)_G(room)->_roomInfo->_zoomFactor, (int16)_G(room)->_roomInfo->_zoomFactor, &_G(spieler_vector)[P_CHEWY]);
-	_G(out)->scale_set(_G(chewy)->_image[spr_nr], x, y, _G(spieler_vector)[P_CHEWY].Xzoom, _G(spieler_vector)[P_CHEWY].Yzoom, _G(scr_width));
-	return 0;
-}
-
 void Room64::chewy_entry() {
 	calc_monitor();
 	if (!_G(flags).LoadGame) {
diff --git a/engines/chewy/rooms/room64.h b/engines/chewy/rooms/room64.h
index f43276a097b..172d3765b61 100644
--- a/engines/chewy/rooms/room64.h
+++ b/engines/chewy/rooms/room64.h
@@ -36,8 +36,6 @@ public:
 	static int16 use_tasche();
 	static void talk_man();
 	static void talk_man(int16 aad_nr);
-
-	static int16 cut_sev(int16 frame);
 };
 
 } // namespace Rooms
diff --git a/engines/chewy/rooms/room87.cpp b/engines/chewy/rooms/room87.cpp
index 7a8cf28527d..efad14a5d4d 100644
--- a/engines/chewy/rooms/room87.cpp
+++ b/engines/chewy/rooms/room87.cpp
@@ -143,11 +143,6 @@ int Room87::proc2(int16 txt_nr) {
 	return 1;
 }
 
-int16 Room87::proc5(int16 key) {
-	_G(atds)->print_aad(_G(spieler).scrollx, _G(spieler).scrolly);
-	return 0;
-}
-
 int Room87::proc4() {
 	if (_G(spieler).inv_cur)
 		return 0;
diff --git a/engines/chewy/rooms/room87.h b/engines/chewy/rooms/room87.h
index 3a5088b3698..4d168951823 100644
--- a/engines/chewy/rooms/room87.h
+++ b/engines/chewy/rooms/room87.h
@@ -33,7 +33,6 @@ public:
 	static void xit(int16 eib_nr);
 	static void setup_func();
 	static int proc2(int16 txt_nr);
-	static int16 proc5(int16 key);
 	static int proc4();
 };
 
diff --git a/engines/chewy/rooms/room90.cpp b/engines/chewy/rooms/room90.cpp
index 1a4fa44afb7..187a986ee0c 100644
--- a/engines/chewy/rooms/room90.cpp
+++ b/engines/chewy/rooms/room90.cpp
@@ -315,12 +315,6 @@ int Room90::shootControlUnit() {
 	return 1;
 }
 
-int16 Room90::proc5(int16 key) {
-	_G(det)->plot_static_details(_G(spieler).scrollx, 0, 3, 3);
-	
-	return 0;
-}
-
 int Room90::useSurimyOnWreck() {
 	if (!isCurInventory(18))
 		return 0;
diff --git a/engines/chewy/rooms/room90.h b/engines/chewy/rooms/room90.h
index ee9049157c0..88541c8c5bd 100644
--- a/engines/chewy/rooms/room90.h
+++ b/engines/chewy/rooms/room90.h
@@ -36,7 +36,6 @@ public:
 	static void proc2();
 	static int getHubcaps();
 	static int shootControlUnit();
-	static int16 proc5(int16 key);
 	static int useSurimyOnWreck();
 };
 
diff --git a/engines/chewy/sound_player.cpp b/engines/chewy/sound_player.cpp
index 219c57c37fb..848d6113053 100644
--- a/engines/chewy/sound_player.cpp
+++ b/engines/chewy/sound_player.cpp
@@ -23,7 +23,6 @@
 #include "audio/decoders/raw.h"
 #include "chewy/chewy.h"
 #include "chewy/sound_player.h"
-#include "chewy/file.h"
 #include "chewy/globals.h"
 #include "chewy/ngshext.h"
 #include "chewy/sound.h"
diff --git a/engines/chewy/video/cfo_decoder.cpp b/engines/chewy/video/cfo_decoder.cpp
index 837ec305ca9..dde156da8f3 100644
--- a/engines/chewy/video/cfo_decoder.cpp
+++ b/engines/chewy/video/cfo_decoder.cpp
@@ -25,6 +25,7 @@
 #include "engines/engine.h"
 #include "graphics/palette.h"
 #include "video/flic_decoder.h"
+#include "chewy/globals.h"
 #include "chewy/mcga.h"
 #include "chewy/sound.h"
 #include "chewy/video/cfo_decoder.h"
@@ -279,9 +280,8 @@ void CfoDecoder::CfoVideoTrack::handleCustomFrame() {
 			break;
 		case kChunkMusicFadeOut:
 			// Used in videos 0, 71
-			warning("kChunkMusicFadeOut");
-			// TODO
-			_fileStream->skip(frameSize);
+			channel = _fileStream->readUint16LE();
+			_G(sndPlayer)->fadeOut(channel);
 			break;
 		case kChunkSetBalance:
 			channel = _fileStream->readUint16LE();
diff --git a/engines/chewy/video/video_player.cpp b/engines/chewy/video/video_player.cpp
index 4068721d153..f065fb6bbed 100644
--- a/engines/chewy/video/video_player.cpp
+++ b/engines/chewy/video/video_player.cpp
@@ -34,6 +34,7 @@ bool VideoPlayer::playVideo(uint num, bool stopMusic) {
 	CfoDecoder *cfoDecoder = new CfoDecoder(g_engine->_sound);
 	VideoResource *videoResource = new VideoResource("cut.tap");
 	Common::SeekableReadStream *videoStream = videoResource->getVideoStream(num);
+	_playCount = 0;
 
 	if (stopMusic) {
 		_G(sndPlayer)->stopMod();
@@ -185,14 +186,165 @@ bool VideoPlayer::handleCustom(uint num, uint frame, CfoDecoder *cfoDecoder) {
 			break;
 		}
 
+		_G(atds)->print_aad(scrollx, scrolly);
+		break;
+	case FCUT_047:
+		// Room37::cut_serv1
+		if (!_G(spieler).R37Kloppe) {
+			if (!_G(spieler).R37Gebiss) {
+				_G(det)->plot_static_details(scrollx, scrolly, 9, 9);
+				_G(det)->plot_static_details(scrollx, scrolly, 11, 11);
+				_G(det)->showStaticSpr(11);
+			} else {
+				_G(det)->plot_static_details(scrollx, scrolly, 8, 8);
+				_G(det)->plot_static_details(scrollx, scrolly, 0, 0);
+			}
+		}
+
+		_G(det)->plot_static_details(scrollx, scrolly, 7, 7);
+		_G(det)->plot_static_details(scrollx, scrolly, 14, 14);
+		break;
+	case FCUT_048: {
+		// Room37::cut_serv2
+		const int16 STATIC_NR[] = {7, 14, 12, 10};
+
+		_G(det)->showStaticSpr(12);
+		_G(det)->showStaticSpr(10);
+		for (short i = 0; i < 4; i++)
+			_G(det)->plot_static_details(scrollx, scrolly, STATIC_NR[i], STATIC_NR[i]);
+		}
+		break;
+	case FCUT_053:
+		if (cfoDecoder->endOfVideo() && _playCount < 3) {
+			cfoDecoder->rewind();
+			_playCount++;
+		}
+		break;
+	case FCUT_054:
+		if (cfoDecoder->endOfVideo() && _playCount < 2) {
+			cfoDecoder->rewind();
+			_playCount++;
+		}
+		break;
+	case FCUT_055:
+	case FCUT_056:
+	case FCUT_064:
+		// Room28::cut_serv2 (FCUT_055)
+		if (num != FCUT_055 || frame < 23) {
+			// Room28::cut_serv1 (FCUT_056 / FCUT_064)
+			if (_G(spieler).R28Briefkasten)
+				_G(det)->plot_static_details(0, 0, 8, 9);
+			else
+				_G(det)->plot_static_details(0, 0, 7, 7);
+		}
+		break;
+	case FCUT_061:
+		// Room43::setup_func
+		_G(atds)->print_aad(scrollx, scrolly);
+		break;
+	case FCUT_068:
+		// Room51::cut_serv
+		_G(det)->plot_static_details(0, 0, 16, 16);
+		break;
+	case FCUT_069:
+		// Room54::cut_serv
+		_G(det)->plot_static_details(176, 0, 9, 9);
+		break;
+	case FCUT_070:
+		// Room55::cut_serv
+		if (frame < 29)
+			_G(det)->plot_static_details(136, 0, 10, 10);
+		break;
+	case FCUT_078: {
+		// Room64::cut_sev
+		const int16 spr_nr = _G(chewy_ph)[_G(spieler_vector)[P_CHEWY].Phase * 8 + _G(spieler_vector)[P_CHEWY].PhNr];
+		const int16 x = _G(spieler_mi)[P_CHEWY].XyzStart[0] + _G(chewy_kor)[spr_nr * 2] - scrollx;
+		const int16 y = _G(spieler_mi)[P_CHEWY].XyzStart[1] + _G(chewy_kor)[spr_nr * 2 + 1] - scrolly;
+
+		calc_zoom(_G(spieler_mi)[P_CHEWY].XyzStart[1], (int16)_G(room)->_roomInfo->_zoomFactor, (int16)_G(room)->_roomInfo->_zoomFactor, &_G(spieler_vector)[P_CHEWY]);
+		_G(out)->scale_set(_G(chewy)->_image[spr_nr], x, y, _G(spieler_vector)[P_CHEWY].Xzoom, _G(spieler_vector)[P_CHEWY].Yzoom, _G(scr_width));
+		}
+		break;
+	case FCUT_083:
+		if (cfoDecoder->endOfVideo() && _playCount < 2) {
+			cfoDecoder->rewind();
+			_playCount++;
+		}
+		break;
+	case FCUT_089:
+		// Room87::proc5
 		_G(atds)->print_aad(scrollx, scrolly);
 		break;
 	case FCUT_094:
 		// Room87::proc3
 		return (frame >= 12) ? false : true;
+	case FCUT_095:
+		// Room87::proc5
+		_G(atds)->print_aad(scrollx, scrolly);
+
+		if (cfoDecoder->endOfVideo() && _G(atds)->aadGetStatus() != -1)
+			cfoDecoder->rewind();
+		break;
+	case FCUT_107:
+		// Room90::proc5
+		_G(det)->plot_static_details(scrollx, 0, 3, 3);
+		break;
 	case FCUT_112:
 		// Room56::proc1
+		if (cfoDecoder->endOfVideo() && _playCount < 2) {
+			cfoDecoder->rewind();
+			_playCount++;
+		}
 		return (_G(in)->getSwitchCode() == 1) ? false : true;
+	case FCUT_116:
+		if (cfoDecoder->endOfVideo() && _playCount < 6) {
+			cfoDecoder->rewind();
+			_playCount++;
+		}
+		break;
+	case FCUT_135:
+	case FCUT_145:
+	case FCUT_142:
+	case FCUT_140:
+	case FCUT_144:
+	case FCUT_134:
+	case FCUT_148:
+	case FCUT_138:
+	case FCUT_143:
+	case FCUT_146:
+	case FCUT_154:
+	case FCUT_139:
+	case FCUT_156:
+	case FCUT_157:
+	case FCUT_147:
+	case FCUT_153:
+	case FCUT_152:
+	case FCUT_141:
+	case FCUT_137:
+	case FCUT_136:
+	case FCUT_151:
+	case FCUT_149:
+	case FCUT_150:
+		// Intro
+		_G(atds)->print_aad(scrollx, scrolly);
+		if (num == FCUT_135 || num == FCUT_134 || num == FCUT_154 || num == FCUT_156)
+			if (_G(atds)->aadGetStatus() != -1)
+				_G(out)->raster_col(254, 63, 12, 46);
+		if (num == FCUT_137 && frame == 35)
+			_G(atds)->stopAad();
+		if (num == FCUT_136 && frame == 18)
+			_G(atds)->stopAad();
+		if (num == FCUT_140 && frame == 15)
+			return false;
+		if (num == FCUT_144 && frame == 7)
+			return false;
+
+		if (num == FCUT_141 || num == FCUT_142 || num == FCUT_143 ||
+			num == FCUT_145 || num == FCUT_146 || num == FCUT_152) {
+			if (cfoDecoder->endOfVideo() && _G(atds)->aadGetStatus() != -1)
+				cfoDecoder->rewind();
+		}
+		break;
 	default:
 		return true;
 	}
diff --git a/engines/chewy/video/video_player.h b/engines/chewy/video/video_player.h
index e71e9435753..28d467568b5 100644
--- a/engines/chewy/video/video_player.h
+++ b/engines/chewy/video/video_player.h
@@ -28,6 +28,8 @@ class CfoDecoder;
 
 class VideoPlayer {
 public:
+	VideoPlayer() { _playCount = 0; }
+
 	/**
 	 * @Plays a video file
 	 * @param num - the video file number
@@ -38,6 +40,7 @@ public:
 
 private:
 	bool handleCustom(uint num, uint frame, CfoDecoder *cfoDecoder);
+	int _playCount;
 };
 
 } // End of namespace Chewy




More information about the Scummvm-git-logs mailing list