Commit Graph

56 Commits

Author SHA1 Message Date
David Capello 8fa97cba32 Animate all tabs when a tab is added or removed
As now there is no scroll in Tabs widget, and the width of all tabs might
vary when a new one is added/removed (e.g. when there is not enough space),
we've to animated them all.

Removed ANI_SMOOTH_SCROLL_TICKS animation, now all animations are
controlled in the same way using a Tabs::Tab::oldX/oldWidth/x/width fields.
2015-02-21 20:06:35 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello 715b3fc9d8 Fix --trim and --save-as when allow non-linear history is enabled 2015-02-03 11:05:33 -03:00
David Capello 0aedc7c74e Merge branch '1.0'
Conflicts:
	src/app/commands/cmd_undo.cpp
	src/app/document_exporter.cpp
	src/app/document_exporter.h
2015-02-02 11:44:09 -03:00
David Capello 9546c0a5e3 Add --trim command line option 2015-02-02 10:42:07 -03:00
David Capello bf3c0890e9 Merge branch '1.0' 2015-01-25 23:10:51 -03:00
David Capello 72e2040c58 Add --filename-format option (fix #519) 2015-01-25 22:36:32 -03:00
David Capello 06d18f1e8a Replace doc::FrameNumber with doc::frame_t 2014-12-28 20:39:11 -03:00
David Capello da1358c5dc Unify all render code in one library
Changes:
* Create render library (move util/render.cpp to render/render.cpp)
* Move app::Zoom class to render::Zoom
* Remove doc::Image::merge() member function
* Add gfx::Clip helper class (to clip dst/src rectangles before a blit)
* Move doc::composite_image() to render::composite_image()
* Remove doc::Sprite::render()
* Replace Sprite::getPixel() with render::get_sprite_pixel()
* Remove doc::layer_render() function
* Convert DitheringMethod to a enum class
* Add AppRender to configure a render::Render with the app configuration
* Move checked background preferences as document-specific configuration
* Add doc::Sprite::layer() and palette() member functions
* Add doc::Layer::cel() member function
* Add doc::Palette::entry() member function()
* Add doc::frame_t type
* Move create_palette_from_rgb/convert_pixel_format to render library
* ExportSpriteSheet doesn't need a temporary image now that we can specify
  the source rectangle in the render routine
2014-12-28 11:06:11 -03:00
David Capello 73658399cc Add setting/preference classes/enums generator
Changes:
* Add a class (Option<T>) to get/set/listen changes to one specific
  preference option
* Add data/pref.xml with the metadata to generate types/classes (not it's
  quite easy to add new preferences)
* Modify the generator to support generation of .h and .cpp files of
  preference types
* Add code to migrate old options to new ones (and functions to delete
  old values)
* Only a couple of options were migrated at the moment, it is a WIP, in the
  future we should completely remove ISettings and direct calls
  to set/get_config_*
2014-12-14 20:19:31 -03:00
David Capello 6f528f3cf2 Merge branch '1.0' 2014-12-05 10:52:05 -03:00
David Capello 41c5605102 Fix regression: --help doesn't work on Windows
base::SystemConsole must be created before any std::cout/printf() is used
2014-12-05 02:25:49 -03:00
David Capello 5aea29348e Merge branch '1.0'
Conflicts:
	data/gui.xml
	src/app/CMakeLists.txt
	src/app/color_utils.cpp
	src/app/color_utils.h
	src/app/commands/cmd_preview.cpp
	src/app/document_exporter.cpp
	src/app/document_exporter.h
	src/app/ui/editor/standby_state.cpp
	src/config.h
	src/main/resources_win32.rc
2014-12-03 11:15:09 -03:00
David Capello b1d9d82fbf Don't initialize GuiSystem if it's not necessary 2014-11-30 21:01:54 -03:00
David Capello b7d86e596a Add --ignore-empty command line option (close #549)
This option can be used to avoid exporting empty frames/cels.
2014-11-30 10:23:11 -03:00
David Capello d9ed3c2348 Rename jmouse_[gs]et_cursor() to ui::[gs]et_mouse_cursor() 2014-11-25 21:30:56 -03:00
David Capello cc889f2b2f Minor refactor to doc::Layer flags 2014-11-16 23:03:30 -03:00
David Capello 1ed34660e4 Merge branch '1.0' 2014-11-09 20:12:57 -03:00
David Capello 91bd84f681 Now --save-as can be combined with --split-layers and --import-layer args
Close #456
2014-11-09 19:46:09 -03:00
David Capello 5e2cefe212 Merge branch '1.0'
Conflicts:
	src/app/commands/cmd_sprite_size.cpp
	src/app/document_exporter.cpp
2014-11-07 19:30:39 -03:00
David Capello c9c8c6308f Add --sheet-pack command line option to improve packing images 2014-11-07 10:39:05 -03:00
David Capello 1ce2e53cfb Add --sheet-width and --sheet-height command line options to specify the texture size 2014-11-07 01:05:08 -03:00
David Capello ce962f4999 Add more command line options to export or convert sprites
Added --save-as, --scale, --split-layers, and --import-layer command line
options.
2014-11-06 21:04:32 -03:00
David Capello 94a642cd36 Change the way ProgramOptions store specified args
Now we can parse command line arguments sequentially in the same order they
were specified.
2014-11-06 09:42:09 -03:00
David Capello 39b8e034b5 Merge branch '1.0'
Conflicts:
	.gitmodules
	CMakeLists.txt
	src/CMakeLists.txt
	src/app/app.h
	src/app/app_menus.cpp
	src/app/commands/cmd_move_mask.cpp
	src/app/commands/cmd_rotate.cpp
	src/app/modules/gui.cpp
	src/doc/resize_image_tests.cpp
	src/ui/accelerator.cpp
	third_party/CMakeLists.txt
2014-10-30 01:06:27 -03:00
David Capello f939ef5f02 Add keyboard shortcuts customization (close #253)
Changes:
* Add KeyboardShortcutsCommand and window
* Add SelectAccelerator window
* Replace modules/gui.cpp functions with app::KeyboardShortcuts and
  app::Key with the logic to load/save/handle keyboard shortcuts
* Change ui::Accelerator concept: now it represent just one keyboard
  shortcut, not a set of shortcuts
* Remove ui::Accelerator from ui::MenuItem, now the key is associated
  in app::AppMenuItem and it's a app::Key
* Add Command::onGetFriendlyName() to get a user friendly name of the
  command depending on its parameters
2014-10-29 11:58:03 -03:00
David Capello 63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello 9e8cf5de90 Show correct title bar in the main system window when the program starts 2014-09-03 00:39:15 -03:00
David Capello a9081695e5 Simplify App::isPortable() to avoid using ResourceFinder 2014-08-24 00:09:01 -03:00
David Capello 483878140a Remove allegro.h in app.cpp 2014-08-21 23:46:17 -03:00
David Capello ddaacd2f7b Fix #11 - now we support all formats to load/save palettes
Also we've removed dependency with Allegro code to load/save palette files.
2014-08-21 23:39:20 -03:00
David Capello 6559eab214 Create crash dump in aseprite folder when it's running in portable mode 2014-08-20 09:16:59 -03:00
David Capello 44c6f9400e Add a notification to report the last crash 2014-08-20 00:11:19 -03:00
David Capello f62356d410 Add compiler flags for C++11 so we can start using it 2014-08-14 00:40:01 -03:00
David Capello 1c324c9b14 Add experimental option to use native mouse cursors (and some renames of cursor names) 2014-08-10 19:51:14 -03:00
David Capello 9fd60f1119 Move Timeline logic to drag-and-drop ranges to app::DocumentRange/move_range/copy_range
This fixes issue 433.
2014-08-07 20:19:31 -03:00
David Capello 91b0c2d071 Refactor: Remove "get" part for member functions that act like a simple getter
Additional change:
- Added Cel::image() to get the related image of the cel directly
2014-07-30 01:28:15 -03:00
David Capello 03a085d1e5 Fix problem deleting app::Document that are inside a Context 2014-07-29 01:29:04 -03:00
David Capello 81ffb0c5bd Refactor: Create doc::Context and move some logic from app::Document to doc::Document
The objective of these changes is to create a more testable doc/logic API.

Included changes:
- Added doc::Context, doc::Documents (the old app::Documents),
  and doc::Sprites (and observers for each)
- Added raster::Sprite::createBasicSprite()
- Added doc::ColorMode (equal to raster::PixelFormat)
- Added some methods to doc::Document: context(), sprites(), sprite()
  (to replace app::Document::getSprite()), width/height(), colorMode(),
  name(), and close()
- Moved app::DocumentObserver/Event to doc::DocumentObserver/Event
- Replaced app::ContextObserver with doc::DocumentsObserver and a couple
  of signals.
- Renamed app::Context::getActiveDocument() with
  doc::Context::activeDocument()
- Renamed app::Context::getActiveLocation() with
  app::Context::activeLocation()
- Removed app::ContextObserverList
- Removed app::DocumentId (now we can use doc::ObjectId)
- Removed app::Context::getSettings()
2014-07-29 00:53:24 -03:00
David Capello 411ceda0e7 Add options to save GIF files (how to quantize palettes mainly)
* Added "context" parameter to save/load routines so we can test them.
2014-07-19 22:01:39 -03:00
David Capello 7d0e0f4b4a Remove references to allegro_message() from outside of she library 2014-06-18 00:53:15 -03:00
David Capello 08fb98d40d New notifications area at the top-right corner 2014-05-25 11:21:10 -03:00
David Capello a6d900fc2c Fix several old issues with indexed images and transparent color
- If we use a RGB color in a background layer (indexed image),
  and the first palette entry (transparent color) matches that RGB color,
  we can use that entry, because this is the background (the transparent
  color isn't transparent at all in the background layer).
- If we use the same RGB color in a transparent color, we've to avoid the
  transparent color, because the user want to paint with that specific
  solid color.
- Palette::findBestfit() receives a mask_index now, so we can find what
  color best matches a specific RGB avoiding that specific mask color,
  or we can use -1 to use any color (e.g. for background layers).
- Added app::ColorTarget() to simplify and fix color_utils::color_for_layer
  and app_get_color_to_clear_layer(), so now we can use the new findBestfit
  to return the transparent color for background layers (if a RGB color
  matches the transparent color RGB values).
- Removed fixup_color_for_layer/background() functions in color_utils
- Fix NewImageFromMask() to use the mask color to clear the image
- Improve the Editor pen preview (cursor.cpp) to draw the bounds of the
  pen when it will paint with the transparent color.
2014-05-08 00:30:36 -03:00
David Capello 5b62a55a0a Avoid memory leaks information of FileFormatsManager 2014-05-02 23:04:04 -03:00
David Capello b33357ed46 Remove base::string (std::string is good enough for utf8 strings) 2014-04-20 19:53:27 -03:00
David Capello bc3d3e9413 Load a better palette by default 2014-04-19 20:52:56 -03:00
David Capello 6b53e46108 Do not fail if the default palette cannot be loaded 2014-04-17 13:48:33 -03:00
David Capello 3313735936 app.cpp: Minor format change 2014-04-12 14:32:45 -03:00
David Capello 1212906d5a Move drop files event to she library 2014-03-20 07:31:19 -03:00
David Capello f531f6d0d0 Simple implementation of issue #17 - Export animation to JSON/sprite sheet files
This is a good start point. From here we can add more formats and options
(XML, custom formats, templates, etc.), rotated sprites, trim, etc.)
2013-12-08 20:19:32 -03:00