From 388fbdb6eb8df910c2fff2dc34954f34759c5b16 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 15 Oct 2014 21:16:04 +0200 Subject: WINTERMUTE: Rename VideoSubtitle to SubtitleCard --- engines/wintermute/module.mk | 2 +- engines/wintermute/video/subtitle_card.cpp | 59 ++++++++++++++++++++++++++++ engines/wintermute/video/subtitle_card.h | 51 ++++++++++++++++++++++++ engines/wintermute/video/video_subtitle.cpp | 59 ---------------------------- engines/wintermute/video/video_subtitle.h | 51 ------------------------ engines/wintermute/video/video_subtitler.cpp | 2 +- engines/wintermute/video/video_subtitler.h | 4 +- 7 files changed, 114 insertions(+), 114 deletions(-) create mode 100644 engines/wintermute/video/subtitle_card.cpp create mode 100644 engines/wintermute/video/subtitle_card.h delete mode 100644 engines/wintermute/video/video_subtitle.cpp delete mode 100644 engines/wintermute/video/video_subtitle.h diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk index b4845b0552..4c95314a02 100644 --- a/engines/wintermute/module.mk +++ b/engines/wintermute/module.mk @@ -108,8 +108,8 @@ MODULE_OBJS := \ utils/path_util.o \ utils/string_util.o \ utils/utils.o \ + video/subtitle_card.o \ video/video_player.o \ - video/video_subtitle.o \ video/video_subtitler.o \ video/video_theora_player.o \ debugger.o \ diff --git a/engines/wintermute/video/subtitle_card.cpp b/engines/wintermute/video/subtitle_card.cpp new file mode 100644 index 0000000000..971b2c019c --- /dev/null +++ b/engines/wintermute/video/subtitle_card.cpp @@ -0,0 +1,59 @@ +/* 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. + * + */ + +/* + * This file is based on Wintermute Engine + * http://dead-code.org/redir.php?target=wme + * Copyright (c) 2011 Jan Nedoma + */ + +#include "engines/wintermute/video/subtitle_card.h" +#include "engines/wintermute/base/base_game.h" +namespace Wintermute { + +SubtitleCard::SubtitleCard(BaseGame *inGame): BaseClass(inGame) { + _startFrame = _endFrame = 0; +} + +SubtitleCard::SubtitleCard(BaseGame *inGame, const Common::String &text, const uint &startFrame, const uint &endFrame): BaseClass(inGame) { + // TODO: Fix expandStringByStringTable instead of this ugly hack + char *tmp = new char[text.size()]; + strcpy(tmp, text.c_str()); + _gameRef->expandStringByStringTable(&tmp); + _text = Common::String(tmp); + _startFrame = startFrame; + _endFrame = endFrame; +} + +uint32 SubtitleCard::getStartFrame() { + return _startFrame; +} + +uint32 SubtitleCard::getEndFrame() { + return _endFrame; +} + +Common::String SubtitleCard::getText() { + return _text; +} + +} // End of namespace Wintermute diff --git a/engines/wintermute/video/subtitle_card.h b/engines/wintermute/video/subtitle_card.h new file mode 100644 index 0000000000..5390d64fcb --- /dev/null +++ b/engines/wintermute/video/subtitle_card.h @@ -0,0 +1,51 @@ +/* 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. + * + */ + +/* + * This file is based on Wintermute Engine + * http://dead-code.org/redir.php?target=wme + * Copyright (c) 2011 Jan Nedoma + */ + +#ifndef WINTERMUTE_SUBTITLECARD_H +#define WINTERMUTE_SUBTITLECARD_H + +#include "engines/wintermute/base/base.h" + +namespace Wintermute { + +class SubtitleCard : public BaseClass { +public: + SubtitleCard(BaseGame *inGame); + SubtitleCard(BaseGame *inGame, const Common::String &text, const uint &startFrame, const uint &endFrame); + uint32 getEndFrame(); + uint32 getStartFrame(); + Common::String getText(); +private: + uint32 _endFrame; + uint32 _startFrame; + Common::String _text; +}; + +} // End of namespace Wintermute + +#endif diff --git a/engines/wintermute/video/video_subtitle.cpp b/engines/wintermute/video/video_subtitle.cpp deleted file mode 100644 index b02a3ec50f..0000000000 --- a/engines/wintermute/video/video_subtitle.cpp +++ /dev/null @@ -1,59 +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. - * - */ - -/* - * This file is based on Wintermute Engine - * http://dead-code.org/redir.php?target=wme - * Copyright (c) 2011 Jan Nedoma - */ - -#include "engines/wintermute/video/video_subtitle.h" -#include "engines/wintermute/base/base_game.h" -namespace Wintermute { - -VideoSubtitle::VideoSubtitle(BaseGame *inGame): BaseClass(inGame) { - _startFrame = _endFrame = 0; -} - -VideoSubtitle::VideoSubtitle(BaseGame *inGame, const Common::String &text, const uint &startFrame, const uint &endFrame): BaseClass(inGame) { - // TODO: Fix expandStringByStringTable instead of this ugly hack - char *tmp = new char[text.size()]; - strcpy(tmp, text.c_str()); - _gameRef->expandStringByStringTable(&tmp); - _text = Common::String(tmp); - _startFrame = startFrame; - _endFrame = endFrame; -} - -uint32 VideoSubtitle::getStartFrame() { - return _startFrame; -} - -uint32 VideoSubtitle::getEndFrame() { - return _endFrame; -} - -Common::String VideoSubtitle::getText() { - return _text; -} - -} // End of namespace Wintermute diff --git a/engines/wintermute/video/video_subtitle.h b/engines/wintermute/video/video_subtitle.h deleted file mode 100644 index fb80a58a72..0000000000 --- a/engines/wintermute/video/video_subtitle.h +++ /dev/null @@ -1,51 +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. - * - */ - -/* - * This file is based on Wintermute Engine - * http://dead-code.org/redir.php?target=wme - * Copyright (c) 2011 Jan Nedoma - */ - -#ifndef WINTERMUTE_VIDSUBTITLE_H -#define WINTERMUTE_VIDSUBTITLE_H - -#include "engines/wintermute/base/base.h" - -namespace Wintermute { - -class VideoSubtitle : public BaseClass { -public: - VideoSubtitle(BaseGame *inGame); - VideoSubtitle(BaseGame *inGame, const Common::String &text, const uint &startFrame, const uint &endFrame); - uint32 getEndFrame(); - uint32 getStartFrame(); - Common::String getText(); -private: - uint32 _endFrame; - uint32 _startFrame; - Common::String _text; -}; - -} // End of namespace Wintermute - -#endif diff --git a/engines/wintermute/video/video_subtitler.cpp b/engines/wintermute/video/video_subtitler.cpp index c8acbeb98b..c57a70ec3b 100644 --- a/engines/wintermute/video/video_subtitler.cpp +++ b/engines/wintermute/video/video_subtitler.cpp @@ -166,7 +166,7 @@ bool VideoSubtitler::loadSubtitles(const Common::String &filename, const Common: } if (start != -1 && text.size() > 0 && (start != 1 || end != 1)) { - _subtitles.push_back(new VideoSubtitle(_gameRef, text, start, end)); + _subtitles.push_back(new SubtitleCard(_gameRef, text, start, end)); } pos += lineLength + 1; diff --git a/engines/wintermute/video/video_subtitler.h b/engines/wintermute/video/video_subtitler.h index 655b1a5969..32e4368daf 100644 --- a/engines/wintermute/video/video_subtitler.h +++ b/engines/wintermute/video/video_subtitler.h @@ -30,7 +30,7 @@ #define WINTERMUTE_VIDSUBTITLER_H #include "engines/wintermute/base/base.h" -#include "engines/wintermute/video/video_subtitle.h" +#include "engines/wintermute/video/subtitle_card.h" namespace Wintermute { @@ -46,7 +46,7 @@ public: void display(); void update(uint32 frame); private: - Common::Array _subtitles; + Common::Array _subtitles; uint32 _lastSample; }; -- cgit v1.2.3