mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-16 15:08:59 +00:00
WINTERMUTE: Save frames as uint rather than long
It's just as good: at 30 FPS, this allows for 2 ^ 32 / 30 / 60 = 2386093 mins, which is, I guess, a reasonable limit.
This commit is contained in:
parent
afb3ae3034
commit
7c6f9772d3
@ -34,7 +34,7 @@ VideoSubtitle::VideoSubtitle(BaseGame *inGame): BaseClass(inGame) {
|
||||
_startFrame = _endFrame = 0;
|
||||
}
|
||||
|
||||
VideoSubtitle::VideoSubtitle(BaseGame *inGame, const Common::String &text, const long &startFrame, const long &endFrame): BaseClass(inGame) {
|
||||
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());
|
||||
@ -44,11 +44,11 @@ VideoSubtitle::VideoSubtitle(BaseGame *inGame, const Common::String &text, const
|
||||
_endFrame = endFrame;
|
||||
}
|
||||
|
||||
long VideoSubtitle::getStartFrame() {
|
||||
uint VideoSubtitle::getStartFrame() {
|
||||
return _startFrame;
|
||||
}
|
||||
|
||||
long VideoSubtitle::getEndFrame() {
|
||||
uint VideoSubtitle::getEndFrame() {
|
||||
return _endFrame;
|
||||
}
|
||||
|
||||
|
@ -36,13 +36,13 @@ namespace Wintermute {
|
||||
class VideoSubtitle : public BaseClass {
|
||||
public:
|
||||
VideoSubtitle(BaseGame *inGame);
|
||||
VideoSubtitle(BaseGame *inGame, const Common::String &text, const long &startFrame, const long &endFrame);
|
||||
long getEndFrame();
|
||||
long getStartFrame();
|
||||
VideoSubtitle(BaseGame *inGame, const Common::String &text, const uint &startFrame, const uint &endFrame);
|
||||
uint getEndFrame();
|
||||
uint getStartFrame();
|
||||
Common::String getText();
|
||||
private:
|
||||
long _endFrame;
|
||||
long _startFrame;
|
||||
uint _endFrame;
|
||||
uint _startFrame;
|
||||
Common::String _text;
|
||||
};
|
||||
|
||||
|
@ -76,7 +76,7 @@ bool VideoSubtitler::loadSubtitles(const Common::String &filename, const Common:
|
||||
newFile = PathUtil::combine(path, name + ext);
|
||||
}
|
||||
|
||||
long size;
|
||||
int size;
|
||||
|
||||
Common::SeekableReadStream *file = BaseFileManager::getEngineInstance()->openFile(newFile, true, false);
|
||||
|
||||
@ -88,7 +88,7 @@ bool VideoSubtitler::loadSubtitles(const Common::String &filename, const Common:
|
||||
char *buffer = new char[size];
|
||||
file->read(buffer, size);
|
||||
|
||||
long start, end;
|
||||
int start, end;
|
||||
bool inToken;
|
||||
char *tokenStart;
|
||||
int tokenLength;
|
||||
@ -184,7 +184,7 @@ bool VideoSubtitler::display() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VideoSubtitler::update(long frame) {
|
||||
bool VideoSubtitler::update(uint frame) {
|
||||
|
||||
if (_subtitles.size() == 0) {
|
||||
// Edge case: we have loaded subtitles early on... from a blank file.
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
uint _currentSubtitle;
|
||||
bool loadSubtitles(const Common::String &filename, const Common::String &subtitleFile);
|
||||
bool display();
|
||||
bool update(long frame);
|
||||
bool update(uint frame);
|
||||
private:
|
||||
Common::Array<VideoSubtitle *> _subtitles;
|
||||
long _lastSample;
|
||||
|
Loading…
x
Reference in New Issue
Block a user