mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 13:09:27 +00:00
Fixed file_size_ex and outportw usage in Linux.
This commit is contained in:
parent
0abb4c9033
commit
2aea148245
@ -12,7 +12,7 @@
|
|||||||
</box>
|
</box>
|
||||||
<box vertical homogeneous expansive>
|
<box vertical homogeneous expansive>
|
||||||
<label text="" name="frame" />
|
<label text="" name="frame" />
|
||||||
<entry maxsize=32 name="frlen" />
|
<entry maxsize=32 name="frlen" magnetic />
|
||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
<box horizontal homogeneous>
|
<box horizontal homogeneous>
|
||||||
|
@ -108,9 +108,9 @@ static char *read_authors_txt(const char *filename)
|
|||||||
int size;
|
int size;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||||
ALLEGRO_SUB_VERSION, \
|
ALLEGRO_SUB_VERSION, \
|
||||||
ALLEGRO_WIP_VERSION))
|
ALLEGRO_WIP_VERSION))
|
||||||
size = file_size(dir->path);
|
size = file_size(dir->path);
|
||||||
#else
|
#else
|
||||||
size = file_size_ex(dir->path);
|
size = file_size_ex(dir->path);
|
||||||
|
@ -456,9 +456,9 @@ static void load_config_file(CONFIG **config, AL_CONST char *filename, AL_CONST
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||||
ALLEGRO_SUB_VERSION, \
|
ALLEGRO_SUB_VERSION, \
|
||||||
ALLEGRO_WIP_VERSION))
|
ALLEGRO_WIP_VERSION))
|
||||||
length = file_size(filename);
|
length = file_size(filename);
|
||||||
#else
|
#else
|
||||||
length = file_size_ex(filename);
|
length = file_size_ex(filename);
|
||||||
|
@ -392,9 +392,9 @@ gif_load_animation (const char *filename, void (*progress) (int))
|
|||||||
{
|
{
|
||||||
PACKFILE *file;
|
PACKFILE *file;
|
||||||
GIF_ANIMATION *gif = NULL;
|
GIF_ANIMATION *gif = NULL;
|
||||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||||
ALLEGRO_SUB_VERSION, \
|
ALLEGRO_SUB_VERSION, \
|
||||||
ALLEGRO_WIP_VERSION))
|
ALLEGRO_WIP_VERSION))
|
||||||
int size = file_size(filename);
|
int size = file_size(filename);
|
||||||
#else
|
#else
|
||||||
int size = file_size_ex(filename);
|
int size = file_size_ex(filename);
|
||||||
|
@ -61,13 +61,19 @@
|
|||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
|
#ifdef ALLEGRO_WINDOWS
|
||||||
|
# define DEF_SCALE 2
|
||||||
|
#else
|
||||||
|
# define DEF_SCALE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int scale;
|
int scale;
|
||||||
} try_resolutions[] = { { 1024, 768, 2 },
|
} try_resolutions[] = { { 1024, 768, DEF_SCALE },
|
||||||
{ 800, 600, 2 },
|
{ 800, 600, DEF_SCALE },
|
||||||
{ 640, 480, 2 },
|
{ 640, 480, DEF_SCALE },
|
||||||
{ 320, 240, 1 },
|
{ 320, 240, 1 },
|
||||||
{ 320, 200, 1 },
|
{ 320, 200, 1 },
|
||||||
{ 0, 0, 0 } };
|
{ 0, 0, 0 } };
|
||||||
|
@ -263,7 +263,7 @@ static void bitmap_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
color[0] = makecol8 (0, 0, 0);
|
color[0] = makecol8 (0, 0, 0);
|
||||||
color[1] = makecol8 (255, 255, 255);
|
color[1] = makecol8 (255, 255, 255);
|
||||||
|
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
if (is_planar_bitmap (bmp)) {
|
if (is_planar_bitmap (bmp)) {
|
||||||
for (y=0; y<image->h; y++) {
|
for (y=0; y<image->h; y++) {
|
||||||
address = LINES(image)[y];
|
address = LINES(image)[y];
|
||||||
@ -294,7 +294,7 @@ static void bitmap_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
|
|
||||||
_y++;
|
_y++;
|
||||||
}
|
}
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -216,7 +216,7 @@ static void grayscale_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y
|
|||||||
switch (depth) {
|
switch (depth) {
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
if (is_planar_bitmap(bmp)) {
|
if (is_planar_bitmap(bmp)) {
|
||||||
for (y=0; y<image->h; y++) {
|
for (y=0; y<image->h; y++) {
|
||||||
bmp_address = (unsigned long)bmp->line[_y];
|
bmp_address = (unsigned long)bmp->line[_y];
|
||||||
@ -244,7 +244,7 @@ static void grayscale_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y
|
|||||||
|
|
||||||
_y++;
|
_y++;
|
||||||
}
|
}
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -228,7 +228,7 @@ static void indexed_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
switch (depth) {
|
switch (depth) {
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
if (is_planar_bitmap (bmp)) {
|
if (is_planar_bitmap (bmp)) {
|
||||||
for (y=0; y<image->h; y++) {
|
for (y=0; y<image->h; y++) {
|
||||||
bmp_address = (unsigned long)bmp->line[_y];
|
bmp_address = (unsigned long)bmp->line[_y];
|
||||||
@ -255,7 +255,7 @@ static void indexed_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
|
|
||||||
_y++;
|
_y++;
|
||||||
}
|
}
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -216,7 +216,7 @@ static void rgb_to_allegro (const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
switch (depth) {
|
switch (depth) {
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
if (is_planar_bitmap (bmp)) {
|
if (is_planar_bitmap (bmp)) {
|
||||||
for (y=0; y<image->h; y++) {
|
for (y=0; y<image->h; y++) {
|
||||||
bmp_address = (unsigned long)bmp->line[_y];
|
bmp_address = (unsigned long)bmp->line[_y];
|
||||||
@ -249,7 +249,7 @@ static void rgb_to_allegro (const Image *image, BITMAP *bmp, int _x, int _y)
|
|||||||
|
|
||||||
_y++;
|
_y++;
|
||||||
}
|
}
|
||||||
#ifdef GFX_MODEX
|
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
/* loads a COL file (Animator and Animator Pro format) */
|
/* loads a COL file (Animator and Animator Pro format) */
|
||||||
RGB *load_col_file(const char *filename)
|
RGB *load_col_file(const char *filename)
|
||||||
{
|
{
|
||||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||||
ALLEGRO_SUB_VERSION, \
|
ALLEGRO_SUB_VERSION, \
|
||||||
ALLEGRO_WIP_VERSION))
|
ALLEGRO_WIP_VERSION))
|
||||||
int size = file_size(filename);
|
int size = file_size(filename);
|
||||||
#else
|
#else
|
||||||
int size = file_size_ex(filename);
|
int size = file_size_ex(filename);
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
/* loads a MSK file (Animator and Animator Pro format) */
|
/* loads a MSK file (Animator and Animator Pro format) */
|
||||||
Mask *load_msk_file(const char *filename)
|
Mask *load_msk_file(const char *filename)
|
||||||
{
|
{
|
||||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||||
ALLEGRO_SUB_VERSION, \
|
ALLEGRO_SUB_VERSION, \
|
||||||
ALLEGRO_WIP_VERSION))
|
ALLEGRO_WIP_VERSION))
|
||||||
int orig_size = file_size(filename);
|
int orig_size = file_size(filename);
|
||||||
#else
|
#else
|
||||||
int orig_size = file_size_ex(filename);
|
int orig_size = file_size_ex(filename);
|
||||||
|
@ -400,6 +400,8 @@ void editor_draw_sprite(JWidget widget, int x1, int y1, int x2, int y2)
|
|||||||
destroy_bitmap(bmp);
|
destroy_bitmap(bmp);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
acquire_bitmap(ji_screen);
|
||||||
|
|
||||||
use_current_sprite_rgb_map();
|
use_current_sprite_rgb_map();
|
||||||
if (bitmap_color_depth(screen) == 8) {
|
if (bitmap_color_depth(screen) == 8) {
|
||||||
image_to_allegro(rendered, ji_screen, dest_x, dest_y);
|
image_to_allegro(rendered, ji_screen, dest_x, dest_y);
|
||||||
@ -412,6 +414,8 @@ void editor_draw_sprite(JWidget widget, int x1, int y1, int x2, int y2)
|
|||||||
}
|
}
|
||||||
restore_rgb_map();
|
restore_rgb_map();
|
||||||
|
|
||||||
|
release_bitmap(ji_screen);
|
||||||
|
|
||||||
image_free(rendered);
|
image_free(rendered);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user