Skip to content

Commit

Permalink
fixed some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Apr 23, 2024
1 parent 6577b62 commit 4dc9a80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Class/ClmClass.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func get_highest_cube_height(cubeArray):
return 0

func get_height_from_bottom(cubeArray):
for cubeNumber in 7:
for cubeNumber in 8:
if cubeArray[cubeNumber] == 0:
return cubeNumber
return 8
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Instances.gd
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func erase_instances_loop(): # started by _ready()
erase_instances_loop()

func kill_instance(id): # Multi-thread safe
id.visible = false
id.position = Vector2(rand_range(-10000000,-20000000),rand_range(-10000000,-20000000)) # Stacking them on the same position causes lag for some reason.
for group in id.get_groups():
id.remove_from_group(group)
instances_to_erase.append(id)
Expand Down
6 changes: 4 additions & 2 deletions Scenes/OverheadGraphics.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ func overhead2d_update_rect_single_threaded(shapePositionArray):
for pos in shapePositionArray:
var basePosX = pos.x * 3
var basePosY = pos.y * 3
var slabID = oDataSlab.get_cellv(pos)
for i in range(9): # 3x3 subtiles
var x = basePosX + (i % 3)
var y = basePosY + (i / 3)
var clmIndex = oDataClmPos.get_cell_clmpos(x, y)
var cubeFace = oDataClm.get_top_cube_face(clmIndex, 0)
var cubeFace = oDataClm.get_top_cube_face(clmIndex, slabID)
var pixelIndex = ((y * width) + x) * 3

pixel_data[pixelIndex] = cubeFace >> 16 & 255
Expand Down Expand Up @@ -111,11 +112,12 @@ func generate_pixel_data(pixData, shapePositionArray):
for pos in shapePositionArray:
var basePosX = pos.x * 3
var basePosY = pos.y * 3
var slabID = oDataSlab.get_cellv(pos)
for i in range(9): # 3x3 subtiles
var x = basePosX + (i % 3)
var y = basePosY + (i / 3)
var clmIndex = oDataClmPos.get_cell_clmpos(x, y)
var cubeFace = oDataClm.get_top_cube_face(clmIndex, 0)
var cubeFace = oDataClm.get_top_cube_face(clmIndex, slabID)
var pixelIndex = ((y * width) + x) * 3

pixData[pixelIndex] = cubeFace >> 16 & 255
Expand Down

0 comments on commit 4dc9a80

Please sign in to comment.