LASTEXPRESS: Remove unnecessary casts

This commit is contained in:
Littleboy 2012-08-21 23:16:52 -04:00
parent bc4e10dabc
commit 275aded0b0
7 changed files with 14 additions and 14 deletions

View File

@ -210,10 +210,10 @@ void SubtitleManager::setTime(uint16 time) {
_currentIndex = -1;
// Find the appropriate line to show
for (int16 i = 0; i < (int16)_subtitles.size(); i++) {
for (uint i = 0; i < _subtitles.size(); i++) {
if ((time >= _subtitles[i]->getTimeStart()) && (time <= _subtitles[i]->getTimeStop())) {
// Keep the index of the line to show
_currentIndex = i;
_currentIndex = (int16)i;
return;
}
}
@ -237,7 +237,7 @@ Common::Rect SubtitleManager::draw(Graphics::Surface *surface) {
// Draw the current line
assert(_currentIndex >= 0 && _currentIndex < (int16)_subtitles.size());
return _subtitles[_currentIndex]->draw(surface, _font);
return _subtitles[(uint16)_currentIndex]->draw(surface, _font);
}
} // End of namespace LastExpress

View File

@ -50,7 +50,7 @@ EntityData::EntityCallData::~EntityCallData() {
SAFE_DELETE(sequence3);
}
void EntityData::EntityCallData::syncString(Common::Serializer &s, Common::String &string, int length) const {
void EntityData::EntityCallData::syncString(Common::Serializer &s, Common::String &string, uint length) const {
char seqName[13];
memset(&seqName, 0, length);
@ -117,7 +117,7 @@ EntityData::EntityParameters *EntityData::getParameters(uint callback, byte inde
return _parameters[callback].parameters[index];
}
int EntityData::getCallback(uint callback) const {
byte EntityData::getCallback(uint callback) const {
if (callback >= 16)
error("[EntityData::getCallback] Invalid callback value (was: %d, max: 16)", callback);

View File

@ -822,7 +822,7 @@ public:
* @param string The string.
* @param length Length of the string.
*/
void syncString(Common::Serializer &s, Common::String &string, int length) const;
void syncString(Common::Serializer &s, Common::String &string, uint length) const;
// Serializable
void saveLoadWithSerializer(Common::Serializer &s);
@ -845,8 +845,8 @@ public:
EntityParameters *getCurrentParameters(byte index = 0) { return getParameters(_data.currentCall, index); }
EntityCallParameters *getCurrentCallParameters() { return &_parameters[_data.currentCall]; }
int getCallback(uint callback) const;
int getCurrentCallback() { return getCallback(_data.currentCall); }
byte getCallback(uint callback) const;
byte getCurrentCallback() { return getCallback(_data.currentCall); }
void setCallback(uint callback, byte index);
void setCurrentCallback(uint index) { setCallback(_data.currentCall, index); }

View File

@ -394,7 +394,7 @@ Action::Action(LastExpressEngine *engine) : _engine(engine) {
}
Action::~Action() {
for (int i = 0; i < (int)_actions.size(); i++)
for (uint i = 0; i < _actions.size(); i++)
SAFE_DELETE(_actions[i]);
_actions.clear();

View File

@ -181,7 +181,7 @@ Entities::Entities(LastExpressEngine *engine) : _engine(engine) {
Entities::~Entities() {
SAFE_DELETE(_header);
for (int i = 0; i < (int)_entities.size(); i++)
for (uint i = 0; i < _entities.size(); i++)
SAFE_DELETE(_entities[i]);
_entities.clear();

View File

@ -619,7 +619,7 @@ void Inventory::drawEgg() const {
// Blinking egg: we need to blink the egg for delta time, with the blinking getting faster until it's always lit.
void Inventory::drawBlinkingEgg(uint ticks) {
uint globalTimer = getGlobalTimer();
uint globalTimer = (uint)getGlobalTimer();
uint timerValue = (getProgress().jacket == kJacketGreen) ? 450 : 225;
if (globalTimer == timerValue || globalTimer == 900) {
@ -653,7 +653,7 @@ void Inventory::drawBlinkingEgg(uint ticks) {
}
void Inventory::blinkEgg() {
drawItem((CursorStyle)(getMenu()->getGameId() + 39), 608, 448, (_blinkingBrightness == 0) ? -1 : _blinkingBrightness);
drawItem((CursorStyle)(getMenu()->getGameId() + 39), 608, 448, (_blinkingBrightness == 0) ? -1 : (int16)_blinkingBrightness);
askForRedraw();

View File

@ -202,7 +202,7 @@ void SavePoints::callAndProcess() {
// Misc
//////////////////////////////////////////////////////////////////////////
bool SavePoints::updateEntityFromData(const SavePoint &savepoint) {
for (int i = 0; i < (int)_data.size(); i++) {
for (uint i = 0; i < _data.size(); i++) {
// Not a data savepoint!
if (!_data[i].entity1)
@ -210,7 +210,7 @@ bool SavePoints::updateEntityFromData(const SavePoint &savepoint) {
// Found our data!
if (_data[i].entity1 == savepoint.entity1 && _data[i].action == savepoint.action) {
debugC(8, kLastExpressDebugLogic, "Update entity from data: entity1=%s, action=%s, param=%d", ENTITY_NAME(_data[i].entity1), ACTION_NAME(_data[i].action), _data[i].param);
debugC(8, kLastExpressDebugLogic, "Update entity from data: entity1=%s, action=%s, param=%u", ENTITY_NAME(_data[i].entity1), ACTION_NAME(_data[i].action), _data[i].param);
// the SavePoint param value is the index of the entity call parameter to update
getEntities()->get(_data[i].entity1)->getParamData()->updateParameters(_data[i].param);