ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

subtitles.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef SUBTITLES_H_
00024 #define SUBTITLES_H_
00025 
00026 #include "engines/myst3/gfx.h"
00027 
00028 #include "common/array.h"
00029 
00030 namespace Myst3 {
00031 
00032 class Myst3Engine;
00033 class DirectorySubEntry;
00034 
00035 class Subtitles : public Window {
00036 public:
00037     static Subtitles *create(Myst3Engine *vm, uint32 id);
00038     virtual ~Subtitles();
00039 
00040     // Window API
00041     Common::Rect getPosition() const override;
00042     Common::Rect getOriginalPosition() const override;
00043 
00044     void setFrame(int32 frame);
00045     void drawOverlay() override;
00046 
00047 protected:
00048     struct Phrase {
00049         uint32 offset;
00050         int32 frame;
00051         Common::String string;
00052     };
00053 
00054     Subtitles(Myst3Engine *vm);
00055 
00056     void loadFontSettings(int32 id);
00057     virtual void loadResources() = 0;
00058     virtual bool loadSubtitles(int32 id) = 0;
00059     virtual void drawToTexture(const Phrase *phrase) = 0;
00060     void freeTexture();
00061 
00062     int32 checkOverridenId(int32 id);
00063     const DirectorySubEntry *loadText(int32 id, bool overriden);
00064 
00065     Myst3Engine *_vm;
00066 
00067     Common::Array<Phrase> _phrases;
00068 
00069     int32 _frame;
00070     Texture *_texture;
00071 
00072     // Font settings
00073     Common::String _fontFace;
00074     uint _fontSize;
00075     bool _fontBold;
00076     uint _surfaceHeight;
00077     uint _singleLineTop;
00078     uint _line1Top;
00079     uint _line2Top;
00080     uint _surfaceTop;
00081     int32 _fontCharsetCode;
00082 };
00083 
00084 } // End of namespace Myst3
00085 
00086 #endif // SUBTITLES_H_


Generated on Sat Oct 12 2019 05:00:59 for ResidualVM by doxygen 1.7.1
curved edge   curved edge