added error visualisation
authormatthew <matthew@owens.tech>
Mon, 30 Jul 2018 16:31:03 +0000 (17:31 +0100)
committermatthew <matthew@owens.tech>
Mon, 30 Jul 2018 16:31:03 +0000 (17:31 +0100)
nogl/main.c

index 7ff0e3e..550c96a 100644 (file)
@@ -42,10 +42,12 @@ int main()
        for(int y = 0; y < bsize.y; ++y){
                for(int x = 0; x < bsize.x; ++x){
                        loc = point2i(x,y);
-                       elevation[y * bsize.x + x] = board_elevation_at(board, loc) + '0';
                        //if(elevation[y * bsize.x + x] != 1){
                        if(board_elevation_at(board, loc) != 1){
                                printf("elevation error at (%d,%d)\n", loc.x, loc.y);
+                               elevation[y * bsize.x + x] = '?';
+                       } else {
+                               elevation[y * bsize.x + x] = board_elevation_at(board, loc) + '0';
                        }
                        if(board_terrain_at(board, loc) == IMPASSABLE){
                                terrain[y * bsize.x + x] = 'X';