mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-15 19:52:05 +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 vertical homogeneous expansive>
|
||||
<label text="" name="frame" />
|
||||
<entry maxsize=32 name="frlen" />
|
||||
<entry maxsize=32 name="frlen" magnetic />
|
||||
</box>
|
||||
</box>
|
||||
<box horizontal homogeneous>
|
||||
|
@ -108,9 +108,9 @@ static char *read_authors_txt(const char *filename)
|
||||
int size;
|
||||
FILE *f;
|
||||
|
||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
size = file_size(dir->path);
|
||||
#else
|
||||
size = file_size_ex(dir->path);
|
||||
|
@ -456,9 +456,9 @@ static void load_config_file(CONFIG **config, AL_CONST char *filename, AL_CONST
|
||||
return;
|
||||
}
|
||||
|
||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
length = file_size(filename);
|
||||
#else
|
||||
length = file_size_ex(filename);
|
||||
|
@ -392,9 +392,9 @@ gif_load_animation (const char *filename, void (*progress) (int))
|
||||
{
|
||||
PACKFILE *file;
|
||||
GIF_ANIMATION *gif = NULL;
|
||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
int size = file_size(filename);
|
||||
#else
|
||||
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 {
|
||||
int width;
|
||||
int height;
|
||||
int scale;
|
||||
} try_resolutions[] = { { 1024, 768, 2 },
|
||||
{ 800, 600, 2 },
|
||||
{ 640, 480, 2 },
|
||||
} try_resolutions[] = { { 1024, 768, DEF_SCALE },
|
||||
{ 800, 600, DEF_SCALE },
|
||||
{ 640, 480, DEF_SCALE },
|
||||
{ 320, 240, 1 },
|
||||
{ 320, 200, 1 },
|
||||
{ 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[1] = makecol8 (255, 255, 255);
|
||||
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
if (is_planar_bitmap (bmp)) {
|
||||
for (y=0; y<image->h; y++) {
|
||||
address = LINES(image)[y];
|
||||
@ -294,7 +294,7 @@ static void bitmap_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
||||
|
||||
_y++;
|
||||
}
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -216,7 +216,7 @@ static void grayscale_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y
|
||||
switch (depth) {
|
||||
|
||||
case 8:
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
if (is_planar_bitmap(bmp)) {
|
||||
for (y=0; y<image->h; 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++;
|
||||
}
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -228,7 +228,7 @@ static void indexed_to_allegro(const Image *image, BITMAP *bmp, int _x, int _y)
|
||||
switch (depth) {
|
||||
|
||||
case 8:
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
if (is_planar_bitmap (bmp)) {
|
||||
for (y=0; y<image->h; 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++;
|
||||
}
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -216,7 +216,7 @@ static void rgb_to_allegro (const Image *image, BITMAP *bmp, int _x, int _y)
|
||||
switch (depth) {
|
||||
|
||||
case 8:
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
if (is_planar_bitmap (bmp)) {
|
||||
for (y=0; y<image->h; 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++;
|
||||
}
|
||||
#ifdef GFX_MODEX
|
||||
#if defined GFX_MODEX && !defined ALLEGRO_UNIX
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -29,9 +29,9 @@
|
||||
/* loads a COL file (Animator and Animator Pro format) */
|
||||
RGB *load_col_file(const char *filename)
|
||||
{
|
||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
int size = file_size(filename);
|
||||
#else
|
||||
int size = file_size_ex(filename);
|
||||
|
@ -31,9 +31,9 @@
|
||||
/* loads a MSK file (Animator and Animator Pro format) */
|
||||
Mask *load_msk_file(const char *filename)
|
||||
{
|
||||
#if (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
|
||||
ALLEGRO_SUB_VERSION, \
|
||||
ALLEGRO_WIP_VERSION))
|
||||
int orig_size = file_size(filename);
|
||||
#else
|
||||
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);
|
||||
#else
|
||||
|
||||
acquire_bitmap(ji_screen);
|
||||
|
||||
use_current_sprite_rgb_map();
|
||||
if (bitmap_color_depth(screen) == 8) {
|
||||
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();
|
||||
|
||||
release_bitmap(ji_screen);
|
||||
|
||||
image_free(rendered);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user