- eye-dropper cursor to editor
- JM_SETCURSOR
- incremental-search to fileview widget
- jgrid widget
- JI_SIGNAL_SET_FONT
- sprite_getpixel
- colorselector widget
- test_jlist test
- HSV color type
- grid, exchange_colors, and eyedropper_tool commands
Fixed:
- duplication of layers
Renamed:
- jwidget_add_childs to jwidget_add_children
- status_bar to statusbar
- tool_bar to toolbar
- color_viewer to colorviewer
- color_bar to colorbar
- color_button to colorbutton
- rectfill_exclude to jrectexclude
- _graya_getk to _graya_getv
- _graya_k_shift to _graya_v_shift
Refactoring to color type:
- now it's a color_t structure instead of a string (char *)
Removed:
- mapgen.[ch]
- update_global_script_variables routine
- JM_CHAR (now it's JM_KEYPRESSED).
- README-es.txt
- FAQ.txt
This commit is contained in:
David Capello 2008-02-29 19:29:49 +00:00
parent 1f98194363
commit 275181990f
208 changed files with 5119 additions and 3807 deletions

View File

@ -9,8 +9,8 @@ AUTHOR
THANKFULNESS
===================================
Some people don't contribute to this project in a directly way but
their work are indispensable:
Some people didn't contribute to the project in a direct way,
but their work was indispensable to make it real:
------------------------------------------------------------------
Álvaro González: For the other routine to generate optimised
@ -56,7 +56,8 @@ THANKFULNESS
Jerry Coffin and HenkJan Wolthuis: For the hash table routines.
Johan Halmén and Anders "Trezker" Andersson for mapgen.
Johan Halmén and Anders "Trezker" Andersson for mapgen (included in
old ASE versions).
<http://edu.loviisa.fi/~lg/jh/mapgen/>
<http://www.angelfire.com/art/dumlesoft/Projects.html>
@ -98,8 +99,8 @@ THANKFULNESS
<http://www.lanet.lv/~pavenis/rhide.html>
Salvador Eduardo Tropea: For the SETEdit editor (although I don't
use it anymore, but the first months in Linux without it would be
impossible :-)
use it anymore, the first months in Linux without it would have been
impossibles)
<http://setedit.sourceforge.net/>
Shawn Hargreaves: And hundreds of people who helped in the Allegro

View File

@ -1,3 +1,62 @@
2008-02-29 David A. Capello <dacap@users.sourceforge.net>
* src/widgets/fileview.c: Added incremental search.
* src/core/file_system.c (fileitem_insert_child_sorted):
Fixed. Now the file-system has a readed-version, so we can updated
outdated file-items with the new children list.
2008-02-28 David A. Capello <dacap@users.sourceforge.net>
* src/jinete/jbox.c, src/jinete/jpanel.c: Fixed some bugs when
access to widget-visibility properties (when layout widgets, we
have to check the JI_HIDDEN flag directly instead of calling
jwidget_is_visible/hidden routines).
2008-02-27 David A. Capello <dacap@users.sourceforge.net>
* src/commands/cmd_duplicate_layer.c (duplicate_layer): Fixed a
problem where the images weren't duplicated (this bug was
introduced when the stock changed from the Layers to the Sprite).
2008-02-22 David A. Capello <dacap@users.sourceforge.net>
* src/jinete/jwidget.c (jwidget_get_drawable_region): Fixed a bug:
when clipping the drawable-region with the children regions, it
was considering hidden children too.
2008-02-21 David A. Capello <dacap@users.sourceforge.net>
* src/*: Refactoring color_bar->colorbar, status_bar->statusbar,
tool_bar->toolbar, menu_bar->menubar, tabs_bar->tabsbar.
* src/modules/tools.c (apply_grid): Added 'flexible' parameter.
* src/commands/cmd_grid.c: Added show_grid and snap_to_grid
commands.
* src/jinete/jwidget.c (jwidget_set_text_soft): Added.
2008-02-20 David A. Capello <dacap@users.sourceforge.net>
* data/jids/mapgen.jid, src/commands/cmd_mapgen.c,
src/util/mapgen.c, src/dialogs/dmapgen.c: Removed.
* src/jinete/jwidget.c (widget_msg_proc): Do more work to handle
redirection of each message.
* src/jinete/jmanager.c: Simplified the destination list for every
message.
* src/jinete/jmessage.h (struct jmessage_key): Added fields:
repeat, propagate_to_children, propagate_to_parent.
* src/jinete/jbase.h: Added JM_SETCURSOR. Removed JM_CHAR.
2008-02-18 David A. Capello <dacap@users.sourceforge.net>
* src/core/file_system.c (get_key_for_pidl): Fixed.
2008-02-12 David A. Capello <dacap@users.sourceforge.net>
* src/raster/dirty.c: Optimized.

57
FAQ.txt
View File

@ -1,57 +0,0 @@
========================================
Frequently Asked Questions
========================================
1. ¿How I can add new convolutions matrices?
2. ¿How I can change the screen layout?
3. ¿How I can load my palette in ASE that are in a 768 bytes file?
4. ¿How I can add a new frame?
1. ¿How I can add new convolutions matrices?
----------------------------------------------------------------------
Add a "convmatr.usr" file in the configuration directory
("ase/data" for Windows or "~/.ase" for Unix) with the same format
of "convmatr.def" (you'll find it in the data directory too). When
ASE start it loads all "convmatr.usr", "convmatr.gen", and
"convmatr.def" files ("user", "generated", and "default" matrices
respectively).
2. ¿How I can change the screen layout?
----------------------------------------------------------------------
If you want to try other screen layout (other organization for the
controls (widgets) in the main window), you can modify the
"data/jids/main.jid" file. I recommend you make a backup copy so
you can back to the original layout. Also, there are some
alternative layouts already, to try them, you should modify:
<window noborders desktop text="Main Window" name="main_window">
By:
<window noborders desktop text="Main Window" name="main_window_old">
And then (for example) modify some name="main_window_alt1" to
name="main_window".
3. ¿How I can load my palette in ASE that are in a 768 bytes file?
----------------------------------------------------------------------
If you palette is in a raw binary file of 768 bytes, the entries
are in order RGB and the range of each entry is 0-63, you can
rename it with the .col extension, and load like an original .col
Animator file.
4. ¿How I can add a new frame?
----------------------------------------------------------------------
Press <Ctrl+Shift+N> (or "Frame/New" menu).
----------------------------------------------------------------------
Copyright (C) 2003-2005 by David A. Capello

View File

@ -3,8 +3,8 @@ LEGAL ISSUES
===================================
- ASE is distributed under GPL license.
- Allegro is giftware license (similar to MIT license).
- Jinete is under BSD license.
- Allegro is giftware license (similar to MIT license).
- ALFONT is under LGPL terms.
- quantize.c is copyright by Ben Davis (you need his authorization to
use his code in your own program).

View File

@ -1,255 +0,0 @@
===================================
NOTICIAS
===================================
0.5
---
- Se agregaron funcionalidades solicitadas por Carl Olsson:
+ mejor soporte cuando "Ajustar a Grilla" está activado para
las herramientas de dibujo que se controlan con cajas (como
rectángulo, elipse, etc).
+ al manejar una selección flotante (al pegar el portapapeles)
la opción "Ajustar a Grilla" tiene efecto sobre el movimiento
de la imagen.
+ agregado movimiento a nivel de subpixel para los cursores con
demasiado zoom en el editor, para saber dónde estamos dentro
del pixel.
- Soporte para grabar archivos GIF por defecto.
- Arreglada la compilación con Allegro 4.2.1 (y arreglado un bug en
Allegro con key_shifts).
- Ahora el estado ventana/pantalla-completa es guardado por
la aplicación (gracias a Manuel De Miguel Moreno por reportarlo).
0.4
---
- Modo consola ya no existe.
- Cambiado el atajo de teclado para el Editor de Película: tecla TAB.
- Nueva característica: Cada cuadro de animación tiene duración.
- Nuevo Editor de Paleta (tecla F4).
- Ahora los sprites soportan multiples paletas: Cada cuadro puede
tener su propia palette de colores.
- Agregado soporte para cargar archivos GIF (por Elias Pschernig).
- Agregado una combo-box al cuadro de selección de archivos para
manejar bookmarks ("Favoritos").
- Hay rotación!!! Ahora puede rotar y escalar al pegar desde el
clipboard (portapapeles).
0.3.1
-----
- Arreglada la creación de archivos de sesión cuando una excepción
(error fatal) ocurre bajo Windows.
- Agregados los ficheros es.po y tips.es.
0.3
---
- Agregado la administración de sesiones (si ocurre algún fallo la
sesión es guardada automáticamente).
- Se agregó una herramienta para dibujar texto (finalmente).
- Más documentación y tips.
- Mejorado el proceso para agregar cuadros de animación.a
- Se arreglaron algunos bugs importantes.
- Se agregó la utilidad mapgen (código original por Johan Halmén y
Anders Andersson).
- Soporte para el lenguage Español (ahora funciona en Windows también).
- Código interno mejorado (principalmente las partes de la GUI, y los
nombres de las funciones).
0.2.4
-----
- Undo más estable: con límites y sin el extraño comportamiento del
rehacer-después-de-sobreescribir-el-deshacer.
- Nueveo filtro por mediana para reducir el ruido de las imágenes.
- Actualizado el soporte alternativo para leer y escribir archivos
JPEG mediante la librería JPGalleg 2.3, gracias a Angelo Mottola por esto.
- Se arreglaron algunos problemas con el teclado: la tecla Alt ya no puede
ser utilizada para atajos del teclado. Alguna combinaciones cambiaron:
+ <~> a <`> (abre el editor de película)
+ <Ctrl+/> a <?> (enmascara por color)
+ <Ctrl+~> a <Ctrl+4> (cierra el editor actualx)
- Agregado Cortar, Copiar, Pegar!
- Agregado AutoCrop (antes conocido como Trim).
0.2.3
-----
- Se arregló la rutina para grabar archivos JPG.
- Arregladas y mejoradas varias partes de la GUI.
0.2.2
-----
- Se agregó algo de documentación para escribir scripts en Lua.
- El Editor de Película (The Film Editor) fue mejorado.
- Arreglados algunos errores con el cursor gráfico, algunons problemas
con el teclado y varios bugs menores.
- Nuevos tips con texto e imágenes. Esto será muy útil para los
principiantes.
- La función del papel cebolla (onionskin) está lista.
- Agregado (de modo opcional) el fusionado de colores ordenado para
dibujar imágenes RGB en 8 bpp.
- Nuevas acciones: Merge Down, New Frame, Copy Frame, cambiar Image
Type!, Load Script File.
- Optimizado la velocidad de dibujado en modo alicatado (tiled).
0.2.1
-----
- Arreglada la versión de Windows: el spray y algunos errores
guardando nombres de ficheros en el archivo de configuración.
- Agregado soporte libintl y la traducción al Español del programa
(sólo para Linux, pero tengo planes de hacer esto andar en Windows).
- Más soporte undo: insertar/remover capas y modificaciones en la
máscara.
- Los filtros Matriz de Convolución y Curva de Color están de vuelta.
- Se agregaron más operaciones básicas (con soporte de undo): aplanar
capas, duplicar capa, duplicar sprite, flip horizontal/vertical,
recortar cuadro.
- Nuevo formato .ASE (en estado alpha, por favor pruébelo!).
- Rutinas para script más simples: ahora hay una capa de rutinas de
alto nivel (fáciles de usar y comprender), y un juego de rutinas de
bajo nivel (para scripts internos o trabajos más específicos).
- Se removió todo el código relacionado con interpolación entre
key-frames (cuadros claves): sí, luego de estar pensando un largo
rato, esto hace muy complicada la edición de la animación (así la
"elegante interpolación spline" fue eliminada).
- El editor de sprites fue optimizado para ser más rápido al mover el
scroll.
- El Editor de Película (The Film Editor) está casi listo para
controlar capas y cuadros.
- Arreglados los filtros usando máscaras con capas desplazadas.
- Soporte para aplicar filtros a varias cuadros/capas al mismo tiempo.
- Diferentes disposiciones de la pantalla fueron agregadas en main.jid
(mire FAQ.txt para saber como cambiar entre ellas).
- La barra de herramientas está devuelta!
0.2
---
- Arreglados varios bugs.
- Soporte opcional para archivos JPEG con la librería JPGalleg 2.0.
- Agregados modos de dibujado: Opaque (opaco/normal), Glass
(vidrio/transparente), Semi (patrón).
- Agregados los tipos de brochas: Circle (círculo), Square (cuadrado),
Line (línea).
- Implementado un sistema de "paleta-falsa" para hacer al GUI
utilizable con cualquier paleta de colores (principalmente para
evitar las situaciones de "pantalla negra" al abrir sprites con
paletas "feas").
- El editor de la paleta de colores tiene mejoras (como la posibilidad
de mover los colores seleccionados).
- El archivo "menus" cambió un poco. Algunos atajos del teclado se
modificaron (y otro nuevos se agregaron), puede verlos en el archivo
"docs/QuickHelp.html". De todos modos, intenté dejar la
compatibilidad con los comandos más usados.
- Soporte completo de scripts con Lua-5.0. Los sprites y el GUI son
controlables desde los mismos scripts, para darle una idea, varias
acciones en los menús están programadas directamente con scripts.
- Control de selección completo (regiones de máscara). Puede
seleccionar areas irregulares (agregar, substraer, cruzar, y
seleccionar por color), guardar y cargarlas en el viejo formato .MSK
del Animator Pro.
- Soporte para editores multiples. Ahora puede editar una imágen con
zoom y ver los resultados en otros editores (actualizados en tiempo
real). - Nuevo núcleo de para controlar gráficos. Todo lo
relacionado a sprite/imágenes/capas/propiedades/key fue
reprogramado. El cambio más importante, se hizo al nivel de
propiedad/keyframes (cada propiedad puede tener interpolación lineal
o con curvas beziers, además de una bandera de finalización de la
curva para hacer movimientos circulares o patrones de movimientos).
- Nuevo GUI. Tanto los gráficos como el código interno fueron
reestructurados completamente, hice una nueva librería de GUI:
Jinete.
0.1.2
-----
- Nuevo efecto RLE Gaussian Blur (desde el código de The GIMP).
- Los modos de mezcla (blender modes) están devuelta: Normal,
Multiply, Screen, Overlay, Hard Light, Darken, Lighten, Addition,
Subtract, Difference, Hue, Saturation, Color, Luminosity.
- Mejor GUI: con colores, ahora debería de ser menos aburrido :-)
- Agregado un diálogo para seleccionar *cualquier* modo de video
gráfico (esto podría ser útil para modos de video con ventanas).
- Nuevamente se volvió a los makefiles al estilo Allegro. Bueno,
bueno, el estilo GNU fue el peor cambio en ASE, pero ahora está
arreglado :-)
- Eliminada la capacidad de cargar archivos .DLL o .so de
plug-ins. Luego de semanas pensándolo, decidí por sacar esta
característica ya que es muy complicado de hacer un buen sistema
para agregar nuevos plug-ins con la implementación del menú
actual. La mayoría de usuarios son solo "usuarios" y no copiarán el
plug-in y modificarán luego el archivo "menus" para agregar el
script que llame a la acción del plug-in. Además, esto me salva de
miles de dolores de cabezas :-)
- Agregada la aplicación de filtros multiples: Ahora, se puede aplicar
los efectos a cada capa, a cada cuadro de animación, o ambos.
- Agregado la lista de archivos usados recientemente ("Recent Files").
- Nuevas rutinas en los scripts para manejar "paths" (rutas).
- Nuevo tipo de selección: "shrink", para encoger la selección a los
límites de la capa bitmap actual.
- Nueva acción "trim_sprite".
0.1.0
-----
- Eliminada la herramienta `move' para mover capas (era redundante).
- Nueva interface para cargar Plug-Ins en forma dinámica (DLL, .so).
- Nuevo soporte completo para cargar/guardar archivos JPEG (RGB/grayscale):
a través de la Independent JPEG Group's JPEG Library.
- Nuevas acciones:
+ trim_layer_bitmap: recorta la capa actual por los límites de la selección.
+ merge_down: para mezclar la capa activa con la próxima.
+ make_undo_animation: para crear una animación desde la operaciones
para deshacer (para ver la progresión del gráfico).
+ undo_history: para deshacer/rehacer varias operaciones a la vez.
+ color_curve: para hacer efectos de conversión de color pixel por pixel.
- Mejorado el comando `Reemplazar Color' (con `tolerancia' y `vista previa').
- Una nueva barra-de-capas optimizada, para manejar sobre todo
las propiedades y los cuadros claves.
- Varias cosas reescritas a Plug-Ins:
+ los formatos de archivos,
+ las acciones de los menús (también, ahora estas acciones pueden ser
utilizadas desde los "guiones" o "scripts").
- Reemplazado el viejo sistema de "profundidad de color" por el nuevo
"tipo de imagen". Desde ahora, una imagen puede ser:
RGB (rojo, verde, azul), Grayscale (escala de grises), o Indexed
(256 colores).
- Nueva Libreria ASE, con un nuevo diseño para manejar:
imágenes, capas, bitmaps, propiedades, cuadros claves, etc.
- Código fuente al estilo GNU: con configure.in, Makefile.am, etc.
0.0.7
-----
- Nuevas rutinas para "guionado" (script): request(), apply_filter(),
load_sprite(), y save_sprite().
- Soporte para cargar archivos FLI/FLC y guardar FLC. Sí! Ahora con ASE
puede hacer animaciones FLC con un buen rendimiento de compresión.
- Agregada la posibilidad de cargar/guardar secuencias de bitmaps:
como por ejemplo ani00.pcx, ani01.pcx, ani02.pcx, etc.
- Más funcionalidad para `deshacer'. Reescribí todo el sistem de `undo'
por completo.
- Nueva herramienta de selección rectangular. Ahora puede cortar, copiar,
pegar, y borrar.
- Nueva compresión RLE para 8 bpp en los archivos .ase.
- Soporte para cargar ficheros .ase de las versiones `0.0.6' y
`0.0.7 CVS (fases importante)': Le recomiendo que actualice todos sus
archivos .ase a la nueva versión `0.0.7' release.
- Nuevas propiedades para los cuadros claves (keyframes): ahora cada keyframe
tiene su propia posición y valor alpha, con esto puede hacer animaciones de
objetos moviendo sólo los keyframes (todos los cuadros intermedios serán
calculados automáticamente).
- Ahora el programa recuerda la configuración (a través de `ase.cfg').
- Agregado un nuevo modo para dibujar "mosaicado" (tiled).
- Nuevo modo de edición en pantalla completa. Con la barra de capas
(layer-bar) a la que se le puede cambiar el tamaño.
- Agregada la opción para dibujar un cuadro previo en modo transparente.
- Eliminada la propiedad de `fondo' de las capas: desde ahora, una capa
será transparente siempre. Con esto son arreglados una tonelada de problemas
con las rutinas para cargar/guardar archivos de las versiones anteriores.
- Nuevo comando `reload_menus' (para recargar los menús).

View File

@ -6,21 +6,25 @@ NEWS
---
+ Added support to load and save PNG files (through 'libpng').
+ Rewritten the color-selector dialog.
+ Replaced the "List" menu with the tabs selector.
+ Better file selector with thumbnails.
+ In Windows: now you can navigate through Desktop, My Documents,
My Computer, etc.
+ Rewritten the File Selector:
+ Preview support.
+ Incremental search.
+ History of navigation (Back/Forward).
+ In Windows: you can visit Desktop, My Documents and My Computer
locations.
+ Optimized the loading/saving operations (using threads).
+ Restructured all the menus (more user friendly options).
+ New XML format for the menus.
+ Enhanced GUI:
+ more borders for windows and more spacing between widgets.
+ better mouse behavior (now in Windows the mouse is captured).
+ Finally screen scaling supported (with double-buffering). This means
that you can use a screen of 320x240 between a window of 640x480
(screen-scaling x2). This is the new default video mode for ASE.
(screen-scaling x2).
+ Fixed other minor problems when you drawn in 'tiled mode' or 'paste'
the clipboard.
+ New XML format for the menus and keyboard shortcuts.
- Removed a lot of complex functionality:
- Removed mask-repositories (you can use .msk files instead).
- Removed menu scripting customization.
@ -29,6 +33,7 @@ NEWS
- Removed draw-text (it'll return in next versions).
- Removed layer-sets (the Film-Editor can't handle them right at the
moment)
- Removed mapgen.
- Removed linked-cels (were complex for the end-user).
- Also the scripting support is broken, next versions of ASE will
contain a better set of routines to create scripts.

View File

@ -1,167 +0,0 @@
ASE - Allegro Sprite Editor
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 por David A. Capello
---------------------------------------------------------------------
Mire el fichero "AUTHORS.txt" para la lista completa de colaboradores
===================================
COPYRIGHT
===================================
Este programa es software libre. Puede redistribuirlo y/o modificarlo bajo
los términos de la Licencia Pública General GNU según es publicada por la
Free Software Foundation, bien de la versión 2 de dicha Licencia o bien
(según su elección) de cualquier versión posterior.
Este programa es distribuido con la esperanza de que sea útil, pero SIN
GARANTIA ALGUNA, incluso sin la garantía implícita de COMERCIALIZACIÓN o
IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Véase la Licencia Pública General
de GNU para más detalles.
Debería haber recibido una copia de la Licencia Pública General junto con
este programa. Si no ha sido así, escriba a la Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
===================================
INTRODUCCIÓN
===================================
ASE es un programa especialmente diseñado para crear sprites
animados con mucha facilidad y que luego puedan ser utilizados en un
video juego. Este programa le permitirá crear desde imágenes
estáticas, a personajes con movimiento, texturas, patrones, fondos,
logos, paletas de colores, y cualquier otra cosa que se le ocurra.
===================================
CARACTERÍSTICAS
===================================
ASE le ofrece la posibilidad de:
- Editar sprites con capas y cuadros de animación.
- Editar imágenes RGB (con Alpha), escala de grises (también con
Alpha), e imágenes con paleta de 256 colores o "indexadas".
- Controlar paletas de 256 colores completamente.
- Aplicar filtros para diferentes efectos (matriz de convolución,
curva de color, etc.).
- Cargar y guardar sprites en los formatos .BMP, .PCX, .TGA, .JPG,
.GIF, .FLC, .FLI, .ASE (el formato especial de ASE).
- Utilizar secuencia de bitmaps (ani00.pcx, ani01.pcx, etc.) para
guardar las animaciones.
- Herramientas de dibujo (puntos, pincel, brocha real, relleno, línea,
rectángulo, elipse), modos de dibujo (opaco, vidrio), y tipos de
brochas (círculo, cuadrado, línea).
- Soporte de máscaras (selecciones).
- Soporte para deshacer/rehacer cada operación.
- Soporte para editores multiples.
- Dibujar con una rejilla personalizable.
- Único modo de dibujo alicatado para dibujar patrones y texturas en
segundos.
- Guardar y cargar sesiones completas de trabajo (en ficheros `.ses').
- Capacidad de hacer `scripts' (guiones) con el lenguaje Lua
(http://www.lua.org).
===================================
CONFIGURACIÓN
===================================
En plataformas Windows y DOS:
ase.cfg - Configuración
data/matrices - Matrices de convolución
data/menus - Menús
data/scripts/* - Scripts o "guiones"
En plataformas Unix, el archivo de configuratión es ~/.aserc, y los
archivos de datos (en data/) son buscados en estos lugares (por
orden de preferencia):
$HOME/.ase/
/usr/local/share/ase/
data/
Mire "src/core/dirs.c" para más información.
===================================
MODO VERBOSO
===================================
Cuando ejecuta "ase" con el parámetro "-v", en las plataformas
Windows y DOS los errores son escritos en STDERR y un archivo
"logXXXX.txt" en el directorio "ase/" es creado con el mismo
contenido.
En otras plataformas (como Unix), ese archivo de registro no es
creado, ya que la utilización de STDERR es mucho más común.
Mire "src/core/core.c" para más información.
===================================
ACTUALIZACIONES
===================================
Los últimos paquetes tanto binarios como el de código fuente, los
puede encontrar desde:
http://sourceforge.net/project/showfiles.php?group_id=20848
También, si desea obtener la última versión en desarrollo de ASE desde el
repositorio SVN, la cual por sierto es la más propensa a tener errores pero
es la que más actualizada está con respecto a las herramientas, la puede
explorar archivo por archivo en esta dirección:
http://ase.svn.sourceforge.net/viewvc/ase/
O la puede bajar completamente a su disco con un programa que controle SVN,
de la siguiente forma:
svn checkout svn co https://ase.svn.sourceforge.net/svnroot/ase/trunk ase
AVISO: Cuando obtenga la versión SVN, no borre los directorios .svn
ni el contenido dentro de ellos, ya que es para uso interno del
programa svn.
===================================
CRÉDITOS
===================================
Mire el archivo "AUTHORS.txt".
===================================
INFORMACIÓN DE CONTACTO
===================================
Para pedir ayuda, reportar bugs, mandar parches, etc., utilice la
lista de correo ase-help:
ase-help@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/ase-help/
Para más información visite la página oficial del proyecto:
http://ase.sourceforge.net
----------------------------------------------------------------------------
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 por David A. Capello

View File

@ -1,12 +1,25 @@
ASE - Allegro Sprite Editor
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 by David A. Capello
Copyright (C) 2001-2008 by David A. Capello
--------------------------------------------------------------------
See the "AUTHORS.txt" file for a complete list of contributors
===================================
INTRODUCTION
===================================
ASE is a program specially designed with facilities to create
animated sprites that can be used in computer games. You can
create static images, characters with movement, textures,
patterns, backgrounds, logos, color palettes, tiles, etc.
What makes ASE different? It focuses on pixel editing, to do
pixel-art. Indeed, it isn't a photo retouching tool or a vector
graphics editor. Mainly it is a tool to create tiny animations
pixel-by-pixel.
===================================
COPYRIGHT
LICENSE
===================================
This program is free software; you can redistribute it and/or modify it
@ -23,138 +36,63 @@ COPYRIGHT
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
===================================
INTRODUCTION
===================================
ASE is a program specially designed with facilities to create
animated sprites that can be used in some video game. This program
let you create from static images, to characters with movement,
textures, patterns, backgrounds, logos, color palettes, and any
other thing that you think.
===================================
FEATURES
===================================
ASE gives to you the possibility to:
- Edit sprites with layers and animation frames.
- Edit RGB (with Alpha), Grayscale (with Alpha also) and Indexed
images.
- Control 256 color palettes completely.
- Apply filters for different color effects (convolution matrix,
color curve, etc.).
- Load and save sprites in these formats: .BMP, .PCX, .TGA, .JPG,
.GIF, .FLC, .FLI, and .ASE (ASE's special format).
- Use bitmap's sequences (ani00.pcx, ani01.pcx, etc.) to save
animations.
- Drawing tools (dots, pencil, real-brush, floodfill, line, rectangle,
ellipse), drawing modes (opaque, glass), and brushes types (circle,
square, line).
- Mask (selections) support.
- Undo/Redo support for every operation.
- Multiple editor support.
- Draw with a customizable grid.
- Unique tiled drawing mode to draw patterns and textures in seconds.
- Scripting capabilities with Lua language (http://www.lua.org).
With ASE you'll be able to:
* Edit sprites with layers and frames.
* Edit RGB (with Alpha), Grayscale and Indexed images (256 color palettes).
* Load/save sprites in these formats: .GIF, .FLC, .FLI, .PNG,
.BMP, .PCX, .TGA, .JPG, and .ASE (ASE's special format).
* Load/save animations in sequence of bitmaps (frm00.pcx, frm01.pcx, ...).
* Tiled drawing mode to draw patterns and textures.
* Undo/Redo support for every operation.
* Multiple editor support.
* Show-grid/Snap-to-Grid
===================================
CONFIGURATION FILES
===================================
In Windows and DOS platforms:
In Windows 98/2K/XP/Vista:
ase.cfg - Configuration
data/matrices - Convolutions matrices
data/menus - Menus
data/scripts/* - Scripts
ase-VERSION.cfg - Program configuration
data/convmatr.def - Convolutions matrices
data/gui-en.xml - Menu definition and keyboard shortcuts
examples/* - Examples of some sprites made with ASE
In Unix platforms, the configuration file is ~/.aserc, and the data/
files are searched in these locations (in order of preference):
In GNU/Linux, the configuration file is ~/.aserc-VERSION, and
the data/ files are searched in these locations (in priority
order):
$HOME/.ase/
/usr/local/share/ase/
data/
See "src/core/dirs.c" for more information.
===================================
VERBOSE MODE
===================================
When run "ase" with "-v" parameter, in Windows and DOS platforms the
errors will be written in STDERR and a "logXXXX.txt" file in "ase/"
directory is created with the same content.
In others platforms (like Unix), that log file isn't created,
because the use of STDERR is more common.
See "src/core/core.c" for more information.
===================================
UPDATES
===================================
The last packages of binaries and source code, you can found them
from:
http://sourceforge.net/project/showfiles.php?group_id=20848
Also, if you want to get the last development version of ASE from
the SVN repository, which is the version more prone to have errors,
but is the more updated in the tools area, you can browse it file by
file in this address:
http://ase.svn.sourceforge.net/viewvc/ase/
Or you can download it completelly to your disk with a program which
control SVN, as follow-up:
svn checkout svn co https://ase.svn.sourceforge.net/svnroot/ase/trunk ase
WARNING: When you obtain the SVN version, don't remove the .svn
directories, they are for exclusive use of the svn program.
===================================
CREDITS
===================================
See the "AUTHORS.txt" file.
===================================
CONTACT INFO
===================================
To request help, report bugs, send patches, etc., you can use the
ase-help mailing list:
To request help you can use the Allegro Sprite Editor group or
the SourceForge forums:
http://groups.google.com/group/aseprite
http://sourceforge.net/forum/?group_id=20848
ase-help@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/ase-help/
We recommend you to use the SourceForge tracker to do specific
reporting of some issues like:
* Bugs:
http://sourceforge.net/tracker/?group_id=20848&atid=120848&func=add
* Request features:
http://sourceforge.net/tracker/?group_id=20848&atid=370848&func=add
* Patches:
http://sourceforge.net/tracker/?group_id=20848&atid=320848&func=add
* Support request:
http://sourceforge.net/tracker/?group_id=20848&atid=220848&func=add
For more information, visit the official page of the project:
http://ase.sourceforge.net
http://www.aseprite.org/
http://www.aseprite.org/wiki/
----------------------------------------------------------------------------
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 by David A. Capello
Copyright (C) 2001-2008 by David A. Capello

View File

@ -1,15 +1,22 @@
High priority work
------------------
- tooltips for color-bar.
- add two DrawClick2:
- DrawClick2FreeHand
- DrawClick2Shape
- the user_data of hook_signal should be void*.
- search for TODO;
- rename jcombox.c to jcombobox.c
- remove the jfilesel.c
- fix the sprite-properties dialog when select the constant
frame length.
- fix copyright years (2001-2008)
- fix a bug in the film editor when move the separator (panel) outside
the screen (to left or right)
+ rewrite the film editor.
- 'jfile.c' should use 'jxml.c', because there are duplicate code:
two (precarious) XML parsers.
- the user_data of hook_signal should be void*.
- ver por el nuevo load_font de Allegro.
- complete palette operations, and palette editor (it needs a slider
or something to move between palette changes);
@ -52,11 +59,10 @@ Wish-list
---------
- dacap wish-list:
+ keyboard shortcuts for snap-to-grid and view-grid
+ different snap-to-grid for paste operation
+ better dialogs: widder buttons, more borders.
+ better film editor
+ rewrite it in one widget.
+ "middle mouse button" for the film editor.
+ added starred file-items in the file-selector.
- manuq wish-list:
+ layer-with-constant-cel
- Mateusz Czaplinski ideas:

View File

@ -7,17 +7,6 @@
See README.txt and COPYING files for more information.
Remember to report "bugs" and errors to:
ase-help@lists.sourceforge.net
======================================================================
ADVERTENCIA SOBRE ALLEGRO-SPRITE-EDITOR
======================================================================
ESTE PROGRAMA ES DISTRIBUIDO SIN GARANTIA ALGUNA !!!
Mire los ficheros README-es.txt y COPYING para mayor
información. Recuerde reportar errores y "bugs" a:
ase-help@lists.sourceforge.net
aseprite@googlegroups.com
======================================================================

View File

@ -25,7 +25,7 @@
/* general information */
#define PACKAGE "ase"
#define VERSION "0.6 BETA 2"
#define VERSION "0.6-beta2"
#define WEBSITE "http://www.aseprite.org/"
#define BUGREPORT "aseprite@googlegroups.com"
#define COPYRIGHT "Copyright (C) 2001-2008 David A. Capello"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,11 +5,8 @@
<!-- file -->
<key command="new_file" shortcut="Ctrl+N" />
<key command="open_file" shortcut="Ctrl+O" />
<key command="open_file" shortcut="F3" />
<key command="save_file" shortcut="Ctrl+S" />
<key command="save_file" shortcut="F2" />
<key command="save_file_as" shortcut="Shift+Ctrl+S" />
<key command="save_file_as" shortcut="Shift+F2" />
<key command="close_file" shortcut="Ctrl+W" />
<key command="close_all_files" shortcut="Shift+Ctrl+W" />
<key command="screen_shot" shortcut="F12" />
@ -26,16 +23,6 @@
<key command="flip_vertical" shortcut="Shift+V" />
<key command="replace_color" shortcut="Shift+R" />
<key command="invert_color" shortcut="Ctrl+I" />
<!-- view -->
<key command="refresh" shortcut="F5" />
<key command="advanced_mode" shortcut="A" />
<key command="make_unique_editor" shortcut="Ctrl+1" />
<key command="split_editor_vertically" shortcut="Ctrl+2" />
<key command="split_editor_horizontally" shortcut="Ctrl+3" />
<key command="close_editor" shortcut="Ctrl+4" />
<key command="preview_fit_to_screen" shortcut="F6" />
<key command="preview_normal" shortcut="F7" />
<key command="preview_tiled" shortcut="F8" />
<!-- sprite -->
<key command="sprite_properties" shortcut="Ctrl+P" />
<!-- layer -->
@ -56,6 +43,18 @@
<key command="deselect_mask" shortcut="Ctrl+D" />
<key command="reselect_mask" shortcut="Shift+Ctrl+D" />
<key command="invert_mask" shortcut="Shift+Ctrl+I" />
<!-- view -->
<key command="refresh" shortcut="F5" />
<key command="advanced_mode" shortcut="A" />
<key command="make_unique_editor" shortcut="Ctrl+1" />
<key command="split_editor_vertically" shortcut="Ctrl+2" />
<key command="split_editor_horizontally" shortcut="Ctrl+3" />
<key command="close_editor" shortcut="Ctrl+4" />
<key command="preview_fit_to_screen" shortcut="F6" />
<key command="preview_normal" shortcut="F7" />
<key command="preview_tiled" shortcut="F8" />
<key command="show_grid" shortcut="G" />
<key command="snap_to_grid" shortcut="H" />
<!-- tools -->
<key command="configure_tools" shortcut="C" />
<key command="marker_tool" shortcut="M" />
@ -63,13 +62,14 @@
<key command="pencil_tool" shortcut="P" />
<key command="brush_tool" shortcut="B" />
<key command="spray_tool" shortcut="S" />
<key command="floodfill_tool" shortcut="F" />
<key command="floodfill_tool" shortcut="F" />
<key command="line_tool" shortcut="L" />
<key command="bezier_tool" shortcut="V" />
<!-- <key command="bezier_tool" shortcut="V" /> -->
<key command="rectangle_tool" shortcut="R" />
<key command="ellipse_tool" shortcut="E" />
<key command="eyedropper_tool" shortcut="I" />
<key command="exchange_colors" shortcut="X" />
<key command="film_editor" shortcut="Tab" />
<key command="palette_editor" shortcut="F4" />
<key command="convolution_matrix" shortcut="F9" />
<key command="color_curve" shortcut="Ctrl+M" />
<key command="color_curve" shortcut="F10" />
@ -95,7 +95,6 @@
<item command="record_screen" name="Record Screen" />
</menu>
<separator />
<item command="about" name="About" />
<item command="exit" name="E&xit" />
</menu>
<menu name="&Edit">
@ -113,25 +112,6 @@
<item command="replace_color" name="R&eplace Color" />
<item command="invert_color" name="&Invert" />
</menu>
<menu name="&View">
<item command="refresh" name="&Refresh" />
<item command="configure_screen" name="Configure &Screen" />
<item command="advanced_mode" name="&Advanced Mode" />
<menu name="&Editor">
<item command="make_unique_editor" name="Make &Unique" />
<separator />
<item command="split_editor_vertically" name="Split &Vertically" />
<item command="split_editor_horizontally" name="Split &Horizontally" />
<separator />
<item command="close_editor" name="&Close" />
</menu>
<separator />
<menu name="&Preview">
<item command="preview_fit_to_screen" name="&Fit to screen" />
<item command="preview_normal" name="&Normal" />
<item command="preview_tiled" name="&Tiled" />
</menu>
</menu>
<menu name="&Sprite">
<item command="sprite_properties" name="&Properties" />
<separator />
@ -189,6 +169,30 @@
<item command="load_mask" name="&Load from MSK file" />
<item command="save_mask" name="&Save to MSK file" />
</menu>
<menu name="&View">
<item command="advanced_mode" name="&Advanced Mode" />
<menu name="&Editor">
<item command="make_unique_editor" name="Make &Unique" />
<separator />
<item command="split_editor_vertically" name="Split &Vertically" />
<item command="split_editor_horizontally" name="Split &Horizontally" />
<separator />
<item command="close_editor" name="&Close" />
</menu>
<separator />
<menu name="&Grid">
<item command="show_grid" name="Show &Grid" />
<item command="snap_to_grid" name="&Snap to Grid" />
</menu>
<menu name="&Preview">
<item command="preview_fit_to_screen" name="&Fit to screen" />
<item command="preview_normal" name="&Normal" />
<item command="preview_tiled" name="&Tiled" />
</menu>
<separator />
<item command="refresh" name="&Refresh" />
<item command="configure_screen" name="Configure &Screen" />
</menu>
<menu name="&Tools">
<menu name="&Drawing Tool">
<item command="configure_tools" name="&Configure" />
@ -216,7 +220,6 @@
<item command="despeckle" name="&Despeckle (median filter)" />
</menu>
<!-- <item command="draw_text" name="Draw &Text" /> -->
<!-- <item command="mapgen" name="&MapGen" /> -->
<!-- <menu name="Scripting"> -->
<!-- <item command="run_script" name="Run &Script" /> -->
<!-- </menu> -->
@ -224,9 +227,13 @@
<!-- <item command="play_flic" name="Pla&y FLI/FLC File" /> -->
<!-- </menu> -->
<separator />
<item command="tips" name="T&ips" />
<item command="options" name="&Options" />
</menu>
<menu name="&Help">
<item command="tips" name="&Tips" />
<separator />
<item command="about" name="&About" />
</menu>
</menu>
</gui>

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007, 2008 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->
@ -33,7 +33,7 @@
<slider min="0" max="255" expansive name="alpha" />
</box>
<view name="palette_editor" expansive /> <!-- custom-widget -->
<box name="color_viewer" expansive /> <!-- custom-widget -->
<box name="colorviewer" expansive /> <!-- custom-widget -->
<box horizontal homogeneous>
<button text="&OK" name="button_ok" magnetic />
<button text="&Cancel" />

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007, 2008 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,59 +1,17 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->
<!-- default 0.2 layout -->
<window noborders desktop text="Main Window" name="main_window">
<box noborders vertical>
<box noborders horizontal name="menu_bar" />
<box noborders horizontal name="tabs_bar" />
<box noborders horizontal name="menubar" />
<box noborders horizontal name="tabsbar" />
<box noborders horizontal expansive>
<box noborders vertical name="color_bar" />
<box noborders vertical name="colorbar" />
<box noborders horizontal name="editor" expansive />
<box noborders vertical name="tool_bar" />
<box noborders vertical name="toolbar" />
</box>
<box noborders horizontal name="status_bar" />
</box>
</window>
<!-- old 0.1.2 layout -->
<window noborders desktop text="Main Window" name="main_window_alt1">
<box noborders vertical>
<box noborders horizontal name="menu_bar" />
<box noborders horizontal expansive>
<box noborders vertical name="color_bar" />
<box noborders vertical expansive>
<box noborders horizontal expansive>
<box noborders horizontal name="editor" expansive />
<box noborders vertical name="tool_bar" />
</box>
<box noborders horizontal name="status_bar" />
</box>
</box>
</box>
</window>
<!-- alternative layout like Windows apps -->
<window noborders desktop text="Main Window" name="main_window_alt2">
<box noborders vertical>
<box noborders horizontal name="menu_bar" />
<box noborders horizontal name="tool_bar" />
<box noborders horizontal name="editor" expansive />
<box noborders horizontal name="color_bar" />
<box noborders horizontal name="status_bar" />
</box>
</window>
<!-- alternative layout like Corel -->
<window noborders desktop text="Main Window" name="main_window_alt3">
<box noborders vertical>
<box noborders horizontal name="menu_bar" />
<box horizontal expansive>
<box noborders vertical name="tool_bar" />
<box noborders horizontal name="editor" expansive />
</box>
<box noborders horizontal name="color_bar" />
<box noborders horizontal name="status_bar" />
<box noborders horizontal name="statusbar" />
</box>
</window>

View File

@ -1,42 +0,0 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->
<window text="Map Generator" name="mapgen">
<panel horizontal>
<view name="mapview" expansive /><!-- custom-widget -->
<box vertical>
<box horizontal>
<box horizontal expansive>
<box vertical homogeneous>
<label text="Width:" />
<label text="Height:" />
</box>
<box vertical homogeneous expansive>
<entry expansive name="width" maxsize=8 />
<entry expansive name="height" maxsize=8 />
</box>
</box>
</box>
<label text="Seed:" />
<box horizontal>
<entry expansive name="seed" maxsize=32 />
<button text="&Random" name="random_seed" />
</box>
<label text="Fractal Factor:" />
<box horizontal>
<entry expansive name="fractal_factor" maxsize=32 />
<button text="sqrt2" name="sqrt2_factor" />
</box>
<check text="&Preview" name="preview" />
<check text="&Tiled" name="tiled" />
<button text="&OK" name="button_ok" magnetic />
<button text="&Cancel" />
</box>
</box>
</window>

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007, 2008 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->
@ -33,7 +33,7 @@
<slider min="0" max="255" name="value" />
</box>
</box>
<box name="color_viewer" expansive /> <!-- custom-widget -->
<box name="colorviewer" expansive /> <!-- custom-widget -->
<button text="Select &All" name="select_all" />
<box vertical>
<box horizontal homogeneous>

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -1,5 +1,5 @@
<!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2005, 2007 by David A. Capello -->
<!-- Copyright (C) 2001-2008 by David A. Capello -->
<!-- Read "LEGAL.txt" for more information. -->

View File

@ -3,7 +3,7 @@
######################################################################
# ASE
ASE = ase$(EXE)
ASE = aseprite$(EXE)
COMMON_SOURCES = \
src/commands/cmd_about.c \
@ -23,17 +23,19 @@ COMMON_SOURCES = \
src/commands/cmd_drawing_tools.c \
src/commands/cmd_duplicate_layer.c \
src/commands/cmd_duplicate_sprite.c \
src/commands/cmd_exchange_colors.c \
src/commands/cmd_exit.c \
src/commands/cmd_eyedropper_tool.c \
src/commands/cmd_film_editor.c \
src/commands/cmd_flatten_layers.c \
src/commands/cmd_flip.c \
src/commands/cmd_frame_properties.c \
src/commands/cmd_goto_frame.c \
src/commands/cmd_grid.c \
src/commands/cmd_invert_mask.c \
src/commands/cmd_layer_properties.c \
src/commands/cmd_link_cel.c \
src/commands/cmd_load_mask.c \
src/commands/cmd_mapgen.c \
src/commands/cmd_mask_all.c \
src/commands/cmd_mask_by_color.c \
src/commands/cmd_merge_down_layer.c \
@ -83,7 +85,6 @@ COMMON_SOURCES = \
src/core/modules.c \
src/dialogs/canvasze.c \
src/dialogs/colsel.c \
src/dialogs/dmapgen.c \
src/dialogs/dpaledit.c \
src/dialogs/drawtext.c \
src/dialogs/filesel.c \
@ -125,6 +126,7 @@ COMMON_SOURCES = \
src/jinete/jcombobox.c \
src/jinete/jdraw.c \
src/jinete/jentry.c \
src/jinete/jgrid.c \
src/jinete/jfile.c \
src/jinete/jfilesel.c \
src/jinete/jfont.c \
@ -194,7 +196,6 @@ COMMON_SOURCES = \
src/util/crop.c \
src/util/filetoks.c \
src/util/hash.c \
src/util/mapgen.c \
src/util/misc.c \
src/util/msk_file.c \
src/util/pic_file.c \
@ -204,6 +205,7 @@ COMMON_SOURCES = \
src/util/thmbnail.c \
src/widgets/colbar.c \
src/widgets/colbut.c \
src/widgets/colsel2.c \
src/widgets/colview.c \
src/widgets/curvedit.c \
src/widgets/editor/click.c \

View File

@ -57,7 +57,7 @@ include makefile.gcc
default: all
all: $(ASE)
all: $(ASE) test
clean:
-rm -f $(ALL_OBJS) $(THIRD_PARTY_LIBS)

View File

@ -4,7 +4,6 @@ GCC="gcc -MM"
CFLAGS="-I. \
-Isrc \
-Ithird_party/lua/include \
-Ithird_party/gfli \
-Ithird_party/intl \
-Ithird_party/libpng \
-Ithird_party/zlib \
@ -23,6 +22,7 @@ $GCC $CFLAGS \
src/dialogs/*.c \
src/effect/*.c \
src/file/*.c \
src/file/*/*.c \
src/intl/*.c \
src/jinete/*.c \
src/modules/*.c \

View File

@ -1,7 +1,7 @@
#! /bin/sh
dir="`pwd`"
version=0.6beta
version=0.6-beta2
distdir=ase-$version
freetype_files="third_party/freetype/ChangeLog \
@ -33,10 +33,6 @@ freetype_files="third_party/freetype/ChangeLog \
third_party/freetype/src/type1/*.[ch] \
third_party/freetype/src/winfonts/*.[ch]"
gfli_files="third_party/gfli/*.[ch] \
third_party/gfli/README \
third_party/gfli/TODO"
jpeg_files="third_party/jpeg/*.[ch] \
third_party/jpeg/*.log \
third_party/jpeg/*.doc \
@ -73,8 +69,7 @@ zlib_files="third_party/zlib/*.[ch] \
third_party/zlib/*.txt \
third_party/zlib/README"
ase_files="all.h \
config.h \
ase_files="config.h \
ChangeLog \
COPYING \
fix.bat \
@ -115,6 +110,8 @@ ase_files="all.h \
src/dialogs/*.[ch] \
src/effect/*.[ch] \
src/file/*.[ch] \
src/file/fli/*.[ch] \
src/file/fli/README \
src/file/gif/*.[ch] \
src/intl/*.[ch] \
src/jinete/*.[ch] \
@ -126,6 +123,7 @@ ase_files="all.h \
src/raster/x86/*.s \
src/script/*.[ch] \
src/script/*.py \
src/test/*.[ch] \
src/test/jinete/*.[ch] \
src/test/jinete/*.jid \
src/test/jinete/*.pcx \
@ -148,7 +146,6 @@ mkdir "$dir/$distdir"
cp --parents \
$freetype_files \
$gfli_files \
$jpeg_files \
$libart_files \
$libpng_files \
@ -172,7 +169,11 @@ fi
function def_common_files()
{
txt_files=" \
$1/*.txt \
$1/AUTHORS.txt \
$1/LEGAL.txt \
$1/NEWS.txt \
$1/README.txt \
$1/WARNING.txt \
$1/COPYING \
$1/data/convmatr.def \
$1/data/jids/*.jid \
@ -202,17 +203,17 @@ if [ ! -f $distdir-win32.zip ] ; then
cd "$dir/.."
make -f makefile.mgw CONFIGURED=1 clean
make -f makefile.mgw CONFIGURED=1
strip -s ase.exe
strip -s aseprite.exe
def_common_files .
mkdir "$dir/$distdir-win32"
cp -r --parents $txt_files $bin_files ase.exe "$dir/$distdir-win32"
cp -r --parents $txt_files $bin_files aseprite.exe "$dir/$distdir-win32"
cd "$dir"
cp alleg42.dll "$dir/$distdir-win32"
def_common_files $distdir-win32
zip -9 $distdir-win32.zip $txt_files
zip -9 $distdir-win32.zip $bin_files \
$distdir-win32/ase.exe \
$distdir-win32/aseprite.exe \
$distdir-win32/alleg42.dll
rm -fr $distdir-win32

View File

@ -65,17 +65,17 @@ static void cmd_about_execute(const char *argument)
jwidget_magnetic(button1, TRUE);
jwidget_set_border(box1, 4, 4, 4, 4);
jwidget_add_childs(box1, label1, label2, separator1, NULL);
jwidget_add_children(box1, label1, label2, separator1, NULL);
if (textbox) {
jview_attach(view, textbox);
jwidget_expansive(view, TRUE);
jwidget_set_min_size(view, JI_SCREEN_W/3, JI_SCREEN_H/4);
jwidget_add_childs(box1, view, separator2, NULL);
jwidget_add_children(box1, view, separator2, NULL);
}
jwidget_expansive(box3, TRUE);
jwidget_expansive(box4, TRUE);
jwidget_add_childs(box2, box3, button1, box4, NULL);
jwidget_add_childs(box1, label3, label4, NULL);
jwidget_add_children(box2, box3, button1, box4, NULL);
jwidget_add_children(box1, label3, label4, NULL);
jwidget_add_child(box1, box2);
jwidget_add_child(window, box1);

View File

@ -31,18 +31,18 @@ static void cmd_advanced_mode_execute(const char *argument)
advanced_mode = !advanced_mode;
if (advanced_mode) {
jwidget_hide(app_get_tool_bar());
jwidget_hide(app_get_menu_bar());
jwidget_hide(app_get_status_bar());
jwidget_hide(app_get_color_bar());
jwidget_hide(app_get_tabs_bar());
jwidget_hide(app_get_toolbar());
jwidget_hide(app_get_menubar());
jwidget_hide(app_get_statusbar());
jwidget_hide(app_get_colorbar());
jwidget_hide(app_get_tabsbar());
}
else {
jwidget_show(app_get_tool_bar());
jwidget_show(app_get_menu_bar());
jwidget_show(app_get_status_bar());
jwidget_show(app_get_color_bar());
jwidget_show(app_get_tabs_bar());
jwidget_show(app_get_toolbar());
jwidget_show(app_get_menubar());
jwidget_show(app_get_statusbar());
jwidget_show(app_get_colorbar());
jwidget_show(app_get_tabsbar());
}
jwindow_remap(app_get_top_window());

View File

@ -19,12 +19,10 @@
#include "config.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "util/misc.h"
#include "widgets/colbar.h"
static bool cmd_clear_enabled(const char *argument)
{
@ -37,7 +35,7 @@ static void cmd_clear_execute(const char *argument)
Sprite *sprite = current_sprite;
/* clear the mask */
ClearMask(color_bar_get_color(app_get_color_bar(), 1));
ClearMask(color_mask());
/* refresh the sprite */
update_screen_for_sprite(sprite);

View File

@ -258,7 +258,7 @@ static int brush_type_change_hook(JWidget widget, int user_data)
set_brush_type(type);
jwidget_dirty((JWidget)user_data);
status_bar_set_text(app_get_status_bar(), 250,
statusbar_set_text(app_get_statusbar(), 250,
"Brush type: %s",
type == BRUSH_CIRCLE ? "Circle":
type == BRUSH_SQUARE ? "Square":
@ -273,7 +273,7 @@ static int brush_mode_change_hook(JWidget widget, int user_data)
set_brush_mode(mode);
status_bar_set_text(app_get_status_bar(), 250,
statusbar_set_text(app_get_statusbar(), 250,
"Brush mode: %s",
mode == DRAWMODE_OPAQUE ? "Opaque":
mode == DRAWMODE_GLASS ? "Glass":

View File

@ -53,8 +53,15 @@ static Layer *duplicate_layer(void)
if (!sprite || !sprite->layer)
return NULL;
/* open undo */
if (undo_is_enabled(sprite->undo))
undo_open(sprite->undo);
layer_copy = layer_new_copy(sprite->layer);
if (!layer_copy) {
if (undo_is_enabled(sprite->undo))
undo_close(sprite->undo);
console_printf("Not enough memory");
return NULL;
}
@ -62,10 +69,9 @@ static Layer *duplicate_layer(void)
sprintf(buf, "%s %s", layer_copy->name, _("Copy"));
layer_set_name(layer_copy, buf);
if (undo_is_enabled(sprite->undo)) {
undo_open(sprite->undo);
/* add the new layer in the sprite */
if (undo_is_enabled(sprite->undo))
undo_add_layer(sprite->undo, (Layer *)sprite->layer->parent, layer_copy);
}
layer_add_layer((Layer *)sprite->layer->parent, layer_copy);

View File

@ -18,21 +18,28 @@
#include "config.h"
#include "jinete/jinete.h"
#include <allegro/unicode.h>
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "widgets/colbar.h"
/* static void cmd_mapgen_execute(const char *argument) */
/* { */
/* } */
static void cmd_exchange_colors_execute(const char *argument)
{
JWidget colorbar = app_get_colorbar();
color_t fg = colorbar_get_fg_color(colorbar);
color_t bg = colorbar_get_bg_color(colorbar);
/* Command cmd_mapgen = { */
/* CMD_MAPGEN, */
/* cmd_mapgen_enabled, */
/* NULL, */
/* cmd_mapgen_execute, */
/* NULL */
/* }; */
colorbar_set_fg_color(colorbar, bg);
colorbar_set_bg_color(colorbar, fg);
}
Command cmd_exchange_colors = {
CMD_EXCHANGE_COLORS,
NULL,
NULL,
cmd_exchange_colors_execute,
NULL
};

View File

@ -0,0 +1,66 @@
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2008 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <allegro/unicode.h>
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/editors.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "raster/image.h"
#include "widgets/colbar.h"
#include "widgets/editor.h"
static void cmd_eyedropper_tool_execute(const char *argument)
{
JWidget widget;
Editor *editor;
color_t color;
int x, y;
widget = jmanager_get_mouse();
if (!widget || widget->type != editor_type())
return;
editor = editor_data(widget);
if (!editor->sprite)
return;
/* pixel position to get */
screen_to_editor(widget, jmouse_x(0), jmouse_y(0), &x, &y);
/* get the color from the image */
color = color_from_image(editor->sprite->imgtype,
sprite_getpixel(editor->sprite, x, y));
/* set the color of the color-bar */
colorbar_set_fg_color(app_get_colorbar(), color);
}
Command cmd_eyedropper_tool = {
CMD_EYEDROPPER_TOOL,
NULL,
NULL,
cmd_eyedropper_tool_execute,
NULL
};

View File

@ -39,7 +39,7 @@ static void cmd_goto_first_frame_execute(const char *argument)
current_sprite->frame = 0;
update_screen_for_sprite(current_sprite);
editor_update_status_bar_for_standby(current_editor);
editor_update_statusbar_for_standby(current_editor);
}
/* ======================== */
@ -59,7 +59,7 @@ static void cmd_goto_previous_frame_execute(const char *argument)
current_sprite->frame = current_sprite->frames-1;
update_screen_for_sprite(current_sprite);
editor_update_status_bar_for_standby(current_editor);
editor_update_statusbar_for_standby(current_editor);
}
/* ======================== */
@ -79,7 +79,7 @@ static void cmd_goto_next_frame_execute(const char *argument)
current_sprite->frame = 0;
update_screen_for_sprite(current_sprite);
editor_update_status_bar_for_standby(current_editor);
editor_update_statusbar_for_standby(current_editor);
}
/* ======================== */
@ -96,7 +96,7 @@ static void cmd_goto_last_frame_execute(const char *argument)
current_sprite->frame = current_sprite->frames-1;
update_screen_for_sprite(current_sprite);
editor_update_status_bar_for_standby(current_editor);
editor_update_statusbar_for_standby(current_editor);
}
Command cmd_goto_first_frame = {

63
src/commands/cmd_grid.c Normal file
View File

@ -0,0 +1,63 @@
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2008 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <allegro/unicode.h>
#include "commands/commands.h"
#include "core/app.h"
#include "modules/editors.h"
#include "modules/tools.h"
#include "widgets/statebar.h"
static void cmd_show_grid_execute(const char *argument)
{
set_view_grid(get_view_grid() ? FALSE: TRUE);
refresh_all_editors();
}
static void cmd_snap_to_grid_execute(const char *argument)
{
char buf[512];
set_use_grid(get_use_grid() ? FALSE: TRUE);
refresh_all_editors();
usprintf(buf, _("Snap to grid: %s"),
get_use_grid() ? _("On"):
_("Off"));
statusbar_set_text(app_get_statusbar(), 250, buf);
}
Command cmd_show_grid = {
CMD_SHOW_GRID,
NULL,
NULL,
cmd_show_grid_execute,
NULL
};
Command cmd_snap_to_grid = {
CMD_SNAP_TO_GRID,
NULL,
NULL,
cmd_snap_to_grid_execute,
NULL
};

View File

@ -27,6 +27,7 @@
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "core/cfg.h"
#include "dialogs/colsel.h"
#include "modules/color.h"
#include "modules/gui.h"
@ -37,13 +38,6 @@
#include "script/functions.h"
#include "util/misc.h"
static const char *bg_table[] = {
"mask",
"rgb{0,0,0}",
"rgb{255,255,255}",
"rgb{255,0,255}"
};
static int _sprite_counter = 0;
/**
@ -55,7 +49,13 @@ static void cmd_new_file_execute(const char *argument)
int imgtype, w, h, bg;
char buf[1024];
Sprite *sprite;
char *color;
color_t color;
color_t bg_table[] = {
color_mask(),
color_rgb(0, 0, 0, 255),
color_rgb(255, 255, 255, 255),
color_rgb(255, 0, 255, 255)
};
/* load the window widget */
window = load_widget("newspr.jid", "new_sprite");
@ -94,6 +94,8 @@ static void cmd_new_file_execute(const char *argument)
jwindow_open_fg(window);
if (jwindow_get_killer(window) == ok) {
bool ok = FALSE;
/* get the options */
if (jwidget_is_selected(radio1)) imgtype = IMAGE_RGB;
else if (jwidget_is_selected(radio2)) imgtype = IMAGE_GRAYSCALE;
@ -107,23 +109,24 @@ static void cmd_new_file_execute(const char *argument)
h = MID(1, h, 9999);
/* select the color */
color = NULL;
color = color_mask();
if (bg >= 0 && bg <= 3) {
color = jstrdup(bg_table[bg]);
color = bg_table[bg];
ok = TRUE;
}
else {
const char *default_color =
get_config_string("NewSprite",
"BackgroundCustom",
"rgb{0,0,0}");
color = get_config_color("NewSprite",
"BackgroundCustom",
color_rgb(0, 0, 0, 255));
color = ji_color_select(imgtype, default_color);
if (color)
set_config_string("NewSprite", "BackgroundCustom", color);
if (ji_color_select(imgtype, &color)) {
set_config_color("NewSprite", "BackgroundCustom", color);
ok = TRUE;
}
}
if (color) {
if (ok) {
/* save the configuration */
set_config_int("NewSprite", "Type", imgtype);
set_config_int("NewSprite", "Width", w);
@ -152,8 +155,6 @@ static void cmd_new_file_execute(const char *argument)
/* show the sprite to the user */
sprite_show(sprite);
}
jfree(color);
}
}

View File

@ -162,8 +162,8 @@ static void cmd_open_file_execute(const char *argument)
data->fop = fop;
/* add the progress bar */
if (app_get_status_bar())
data->progress = progress_new(app_get_status_bar());
if (app_get_statusbar())
data->progress = progress_new(app_get_statusbar());
else
data->progress = NULL;

View File

@ -27,6 +27,7 @@
#include "modules/gui.h"
#include "modules/palette.h"
#include "modules/sprites.h"
#include "modules/tools.h"
#include "raster/sprite.h"
#include "widgets/editor.h"
@ -49,10 +50,14 @@ static void cmd_play_animation_execute(const char *argument)
Sprite *sprite = current_sprite;
int old_frame, msecs;
bool done = FALSE;
bool onionskin = get_onionskin();
if (sprite->frames < 2)
return;
/* desactivate the onion-skin */
set_onionskin(FALSE);
jmouse_hide();
old_frame = sprite->frame;
@ -92,6 +97,8 @@ static void cmd_play_animation_execute(const char *argument)
gui_feedback();
}
set_onionskin(onionskin);
/* if right-click or ESC */
if (mouse_b == 2 || (keypressed() && (readkey()>>8) == KEY_ESC))
/* return to the old frame position */

View File

@ -104,8 +104,8 @@ static void preview_sprite(int flags)
bmp = create_bitmap(sprite->w, sprite->h);
if (bmp) {
/* print a informative text */
status_bar_set_text(app_get_status_bar(), 1, _("Rendering..."));
jwidget_flush_redraw(app_get_status_bar());
statusbar_set_text(app_get_statusbar(), 1, _("Rendering..."));
jwidget_flush_redraw(app_get_statusbar());
jmanager_dispatch_messages(ji_get_default_manager());
jmouse_set_cursor(JI_CURSOR_NULL);
@ -157,8 +157,8 @@ static void preview_sprite(int flags)
outh = (double)bmp->h * (double)scale;
stretch_blit(bmp, ji_screen, 0, 0, bmp->w, bmp->h, 0, 0, outw, outh);
rectfill_exclude(ji_screen, 0, 0, JI_SCREEN_W-1, JI_SCREEN_H-1,
0, 0, outw-1, outh-1, bg_color);
jrectexclude(ji_screen, 0, 0, JI_SCREEN_W-1, JI_SCREEN_H-1,
0, 0, outw-1, outh-1, bg_color);
}
/* draw in normal size */
else {
@ -207,7 +207,7 @@ static void preview_sprite(int flags)
Command *command;
JMessage msg;
msg = jmessage_new_key_related(JM_CHAR, readkey_value);
msg = jmessage_new_key_related(JM_KEYPRESSED, readkey_value);
command = command_get_by_key(msg);
jmessage_free(msg);

View File

@ -45,10 +45,10 @@ static void cmd_save_file_execute(const char *argument)
recent_file(current_sprite->filename);
sprite_mark_as_saved(current_sprite);
if (app_get_status_bar())
status_bar_set_text(app_get_status_bar(),
1000, "File %s, saved.",
get_filename(current_sprite->filename));
if (app_get_statusbar())
statusbar_set_text(app_get_statusbar(),
1000, "File %s, saved.",
get_filename(current_sprite->filename));
}
else {
/* TODO if the user cancel we shouldn't unrecent the file */

View File

@ -46,7 +46,6 @@ static void cmd_sprite_properties_execute(const char *argument)
Sprite *sprite = current_sprite;
char *imgtype_text;
char buf[256];
char *tmp;
/* load the window widget */
window = load_widget("sprprop.jid", "sprite_properties");
@ -96,9 +95,9 @@ static void cmd_sprite_properties_execute(const char *argument)
jwidget_set_text(frames, buf);
/* background color */
tmp = color_from_image(sprite->imgtype, sprite->bgcolor);
bgcolor_button = color_button_new(tmp, current_sprite->imgtype);
jfree(tmp);
bgcolor_button = color_button_new(color_from_image(sprite->imgtype,
sprite->bgcolor),
current_sprite->imgtype);
jwidget_add_child(bgcolor_box, bgcolor_button);
@ -107,6 +106,7 @@ static void cmd_sprite_properties_execute(const char *argument)
for (;;) {
load_window_pos(window, "SpriteProperties");
jwidget_show(window);
jwindow_open_fg(window);
save_window_pos(window, "SpriteProperties");

View File

@ -36,7 +36,6 @@ extern Command cmd_close_file;
extern Command cmd_close_all_files;
extern Command cmd_screen_shot;
extern Command cmd_record_screen;
extern Command cmd_about;
extern Command cmd_exit;
/* edit */
extern Command cmd_undo;
@ -49,17 +48,6 @@ extern Command cmd_flip_horizontal;
extern Command cmd_flip_vertical;
extern Command cmd_replace_color;
extern Command cmd_invert_color;
/* view */
extern Command cmd_refresh;
extern Command cmd_configure_screen;
extern Command cmd_advanced_mode;
extern Command cmd_make_unique_editor;
extern Command cmd_split_editor_vertically;
extern Command cmd_split_editor_horizontally;
extern Command cmd_close_editor;
extern Command cmd_preview_tiled, preview;
extern Command cmd_preview_normal, preview;
extern Command cmd_preview_fit_to_screen, preview;
/* sprite */
extern Command cmd_sprite_properties;
extern Command cmd_duplicate_sprite;
@ -100,6 +88,19 @@ extern Command cmd_invert_mask;
extern Command cmd_mask_by_color;
extern Command cmd_load_mask;
extern Command cmd_save_mask;
/* view */
extern Command cmd_refresh;
extern Command cmd_configure_screen;
extern Command cmd_advanced_mode;
extern Command cmd_make_unique_editor;
extern Command cmd_split_editor_vertically;
extern Command cmd_split_editor_horizontally;
extern Command cmd_close_editor;
extern Command cmd_show_grid;
extern Command cmd_snap_to_grid;
extern Command cmd_preview_tiled;
extern Command cmd_preview_normal;
extern Command cmd_preview_fit_to_screen;
/* tools */
extern Command cmd_configure_tools;
extern Command cmd_marker_tool;
@ -111,14 +112,18 @@ extern Command cmd_floodfill_tool;
extern Command cmd_line_tool;
extern Command cmd_rectangle_tool;
extern Command cmd_ellipse_tool;
extern Command cmd_eyedropper_tool;
extern Command cmd_exchange_colors;
extern Command cmd_film_editor;
extern Command cmd_palette_editor;
extern Command cmd_convolution_matrix;
extern Command cmd_color_curve;
extern Command cmd_despeckle;
extern Command cmd_run_script;
extern Command cmd_tips;
extern Command cmd_options;
/* help */
extern Command cmd_tips;
extern Command cmd_about;
/* internal */
extern Command cmd_select_file;
@ -132,7 +137,6 @@ static Command *commands[] = {
&cmd_close_all_files,
&cmd_screen_shot,
&cmd_record_screen,
&cmd_about,
&cmd_exit,
/* edit */
&cmd_undo,
@ -145,17 +149,6 @@ static Command *commands[] = {
&cmd_flip_vertical,
&cmd_replace_color,
&cmd_invert_color,
/* view */
&cmd_refresh,
&cmd_configure_screen,
&cmd_advanced_mode,
&cmd_make_unique_editor,
&cmd_split_editor_vertically,
&cmd_split_editor_horizontally,
&cmd_close_editor,
&cmd_preview_tiled,
&cmd_preview_normal,
&cmd_preview_fit_to_screen,
/* sprite */
&cmd_sprite_properties,
&cmd_duplicate_sprite,
@ -196,6 +189,19 @@ static Command *commands[] = {
&cmd_mask_by_color,
&cmd_load_mask,
&cmd_save_mask,
/* view */
&cmd_refresh,
&cmd_configure_screen,
&cmd_advanced_mode,
&cmd_make_unique_editor,
&cmd_split_editor_vertically,
&cmd_split_editor_horizontally,
&cmd_close_editor,
&cmd_show_grid,
&cmd_snap_to_grid,
&cmd_preview_tiled,
&cmd_preview_normal,
&cmd_preview_fit_to_screen,
/* tools */
&cmd_configure_tools,
&cmd_marker_tool,
@ -207,6 +213,8 @@ static Command *commands[] = {
&cmd_line_tool,
&cmd_rectangle_tool,
&cmd_ellipse_tool,
&cmd_eyedropper_tool,
&cmd_exchange_colors,
&cmd_film_editor,
&cmd_palette_editor,
&cmd_convolution_matrix,
@ -214,10 +222,11 @@ static Command *commands[] = {
&cmd_despeckle,
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */
&cmd_run_script,
&cmd_tips,
&cmd_options,
/* help */
&cmd_tips,
&cmd_about,
/* internal */
&cmd_select_file,
NULL

View File

@ -30,7 +30,6 @@
#define CMD_CLOSE_ALL_FILES "close_all_files"
#define CMD_SCREEN_SHOT "screen_shot"
#define CMD_RECORD_SCREEN "record_screen"
#define CMD_ABOUT "about"
#define CMD_EXIT "exit"
/* edit */
#define CMD_UNDO "undo"
@ -43,17 +42,6 @@
#define CMD_FLIP_VERTICAL "flip_vertical"
#define CMD_REPLACE_COLOR "replace_color"
#define CMD_INVERT_COLOR "invert_color"
/* view */
#define CMD_REFRESH "refresh"
#define CMD_CONFIGURE_SCREEN "configure_screen"
#define CMD_ADVANCED_MODE "advanced_mode"
#define CMD_MAKE_UNIQUE_EDITOR "make_unique_editor"
#define CMD_SPLIT_EDITOR_VERTICALLY "split_editor_vertically"
#define CMD_SPLIT_EDITOR_HORIZONTALLY "split_editor_horizontally"
#define CMD_CLOSE_EDITOR "close_editor"
#define CMD_PREVIEW_TILED "preview_tiled"
#define CMD_PREVIEW_NORMAL "preview_normal"
#define CMD_PREVIEW_FIT_TO_SCREEN "preview_fit_to_screen"
/* sprite */
#define CMD_SPRITE_PROPERTIES "sprite_properties"
#define CMD_DUPLICATE_SPRITE "duplicate_sprite"
@ -94,6 +82,19 @@
#define CMD_MASK_BY_COLOR "mask_by_color"
#define CMD_LOAD_MASK "load_mask"
#define CMD_SAVE_MASK "save_mask"
/* view */
#define CMD_REFRESH "refresh"
#define CMD_CONFIGURE_SCREEN "configure_screen"
#define CMD_ADVANCED_MODE "advanced_mode"
#define CMD_MAKE_UNIQUE_EDITOR "make_unique_editor"
#define CMD_SPLIT_EDITOR_VERTICALLY "split_editor_vertically"
#define CMD_SPLIT_EDITOR_HORIZONTALLY "split_editor_horizontally"
#define CMD_CLOSE_EDITOR "close_editor"
#define CMD_SHOW_GRID "show_grid"
#define CMD_SNAP_TO_GRID "snap_to_grid"
#define CMD_PREVIEW_TILED "preview_tiled"
#define CMD_PREVIEW_NORMAL "preview_normal"
#define CMD_PREVIEW_FIT_TO_SCREEN "preview_fit_to_screen"
/* tools */
#define CMD_CONFIGURE_TOOLS "configure_tools"
#define CMD_MARKER_TOOL "marker_tool"
@ -105,6 +106,8 @@
#define CMD_LINE_TOOL "line_tool"
#define CMD_RECTANGLE_TOOL "rectangle_tool"
#define CMD_ELLIPSE_TOOL "ellipse_tool"
#define CMD_EYEDROPPER_TOOL "eyedropper_tool"
#define CMD_EXCHANGE_COLORS "exchange_colors"
#define CMD_FILM_EDITOR "film_editor"
#define CMD_PALETTE_EDITOR "palette_editor"
#define CMD_CONVOLUTION_MATRIX "convolution_matrix"
@ -112,10 +115,11 @@
#define CMD_DESPECKLE "despeckle"
/* #define CMD_DRAW_TEXT "draw_text" */
/* #define CMD_PLAY_FLIC "play_flic" */
/* #define CMD_MAPGEN "mapgen" */
#define CMD_RUN_SCRIPT "run_script"
#define CMD_TIPS "tips"
#define CMD_OPTIONS "options"
/* help */
#define CMD_TIPS "tips"
#define CMD_ABOUT "about"
/* internal commands */
#define CMD_SELECT_FILE "select_file"

View File

@ -104,13 +104,13 @@ static void cmd_replace_color_execute(const char *argument)
preview = preview_new(effect);
button_color1 = color_button_new
(get_config_string("ReplaceColor", "Color1",
color_bar_get_color(app_get_color_bar(), 0)),
(get_config_color("ReplaceColor", "Color1",
colorbar_get_fg_color(app_get_colorbar())),
current_sprite->imgtype);
button_color2 = color_button_new
(get_config_string("ReplaceColor", "Color2",
color_bar_get_color(app_get_color_bar(), 1)),
(get_config_color("ReplaceColor", "Color2",
colorbar_get_bg_color(app_get_colorbar())),
current_sprite->imgtype);
target_button = target_button_new(current_sprite->imgtype, FALSE);
@ -171,7 +171,7 @@ static int button_1_select_hook(JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color(w, color_bar_get_color(app_get_color_bar(), 0));
color_button_set_color(w, colorbar_get_fg_color(app_get_colorbar()));
color_change_hook(w, user_data);
return TRUE;
@ -181,7 +181,7 @@ static int button_2_select_hook(JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color(w, color_bar_get_color(app_get_color_bar(), 1));
color_button_set_color(w, colorbar_get_bg_color(app_get_colorbar()));
color_change_hook(w, user_data);
return TRUE;
@ -192,7 +192,7 @@ static int color_change_hook(JWidget widget, int user_data)
char buf[64];
sprintf(buf, "Color%d", user_data);
set_config_string("ReplaceColor", buf, color_button_get_color(widget));
set_config_color("ReplaceColor", buf, color_button_get_color(widget));
make_preview();
return FALSE;
@ -222,16 +222,16 @@ static int preview_change_hook(JWidget widget, int user_data)
static void make_preview(void)
{
Effect *effect = preview_get_effect(preview);
const char *from, *to;
color_t from, to;
int fuzziness;
from = get_config_string("ReplaceColor", "Color1", "mask");
to = get_config_string("ReplaceColor", "Color2", "mask");
from = get_config_color("ReplaceColor", "Color1", color_mask());
to = get_config_color("ReplaceColor", "Color2", color_mask());
fuzziness = get_config_int("ReplaceColor", "Fuzziness", 0);
set_replace_colors(get_color_for_image(effect->dst->imgtype, from),
get_color_for_image(effect->dst->imgtype, to),
MID(0, fuzziness, 255));
get_color_for_image(effect->dst->imgtype, to),
MID(0, fuzziness, 255));
if (jwidget_is_selected(check_preview))
preview_restart(preview);

View File

@ -18,6 +18,7 @@
#include "config.h"
#include <assert.h>
#include <allegro.h>
/* #include <allegro/internal/aintern.h> */
#include <stdarg.h>
@ -74,20 +75,22 @@ typedef struct Option
static char *exe_name; /* name of the program */
static JWidget top_window = NULL; /* top level window (the desktop) */
static JWidget box_menu_bar = NULL; /* box where the menu bar is */
static JWidget box_color_bar = NULL; /* box where the color bar is */
static JWidget box_tool_bar = NULL; /* box where the tools bar is */
static JWidget box_status_bar = NULL; /* box where the status bar is */
static JWidget box_tabs_bar = NULL; /* box where the tabs bar is */
static JWidget menu_bar = NULL; /* the menu bar widget */
static JWidget status_bar = NULL; /* the status bar widget */
static JWidget color_bar = NULL; /* the color bar widget */
static JWidget tool_bar = NULL; /* the tool bar widget */
static JWidget tabs_bar = NULL; /* the tabs bar widget */
static JWidget box_menubar = NULL; /* box where the menu bar is */
static JWidget box_colorbar = NULL; /* box where the color bar is */
static JWidget box_toolbar = NULL; /* box where the tools bar is */
static JWidget box_statusbar = NULL; /* box where the status bar is */
static JWidget box_tabsbar = NULL; /* box where the tabs bar is */
static JWidget menubar = NULL; /* the menu bar widget */
static JWidget statusbar = NULL; /* the status bar widget */
static JWidget colorbar = NULL; /* the color bar widget */
static JWidget toolbar = NULL; /* the tool bar widget */
static JWidget tabsbar = NULL; /* the tabs bar widget */
static JList options; /* list of "Option" structures (options to execute) */
static char *palette_filename = NULL;
static void tabsbar_select_callback(JWidget tabs, void *data);
static int check_args(int argc, char *argv[]);
static void usage(int status);
@ -186,48 +189,48 @@ void app_loop(void)
if (!top_window)
return;
box_menu_bar = jwidget_find_name(top_window, "menu_bar");
box_menubar = jwidget_find_name(top_window, "menubar");
box_editors = jwidget_find_name(top_window, "editor");
box_color_bar = jwidget_find_name(top_window, "color_bar");
box_tool_bar = jwidget_find_name(top_window, "tool_bar");
box_status_bar = jwidget_find_name(top_window, "status_bar");
box_tabs_bar = jwidget_find_name(top_window, "tabs_bar");
box_colorbar = jwidget_find_name(top_window, "colorbar");
box_toolbar = jwidget_find_name(top_window, "toolbar");
box_statusbar = jwidget_find_name(top_window, "statusbar");
box_tabsbar = jwidget_find_name(top_window, "tabsbar");
menu_bar = jmenubar_new();
status_bar = status_bar_new();
color_bar = color_bar_new(box_color_bar->align);
tool_bar = tool_bar_new(box_tool_bar->align);
tabs_bar = tabs_new(sprite_show);
menubar = jmenubar_new();
statusbar = statusbar_new();
colorbar = colorbar_new(box_colorbar->align);
toolbar = toolbar_new(box_toolbar->align);
tabsbar = tabs_new(tabsbar_select_callback);
view = editor_view_new();
editor = create_new_editor();
/* append the NULL sprite to the tabs */
tabs_append_tab(tabs_bar, "Nothing", NULL);
tabs_append_tab(tabsbar, "Nothing", NULL);
/* configure all widgets to expansives */
jwidget_expansive(menu_bar, TRUE);
jwidget_expansive(status_bar, TRUE);
jwidget_expansive(color_bar, TRUE);
jwidget_expansive(tool_bar, TRUE);
jwidget_expansive(tabs_bar, TRUE);
jwidget_expansive(menubar, TRUE);
jwidget_expansive(statusbar, TRUE);
jwidget_expansive(colorbar, TRUE);
jwidget_expansive(toolbar, TRUE);
jwidget_expansive(tabsbar, TRUE);
jwidget_expansive(view, TRUE);
/* prepare the first editor */
jview_attach(view, editor);
/* setup the menus */
jmenubar_set_menu(menu_bar, get_root_menu());
jmenubar_set_menu(menubar, get_root_menu());
/* start text of status bar */
app_default_status_bar_message();
app_default_statusbar_message();
/* add the widgets in the boxes */
if (box_menu_bar) jwidget_add_child(box_menu_bar, menu_bar);
if (box_menubar) jwidget_add_child(box_menubar, menubar);
if (box_editors) jwidget_add_child(box_editors, view);
if (box_color_bar) jwidget_add_child(box_color_bar, color_bar);
if (box_tool_bar) jwidget_add_child(box_tool_bar, tool_bar);
if (box_status_bar) jwidget_add_child(box_status_bar, status_bar);
if (box_tabs_bar) jwidget_add_child(box_tabs_bar, tabs_bar);
if (box_colorbar) jwidget_add_child(box_colorbar, colorbar);
if (box_toolbar) jwidget_add_child(box_toolbar, toolbar);
if (box_statusbar) jwidget_add_child(box_statusbar, statusbar);
if (box_tabsbar) jwidget_add_child(box_tabsbar, tabsbar);
/* prepare the window */
jwindow_remap(top_window);
@ -324,7 +327,7 @@ void app_loop(void)
/* remove the root-menu from the menu-bar (because the rootmenu
module should destroy it) */
jmenubar_set_menu(menu_bar, NULL);
jmenubar_set_menu(menubar, NULL);
/* destroy the top-window */
jwidget_free(top_window);
@ -379,7 +382,7 @@ void app_realloc_sprite_list(void)
/* insert all other sprites */
JI_LIST_FOR_EACH(get_sprite_list(), link) {
sprite = link->data;
tabs_set_text_for_tab(tabs_bar,
tabs_set_text_for_tab(tabsbar,
get_filename(sprite->filename),
sprite);
}
@ -444,16 +447,22 @@ int app_get_current_image_type(void)
}
JWidget app_get_top_window(void) { return top_window; }
JWidget app_get_menu_bar(void) { return menu_bar; }
JWidget app_get_status_bar(void) { return status_bar; }
JWidget app_get_color_bar(void) { return color_bar; }
JWidget app_get_tool_bar(void) { return tool_bar; }
JWidget app_get_tabs_bar(void) { return tabs_bar; }
JWidget app_get_menubar(void) { return menubar; }
JWidget app_get_statusbar(void) { return statusbar; }
JWidget app_get_colorbar(void) { return colorbar; }
JWidget app_get_toolbar(void) { return toolbar; }
JWidget app_get_tabsbar(void) { return tabsbar; }
void app_default_status_bar_message(void)
void app_default_statusbar_message(void)
{
status_bar_set_text(app_get_status_bar(), 250,
"ASE " VERSION ", " COPYRIGHT);
statusbar_set_text(app_get_statusbar(), 250,
"ASE " VERSION ", " COPYRIGHT);
}
static void tabsbar_select_callback(JWidget tabs, void *data)
{
/* data can be NULL (the "Nothing" tab) */
sprite_show((Sprite *)data);
}
/* looks the inpunt arguments in the command line */

View File

@ -33,13 +33,13 @@ bool app_realloc_recent_list(void);
int app_get_current_image_type(void);
JWidget app_get_top_window(void);
JWidget app_get_menu_bar(void);
JWidget app_get_status_bar(void);
JWidget app_get_color_bar(void);
JWidget app_get_tool_bar(void);
JWidget app_get_tabs_bar(void);
JWidget app_get_menubar(void);
JWidget app_get_statusbar(void);
JWidget app_get_colorbar(void);
JWidget app_get_toolbar(void);
JWidget app_get_tabsbar(void);
void app_default_status_bar_message(void);
void app_default_statusbar_message(void);
#endif /* CORE_APP_H */

View File

@ -91,6 +91,21 @@ void get_config_rect(const char *section, const char *name, JRect rect)
void set_config_rect(const char *section, const char *name, JRect rect)
{
char buf[128];
usprintf(buf, "%d %d %d %d", rect->x1, rect->y1, rect->x2, rect->y2);
uszprintf(buf, sizeof(buf), "%d %d %d %d",
rect->x1, rect->y1, rect->x2, rect->y2);
set_config_string(section, name, buf);
}
color_t get_config_color(const char *section, const char *name, color_t value)
{
char buf[128];
color_to_string(value, buf, sizeof(buf));
return string_to_color(get_config_string(section, name, buf));
}
void set_config_color(const char *section, const char *name, color_t value)
{
char buf[128];
color_to_string(value, buf, sizeof(buf));
set_config_string(section, name, buf);
}

View File

@ -22,6 +22,8 @@
#include <allegro/config.h>
#include "jinete/jbase.h"
#include "modules/color.h"
void ase_config_init(void);
void ase_config_exit(void);
@ -31,4 +33,7 @@ void set_config_bool(const char *section, const char *name, bool value);
void get_config_rect(const char *section, const char *name, JRect rect);
void set_config_rect(const char *section, const char *name, JRect rect);
color_t get_config_color(const char *section, const char *name, color_t value);
void set_config_color(const char *section, const char *name, color_t value);
#endif /* CORE_CFG_H */

View File

@ -96,7 +96,8 @@ struct FileItem
char *displayname;
FileItem *parent;
JList children;
int last_update;
unsigned int version;
bool removed;
#ifdef USE_PIDLS
LPITEMIDLIST pidl; /* relative to parent */
LPITEMIDLIST fullpidl; /* relative to the Desktop folder
@ -111,6 +112,7 @@ struct FileItem
/* the root of the file-system */
static FileItem *rootitem = NULL;
static HashTable *hash_fileitems = NULL;
static unsigned int current_file_system_version = 0;
/* hash-table for thumbnails */
static HashTable *hash_thumbnail = NULL;
@ -161,6 +163,8 @@ bool file_system_init(void)
SHGetDesktopFolder(&shl_idesktop);
#endif
++current_file_system_version;
hash_fileitems = hash_new(512);
hash_thumbnail = hash_new(512);
get_root_fileitem();
@ -192,6 +196,17 @@ void file_system_exit(void)
#endif
}
/**
* Marks all FileItems as deprecated to be refresh the next time they
* are queried through @ref fileitem_get_children.
*
* @see fileitem_get_children
*/
void file_system_refresh(void)
{
++current_file_system_version;
}
FileItem *get_root_fileitem(void)
{
FileItem *fileitem;
@ -348,10 +363,26 @@ JList fileitem_get_children(FileItem *fileitem)
{
assert(fileitem != NULL);
if (!fileitem->children && IS_FOLDER(fileitem)) {
fileitem->children = jlist_new();
/* is the file-item a folder? */
if (IS_FOLDER(fileitem) &&
/* if the children list is empty, or the file-system version
change (it's like to say: the current fileitem->children list
is outdated)... */
(!fileitem->children || current_file_system_version > fileitem->version)) {
JLink link, next;
FileItem *child;
/* printf("Loading files for %p (%s)\n", fileitem, fileitem->displayname); fflush(stdout); */
/* we have to rebuild the childre list */
if (!fileitem->children)
fileitem->children = jlist_new();
else {
JI_LIST_FOR_EACH_SAFE(fileitem->children, link, next) {
child = (FileItem *)link->data;
child->removed = TRUE;
}
}
/* printf("Loading files for %p (%s)\n", fileitem, fileitem->displayname); fflush(stdout); */
#ifdef USE_PIDLS
{
IShellFolder *pFolder = NULL;
@ -393,7 +424,6 @@ JList fileitem_get_children(FileItem *fileitem)
/* generate the FileItems */
for (c=0; c<fetched; ++c) {
FileItem *child;
LPITEMIDLIST fullpidl = concat_pidl(fileitem->fullpidl,
itempidl[c]);
@ -442,6 +472,18 @@ JList fileitem_get_children(FileItem *fileitem)
(int)fileitem); /* TODO warning with 64bits */
}
#endif
/* check old file-items (maybe removed directories or file-items) */
JI_LIST_FOR_EACH_SAFE(fileitem->children, link, next) {
child = (FileItem *)link->data;
if (child->removed) {
jlist_delete_link(fileitem->children, link);
fileitem_free(child);
}
}
/* now this file-item is updated */
fileitem->version = current_file_system_version;
}
return fileitem->children;
@ -504,7 +546,7 @@ static FileItem *fileitem_new(FileItem *parent)
fileitem->displayname = NULL;
fileitem->parent = parent;
fileitem->children = NULL;
fileitem->last_update = -1;
fileitem->version = current_file_system_version;
#ifdef USE_PIDLS
fileitem->pidl = NULL;
fileitem->fullpidl = NULL;
@ -533,12 +575,8 @@ static void fileitem_free(FileItem *fileitem)
}
#endif
/* this isn't neccessary (if fileitem_free is called with the
root-item at the first time)...
if (fileitem->parent)
jlist_remove(fileitem->parent->children, fileitem);
*/
if (fileitem->parent)
jlist_remove(fileitem->parent->children, fileitem);
if (fileitem->keyname)
jfree(fileitem->keyname);
@ -564,6 +602,14 @@ static void fileitem_insert_child_sorted(FileItem *fileitem, FileItem *child)
{
JLink link;
bool inserted = FALSE;
/* this file-item wasn't removed from the last lookup */
child->removed = FALSE;
/* if the fileitem is already in the list we can go back */
if (jlist_find(fileitem->children, child) != fileitem->children->end)
return;
JI_LIST_FOR_EACH(fileitem->children, link) {
if (fileitem_cmp((FileItem *)link->data, child) > 0) {
jlist_insert_before(fileitem->children, link, child);

View File

@ -28,6 +28,8 @@ typedef struct FileItem FileItem;
bool file_system_init(void);
void file_system_exit(void);
void file_system_refresh(void);
FileItem *get_root_fileitem(void);
FileItem *get_fileitem_from_path(const char *path);

View File

@ -39,29 +39,29 @@
static JWidget slider_R, slider_G, slider_B, slider_A;
static JWidget slider_H, slider_S, slider_V;
static JWidget color_viewer;
static JWidget colorviewer;
static JWidget palette_editor;
static int sliderRGB_change_signal(JWidget widget, int user_data);
static int sliderHSV_change_signal(JWidget widget, int user_data);
static int sliderA_change_signal(JWidget widget, int user_data);
static int color_viewer_select_signal(JWidget widget, int user_data);
static int colorviewer_select_signal(JWidget widget, int user_data);
static int palette_editor_change_signal(JWidget widget, int user_data);
static int window_resize_signal(JWidget widget, int user_data);
char *ji_color_select(int imgtype, const char *color)
bool ji_color_select(int imgtype, color_t *color)
{
JWidget window, color_viewer_box, palette_editor_view, button_ok;
char *selected_color;
JWidget window, colorviewer_box, palette_editor_view, button_ok;
char buf[256];
PALETTE palette;
bool ret = FALSE;
get_palette(palette);
/* get current palette */
window = load_widget("colsel.jid", "color_selection");
if (!window)
return NULL;
return ret;
/* window title */
sprintf(buf, "%s (%s)", window->text,
@ -80,18 +80,18 @@ char *ji_color_select(int imgtype, const char *color)
"saturation", &slider_S,
"value", &slider_V,
"button_ok", &button_ok,
"color_viewer", &color_viewer_box,
"colorviewer", &colorviewer_box,
"palette_editor", &palette_editor_view, NULL)) {
jwidget_free(window);
return NULL;
return ret;
}
color_viewer = color_viewer_new(color, imgtype);
colorviewer = colorviewer_new(*color, imgtype);
palette_editor = palette_editor_new(palette, FALSE, 3);
palette_editor_set_columns(palette_editor, 32);
jwidget_expansive(color_viewer, TRUE);
jwidget_add_child(color_viewer_box, color_viewer);
jwidget_expansive(colorviewer, TRUE);
jwidget_add_child(colorviewer_box, colorviewer);
jview_attach(palette_editor_view, palette_editor);
jview_maxsize(palette_editor_view);
@ -105,26 +105,26 @@ char *ji_color_select(int imgtype, const char *color)
HOOK(slider_H, JI_SIGNAL_SLIDER_CHANGE, sliderHSV_change_signal, 0);
HOOK(slider_S, JI_SIGNAL_SLIDER_CHANGE, sliderHSV_change_signal, 0);
HOOK(slider_V, JI_SIGNAL_SLIDER_CHANGE, sliderHSV_change_signal, 0);
HOOK(color_viewer, SIGNAL_COLOR_VIEWER_SELECT, color_viewer_select_signal, 0);
HOOK(colorviewer, SIGNAL_COLORVIEWER_SELECT, colorviewer_select_signal, 0);
HOOK(palette_editor, SIGNAL_PALETTE_EDITOR_CHANGE, palette_editor_change_signal, 0);
HOOK(window, JI_SIGNAL_WINDOW_RESIZE, window_resize_signal, palette_editor);
/* initial values */
switch (color_type(color)) {
switch (color_type(*color)) {
case COLOR_TYPE_MASK:
color_viewer_select_signal(NULL, 0);
colorviewer_select_signal(NULL, 0);
break;
case COLOR_TYPE_RGB:
case COLOR_TYPE_GRAY:
jslider_set_value(slider_R, color_get_red(imgtype, color));
jslider_set_value(slider_G, color_get_green(imgtype, color));
jslider_set_value(slider_B, color_get_blue(imgtype, color));
jslider_set_value(slider_A, color_get_alpha(imgtype, color));
jslider_set_value(slider_R, color_get_red(imgtype, *color));
jslider_set_value(slider_G, color_get_green(imgtype, *color));
jslider_set_value(slider_B, color_get_blue(imgtype, *color));
jslider_set_value(slider_A, color_get_alpha(imgtype, *color));
sliderRGB_change_signal(NULL, 0);
break;
case COLOR_TYPE_INDEX:
palette_editor_select_color(palette_editor, color_get_index(imgtype, color));
palette_editor_change_signal(NULL, color_get_index(imgtype, color));
palette_editor_select_color(palette_editor, color_get_index(imgtype, *color));
palette_editor_change_signal(NULL, color_get_index(imgtype, *color));
break;
}
@ -157,12 +157,8 @@ char *ji_color_select(int imgtype, const char *color)
/* check the killer widget */
if (jwindow_get_killer(window) == button_ok) {
/* selected color */
selected_color = jstrdup(color_viewer_get_color(color_viewer));
}
/* cancel or ESC */
else {
/* selected color */
selected_color = NULL;
*color = colorviewer_get_color(colorviewer);
ret = TRUE;
}
/* save window configuration */
@ -170,18 +166,18 @@ char *ji_color_select(int imgtype, const char *color)
jwidget_free(window);
return selected_color;
return ret;
}
static int sliderRGB_change_signal(JWidget widget, int user_data)
{
int imgtype = color_viewer_get_imgtype(color_viewer);
int imgtype = colorviewer_get_imgtype(colorviewer);
int r = jslider_get_value(slider_R);
int g = jslider_get_value(slider_G);
int b = jslider_get_value(slider_B);
int a = jslider_get_value(slider_A);
float h, s, v;
char *color;
color_t color;
rgb_to_hsv(r, g, b, &h, &s, &v);
@ -199,21 +195,19 @@ static int sliderRGB_change_signal(JWidget widget, int user_data)
palette_editor_select_color(palette_editor, -1);
}
color_viewer_set_color(color_viewer, color);
jfree(color);
colorviewer_set_color(colorviewer, color);
return FALSE;
}
static int sliderHSV_change_signal(JWidget widget, int user_data)
{
int imgtype = color_viewer_get_imgtype(color_viewer);
int imgtype = colorviewer_get_imgtype(colorviewer);
int h = jslider_get_value(slider_H);
int s = jslider_get_value(slider_S);
int v = jslider_get_value(slider_V);
int a = jslider_get_value(slider_A);
int r, g, b;
char *color;
color_t color;
hsv_to_rgb(360.0 * h / 255.0, s / 255.0, v / 255.0, &r, &g, &b);
@ -231,22 +225,20 @@ static int sliderHSV_change_signal(JWidget widget, int user_data)
palette_editor_select_color(palette_editor, -1);
}
color_viewer_set_color(color_viewer, color);
jfree(color);
colorviewer_set_color(colorviewer, color);
return FALSE;
}
static int sliderA_change_signal(JWidget widget, int user_data)
{
const char *input_color = color_viewer_get_color(color_viewer);
int imgtype = color_viewer_get_imgtype(color_viewer);
color_t input_color = colorviewer_get_color(colorviewer);
int imgtype = colorviewer_get_imgtype(colorviewer);
int r = color_get_red(imgtype, input_color);
int g = color_get_green(imgtype, input_color);
int b = color_get_blue(imgtype, input_color);
int a = jslider_get_value(slider_A);
int type = color_type(input_color);
char *color = NULL;
color_t color;
switch (type) {
case COLOR_TYPE_MASK:
@ -267,18 +259,14 @@ static int sliderA_change_signal(JWidget widget, int user_data)
break;
}
if (color) {
color_viewer_set_color(color_viewer, color);
jfree(color);
}
colorviewer_set_color(colorviewer, color);
return FALSE;
}
static int color_viewer_select_signal(JWidget widget, int user_data)
static int colorviewer_select_signal(JWidget widget, int user_data)
{
int imgtype = color_viewer_get_imgtype(color_viewer);
char *color = color_mask();
int imgtype = colorviewer_get_imgtype(colorviewer);
color_t color = color_mask();
int r = color_get_red(imgtype, color);
int g = color_get_green(imgtype, color);
int b = color_get_blue(imgtype, color);
@ -286,7 +274,7 @@ static int color_viewer_select_signal(JWidget widget, int user_data)
rgb_to_hsv(r, g, b, &h, &s, &v);
color_viewer_set_color(color_viewer, color);
colorviewer_set_color(colorviewer, color);
jslider_set_value(slider_R, r);
jslider_set_value(slider_G, g);
@ -304,15 +292,14 @@ static int color_viewer_select_signal(JWidget widget, int user_data)
palette_editor_select_color(palette_editor, -1);
}
jfree(color);
return FALSE;
}
static int palette_editor_change_signal(JWidget widget, int user_data)
{
PaletteEditor *paledit = palette_editor_data(palette_editor);
int imgtype = color_viewer_get_imgtype(color_viewer);
char *color = color_index(paledit->color[1]);
int imgtype = colorviewer_get_imgtype(colorviewer);
color_t color = color_index(paledit->color[1]);
int r = color_get_red(imgtype, color);
int g = color_get_green(imgtype, color);
int b = color_get_blue(imgtype, color);
@ -320,7 +307,7 @@ static int palette_editor_change_signal(JWidget widget, int user_data)
rgb_to_hsv(r, g, b, &h, &s, &v);
color_viewer_set_color(color_viewer, color);
colorviewer_set_color(colorviewer, color);
jslider_set_value(slider_R, r);
jslider_set_value(slider_G, g);
@ -329,8 +316,6 @@ static int palette_editor_change_signal(JWidget widget, int user_data)
jslider_set_value(slider_H, 255.0 * h / 360.0);
jslider_set_value(slider_V, 255.0 * v);
jslider_set_value(slider_S, 255.0 * s);
jfree(color);
return FALSE;
}

View File

@ -19,7 +19,9 @@
#ifndef DIALOGS_COLSEL_H
#define DIALOGS_COLSEL_H
char *ji_color_select(int imgtype, const char *color);
#include "modules/color.h"
bool ji_color_select(int imgtype, color_t *color);
#endif /* DIALOGS_COLSEL_H */

View File

@ -1,299 +0,0 @@
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2008 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <allegro.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "jinete/jinete.h"
#include "jinete/jintern.h"
#include "console/console.h"
#include "core/cfg.h"
#include "core/dirs.h"
#include "modules/gui.h"
#include "modules/palette.h"
#include "modules/sprites.h"
#include "raster/image.h"
#include "raster/sprite.h"
#include "script/import.h"
#include "util/mapgen.h"
#include "util/misc.h"
#ifndef M_SQRT2
#define M_SQRT2 1.41421356237309504880
#endif
static JWidget entry_width, entry_height, entry_seed, entry_factor;
static JWidget preview_map, check_preview;
static void regen_map(int forced);
static void random_seed_command(JWidget widget);
static void sqrt2_factor_command(JWidget widget);
static int change_hook(JWidget widget, int user_data);
static JWidget image_viewer_new(Image *image);
static bool image_viewer_msg_proc(JWidget widget, JMessage msg);
void dialogs_mapgen(void)
{
JWidget window, view_map, check_tiled, button_ok;
Sprite *sprite, *old_sprite = current_sprite;
PALETTE old_palette;
RGB *new_palette = NULL;
double factor;
char buf[256];
int w, h, seed;
window = load_widget("mapgen.jid", "mapgen");
if (!window)
return;
if (!get_widgets (window,
"mapview", &view_map,
"width", &entry_width,
"height", &entry_height,
"seed", &entry_seed,
"fractal_factor", &entry_factor,
"preview", &check_preview,
"tiled", &check_tiled,
"button_ok", &button_ok, NULL)) {
jwidget_free(window);
return;
}
/* get current palette */
palette_copy(old_palette, current_palette);
/* load terrain palette */
{
DIRS *dir, *dirs = filename_in_datadir("palettes/terrain1.col");
for (dir=dirs; dir; dir=dir->next) {
new_palette = palette_load(dir->path);
if (new_palette)
break;
}
dirs_free(dirs);
}
sprite = sprite_new_with_layer(IMAGE_INDEXED, 256, 256);
set_current_sprite(sprite);
preview_map = image_viewer_new(GetImage(current_sprite));
/* set palette */
if (new_palette)
sprite_set_palette(sprite, new_palette, 0);
set_current_palette(sprite_get_palette(sprite, 0), FALSE);
jmanager_refresh_screen();
w = get_config_int("MapGen", "Width", 256);
sprintf(buf, "%d", MID(1, w, 9999));
jwidget_set_text(entry_width, buf);
h = get_config_int("MapGen", "Height", 256);
sprintf(buf, "%d", MID(1, h, 9999));
jwidget_set_text(entry_height, buf);
seed = get_config_int("MapGen", "Seed", 662355502);
sprintf(buf, "%d", seed);
jwidget_set_text(entry_seed, buf);
factor = get_config_float("MapGen", "FractalFactor", M_SQRT2);
sprintf(buf, "%.16g", factor);
jwidget_set_text(entry_factor, buf);
if (get_config_bool("MapGen", "Preview", TRUE))
jwidget_select(check_preview);
jwidget_select(check_tiled);
jwidget_disable(check_tiled);
HOOK(check_preview, JI_SIGNAL_CHECK_CHANGE, change_hook, 0);
HOOK(entry_seed, JI_SIGNAL_ENTRY_CHANGE, change_hook, 0);
HOOK(entry_factor, JI_SIGNAL_ENTRY_CHANGE, change_hook, 0);
jbutton_add_command(jwidget_find_name(window, "random_seed"),
random_seed_command);
jbutton_add_command(jwidget_find_name(window, "sqrt2_factor"),
sqrt2_factor_command);
jview_attach(view_map, preview_map);
/* default position */
jwindow_remap(window);
jwindow_center(window);
/* load window configuration */
load_window_pos(window, "MapGen");
/* open the window */
regen_map(FALSE);
jwindow_open_fg(window);
if (jwindow_get_killer(window) == button_ok) {
/* generate the map */
regen_map(TRUE);
/* show the sprite */
sprite_show(sprite);
}
else {
set_current_sprite(old_sprite);
set_current_palette(old_palette, FALSE);
jmanager_refresh_screen();
sprite_free(sprite);
}
/* save window configuration */
save_window_pos(window, "MapGen");
jwidget_free(window);
}
static void regen_map(int forced)
{
int w, h, seed;
double factor;
if (forced || jwidget_is_selected(check_preview)) {
w = strtol(jwidget_get_text(entry_width), NULL, 10);
h = strtol(jwidget_get_text(entry_height), NULL, 10);
seed = strtol(jwidget_get_text(entry_seed), NULL, 10);
factor = strtod(jwidget_get_text(entry_factor), NULL);
if (forced) {
set_config_int("MapGen", "Width", w);
set_config_int("MapGen", "Height", h);
set_config_int("MapGen", "Seed", seed);
set_config_float("MapGen", "FractalFactor", factor);
}
/* generate the map */
mapgen(GetImage(current_sprite), seed, factor);
jwidget_dirty(preview_map);
}
}
static void random_seed_command(JWidget widget)
{
char buf[256];
sprintf(buf, "%d", rand());
jwidget_set_text(entry_seed, buf);
regen_map(FALSE);
}
static void sqrt2_factor_command(JWidget widget)
{
char buf[256];
sprintf(buf, "%.16g", M_SQRT2);
jwidget_set_text(entry_factor, buf);
regen_map(FALSE);
}
static int change_hook(JWidget widget, int user_data)
{
regen_map(FALSE);
return FALSE;
}
/**********************************************************************/
/* image viewer (simple preview) */
static JWidget image_viewer_new(Image *image)
{
JWidget widget = jwidget_new(JI_WIDGET);
jwidget_add_hook(widget, JI_WIDGET, image_viewer_msg_proc, NULL);
widget->user_data[0] = image;
return widget;
}
static bool image_viewer_msg_proc(JWidget widget, JMessage msg)
{
Image *image = widget->user_data[0];
switch (msg->type) {
case JM_REQSIZE:
msg->reqsize.w = image->w;
msg->reqsize.h = image->h;
return TRUE;
case JM_DRAW: {
BITMAP *bmp = create_bitmap(image->w, image->h);
image_to_allegro(image, bmp, 0, 0);
_ji_theme_rectfill_exclude
(ji_screen,
widget->rc->x1, widget->rc->y1,
widget->rc->x2-1, widget->rc->y2-1,
widget->rc->x1, widget->rc->y1,
widget->rc->x1+bmp->w-1,
widget->rc->y1+bmp->h-1, jwidget_get_bg_color(widget));
blit(bmp, ji_screen,
0, 0, widget->rc->x1, widget->rc->y1, bmp->w, bmp->h);
destroy_bitmap(bmp);
return TRUE;
}
case JM_BUTTONPRESSED: {
JWidget view = jwidget_get_view(widget);
if (view) {
jwidget_hard_capture_mouse(widget);
jmouse_set_cursor(JI_CURSOR_MOVE);
return TRUE;
}
break;
}
case JM_MOTION: {
JWidget view = jwidget_get_view(widget);
if (view && jwidget_has_capture(widget)) {
JRect vp = jview_get_viewport_position(view);
int scroll_x, scroll_y;
jview_get_scroll(view, &scroll_x, &scroll_y);
jview_set_scroll(view,
scroll_x + jmouse_x(1) - jmouse_x(0),
scroll_y + jmouse_y(1) - jmouse_y(0));
jmouse_control_infinite_scroll(vp);
jrect_free(vp);
}
break;
}
case JM_BUTTONRELEASED: {
JWidget view = jwidget_get_view(widget);
if (view && jwidget_has_capture(widget)) {
jwidget_release_mouse(widget);
jmouse_set_cursor(JI_CURSOR_NORMAL);
return TRUE;
}
break;
}
}
return FALSE;
}

View File

@ -1,25 +0,0 @@
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2008 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DIALOGS_DMAPGEN_H
#define DIALOGS_DMAPGEN_H
void dialogs_mapgen(void);
#endif /* DIALOGS_DMAPGEN_H */

View File

@ -41,7 +41,7 @@ static PALETTE *palettes;
static JWidget slider_R, slider_G, slider_B;
static JWidget slider_H, slider_S, slider_V;
static JWidget color_viewer;
static JWidget colorviewer;
static JWidget palette_editor;
static JWidget slider_frame;
@ -61,7 +61,7 @@ static void set_new_palette(RGB *palette);
void dialogs_palette_editor(void)
{
JWidget window, color_viewer_box, palette_editor_view;
JWidget window, colorviewer_box, palette_editor_view;
JWidget slider_columns, button_ok;
JWidget button_select_all;
JWidget button_undo, button_redo;
@ -99,7 +99,7 @@ void dialogs_palette_editor(void)
"ramp", &button_ramp,
"quantize", &button_quantize,
"button_ok", &button_ok,
"color_viewer", &color_viewer_box,
"colorviewer", &colorviewer_box,
"palette_editor", &palette_editor_view, NULL)) {
jwidget_free(window);
return;
@ -127,11 +127,11 @@ void dialogs_palette_editor(void)
columns = MID(1, columns, 256);
/* custom widgets */
color_viewer = color_viewer_new("index{0}", IMAGE_INDEXED);
colorviewer = colorviewer_new(color_index(0), IMAGE_INDEXED);
palette_editor = palette_editor_new(palette, TRUE, 6);
jwidget_expansive(color_viewer, TRUE);
jwidget_add_child(color_viewer_box, color_viewer);
jwidget_expansive(colorviewer, TRUE);
jwidget_add_child(colorviewer_box, colorviewer);
jwidget_disable(button_undo);
jwidget_disable(button_redo);
@ -416,8 +416,8 @@ static int slider_frame_change_signal(JWidget widget, int user_data)
static int palette_editor_change_signal(JWidget widget, int user_data)
{
PaletteEditor *paledit = palette_editor_data(palette_editor);
int imgtype = color_viewer_get_imgtype(color_viewer);
char *color = color_index(paledit->color[1]);
int imgtype = colorviewer_get_imgtype(colorviewer);
color_t color = color_index(paledit->color[1]);
int r = color_get_red(imgtype, color);
int g = color_get_green(imgtype, color);
int b = color_get_blue(imgtype, color);
@ -425,7 +425,7 @@ static int palette_editor_change_signal(JWidget widget, int user_data)
rgb_to_hsv(r, g, b, &h, &s, &v);
color_viewer_set_color(color_viewer, color);
colorviewer_set_color(colorviewer, color);
jslider_set_value(slider_R, r);
jslider_set_value(slider_G, g);
@ -433,8 +433,6 @@ static int palette_editor_change_signal(JWidget widget, int user_data)
jslider_set_value(slider_H, 255.0 * h / 360.0);
jslider_set_value(slider_V, 255.0 * v);
jslider_set_value(slider_S, 255.0 * s);
jfree(color);
return FALSE;
}

View File

@ -82,8 +82,8 @@ void dialogs_draw_text(void)
/* color button */
color_but = color_button_new
(get_config_string("DrawText", "Color",
color_bar_get_color(app_get_color_bar(), 0)),
(get_config_color("DrawText", "Color",
colorbar_get_fg_color(app_get_colorbar())),
current_sprite->imgtype);
jwidget_add_child(color_box, color_but);
@ -100,12 +100,12 @@ void dialogs_draw_text(void)
jwindow_open_fg(window);
if (jwindow_get_killer(window) == button_ok) {
color_t color_with_type = color_button_get_color(color_but);
const char *text = jwidget_get_text(entry_text);
const char *color_str = color_button_get_color(color_but);
const char *size_str = jwidget_get_text(entry_size);
const char *font_str = get_config_string("DrawText", "Font",
"allegro.pcx");
int color, rgb_color;
int color;
int size;
FONT *f;
@ -126,11 +126,11 @@ void dialogs_draw_text(void)
ji_font_set_size(f, size);
/* setup color */
color = get_color_for_image(current_sprite->imgtype, color_str);
rgb_color = get_color_for_image(IMAGE_RGB, color_str);
color = get_color_for_image(current_sprite->imgtype,
color_with_type);
/* update configuration */
set_config_string("DrawText", "Color", color_str);
set_config_color("DrawText", "Color", color_with_type);
set_config_string("DrawText", "Text", text);
set_config_int("DrawText", "Size", size);
@ -222,7 +222,7 @@ static Image *render_text(FONT *f, const char *text, int color)
break;
case IMAGE_GRAYSCALE:
DO(ase_uint16, _graya(_graya_getk(color), getg32(c)));
DO(ase_uint16, _graya(_graya_getv(color), getg32(c)));
break;
case IMAGE_INDEXED:

View File

@ -81,6 +81,8 @@ char *ase_file_selector(const char *message,
char *result = NULL;
char *tok;
file_system_refresh();
if (!navigation_history)
navigation_history = jlist_new();

View File

@ -352,7 +352,7 @@ static bool layer_box_msg_proc(JWidget widget, JMessage msg)
return TRUE;
}
case JM_CHAR: {
case JM_KEYPRESSED: {
Command *command = command_get_by_key(msg);
/* close film editor */
@ -666,9 +666,9 @@ static bool cel_box_msg_proc(JWidget widget, JMessage msg)
x2 = x1+THUMBSIZE-1;
y2 = y1+THUMBSIZE-1;
_ji_theme_rectedge(bmp, x1-1, y1-1, x2+1, y2+1,
makecol(128, 128, 128),
makecol(196, 196, 196));
jrectedge(bmp, x1-1, y1-1, x2+1, y2+1,
makecol(128, 128, 128),
makecol(196, 196, 196));
if (thumbnail)
draw_sprite(bmp, thumbnail, x1, y1);

View File

@ -75,8 +75,8 @@ void dialogs_mask_color(void)
box4 = jbox_new(JI_HORIZONTAL | JI_HOMOGENEOUS);
label_color = jlabel_new(_("Color:"));
button_color = color_button_new
(get_config_string("MaskColor", "Color",
color_bar_get_color(app_get_color_bar(), 0)),
(get_config_color("MaskColor", "Color",
colorbar_get_fg_color(app_get_colorbar())),
sprite->imgtype);
button_1 = jbutton_new("1");
button_2 = jbutton_new("2");
@ -103,10 +103,10 @@ void dialogs_mask_color(void)
jwidget_expansive(box2, TRUE);
jwidget_add_child(window, box1);
jwidget_add_childs(box1, box2, box3, check_preview, box4, NULL);
jwidget_add_childs(box2, label_color, button_color, button_1, button_2, NULL);
jwidget_add_childs(box3, label_fuzziness, slider_fuzziness, NULL);
jwidget_add_childs(box4, button_ok, button_cancel, NULL);
jwidget_add_children(box1, box2, box3, check_preview, box4, NULL);
jwidget_add_children(box2, label_color, button_color, button_1, button_2, NULL);
jwidget_add_children(box3, label_fuzziness, slider_fuzziness, NULL);
jwidget_add_children(box4, button_ok, button_cancel, NULL);
/* default position */
jwindow_remap(window);
@ -133,8 +133,8 @@ void dialogs_mask_color(void)
sprite_set_mask(sprite, mask);
mask_free(mask);
set_config_string("MaskColor", "Color",
color_button_get_color(button_color));
set_config_color("MaskColor", "Color",
color_button_get_color(button_color));
set_config_int("MaskColor", "Fuzziness",
jslider_get_value(slider_fuzziness));
@ -156,14 +156,14 @@ void dialogs_mask_color(void)
static void button_1_command(JWidget widget)
{
color_button_set_color(button_color,
color_bar_get_color(app_get_color_bar(), 0));
colorbar_get_fg_color(app_get_colorbar()));
mask_preview();
}
static void button_2_command(JWidget widget)
{
color_button_set_color(button_color,
color_bar_get_color(app_get_color_bar(), 1));
colorbar_get_bg_color(app_get_colorbar()));
mask_preview();
}
@ -188,16 +188,15 @@ static int preview_change_hook(JWidget widget, int user_data)
static Mask *gen_mask(void)
{
int xpos, ypos, color, fuzziness;
const char *color_text;
Sprite *sprite;
Image *image;
Mask *mask;
sprite = current_sprite;
image = GetImage2 (sprite, &xpos, &ypos, NULL);
image = GetImage2(sprite, &xpos, &ypos, NULL);
color_text = color_button_get_color(button_color);
color = get_color_for_image(sprite->imgtype, color_text);
color = get_color_for_image(sprite->imgtype,
color_button_get_color(button_color));
fuzziness = jslider_get_value(slider_fuzziness);
mask = mask_new();

View File

@ -53,20 +53,14 @@ static int paledit_change_signal(JWidget widget, int user_data)
{
if (jmouse_b(0)) {
PaletteEditor *paledit = palette_editor_data(widget);
JWidget color_bar = (JWidget)user_data;
JWidget colorbar = (JWidget)user_data;
if (paledit->color[0] == paledit->color[1]) {
char *color = color_index(paledit->color[1]);
color_bar_set_color(color_bar,
jmouse_b(0) == 1 ? 0: 1,
color, FALSE);
jfree(color);
color_t color = color_index(paledit->color[1]);
colorbar_set_fg_color(colorbar, color);
}
else {
bool array[256];
char buf[256];
int c, sel;
palette_editor_get_selected_entries(widget, array);
@ -74,12 +68,12 @@ static int paledit_change_signal(JWidget widget, int user_data)
if (array[c])
sel++;
color_bar_set_size(color_bar, sel);
colorbar_set_size(colorbar, sel);
for (c=sel=0; c<256; c++) {
if (array[c]) {
sprintf(buf, "index{%d}", c);
color_bar_set_color_directly(color_bar, sel++, buf);
colorbar_set_color(colorbar, sel++,
color_index(c));
}
}
}

View File

@ -95,7 +95,7 @@ static void do_quick(int action)
if (action == ACTION_MOVE) {
int enabled = undo_is_enabled(sprite->undo);
undo_disable(sprite->undo);
ClearMask(color_bar_get_color(app_get_color_bar(), 1));
ClearMask(color_mask());
if (enabled)
undo_enable(sprite->undo);
}

View File

@ -317,7 +317,7 @@ void apply_color_curve2 (Effect *effect)
c = *(src_address++);
k = _graya_getk(c);
k = _graya_getv(c);
a = _graya_geta(c);
if (effect->target.k) k = data.cmap[k];

View File

@ -432,7 +432,7 @@ void apply_convolution_matrix2(Effect *effect)
if (_graya_geta(color) == 0)
div -= *mdata;
else {
k += _graya_getk(color) * (*mdata);
k += _graya_getv(color) * (*mdata);
a += _graya_geta(color) * (*mdata);
}
);
@ -442,7 +442,7 @@ void apply_convolution_matrix2(Effect *effect)
k = MID(0, k, 255);
}
else
k = _graya_getk(color);
k = _graya_getv(color);
if (effect->target.a) {
a = a / matrix->div + matrix->bias;

View File

@ -82,7 +82,7 @@ void apply_invert_color2(Effect *effect)
c = *(src_address++);
k = _graya_getk(c);
k = _graya_getv(c);
a = _graya_geta(c);
if (effect->target.k) k ^= 0xff;

View File

@ -152,7 +152,7 @@ void apply_median2(Effect *effect)
GET_MATRIX_DATA
(ase_uint16, data.w, data.h, data.w/2, data.h/2,
color = *src_address;
data.channel[0][c] = _graya_getk(color);
data.channel[0][c] = _graya_getv(color);
data.channel[1][c] = _graya_geta(color);
c++;
);
@ -165,7 +165,7 @@ void apply_median2(Effect *effect)
if (effect->target.k)
k = data.channel[0][data.ncolors/2];
else
k = _graya_getk(color);
k = _graya_getv(color);
if (effect->target.a)
a = data.channel[1][data.ncolors/2];

View File

@ -90,7 +90,7 @@ void apply_replace_color2(Effect *effect)
src_address = ((ase_uint16 **)effect->src->line)[effect->row+effect->y]+effect->x;
dst_address = ((ase_uint16 **)effect->dst->line)[effect->row+effect->y]+effect->x;
dst_k = _graya_getk(data.from);
dst_k = _graya_getv(data.from);
dst_a = _graya_geta(data.from);
for (x=0; x<effect->w; x++) {
@ -107,7 +107,7 @@ void apply_replace_color2(Effect *effect)
c = *(src_address++);
src_k = _graya_getk(c);
src_k = _graya_getv(c);
src_a = _graya_geta(c);
if ((src_k >= dst_k-data.fuzziness) && (src_k <= dst_k+data.fuzziness) &&

View File

@ -398,7 +398,7 @@ static void ase_file_prepare_header(FILE *f, ASE_Header *header, Sprite *sprite)
header->bgcolor[3] = _rgba_geta(sprite->bgcolor);
break;
case IMAGE_GRAYSCALE:
header->bgcolor[0] = _graya_getk(sprite->bgcolor);
header->bgcolor[0] = _graya_getv(sprite->bgcolor);
header->bgcolor[1] = _graya_geta(sprite->bgcolor);
break;
case IMAGE_INDEXED:
@ -864,7 +864,7 @@ static void ase_file_write_cel_chunk(FILE *f, Cel *cel, Layer *layer, Sprite *sp
for (y=0; y<image->h; y++) {
for (x=0; x<image->w; x++) {
c = image->method->getpixel(image, x, y);
fputc(_graya_getk(c), f);
fputc(_graya_getv(c), f);
fputc(_graya_geta(c), f);
}
}

View File

@ -694,7 +694,7 @@ static bool save_BMP(FileOp *fop)
if (image->imgtype == IMAGE_INDEXED)
fputc(image->method->getpixel(image, j, i), f);
else if (image->imgtype == IMAGE_GRAYSCALE)
fputc(_graya_getk(image->method->getpixel(image, j, i)), f);
fputc(_graya_getv(image->method->getpixel(image, j, i)), f);
}
else {
c = image->method->getpixel(image, j, i);

View File

@ -329,7 +329,7 @@ static bool save_JPEG(FileOp *fop)
src_address = ((ase_uint16 **)image->line)[cinfo.next_scanline+y];
dst_address = ((ase_uint8 **)buffer)[y];
for (x=0; x<image->w; x++)
*(dst_address++) = _graya_getk(*(src_address++));
*(dst_address++) = _graya_getv(*(src_address++));
}
}
jpeg_write_scanlines(&cinfo, buffer, buffer_height);

View File

@ -237,7 +237,7 @@ static bool save_PCX(FileOp *fop)
ch = image->method->getpixel(image, x, y);
else if (image->imgtype == IMAGE_GRAYSCALE) {
c = image->method->getpixel(image, x, y);
ch = _graya_getk(c);
ch = _graya_getv(c);
}
}
else {

View File

@ -441,7 +441,7 @@ static bool save_PNG(FileOp *fop)
for (x=0; x<width; x++) {
c = *(src_address++);
*(dst_address++) = _graya_getk(c);
*(dst_address++) = _graya_getv(c);
*(dst_address++) = _graya_geta(c);
}
}
@ -453,7 +453,7 @@ static bool save_PNG(FileOp *fop)
for (x=0; x<width; x++) {
c = *(src_address++);
*(dst_address++) = _graya_getk(c);
*(dst_address++) = _graya_getv(c);
}
}
/* PALETTE */

View File

@ -457,7 +457,7 @@ static bool save_TGA(FileOp *fop)
case IMAGE_GRAYSCALE:
for (y=image->h-1; y>=0; y--) {
for (x=0; x<image->w; x++)
fputc(_graya_getk(image_getpixel(image, x, y)), f);
fputc(_graya_getv(image_getpixel(image, x, y)), f);
fop_progress(fop, (float)(image->h-y) / (float)(image->h));
}

View File

@ -87,31 +87,30 @@ struct jtheme;
struct jwidget;
/* alignment */
#define JI_HORIZONTAL 1
#define JI_VERTICAL 2
#define JI_LEFT 4
#define JI_CENTER 8
#define JI_RIGHT 16
#define JI_TOP 32
#define JI_MIDDLE 64
#define JI_BOTTOM 128
#define JI_HOMOGENEOUS 256
#define JI_WORDWRAP 512
#define JI_HORIZONTAL 0x0001
#define JI_VERTICAL 0x0002
#define JI_LEFT 0x0004
#define JI_CENTER 0x0008
#define JI_RIGHT 0x0010
#define JI_TOP 0x0020
#define JI_MIDDLE 0x0040
#define JI_BOTTOM 0x0080
#define JI_HOMOGENEOUS 0x0100
#define JI_WORDWRAP 0x0200
/* widget flags */
/* #define JI_DIRTY 0x000001 /\* need be redraw *\/ */
#define JI_HIDDEN 0x000002 /* is hidden (not visible, not clickeable) */
#define JI_SELECTED 0x000004 /* is selected */
#define JI_DISABLED 0x000008 /* is disabled (not usable) */
#define JI_HASFOCUS 0x000010 /* has the input focus */
#define JI_HASMOUSE 0x000020 /* has the mouse */
#define JI_HASCAPTURE 0x000040 /* captured the mouse */
#define JI_FOCUSREST 0x000080 /* want the focus (is a rest for focus) */
#define JI_MAGNETIC 0x000100 /* attract the focus */
#define JI_EXPANSIVE 0x000200 /* is expansive (want more space) */
#define JI_DECORATIVE 0x000400 /* to decorate windows */
#define JI_HARDCAPTURE 0x000800 /* only windows use hard capture */
#define JI_INITIALIZED 0x001000 /* the widget was already initialized by a theme */
#define JI_HIDDEN 0x0001 /* is hidden (not visible, not clickeable) */
#define JI_SELECTED 0x0002 /* is selected */
#define JI_DISABLED 0x0004 /* is disabled (not usable) */
#define JI_HASFOCUS 0x0008 /* has the input focus */
#define JI_HASMOUSE 0x0010 /* has the mouse */
#define JI_HASCAPTURE 0x0020 /* captured the mouse */
#define JI_FOCUSREST 0x0040 /* want the focus (is a rest for focus) */
#define JI_MAGNETIC 0x0080 /* attract the focus */
#define JI_EXPANSIVE 0x0100 /* is expansive (want more space) */
#define JI_DECORATIVE 0x0200 /* to decorate windows */
#define JI_HARDCAPTURE 0x0400 /* only windows use hard capture */
#define JI_INITIALIZED 0x0800 /* the widget was already initialized by a theme */
/* widget types */
enum {
@ -124,6 +123,7 @@ enum {
JI_CHECK,
JI_COMBOBOX,
JI_ENTRY,
JI_GRID,
JI_IMAGE,
JI_LABEL,
JI_LISTBOX,
@ -167,7 +167,6 @@ enum {
the last message in the queue */
/* keyboard related messages */
JM_CHAR, /* a new character in the buffer */
JM_KEYPRESSED, /* when a any key is pressed */
JM_KEYRELEASED, /* when a any key is released */
JM_FOCUSENTER, /* widget gets the focus */
@ -180,6 +179,7 @@ enum {
JM_MOUSEENTER, /* a widget gets mouse pointer */
JM_MOUSELEAVE, /* a widget losts mouse pointer */
JM_MOTION, /* user moves the mouse on some widget */
JM_SETCURSOR, /* a widget needs to setup the mouse cursor */
JM_WHEEL, /* user moves the wheel */
/* XXX drag'n'drop operation? */
@ -192,7 +192,6 @@ enum {
/* signals */
enum {
/* generic signals */
JI_SIGNAL_DIRTY,
JI_SIGNAL_ENABLE,
JI_SIGNAL_DISABLE,
JI_SIGNAL_SELECT,
@ -204,6 +203,7 @@ enum {
JI_SIGNAL_NEW_PARENT,
JI_SIGNAL_GET_TEXT,
JI_SIGNAL_SET_TEXT,
JI_SIGNAL_SET_FONT,
JI_SIGNAL_INIT_THEME,
/* special widget signals */
@ -252,7 +252,7 @@ typedef struct jxmlelem *JXmlElem;
typedef struct jxmltext *JXmlText;
typedef bool (*JMessageFunc) (JWidget widget, JMessage msg);
typedef void (*JDrawFunc) (JWidget widget);
typedef void (*JDrawFunc) (JWidget widget, JRect clip);
/* without leak detection */
void *jmalloc (unsigned long n_bytes);

Some files were not shown because too many files have changed in this diff Show More