Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Apr 17, 2024
1 parent 77110c6 commit 27e9e83
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
18 changes: 14 additions & 4 deletions Scenes/DataOwnership.gd
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
extends Grid

func set_cell_ownership(x, y, value):
set_cell(x*3, y*3, value)

func set_cellv_ownership(pos, value):
set_cell(pos.x*3, pos.y*3, value)
var x = pos.x * 3
var y = pos.y * 3
var start_seek_pos = (y * width + x) * bytes_per_entry
if start_seek_pos >= 0 and start_seek_pos < buffer_size:
var seek_pos = start_seek_pos
for _i in range(3):
for _j in range(3):
buffer.seek(seek_pos)
buffer.put_u8(value)
seek_pos += bytes_per_entry
seek_pos += (width - 3) * bytes_per_entry


func get_cell_ownership(x, y):
return get_cell(x*3, y*3)



func get_cellv_ownership(pos):
return get_cell(pos.x*3, pos.y*3)
1 change: 0 additions & 1 deletion Scenes/GenerateBorderWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func _on_ButtonNewMapOK_pressed():
# yield must be used here, because this function has yields inside of it.
yield(oSlabPlacement.generate_slabs_based_on_id(shapePositionArray, false), "completed")


if oCheckBoxNewMapAutoOpensMapSettings.pressed == true:
Utils.popup_centered(oMapSettingsWindow)

Expand Down
2 changes: 1 addition & 1 deletion Scenes/SlabPlacement.gd
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func _on_ConfirmAutoGen_confirmed():
shapePositionArray.append(Vector2(xSlab,ySlab))

autogen_was_called = true
generate_slabs_based_on_id(shapePositionArray, updateNearby)
yield(generate_slabs_based_on_id(shapePositionArray, updateNearby), "completed")
autogen_was_called = false

print('Auto-generated all slabs: ' + str(OS.get_ticks_msec() - CODETIME_START) + 'ms')
Expand Down
2 changes: 1 addition & 1 deletion Scenes/oAnalyzeGrids.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ onready var tilemap_data = {
"Wibble": {"extension": ".wib", "grid_type": "SUBTILE", "node": oDataWibble},
"Liquid": {"extension": ".wlb", "grid_type": "TILE", "node": oDataLiquid},
"Slab": {"extension": ".slb", "grid_type": "TILE", "node": oDataSlab},
"Ownership": {"extension": ".own", "grid_type": "TILE", "node": oDataOwnership},
"Ownership": {"extension": ".own", "grid_type": "SUBTILE", "node": oDataOwnership},
"Column Positions": {"extension": ".dat", "grid_type": "SUBTILE", "node": oDataClmPos},
"Fake Slabs": {"extension": ".une", "grid_type": "TILE", "node": oDataFakeSlab},
"Style": {"extension": ".slx", "grid_type": "TILE", "node": oDataSlx}
Expand Down

0 comments on commit 27e9e83

Please sign in to comment.