2013-08-05 18:40:48 -07:00
|
|
|
# Aseprite Source Code
|
2012-07-14 12:55:16 -07:00
|
|
|
|
2013-08-05 18:40:48 -07:00
|
|
|
If you are here is because you want to learn about Aseprite source
|
2014-07-28 20:53:24 -07:00
|
|
|
code. We'll try to write in these `README.md` files a summary of each
|
2012-07-14 12:55:16 -07:00
|
|
|
module/library.
|
2013-08-05 18:40:48 -07:00
|
|
|
|
|
|
|
# Modules & Libraries
|
|
|
|
|
|
|
|
Aseprite is separated in the following layers/modules:
|
|
|
|
|
|
|
|
## Level 0: Completely independent modules
|
|
|
|
|
|
|
|
These libraries are easy to be used and embedded in other software
|
|
|
|
because they don't depend on any other component.
|
|
|
|
|
2016-08-01 06:29:21 -07:00
|
|
|
* [clip](https://github.com/aseprite/clip): Clipboard library.
|
2015-09-24 06:02:52 -07:00
|
|
|
* [fixmath](fixmath/): Fixed point operations (original code from Allegro code by Shawn Hargreaves).
|
2016-08-01 06:29:21 -07:00
|
|
|
* [flic](https://github.com/aseprite/flic): Library to load/save FLI/FLC files.
|
2021-03-05 13:39:36 -08:00
|
|
|
* laf/[base](https://github.com/aseprite/laf/tree/main/base): Core/basic stuff, multithreading, utf8, sha1, file system, memory, etc.
|
|
|
|
* laf/[gfx](https://github.com/aseprite/laf/tree/main/gfx): Abstract graphics structures like point, size, rectangle, region, color, etc.
|
2018-08-23 13:45:42 -07:00
|
|
|
* [observable](https://github.com/aseprite/observable): Signal/slot functions.
|
2015-10-28 15:45:01 -07:00
|
|
|
* [scripting](scripting/): JavaScript engine.
|
2016-02-29 07:25:35 -08:00
|
|
|
* [steam](steam/): Steam API wrapper to avoid static linking to the .lib file.
|
2016-08-01 06:29:21 -07:00
|
|
|
* [undo](https://github.com/aseprite/undo): Generic library to manage a history of undoable commands.
|
2013-08-05 18:40:48 -07:00
|
|
|
|
|
|
|
## Level 1
|
|
|
|
|
2014-10-16 17:27:25 -07:00
|
|
|
* [cfg](cfg/) (base): Library to load/save .ini files.
|
2014-07-13 09:24:57 -07:00
|
|
|
* [gen](gen/) (base): Helper utility to generate C++ files from different XMLs.
|
2013-08-05 18:58:07 -07:00
|
|
|
* [net](net/) (base): Networking library to send HTTP requests.
|
2021-03-05 13:39:36 -08:00
|
|
|
* laf/[os](https://github.com/aseprite/laf/tree/main/os) (base, gfx, wacom): OS input/output.
|
2013-08-05 18:40:48 -07:00
|
|
|
|
|
|
|
## Level 2
|
|
|
|
|
2020-06-09 15:56:25 -07:00
|
|
|
* [doc](doc/) (base, fixmath, gfx): Document model library.
|
2018-10-18 11:29:16 -07:00
|
|
|
* [ui](ui/) (base, gfx, os): Portable UI library (buttons, windows, text fields, etc.)
|
|
|
|
* [updater](updater/) (base, cfg, net): Component to check for updates.
|
2015-09-24 06:02:52 -07:00
|
|
|
|
|
|
|
## Level 3
|
|
|
|
|
2018-10-18 11:29:16 -07:00
|
|
|
* [dio](dio/) (base, doc, fixmath, flic): Load/save sprites/documents.
|
2014-10-20 18:21:31 -07:00
|
|
|
* [filters](filters/) (base, doc, gfx): Effects for images.
|
2015-09-24 06:02:52 -07:00
|
|
|
* [render](render/) (base, doc, gfx): Library to render documents.
|
2013-08-05 18:40:48 -07:00
|
|
|
|
2015-09-24 06:02:52 -07:00
|
|
|
## Level 4
|
2013-08-05 18:40:48 -07:00
|
|
|
|
2018-08-24 07:33:21 -07:00
|
|
|
* [app](app/) (base, doc, dio, filters, fixmath, flic, gfx, pen, render, scripting, os, ui, undo, updater)
|
2018-10-18 11:29:16 -07:00
|
|
|
* [desktop](desktop/) (base, doc, dio, render): Integration with the desktop (Windows Explorer, Finder, GNOME, KDE, etc.)
|
2014-07-28 20:53:24 -07:00
|
|
|
|
2018-10-18 11:29:16 -07:00
|
|
|
## Level 5
|
2014-07-28 20:53:24 -07:00
|
|
|
|
2018-08-09 08:58:43 -07:00
|
|
|
* [main](main/) (app, base, os, ui)
|
2015-04-07 13:19:34 -07:00
|
|
|
|
|
|
|
# Debugging Tricks
|
|
|
|
|
2017-08-15 11:47:06 -07:00
|
|
|
When Aseprite is compiled with `ENABLE_DEVMODE`, you have the
|
2018-06-22 11:41:22 -07:00
|
|
|
following extra commands/features available:
|
2017-08-15 11:47:06 -07:00
|
|
|
|
|
|
|
* `F5`: On Windows shows the amount of used memory.
|
2018-06-22 11:41:22 -07:00
|
|
|
* `F1`: Switch new/old render engine.
|
|
|
|
* `Ctrl+F1`: Switch/test Screen/UI Scaling values.
|
2017-08-15 11:47:06 -07:00
|
|
|
* `Ctrl+Alt+Shift+Q`: crashes the application in case that you want to
|
|
|
|
test the anticrash feature or your need a memory dump file.
|
|
|
|
* `Ctrl+Alt+Shift+R`: recover the active document from the data
|
|
|
|
recovery store.
|
2018-06-22 11:41:22 -07:00
|
|
|
* `aseprite.ini`: `[perf] show_render_time=true` shows a performance
|
|
|
|
clock in the Editor.
|
2017-09-22 08:53:50 -07:00
|
|
|
|
2019-05-06 10:15:44 -07:00
|
|
|
In Debug mode (`_DEBUG`):
|
|
|
|
|
|
|
|
* [`TRACEARGS`](https://github.com/aseprite/laf/blob/f3222bdee2d21556e9da55343e73803c730ecd97/base/debug.h#L40):
|
|
|
|
in debug mode, it prints in the terminal/console each given argument
|
|
|
|
|
2017-09-22 08:53:50 -07:00
|
|
|
# Detect Platform
|
|
|
|
|
2021-06-16 13:21:02 -07:00
|
|
|
You can check the platform using some `laf` macros:
|
|
|
|
|
|
|
|
#if LAF_WINDOWS
|
|
|
|
// ...
|
|
|
|
#elif LAF_MACOS
|
|
|
|
// ...
|
|
|
|
#elif LAF_LINUX
|
|
|
|
// ...
|
|
|
|
#endif
|
|
|
|
|
|
|
|
Or using platform-specific macros:
|
2017-09-22 08:53:50 -07:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef _WIN64
|
|
|
|
// Windows x64
|
|
|
|
#else
|
|
|
|
// Windows x86
|
|
|
|
#endif
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
// macOS
|
|
|
|
#else
|
|
|
|
// Linux
|
|
|
|
#endif
|