diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-01-13 21:21:42 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-14 22:26:26 (GMT) |
| commit | ff55050b9ba7dfdcdf83457f90a94f37c7e1c907 (patch) | |
| tree | efc35b74dbf8060a565646dc4337bd956355ce9f /src/save.c | |
| parent | dcac550ef406a24493ac3c6a24804997e2f1bef2 (diff) | |
| download | powder-ff55050b9ba7dfdcdf83457f90a94f37c7e1c907.zip powder-ff55050b9ba7dfdcdf83457f90a94f37c7e1c907.tar.gz | |
Change variable declarations to make Visual Studio happy
Diffstat (limited to 'src/save.c')
| -rw-r--r-- | src/save.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,4 +1,5 @@ #include <bzlib.h> +#include <math.h> #include "defines.h" #include "powder.h" #include "save.h" @@ -56,7 +57,9 @@ pixel *prerender_save_OPS(void *save, int size, int *width, int *height) int i, x, y, j; int blockX, blockY, blockW, blockH, fullX, fullY, fullW, fullH; pixel * vidBuf = NULL; - + bson b; + bson_iterator iter; + //Block sizes blockX = 0; blockY = 0; @@ -115,8 +118,6 @@ pixel *prerender_save_OPS(void *save, int size, int *width, int *height) goto fail; } - bson b; - bson_iterator iter; bson_init_data(&b, bsonData); bson_iterator_init(&iter, &b); while(bson_iterator_next(&iter)) @@ -311,7 +312,8 @@ void *build_save_OPS(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h int blockX, blockY, blockW, blockH, fullX, fullY, fullW, fullH; int x, y, i, wallDataFound = 0; int posCount, signsCount; - + bson b; + //Get coords in blocks blockX = orig_x0/CELL; blockY = orig_y0/CELL; @@ -542,7 +544,6 @@ void *build_save_OPS(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h partsData = NULL; } - bson b; bson_init(&b); bson_append_bool(&b, "waterEEnabled", water_equal_test); bson_append_bool(&b, "legacyEnable", legacy_enable); @@ -640,7 +641,9 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c int i, freeIndicesCount, x, y, returnCode = 0, j; int *freeIndices = NULL; int blockX, blockY, blockW, blockH, fullX, fullY, fullW, fullH; - + bson b; + bson_iterator iter; + //Block sizes blockX = x0/CELL; blockY = y0/CELL; @@ -701,8 +704,6 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c clear_sim(); } - bson b; - bson_iterator iter; bson_init_data(&b, bsonData); bson_iterator_init(&iter, &b); while(bson_iterator_next(&iter)) |
