[Scummvm-cvs-logs] scummvm master -> 9796890cce47e43d06b5459459150d44b39b1883
Littleboy
littleboy22 at gmail.com
Mon Sep 19 15:29:57 CEST 2011
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ce4c98d757 LASTEXPRESS: Small cleanup in Entities::processEntity() and Entities::processFrame()
9796890cce GUI: Replace ConsoleDialog use of vsnprintf by Common::String::vformat()
Commit: ce4c98d75715192823655f8e255b894c5bb92364
https://github.com/scummvm/scummvm/commit/ce4c98d75715192823655f8e255b894c5bb92364
Author: Littleboy (littleboy at scummvm.org)
Date: 2011-09-19T06:22:59-07:00
Commit Message:
LASTEXPRESS: Small cleanup in Entities::processEntity() and Entities::processFrame()
Changed paths:
engines/lastexpress/game/entities.cpp
diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp
index f6bb203..1b31339 100644
--- a/engines/lastexpress/game/entities.cpp
+++ b/engines/lastexpress/game/entities.cpp
@@ -753,50 +753,48 @@ label_nosequence:
if (!data->sequence)
goto label_nosequence;
- if (data->frame->getInfo()->field_30 > data->field_49B + 1 || (data->direction == kDirectionLeft && data->sequence->count() == 1)) {
+ if (data->frame->getInfo()->field_30 > (data->field_49B + 1) || (data->direction == kDirectionLeft && data->sequence->count() == 1)) {
++data->field_49B;
- INCREMENT_DIRECTION_COUNTER();
- return;
- }
+ } else {
+ if (data->frame->getInfo()->field_30 > data->field_49B && !data->frame->getInfo()->keepPreviousFrame) {
+ ++data->field_49B;
+ } else {
+ if (data->frame->getInfo()->keepPreviousFrame == 1)
+ keepPreviousFrame = true;
- if (data->frame->getInfo()->field_30 > data->field_49B && !data->frame->getInfo()->keepPreviousFrame) {
- ++data->field_49B;
- INCREMENT_DIRECTION_COUNTER();
- return;
- }
+ // Increment current frame
+ ++data->currentFrame;
- if (data->frame->getInfo()->keepPreviousFrame == 1)
- keepPreviousFrame = true;
+ if (data->currentFrame > (int16)(data->sequence->count() - 1) || (data->field_4A9 && checkSequenceFromPosition(entityIndex))) {
- // Increment current frame
- ++data->currentFrame;
+ if (data->direction == kDirectionLeft) {
+ data->currentFrame = 0;
+ } else {
+ keepPreviousFrame = true;
+ drawNextSequence(entityIndex);
- if (data->currentFrame > (int16)(data->sequence->count() - 1) || (data->field_4A9 && checkSequenceFromPosition(entityIndex))) {
+ if (getFlags()->flag_entities_0 || data->doProcessEntity)
+ return;
- if (data->direction == kDirectionLeft) {
- data->currentFrame = 0;
- } else {
- keepPreviousFrame = true;
- drawNextSequence(entityIndex);
+ if (!data->sequence2) {
+ updateEntityPosition(entityIndex);
+ data->doProcessEntity = false;
+ return;
+ }
- if (getFlags()->flag_entities_0 || data->doProcessEntity)
- return;
+ copySequenceData(entityIndex);
+ }
- if (!data->sequence2) {
- updateEntityPosition(entityIndex);
- data->doProcessEntity = false;
- return;
}
- copySequenceData(entityIndex);
- }
+ processFrame(entityIndex, keepPreviousFrame, false);
+ if (getFlags()->flag_entities_0 || data->doProcessEntity)
+ return;
+ }
}
- processFrame(entityIndex, keepPreviousFrame, false);
-
- if (!getFlags()->flag_entities_0 && !data->doProcessEntity)
- INCREMENT_DIRECTION_COUNTER();
+ INCREMENT_DIRECTION_COUNTER();
}
void Entities::computeCurrentFrame(EntityIndex entityIndex) const {
@@ -1109,9 +1107,8 @@ void Entities::processFrame(EntityIndex entityIndex, bool keepPreviousFrame, boo
// Get new frame info
FrameInfo *info = data->sequence->getFrameInfo((uint16)data->currentFrame);
- if (data->frame && data->frame->getInfo()->subType != kFrameType3)
- if (!info->field_2E || keepPreviousFrame)
- getScenes()->setCoordinates(data->frame);
+ if (data->frame && data->frame->getInfo()->subType != kFrameType3 && (!info->field_2E || keepPreviousFrame))
+ getScenes()->setCoordinates(data->frame);
// Update position
if (info->entityPosition) {
Commit: 9796890cce47e43d06b5459459150d44b39b1883
https://github.com/scummvm/scummvm/commit/9796890cce47e43d06b5459459150d44b39b1883
Author: Littleboy (littleboy at scummvm.org)
Date: 2011-09-19T06:23:00-07:00
Commit Message:
GUI: Replace ConsoleDialog use of vsnprintf by Common::String::vformat()
Changed paths:
gui/console.cpp
diff --git a/gui/console.cpp b/gui/console.cpp
index b656d23..bfce04c 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -665,12 +665,11 @@ int ConsoleDialog::printFormat(int dummy, const char *format, ...) {
}
int ConsoleDialog::vprintFormat(int dummy, const char *format, va_list argptr) {
- char buf[2048];
+ Common::String buffer = Common::String::vformat(format, argptr);
- int count = vsnprintf(buf, sizeof(buf), format, argptr);
- buf[sizeof(buf)-1] = 0; // ensure termination
- print(buf);
- return count;
+ print(buffer.c_str());
+
+ return buffer.size();
}
void ConsoleDialog::printChar(int c) {
More information about the Scummvm-git-logs
mailing list