1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-16 00:05:18 +00:00

Compare commits

..

4 commits

Author SHA1 Message Date
Emmanouil Papadeas
1caa2c647e [skip ci] Update CHANGELOG.md 2024-02-20 15:47:57 +02:00
Emmanouil Papadeas
21cd02deaf Revert "Update to Godot 3.5.3"
This reverts commit 6492705d8a.
2024-02-20 15:46:50 +02:00
Emmanouil Papadeas
6492705d8a Update to Godot 3.5.3 2024-02-20 15:44:30 +02:00
Emmanouil Papadeas
3f6e1385e0 Fix crashes when attempting to import invalid pxo files 2024-02-20 15:42:27 +02:00
3 changed files with 35 additions and 36 deletions

View file

@ -25,6 +25,7 @@ Built using Godot 3.5.2
- Memory usage has been greatly optimized when doing operations such as drawing, image effects, selecting, transforming, etc, as the images stored in memory are now compressed. [#883](https://github.com/Orama-Interactive/Pixelorama/issues/883)
- Fixed memory leak when applying image effects. [7235617db7c21837edc7ba7b95f2e7eeb1140691](https://github.com/Orama-Interactive/Pixelorama/commit/7235617db7c21837edc7ba7b95f2e7eeb1140691)
- Fixed memory leak when previewing layouts in the Manage Layouts dialog.
- Attempting to load an invalid pxo file no longer crashes the application. [3f6e1385e06cd7801fe12fbf90a9649557ea8f2e](https://github.com/Orama-Interactive/Pixelorama/commit/3f6e1385e06cd7801fe12fbf90a9649557ea8f2e)
- Tool shortcuts can now work with <kbd>Control</kbd>. [#935](https://github.com/Orama-Interactive/Pixelorama/issues/935)
- Optimize canvas drawing by only updating it when the image(s) have changed. [ac6a4db43d9296ebc03e639d8199dd3878a25d86](https://github.com/Orama-Interactive/Pixelorama/commit/ac6a4db43d9296ebc03e639d8199dd3878a25d86)
- Fix bug where using shortcuts to switch between frames also moved the selection, causing deletions.

View file

@ -343,7 +343,7 @@ config/icon="res://assets/graphics/icons/icon.png"
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
config/custom_user_dir_name.X11="pixelorama"
config/Version="v0.11.4-rc1"
config/Version="v0.11.4-rc2"
config/ExtensionsAPI_Version=3
config/Pxo_Version=2

View file

@ -131,6 +131,16 @@ func open_pxo_file(path: String, untitled_backup: bool = false, replace_empty: b
file.close()
return
var first_line := file.get_line()
var dict := JSON.parse(first_line)
if dict.error != OK:
print("Error, corrupt pxo file")
file.close()
return
if typeof(dict.result) != TYPE_DICTIONARY:
print("Error, json parsed result is: %s" % typeof(dict.result))
file.close()
return
var empty_project: bool = Global.current_project.is_empty() and replace_empty
var new_project: Project
if empty_project:
@ -142,43 +152,31 @@ func open_pxo_file(path: String, untitled_backup: bool = false, replace_empty: b
else:
new_project = Project.new([], path.get_file())
var first_line := file.get_line()
var dict := JSON.parse(first_line)
if dict.error != OK:
print("Error, corrupt pxo file")
file.close()
return
else:
if typeof(dict.result) != TYPE_DICTIONARY:
print("Error, json parsed result is: %s" % typeof(dict.result))
file.close()
return
new_project.deserialize(dict.result)
for frame in new_project.frames:
for cel in frame.cels:
cel.load_image_data_from_pxo(file, new_project.size)
new_project.deserialize(dict.result)
for frame in new_project.frames:
for cel in frame.cels:
cel.load_image_data_from_pxo(file, new_project.size)
if dict.result.has("brushes"):
for brush in dict.result.brushes:
var b_width = brush.size_x
var b_height = brush.size_y
var buffer := file.get_buffer(b_width * b_height * 4)
var image := Image.new()
image.create_from_data(b_width, b_height, false, Image.FORMAT_RGBA8, buffer)
new_project.brushes.append(image)
Brushes.add_project_brush(image)
if dict.result.has("brushes"):
for brush in dict.result.brushes:
var b_width = brush.size_x
var b_height = brush.size_y
var buffer := file.get_buffer(b_width * b_height * 4)
var image := Image.new()
image.create_from_data(b_width, b_height, false, Image.FORMAT_RGBA8, buffer)
new_project.brushes.append(image)
Brushes.add_project_brush(image)
if dict.result.has("tile_mask") and dict.result.has("has_mask"):
if dict.result.has_mask:
var t_width = dict.result.tile_mask.size_x
var t_height = dict.result.tile_mask.size_y
var buffer := file.get_buffer(t_width * t_height * 4)
var image := Image.new()
image.create_from_data(t_width, t_height, false, Image.FORMAT_RGBA8, buffer)
new_project.tiles.tile_mask = image
else:
new_project.tiles.reset_mask()
if dict.result.has("tile_mask") and dict.result.has("has_mask"):
if dict.result.has_mask:
var t_width = dict.result.tile_mask.size_x
var t_height = dict.result.tile_mask.size_y
var buffer := file.get_buffer(t_width * t_height * 4)
var image := Image.new()
image.create_from_data(t_width, t_height, false, Image.FORMAT_RGBA8, buffer)
new_project.tiles.tile_mask = image
else:
new_project.tiles.reset_mask()
file.close()
if empty_project: