|
@@ -805,7 +805,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
|
|
Vector2 coord((int)(mb->get_position().x / (spacing + size.x)), (int)(mb->get_position().y / (spacing + size.y)));
|
|
Vector2 coord((int)(mb->get_position().x / (spacing + size.x)), (int)(mb->get_position().y / (spacing + size.y)));
|
|
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
|
|
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
|
|
pos = mb->get_position() - pos;
|
|
pos = mb->get_position() - pos;
|
|
- uint16_t bit;
|
|
|
|
|
|
+ uint16_t bit = 0;
|
|
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
|
|
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
|
|
if (pos.x < size.x / 2) {
|
|
if (pos.x < size.x / 2) {
|
|
if (pos.y < size.y / 2) {
|
|
if (pos.y < size.y / 2) {
|
|
@@ -868,7 +868,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
|
|
Vector2 coord((int)(mm->get_position().x / (spacing + size.x)), (int)(mm->get_position().y / (spacing + size.y)));
|
|
Vector2 coord((int)(mm->get_position().x / (spacing + size.x)), (int)(mm->get_position().y / (spacing + size.y)));
|
|
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
|
|
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
|
|
pos = mm->get_position() - pos;
|
|
pos = mm->get_position() - pos;
|
|
- uint16_t bit;
|
|
|
|
|
|
+ uint16_t bit = 0;
|
|
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
|
|
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
|
|
if (pos.x < size.x / 2) {
|
|
if (pos.x < size.x / 2) {
|
|
if (pos.y < size.y / 2) {
|
|
if (pos.y < size.y / 2) {
|
|
@@ -1146,7 +1146,7 @@ void TileSetEditor::_on_tool_clicked(int p_tool) {
|
|
case EDITMODE_COLLISION: {
|
|
case EDITMODE_COLLISION: {
|
|
if (!edited_collision_shape.is_null()) {
|
|
if (!edited_collision_shape.is_null()) {
|
|
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile());
|
|
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile());
|
|
- int index;
|
|
|
|
|
|
+ int index = -1;
|
|
for (int i = 0; i < sd.size(); i++) {
|
|
for (int i = 0; i < sd.size(); i++) {
|
|
if (sd[i].shape == edited_collision_shape) {
|
|
if (sd[i].shape == edited_collision_shape) {
|
|
index = i;
|
|
index = i;
|