unpack zips in src to better compression
This commit is contained in:
BIN
sources/z-tools/trunk/zcodeclib/exemple/8.gif
Normal file
BIN
sources/z-tools/trunk/zcodeclib/exemple/8.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
BIN
sources/z-tools/trunk/zcodeclib/exemple/exemple.app
Normal file
BIN
sources/z-tools/trunk/zcodeclib/exemple/exemple.app
Normal file
Binary file not shown.
89
sources/z-tools/trunk/zcodeclib/exemple/main.c
Normal file
89
sources/z-tools/trunk/zcodeclib/exemple/main.c
Normal file
@@ -0,0 +1,89 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <osbind.h>
|
||||
#include <mintbind.h>
|
||||
#include <gem.h>
|
||||
#include <ldg.h>
|
||||
#include <types2b.h>
|
||||
#include <zcodec.h>
|
||||
|
||||
|
||||
int main( int argc, char *argv[])
|
||||
{
|
||||
IMAGE *test_img = NULL;
|
||||
MFDB *resize = NULL, screen = {0};
|
||||
int16 xy[8];
|
||||
|
||||
/* We load the wanted codecs but if we want to
|
||||
load the entire codecs's pack, we can do "codecs_init( "all"); */
|
||||
if( !codecs_init( "gif.ldg"))
|
||||
Cconws("can't init the codec \n\r");
|
||||
|
||||
if ( argc > 1)
|
||||
{ /* we load the dragged picture, we put - 1 to both w and h options because we don't want zoom */
|
||||
if( ! (test_img = load_img( argv[argc - 1], -1, -1, 0)))
|
||||
{
|
||||
Cconws("can't load image \n\r");
|
||||
codecs_quit();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Cconws("Drag and Drop a gif image\n\r");
|
||||
codecs_quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
xy[0] = 0;
|
||||
xy[1] = 0;
|
||||
xy[2] = test_img->image[0].fd_w - 1;
|
||||
xy[3] = test_img->image[0].fd_h - 1;
|
||||
xy[4] = 20;
|
||||
xy[5] = 20;
|
||||
xy[6] = xy[4] + xy[2];
|
||||
xy[7] = xy[5] + xy[3];
|
||||
|
||||
if ( test_img->image[0].fd_nplanes == 1)
|
||||
{
|
||||
int16 color[2] = { 0, 1};
|
||||
|
||||
vrt_cpyfm( vdi_handle, MD_REPLACE, xy, &test_img->image[0], &screen, color);
|
||||
}
|
||||
else
|
||||
vro_cpyfm( vdi_handle, S_ONLY, xy, &test_img->image[0], &screen);
|
||||
|
||||
if( !( resize = pic_resize( &test_img->image[0],64, 64, 1)))
|
||||
{
|
||||
Cconws("can't resize image \n\r");
|
||||
delete_img( test_img);
|
||||
codecs_quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
xy[0] = 0;
|
||||
xy[1] = 0;
|
||||
xy[2] = resize->fd_w - 1;
|
||||
xy[3] = resize->fd_h - 1;
|
||||
xy[4] = 20 + test_img->image[0].fd_w - 1;
|
||||
xy[5] = 20;
|
||||
xy[6] = xy[4] + xy[2];
|
||||
xy[7] = xy[5] + xy[3];
|
||||
|
||||
/* draw the image */
|
||||
if ( resize->fd_nplanes == 1)
|
||||
{
|
||||
int16 color[2] = { 0, 1};
|
||||
|
||||
vrt_cpyfm( vdi_handle, MD_REPLACE, xy, resize, &screen, color);
|
||||
}
|
||||
else
|
||||
vro_cpyfm( vdi_handle, S_ONLY, xy, resize, &screen);
|
||||
|
||||
|
||||
delete_mfdb( resize, 1);
|
||||
delete_img( test_img);
|
||||
codecs_quit();
|
||||
return 0;
|
||||
}
|
||||
41
sources/z-tools/trunk/zcodeclib/exemple/makefile
Normal file
41
sources/z-tools/trunk/zcodeclib/exemple/makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
ifeq ($(CROSS),yes)
|
||||
AS = m68k-atari-mint-as
|
||||
CC = m68k-atari-mint-gcc
|
||||
STACK = m68k-atari-mint-stack
|
||||
INCLUDE_PATH = /home/zorro/cross-tools/include
|
||||
LIB_PATH = /home/zorro/cross-tools/lib
|
||||
else
|
||||
AS = as
|
||||
CC = gcc
|
||||
STACK = stack
|
||||
INCLUDE_PATH = /usr/GEM/include
|
||||
LIB_PATH = /usr/GEM/lib
|
||||
endif
|
||||
|
||||
STACKSIZE = 128k
|
||||
COMPRESS = upx
|
||||
OPTIMISATION = -O2 -fomit-frame-pointer -finline-functions
|
||||
CPU = -m68020-60
|
||||
LIB = -lzcodec -lgem -lldg
|
||||
|
||||
CFLAGS = $(CPU) $(OPTIMISATION) -Wall -I$(INCLUDE_PATH)
|
||||
|
||||
OBJ = main.o
|
||||
|
||||
PROGRAM = exemple.app
|
||||
|
||||
|
||||
all: $(PROGRAM) stack #compress
|
||||
|
||||
$(PROGRAM): $(OBJ)
|
||||
$(CC) -o$@ $(OBJ) -Xlinker -s -L$(LIB_PATH) $(LIB)
|
||||
|
||||
stack:
|
||||
$(STACK) -S $(STACKSIZE) $(PROGRAM)
|
||||
|
||||
compress:
|
||||
$(COMPRESS) $(PROGRAM)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
|
||||
Reference in New Issue
Block a user