aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-28 16:27:51 +0000
committerTorbjörn Andersson2003-09-28 16:27:51 +0000
commitd4f6639802ff0c99ed0ecd482aa0c0ad483c7a8f (patch)
tree244da2cc2dc4ceaf0156977b385eaea8e5eff6bf /sword2
parent6e13f4eb2852d244b544e18bcbdbacbc424eedac (diff)
downloadscummvm-rg350-d4f6639802ff0c99ed0ecd482aa0c0ad483c7a8f.tar.gz
scummvm-rg350-d4f6639802ff0c99ed0ecd482aa0c0ad483c7a8f.tar.bz2
scummvm-rg350-d4f6639802ff0c99ed0ecd482aa0c0ad483c7a8f.zip
cleanup
svn-id: r10467
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/render.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index 7a90fbb3a6..fbb964a34d 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -64,7 +64,6 @@ int32 renderTooSlow;
uint8 xblocks[MAXLAYERS];
uint8 yblocks[MAXLAYERS];
-uint8 restoreLayer[MAXLAYERS];
// blockSurfaces stores an array of sub-blocks for each of the parallax layers.
@@ -378,15 +377,15 @@ void StretchImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 dstHeight,
int32 RestoreBackgroundLayer(_parallax *p, int16 l)
{
int16 oldLayer = layer;
- int16 i;
debug(2, "RestoreBackgroundLayer %d", l);
layer = l;
if (blockSurfaces[l]) {
- for (i = 0; i < xblocks[l] * yblocks[l]; i++)
+ for (int i = 0; i < xblocks[l] * yblocks[l]; i++) {
if (blockSurfaces[l][i])
free(blockSurfaces[l][i]);
+ }
free(blockSurfaces[l]);
blockSurfaces[l] = NULL;
@@ -707,7 +706,6 @@ int32 SetLocationMetrics(uint16 w, uint16 h) {
int32 RenderParallax(_parallax *p, int16 l) {
int16 x, y;
- int16 i, j;
ScummVM::Rect r;
if (locationWide == screenWide)
@@ -729,8 +727,8 @@ int32 RenderParallax(_parallax *p, int16 l) {
clip_rect.top = MENUDEEP;
clip_rect.bottom = screenDeep - MENUDEEP;
- for (j = 0; j < yblocks[l]; j++) {
- for (i = 0; i < xblocks[l]; i++) {
+ for (int j = 0; j < yblocks[l]; j++) {
+ for (int i = 0; i < xblocks[l]; i++) {
if (blockSurfaces[l][i + j * xblocks[l]]) {
r.left = i * BLOCKWIDTH - x;
r.right = r.left + BLOCKWIDTH;
@@ -988,10 +986,11 @@ int32 InitialiseBackgroundLayer(_parallax *p) {
} else
blockSurfaces[layer][i] = NULL;
}
+
free(memchunk);
layer++;
- return RD_OK;
+ return RD_OK;
}
/**
@@ -1001,11 +1000,9 @@ int32 InitialiseBackgroundLayer(_parallax *p) {
int32 CloseBackgroundLayer(void) {
debug(2, "CloseBackgroundLayer");
- int16 i, j;
-
- for (j = 0; j < MAXLAYERS; j++) {
+ for (int j = 0; j < MAXLAYERS; j++) {
if (blockSurfaces[j]) {
- for (i = 0; i < xblocks[j] * yblocks[j]; i++)
+ for (int i = 0; i < xblocks[j] * yblocks[j]; i++)
if (blockSurfaces[j][i])
free(blockSurfaces[j][i]);
free(blockSurfaces[j]);