mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 22:38:17 +00:00
ULTIMA8: Fix some coverity issues
This commit is contained in:
parent
a18e803ea6
commit
20d4380337
@ -47,7 +47,7 @@ MusicFlex::~MusicFlex() {
|
||||
}
|
||||
|
||||
MusicFlex::SongInfo::SongInfo() : _numMeasures(0), _loopJump(0) {
|
||||
memset(_filename, 0, 16);
|
||||
memset(_filename, 0, 17);
|
||||
memset(_transitions, 0, 128 * sizeof(int *));
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
SongInfo();
|
||||
~SongInfo();
|
||||
|
||||
char _filename[16];
|
||||
char _filename[17];
|
||||
int _numMeasures;
|
||||
int _loopJump;
|
||||
int *_transitions[128];
|
||||
|
@ -105,6 +105,9 @@ void ComputerGump::run() {
|
||||
void ComputerGump::nextText() {
|
||||
TextWidget *textWidget = dynamic_cast<TextWidget *>(_textWidget);
|
||||
|
||||
if (!textWidget)
|
||||
return;
|
||||
|
||||
if (!textWidget->setupNextText())
|
||||
Close();
|
||||
}
|
||||
|
@ -220,8 +220,7 @@ void RemorseMenuGump::selectEntry(int entry) {
|
||||
}
|
||||
|
||||
bool RemorseMenuGump::OnTextInput(int unicode) {
|
||||
if (Gump::OnTextInput(unicode)) return true;
|
||||
return true;
|
||||
return Gump::OnTextInput(unicode);
|
||||
}
|
||||
|
||||
} // End of namespace Ultima8
|
||||
|
@ -101,9 +101,9 @@ static const char *_getRandomMovie(const char **movies, int nmovies) {
|
||||
bool WeaselGump::_playedIntroMovie = false;
|
||||
|
||||
WeaselGump::WeaselGump(uint16 level)
|
||||
: ModalGump(0, 0, 640, 480), _credits(0),
|
||||
_level(level), _state(kWeaselStart), _curItem(0), _ammoMode(false),
|
||||
_curItemCost(1), _curItemShape(0), _ui(nullptr), _movie(nullptr) {
|
||||
: ModalGump(0, 0, 640, 480), _credits(0), _level(level),
|
||||
_state(kWeaselStart), _curItem(0), _ammoMode(false), _curItemCost(1),
|
||||
_curItemShape(0), _ui(nullptr), _movie(nullptr), _weaselDat(nullptr) {
|
||||
Mouse *mouse = Mouse::get_instance();
|
||||
mouse->pushMouseCursor();
|
||||
mouse->setMouseCursor(Mouse::MOUSE_HAND);
|
||||
@ -202,6 +202,10 @@ Gump *WeaselGump::playMovie(const Std::string &filename) {
|
||||
const Std::string path = Std::string::format("flics/%s.avi", filename.c_str());
|
||||
FileSystem *filesys = FileSystem::get_instance();
|
||||
Common::SeekableReadStream *rs = filesys->ReadFile(path);
|
||||
if (!rs) {
|
||||
warning("Couldn't load flic %s", filename.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
Gump *gump = new MovieGump(600, 450, rs, false);
|
||||
gump->InitGump(this, true);
|
||||
gump->setRelativePosition(CENTER);
|
||||
@ -500,6 +504,7 @@ void WeaselGump::updateItemDisplay() {
|
||||
const ShapeInfo *shapeinfo = GameData::get_instance()->getMainShapes()->getShapeInfo(_curItemShape);
|
||||
if (!shapeinfo || !shapeinfo->_weaponInfo) {
|
||||
warning("Weasel: no info for shape %d", _curItemShape);
|
||||
return;
|
||||
}
|
||||
const Shape *shape = GameData::get_instance()->getGumps()->getShape(shapeinfo->_weaponInfo->_displayGumpShape);
|
||||
|
||||
|
@ -1223,6 +1223,7 @@ Common::Error Ultima8Engine::loadGameStream(Common::SeekableReadStream *stream)
|
||||
perr << message << Std::endl;
|
||||
#else
|
||||
Error(message, "Error Loading savegame");
|
||||
delete sg;
|
||||
return Common::kReadingFailed;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user