From ca2db752f04229742f868ee6ccb901a1c98cd78a Mon Sep 17 00:00:00 2001 From: Scott McCreary Date: Wed, 15 Oct 2008 23:18:02 +0000 Subject: [PATCH] Applied Kaliber's combined HaikuPorts and HaikuHacks patch to Allegro-4.3.10plus SVN and had to fix 3 files, this patch includes those fixes as well. Still some more work to do to get Allegro-4.3.10plus SVN working on Haiku. --- .../allegro/allegro-4.3.10plus-haiku.diff | 2443 +++++++++++++++++ 1 file changed, 2443 insertions(+) create mode 100644 media-libs/allegro/allegro-4.3.10plus-haiku.diff diff --git a/media-libs/allegro/allegro-4.3.10plus-haiku.diff b/media-libs/allegro/allegro-4.3.10plus-haiku.diff new file mode 100644 index 000000000..aaa774564 --- /dev/null +++ b/media-libs/allegro/allegro-4.3.10plus-haiku.diff @@ -0,0 +1,2443 @@ +diff -urN allegro-4.3.10plus/addons/allegrogl/fix.sh allegro-4.3.10plus-haiku/addons/allegrogl/fix.sh +--- allegro-4.3.10plus/addons/allegrogl/fix.sh 2008-10-15 14:42:13.000000000 +0000 ++++ allegro-4.3.10plus-haiku/addons/allegrogl/fix.sh 2008-10-15 15:04:09.000000000 +0000 +@@ -27,7 +27,7 @@ + echo " Usage: fix [--dtou|--utod|--quick]" + echo "" + echo " is one of: djgpp, mingw32, unix, macosx," +- echo " macosx-universal" ++ echo " macosx-universal, beos, haiku" + echo "" + echo " --dtou converts from DOS/Win32 format to Unix" + echo " --utod converts from Unix format to DOS/Win32" +@@ -81,6 +81,7 @@ + + case "$1" in + djgpp ) proc_fix "DJGPP" "makefile.dj";; ++ haiku ) proc_fix "Haiku" "makefile.gen";; + mingw ) proc_fix "Mingw32" "makefile.mgw";; + mingw32 ) proc_fix "Mingw32" "makefile.mgw";; + # used only by allegro's zipup.sh in packaging process +diff -urN allegro-4.3.10plus/addons/jpgalleg/fix.sh allegro-4.3.10plus-haiku/addons/jpgalleg/fix.sh +--- allegro-4.3.10plus/addons/jpgalleg/fix.sh 2008-10-15 14:40:17.000000000 +0000 ++++ allegro-4.3.10plus-haiku/addons/jpgalleg/fix.sh 2008-10-15 15:01:00.000000000 +0000 +@@ -85,6 +85,7 @@ + "mingw" ) proc_fix "MinGW32" "makefile.mgw";; + "msvc" ) proc_fix "MSVC" "makefile.vc";; + "beos" ) proc_fix "BeOS" "makefile.be";; ++ "haiku" ) proc_fix "Haiku" "makefile.be";; + "unix" ) proc_fix "Unix" "makefile.uni";; + "macosx" ) proc_fix "MacOS X" "makefile.osx";; + "macosx-universal" ) proc_fix_osx_ub ;; +diff -urN allegro-4.3.10plus/addons/jpgalleg/fix.sh~ allegro-4.3.10plus-haiku/addons/jpgalleg/fix.sh~ +--- allegro-4.3.10plus/addons/jpgalleg/fix.sh~ 1970-01-01 00:00:00.000000000 +0000 ++++ allegro-4.3.10plus-haiku/addons/jpgalleg/fix.sh~ 2008-10-15 14:40:17.000000000 +0000 +@@ -0,0 +1,106 @@ ++#!/bin/sh ++# ++# Converts line breaks to Unix format and configures JPGalleg to be built ++# under specified platform. Derived from the Allegro version of this same ++# script. ++ ++proc_help() ++{ ++ echo ++ echo "Usage: ./fix.sh [--quick|--dtou|--utod]" ++ echo ++ echo "Where platform is one of: djgpp, mingw32, msvc, beos, unix, macosx," ++ echo "macosx-universal" ++ echo "The --quick parameter turns off text file conversion, --dtou converts from" ++ echo "DOS/Win32 format to Unix and --utod converts from Unix to DOS/Win32 format." ++ echo "If no parameter is specified --dtou is assumed." ++ echo ++ ++ NOCONV="1" ++} ++ ++proc_fix() ++{ ++ echo "Configuring JPGalleg for $1..." ++ ++ echo "# generated by fix.sh" > makefile ++ echo "MAKEFILE_INC = $2" >> makefile ++ echo "include makefile.all" >> makefile ++} ++ ++proc_fix_osx_ub() ++{ ++ echo "Configuring JPGalleg for Mac OSX Universal Binary ..." ++ ++ echo "# generated by fix.sh" > makefile ++ echo "UB = 1" >> makefile ++ echo "MAKEFILE_INC = makefile.osx" >> makefile ++ echo "include makefile.all" >> makefile ++} ++ ++proc_filelist() ++{ ++ # common files. ++ FILELIST=`find . -type f -not -path "*.svn*" "(" \ ++ -name "*.c" -o -name "*.h" -o -name "*.s" -o -name "*.txt" -o \ ++ -name "*.inc" -o -name "*.scm" -o -name "*.scr" -o -name "*.scu" -o \ ++ -name "makefile*" \ ++ ")"` ++ ++ # touch unix shell scripts? ++ if [ "$1" != "omit_sh" ]; then ++ FILELIST="$FILELIST `find . -type f -name '*.sh'`" ++ fi ++ ++ # touch DOS batch files? ++ if [ "$1" != "omit_bat" ]; then ++ FILELIST="$FILELIST `find . -type f -name '*.bat'`" ++ fi ++} ++ ++proc_utod() ++{ ++ echo "Converting files from Unix to DOS/Win32..." ++ proc_filelist "omit_sh" ++ /bin/sh ../../misc/utod.sh $FILELIST ++} ++ ++proc_dtou() ++{ ++ echo "Converting files from DOS/Win32 to Unix..." ++ proc_filelist "omit_bat" ++ /bin/sh ../../misc/dtou.sh $FILELIST ++} ++ ++# prepare JPGalleg for the given platform. ++ ++if [ -z "$1" ]; then ++ proc_help ++ exit 0 ++fi ++ ++case "$1" in ++ "djgpp" ) proc_fix "DJGPP" "makefile.dj";; ++ "mingw32" ) proc_fix "MinGW32" "makefile.mgw";; ++ "mingw" ) proc_fix "MinGW32" "makefile.mgw";; ++ "msvc" ) proc_fix "MSVC" "makefile.vc";; ++ "beos" ) proc_fix "BeOS" "makefile.be";; ++ "unix" ) proc_fix "Unix" "makefile.uni";; ++ "macosx" ) proc_fix "MacOS X" "makefile.osx";; ++ "macosx-universal" ) proc_fix_osx_ub ;; ++ "help" ) proc_help; exit 0;; ++ * ) echo "Platform not supported by JPGalleg."; exit 0;; ++esac ++ ++# convert all text-file line endings. ++ ++if [ "$NOCONV" != "1" ]; then ++ case "$2" in ++ "--utod" ) proc_utod "$1";; ++ "--dtou" ) proc_dtou "$1";; ++ esac ++fi ++ ++# set execute permissions just in case. ++ ++chmod +x *.sh misc/*.sh +diff -urN allegro-4.3.10plus/addons/loadpng/fix.sh allegro-4.3.10plus-haiku/addons/loadpng/fix.sh +--- allegro-4.3.10plus/addons/loadpng/fix.sh 2008-10-15 14:39:18.000000000 +0000 ++++ allegro-4.3.10plus-haiku/addons/loadpng/fix.sh 2008-10-15 15:04:58.000000000 +0000 +@@ -8,7 +8,7 @@ + echo + echo "Usage: $0 [--quick|--dtou|--utod]" + echo +- echo "Where platform is one of: djgpp, mingw32, unix, macosx, macosx-universal" ++ echo "Where platform is one of: djgpp, mingw32, unix, macosx, macosx-universal, beos, haiku" + echo "The --quick parameter turns off text file conversion, --dtou converts from" + echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format." + echo "If no parameter is specified --quick is assumed." +@@ -88,7 +88,9 @@ + fi + + case "$1" in ++ "beos" ) proc_fix "BeOS" "Makefile.be";; + "djgpp" ) proc_fix "DOS (djgpp)" "Makefile.dj";; ++ "haiku" ) proc_fix "Haiku" "Makefile.be";; + "mingw" ) proc_fix "Windows (MinGW)" "Makefile.mgw";; + "mingw32" ) proc_fix "Windows (MinGW)" "Makefile.mgw";; + "unix" ) proc_fix "Unix" "Makefile.unx";; +diff -urN allegro-4.3.10plus/addons/logg/fix.sh allegro-4.3.10plus-haiku/addons/logg/fix.sh +--- allegro-4.3.10plus/addons/logg/fix.sh 2008-10-15 14:42:14.000000000 +0000 ++++ allegro-4.3.10plus-haiku/addons/logg/fix.sh 2008-10-15 15:07:15.000000000 +0000 +@@ -8,7 +8,8 @@ + echo + echo "Usage: $0 [--quick|--dtou|--utod]" + echo +- echo "Where platform is one of: mingw32, unix, macosx, macosx-universal" ++ echo "Where platform is one of: mingw32, unix, macosx, macosx-universal," ++ echo " beos, haiku" + echo "The --quick parameter turns off text file conversion, --dtou converts from" + echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format." + echo "If no parameter is specified --quick is assumed." +@@ -80,6 +81,8 @@ + fi + + case "$1" in ++ "beos" ) proc_fix "BeOS" "Makefile.be";; ++ "haiku" ) proc_fix "Haiku" "Makefile.be";; + "mingw" ) proc_fix "Windows (MinGW)" "Makefile.migw";; + "mingw32" ) proc_fix "Windows (MinGW)" "Makefile.migw";; + "unix" ) proc_fix "Unix" "Makefile.unix";; +diff -urN allegro-4.3.10plus/fix.sh allegro-4.3.10plus-haiku/fix.sh +--- allegro-4.3.10plus/fix.sh 2008-10-15 14:44:47.000000000 +0000 ++++ allegro-4.3.10plus-haiku/fix.sh 2008-10-15 15:01:00.000000000 +0000 +@@ -9,7 +9,7 @@ + echo + echo "Usage: $0 [--quick|--dtou|--utod]" + echo +- echo "Where platform is one of: bcc32, beos, djgpp, mingw, qnx, unix" ++ echo "Where platform is one of: bcc32, beos, djgpp, haiku, mingw, qnx, unix" + echo "mac, macosx, macosx-universal and watcom." + echo "The --quick parameter turns off text file conversion, --dtou converts from" + echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format." +@@ -90,6 +90,7 @@ + "bcc32" ) proc_fix "Windows (BCC32)" "makefile.bcc" "ALLEGRO_BCC32";; + "beos" ) proc_fix "BeOS" "makefile.be" "ALLEGRO_BEOS";; + "djgpp" ) proc_fix "DOS (djgpp)" "makefile.dj" "ALLEGRO_DJGPP";; ++ "haiku" ) proc_fix "Haiku" "makefile.be" "ALLEGRO_HAIKU";; + "mingw" ) proc_fix "Windows (MinGW)" "makefile.mgw" "ALLEGRO_MINGW32";; + "mingw32" ) proc_fix "Windows (MinGW)" "makefile.mgw" "ALLEGRO_MINGW32";; + # The 'msvc' target is undocumented in the help message, but is used +diff -urN allegro-4.3.10plus/fix.sh~ allegro-4.3.10plus-haiku/fix.sh~ +--- allegro-4.3.10plus/fix.sh~ 1970-01-01 00:00:00.000000000 +0000 ++++ allegro-4.3.10plus-haiku/fix.sh~ 2008-10-15 14:44:47.000000000 +0000 +@@ -0,0 +1,145 @@ ++#!/bin/sh ++# ++# Sets up the Allegro package for building with the specified compiler, ++# and if possible converting text files to the desired target format. ++# ++ ++proc_help() ++{ ++ echo ++ echo "Usage: $0 [--quick|--dtou|--utod]" ++ echo ++ echo "Where platform is one of: bcc32, beos, djgpp, mingw, qnx, unix" ++ echo "mac, macosx, macosx-universal and watcom." ++ echo "The --quick parameter turns off text file conversion, --dtou converts from" ++ echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format." ++ echo "If no parameter is specified --quick is assumed." ++ echo ++} ++ ++proc_fix() ++{ ++ echo "Configuring Allegro for $1 ..." ++ ++ if [ "$2" != "none" ]; then ++ echo "# generated by fix.sh" > makefile ++ echo "MAKEFILE_INC = $2" >> makefile ++ echo "include makefile.all" >> makefile ++ fi ++ ++ echo "/* generated by fix.sh */" > include/allegro/platform/alplatf.h ++ echo "#define $3" >> include/allegro/platform/alplatf.h ++} ++ ++proc_fix_osx_ub() ++{ ++ echo "Configuring Allegro for Mac OSX Universal Binary ..." ++ ++ echo "# generated by fix.sh" > makefile ++ echo "UB = 1" >> makefile ++ echo "MAKEFILE_INC = makefile.osx" >> makefile ++ echo "include makefile.all" >> makefile ++ ++ echo "/* generated by fix.sh */" > include/allegro/platform/alplatf.h ++ echo "#define ALLEGRO_MACOSX" >> include/allegro/platform/alplatf.h ++} ++ ++proc_filelist() ++{ ++ # common files. This must not include any shell scripts or batch files. ++ AL_FILELIST=`find . -type f "(" ! -path "*/.*" ")" -a "(" \ ++ -name "*.c" -o -name "*.cfg" -o -name "*.cpp" -o -name "*.def" -o \ ++ -name "*.h" -o -name "*.hin" -o -name "*.in" -o -name "*.inc" -o \ ++ -name "*.m" -o -name "*.m4" -o -name "*.mft" -o -name "*.s" -o \ ++ -name "*.rc" -o -name "*.rh" -o -name "*.spec" -o -name "*.pl" -o \ ++ -name "*.txt" -o -name "*._tx" -o -name "makefile*" -o \ ++ -name "*.inl" -o -name "CHANGES" -o \ ++ -name "AUTHORS" -o -name "THANKS" ")" -a ! -path "*addons*" \ ++ ` ++ ++ # touch unix shell scripts? ++ if [ "$1" != "omit_sh" ]; then ++ AL_FILELIST="$AL_FILELIST `find . -type f -name '*.sh' -o \ ++ -name 'configure' -a ! -path "*addons*"`" ++ fi ++ ++ # touch DOS batch files? ++ if [ "$1" != "omit_bat" ]; then ++ AL_FILELIST="$AL_FILELIST `find . -type f -name '*.bat' -a \ ++ ! -path "*addons*"`" ++ fi ++} ++ ++proc_utod() ++{ ++ echo "Converting files from Unix to DOS/Win32 ..." ++ proc_filelist "omit_sh" ++ /bin/sh misc/utod.sh $AL_FILELIST ++} ++ ++proc_dtou() ++{ ++ echo "Converting files from DOS/Win32 to Unix ..." ++ proc_filelist "omit_bat" ++ /bin/sh misc/dtou.sh $AL_FILELIST ++} ++ ++# prepare allegro for the given platform. ++ ++case "$1" in ++ "bcc32" ) proc_fix "Windows (BCC32)" "makefile.bcc" "ALLEGRO_BCC32";; ++ "beos" ) proc_fix "BeOS" "makefile.be" "ALLEGRO_BEOS";; ++ "djgpp" ) proc_fix "DOS (djgpp)" "makefile.dj" "ALLEGRO_DJGPP";; ++ "mingw" ) proc_fix "Windows (MinGW)" "makefile.mgw" "ALLEGRO_MINGW32";; ++ "mingw32" ) proc_fix "Windows (MinGW)" "makefile.mgw" "ALLEGRO_MINGW32";; ++ # The 'msvc' target is undocumented in the help message, but is used ++ # during the release process by misc/zipup.sh. ++ "msvc" ) proc_fix "Windows (MSVC)" "makefile.vc" "ALLEGRO_MSVC";; ++ "qnx" ) proc_fix "QNX" "makefile.qnx" "ALLEGRO_QNX";; ++ "unix" ) proc_fix "Unix" "none" "ALLEGRO_UNIX";; ++ "mac" ) proc_fix "Mac" "none" "ALLEGRO_MPW";; ++ "macosx" ) proc_fix "MacOS X" "makefile.osx" "ALLEGRO_MACOSX";; ++ "macosx-universal" ) proc_fix_osx_ub ;; ++ "watcom" ) proc_fix "DOS (Watcom)" "makefile.wat" "ALLEGRO_WATCOM";; ++ "help" ) proc_help; exit 0;; ++ * ) proc_help; exit 0;; ++esac ++ ++# convert all text-file line endings. ++ ++trap 'exit $?' 1 2 3 13 15 ++ ++case "$2" in ++ "--utod" ) proc_utod "$1";; ++ "--dtou" ) proc_dtou "$1";; ++ "--quick" ) echo "No text file conversion performed ...";; ++esac ++ ++# set execute permissions just in case. ++ ++chmod +x *.sh misc/*.sh tools/x11/*.sh misc/*.pl ++if [ -f configure ]; then ++ chmod +x configure ++fi ++ ++# run fix.sh for addons. We call /bin/sh explicitly in case the fix.sh ++# files have lost the execute bit. ++ ++if ! ( cd addons/allegrogl && /bin/sh fix.sh $1 $2 ) ++then ++ echo "Error occured while executing AllegroGL's fix.sh!" ++fi ++if ! ( cd addons/loadpng && /bin/sh fix.sh $1 $2 ) ++then ++ echo "Error occured while executing loadpng's fix.sh!" ++fi ++if ! ( cd addons/logg && /bin/sh fix.sh $1 $2 ) ++then ++ echo "Error occured while executing logg's fix.sh!" ++fi ++if ! ( cd addons/jpgalleg && /bin/sh fix.sh $1 $2 ) ++then ++ echo "Error occured while executing jpgalleg's fix.sh!" ++fi ++ ++echo "Done!" +diff -urN allegro-4.3.10plus/include/allegro/internal/aintern.h allegro-4.3.10plus-haiku/include/allegro/internal/aintern.h +--- allegro-4.3.10plus/include/allegro/internal/aintern.h 2008-10-15 14:42:48.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/internal/aintern.h 2008-10-15 15:01:00.000000000 +0000 +@@ -190,7 +190,7 @@ + + + #if (defined ALLEGRO_DOS) || (defined ALLEGRO_DJGPP) || (defined ALLEGRO_WATCOM) || \ +- (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) ++ (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) || (defined ALLEGRO_HAIKU) + + AL_ARRAY(char *, _pckeys_names); + +diff -urN allegro-4.3.10plus/include/allegro/internal/aintern.h~ allegro-4.3.10plus-haiku/include/allegro/internal/aintern.h~ +--- allegro-4.3.10plus/include/allegro/internal/aintern.h~ 1970-01-01 00:00:00.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/internal/aintern.h~ 2008-10-15 14:42:48.000000000 +0000 +@@ -0,0 +1,1258 @@ ++/* ______ ___ ___ ++ * /\ _ \ /\_ \ /\_ \ ++ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ ++ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ ++ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ ++ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ ++ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ ++ * /\____/ ++ * \_/__/ ++ * ++ * Some definitions for internal use by the library code. ++ * ++ * By Shawn Hargreaves. ++ * ++ * See readme.txt for copyright information. ++ */ ++ ++ ++#ifndef AINTERN_H ++#define AINTERN_H ++ ++#ifndef ALLEGRO_H ++ #error must include allegro.h first ++#endif ++ ++#ifdef __cplusplus ++ extern "C" { ++#endif ++ ++ ++/* length in bytes of the cpu_vendor string */ ++#define _AL_CPU_VENDOR_SIZE 32 ++ ++ ++/* flag for how many times we have been initialised */ ++AL_VAR(int, _allegro_count); ++ ++ ++/* flag to know whether we are being called by the exit mechanism */ ++AL_VAR(int, _allegro_in_exit); ++ ++ ++/* flag to decide whether to disable the screensaver */ ++enum { ++ NEVER_DISABLED, ++ FULLSCREEN_DISABLED, ++ ALWAYS_DISABLED ++}; ++ ++AL_VAR(int, _screensaver_policy); ++ ++ ++AL_FUNCPTR(int, _al_trace_handler, (AL_CONST char *msg)); ++ ++ ++/* malloc wrappers */ ++/* The 4.3 branch uses the following macro names to allow the user to customise ++ * the memory management routines. We don't have that feature in 4.2, but we ++ * use the same macros names in order to reduce divergence of the codebases. ++ */ ++#define _AL_MALLOC(SIZE) (_al_malloc(SIZE)) ++#define _AL_MALLOC_ATOMIC(SIZE) (_al_malloc(SIZE)) ++#define _AL_FREE(PTR) (_al_free(PTR)) ++#define _AL_REALLOC(PTR, SIZE) (_al_realloc(PTR, SIZE)) ++ ++AL_FUNC(void *, _al_malloc, (size_t size)); ++AL_FUNC(void, _al_free, (void *mem)); ++AL_FUNC(void *, _al_realloc, (void *mem, size_t size)); ++AL_FUNC(char *, _al_strdup, (const char *string)); ++ ++ ++ ++/* some Allegro functions need a block of scratch memory */ ++AL_VAR(void *, _scratch_mem); ++AL_VAR(int, _scratch_mem_size); ++ ++ ++AL_INLINE(void, _grow_scratch_mem, (int size), ++{ ++ if (size > _scratch_mem_size) { ++ size = (size+1023) & 0xFFFFFC00; ++ _scratch_mem = _AL_REALLOC(_scratch_mem, size); ++ _scratch_mem_size = size; ++ } ++}) ++ ++ ++/* list of functions to call at program cleanup */ ++AL_FUNC(void, _add_exit_func, (AL_METHOD(void, func, (void)), AL_CONST char *desc)); ++AL_FUNC(void, _remove_exit_func, (AL_METHOD(void, func, (void)))); ++ ++ ++/* helper structure for talking to Unicode strings */ ++typedef struct UTYPE_INFO ++{ ++ int id; ++ AL_METHOD(int, u_getc, (AL_CONST char *s)); ++ AL_METHOD(int, u_getx, (char **s)); ++ AL_METHOD(int, u_setc, (char *s, int c)); ++ AL_METHOD(int, u_width, (AL_CONST char *s)); ++ AL_METHOD(int, u_cwidth, (int c)); ++ AL_METHOD(int, u_isok, (int c)); ++ int u_width_max; ++} UTYPE_INFO; ++ ++AL_FUNC(UTYPE_INFO *, _find_utype, (int type)); ++ ++ ++/* message stuff */ ++#define ALLEGRO_MESSAGE_SIZE 4096 ++ ++ ++/* wrappers for implementing disk I/O on different platforms */ ++AL_FUNC(int, _al_file_isok, (AL_CONST char *filename)); ++AL_FUNC(uint64_t, _al_file_size_ex, (AL_CONST char *filename)); ++AL_FUNC(time_t, _al_file_time, (AL_CONST char *filename)); ++AL_FUNC(int, _al_drive_exists, (int drive)); ++AL_FUNC(int, _al_getdrive, (void)); ++AL_FUNC(void, _al_getdcwd, (int drive, char *buf, int size)); ++ ++AL_FUNC(void, _al_detect_filename_encoding, (void)); ++ ++/* obsolete; only exists for binary compatibility with 4.2.0 */ ++AL_FUNC(long, _al_file_size, (AL_CONST char *filename)); ++ ++ ++/* packfile stuff */ ++AL_VAR(int, _packfile_filesize); ++AL_VAR(int, _packfile_datasize); ++AL_VAR(int, _packfile_type); ++AL_FUNC(PACKFILE *, _pack_fdopen, (int fd, AL_CONST char *mode)); ++ ++AL_FUNC(int, _al_lzss_incomplete_state, (AL_CONST LZSS_UNPACK_DATA *dat)); ++ ++ ++/* config stuff */ ++void _reload_config(void); ++ ++ ++/* various bits of mouse stuff */ ++AL_FUNC(void, _handle_mouse_input, (void)); ++ ++AL_VAR(int, _mouse_x); ++AL_VAR(int, _mouse_y); ++AL_VAR(int, _mouse_z); ++AL_VAR(int, _mouse_w); ++AL_VAR(int, _mouse_b); ++AL_VAR(int, _mouse_on); ++ ++AL_VAR(int, _mouse_installed); ++ ++AL_VAR(int, _mouse_type); ++AL_VAR(BITMAP *, _mouse_screen); ++AL_VAR(BITMAP *, _mouse_pointer); ++ ++ ++/* various bits of timer stuff */ ++AL_FUNC(long, _handle_timer_tick, (int interval)); ++ ++#define MAX_TIMERS 16 ++ ++/* list of active timer handlers */ ++typedef struct TIMER_QUEUE ++{ ++ AL_METHOD(void, proc, (void)); /* timer handler functions */ ++ AL_METHOD(void, param_proc, (void *param)); ++ void *param; /* param for param_proc if used */ ++ long speed; /* timer speed */ ++ long counter; /* counts down to zero=blastoff */ ++} TIMER_QUEUE; ++ ++AL_ARRAY(TIMER_QUEUE, _timer_queue); ++ ++AL_VAR(int, _timer_installed); ++ ++AL_VAR(int, _timer_use_retrace); ++AL_VAR(volatile int, _retrace_hpp_value); ++ ++AL_VAR(long, _vsync_speed); ++ ++ ++/* various bits of keyboard stuff */ ++AL_FUNC(void, _handle_key_press, (int keycode, int scancode)); ++AL_FUNC(void, _handle_key_release, (int scancode)); ++ ++AL_VAR(int, _keyboard_installed); ++AL_ARRAY(AL_CONST char *, _keyboard_common_names); ++AL_ARRAY(volatile char, _key); ++AL_VAR(volatile int, _key_shifts); ++ ++ ++#if (defined ALLEGRO_DOS) || (defined ALLEGRO_DJGPP) || (defined ALLEGRO_WATCOM) || \ ++ (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) ++ ++AL_ARRAY(char *, _pckeys_names); ++ ++AL_FUNC(void, _pckeys_init, (void)); ++AL_FUNC(void, _handle_pckey, (int code)); ++AL_FUNC(int, _pckey_scancode_to_ascii, (int scancode)); ++AL_FUNC(AL_CONST char *, _pckey_scancode_to_name, (int scancode)); ++ ++AL_VAR(unsigned short *, _key_ascii_table); ++AL_VAR(unsigned short *, _key_capslock_table); ++AL_VAR(unsigned short *, _key_shift_table); ++AL_VAR(unsigned short *, _key_control_table); ++AL_VAR(unsigned short *, _key_altgr_lower_table); ++AL_VAR(unsigned short *, _key_altgr_upper_table); ++AL_VAR(unsigned short *, _key_accent1_lower_table); ++AL_VAR(unsigned short *, _key_accent1_upper_table); ++AL_VAR(unsigned short *, _key_accent2_lower_table); ++AL_VAR(unsigned short *, _key_accent2_upper_table); ++AL_VAR(unsigned short *, _key_accent3_lower_table); ++AL_VAR(unsigned short *, _key_accent3_upper_table); ++AL_VAR(unsigned short *, _key_accent4_lower_table); ++AL_VAR(unsigned short *, _key_accent4_upper_table); ++ ++AL_VAR(int, _key_accent1); ++AL_VAR(int, _key_accent2); ++AL_VAR(int, _key_accent3); ++AL_VAR(int, _key_accent4); ++AL_VAR(int, _key_accent1_flag); ++AL_VAR(int, _key_accent2_flag); ++AL_VAR(int, _key_accent3_flag); ++AL_VAR(int, _key_accent4_flag); ++ ++AL_VAR(int, _key_standard_kb); ++ ++AL_VAR(char *, _keyboard_layout); ++ ++#endif ++ ++#if (defined ALLEGRO_WINDOWS) ++ ++ AL_FUNC(int, _al_win_open, (const char *filename, int mode, int perm)); ++ AL_FUNC(int, _al_win_unlink, (const char *filename)); ++ ++ ++ #define _al_open(filename, mode, perm) _al_win_open(filename, mode, perm) ++ #define _al_unlink(filename) _al_win_unlink(filename) ++ ++#else ++ ++ #define _al_open(filename, mode, perm) open(filename, mode, perm) ++ #define _al_unlink(filename) unlink(filename) ++ ++#endif ++ ++ ++/* various bits of joystick stuff */ ++AL_VAR(int, _joy_type); ++ ++AL_VAR(int, _joystick_installed); ++ ++ ++/* some GUI innards that other people need to use */ ++AL_FUNC(int, _gui_shadow_box_proc, (int msg, DIALOG *d, int c)); ++AL_FUNC(int, _gui_ctext_proc, (int msg, DIALOG *d, int c)); ++AL_FUNC(int, _gui_button_proc, (int msg, DIALOG *d, int c)); ++AL_FUNC(int, _gui_edit_proc, (int msg, DIALOG *d, int c)); ++AL_FUNC(int, _gui_list_proc, (int msg, DIALOG *d, int c)); ++AL_FUNC(int, _gui_text_list_proc, (int msg, DIALOG *d, int c)); ++ ++AL_FUNC(void, _handle_scrollable_scroll_click, (DIALOG *d, int listsize, int *offset, int height)); ++AL_FUNC(void, _handle_scrollable_scroll, (DIALOG *d, int listsize, int *idx, int *offset)); ++AL_FUNC(void, _handle_listbox_click, (DIALOG *d)); ++AL_FUNC(void, _draw_scrollable_frame, (DIALOG *d, int listsize, int offset, int height, int fg_color, int bg)); ++AL_FUNC(void, _draw_listbox, (DIALOG *d)); ++AL_FUNC(void, _draw_textbox, (char *thetext, int *listsize, int draw, int offset, int wword, int tabsize, int x, int y, int w, int h, int disabled, int fore, int deselect, int disable)); ++ ++ ++/* text- and font-related stuff */ ++typedef struct FONT_VTABLE ++{ ++ AL_METHOD(int, font_height, (AL_CONST FONT *f)); ++ AL_METHOD(int, char_length, (AL_CONST FONT *f, int ch)); ++ AL_METHOD(int, text_length, (AL_CONST FONT *f, AL_CONST char *text)); ++ AL_METHOD(int, render_char, (AL_CONST FONT *f, int ch, int fg, int bg, BITMAP *bmp, int x, int y)); ++ AL_METHOD(void, render, (AL_CONST FONT *f, AL_CONST char *text, int fg, int bg, BITMAP *bmp, int x, int y)); ++ AL_METHOD(void, destroy, (FONT *f)); ++ ++ AL_METHOD(int, get_font_ranges, (FONT *f)); ++ AL_METHOD(int, get_font_range_begin, (FONT *f, int range)); ++ AL_METHOD(int, get_font_range_end, (FONT *f, int range)); ++ AL_METHOD(FONT *, extract_font_range, (FONT *f, int begin, int end)); ++ AL_METHOD(FONT *, merge_fonts, (FONT *f1, FONT *f2)); ++ AL_METHOD(int, transpose_font, (FONT *f, int drange)); ++} FONT_VTABLE; ++ ++AL_VAR(FONT_VTABLE, _font_vtable_mono); ++AL_VAR(FONT_VTABLE *, font_vtable_mono); ++AL_VAR(FONT_VTABLE, _font_vtable_color); ++AL_VAR(FONT_VTABLE *, font_vtable_color); ++AL_VAR(FONT_VTABLE, _font_vtable_trans); ++AL_VAR(FONT_VTABLE *, font_vtable_trans); ++ ++AL_FUNC(FONT_GLYPH *, _mono_find_glyph, (AL_CONST FONT *f, int ch)); ++AL_FUNC(BITMAP *, _color_find_glyph, (AL_CONST FONT *f, int ch)); ++ ++typedef struct FONT_MONO_DATA ++{ ++ int begin, end; /* first char and one-past-the-end char */ ++ FONT_GLYPH **glyphs; /* our glyphs */ ++ struct FONT_MONO_DATA *next; /* linked list structure */ ++} FONT_MONO_DATA; ++ ++typedef struct FONT_COLOR_DATA ++{ ++ int begin, end; /* first char and one-past-the-end char */ ++ BITMAP **bitmaps; /* our glyphs */ ++ struct FONT_COLOR_DATA *next; /* linked list structure */ ++} FONT_COLOR_DATA; ++ ++ ++/* caches and tables for svga bank switching */ ++AL_VAR(int, _last_bank_1); ++AL_VAR(int, _last_bank_2); ++ ++AL_VAR(int *, _gfx_bank); ++ ++/* bank switching routines (these use a non-C calling convention on i386!) */ ++AL_FUNC(uintptr_t, _stub_bank_switch, (BITMAP *bmp, int lyne)); ++AL_FUNC(void, _stub_unbank_switch, (BITMAP *bmp)); ++AL_FUNC(void, _stub_bank_switch_end, (void)); ++ ++#ifdef ALLEGRO_GFX_HAS_VGA ++ ++AL_FUNC(uintptr_t, _x_bank_switch, (BITMAP *bmp, int lyne)); ++AL_FUNC(void, _x_unbank_switch, (BITMAP *bmp)); ++AL_FUNC(void, _x_bank_switch_end, (void)); ++ ++#endif ++ ++#ifdef ALLEGRO_GFX_HAS_VBEAF ++ ++AL_FUNC(void, _accel_bank_stub, (void)); ++AL_FUNC(void, _accel_bank_stub_end, (void)); ++AL_FUNC(void, _accel_bank_switch, (void)); ++AL_FUNC(void, _accel_bank_switch_end, (void)); ++ ++AL_VAR(void *, _accel_driver); ++ ++AL_VAR(int, _accel_active); ++ ++AL_VAR(void *, _accel_set_bank); ++AL_VAR(void *, _accel_idle); ++ ++AL_FUNC(void, _fill_vbeaf_libc_exports, (void *ptr)); ++AL_FUNC(void, _fill_vbeaf_pmode_exports, (void *ptr)); ++ ++#endif ++ ++ ++/* stuff for setting up bitmaps */ ++AL_FUNC(BITMAP *, _make_bitmap, (int w, int h, uintptr_t addr, GFX_DRIVER *driver, int color_depth, int bpl)); ++AL_FUNC(void, _sort_out_virtual_width, (int *width, GFX_DRIVER *driver)); ++ ++AL_FUNC(GFX_VTABLE *, _get_vtable, (int color_depth)); ++ ++AL_VAR(GFX_VTABLE, _screen_vtable); ++ ++AL_VAR(int, _gfx_mode_set_count); ++ ++AL_VAR(int, _refresh_rate_request); ++AL_FUNC(void, _set_current_refresh_rate, (int rate)); ++ ++AL_VAR(int, _wait_for_vsync); ++ ++AL_VAR(int, _sub_bitmap_id_count); ++ ++AL_VAR(int, _screen_split_position); ++ ++AL_VAR(int, _safe_gfx_mode_change); ++ ++#ifdef ALLEGRO_I386 ++ #define BYTES_PER_PIXEL(bpp) (((int)(bpp) + 7) / 8) ++#else ++ #ifdef ALLEGRO_MPW ++ /* in Mac 24 bit is a unsigned long */ ++ #define BYTES_PER_PIXEL(bpp) (((bpp) <= 8) ? 1 \ ++ : (((bpp) <= 16) ? 2 \ ++ : 4)) ++ #else ++ #define BYTES_PER_PIXEL(bpp) (((bpp) <= 8) ? 1 \ ++ : (((bpp) <= 16) ? 2 \ ++ : (((bpp) <= 24) ? 3 : 4))) ++ #endif ++#endif ++ ++AL_FUNC(int, _color_load_depth, (int depth, int hasalpha)); ++ ++AL_VAR(int, _color_conv); ++ ++AL_FUNC(BITMAP *, _fixup_loaded_bitmap, (BITMAP *bmp, PALETTE pal, int bpp)); ++ ++AL_FUNC(int, _bitmap_has_alpha, (BITMAP *bmp)); ++ ++/* default truecolor pixel format */ ++#define DEFAULT_RGB_R_SHIFT_15 0 ++#define DEFAULT_RGB_G_SHIFT_15 5 ++#define DEFAULT_RGB_B_SHIFT_15 10 ++#define DEFAULT_RGB_R_SHIFT_16 0 ++#define DEFAULT_RGB_G_SHIFT_16 5 ++#define DEFAULT_RGB_B_SHIFT_16 11 ++#define DEFAULT_RGB_R_SHIFT_24 0 ++#define DEFAULT_RGB_G_SHIFT_24 8 ++#define DEFAULT_RGB_B_SHIFT_24 16 ++#define DEFAULT_RGB_R_SHIFT_32 0 ++#define DEFAULT_RGB_G_SHIFT_32 8 ++#define DEFAULT_RGB_B_SHIFT_32 16 ++#define DEFAULT_RGB_A_SHIFT_32 24 ++ ++ ++/* display switching support */ ++AL_FUNC(void, _switch_in, (void)); ++AL_FUNC(void, _switch_out, (void)); ++ ++AL_FUNC(void, _register_switch_bitmap, (BITMAP *bmp, BITMAP *parent)); ++AL_FUNC(void, _unregister_switch_bitmap, (BITMAP *bmp)); ++AL_FUNC(void, _save_switch_state, (int switch_mode)); ++AL_FUNC(void, _restore_switch_state, (void)); ++ ++AL_VAR(int, _dispsw_status); ++ ++ ++/* current drawing mode */ ++AL_VAR(int, _drawing_mode); ++AL_VAR(BITMAP *, _drawing_pattern); ++AL_VAR(int, _drawing_x_anchor); ++AL_VAR(int, _drawing_y_anchor); ++AL_VAR(unsigned int, _drawing_x_mask); ++AL_VAR(unsigned int, _drawing_y_mask); ++ ++AL_FUNCPTR(int *, _palette_expansion_table, (int bpp)); ++ ++AL_VAR(int, _color_depth); ++ ++AL_VAR(int, _current_palette_changed); ++AL_VAR(PALETTE, _prev_current_palette); ++AL_VAR(int, _got_prev_current_palette); ++ ++AL_ARRAY(int, _palette_color8); ++AL_ARRAY(int, _palette_color15); ++AL_ARRAY(int, _palette_color16); ++AL_ARRAY(int, _palette_color24); ++AL_ARRAY(int, _palette_color32); ++ ++/* truecolor blending functions */ ++AL_VAR(BLENDER_FUNC, _blender_func15); ++AL_VAR(BLENDER_FUNC, _blender_func16); ++AL_VAR(BLENDER_FUNC, _blender_func24); ++AL_VAR(BLENDER_FUNC, _blender_func32); ++ ++AL_VAR(BLENDER_FUNC, _blender_func15x); ++AL_VAR(BLENDER_FUNC, _blender_func16x); ++AL_VAR(BLENDER_FUNC, _blender_func24x); ++ ++AL_VAR(int, _blender_col_15); ++AL_VAR(int, _blender_col_16); ++AL_VAR(int, _blender_col_24); ++AL_VAR(int, _blender_col_32); ++ ++AL_VAR(int, _blender_alpha); ++ ++AL_FUNC(unsigned long, _blender_black, (unsigned long x, unsigned long y, unsigned long n)); ++ ++#ifdef ALLEGRO_COLOR16 ++ ++AL_FUNC(unsigned long, _blender_trans15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_add15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_burn15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_color15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_difference15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dissolve15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dodge15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_hue15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_invert15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_luminance15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_multiply15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_saturation15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_screen15, (unsigned long x, unsigned long y, unsigned long n)); ++ ++AL_FUNC(unsigned long, _blender_trans16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_add16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_burn16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_color16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_difference16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dissolve16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dodge16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_hue16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_invert16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_luminance16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_multiply16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_saturation16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_screen16, (unsigned long x, unsigned long y, unsigned long n)); ++ ++#endif ++ ++#if (defined ALLEGRO_COLOR24) || (defined ALLEGRO_COLOR32) ++ ++AL_FUNC(unsigned long, _blender_trans24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_add24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_burn24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_color24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_difference24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dissolve24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_dodge24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_hue24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_invert24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_luminance24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_multiply24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_saturation24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_screen24, (unsigned long x, unsigned long y, unsigned long n)); ++ ++#endif ++ ++AL_FUNC(unsigned long, _blender_alpha15, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_alpha16, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_alpha24, (unsigned long x, unsigned long y, unsigned long n)); ++AL_FUNC(unsigned long, _blender_alpha32, (unsigned long x, unsigned long y, unsigned long n)); ++ ++AL_FUNC(unsigned long, _blender_write_alpha, (unsigned long x, unsigned long y, unsigned long n)); ++ ++ ++/* graphics drawing routines */ ++AL_FUNC(void, _normal_line, (BITMAP *bmp, int x1, int y_1, int x2, int y2, int color)); ++AL_FUNC(void, _fast_line, (BITMAP *bmp, int x1, int y_1, int x2, int y2, int color)); ++AL_FUNC(void, _normal_rectfill, (BITMAP *bmp, int x1, int y_1, int x2, int y2, int color)); ++ ++#ifdef ALLEGRO_COLOR8 ++ ++AL_FUNC(int, _linear_getpixel8, (BITMAP *bmp, int x, int y)); ++AL_FUNC(void, _linear_putpixel8, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _linear_vline8, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _linear_hline8, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _linear_draw_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_ex8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip)); ++AL_FUNC(void, _linear_draw_sprite_v_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_h_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_vh_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_character8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_draw_glyph8, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_blit8, (BITMAP *source,BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_blit_backward8, (BITMAP *source,BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_masked_blit8, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_clear_to_color8, (BITMAP *bitmap, int color)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR16 ++ ++AL_FUNC(void, _linear_putpixel15, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _linear_vline15, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _linear_hline15, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _linear_draw_trans_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_sprite15, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_rle_sprite15, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++ ++AL_FUNC(int, _linear_getpixel16, (BITMAP *bmp, int x, int y)); ++AL_FUNC(void, _linear_putpixel16, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _linear_vline16, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _linear_hline16, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _linear_draw_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_ex16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip)); ++AL_FUNC(void, _linear_draw_256_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_v_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_h_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_vh_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_rle_sprite16, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_character16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_draw_glyph16, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_blit16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_blit_backward16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_masked_blit16, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_clear_to_color16, (BITMAP *bitmap, int color)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR24 ++ ++AL_FUNC(int, _linear_getpixel24, (BITMAP *bmp, int x, int y)); ++AL_FUNC(void, _linear_putpixel24, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _linear_vline24, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _linear_hline24, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _linear_draw_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_ex24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip)); ++AL_FUNC(void, _linear_draw_256_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_v_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_h_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_vh_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rgba_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_rle_sprite24, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_character24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_draw_glyph24, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_blit24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_blit_backward24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_masked_blit24, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_clear_to_color24, (BITMAP *bitmap, int color)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR32 ++ ++AL_FUNC(int, _linear_getpixel32, (BITMAP *bmp, int x, int y)); ++AL_FUNC(void, _linear_putpixel32, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _linear_vline32, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _linear_hline32, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _linear_draw_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_ex32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip)); ++AL_FUNC(void, _linear_draw_256_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_v_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_h_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_sprite_vh_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_trans_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _linear_draw_lit_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++AL_FUNC(void, _linear_draw_character32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_draw_glyph32, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)); ++AL_FUNC(void, _linear_blit32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_blit_backward32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_masked_blit32, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _linear_clear_to_color32, (BITMAP *bitmap, int color)); ++ ++#endif ++ ++#ifdef ALLEGRO_GFX_HAS_VGA ++ ++AL_FUNC(int, _x_getpixel, (BITMAP *bmp, int x, int y)); ++AL_FUNC(void, _x_putpixel, (BITMAP *bmp, int x, int y, int color)); ++AL_FUNC(void, _x_vline, (BITMAP *bmp, int x, int y_1, int y2, int color)); ++AL_FUNC(void, _x_hline, (BITMAP *bmp, int x1, int y, int x2, int color)); ++AL_FUNC(void, _x_draw_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_sprite_v_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_sprite_h_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_sprite_vh_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_trans_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_lit_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color)); ++AL_FUNC(void, _x_draw_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_trans_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y)); ++AL_FUNC(void, _x_draw_lit_rle_sprite, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y, int color)); ++AL_FUNC(void, _x_draw_character, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color, int bg)); ++AL_FUNC(void, _x_draw_glyph, (BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)); ++AL_FUNC(void, _x_blit_from_memory, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_blit_to_memory, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_blit, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_blit_forward, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_blit_backward, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_masked_blit, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)); ++AL_FUNC(void, _x_clear_to_color, (BITMAP *bitmap, int color)); ++ ++#endif ++ ++ ++/* color conversion routines */ ++typedef struct GRAPHICS_RECT { ++ int width; ++ int height; ++ int pitch; ++ void *data; ++} GRAPHICS_RECT; ++ ++typedef void (COLORCONV_BLITTER_FUNC)(GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect); ++ ++AL_FUNC(COLORCONV_BLITTER_FUNC *, _get_colorconv_blitter, (int from_depth, int to_depth)); ++AL_FUNC(void, _release_colorconv_blitter, (COLORCONV_BLITTER_FUNC *blitter)); ++AL_FUNC(void, _set_colorconv_palette, (AL_CONST struct RGB *p, int from, int to)); ++AL_FUNC(unsigned char *, _get_colorconv_map, (void)); ++ ++#ifdef ALLEGRO_COLOR8 ++ ++AL_FUNC(void, _colorconv_blit_8_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_8_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_8_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_8_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_8_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR16 ++ ++AL_FUNC(void, _colorconv_blit_15_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_15_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_15_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_15_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++ ++AL_FUNC(void, _colorconv_blit_16_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_16_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_16_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_16_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR24 ++ ++AL_FUNC(void, _colorconv_blit_24_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_24_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_24_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_24_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR32 ++ ++AL_FUNC(void, _colorconv_blit_32_to_8, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_32_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_32_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorconv_blit_32_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++ ++#endif ++ ++ ++/* color copy routines */ ++#ifndef ALLEGRO_NO_COLORCOPY ++ ++#ifdef ALLEGRO_COLOR16 ++AL_FUNC(void, _colorcopy_blit_15_to_15, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++AL_FUNC(void, _colorcopy_blit_16_to_16, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++#endif ++ ++#ifdef ALLEGRO_COLOR24 ++AL_FUNC(void, _colorcopy_blit_24_to_24, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++#endif ++ ++#ifdef ALLEGRO_COLOR32 ++AL_FUNC(void, _colorcopy_blit_32_to_32, (GRAPHICS_RECT *src_rect, GRAPHICS_RECT *dest_rect)); ++#endif ++ ++#endif ++ ++ ++/* generic color conversion blitter */ ++AL_FUNC(void, _blit_between_formats, (BITMAP *src, BITMAP *dest, int s_x, int s_y, int d_x, int d_y, int w, int h)); ++ ++ ++/* asm helper for stretch_blit() */ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _do_stretch, (BITMAP *source, BITMAP *dest, void *drawer, int sx, fixed sy, fixed syd, int dx, int dy, int dh, int color_depth)); ++#endif ++ ++ ++/* lower level functions for rotation */ ++AL_FUNC(void, _parallelogram_map, (BITMAP *bmp, BITMAP *spr, fixed xs[4], fixed ys[4], void (*draw_scanline)(BITMAP *bmp, BITMAP *spr, fixed l_bmp_x, int bmp_y, fixed r_bmp_x, fixed l_spr_x, fixed l_spr_y, fixed spr_dx, fixed spr_dy), int sub_pixel_accuracy)); ++AL_FUNC(void, _parallelogram_map_standard, (BITMAP *bmp, BITMAP *sprite, fixed xs[4], fixed ys[4])); ++AL_FUNC(void, _rotate_scale_flip_coordinates, (fixed w, fixed h, fixed x, fixed y, fixed cx, fixed cy, fixed angle, fixed scale_x, fixed scale_y, int h_flip, int v_flip, fixed xs[4], fixed ys[4])); ++AL_FUNC(void, _pivot_scaled_sprite_flip, (struct BITMAP *bmp, struct BITMAP *sprite, fixed x, fixed y, fixed cx, fixed cy, fixed angle, fixed scale, int v_flip)); ++ ++ ++/* number of fractional bits used by the polygon rasteriser */ ++#define POLYGON_FIX_SHIFT 18 ++ ++ ++/* bitfield specifying which polygon attributes need interpolating */ ++#define INTERP_FLAT 1 /* no interpolation */ ++#define INTERP_1COL 2 /* gcol or alpha */ ++#define INTERP_3COL 4 /* grgb */ ++#define INTERP_FIX_UV 8 /* atex */ ++#define INTERP_Z 16 /* always in scene3d */ ++#define INTERP_FLOAT_UV 32 /* ptex */ ++#define OPT_FLOAT_UV_TO_FIX 64 /* translate ptex to atex */ ++#define COLOR_TO_RGB 128 /* grgb to gcol for truecolor */ ++#define INTERP_ZBUF 256 /* z-buffered */ ++#define INTERP_THRU 512 /* any kind of transparent */ ++#define INTERP_NOSOLID 1024 /* non-solid modes for 8-bit flat */ ++#define INTERP_BLEND 2048 /* lit for truecolor */ ++#define INTERP_TRANS 4096 /* trans for truecolor */ ++ ++ ++/* information for polygon scanline fillers */ ++typedef struct POLYGON_SEGMENT ++{ ++ fixed u, v, du, dv; /* fixed point u/v coordinates */ ++ fixed c, dc; /* single color gouraud shade values */ ++ fixed r, g, b, dr, dg, db; /* RGB gouraud shade values */ ++ float z, dz; /* polygon depth (1/z) */ ++ float fu, fv, dfu, dfv; /* floating point u/v coordinates */ ++ unsigned char *texture; /* the texture map */ ++ int umask, vmask, vshift; /* texture map size information */ ++ int seg; /* destination bitmap selector */ ++ uintptr_t zbuf_addr; /* Z-buffer address */ ++ uintptr_t read_addr; /* reading address for transparency modes */ ++} POLYGON_SEGMENT; ++ ++ ++/* prototype for the scanline filler functions */ ++typedef AL_METHOD(void, SCANLINE_FILLER, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++ ++/* an active polygon edge */ ++typedef struct POLYGON_EDGE ++{ ++ int top; /* top y position */ ++ int bottom; /* bottom y position */ ++ fixed x, dx; /* fixed point x position and gradient */ ++ fixed w; /* width of line segment */ ++ POLYGON_SEGMENT dat; /* texture/gouraud information */ ++ struct POLYGON_EDGE *prev; /* doubly linked list */ ++ struct POLYGON_EDGE *next; ++ struct POLYGON_INFO *poly; /* father polygon */ ++} POLYGON_EDGE; ++ ++ ++typedef struct POLYGON_INFO /* a polygon waiting rendering */ ++{ ++ struct POLYGON_INFO *next, *prev;/* double linked list */ ++ int inside; /* flag for "scanlining" */ ++ int flags; /* INTERP_* flags */ ++ int color; /* vtx[0]->c */ ++ float a, b, c; /* plane's coefficients -a/d, -b/d, -c/d */ ++ int dmode; /* drawing mode */ ++ BITMAP *dpat; /* drawing pattern */ ++ int xanchor, yanchor; /* for dpat */ ++ int alpha; /* blender alpha */ ++ int b15, b16, b24, b32; /* blender colors */ ++ COLOR_MAP *cmap; /* trans color map */ ++ SCANLINE_FILLER drawer; /* scanline drawing functions */ ++ SCANLINE_FILLER alt_drawer; ++ POLYGON_EDGE *left_edge; /* true edges used in interpolation */ ++ POLYGON_EDGE *right_edge; ++ POLYGON_SEGMENT info; /* base information for scanline functions */ ++} POLYGON_INFO; ++ ++ ++/* global variable for z-buffer */ ++AL_VAR(BITMAP *, _zbuffer); ++ ++ ++/* polygon helper functions */ ++AL_VAR(SCANLINE_FILLER, _optim_alternative_drawer); ++AL_FUNC(POLYGON_EDGE *, _add_edge, (POLYGON_EDGE *list, POLYGON_EDGE *edge, int sort_by_x)); ++AL_FUNC(POLYGON_EDGE *, _remove_edge, (POLYGON_EDGE *list, POLYGON_EDGE *edge)); ++AL_FUNC(int, _fill_3d_edge_structure, (POLYGON_EDGE *edge, AL_CONST V3D *v1, AL_CONST V3D *v2, int flags, BITMAP *bmp)); ++AL_FUNC(int, _fill_3d_edge_structure_f, (POLYGON_EDGE *edge, AL_CONST V3D_f *v1, AL_CONST V3D_f *v2, int flags, BITMAP *bmp)); ++AL_FUNC(SCANLINE_FILLER, _get_scanline_filler, (int type, int *flags, POLYGON_SEGMENT *info, BITMAP *texture, BITMAP *bmp)); ++AL_FUNC(void, _clip_polygon_segment, (POLYGON_SEGMENT *info, fixed gap, int flags)); ++AL_FUNC(void, _clip_polygon_segment_f, (POLYGON_SEGMENT *info, int gap, int flags)); ++ ++ ++/* polygon scanline filler functions */ ++AL_FUNC(void, _poly_scanline_dummy, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifdef ALLEGRO_COLOR8 ++ ++AL_FUNC(void, _poly_scanline_gcol8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_grgb8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _poly_scanline_grgb8x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++#endif ++ ++AL_FUNC(void, _poly_zbuf_flat8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_gcol8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_grgb8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_lit8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_trans8, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR16 ++ ++AL_FUNC(void, _poly_scanline_grgb15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _poly_scanline_grgb15x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit15x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit15x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit15x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit15x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++AL_FUNC(void, _poly_scanline_ptex_lit15d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit15d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++#endif ++ ++AL_FUNC(void, _poly_zbuf_grgb15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_lit15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_trans15, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++AL_FUNC(void, _poly_scanline_grgb16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _poly_scanline_grgb16x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit16x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit16x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit16x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit16x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++AL_FUNC(void, _poly_scanline_ptex_lit16d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit16d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++#endif ++ ++AL_FUNC(void, _poly_zbuf_flat16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_grgb16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_lit16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_trans16, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR24 ++ ++AL_FUNC(void, _poly_scanline_grgb24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _poly_scanline_grgb24x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit24x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit24x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit24x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit24x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++AL_FUNC(void, _poly_scanline_ptex_lit24d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit24d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++#endif ++ ++AL_FUNC(void, _poly_zbuf_flat24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_grgb24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_lit24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_trans24, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#endif ++ ++#ifdef ALLEGRO_COLOR32 ++ ++AL_FUNC(void, _poly_scanline_grgb32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#ifndef SCAN_EXPORT ++AL_FUNC(void, _poly_scanline_grgb32x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_lit32x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_lit32x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_atex_mask_lit32x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit32x, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++AL_FUNC(void, _poly_scanline_ptex_lit32d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_scanline_ptex_mask_lit32d, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++#endif ++ ++AL_FUNC(void, _poly_zbuf_flat32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_grgb32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_lit32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_atex_mask_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++AL_FUNC(void, _poly_zbuf_ptex_mask_trans32, (uintptr_t addr, int w, POLYGON_SEGMENT *info)); ++ ++#endif ++ ++ ++/* sound lib stuff */ ++AL_VAR(MIDI_DRIVER, _midi_none); ++AL_VAR(int, _digi_volume); ++AL_VAR(int, _midi_volume); ++AL_VAR(int, _sound_flip_pan); ++AL_VAR(int, _sound_hq); ++AL_VAR(int, _sound_stereo); ++AL_VAR(int, _sound_bits); ++AL_VAR(int, _sound_freq); ++AL_VAR(int, _sound_port); ++AL_VAR(int, _sound_dma); ++AL_VAR(int, _sound_irq); ++ ++AL_VAR(int, _sound_installed); ++AL_VAR(int, _sound_input_installed); ++ ++AL_FUNC(int, _midi_allocate_voice, (int min, int max)); ++ ++AL_VAR(volatile long, _midi_tick); ++ ++AL_FUNC(int, _digmid_find_patches, (char *dir, int dir_size, char *file, int size_of_file)); ++ ++#define VIRTUAL_VOICES 256 ++ ++ ++typedef struct /* a virtual (as seen by the user) soundcard voice */ ++{ ++ AL_CONST SAMPLE *sample; /* which sample are we playing? (NULL = free) */ ++ int num; /* physical voice number (-1 = been killed off) */ ++ int autokill; /* set to free the voice when the sample finishes */ ++ long time; /* when we were started (for voice allocation) */ ++ int priority; /* how important are we? */ ++} VOICE; ++ ++ ++typedef struct /* a physical (as used by hardware) soundcard voice */ ++{ ++ int num; /* the virtual voice currently using me (-1 = free) */ ++ int playmode; /* are we looping? */ ++ int vol; /* current volume (fixed point .12) */ ++ int dvol; /* volume delta, for ramping */ ++ int target_vol; /* target volume, for ramping */ ++ int pan; /* current pan (fixed point .12) */ ++ int dpan; /* pan delta, for sweeps */ ++ int target_pan; /* target pan, for sweeps */ ++ int freq; /* current frequency (fixed point .12) */ ++ int dfreq; /* frequency delta, for sweeps */ ++ int target_freq; /* target frequency, for sweeps */ ++} PHYS_VOICE; ++ ++AL_ARRAY(PHYS_VOICE, _phys_voice); ++ ++ ++#define MIXER_DEF_SFX 8 ++#define MIXER_MAX_SFX 64 ++ ++AL_FUNC(int, _mixer_init, (int bufsize, int freq, int stereo, int is16bit, int *voices)); ++AL_FUNC(void, _mixer_exit, (void)); ++AL_FUNC(void, _mix_some_samples, (uintptr_t buf, unsigned short seg, int issigned)); ++AL_FUNC(void, _mixer_init_voice, (int voice, AL_CONST SAMPLE *sample)); ++AL_FUNC(void, _mixer_release_voice, (int voice)); ++AL_FUNC(void, _mixer_start_voice, (int voice)); ++AL_FUNC(void, _mixer_stop_voice, (int voice)); ++AL_FUNC(void, _mixer_loop_voice, (int voice, int loopmode)); ++AL_FUNC(int, _mixer_get_position, (int voice)); ++AL_FUNC(void, _mixer_set_position, (int voice, int position)); ++AL_FUNC(int, _mixer_get_volume, (int voice)); ++AL_FUNC(void, _mixer_set_volume, (int voice, int volume)); ++AL_FUNC(void, _mixer_ramp_volume, (int voice, int tyme, int endvol)); ++AL_FUNC(void, _mixer_stop_volume_ramp, (int voice)); ++AL_FUNC(int, _mixer_get_frequency, (int voice)); ++AL_FUNC(void, _mixer_set_frequency, (int voice, int frequency)); ++AL_FUNC(void, _mixer_sweep_frequency, (int voice, int tyme, int endfreq)); ++AL_FUNC(void, _mixer_stop_frequency_sweep, (int voice)); ++AL_FUNC(int, _mixer_get_pan, (int voice)); ++AL_FUNC(void, _mixer_set_pan, (int voice, int pan)); ++AL_FUNC(void, _mixer_sweep_pan, (int voice, int tyme, int endpan)); ++AL_FUNC(void, _mixer_stop_pan_sweep, (int voice)); ++AL_FUNC(void, _mixer_set_echo, (int voice, int strength, int delay)); ++AL_FUNC(void, _mixer_set_tremolo, (int voice, int rate, int depth)); ++AL_FUNC(void, _mixer_set_vibrato, (int voice, int rate, int depth)); ++ ++AL_FUNC(void, _dummy_noop1, (int p)); ++AL_FUNC(void, _dummy_noop2, (int p1, int p2)); ++AL_FUNC(void, _dummy_noop3, (int p1, int p2, int p3)); ++AL_FUNC(int, _dummy_load_patches, (AL_CONST char *patches, AL_CONST char *drums)); ++AL_FUNC(void, _dummy_adjust_patches, (AL_CONST char *patches, AL_CONST char *drums)); ++AL_FUNC(void, _dummy_key_on, (int inst, int note, int bend, int vol, int pan)); ++ ++ ++/* datafile ID's for compatibility with the old datafile format */ ++#define V1_DAT_MAGIC 0x616C6C2EL ++ ++#define V1_DAT_DATA 0 ++#define V1_DAT_FONT 1 ++#define V1_DAT_BITMAP_16 2 ++#define V1_DAT_BITMAP_256 3 ++#define V1_DAT_SPRITE_16 4 ++#define V1_DAT_SPRITE_256 5 ++#define V1_DAT_PALETTE_16 6 ++#define V1_DAT_PALETTE_256 7 ++#define V1_DAT_FONT_8x8 8 ++#define V1_DAT_FONT_PROP 9 ++#define V1_DAT_BITMAP 10 ++#define V1_DAT_PALETTE 11 ++#define V1_DAT_SAMPLE 12 ++#define V1_DAT_MIDI 13 ++#define V1_DAT_RLE_SPRITE 14 ++#define V1_DAT_FLI 15 ++#define V1_DAT_C_SPRITE 16 ++#define V1_DAT_XC_SPRITE 17 ++ ++#define OLD_FONT_SIZE 95 ++#define LESS_OLD_FONT_SIZE 224 ++ ++ ++/* datafile object loading functions */ ++AL_FUNC(void, _unload_datafile_object, (DATAFILE *dat)); ++ ++ ++/* information about a datafile object */ ++typedef struct DATAFILE_TYPE ++{ ++ int type; ++ AL_METHOD(void *, load, (PACKFILE *f, long size)); ++ AL_METHOD(void, destroy, (void *)); ++} DATAFILE_TYPE; ++ ++ ++#define MAX_DATAFILE_TYPES 32 ++ ++AL_ARRAY(DATAFILE_TYPE, _datafile_type); ++ ++AL_VAR(int, _compile_sprites); ++ ++AL_FUNC(void, _construct_datafile, (DATAFILE *data)); ++ ++ ++/* for readbmp.c */ ++AL_FUNC(void, _register_bitmap_file_type_init, (void)); ++ ++/* for readsmp.c */ ++AL_FUNC(void, _register_sample_file_type_init, (void)); ++ ++/* for readfont.c */ ++AL_FUNC(void, _register_font_file_type_init, (void)); ++ ++ ++/* for module linking system; see comment in allegro.c */ ++struct _AL_LINKER_MIDI ++{ ++ AL_METHOD(int, init, (void)); ++ AL_METHOD(void, exit, (void)); ++}; ++ ++AL_VAR(struct _AL_LINKER_MIDI *, _al_linker_midi); ++ ++struct _AL_LINKER_MOUSE ++{ ++ AL_METHOD(void, set_mouse_etc, (void)); ++ AL_METHOD(void, show_mouse, (BITMAP *)); ++ BITMAP **mouse_screen_ptr; ++}; ++ ++AL_VAR(struct _AL_LINKER_MOUSE *, _al_linker_mouse); ++ ++ ++/* dynamic driver lists */ ++AL_FUNC(_DRIVER_INFO *, _create_driver_list, (void)); ++AL_FUNC(void, _destroy_driver_list, (_DRIVER_INFO *drvlist)); ++AL_FUNC(void, _driver_list_append_driver, (_DRIVER_INFO **drvlist, int id, void *driver, int autodetect)); ++AL_FUNC(void, _driver_list_prepend_driver, (_DRIVER_INFO **drvlist, int id, void *driver, int autodetect)); ++AL_FUNC(void, _driver_list_append_list, (_DRIVER_INFO **drvlist, _DRIVER_INFO *srclist)); ++ ++ ++/* various libc stuff */ ++AL_FUNC(void *, _al_sane_realloc, (void *ptr, size_t size)); ++AL_FUNC(char *, _al_sane_strncpy, (char *dest, const char *src, size_t n)); ++ ++ ++#define _AL_RAND_MAX 0xFFFF ++AL_FUNC(void, _al_srand, (int seed)); ++AL_FUNC(int, _al_rand, (void)); ++ ++ ++#ifdef __cplusplus ++ } ++#endif ++ ++#endif /* ifndef AINTERN_H */ +diff -urN allegro-4.3.10plus/include/allegro/internal/alconfig.h allegro-4.3.10plus-haiku/include/allegro/internal/alconfig.h +--- allegro-4.3.10plus/include/allegro/internal/alconfig.h 2008-10-15 14:42:48.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/internal/alconfig.h 2008-10-15 15:01:00.000000000 +0000 +@@ -48,6 +48,8 @@ + #include "allegro/platform/albcc32.h" + #elif defined ALLEGRO_MSVC + #include "allegro/platform/almsvc.h" ++ #elif defined ALLEGRO_HAIKU ++ #include "allegro/platform/albecfg.h" + #elif defined ALLEGRO_BEOS + #include "allegro/platform/albecfg.h" + #elif defined ALLEGRO_MPW +diff -urN allegro-4.3.10plus/include/allegro/platform/albecfg.h allegro-4.3.10plus-haiku/include/allegro/platform/albecfg.h +--- allegro-4.3.10plus/include/allegro/platform/albecfg.h 2008-10-15 14:42:46.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/platform/albecfg.h 2008-10-15 15:01:00.000000000 +0000 +@@ -31,7 +31,13 @@ + #define ALLEGRO_HAVE_SYS_TIME_H 1 + + /* describe this platform */ +-#define ALLEGRO_PLATFORM_STR "BeOS" ++#if defined __BEOS__ && !defined __HAIKU__ ++ #define ALLEGRO_PLATFORM_STR "BeOS" ++#endif ++#if defined __HAIKU__ ++ #define ALLEGRO_PLATFORM_STR "Haiku" ++ #define ALLEGRO_HAVE_LIBPTHREAD 1 ++#endif + #define ALLEGRO_LITTLE_ENDIAN + #define ALLEGRO_CONSOLE_OK + #define ALLEGRO_USE_CONSTRUCTOR +diff -urN allegro-4.3.10plus/include/allegro/platform/albeos.h allegro-4.3.10plus-haiku/include/allegro/platform/albeos.h +--- allegro-4.3.10plus/include/allegro/platform/albeos.h 2008-10-15 14:42:46.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/platform/albeos.h 2008-10-15 15:01:00.000000000 +0000 +@@ -74,3 +74,7 @@ + #define JOYSTICK_DRIVER_BEOS \ + { JOYSTICK_BEOS, &joystick_beos, TRUE }, + ++#if defined __HAIKU__ ++#define TIMERDRV_UNIX_PTHREADS AL_ID('P','T','H','R') ++#endif ++ +diff -urN allegro-4.3.10plus/include/allegro/platform/alunixac.hin allegro-4.3.10plus-haiku/include/allegro/platform/alunixac.hin +--- allegro-4.3.10plus/include/allegro/platform/alunixac.hin 2008-10-15 14:42:46.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/platform/alunixac.hin 2008-10-15 15:01:00.000000000 +0000 +@@ -68,7 +68,7 @@ + #undef ALLEGRO_DARWIN + + /* Define if you have the pthread library. */ +-#undef ALLEGRO_HAVE_LIBPTHREAD ++/* #undef ALLEGRO_HAVE_LIBPTHREAD */ + + /* Define if constructor attribute is supported. */ + #undef ALLEGRO_USE_CONSTRUCTOR +@@ -159,7 +159,7 @@ + + /* Define as the return type of signal handlers (`int' or `void'). */ + /* TODO: rename this */ +-#undef RETSIGTYPE ++/* #undef RETSIGTYPE */ + + /* Define to empty if `const' does not conform to ANSI C. */ + #undef const +diff -urN allegro-4.3.10plus/include/allegro/system.h allegro-4.3.10plus-haiku/include/allegro/system.h +--- allegro-4.3.10plus/include/allegro/system.h 2008-10-15 14:42:57.000000000 +0000 ++++ allegro-4.3.10plus-haiku/include/allegro/system.h 2008-10-15 15:01:00.000000000 +0000 +@@ -61,6 +61,7 @@ + #define OSTYPE_QNX AL_ID('Q','N','X',' ') + #define OSTYPE_UNIX AL_ID('U','N','I','X') + #define OSTYPE_BEOS AL_ID('B','E','O','S') ++#define OSTYPE_HAIKU AL_ID('H','A','I','K') + #define OSTYPE_MACOS AL_ID('M','A','C',' ') + #define OSTYPE_MACOSX AL_ID('M','A','C','X') + +diff -urN allegro-4.3.10plus/makefile.all allegro-4.3.10plus-haiku/makefile.all +--- allegro-4.3.10plus/makefile.all 2008-10-15 14:44:47.000000000 +0000 ++++ allegro-4.3.10plus-haiku/makefile.all 2008-10-15 15:01:00.000000000 +0000 +@@ -8,7 +8,7 @@ + # DEBUGMODE=2 selects a build intended to debug Allegro itself. + # PROFILEMODE=1 selects a profiling build. + # WARNMODE=1 selects strict compiler warnings. +-# STATICLINK=1 use static linking (MinGW32, MSVC, BeOS). ++# STATICLINK=1 use static linking (MinGW32, MSVC, BeOS, Haiku). + # STATICRUNTIME=1 link to a static C runtime library (/MT) (MSVC) + # TARGET_ARCH_COMPAT optimize for the given processor while preserving backwards + # compatibility with older processors (GCC-based platforms). +@@ -132,7 +132,7 @@ + # XXX this is duplicated in makefile.in + DOCBASEFILES = ahack changes faq mistakes help thanks allegro const abi api packfile \ + readme makedoc datafile grabber dat dat2c dat2s license addons targets +-DOCBUILDFILES = bcc32 beos darwin djgpp dmc linux macosx mingw32 msvc qnx unix watcom ++DOCBUILDFILES = bcc32 beos darwin djgpp dmc haiku linux macosx mingw32 msvc qnx unix watcom + DOCTXTBUILDFILES = $(addprefix docs/build/,$(addsuffix .txt,$(DOCBUILDFILES))) + + DOCS = $(addprefix docs/txt/,$(addsuffix .txt,$(filter-out changes thanks readme, $(DOCBASEFILES)))) +diff -urN allegro-4.3.10plus/makefile.be allegro-4.3.10plus-haiku/makefile.be +--- allegro-4.3.10plus/makefile.be 2008-10-15 14:44:47.000000000 +0000 ++++ allegro-4.3.10plus-haiku/makefile.be 2008-10-15 15:01:00.000000000 +0000 +@@ -10,11 +10,20 @@ + + # -------- define some variables that the primary makefile will use -------- + ++OS=$(shell uname -s) ++ ++ifeq ($(OS),BeOS) + PLATFORM = BeOS ++endif ++ ++ifeq ($(OS),Haiku) ++PLATFORM = Haiku ++endif ++ + CC = gcc + EXE = + OBJ = .o +-HTML = html ++#HTML = html + + PLATFORM_DIR = obj/beos + +@@ -109,7 +118,7 @@ + # ------ build a C-only version ------ + + VPATH += src/c +-MY_OBJECTS = $(C_OBJECTS) cmiscs ++MY_OBJECTS = $(C_OBJECTS) + CFLAGS += -DALLEGRO_NO_ASM + + else +@@ -123,7 +132,13 @@ + + OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_BEOS_FILES))) + ++ifeq ($(OS),BeOS) + LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia -lnet ++endif ++ ++ifeq ($(OS),Haiku) ++LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia -lnetwork ++endif + + PROGRAMS = bfixicon + +@@ -135,11 +150,21 @@ + + # -------- rules for installing and removing the library files -------- + ++ifeq ($(OS),BeOS) + INSTALLDIR = /boot/develop + LIBDIR = lib/x86 + INCDIR = headers + + SHARED_LIBDIR = /boot/home/config/lib ++endif ++ ++ifeq ($(OS),Haiku) ++INSTALLDIR = /boot/common ++LIBDIR = lib ++INCDIR = include ++ ++SHARED_LIBDIR = /boot/common/lib ++endif + + + ifdef STATICLINK +@@ -167,7 +192,14 @@ + sed -e "s/@LIBS@/$(LIBRARIES)/" temp2 > temp + sed -e "s/include/headers/" temp >temp2 + sed -e "s/ -l\$${lib_type}_unsharable//" temp2 >temp ++ ++ifeq ($(OS),BeOS) + sed -e "s/libdirs=-L\$${exec_prefix}\/lib/libdirs=\"-L\$${exec_prefix}\/lib\/x86 -L\/boot\/home\/config\/lib\"/" temp >/bin/allegro-config ++endif ++ifeq ($(OS),Haiku) ++ sed -e "s/libdirs=-L\$${exec_prefix}\/lib/libdirs=\"-L\$${exec_prefix}\/lib\/x86 -L\/boot\/common\/lib\"/" temp >/bin/allegro-config ++endif ++ + rm -f temp temp2 + chmod a+x /bin/allegro-config + +diff -urN allegro-4.3.10plus/misc/mkunixdists.sh allegro-4.3.10plus-haiku/misc/mkunixdists.sh +--- allegro-4.3.10plus/misc/mkunixdists.sh 2008-10-15 14:43:09.000000000 +0000 ++++ allegro-4.3.10plus-haiku/misc/mkunixdists.sh 2008-10-15 15:01:00.000000000 +0000 +@@ -73,9 +73,9 @@ + # Hack'n'slash + echo "Stripping to form end-user distribution" + (cd $dir/$basename && { +- (cd src && rm -rf beos qnx dos mac ppc win) +- (cd obj && rm -rf bcc32 beos qnx djgpp mingw32 msvc watcom) +- (cd lib && rm -rf bcc32 beos qnx djgpp mingw32 msvc watcom) ++ (cd src && rm -rf beos haiku qnx dos mac ppc win) ++ (cd obj && rm -rf bcc32 beos haiku qnx djgpp mingw32 msvc watcom) ++ (cd lib && rm -rf bcc32 beos haiku qnx djgpp mingw32 msvc watcom) + (cd include && rm -f bealleg.h qnxalleg.h macalleg.h winalleg.h) + (cd misc && rm -f cmplog.pl dllsyms.lst findtext.sh fixpatch.sh fixver.sh) + (cd misc && rm -f allegro-config-qnx.sh zipup.sh zipwin.sh *.bat *.c) +@@ -94,8 +94,8 @@ + (cd addons/jpgalleg && rm -f makefile.be makefile.mgw makefile.dj) + (cd addons/jpgalleg && rm -f makefile.osx makefile.vc fix.bat readme.txt) + (cd addons/jpgalleg/misc && rm -f fixver.sh runner.c) +- (cd addons/jpgalleg/lib && rm -rf beos djgpp macosx mingw32 msvc) +- (cd addons/jpgalleg/obj && rm -rf beos djgpp macosx mingw32 msvc) ++ (cd addons/jpgalleg/lib && rm -rf beos djgpp haiku macosx mingw32 msvc) ++ (cd addons/jpgalleg/obj && rm -rf beos djgpp haiku macosx mingw32 msvc) + + # logg addon + (cd addons/logg && rm -f Makefile.mingw play_ogg.c stream_ogg.c fix.bat) +diff -urN allegro-4.3.10plus/misc/zipup.sh allegro-4.3.10plus-haiku/misc/zipup.sh +--- allegro-4.3.10plus/misc/zipup.sh 2008-10-15 14:43:09.000000000 +0000 ++++ allegro-4.3.10plus-haiku/misc/zipup.sh 2008-10-15 15:01:00.000000000 +0000 +@@ -125,6 +125,12 @@ + + make depend UNIX_TOOLS=1 CC=gcc + ++# generate dependencies for Haiku ++echo "Generating Haiku dependencies..." ++ ++./fix.sh haiku --quick ++ ++make depend UNIX_TOOLS=1 CC=gcc + + # generate dependencies for QNX + echo "Generating QNX dependencies..." +@@ -164,7 +170,7 @@ + for base in abi ahack allegro const faq help mistakes; do + ./_makedoc.exe -ascii docs/txt/$base.txt docs/src/$base._tx + done +-for base in bcc32 beos darwin djgpp linux macosx mingw32 msvc qnx unix watcom; do ++for base in bcc32 beos darwin djgpp haiku linux macosx mingw32 msvc qnx unix watcom; do + ./_makedoc.exe -ascii docs/build/$base.txt docs/src/build/$base._tx + done + +diff -urN allegro-4.3.10plus/setup/keyconf.c allegro-4.3.10plus-haiku/setup/keyconf.c +--- allegro-4.3.10plus/setup/keyconf.c 2008-10-15 14:43:30.000000000 +0000 ++++ allegro-4.3.10plus-haiku/setup/keyconf.c 2008-10-15 15:01:00.000000000 +0000 +@@ -25,8 +25,8 @@ + + + /* The code can't link on platforms that don't use src/misc/pckeys.c (everything +- * but DOS, QNX, BEOS). */ +-#if (defined ALLEGRO_DOS) || (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) ++ * but DOS, QNX, BEOS, HAIKU). */ ++#if (defined ALLEGRO_DOS) || (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) || (defined ALLEGRO_HAIKU) + + + char *ascii_name[32] = +diff -urN allegro-4.3.10plus/src/beos/baccel.cpp allegro-4.3.10plus-haiku/src/beos/baccel.cpp +--- allegro-4.3.10plus/src/beos/baccel.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/baccel.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -20,7 +20,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bdispsw.cpp allegro-4.3.10plus-haiku/src/beos/bdispsw.cpp +--- allegro-4.3.10plus/src/beos/bdispsw.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bdispsw.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bdwindow.cpp allegro-4.3.10plus-haiku/src/beos/bdwindow.cpp +--- allegro-4.3.10plus/src/beos/bdwindow.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bdwindow.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -21,7 +21,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +@@ -260,8 +260,10 @@ + cmap[i] = BScreen().IndexForColor(((i >> 4) & 0xF0) | (i >> 8), (i & 0xF0) | ((i >> 4) & 0xF), (i & 0xF) | ((i & 0xF) << 4)); + } + } ++#if 0 + TRACE(PREFIX_I "Color conversion mode set: %d->%d\n", + (int)screen_depth, (int)display_depth); ++#endif + } + + if (rects) { +diff -urN allegro-4.3.10plus/src/beos/bgfx.c allegro-4.3.10plus-haiku/src/beos/bgfx.c +--- allegro-4.3.10plus/src/beos/bgfx.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bgfx.c 2008-10-15 15:01:00.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + + +diff -urN allegro-4.3.10plus/src/beos/bgfxapi.cpp allegro-4.3.10plus-haiku/src/beos/bgfxapi.cpp +--- allegro-4.3.10plus/src/beos/bgfxapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bgfxapi.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bgfxdrv.c allegro-4.3.10plus-haiku/src/beos/bgfxdrv.c +--- allegro-4.3.10plus/src/beos/bgfxdrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bgfxdrv.c 2008-10-15 15:01:00.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + BEGIN_GFX_DRIVER_LIST + GFX_DRIVER_BEOS +diff -urN allegro-4.3.10plus/src/beos/bjoy.c allegro-4.3.10plus-haiku/src/beos/bjoy.c +--- allegro-4.3.10plus/src/beos/bjoy.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bjoy.c 2008-10-15 15:01:00.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bjoyapi.cpp allegro-4.3.10plus-haiku/src/beos/bjoyapi.cpp +--- allegro-4.3.10plus/src/beos/bjoyapi.cpp 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bjoyapi.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + static BJoystick *be_joy = NULL; + static int32 num_devices, num_axes, num_hats, num_buttons; +@@ -64,12 +64,12 @@ + device_config = get_config_string("joystick", "joystick_device", ""); + + /* Let's try to open selected device */ +- if ((device_config[0] == '\0') || (be_joy->Open(device_config) < 0)) { ++ if ((device_config[0] == '\0') || (be_joy->Open(device_config, true) < 0)) { + /* ok, let's try to open first available device */ + if (be_joy->GetDeviceName(0, device_name) != B_OK) { + goto cleanup; + } +- if (be_joy->Open(device_name) == B_ERROR) { ++ if (be_joy->Open(device_name, true) == B_ERROR) { + goto cleanup; + } + } +diff -urN allegro-4.3.10plus/src/beos/bjoydrv.c allegro-4.3.10plus-haiku/src/beos/bjoydrv.c +--- allegro-4.3.10plus/src/beos/bjoydrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bjoydrv.c 2008-10-15 15:01:00.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + BEGIN_JOYSTICK_DRIVER_LIST + JOYSTICK_DRIVER_BEOS +diff -urN allegro-4.3.10plus/src/beos/bkey.c allegro-4.3.10plus-haiku/src/beos/bkey.c +--- allegro-4.3.10plus/src/beos/bkey.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bkey.c 2008-10-15 15:01:00.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + + +diff -urN allegro-4.3.10plus/src/beos/bkeyapi.cpp allegro-4.3.10plus-haiku/src/beos/bkeyapi.cpp +--- allegro-4.3.10plus/src/beos/bkeyapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bkeyapi.cpp 2008-10-15 15:01:00.000000000 +0000 +@@ -22,9 +22,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + #define KEY_ID_PC101 0 // the docs say it should be 0x83ab, but they lie + +@@ -260,7 +260,9 @@ + key_info_old = key_info_new; + } + ++#if 0 + TRACE(PREFIX_I "keyboard thread exited\n"); ++#endif + + return 0; + } +diff -urN allegro-4.3.10plus/src/beos/bkeydrv.c allegro-4.3.10plus-haiku/src/beos/bkeydrv.c +--- allegro-4.3.10plus/src/beos/bkeydrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bkeydrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + _DRIVER_INFO _keyboard_driver_list[] = + { +diff -urN allegro-4.3.10plus/src/beos/bmidi.c allegro-4.3.10plus-haiku/src/beos/bmidi.c +--- allegro-4.3.10plus/src/beos/bmidi.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmidi.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + MIDI_DRIVER midi_beos = + { +diff -urN allegro-4.3.10plus/src/beos/bmidiapi.cpp allegro-4.3.10plus-haiku/src/beos/bmidiapi.cpp +--- allegro-4.3.10plus/src/beos/bmidiapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmidiapi.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + + BMidiSynth *_be_midisynth = NULL; +diff -urN allegro-4.3.10plus/src/beos/bmididrv.c allegro-4.3.10plus-haiku/src/beos/bmididrv.c +--- allegro-4.3.10plus/src/beos/bmididrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmididrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + BEGIN_MIDI_DRIVER_LIST + MIDI_DRIVER_BEOS +diff -urN allegro-4.3.10plus/src/beos/bmousapi.cpp allegro-4.3.10plus-haiku/src/beos/bmousapi.cpp +--- allegro-4.3.10plus/src/beos/bmousapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmousapi.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -23,9 +23,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + #define MOUSE_THREAD_NAME "mouse driver" + #define MOUSE_THREAD_PRIORITY 60 +@@ -78,7 +78,9 @@ + + if (mouse_thread_running == false) { + release_sem(_be_mouse_view_attached); ++#if 0 + TRACE(PREFIX_I "mouse thread exited\n"); ++#endif + + return 0; + } +diff -urN allegro-4.3.10plus/src/beos/bmousdrv.c allegro-4.3.10plus-haiku/src/beos/bmousdrv.c +--- allegro-4.3.10plus/src/beos/bmousdrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmousdrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + + +diff -urN allegro-4.3.10plus/src/beos/bmouse.c allegro-4.3.10plus-haiku/src/beos/bmouse.c +--- allegro-4.3.10plus/src/beos/bmouse.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bmouse.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + + +diff -urN allegro-4.3.10plus/src/beos/boverlay.cpp allegro-4.3.10plus-haiku/src/beos/boverlay.cpp +--- allegro-4.3.10plus/src/beos/boverlay.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/boverlay.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bsnd.c allegro-4.3.10plus-haiku/src/beos/bsnd.c +--- allegro-4.3.10plus/src/beos/bsnd.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsnd.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + DIGI_DRIVER digi_beos = + { +diff -urN allegro-4.3.10plus/src/beos/bsndapi.cpp allegro-4.3.10plus-haiku/src/beos/bsndapi.cpp +--- allegro-4.3.10plus/src/beos/bsndapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsndapi.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -20,7 +20,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bsnddrv.c allegro-4.3.10plus-haiku/src/beos/bsnddrv.c +--- allegro-4.3.10plus/src/beos/bsnddrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsnddrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,9 +19,9 @@ + #include "allegro/internal/aintern.h" + + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + BEGIN_DIGI_DRIVER_LIST + DIGI_DRIVER_BEOS +diff -urN allegro-4.3.10plus/src/beos/bsysapi.cpp allegro-4.3.10plus-haiku/src/beos/bsysapi.cpp +--- allegro-4.3.10plus/src/beos/bsysapi.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsysapi.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -27,9 +27,9 @@ + #include + #endif + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + #define SYS_THREAD_PRIORITY B_NORMAL_PRIORITY + #define SYS_THREAD_NAME "system driver" +@@ -144,7 +144,9 @@ + + _be_allegro_app->Run(); + ++#if 0 + TRACE(PREFIX_I "system thread exited\n"); ++#endif + + return 0; + } +@@ -201,8 +203,6 @@ + uname(&os_name); + os_type = OSTYPE_BEOS; + os_multitasking = TRUE; +- os_version = atoi(strtok(os_name.release, ".")); +- os_revision = atoi(strtok(NULL, ".")); + + chdir(app_path); + +diff -urN allegro-4.3.10plus/src/beos/bsysdrv.c allegro-4.3.10plus-haiku/src/beos/bsysdrv.c +--- allegro-4.3.10plus/src/beos/bsysdrv.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsysdrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + _DRIVER_INFO _system_driver_list[] = + { +diff -urN allegro-4.3.10plus/src/beos/bsystem.c allegro-4.3.10plus-haiku/src/beos/bsystem.c +--- allegro-4.3.10plus/src/beos/bsystem.c 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bsystem.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,11 +19,9 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif +- +- ++#endif + + SYSTEM_DRIVER system_beos = { + SYSTEM_BEOS, +diff -urN allegro-4.3.10plus/src/beos/btimeapi.cpp allegro-4.3.10plus-haiku/src/beos/btimeapi.cpp +--- allegro-4.3.10plus/src/beos/btimeapi.cpp 2008-10-15 14:29:36.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/btimeapi.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/btimedrv.c allegro-4.3.10plus-haiku/src/beos/btimedrv.c +--- allegro-4.3.10plus/src/beos/btimedrv.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/btimedrv.c 2008-10-15 15:01:01.000000000 +0000 +@@ -18,9 +18,9 @@ + #include "allegro.h" + #include "allegro/internal/aintern.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile +-#endif ++#endif + + _DRIVER_INFO _timer_driver_list[] = { + {TIMER_BEOS, &timer_beos, TRUE}, +diff -urN allegro-4.3.10plus/src/beos/btimer.c allegro-4.3.10plus-haiku/src/beos/btimer.c +--- allegro-4.3.10plus/src/beos/btimer.c 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/btimer.c 2008-10-15 15:01:01.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +diff -urN allegro-4.3.10plus/src/beos/bwindow.cpp allegro-4.3.10plus-haiku/src/beos/bwindow.cpp +--- allegro-4.3.10plus/src/beos/bwindow.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bwindow.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +@@ -117,7 +117,7 @@ + /* _be_gfx_bwindow_read_write_bank: + * Returns new line and marks it as dirty. + */ +-extern "C" unsigned long _be_gfx_bwindow_read_write_bank(BITMAP *bmp, int line) ++extern "C" uintptr_t _be_gfx_bwindow_read_write_bank(BITMAP *bmp, int line) + { + if (!bmp->id & BMP_ID_LOCKED) { + bmp->id |= (BMP_ID_LOCKED | BMP_ID_AUTOLOCK); +diff -urN allegro-4.3.10plus/src/beos/bwscreen.cpp allegro-4.3.10plus-haiku/src/beos/bwscreen.cpp +--- allegro-4.3.10plus/src/beos/bwscreen.cpp 2008-10-15 14:29:35.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/beos/bwscreen.cpp 2008-10-15 15:01:01.000000000 +0000 +@@ -19,7 +19,7 @@ + #include "allegro/internal/aintern.h" + #include "allegro/platform/aintbeos.h" + +-#ifndef ALLEGRO_BEOS ++#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU + #error something is wrong with the makefile + #endif + +@@ -474,7 +474,7 @@ + /* be_gfx_bwindowscreen_read_write_bank: + * Returns new line and synchronizes framebuffer if needed. + */ +-extern "C" unsigned long be_gfx_bwindowscreen_read_write_bank(BITMAP *bmp, int line) ++extern "C" uintptr_t be_gfx_bwindowscreen_read_write_bank(BITMAP *bmp, int line) + { + if (!(bmp->id & BMP_ID_LOCKED)) { + _be_sync_func(); +@@ -490,7 +490,7 @@ + */ + extern "C" void be_gfx_bwindowscreen_unwrite_bank(BITMAP *bmp) + { +- if (bmp->id & BMP_AUTOLOCK) { ++ if (bmp->id & BMP_ID_AUTOLOCK) { + bmp->id &= ~(BMP_ID_LOCKED | BMP_ID_AUTOLOCK); + } + } +diff -urN allegro-4.3.10plus/src/i386/asmdefs.inc allegro-4.3.10plus-haiku/src/i386/asmdefs.inc +--- allegro-4.3.10plus/src/i386/asmdefs.inc 2008-10-15 14:31:06.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/i386/asmdefs.inc 2008-10-15 15:01:01.000000000 +0000 +@@ -31,6 +31,8 @@ + #include "obj/msvc/asmdef.inc" + #elif defined ALLEGRO_WATCOM + #include "obj/watcom/asmdef.inc" ++#elif defined ALLEGRO_HAIKU ++ #include "obj/beos/asmdef.inc" + #elif defined ALLEGRO_BEOS + #include "obj/beos/asmdef.inc" + #elif defined ALLEGRO_QNX +diff -urN allegro-4.3.10plus/src/midi.c allegro-4.3.10plus-haiku/src/midi.c +--- allegro-4.3.10plus/src/midi.c 2008-10-15 14:33:58.000000000 +0000 ++++ allegro-4.3.10plus-haiku/src/midi.c 2008-10-15 15:01:01.000000000 +0000 +@@ -1122,7 +1122,7 @@ + running_status = 0; + + while (p < end) { /* work through data stream */ +-#ifdef ALLEGRO_BEOS ++#if defined ALLEGRO_BEOS || defined ALLEGRO_HAIKU + /* Is there a bug in this routine, or in gcc under BeOS/x86? --PW */ + { int i; for (i=1; i; i--); } + #endif +diff -urN allegro-4.3.10plus/tools/dat2c.c allegro-4.3.10plus-haiku/tools/dat2c.c +--- allegro-4.3.10plus/tools/dat2c.c 2008-10-15 14:36:09.000000000 +0000 ++++ allegro-4.3.10plus-haiku/tools/dat2c.c 2008-10-15 15:01:01.000000000 +0000 +@@ -342,7 +342,7 @@ + } + + if (dat2c->lformat == lineformat_default) +-#if (defined ALLEGRO_UNIX || defined ALLEGRO_QNX || defined ALLEGRO_BEOS || defined ALLEGRO_MACOSX) ++#if (defined ALLEGRO_UNIX || defined ALLEGRO_QNX || defined ALLEGRO_BEOS || defined ALLEGRO_HAIKU || defined ALLEGRO_MACOSX) + dat2c->lformat = lineformat_unix; + #elif (defined ALLEGRO_WINDOWS || defined ALLEGRO_DOS) + dat2c->lformat = lineformat_dos; +diff -urN allegro-4.3.10plus/tools/datedit.c allegro-4.3.10plus-haiku/tools/datedit.c +--- allegro-4.3.10plus/tools/datedit.c 2008-10-15 14:36:09.000000000 +0000 ++++ allegro-4.3.10plus-haiku/tools/datedit.c 2008-10-15 15:01:01.000000000 +0000 +@@ -121,6 +121,8 @@ + #include "obj/dmc/plugins.h" + #elif defined ALLEGRO_BEOS + #include "obj/beos/plugins.h" ++ #elif defined ALLEGRO_HAIKU ++ #include "obj/beos/plugins.h" + #elif defined ALLEGRO_BCC32 + #include "obj/bcc32/plugins.h" + #elif defined ALLEGRO_MPW +diff -urN allegro-4.3.10plus/tools/grabber.c allegro-4.3.10plus-haiku/tools/grabber.c +--- allegro-4.3.10plus/tools/grabber.c 2008-10-15 14:36:09.000000000 +0000 ++++ allegro-4.3.10plus-haiku/tools/grabber.c 2008-10-15 15:01:01.000000000 +0000 +@@ -3132,6 +3132,7 @@ + case OSTYPE_QNX: s = "QNX"; break; + case OSTYPE_UNIX: s = "Unix"; break; + case OSTYPE_BEOS: s = "BeOS"; break; ++ case OSTYPE_HAIKU: s = "Haiku"; break; + case OSTYPE_MACOS: s = "MacOS"; break; + case OSTYPE_MACOSX: s = "MacOS X"; break; + default: s = "Unknown"; break;