Permalink
Comparing changes
Open a pull request
4
contributors
Commits on Oct 18, 2013
…ing window.
… change cursor image.
…pline.
…rect avi raw reader.
…, etc...
Commits on Oct 20, 2013
Commits on Oct 21, 2013
Commits on Oct 25, 2013
getStateFlag.
Commits on Oct 30, 2013
Commits on Nov 01, 2013
…with 16bit flag.
Commits on Nov 13, 2013
Commits on Nov 15, 2013
…ontrol list from end to beginning
… scripts.
…rrect use it from actions.
Commits on Nov 24, 2013
Commits on Nov 25, 2013
…ot key in same actions.
Commits on Nov 26, 2013
…wercase.
Commits on Dec 04, 2013
Commits on Dec 24, 2013
…ration.
Commits on Jan 07, 2014
Commits on Jan 17, 2014
Commits on Feb 04, 2014
Commits on Feb 24, 2014
Commits on Mar 01, 2014
…s and correct scale.
Commits on Mar 05, 2014
Commits on Mar 07, 2014
Commits on Jun 13, 2014
Conflicts: engines/zvision/animation/rlf_animation.cpp engines/zvision/animation_control.h engines/zvision/core/console.cpp engines/zvision/core/events.cpp engines/zvision/cursors/cursor.cpp engines/zvision/cursors/cursor_manager.cpp engines/zvision/cursors/cursor_manager.h engines/zvision/fonts/truetype_font.cpp engines/zvision/graphics/render_manager.cpp engines/zvision/graphics/render_manager.h engines/zvision/inventory/inventory_manager.h engines/zvision/inventory_manager.h engines/zvision/meta_animation.h engines/zvision/module.mk engines/zvision/scripting/actions.cpp engines/zvision/scripting/control.h engines/zvision/scripting/controls/animation_control.cpp engines/zvision/scripting/controls/animation_control.h engines/zvision/scripting/controls/input_control.cpp engines/zvision/scripting/controls/lever_control.cpp engines/zvision/scripting/controls/timer_node.cpp engines/zvision/scripting/controls/timer_node.h engines/zvision/scripting/puzzle.h engines/zvision/scripting/scr_file_handling.cpp engines/zvision/scripting/script_manager.cpp engines/zvision/scripting/script_manager.h engines/zvision/sidefx.cpp engines/zvision/sound/zork_raw.cpp engines/zvision/sound/zork_raw.h engines/zvision/video/video.cpp engines/zvision/video/zork_avi_decoder.h engines/zvision/zvision.cpp engines/zvision/zvision.h
Commits on Jun 14, 2014
Commits on Jul 02, 2014
Commits on Jul 12, 2014
…les.
…ocus/unfocus
Commits on Aug 04, 2014
Commits on Oct 10, 2014
Commits on Nov 08, 2014
Commits on Nov 12, 2014
…vkKey
Commits on Nov 19, 2014
ZVISION: (SECOND ATTEMPT) Add detection for Zork Nemesis and Zork Grand Inquisitor demos and Zork Grand Inquisitor DVD version
Unified
Split
Showing
with
12,201 additions
and 2,466 deletions.
- +133 −0 engines/zvision/animation/meta_animation.cpp
- +35 −23 engines/zvision/{scripting/controls/animation_control.h → animation/meta_animation.h}
- +153 −101 engines/zvision/animation/rlf_animation.cpp
- +22 −12 engines/zvision/animation/rlf_animation.h
- +2 −2 engines/zvision/archives/zfs_archive.cpp
- +1 −1 engines/zvision/archives/zfs_archive.h
- +29 −30 engines/zvision/core/console.cpp
- +208 −51 engines/zvision/core/events.cpp
- +765 −0 engines/zvision/core/menu.cpp
- +100 −1 engines/zvision/core/menu.h
- +89 −0 engines/zvision/core/midi.cpp
- +59 −0 engines/zvision/core/midi.h
- +119 −67 engines/zvision/core/save_manager.cpp
- +17 −3 engines/zvision/core/save_manager.h
- +275 −0 engines/zvision/core/search_manager.cpp
- +73 −0 engines/zvision/core/search_manager.h
- +53 −24 engines/zvision/cursors/cursor.cpp
- +20 −6 engines/zvision/cursors/cursor.h
- +101 −99 engines/zvision/cursors/cursor_manager.cpp
- +49 −28 engines/zvision/cursors/cursor_manager.h
- +110 −60 engines/zvision/detection.cpp
- +236 −5 engines/zvision/fonts/truetype_font.cpp
- +46 −3 engines/zvision/fonts/truetype_font.h
- +83 −0 engines/zvision/graphics/effect.h
- +174 −0 engines/zvision/graphics/effects/fog.cpp
- +52 −0 engines/zvision/graphics/effects/fog.h
- +110 −0 engines/zvision/graphics/effects/light.cpp
- +53 −0 engines/zvision/graphics/effects/light.h
- +146 −0 engines/zvision/graphics/effects/wave.cpp
- +51 −0 engines/zvision/graphics/effects/wave.h
- +844 −300 engines/zvision/graphics/render_manager.cpp
- +173 −165 engines/zvision/graphics/render_manager.h
- +64 −6 engines/zvision/graphics/render_table.cpp
- +15 −2 engines/zvision/graphics/render_table.h
- +28 −4 engines/zvision/module.mk
- +752 −137 engines/zvision/scripting/actions.cpp
- +233 −104 engines/zvision/scripting/actions.h
- +34 −19 engines/zvision/scripting/control.cpp
- +51 −54 engines/zvision/scripting/control.h
- +0 −263 engines/zvision/scripting/controls/animation_control.cpp
- +320 −0 engines/zvision/scripting/controls/fist_control.cpp
- +87 −0 engines/zvision/scripting/controls/fist_control.h
- +201 −0 engines/zvision/scripting/controls/hotmov_control.cpp
- +63 −0 engines/zvision/scripting/controls/hotmov_control.h
- +157 −43 engines/zvision/scripting/controls/input_control.cpp
- +27 −7 engines/zvision/scripting/controls/input_control.h
- +101 −95 engines/zvision/scripting/controls/lever_control.cpp
- +6 −13 engines/zvision/scripting/controls/lever_control.h
- +216 −0 engines/zvision/scripting/controls/paint_control.cpp
- +92 −0 engines/zvision/scripting/controls/paint_control.h
- +74 −24 engines/zvision/scripting/controls/push_toggle_control.cpp
- +18 −3 engines/zvision/scripting/controls/push_toggle_control.h
- +205 −0 engines/zvision/scripting/controls/safe_control.cpp
- +71 −0 engines/zvision/scripting/controls/safe_control.h
- +123 −0 engines/zvision/scripting/controls/save_control.cpp
- +56 −0 engines/zvision/scripting/controls/save_control.h
- +219 −0 engines/zvision/scripting/controls/slot_control.cpp
- +85 −0 engines/zvision/scripting/controls/slot_control.h
- +108 −0 engines/zvision/scripting/controls/titler_control.cpp
- +55 −0 engines/zvision/scripting/controls/titler_control.h
- +123 −0 engines/zvision/scripting/inventory.cpp
- +9 −2 engines/zvision/scripting/puzzle.h
- +183 −109 engines/zvision/scripting/scr_file_handling.cpp
- +631 −259 engines/zvision/scripting/script_manager.cpp
- +159 −38 engines/zvision/scripting/script_manager.h
- +36 −0 engines/zvision/scripting/sidefx.cpp
- +114 −0 engines/zvision/scripting/sidefx.h
- +207 −0 engines/zvision/scripting/sidefx/animation_node.cpp
- +84 −0 engines/zvision/scripting/sidefx/animation_node.h
- +109 −0 engines/zvision/scripting/sidefx/distort_node.cpp
- +63 −0 engines/zvision/scripting/sidefx/distort_node.h
- +240 −0 engines/zvision/scripting/sidefx/music_node.cpp
- +135 −0 engines/zvision/scripting/sidefx/music_node.h
- +56 −0 engines/zvision/scripting/sidefx/region_node.cpp
- +57 −0 engines/zvision/scripting/sidefx/region_node.h
- +86 −0 engines/zvision/scripting/sidefx/syncsound_node.cpp
- +56 −0 engines/zvision/scripting/sidefx/syncsound_node.h
- +22 −15 engines/zvision/scripting/{controls → sidefx}/timer_node.cpp
- +9 −5 engines/zvision/scripting/{controls → sidefx}/timer_node.h
- +175 −0 engines/zvision/scripting/sidefx/ttytext_node.cpp
- +73 −0 engines/zvision/scripting/sidefx/ttytext_node.h
- +143 −71 engines/zvision/sound/zork_raw.cpp
- +63 −25 engines/zvision/sound/zork_raw.h
- +108 −0 engines/zvision/subtitles/subtitles.cpp
- +27 −1 engines/zvision/subtitles/subtitles.h
- +24 −3 engines/zvision/{strings → text}/string_manager.cpp
- +11 −0 engines/zvision/{strings → text}/string_manager.h
- +549 −0 engines/zvision/text/text.cpp
- +100 −0 engines/zvision/text/text.h
- +6 −2 engines/zvision/utility/clock.h
- +6 −6 engines/zvision/utility/lzss_read_stream.cpp
- +1 −1 engines/zvision/utility/lzss_read_stream.h
- +2 −2 engines/zvision/utility/single_value_container.h
- +5 −5 engines/zvision/utility/utility.cpp
- +2 −2 engines/zvision/utility/utility.h
- +129 −0 engines/zvision/utility/win_keys.cpp
- +7 −3 engines/zvision/{inventory/inventory_manager.h → utility/win_keys.h}
- +33 −87 engines/zvision/video/video.cpp
- +12 −3 engines/zvision/video/zork_avi_decoder.cpp
- +20 −8 engines/zvision/video/zork_avi_decoder.h
- +391 −44 engines/zvision/zvision.cpp
- +93 −20 engines/zvision/zvision.h
| @@ -0,0 +1,133 @@ | ||
| /* 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. | ||
| * | ||
| */ | ||
|
|
||
| #include "common/scummsys.h" | ||
|
|
||
| #include "zvision/animation/meta_animation.h" | ||
|
|
||
| #include "zvision/zvision.h" | ||
| #include "zvision/graphics/render_manager.h" | ||
| #include "zvision/scripting/script_manager.h" | ||
| #include "zvision/animation/rlf_animation.h" | ||
| #include "zvision/video/zork_avi_decoder.h" | ||
|
|
||
| #include "video/video_decoder.h" | ||
|
|
||
| #include "graphics/surface.h" | ||
|
|
||
|
|
||
| namespace ZVision { | ||
|
|
||
| MetaAnimation::MetaAnimation(const Common::String &fileName, ZVision *engine) | ||
| : _fileType(RLF), | ||
| _curFrame(NULL) { | ||
| Common::String tmpFileName = fileName; | ||
| tmpFileName.toLowercase(); | ||
| if (tmpFileName.hasSuffix(".rlf")) { | ||
| _fileType = RLF; | ||
| Common::File *_file = engine->getSearchManager()->openFile(tmpFileName); | ||
| _animation.rlf = new RlfAnimation(_file, false); | ||
| _frmDelay = _animation.rlf->frameTime(); | ||
| } else if (tmpFileName.hasSuffix(".avi")) { | ||
| _fileType = AVI; | ||
| Common::File *_file = engine->getSearchManager()->openFile(tmpFileName); | ||
| _animation.avi = new ZorkAVIDecoder(); | ||
| _animation.avi->loadStream(_file); | ||
| _frmDelay = 1000.0 / _animation.avi->getDuration().framerate(); | ||
| } else { | ||
| warning("Unrecognized animation file type: %s", fileName.c_str()); | ||
| } | ||
| } | ||
|
|
||
| MetaAnimation::~MetaAnimation() { | ||
| if (_fileType == RLF) { | ||
| delete _animation.rlf; | ||
| } else if (_fileType == AVI) { | ||
| delete _animation.avi; | ||
| } | ||
| } | ||
|
|
||
| uint MetaAnimation::frameCount() { | ||
| if (_fileType == RLF) { | ||
| return _animation.rlf->frameCount(); | ||
| } else | ||
| return _animation.avi->getFrameCount(); | ||
|
|
||
| } | ||
|
|
||
| uint MetaAnimation::width() { | ||
| if (_fileType == RLF) { | ||
| return _animation.rlf->width(); | ||
| } else | ||
| return _animation.avi->getWidth(); | ||
| } | ||
| uint MetaAnimation::height() { | ||
| if (_fileType == RLF) { | ||
| return _animation.rlf->height(); | ||
| } else | ||
| return _animation.avi->getHeight(); | ||
| } | ||
| uint32 MetaAnimation::frameTime() { | ||
| return _frmDelay; | ||
| } | ||
|
|
||
| void MetaAnimation::seekToFrame(int frameNumber) { | ||
| if (frameNumber >= (int)frameCount()) | ||
| frameNumber = frameCount() - 1; | ||
|
|
||
| if (_fileType == RLF) { | ||
| _animation.rlf->seekToFrame(frameNumber); | ||
| } else | ||
| _animation.avi->seekToFrame(frameNumber); | ||
| } | ||
|
|
||
| const Graphics::Surface *MetaAnimation::decodeNextFrame() { | ||
| if (_fileType == RLF) | ||
| _curFrame = _animation.rlf->decodeNextFrame(); | ||
| else | ||
| _curFrame = _animation.avi->decodeNextFrame(); | ||
|
|
||
| return _curFrame; | ||
| } | ||
|
|
||
| const Graphics::Surface *MetaAnimation::getFrameData(uint frameNumber) { | ||
| if (frameNumber >= frameCount()) | ||
| frameNumber = frameCount() - 1; | ||
|
|
||
| if (_fileType == RLF) { | ||
| _curFrame = _animation.rlf->getFrameData(frameNumber); | ||
| return _curFrame; | ||
| } else { | ||
| _animation.avi->seekToFrame(frameNumber); | ||
| _curFrame = _animation.avi->decodeNextFrame(); | ||
| return _curFrame; | ||
| } | ||
| } | ||
|
|
||
| bool MetaAnimation::endOfAnimation() { | ||
| if (_fileType == RLF) { | ||
| return _animation.rlf->endOfAnimation(); | ||
| } else | ||
| return _animation.avi->endOfVideo(); | ||
| } | ||
|
|
||
| } // End of namespace ZVision |
| @@ -8,22 +8,25 @@ | ||
| * 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. | ||
| * | ||
| */ | ||
|
|
||
| #ifndef ZVISION_ANIMATION_CONTROL_H | ||
| #define ZVISION_ANIMATION_CONTROL_H | ||
| #ifndef ZVISION_METAANIM_NODE_H | ||
| #define ZVISION_METAANIM_NODE_H | ||
|
|
||
| #include "zvision/scripting/control.h" | ||
| #include "zvision/scripting/sidefx.h" | ||
| #include "zvision/zvision.h" | ||
| #include "common/rect.h" | ||
| #include "common/list.h" | ||
|
|
||
|
|
||
| namespace Common { | ||
| @@ -43,10 +46,21 @@ namespace ZVision { | ||
| class ZVision; | ||
| class RlfAnimation; | ||
|
|
||
| class AnimationControl : public Control { | ||
| class MetaAnimation { | ||
| public: | ||
| AnimationControl(ZVision *engine, uint32 controlKey, const Common::String &fileName); | ||
| ~AnimationControl(); | ||
| MetaAnimation(const Common::String &fileName, ZVision *engine); | ||
| ~MetaAnimation(); | ||
|
|
||
| struct playnode { | ||
| Common::Rect pos; | ||
| int32 slot; | ||
| int32 start; | ||
| int32 stop; | ||
| int32 loop; | ||
| int32 _curFrame; | ||
| int32 _delay; | ||
| Graphics::Surface *_scaled; | ||
| }; | ||
|
|
||
| private: | ||
| enum FileType { | ||
| @@ -55,31 +69,29 @@ class AnimationControl : public Control { | ||
| }; | ||
|
|
||
| private: | ||
| uint32 _animationKey; | ||
|
|
||
| union { | ||
| RlfAnimation *rlf; | ||
| Video::VideoDecoder *avi; | ||
| } _animation; | ||
|
|
||
| FileType _fileType; | ||
| uint _loopCount; | ||
| int32 _x; | ||
| int32 _y; | ||
|
|
||
| uint _accumulatedTime; | ||
| uint _currentLoop; | ||
| int32 _frmDelay; | ||
|
|
||
| Graphics::Surface *_cachedFrame; | ||
| bool _cachedFrameNeedsDeletion; | ||
| const Graphics::Surface *_curFrame; | ||
|
|
||
| public: | ||
| bool process(uint32 deltaTimeInMillis); | ||
|
|
||
| void setAnimationKey(uint32 animationKey) { _animationKey = animationKey; } | ||
| void setLoopCount(uint loopCount) { _loopCount = loopCount; } | ||
| void setXPos(int32 x) { _x = x; } | ||
| void setYPost(int32 y) { _y = y; } | ||
| uint frameCount(); | ||
| uint width(); | ||
| uint height(); | ||
| uint32 frameTime(); | ||
|
|
||
| void seekToFrame(int frameNumber); | ||
|
|
||
| const Graphics::Surface *decodeNextFrame(); | ||
| const Graphics::Surface *getFrameData(uint frameNumber); | ||
|
|
||
| bool endOfAnimation(); | ||
| }; | ||
|
|
||
| } // End of namespace ZVision | ||
Oops, something went wrong.
Showing you all comments on commits in this comparison.
This comment has been minimized.
This comment has been minimized.
|
The bracket syntax is C99. Do all our platforms support this? |