aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-06-08 22:53:38 +0200
committerStrangerke2014-06-08 22:53:38 +0200
commit5d80601c06c02db12147b64c5c17feeaf5565bc8 (patch)
tree10d01cacc09428bbba38ecad204b80cde26b7475
parent93010a840734507b84554ad47e50eec7db34a939 (diff)
downloadscummvm-rg350-5d80601c06c02db12147b64c5c17feeaf5565bc8.tar.gz
scummvm-rg350-5d80601c06c02db12147b64c5c17feeaf5565bc8.tar.bz2
scummvm-rg350-5d80601c06c02db12147b64c5c17feeaf5565bc8.zip
CGE2: Reduce the scope of a couple of variables, fix style
-rw-r--r--engines/cge2/talk.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/cge2/talk.cpp b/engines/cge2/talk.cpp
index acadd2e001..87703834e7 100644
--- a/engines/cge2/talk.cpp
+++ b/engines/cge2/talk.cpp
@@ -128,21 +128,21 @@ Talk::Talk(CGE2Engine *vm, ColorBank color)
}
uint8 *Talk::box(V2D siz) {
- uint8 *b, *p, *q;
uint16 n, r = (_mode == kTBRound) ? kTextRoundCorner : 0;
const byte lt = _color[1], bg = _color[2], dk = _color[3];
- int i;
- if (siz.x < 8) siz.x = 8;
- if (siz.y < 8) siz.y = 8;
- b = new uint8[n = siz.area()];
+ if (siz.x < 8)
+ siz.x = 8;
+ if (siz.y < 8)
+ siz.y = 8;
+ uint8 *b = new uint8[n = siz.area()];
if (!b)
error("No core!");
memset(b, bg, n);
if (_mode) {
- p = b;
- q = b + n - siz.x;
+ uint8 *p = b;
+ uint8 *q = b + n - siz.x;
memset(p, lt, siz.x);
memset(q, dk, siz.x);
while (p < q) {
@@ -151,9 +151,9 @@ uint8 *Talk::box(V2D siz) {
*p = lt;
}
p = b;
- for (i = 0; i < r; i++) {
- int j;
- for (j = 0; j < r - i; j++) {
+ for (int i = 0; i < r; i++) {
+ int j = 0;
+ for (; j < r - i; j++) {
p[j] = kPixelTransp;
p[siz.x - j - 1] = kPixelTransp;
q[j] = kPixelTransp;