mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-16 08:15:18 +00:00
Compare commits
No commits in common. "1caa2c647e98a063a15560e3439b1449e0e1d251" and "b2f511c45be61cd26f01e134bf7a6a55109f46ad" have entirely different histories.
1caa2c647e
...
b2f511c45b
3 changed files with 36 additions and 35 deletions
|
@ -25,7 +25,6 @@ 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.
|
||||
|
|
|
@ -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-rc2"
|
||||
config/Version="v0.11.4-rc1"
|
||||
config/ExtensionsAPI_Version=3
|
||||
config/Pxo_Version=2
|
||||
|
||||
|
|
|
@ -131,16 +131,6 @@ 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:
|
||||
|
@ -152,31 +142,43 @@ func open_pxo_file(path: String, untitled_backup: bool = false, replace_empty: b
|
|||
else:
|
||||
new_project = Project.new([], path.get_file())
|
||||
|
||||
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)
|
||||
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
|
||||
|
||||
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)
|
||||
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("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("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()
|
||||
|
||||
file.close()
|
||||
if empty_project:
|
||||
|
|
Loading…
Add table
Reference in a new issue