diff --git a/a.out b/a.out index 74001d0..8d7c1d1 100755 Binary files a/a.out and b/a.out differ diff --git a/display.cmi b/display.cmi index 8a48d58..4301f53 100644 Binary files a/display.cmi and b/display.cmi differ diff --git a/display.cmx b/display.cmx index d977b40..c9a6f01 100644 Binary files a/display.cmx and b/display.cmx differ diff --git a/display.ml b/display.ml index 6dcf99d..46317e0 100644 --- a/display.ml +++ b/display.ml @@ -297,7 +297,7 @@ let copperTexture = parse_texture_static "textures/copper.txt" ;; let ironTexture = parse_texture_static "textures/iron.txt" ;; let goldTexture = parse_texture_static "textures/gold.txt" ;; let diamondTexture = parse_texture_static "textures/diamond.txt" ;; -let tungstenTexture = parse_texture_static "textures/copper.txt" ;; +let tungstenTexture = parse_texture_static "textures/tungsten.txt" ;; let zincTexture = parse_texture_static "textures/zinc.txt" ;; let carbonTexture = parse_texture_static "textures/carbon.txt" ;; let steelTexture = parse_texture_static "textures/carbon.txt" ;; @@ -1613,6 +1613,7 @@ let draw_inventories () = for i = 0 to (Array.length playerOreInventory -1) do set_color colorsInv.(i); draw_2D_texture textureOreList.(i) 2 (__height__ - (240 + 50 * (Array.length playerOreInventory -1 -i)) - 20) 2; + set_color black; draw_integer_alignedleft 40 (__height__ - (240 + 50 * (Array.length playerOreInventory -1 -i))) playerOreInventory.(i) 20 done ;; diff --git a/display.o b/display.o index 9812e12..5bc0401 100644 Binary files a/display.o and b/display.o differ diff --git a/image_parsing.py b/image_parsing.py index e9e6125..9ef1cbe 100644 --- a/image_parsing.py +++ b/image_parsing.py @@ -18,10 +18,7 @@ def import_img(filename, out_name, show=False): for w in range(0,height): (red, green, blue) = img.getpixel((w,height -1 -h)) if red * green * blue != 1: - if red * green * blue != 255*255*255: - ptr.write(str(red) + "," + str(green) + "," + str(blue)) - else: - ptr.write("1,1,1") + ptr.write(str(red) + "," + str(green) + "," + str(blue)) else: ptr.write("1,1,1") if(w != width-1): diff --git a/textures/carbon.txt b/textures/carbon.txt index 8e8bcf7..f096eb1 100644 --- a/textures/carbon.txt +++ b/textures/carbon.txt @@ -1,17 +1,17 @@ 16 16 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 35,35,35 35,35,35 20,20,20 20,20,20 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 35,35,35 49,49,49 63,63,63 49,49,49 33,33,33 20,20,20 20,20,20 20,20,20 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 35,35,35 49,49,49 63,63,63 81,81,81 49,49,49 43,43,43 43,43,43 49,49,49 49,49,49 20,20,20 20,20,20 20,20,20 1,1,1 1,1,1 1,1,1 -35,35,35 49,49,49 63,63,63 63,63,63 81,81,81 49,49,49 43,43,43 43,43,43 43,43,43 43,43,43 63,63,63 63,63,63 49,49,49 20,20,20 20,20,20 1,1,1 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 35,35,35 35,35,35 20,20,20 20,20,20 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 35,35,35 49,49,49 63,63,63 49,49,49 33,33,33 20,20,20 20,20,20 20,20,20 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 35,35,35 49,49,49 63,63,63 81,81,81 49,49,49 43,43,43 43,43,43 49,49,49 49,49,49 20,20,20 20,20,20 20,20,20 255,255,255 255,255,255 255,255,255 +35,35,35 49,49,49 63,63,63 63,63,63 81,81,81 49,49,49 43,43,43 43,43,43 43,43,43 43,43,43 63,63,63 63,63,63 49,49,49 20,20,20 20,20,20 255,255,255 35,35,35 63,63,63 63,63,63 63,63,63 96,96,96 96,96,96 81,81,81 49,49,49 43,43,43 43,43,43 43,43,43 43,43,43 63,63,63 63,63,63 63,63,63 20,20,20 35,35,35 63,63,63 63,63,63 96,96,96 81,81,81 81,81,81 96,96,96 96,96,96 96,96,96 81,81,81 49,49,49 43,43,43 43,43,43 49,49,49 63,63,63 20,20,20 35,35,35 63,63,63 96,96,96 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 96,96,96 96,96,96 96,96,96 81,81,81 43,43,43 63,63,63 20,20,20 35,35,35 96,96,96 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 96,96,96 96,96,96 81,81,81 43,43,43 -1,1,1 35,35,35 35,35,35 35,35,35 63,63,63 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 63,63,63 43,43,43 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 35,35,35 35,35,35 35,35,35 63,63,63 81,81,81 81,81,81 81,81,81 81,81,81 63,63,63 43,43,43 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 35,35,35 35,35,35 35,35,35 63,63,63 63,63,63 43,43,43 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 35,35,35 35,35,35 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 -1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 1,1,1 +255,255,255 35,35,35 35,35,35 35,35,35 63,63,63 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 81,81,81 63,63,63 43,43,43 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 35,35,35 35,35,35 35,35,35 63,63,63 81,81,81 81,81,81 81,81,81 81,81,81 63,63,63 43,43,43 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 35,35,35 35,35,35 35,35,35 63,63,63 63,63,63 43,43,43 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 35,35,35 35,35,35 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 +255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 255,255,255 diff --git a/textures/diamond.txt b/textures/diamond.txt index a71ece1..c520cdf 100644 --- a/textures/diamond.txt +++ b/textures/diamond.txt @@ -5,13 +5,13 @@ 0,0,0 0,0,0 0,0,0 20,94,83 44,224,216 26,170,167 32,197,181 32,197,181 32,197,181 32,197,181 26,170,167 161,251,232 20,94,83 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 20,94,83 74,237,217 26,170,167 32,197,181 32,197,181 32,197,181 32,197,181 26,170,167 32,197,181 20,94,83 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 213,255,246 74,237,217 74,237,217 26,170,167 26,170,167 26,170,167 26,170,167 32,197,181 32,197,181 28,145,154 20,94,83 0,0,0 0,0,0 -0,0,0 0,0,0 17,114,122 1,1,1 1,1,1 32,197,181 161,251,232 161,251,232 161,251,232 74,237,217 28,145,154 26,170,167 26,170,167 20,94,83 0,0,0 0,0,0 -0,0,0 0,0,0 17,114,122 1,1,1 74,237,217 213,255,246 74,237,217 161,251,232 161,251,232 161,251,232 28,145,154 32,197,181 26,170,167 20,94,83 0,0,0 0,0,0 -0,0,0 0,0,0 17,114,122 1,1,1 74,237,217 1,1,1 74,237,217 74,237,217 161,251,232 161,251,232 26,170,167 32,197,181 26,170,167 20,94,83 0,0,0 0,0,0 -0,0,0 0,0,0 0,0,0 17,114,122 1,1,1 74,237,217 1,1,1 213,255,246 1,1,1 213,255,246 74,237,217 74,237,217 20,94,83 0,0,0 0,0,0 0,0,0 -0,0,0 0,0,0 0,0,0 17,114,122 1,1,1 74,237,217 161,251,232 161,251,232 213,255,246 161,251,232 74,237,217 32,197,181 20,94,83 0,0,0 0,0,0 0,0,0 -0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 1,1,1 74,237,217 74,237,217 161,251,232 213,255,246 32,197,181 20,94,83 0,0,0 0,0,0 0,0,0 0,0,0 -0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 1,1,1 1,1,1 1,1,1 213,255,246 17,114,122 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 +0,0,0 0,0,0 17,114,122 255,255,255 255,255,255 32,197,181 161,251,232 161,251,232 161,251,232 74,237,217 28,145,154 26,170,167 26,170,167 20,94,83 0,0,0 0,0,0 +0,0,0 0,0,0 17,114,122 255,255,255 74,237,217 213,255,246 74,237,217 161,251,232 161,251,232 161,251,232 28,145,154 32,197,181 26,170,167 20,94,83 0,0,0 0,0,0 +0,0,0 0,0,0 17,114,122 255,255,255 74,237,217 255,255,255 74,237,217 74,237,217 161,251,232 161,251,232 26,170,167 32,197,181 26,170,167 20,94,83 0,0,0 0,0,0 +0,0,0 0,0,0 0,0,0 17,114,122 255,255,255 74,237,217 255,255,255 213,255,246 255,255,255 213,255,246 74,237,217 74,237,217 20,94,83 0,0,0 0,0,0 0,0,0 +0,0,0 0,0,0 0,0,0 17,114,122 255,255,255 74,237,217 161,251,232 161,251,232 213,255,246 161,251,232 74,237,217 32,197,181 20,94,83 0,0,0 0,0,0 0,0,0 +0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 255,255,255 74,237,217 74,237,217 161,251,232 213,255,246 32,197,181 20,94,83 0,0,0 0,0,0 0,0,0 0,0,0 +0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 255,255,255 255,255,255 255,255,255 213,255,246 17,114,122 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 17,114,122 17,114,122 17,114,122 17,114,122 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 diff --git a/textures/gold.txt b/textures/gold.txt index 3bf16c1..b6f166f 100644 --- a/textures/gold.txt +++ b/textures/gold.txt @@ -5,7 +5,7 @@ 0,0,0 0,0,0 178,100,17 233,177,21 250,214,74 233,177,21 233,177,21 117,40,2 117,40,2 117,40,2 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 178,100,17 233,177,21 250,214,74 253,245,95 233,177,21 220,150,19 220,150,19 233,177,21 233,177,21 117,40,2 117,40,2 117,40,2 0,0,0 0,0,0 0,0,0 178,100,17 233,177,21 253,245,95 250,214,74 253,245,95 233,177,21 220,150,19 220,150,19 220,150,19 220,150,19 233,177,21 250,214,74 250,214,74 117,40,2 117,40,2 0,0,0 -178,100,17 250,214,74 253,245,95 250,214,74 1,1,1 255,253,224 253,245,95 233,177,21 220,150,19 220,150,19 220,150,19 220,150,19 233,177,21 250,214,74 250,214,74 117,40,2 +178,100,17 250,214,74 253,245,95 250,214,74 255,255,255 255,253,224 253,245,95 233,177,21 220,150,19 220,150,19 220,150,19 220,150,19 233,177,21 250,214,74 250,214,74 117,40,2 178,100,17 250,214,74 253,245,95 255,253,224 253,245,95 253,245,95 255,253,224 255,253,224 255,253,224 253,245,95 233,177,21 220,150,19 220,150,19 220,150,19 250,214,74 117,40,2 178,100,17 250,214,74 255,253,224 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 255,253,224 255,253,224 255,253,224 253,245,95 220,150,19 250,214,74 117,40,2 178,100,17 255,253,224 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 253,245,95 255,253,224 255,253,224 253,245,95 117,40,2 diff --git a/textures/iron.txt b/textures/iron.txt index 04c1ef2..2622588 100644 --- a/textures/iron.txt +++ b/textures/iron.txt @@ -5,10 +5,10 @@ 0,0,0 0,0,0 94,94,94 130,130,130 168,168,168 130,130,130 88,88,88 53,53,53 53,53,53 53,53,53 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 94,94,94 130,130,130 168,168,168 216,216,216 130,130,130 114,114,114 114,114,114 130,130,130 130,130,130 53,53,53 53,53,53 53,53,53 0,0,0 0,0,0 0,0,0 94,94,94 130,130,130 168,168,168 168,168,168 216,216,216 130,130,130 114,114,114 114,114,114 114,114,114 114,114,114 168,168,168 168,168,168 130,130,130 53,53,53 53,53,53 0,0,0 -94,94,94 168,168,168 168,168,168 168,168,168 1,1,1 1,1,1 216,216,216 130,130,130 114,114,114 114,114,114 114,114,114 114,114,114 168,168,168 168,168,168 168,168,168 53,53,53 -94,94,94 168,168,168 168,168,168 1,1,1 216,216,216 216,216,216 1,1,1 1,1,1 1,1,1 216,216,216 130,130,130 114,114,114 114,114,114 130,130,130 168,168,168 53,53,53 -94,94,94 168,168,168 1,1,1 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 1,1,1 1,1,1 1,1,1 216,216,216 114,114,114 168,168,168 53,53,53 -94,94,94 1,1,1 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 1,1,1 1,1,1 216,216,216 114,114,114 +94,94,94 168,168,168 168,168,168 168,168,168 255,255,255 255,255,255 216,216,216 130,130,130 114,114,114 114,114,114 114,114,114 114,114,114 168,168,168 168,168,168 168,168,168 53,53,53 +94,94,94 168,168,168 168,168,168 255,255,255 216,216,216 216,216,216 255,255,255 255,255,255 255,255,255 216,216,216 130,130,130 114,114,114 114,114,114 130,130,130 168,168,168 53,53,53 +94,94,94 168,168,168 255,255,255 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 255,255,255 255,255,255 255,255,255 216,216,216 114,114,114 168,168,168 53,53,53 +94,94,94 255,255,255 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 255,255,255 255,255,255 216,216,216 114,114,114 0,0,0 94,94,94 94,94,94 94,94,94 168,168,168 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 216,216,216 168,168,168 114,114,114 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 94,94,94 94,94,94 94,94,94 168,168,168 216,216,216 216,216,216 216,216,216 216,216,216 168,168,168 114,114,114 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 94,94,94 94,94,94 94,94,94 168,168,168 168,168,168 114,114,114 0,0,0 0,0,0 0,0,0 diff --git a/textures/zinc.txt b/textures/zinc.txt index c663af3..cc12e72 100644 --- a/textures/zinc.txt +++ b/textures/zinc.txt @@ -7,8 +7,8 @@ 0,0,0 0,0,0 49,84,78 165,192,160 165,192,160 185,233,193 80,109,99 49,84,78 49,84,78 49,84,78 80,109,99 80,109,99 49,84,78 33,59,63 0,0,0 0,0,0 0,0,0 0,0,0 49,84,78 165,192,160 146,155,135 185,233,193 80,109,99 49,84,78 49,84,78 80,109,99 49,84,78 80,109,99 120,130,115 33,59,63 0,0,0 0,0,0 0,0,0 0,0,0 49,84,78 146,155,135 146,155,135 185,233,193 120,130,115 80,109,99 80,109,99 80,109,99 80,109,99 80,109,99 120,130,115 33,59,63 0,0,0 0,0,0 -0,0,0 0,0,0 49,84,78 146,155,135 165,192,160 1,1,1 214,255,220 214,255,220 165,192,160 120,130,115 80,109,99 120,130,115 120,130,115 33,59,63 0,0,0 0,0,0 -0,0,0 0,0,0 49,84,78 165,192,160 1,1,1 214,255,220 185,233,193 185,233,193 214,255,220 214,255,220 185,233,193 165,192,160 120,130,115 33,59,63 0,0,0 0,0,0 +0,0,0 0,0,0 49,84,78 146,155,135 165,192,160 255,255,255 214,255,220 214,255,220 165,192,160 120,130,115 80,109,99 120,130,115 120,130,115 33,59,63 0,0,0 0,0,0 +0,0,0 0,0,0 49,84,78 165,192,160 255,255,255 214,255,220 185,233,193 185,233,193 214,255,220 214,255,220 185,233,193 165,192,160 120,130,115 33,59,63 0,0,0 0,0,0 0,0,0 0,0,0 80,109,99 214,255,220 214,255,220 185,233,193 185,233,193 185,233,193 185,233,193 214,255,220 214,255,220 214,255,220 185,233,193 33,59,63 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 80,109,99 80,109,99 80,109,99 165,192,160 185,233,193 214,255,220 214,255,220 214,255,220 185,233,193 80,109,99 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 0,0,0 80,109,99 80,109,99 80,109,99 165,192,160 165,192,160 80,109,99 0,0,0 0,0,0 0,0,0 0,0,0