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:
Tobia Tesan 2014-02-08 00:39:59 +01:00
parent afb3ae3034
commit 7c6f9772d3
4 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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.

View 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;