30 Commits

Author SHA1 Message Date
David Capello
55bfbf5f8b Add DocumentApi::bgColor() member functions 2014-09-12 01:54:21 -03:00
David Capello
ace67b5eee Fix DocumentApi::move/copyCel() now that we can drop cels at a frame > total sprite frames 2014-09-10 23:38:07 -03:00
David Capello
8acfa688cc Add DocumentApi::clearImage() member function 2014-09-10 00:59:14 -03:00
David Capello
64a841a1d6 Remove unused variables 2014-09-09 08:49:52 -03:00
David Capello
d8ad3ab576 Fix #452: Expand number of frames automatically when we drag and drop cels at the end of timeline 2014-09-09 01:32:20 -03:00
David Capello
da1b7097c6 Clear background layer too in "New Empty Frame" 2014-08-24 20:18:32 -03:00
David Capello
6c571adbd4 Add Alt+B shortcut to create new empty frames 2014-08-24 18:01:52 -03:00
David Capello
71d11e60a7 Complete copy-and-paste operations of frames and cels between documents 2014-08-18 00:21:03 -03:00
David Capello
a5d6af7d87 Fix issue 426: The user should not be able to change cel opacity in Indexed images 2014-08-09 18:04:53 -03:00
David Capello
7faf8a1bb7 Fix crash in ClearCommand removing empty cels 2014-08-09 11:25:40 -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
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
9dfec919e4 Fix issue merging frames that weren't rendered on any editor at least once
This bug is because the mask color of cel images were fixed when they
were used in the rendering process. Now, the mask color is fixed when the
image is added to the raster::Stock structure.
2014-06-09 22:36:42 -03:00
David Capello
7017332d62 Fix conversion of Indexed images to RGB when the layer is transparent 2014-06-03 00:05:57 -03:00
David Capello
3e70c5316d Add undo information when the sprite transparent color is modified 2014-05-02 20:00:26 -03:00
David Capello
d76f6f6716 Add DocumentApi::setCelOpacity() 2014-05-02 11:28:21 -03:00
David Capello
09027fdee4 Fix issue #258 - bug moving a cel from a transparent layer to background
The problem was in DocumentApi::moveCel(). We cannot move a Cel between
layers and frames at the same time easily (it's not possible to do it
without being in a temporal invalid state, e.g. where two cels are in the
same frame position). It's better if we create completely new cel for
the target and remove the previous one in all cases (undoers are already
prepared to do those operations correctly).

- Add Sprite::getImageRefs() member function.
2014-05-02 11:28:03 -03:00
David Capello
942dba36fd Timeline: add support to move/copy ranges (multiple cels/frames/layers)
- Merge Timeline::STATE_MOVING_LAYER/CEL/FRAME to STATE_MOVING_RANGE.
- Remove celmove.h/cpp and move_cel/copy_cel functions. Now they are
  in the Timeline as dropRange/Cels/Frames/Layers member functions.
- Add DocumentApi::copyFrame/moveCel/copyCel member functions.
- Add timeline_drop_layer_deco and timeline_drop_frame_deco skin parts.
- Move code from DuplicateLayerCommand::onExecute() to new member
  function DocumentApi::duplicateLayer().
- Fix a bug changing Cel's frame number: we weren't updating the Cel
  position properly inside the LayerImage::m_cels collection. Now we use
  LayerImage::moveCel() to change the Cel frame number.
- Other fixes to DocumentApi: Change bgcolor from int to color_t.
2014-04-09 21:56:06 -03:00
David Capello
395be62b03 Fix issue #310 - crash on export sprite sheet
The timeline wasn't being added as a Document observer, so it wasn't
getting notifications about layers modifications. In this way the timeline
wasn't able to update its m_layers[] internal field and was accessing to
removed layers/invalid memory.
2014-03-29 16:31:39 -03:00
David Capello
2462767aac Fix issue 337: Vertical flip and Horizontal flips functions affect more than selected area 2014-02-17 00:41:28 -03:00
David Capello
076be1f22f Timeline: fix problem setting the duration of a frame range 2013-12-22 16:30:04 -03:00
David Capello
85523ba63a Add ability to change the properties of several frames (a range of frames) at once 2013-12-22 12:19:03 -03:00
David Capello
d77efb602e Add DocumentApi::undoEnabled()
Now we can disable the undo information in DocumentApi() passing
a NULL undoers collection on its ctor.
2013-12-08 20:07:02 -03:00
David Capello
ddf4a13490 Add the Palette menu with Load/Save commands 2013-11-15 16:56:50 -03:00
David Capello
13946b310c Improve creation of Dirty() instance (fix issue #239)
Now Dirty() ctor receives the bounds, so we don't need to iterate over
the whole image to find/shrink the modified region.
2013-11-10 15:54:36 -03:00
David Capello
e5ba8e0922 Encapsulate Image implementation (private members, accessors, iterators, etc.)
- Rename _rgba/_graya to raster::rgba()/graya()
- Add raster::color_t type (alias for uint32_t)
- Rename raster::GfxObj to Object. And GfxObj::getType() to Object::type()
- Move conversion from raster::Image/Palette to Allegro BITMAP/RGB
  to raster/conversion_alleg.h file
- Add raster/color_scales.h
- Rename image_* functions to raster/primitives.h
- Reimplement ink processing with templates instead of macros
2013-11-09 19:59:05 -03:00
David Capello
cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello
c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00