diff --git a/src/Makefile b/src/Makefile index 983f62a7..16ada824 100644 --- a/src/Makefile +++ b/src/Makefile @@ -202,7 +202,7 @@ LIBS+=-lm endif ifdef SDL -include sdl2/Makefile.cfg +include sdl/Makefile.cfg endif #ifdef SDL ifdef DISTCC diff --git a/src/Makefile.cfg b/src/Makefile.cfg index e4f9290c..1ea96df9 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -386,7 +386,7 @@ OBJDUMP_OPTS?=--wide --source --line-numbers LD=$(CC) ifdef SDL - INTERFACE=sdl2 + INTERFACE=sdl OBJDIR:=$(OBJDIR)/SDL endif diff --git a/src/sdl/MakeNIX.cfg b/src/sdl/MakeNIX.cfg index 457f5230..f5c9b207 100644 --- a/src/sdl/MakeNIX.cfg +++ b/src/sdl/MakeNIX.cfg @@ -30,6 +30,10 @@ ifdef NOTERMIOS endif endif +ifdef LINUX64 + OPTS+=-DLINUX64 +endif + # #here is Solaris # @@ -89,4 +93,4 @@ ifndef NOHW endif # name of the exefile - EXENAME?=lsdlsrb2 + EXENAME?=lsdl2srb2 diff --git a/src/sdl/Makefile.cfg b/src/sdl/Makefile.cfg index 1d404c4c..3b92a9fb 100644 --- a/src/sdl/Makefile.cfg +++ b/src/sdl/Makefile.cfg @@ -43,9 +43,9 @@ SDL_CFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --cflags) SDL_LDFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --libs) else ifdef PREFIX - SDL_CONFIG?=$(PREFIX)-sdl-config + SDL_CONFIG?=$(PREFIX)-sdl2-config else - SDL_CONFIG?=sdl-config + SDL_CONFIG?=sdl2-config endif ifdef STATIC @@ -95,33 +95,28 @@ endif endif endif -ifdef FILTERS - OBJS+=$(OBJDIR)/filters.o $(OBJDIR)/hq2x.o $(OBJDIR)/lq2x.o - OPTS+=-DHAVE_FILTER -endif - ifdef NOMIXER i_sound_o=$(OBJDIR)/sdl_sound.o else i_sound_o=$(OBJDIR)/mixer_sound.o OPTS+=-DHAVE_MIXER - SDL_LDFLAGS+=-lSDL_mixer + SDL_LDFLAGS+=-lSDL2_mixer endif ifdef SDL_TTF OPTS+=-DHAVE_TTF - SDL_LDFLAGS+=-lSDL_ttf -lfreetype -lz + SDL_LDFLAGS+=-lSDL2_ttf -lfreetype -lz OBJS+=$(OBJDIR)/i_ttf.o endif -#ifdef SDL_IMAGE -# OPTS+=-DHAVE_IMAGE -# SDL_LDFLAGS+=-lSDL_image -#endif +ifdef SDL_IMAGE + OPTS+=-DHAVE_IMAGE + SDL_LDFLAGS+=-lSDL2_image +endif ifdef SDL_NET OPTS+=-DHAVE_SDLNET - SDL_LDFLAGS+=-lSDL_net + SDL_LDFLAGS+=-lSDL2_net endif ifdef SDLMAIN diff --git a/src/sdl/SRB2CE/Makefile.cfg b/src/sdl/SRB2CE/Makefile.cfg deleted file mode 100644 index 8d4ae3e4..00000000 --- a/src/sdl/SRB2CE/Makefile.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# -# Makefile.cfg for WinCE with GCC -# - -OPTS+=-D_WIN32_WCE -D_UNICODE -SDL_CFLAGS?= -SDL_LDFLAGS?= -NOHS=1 -NOHW=1 -NONET=1 -NOMIXER=1 -NOPNG=1 diff --git a/src/sdl/SRB2CE/SRB2CE.zip b/src/sdl/SRB2CE/SRB2CE.zip deleted file mode 100644 index 3ac8530d..00000000 Binary files a/src/sdl/SRB2CE/SRB2CE.zip and /dev/null differ diff --git a/src/sdl/SRB2CE/cehelp.c b/src/sdl/SRB2CE/cehelp.c deleted file mode 100644 index b9fafd04..00000000 --- a/src/sdl/SRB2CE/cehelp.c +++ /dev/null @@ -1,447 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2004 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// DESCRIPTION: -// stub and replacement "ANSI" C functions for use under Windows CE -// -//----------------------------------------------------------------------------- - -#include "../../doomdef.h" -#include "cehelp.h" - -#define _SEC_IN_MINUTE 60 -#define _SEC_IN_HOUR 3600 -#define _SEC_IN_DAY 86400 - -static const int DAYS_IN_MONTH[12] = -{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - -#define _DAYS_IN_MONTH(x) ((x == 1) ? days_in_feb : DAYS_IN_MONTH[x]) - -static const int _DAYS_BEFORE_MONTH[12] = -{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; - -#define _ISLEAP(y) (((y) % 4) == 0 && (((y) % 100) != 0 || (((y)+1900) % 400) == 0)) -#define _DAYS_IN_YEAR(year) (_ISLEAP(year) ? 366 : 365) - -char *strerror(int ecode) -{ - static char buff[1024 + 1]; - DWORD dwMsgLen = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - ecode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &buff[0], 1024, NULL); - return buff; -} - -int unlink( const char *filename ) -{ - return remove(filename); -} - -int remove( const char *path ) -{ - return DeleteFileA(path)-1; -} - -int rename( const char *oldname, const char *newname ) -{ - return MoveFileA(oldname, newname)!=0; -} - -static inline void STToTM(const SYSTEMTIME *st, struct tm *tm) -{ - if (!st || !tm) return; - tm->tm_sec = st->wSecond; - tm->tm_min = st->wMinute; - tm->tm_hour = st->wHour; - tm->tm_mday = st->wDay; - tm->tm_mon = st->wMonth - 1; - tm->tm_year = st->wYear - 1900; - tm->tm_wday = st->wDayOfWeek; - tm->tm_yday = 0; - tm->tm_isdst = 0; -} - -time_t time(time_t *T) -{ - time_t returntime; - SYSTEMTIME st; - struct tm stft; - GetSystemTime(&st); - STToTM(&st,&stft); - returntime = mktime(&stft); - if (T) *T = returntime; - return returntime; -} - -static inline UINT64 TTtoFT(const time_t wt, FILETIME *ft) -{ - UINT64 temptime = wt; // FILETIME: 1/(10^7) secs since January 1, 1601 - temptime *= 10000000; // time_t : 1 secs since January 1, 1970 - // 369 years * 365 days * 24 hours * 60 mins * 60 secs * 10 - // 123 leaps days * 24 hours * 60 mins * 60 secs * 10 - temptime += 116444736000000000; - if (ft) CopyMemory(ft,&temptime,sizeof (ULARGE_INTEGER)); - return temptime; -} - -static struct tm cehelptm; - -struct tm * localtime(const time_t *CLOCK) -{ - SYSTEMTIME st; - FILETIME stft; - UINT64 ftli = 0; - if (CLOCK) ftli = TTtoFT(*CLOCK, &stft); - if (ftli) - FileTimeToSystemTime(&stft,&st); - else - GetSystemTime(&st); - STToTM(&st,&cehelptm); - if (st.wYear >= 1970) - return &cehelptm; - else - return NULL; -} - -static void validate_structure (struct tm *tim_p) // from newlib -{ - div_t res; - int days_in_feb = 28; - - /* calculate time & date to account for out of range values */ - if (tim_p->tm_sec < 0 || tim_p->tm_sec > 59) - { - res = div (tim_p->tm_sec, 60); - tim_p->tm_min += res.quot; - if ((tim_p->tm_sec = res.rem) < 0) - { - tim_p->tm_sec += 60; - --tim_p->tm_min; - } - } - - if (tim_p->tm_min < 0 || tim_p->tm_min > 59) - { - res = div (tim_p->tm_min, 60); - tim_p->tm_hour += res.quot; - if ((tim_p->tm_min = res.rem) < 0) - { - tim_p->tm_min += 60; - --tim_p->tm_hour; - } - } - - if (tim_p->tm_hour < 0 || tim_p->tm_hour > 23) - { - res = div (tim_p->tm_hour, 24); - tim_p->tm_mday += res.quot; - if ((tim_p->tm_hour = res.rem) < 0) - { - tim_p->tm_hour += 24; - --tim_p->tm_mday; - } - } - - if (tim_p->tm_mon > 11) - { - res = div (tim_p->tm_mon, 12); - tim_p->tm_year += res.quot; - if ((tim_p->tm_mon = res.rem) < 0) - { - tim_p->tm_mon += 12; - --tim_p->tm_year; - } - } - - if (_DAYS_IN_YEAR (tim_p->tm_year) == 366) - days_in_feb = 29; - - if (tim_p->tm_mday <= 0) - { - while (tim_p->tm_mday <= 0) - { - if (--tim_p->tm_mon == -1) - { - tim_p->tm_year--; - tim_p->tm_mon = 11; - days_in_feb = - ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ? - 29 : 28); - } - tim_p->tm_mday += _DAYS_IN_MONTH (tim_p->tm_mon); - } - } - else - { - while (tim_p->tm_mday > _DAYS_IN_MONTH (tim_p->tm_mon)) - { - tim_p->tm_mday -= _DAYS_IN_MONTH (tim_p->tm_mon); - if (++tim_p->tm_mon == 12) - { - tim_p->tm_year++; - tim_p->tm_mon = 0; - days_in_feb = - ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ? - 29 : 28); - } - } - } -} - -time_t mktime (struct tm *tim_p) // from newlib -{ - time_t tim = 0; - long days = 0; - int year; - - /* validate structure */ - validate_structure (tim_p); - - /* compute hours, minutes, seconds */ - tim += tim_p->tm_sec + (tim_p->tm_min * _SEC_IN_MINUTE) + - (tim_p->tm_hour * _SEC_IN_HOUR); - - /* compute days in year */ - days += tim_p->tm_mday - 1; - days += _DAYS_BEFORE_MONTH[tim_p->tm_mon]; - if (tim_p->tm_mon > 1 && _DAYS_IN_YEAR (tim_p->tm_year) == 366) - days++; - - /* compute day of the year */ - tim_p->tm_yday = days; - - if (tim_p->tm_year > 10000 - || tim_p->tm_year < -10000) - { - return (time_t) -1; - } - - /* compute days in other years */ - if (tim_p->tm_year > 70) - { - for (year = 70; year < tim_p->tm_year; year++) - days += _DAYS_IN_YEAR (year); - } - else if (tim_p->tm_year < 70) - { - for (year = 69; year > tim_p->tm_year; year--) - days -= _DAYS_IN_YEAR (year); - days -= _DAYS_IN_YEAR (year); - } - - /* compute day of the week */ - if ((tim_p->tm_wday = (days + 4) % 7) < 0) - tim_p->tm_wday += 7; - - /* compute total seconds */ - tim += (days * _SEC_IN_DAY); - - return tim; -} - -#undef WINAPI -#define WINAPI __stdcall //__delcspec(dllexport) - -#ifdef _MSC_VER -//#pragma warning(disable : 4273) -#endif - - -static __forceinline int STRtoWSTR(LPCSTR lpMultiByteStr, int cchMultiByte, - LPWSTR lpWideCharStr, int cchWideChar) -{ - return MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpMultiByteStr, - cchMultiByte,lpWideCharStr,cchWideChar); -} - -static __forceinline int WSTRtoSTR(LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR lpMultiByteStr, int cbMultiByte) -{ - return WideCharToMultiByte(CP_ACP,WC_COMPOSITECHECK|WC_SEPCHARS, - lpWideCharStr,cchWideChar,lpMultiByteStr,cbMultiByte,NULL,NULL); -} - -DWORD WINAPI FormatMessageA( - DWORD dwFlags, - LPCVOID lpSource, - DWORD dwMessageId, - DWORD dwLanguageId, - LPSTR lpBuffer, - DWORD nSize, - va_list *Arguments) -{ - const int nSizeW = STRtoWSTR(lpBuffer,nSize,NULL,0); - int nSizeF = 0; - LPWSTR lpBufferW = alloca(sizeof (wchar_t)*nSizeW); - LPWSTR lpSourceW = NULL; - - if (!lpBufferW) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - ZeroMemory(lpBuffer,nSize); - return nSizeF; - } - - if (dwFlags & FORMAT_MESSAGE_FROM_STRING) - { - const int sLen = STRtoWSTR(lpSource, -1, NULL, 0); - lpSourceW = alloca(sizeof (wchar_t)*sLen); - - if (lpSourceW) - STRtoWSTR(lpSource, -1, lpSourceW, sLen); - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return nSizeF; - } - } - - if (lpSourceW) - nSizeF = FormatMessageW(dwFlags, lpSourceW, dwMessageId, dwLanguageId, - lpBufferW, nSizeW, Arguments); - else - nSizeF = FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, - lpBufferW, nSizeW, Arguments); - - return WSTRtoSTR(lpBufferW, nSizeF, lpBuffer, nSize); -} - -BOOL WINAPI DeleteFileA( - LPCSTR lpFileName) -{ - const int sLen = STRtoWSTR(lpFileName, -1, NULL, 0); - LPWSTR lpFileNameW = alloca(sizeof (wchar_t)*sLen); - - if (lpFileNameW) - STRtoWSTR(lpFileName, -1, lpFileNameW, sLen); - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - return DeleteFileW(lpFileNameW); -} - -BOOL WINAPI MoveFileA( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName -) -{ - const int sLen1 = STRtoWSTR(lpExistingFileName, -1, NULL, 0); - LPWSTR lpExistingFileNameW = alloca(sizeof (wchar_t)*sLen1); - - const int sLen2 = STRtoWSTR(lpNewFileName, -1, NULL, 0); - LPWSTR lpNewFileNameW = alloca(sizeof (wchar_t)*sLen2); - - - if (!lpExistingFileNameW || !lpNewFileNameW) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - STRtoWSTR(lpExistingFileName, -1, lpExistingFileNameW, sLen1); - STRtoWSTR(lpNewFileName, -1, lpNewFileNameW, sLen2); - - return MoveFileW(lpExistingFileNameW, lpNewFileNameW); -} - - -HANDLE WINAPI CreateFileA( - LPCSTR lpFileName, - DWORD dwDesiredAccess, - DWORD dwShareMode, - LPSECURITY_ATTRIBUTES lpSecurityAttributes, - DWORD dwCreationDisposition, - DWORD dwFlagsAndAttributes, - HANDLE hTemplateFile) -{ - const int sLen = STRtoWSTR(lpFileName, -1, NULL, 0); - LPWSTR lpFileNameW = alloca(sizeof (wchar_t)*sLen); - - if (lpFileNameW) - STRtoWSTR(lpFileName, -1, lpFileNameW, sLen); - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return INVALID_HANDLE_VALUE; - } - - return CreateFileW(lpFileNameW, dwDesiredAccess, dwShareMode, - lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, - hTemplateFile); -} - -BOOL WINAPI CreateDirectoryA( - LPCSTR lpPathName, - LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ - const int sLen = STRtoWSTR(lpPathName, -1, NULL, 0); - LPWSTR lpPathNameW = alloca(sizeof (wchar_t)*sLen); - - if (lpPathNameW) - STRtoWSTR(lpPathName, -1, lpPathNameW, sLen); - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - return CreateDirectoryW(lpPathNameW, lpSecurityAttributes); -} - -int WINAPI MessageBoxA( - HWND hWnd , - LPCSTR lpText, - LPCSTR lpCaption, - UINT uType) -{ - const int sLen1 = STRtoWSTR(lpText, -1, NULL, 0); - LPWSTR lpTextW = alloca(sizeof (wchar_t)*sLen1); - - const int sLen2 = STRtoWSTR(lpCaption, -1, NULL, 0); - LPWSTR lpCaptionW = alloca(sizeof (wchar_t)*sLen2); - - - if (!lpTextW || !lpCaptionW) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - STRtoWSTR(lpText, -1, lpTextW, sLen1); - STRtoWSTR(lpCaption, -1, lpCaptionW, sLen2); - - return MessageBoxW(hWnd, lpTextW, lpCaptionW, uType); -} - -VOID WINAPI OutputDebugStringA( - LPCSTR lpOutputString) -{ - const int sLen = STRtoWSTR(lpOutputString, -1, NULL, 0); - LPWSTR lpOutputStringW = alloca(sizeof (wchar_t)*sLen); - - if (lpOutputStringW) - STRtoWSTR(lpOutputString, -1, lpOutputStringW, sLen); - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return; - } - - OutputDebugStringW(lpOutputStringW); -} - diff --git a/src/sdl/SRB2CE/cehelp.h b/src/sdl/SRB2CE/cehelp.h deleted file mode 100644 index bc265b05..00000000 --- a/src/sdl/SRB2CE/cehelp.h +++ /dev/null @@ -1,63 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2004 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// DESCRIPTION: -// stub and replacement "ANSI" C functions for use under Windows CE -// -//----------------------------------------------------------------------------- - -#ifndef __I_WINCE__ -#define __I_WINCE__ - -#ifdef USEASMCE -#define USEASM // Remline if NASM doesn't work on x86 targets -#endif - -char *strerror(int ecode); -int access(const char *path, int amode); -int unlink( const char *filename ); -int remove( const char *path ); -int rename( const char *oldname, const char *newname ); -//CreateDirectoryEx( const char *currectpath, const char *path,SECURITY_ATTRIBUTES) - -#ifndef _TIME_T_DEFINED -typedef long time_t; /* time value */ -#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ -#endif - -time_t time(time_t *T); - -#ifndef __GNUC__ -#ifndef _TM_DEFINED -struct tm { - int tm_sec; /* seconds after the minute - [0,59] */ - int tm_min; /* minutes after the hour - [0,59] */ - int tm_hour; /* hours since midnight - [0,23] */ - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday - [0,6] */ - int tm_yday; /* days since January 1 - [0,365] */ - int tm_isdst; /* daylight savings time flag */ - }; -#define _TM_DEFINED -#endif - -struct tm * localtime(const time_t *CLOCK); - -time_t mktime (struct tm *tim_p); -#endif - -#endif diff --git a/src/sdl/SRB2DC/.gitignore b/src/sdl/SRB2DC/.gitignore deleted file mode 100644 index a966585d..00000000 --- a/src/sdl/SRB2DC/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/scramble diff --git a/src/sdl/SRB2DC/IP.BIN b/src/sdl/SRB2DC/IP.BIN deleted file mode 100644 index c3366213..00000000 Binary files a/src/sdl/SRB2DC/IP.BIN and /dev/null differ diff --git a/src/sdl/SRB2DC/Makefile.cfg b/src/sdl/SRB2DC/Makefile.cfg deleted file mode 100644 index 3edaf8a1..00000000 --- a/src/sdl/SRB2DC/Makefile.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# -# Makefile.cfg for SRB2/Dreamcast -# - -#include $(KOS_BASE)/Makefile.rules - -# -#hmmm, the Dreamcast -# - - HOSTCC:=$(CC) - CC=$(KOS_CC) - PREFIX=$(KOS_CC_BASE)/bin/$(KOS_CC_PREFIX) - OBJDUMP=$(PREFIX)-objdump - OBJCOPY=$(PREFIX)-objcopy - - #NOHW=1 #No working MiniGL right now - NOHS=1 #No HWSound right now -ifndef LWIP - NONET=1 #No LWIP -endif - #i_net_o=$(OBJDIR)/i_udp.o #use KOS's UDP - #NOMIXER=1 #Basic sound only - NOIPX=1 #No IPX network code - NOPNG=1 #No Screenshot - - OPTS=$(KOS_CFLAGS) -DUNIXCOMMON -DDC -ifndef NOHW - OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY -DKOS_GL_COMPATIBILITY -endif - SDL_CFLAGS?=-I$(KOS_BASE)/addons/include/SDL - SDL_LDFLAGS?=-lSDL - LDFLAGS=$(KOS_LDFLAGS) - LIBS:=$(KOS_LIBS) -lconio -lm -ifndef NOMIXER - LIBS:=-loggvorbisplay -lSDL $(LIBS) -endif - -ifdef LWIP - OPTS+=-I$(KOS_BASE)/../kos-ports/lwip/kos/include -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include/ipv4 -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include -DIPv4 - LIBS:=-llwip4 -lkosutils $(LIBS) - OPTS+=-DHAVE_LWIP -endif -ifndef NOHW - LIBS+=-lgl -endif - - i_system_o+=$(OBJDIR)/dchelp.o - i_main_o=$(KOS_START) $(OBJDIR)/i_main.o $(OBJEXTRA) - - # name of the exefile - EXENAME?=SRB2.elf - BINNAME?=SRB2.BIN diff --git a/src/sdl/SRB2DC/SELFBOOT.BIN b/src/sdl/SRB2DC/SELFBOOT.BIN deleted file mode 100644 index a87ee386..00000000 Binary files a/src/sdl/SRB2DC/SELFBOOT.BIN and /dev/null differ diff --git a/src/sdl/SRB2DC/VMU.xbm b/src/sdl/SRB2DC/VMU.xbm deleted file mode 100644 index 0d56985f..00000000 --- a/src/sdl/SRB2DC/VMU.xbm +++ /dev/null @@ -1,19 +0,0 @@ -#define VMU_width 48 -#define VMU_height 32 -static unsigned char VMU_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x58, 0x75, 0x00, 0x00, 0x00, 0x00, 0xee, 0xaa, 0x00, 0x00, - 0x00, 0x86, 0x55, 0x55, 0x01, 0x00, 0x00, 0xda, 0xc8, 0xaf, 0x00, 0x00, - 0x00, 0x62, 0x55, 0x54, 0x00, 0x00, 0x00, 0x32, 0xa2, 0x6c, 0x00, 0x00, - 0x00, 0x5c, 0x55, 0xfd, 0x01, 0x00, 0x00, 0xac, 0x88, 0xaa, 0x02, 0x00, - 0x00, 0x54, 0x75, 0x55, 0x05, 0x00, 0x00, 0xac, 0xbf, 0xaa, 0x0a, 0x00, - 0x00, 0xd6, 0x61, 0x55, 0x15, 0x00, 0x00, 0xe9, 0xc0, 0xaa, 0x2a, 0x00, - 0x00, 0x39, 0x40, 0x55, 0x55, 0x00, 0x00, 0x6d, 0xc0, 0xaa, 0xbe, 0x00, - 0x00, 0x6d, 0x40, 0xd5, 0xc3, 0x00, 0x00, 0x6d, 0xc0, 0xea, 0x00, 0x00, - 0x00, 0x29, 0x60, 0xf5, 0x00, 0x00, 0x00, 0x26, 0xe0, 0xfa, 0x00, 0x00, - 0x00, 0x58, 0xb8, 0xbd, 0x00, 0x00, 0x00, 0x84, 0x07, 0xdf, 0x00, 0x00, - 0x00, 0x08, 0x20, 0xae, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x5f, 0x01, 0x00, - 0x00, 0xc0, 0x3f, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/src/sdl/SRB2DC/dchelp.c b/src/sdl/SRB2DC/dchelp.c deleted file mode 100644 index 5fdf04bc..00000000 --- a/src/sdl/SRB2DC/dchelp.c +++ /dev/null @@ -1,134 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2006 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// DESCRIPTION: -// stub and replacement "ANSI" C functions for use on Dreamcast/KOS -// -//----------------------------------------------------------------------------- -#include -#include -#ifndef HAVE_LWIP -#include -#endif -#include "../../doomdef.h" -#include "dchelp.h" - -int access(const char *path, int amode) -{ - file_t handle = FILEHND_INVALID; - - if (amode == F_OK || amode == R_OK) - handle=fs_open(path,O_RDONLY); - else if (amode == (R_OK|W_OK)) - handle=fs_open(path,O_RDWR); - else if (amode == W_OK) - handle=fs_open(path,O_WRONLY); - - if (handle != FILEHND_INVALID) - { - fs_close(handle); - return 0; - } - - return -1; -} - -double hypot(double x, double y) -{ - double ax, yx, yx2, yx1; - if (abs(y) > abs(x)) // |y|>|x| - { - ax = abs(y); // |y| => ax - yx = (x/y); - } - else // |x|>|y| - { - ax = abs(x); // |x| => ax - yx = (x/y); - } - yx2 = yx*yx; // (x/y)^2 - yx1 = sqrt(1+yx2); // (1 + (x/y)^2)^1/2 - return ax*yx1; // |x|*((1 + (x/y)^2)^1/2) -} - -#if !(defined (NONET) || defined (NOMD5)) -#ifdef HAVE_LWIP - -#include - -static uint8 ip[4]; -static char *h_addr_listtmp[2] = {ip, NULL}; -static struct hostent hostenttmp = {NULL, NULL, 0, 1, h_addr_listtmp}; - -struct hostent *gethostbyname(const char *name) -{ - struct sockaddr_in dnssrv; - dnssrv.sin_family = AF_INET; - dnssrv.sin_port = htons(53); - dnssrv.sin_addr.s_addr = htonl(0x0a030202); ///< what? - if (lwip_gethostbyname(&dnssrv, name, ip) < 0) - return NULL; - else - return &hostenttmp; -} -#else - -struct hostent *gethostbyname(const char *name) -{ - (void)name; - return NULL; -} - -int ioctl(int s, long cmd, void *argp) -{ - return fs_ioctl(s, argp, cmd); //FIONBIO? -} - -int select(int maxfdp1, void *readset, void *writeset, void *exceptset, - void *timeout) -{ - (void)maxfdp1; - (void)readset; - (void)writeset; - (void)exceptset; - (void)timeout; - errno = EAFNOSUPPORT; - return -1; -} - -int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen) -{ - (void)s; - (void)level; //SOL_SOCKET - (void)optname; //SO_RCVBUF, SO_ERROR - (void)optval; - (void)optlen; - errno = EAFNOSUPPORT; - return -1; -} - -int setsockopt (int s, int level, int optname, void *optval, socklen_t optlen) -{ - (void)s; - (void)level; //SOL_SOCKET - (void)optname; //SO_REUSEADDR, SO_BROADCAST, SO_RCVBUF - (void)optval; - (void)optlen; - errno = EAFNOSUPPORT; - return -1; -} - -#endif -#endif diff --git a/src/sdl/SRB2DC/dchelp.h b/src/sdl/SRB2DC/dchelp.h deleted file mode 100644 index 236f3111..00000000 --- a/src/sdl/SRB2DC/dchelp.h +++ /dev/null @@ -1,51 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2006 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// DESCRIPTION: -// stub and replacement "ANSI" C functions for use on Dreamcast/KOS -// -//----------------------------------------------------------------------------- - -#ifndef __I_DREAMCAST__ -#define __I_DREAMCAST__ - -struct hostent -{ - char *h_name; /* Official name of host. */ - char **h_aliases; /* Alias list. */ - int h_addrtype; /* Host address type. */ - int h_length; /* Length of address. */ - char **h_addr_list; /* List of addresses from name server. */ -#define h_addr h_addr_list[0] /* Address, for backward compatibility. */ -}; - -struct hostent *gethostbyname(const char *name); - -#ifndef HAVE_LWIP -#define INADDR_NONE ((uint32) 0xffffffff) -#define INADDR_LOOPBACK ((uint32) 0x7f000001) -#define SOCK_STREAM 1 -#define FIONBIO 0 -#define SOL_SOCKET 0 -#define SO_ERROR 0 -#define SO_REUSEADDR 0 -#define SO_BROADCAST 0 -#define SO_RCVBUF 0 -int ioctl(int s, long cmd, void *argp); -int select(int maxfdp1, void *readset, void *writeset, void *exceptset, void *timeout); -int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); -int setsockopt(int s, int level, int optname, void *optval, socklen_t optlen); -#endif -#endif diff --git a/src/sdl/SRB2DC/i_udp.c b/src/sdl/SRB2DC/i_udp.c deleted file mode 100644 index ec5e305f..00000000 --- a/src/sdl/SRB2DC/i_udp.c +++ /dev/null @@ -1,455 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 2005 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief KOS UDP network interface - -#include "../../doomdef.h" - -#include "../../i_system.h" -#include "../../d_event.h" -#include "../../d_net.h" -#include "../../m_argv.h" - -#include "../../doomstat.h" - -#include "../../i_net.h" - -#include "../../z_zone.h" - -#include "../../i_tcp.h" - -#include -//#include -#define NET_NONE 0x00000000 -#define NET_LOCAL 0x0100007F -#define NET_ANY 0xFFFFFFFF - -#define MAXBANS 20 - -typedef struct -{ - uint32 host; - uint16 port; -} IPaddress; - -static IPaddress clientaddress[MAXNETNODES+1]; -static boolean nodeconnected[MAXNETNODES+1]; - -static int mysocket = 0; -static boolean init_KOSUDP_driver = false; - -static size_t numbans = 0; -static IPaddress banned[MAXBANS]; -static boolean KOSUDP_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? - -static inline int net_udp_sendto(int sock, const uint8 *data, int size, uint16 rem_port, uint32 rem_addr) -{ - uint8 dst_ip[4] = {((uint8*)(&(rem_addr)))[0], - ((uint8*)(&(rem_addr)))[1], - ((uint8*)(&(rem_addr)))[2], - ((uint8*)(&(rem_addr)))[3]}; - return net_udp_send_raw(net_default_dev, clientaddress[0].port, rem_port, dst_ip, data, size); - (void)sock; -} - -static inline int net_udp_recvfrom(int sock, uint8 *buf, int size, uint16 *rem_port, uint32 *rem_addr) -{ - return net_udp_recv(sock, buf, size); - (void)rem_port; - (void)rem_addr; -} - -static const char *KOSUDP_AddrToStr(IPaddress* sk) -{ - static char s[22]; // 255.255.255.255:65535 - sprintf(s,"%d.%d.%d.%d:%d", - ((uint8*)(&(sk->host)))[3], - ((uint8*)(&(sk->host)))[2], - ((uint8*)(&(sk->host)))[1], - ((uint8*)(&(sk->host)))[0], - net_ntohs(sk->port)); - return s; -} - -static const char *KOSUDP_GetNodeAddress(int node) -{ - if (!nodeconnected[node]) - return NULL; - return KOSUDP_AddrToStr(&clientaddress[node]); -} - -static const char *KOSUDP_GetBanAddress(size_t ban) -{ - if (ban > numbans) - return NULL; - return KOSUDP_AddrToStr(&banned[ban]); -} - -static boolean KOSUDP_cmpaddr(IPaddress* a, IPaddress* b) -{ - return (a->host == b->host && (b->port == 0 || a->port == b->port)); -} - -static SINT8 getfreenode(void) -{ - SINT8 j; - - for (j = 0; j < MAXNETNODES; j++) - if (!nodeconnected[j]) - { - nodeconnected[j] = true; - return j; - } - return -1; -} - -static void KOSUDP_Get(void) -{ - int size; - size_t i; - SINT8 j; - IPaddress temp = {clientaddress[BROADCASTADDR].host,clientaddress[BROADCASTADDR].port}; - - size = net_udp_recvfrom(mysocket,(char *)&doomcom->data, MAXPACKETLENGTH, &temp.port, &temp.host); - if (size == 0) - { - doomcom->remotenode = -1; // no packet - return; - } - - // find remote node number - for (i = 0; i < MAXNETNODES; i++) - if (KOSUDP_cmpaddr(&temp, &(clientaddress[i]))) - { - doomcom->remotenode = (INT16)i; // good packet from a game player - doomcom->datalength = (INT16)size; - return; - } - - // not found - - // find a free slot - j = getfreenode(); - if (j > 0) - { - M_Memcpy(&clientaddress[j], &temp, sizeof (temp)); - DEBFILE(va("New node detected: node:%d address:%s\n", j, - KOSUDP_GetNodeAddress(j))); - doomcom->remotenode = (INT16)j; // good packet from a game player - doomcom->datalength = (INT16)size; - // check if it's a banned dude so we can send a refusal later - for (i = 0; i < numbans; i++) - if (KOSUDP_cmpaddr(&temp, &banned[i])) - { - KOSUDP_bannednode[j] = true; - DEBFILE("This dude has been banned\n"); - break; - } - if (i == numbans) - KOSUDP_bannednode[j] = false; - return; - } - - DEBFILE("New node detected: No more free slots\n"); - doomcom->remotenode = -1; // no packet -} - -#if 0 -static boolean KOSUDP_CanSend(void) -{ - return true; -} -#endif - -static void KOSUDP_Send(void) -{ - const IPaddress *nodeinfo; - - if (!doomcom->remotenode || !nodeconnected[doomcom->remotenode]) - return; - - nodeinfo = clientaddress + doomcom->remotenode; - - if (net_udp_sendto(mysocket, (char *)&doomcom->data, doomcom->datalength, nodeinfo->port, nodeinfo->host) == -1) - { - CONS_Printf("KOSUDP: error sending data\n"); - } -} - -static void KOSUDP_FreeNodenum(int numnode) -{ - // can't disconnect from self :) - if (!numnode) - return; - - DEBFILE(va("Free node %d (%s)\n", numnode, KOSUDP_GetNodeAddress(numnode))); - - nodeconnected[numnode] = false; - - memset(&clientaddress[numnode], 0, sizeof (IPaddress)); -} - -static int KOSUDP_Socket(void) -{ - int temp = 0; - uint16 portnum = 0; - const uint32 hostip = net_default_dev?net_ntohl(net_ipv4_address(net_default_dev->ip_addr)):NET_LOCAL; - //Hurdler: I'd like to put a server and a client on the same computer - //Logan: Me too - //BP: in fact for client we can use any free port we want i have read - // in some doc that connect in udp can do it for us... - //Alam: where? - if (M_CheckParm("-clientport")) - { - if (!M_IsNextParm()) - I_Error("syntax: -clientport "); - portnum = net_ntohs(atoi(M_GetNextParm())); - } - else - portnum = net_ntohs(sock_port); - - temp = net_udp_sock_open(portnum, hostip, portnum, NET_NONE); - if (temp) - { - int btemp = net_udp_sock_open(portnum, hostip, portnum, NET_ANY); - clientaddress[0].port = portnum; - clientaddress[0].host = NET_NONE; - if (btemp) - { - clientaddress[BROADCASTADDR].port = net_ntohs(sock_port); - clientaddress[BROADCASTADDR].host = NET_ANY; - } - else - { - CONS_Printf("KOSUDP: can't setup broadcast sock\n"); - net_udp_sock_close(temp); - return 0; - } - } - else - { - CONS_Printf("KOSUDP: can't setup main sock\n"); - return 0; - } - - doomcom->extratics = 1; // internet is very high ping - - return temp; -} - -static void I_ShutdownKOSUDPDriver(void) -{ - //net_shutdown(); - init_KOSUDP_driver = false; -} - -static void I_InitKOSUDPDriver(void) -{ - if (init_KOSUDP_driver) - I_ShutdownKOSUDPDriver(); - else - net_init(); - D_SetDoomcom(); - memset(&clientaddress,0,sizeof (clientaddress)); - init_KOSUDP_driver = true; -} - -static void KOSUDP_CloseSocket(void) -{ - if (mysocket) - net_udp_sock_close(mysocket); - mysocket = 0; -} - -static SINT8 KOSUDP_NetMakeNodewPort(const char *hostname, const char* port) -{ - SINT8 newnode; - uint16 portnum = net_ntohs(sock_port); - - if (port && !port[0]) - portnum = net_ntohs((UINT16)atoi(port)); - - newnode = getfreenode(); - if (newnode == -1) - return -1; - // find ip of the server - clientaddress[newnode].port = portnum; - clientaddress[newnode].host = inet_addr(hostname); - - if (clientaddress[newnode].host == NET_NONE) - { - free(hostname); - return -1; - } - return newnode; -} - -static boolean KOSUDP_OpenSocket(void) -{ - size_t i; - - memset(clientaddress, 0, sizeof (clientaddress)); - - for (i = 0; i < MAXNETNODES; i++) - nodeconnected[i] = false; - - //CONS_Printf("KOSUDP Code starting up\n"); - - nodeconnected[0] = true; // always connected to self - nodeconnected[BROADCASTADDR] = true; - I_NetSend = KOSUDP_Send; - I_NetGet = KOSUDP_Get; - I_NetCloseSocket = KOSUDP_CloseSocket; - I_NetFreeNodenum = KOSUDP_FreeNodenum; - I_NetMakeNodewPort = KOSUDP_NetMakeNodewPort; - - //I_NetCanSend = KOSUDP_CanSend; - - // build the socket but close it first - KOSUDP_CloseSocket(); - mysocket = KOSUDP_Socket(); - - if (mysocket) - { -#if 0 - // for select - myset = SDLNet_AllocSocketSet(1); - if (!myset) - { - CONS_Printf("SDL_Net: %s",SDLNet_GetError()); - return false; - } - if (SDLNet_UDP_AddSocket(myset,mysocket) == -1) - { - CONS_Printf("SDL_Net: %s",SDLNet_GetError()); - return false; - } -#endif - return true; - } - return false; -} - -static boolean KOSUDP_Ban(int node) -{ - if (numbans == MAXBANS) - return false; - - M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress)); - banned[numbans].port = 0' - numbans++; - return true; -} - -static void KOSUDP_ClearBans(void) -{ - numbans = 0; -} - -// -// I_InitNetwork -// Only required for DOS, so this is more a dummy -// -boolean I_InitNetwork(void) -{ - char serverhostname[255]; - boolean ret = false; - //if (!M_CheckParm ("-kosnet")) - // return false; - // initilize the driver - I_InitKOSUDPDriver(); - I_AddExitFunc(I_ShutdownKOSUDPDriver); - if (!init_KOSUDP_driver) - return false; - - if (M_CheckParm("-udpport")) - { - if (M_IsNextParm()) - sock_port = (UINT16)atoi(M_GetNextParm()); - else - sock_port = 0; - } - - // parse network game options, - if (M_CheckParm("-server") || dedicated) - { - server = true; - - // If a number of clients (i.e. nodes) is specified, the server will wait for the clients - // to connect before starting. - // If no number is specified here, the server starts with 1 client, and others can join - // in-game. - // Since Boris has implemented join in-game, there is no actual need for specifying a - // particular number here. - // FIXME: for dedicated server, numnodes needs to be set to 0 upon start -/* if (M_IsNextParm()) - doomcom->numnodes = (INT16)atoi(M_GetNextParm()); - else */if (dedicated) - doomcom->numnodes = 0; - else - doomcom->numnodes = 1; - - if (doomcom->numnodes < 0) - doomcom->numnodes = 0; - if (doomcom->numnodes > MAXNETNODES) - doomcom->numnodes = MAXNETNODES; - - // server - servernode = 0; - // FIXME: - // ??? and now ? - // server on a big modem ??? 4*isdn - net_bandwidth = 16000; - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - - ret = true; - } - else if (M_CheckParm("-connect")) - { - if (M_IsNextParm()) - strcpy(serverhostname, M_GetNextParm()); - else - serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it - - // server address only in ip - if (serverhostname[0]) - { - COM_BufAddText("connect \""); - COM_BufAddText(serverhostname); - COM_BufAddText("\"\n"); - - // probably modem - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - } - else - { - // so we're on a LAN - COM_BufAddText("connect any\n"); - - net_bandwidth = 800000; - hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - } - } - - I_NetOpenSocket = KOSUDP_OpenSocket; - I_Ban = KOSUDP_Ban; - I_ClearBans = KOSUDP_ClearBans; - I_GetNodeAddress = KOSUDP_GetNodeAddress; - I_GetBanAddress = KOSUDP_GetBanAddress; - bannednode = KOSUDP_bannednode; - - return ret; -} diff --git a/src/sdl/SRB2DC/scramble.c b/src/sdl/SRB2DC/scramble.c deleted file mode 100644 index a3483b00..00000000 --- a/src/sdl/SRB2DC/scramble.c +++ /dev/null @@ -1,259 +0,0 @@ -#include -#include - -#define MAXCHUNK (2048*1024) - -static unsigned int seed; - -void my_srand(unsigned int n) -{ - seed = n & 0xffff; -} - -unsigned int my_rand() -{ - seed = (seed * 2109 + 9273) & 0x7fff; - return (seed + 0xc000) & 0xffff; -} - -void load(FILE *fh, unsigned char *ptr, unsigned long sz) -{ - if (fread(ptr, 1, sz, fh) != sz) - { - fprintf(stderr, "Read error!\n"); - exit(1); - } -} - -void load_chunk(FILE *fh, unsigned char *ptr, unsigned long sz) -{ - static int idx[MAXCHUNK/32]; - int i; - - /* Convert chunk size to number of slices */ - sz /= 32; - - /* Initialize index table with unity, - so that each slice gets loaded exactly once */ - for (i = 0; i < sz; i++) - idx[i] = i; - - for (i = sz-1; i >= 0; --i) - { - /* Select a replacement index */ - int x = (my_rand() * i) >> 16; - - /* Swap */ - int tmp = idx[i]; - idx[i] = idx[x]; - idx[x] = tmp; - - /* Load resulting slice */ - load(fh, ptr+32*idx[i], 32); - } -} - -void load_file(FILE *fh, unsigned char *ptr, unsigned long filesz) -{ - unsigned long chunksz; - - my_srand(filesz); - - /* Descramble 2 meg blocks for as long as possible, then - gradually reduce the window down to 32 bytes (1 slice) */ - for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1) - while (filesz >= chunksz) - { - load_chunk(fh, ptr, chunksz); - filesz -= chunksz; - ptr += chunksz; - } - - /* Load final incomplete slice */ - if (filesz) - load(fh, ptr, filesz); -} - -void read_file(char *filename, unsigned char **ptr, unsigned long *sz) -{ - FILE *fh = fopen(filename, "rb"); - if (fh == NULL) - { - fprintf(stderr, "Can't open \"%s\".\n", filename); - exit(1); - } - if (fseek(fh, 0, SEEK_END)<0) - { - fprintf(stderr, "Seek error.\n"); - exit(1); - } - *sz = ftell(fh); - *ptr = malloc(*sz); - if ( *ptr == NULL ) - { - fprintf(stderr, "Out of memory.\n"); - exit(1); - } - if (fseek(fh, 0, SEEK_SET)<0) - { - fprintf(stderr, "Seek error.\n"); - exit(1); - } - load_file(fh, *ptr, *sz); - fclose(fh); -} - -void save(FILE *fh, unsigned char *ptr, unsigned long sz) -{ - if (fwrite(ptr, 1, sz, fh) != sz) - { - fprintf(stderr, "Write error!\n"); - exit(1); - } -} - -void save_chunk(FILE *fh, unsigned char *ptr, unsigned long sz) -{ - static int idx[MAXCHUNK/32]; - int i; - - /* Convert chunk size to number of slices */ - sz /= 32; - - /* Initialize index table with unity, - so that each slice gets saved exactly once */ - for (i = 0; i < sz; i++) - idx[i] = i; - - for (i = sz-1; i >= 0; --i) - { - /* Select a replacement index */ - int x = (my_rand() * i) >> 16; - - /* Swap */ - int tmp = idx[i]; - idx[i] = idx[x]; - idx[x] = tmp; - - /* Save resulting slice */ - save(fh, ptr+32*idx[i], 32); - } -} - -void save_file(FILE *fh, unsigned char *ptr, unsigned long filesz) -{ - unsigned long chunksz; - - my_srand(filesz); - - /* Descramble 2 meg blocks for as long as possible, then - gradually reduce the window down to 32 bytes (1 slice) */ - for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1) - while (filesz >= chunksz) - { - save_chunk(fh, ptr, chunksz); - filesz -= chunksz; - ptr += chunksz; - } - - /* Save final incomplete slice */ - if (filesz) - save(fh, ptr, filesz); -} - -void write_file(char *filename, unsigned char *ptr, unsigned long sz) -{ - FILE *fh = fopen(filename, "wb"); - if (fh == NULL) - { - fprintf(stderr, "Can't open \"%s\".\n", filename); - exit(1); - } - save_file(fh, ptr, sz); - fclose(fh); -} - -void descramble(char *src, char *dst) -{ - unsigned char *ptr = NULL; - unsigned long sz = 0; - FILE *fh; - - read_file(src, &ptr, &sz); - - fh = fopen(dst, "wb"); - if (fh == NULL) - { - fprintf(stderr, "Can't open \"%s\".\n", dst); - exit(1); - } - if ( fwrite(ptr, 1, sz, fh) != sz ) - { - fprintf(stderr, "Write error.\n"); - exit(1); - } - fclose(fh); - free(ptr); -} - -void scramble(char *src, char *dst) -{ - unsigned char *ptr = NULL; - unsigned long sz = 0; - FILE *fh; - - fh = fopen(src, "rb"); - if (fh == NULL) - { - fprintf(stderr, "Can't open \"%s\".\n", src); - exit(1); - } - if (fseek(fh, 0, SEEK_END)<0) - { - fprintf(stderr, "Seek error.\n"); - exit(1); - } - sz = ftell(fh); - ptr = malloc(sz); - if ( ptr == NULL ) - { - fprintf(stderr, "Out of memory.\n"); - exit(1); - } - if (fseek(fh, 0, SEEK_SET)<0) - { - fprintf(stderr, "Seek error.\n"); - exit(1); - } - if ( fread(ptr, 1, sz, fh) != sz ) - { - fprintf(stderr, "Read error.\n"); - exit(1); - } - fclose(fh); - - write_file(dst, ptr, sz); - - free(ptr); -} - -int main(int argc, char *argv[]) -{ - int opt = 0; - - if (argc > 1 && !strcmp(argv[1], "-d")) - opt ++; - - if (argc != 3+opt) - { - fprintf(stderr, "Usage: %s [-d] from to\n", argv[0]); - exit(1); - } - - if (opt) - descramble(argv[2], argv[3]); - else - scramble(argv[1], argv[2]); - - return 0; -} diff --git a/src/sdl/SRB2PS3/ICON0.png b/src/sdl/SRB2PS3/ICON0.png deleted file mode 100644 index 140230c1..00000000 Binary files a/src/sdl/SRB2PS3/ICON0.png and /dev/null differ diff --git a/src/sdl/SRB2PS3/Makefile.cfg b/src/sdl/SRB2PS3/Makefile.cfg deleted file mode 100644 index a4a01714..00000000 --- a/src/sdl/SRB2PS3/Makefile.cfg +++ /dev/null @@ -1,139 +0,0 @@ -# -# Makefile.cfg for SRB2 for the PlayStation 3 using PSL1GHT -# - -# Check if PS3DEV and PSL1GHT is set in the environment. If so, continue with compilation. -.SUFFIXES: - -ifeq ($(strip $(PS3DEV)),) -$(error "Please set PS3DEV in your environment. export PS3DEV=ps3dev-toolchain") -endif - -ifeq ($(strip $(PSL1GHT)),) -$(error "Please set PSL1GHT in your environment. export PSL1GHT=PSL1GHT") -endif - -# Set compiler flags - -# Disable same warning flags -WFLAGS+=-Wno-shadow -Wno-char-subscripts -Wno-format - -ifdef JAILBREAK -EXENAME?=SRB2PS3-jb.elf -PKGNAME?=SRB2PS3-jb.pkg -else -EXENAME?=SRB2PS3.elf -PKGNAME?=SRB2PS3.pkg -endif -DGBNAME?=$(EXENAME).debug - -SRB2PS3DIR=sdl/SRB2PS3 -ICON0?=$(SRB2PS3DIR)/ICON0.png -SFOXML?=sfo.xml -SRB2TTF?=sdl/srb2.ttf - -TITLE=Sonic Robo Blast 2 v2.0.6 -APPID=SRB2-PS3 -CONTENTID=UP0001-$(APPID)_00-0000000000000000 - -FSELF=$(PS3DEV)/bin/fself.py -MAKE_SELF_NPDRM=$(PS3DEV)/ps3publictools/make_self_npdrm -FINALIZE=$(PS3DEV)/ps3publictools/package_finalize -SFO=$(PS3DEV)/bin/sfo.py -PKG=$(PS3DEV)/bin/pkg.py -PS3LOADEXE=$(PS3DEV)/ps3tools/ps3load -SED=sed -MV=mv -XARGS=xargs -FOR=for -SHXARGS:=$(XARGS) -SHSED:=$(SED) -SPRXLINKER=$(PS3DEV)/bin/sprxlinker - -ifdef JAILBREAK -PKGDIR=$(BIN)/pkg-jb -else -PKGDIR=$(BIN)/pkg -endif -USRDIR=$(PKGDIR)/USRDIR -ETCDIR=$(USRDIR)/etc -WGET=wget -P $(ETCDIR) -c -nc - -ifndef ECHO - FSELF:=@$(FSELF) - MAKE_SELF_NPDRM:=@$(MAKE_SELF_NPDRM) - FINALIZE:=@$(FINALIZE) - SFO:=@$(SFO) - PKG:=@$(PKG) - PS3LOADEXE:=@$(PS3LOADEXE) - SED:=@$(SED) - MV:=@$(MV) - SPRXLINKER:=@$(SPRXLINKER) - XARGS:=@$(XARGS) - FOR:=@(FOR) -endif - -# SRB2PS3 needs SDL_ttf to display any console text -SDL_TTF=1 - -# newlib has no support for networking -#NONET=1 - -# use absolute paths because changing PATH variable breaks distcc -PREFIX := $(PS3DEV)/ppu/bin/$(PREFIX) - -# PS3DEV toolchain libdir and includedir -PS3DEV_INC := $(PS3DEV)/ppu/include -PS3DEV_LIB := $(PS3DEV)/ppu/lib - -# PSL1GHT libdir and includedir -PSL1GHT_INC := $(PSL1GHT)/ppu/include -PSL1GHT_LIB := $(PSL1GHT)/ppu/lib - -PS3PORTS := $(PS3DEV)/portlibs -PS3PORTS_BIN := $(PS3PORTS)/ppu/bin -PS3PORTS_INC := $(PS3PORTS)/ppu/include - -PNG_CONFIG := $(PS3PORTS_BIN)/libpng-config -# static compilation -PNG_STATIC=1 - -SDL_CONFIG := $(PS3PORTS_BIN)/sdl-config - -INCLUDE := -I$(PSL1GHT_INC) -I$(PS3DEV_INC) -I$(PS3PORTS_INC) - -OPTS+=-D_PS3 -DUNIXCOMMON -CFLAGS+= -g $(INCLUDE) -L$(PSL1GHT_LIB) -L$(PS3DEV_LIB) -L$(PS3DEV)/lib -CXXFLAGS+=$(CFLAGS) -LDFLAGS+= -B$(PSL1GHT_LIB) -B$(PS3DEV_LIB) -B$(PS3DEV)/lib -LIBS+=-lrsx -ifndef NONET -LIBS+=-lnet -lsysmodule -endif - -$(BIN)/$(PKGNAME): $(OBJS) $(BIN)/$(EXENAME) - @echo Linking $(PKGNAME)... - -$(MKDIR) $(ETCDIR) - $(CP) $(ICON0) $(PKGDIR) - $(CP) $(SRB2TTF) $(ETCDIR) -ifdef WITHDATA - $(FOR) datafile in $(shell echo $(D_FILES) | $(SHSED) 's/\.srb/\.wad/' | $(SHXARGS) -n 1 basename); do \ - $(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$datafile; \ - done -endif - $(SPRXLINKER) $(BIN)/$(EXENAME) -ifdef JAILBREAK - $(SED) 's/@@PS3_SYSTEM_VER@@/3.41/' $(SRB2PS3DIR)/$(SFOXML) > $(BIN)/$(SFOXML) - $(FSELF) -n $(BIN)/$(EXENAME) $(USRDIR)/EBOOT.BIN -else - $(SED) 's/@@PS3_SYSTEM_VER@@/3.55/' $(SRB2PS3DIR)/$(SFOXML) > $(BIN)/$(SFOXML) - $(MAKE_SELF_NPDRM) $(BIN)/$(EXENAME) $(USRDIR)/EBOOT.BIN $(CONTENTID) -endif - $(SFO) --title "$(TITLE)" --appid "$(APPID)" -f $(BIN)/$(SFOXML) $(PKGDIR)/PARAM.SFO - $(PKG) --contentid $(CONTENTID) $(PKGDIR)/ $(BIN)/$(PKGNAME) -ifndef JAILBREAK - $(FINALIZE) $(BIN)/$(PKGNAME) -endif - -run: $(BIN)/$(EXENAME) - $(PS3LOADEXE) $(USRDIR)/EBOOT.BIN diff --git a/src/sdl/SRB2PS3/sfo.xml b/src/sdl/SRB2PS3/sfo.xml deleted file mode 100644 index d7719b54..00000000 --- a/src/sdl/SRB2PS3/sfo.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - 02.06 - - - 0 - - - 1 - - - HG - - - This application was created with the official non-official SDK called PSL1GHT, for more information visit http://www.psl1ght.com/ . This is in no way associated with Sony Computer Entertainment Inc., please do not contact them for help, they will not be able to provide it. - - - 0 - - - 0@@PS3_SYSTEM_VER@@00 - - - 63 - - - 279 - - - Sonic Robo Blast 2 - - - SRB200000 - - - 02.06 - - diff --git a/src/sdl/SRB2PSP/ICON0.png b/src/sdl/SRB2PSP/ICON0.png deleted file mode 100644 index 140230c1..00000000 Binary files a/src/sdl/SRB2PSP/ICON0.png and /dev/null differ diff --git a/src/sdl/SRB2PSP/Makefile.cfg b/src/sdl/SRB2PSP/Makefile.cfg deleted file mode 100644 index f9ec6416..00000000 --- a/src/sdl/SRB2PSP/Makefile.cfg +++ /dev/null @@ -1,126 +0,0 @@ -# -# Makefile.cfg for SRB2/PSP -# - -# -#hmmm, the PSP -# - - PSPSDK=$(shell psp-config -p) - PSPDEV=$(shell psp-config -d) - PSPPREFIX=$(shell psp-config -P) - STRIP=psp-strip - MKSFO?=mksfoex -d MEMSIZE=1 - #MKSFO=mksfo - PACK_PBP=pack-pbp - FIXUP=psp-fixup-imports - HOSTCC:=$(CC) - CC=$(PSPDEV)/bin/psp-gcc - OBJCOPY=psp-objcopy - OBJDUMP=psp-objdump -ifdef FIXEDPRX - PRXGEN=psp-prxgen -else - PRXGEN=$(OBJCOPY) -endif -ifndef PRXSIGN - SIGNER:=$(PSPDEV)/bin/$(OBJCOPY) -endif - -ifndef ECHO - MKSFO:=@$(MKSFO) - PACK_PBP:=@$(PACK_PBP) - FIXUP:=@$(FIXUP) - PRXGEN:=@$(PRXGEN) -endif - - PSP_EBOOT_TITLE=SRB2-PSP vME - PSP_EBOOT_SFO=$(BIN)/PARAM.SFO - PSP_EBOOT_ICON=sdl/SRB2PSP/ICON0.png - PSP_EBOOT_ICON1=NULL - PSP_EBOOT_UNKPNG=NULL - PSP_EBOOT_PIC1=sdl/SRB2PSP/PIC1.png - PSP_EBOOT_SND0=NULL - PSP_EBOOT_PSAR=NULL - - SIGNER?=sdl/SRB2PSP/psp-prxsign/psp-prxsign - - SDL=1 - PREFIX=psp - NONX86=1 - #NOHW=1 - NOHS=1 - NOMD5=1 - NONET=1 #No TCPIP code - NOPNG=1 #No Screenshot - - OPTS=-I$(PSPPREFIX)/include -I$(PSPSDK)/include - OPTS+=-DUNIXCOMMON -DFORCESDLMAIN -G0 - WFLAGS+=-Wno-undef - WFLAGS+=-O1 - LIBS=-lm - SDL_CONFIG?=$(PSPPREFIX)/bin/sdl-config - #SDL_CFLAGS?=-I$(PSPDEV)/psp/include/SDL - #SDL_LDFLAGS?=-lSDLmain -lSDL -lglut -lGLU -lGL -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lpspvfpu -lpsprtc -ifndef NOMIXER - LIBS:=-liberty -lvorbisfile -lvorbis -logg -lSDL $(LIBS) -endif -ifndef NOHW - OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY - LIBS+=-lGLU -lGL -lm -endif - #PSPSDK_LIBS=-L$(PSPSDK)/lib -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk - #LIBS+=$(PSPSDK_LIBS) -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -ifdef FIXEDPRX - LDFLAGS := -specs=$(PSPSDK)/lib/prxspecs -Wl,-q,-T$(PSPSDK)/lib/linkfile.prx $(LDFLAGS) - LIBS+=$(PSPSDK)/lib/prxexports.o -endif - -ifeq ($(PSP_FW_VERSION),) -PSP_FW_VERSION=150 -endif - - CPPFLAGS:=-D_PSP_FW_VERSION=$(PSP_FW_VERSION) $(CPPFLAGS) - - - # name of the exefile - EXENAME?=SRB2PSP.elf - PRXNAME?=SRB2PSP.prx - DBGNAME?=SRB2PSP.debug - -post-build: $(BIN)/EBOOT.PBP - -kxploit: $(BIN)/$(EXENAME) $(PSP_EBOOT_SFO) - -$(MKDIR) "$(BIN)/kxploit/srb2" - @echo emitting kxploit/srb2/ - $(STRIP) $(BIN)/$(EXENAME) -o $(BIN)/kxploit/srb2/EBOOT.PBP - @echo emitting kxploit/srb2% - -$(MKDIR) "$(BIN)/kxploit/srb2%/" - $(PACK_PBP) "$(BIN)/kxploit/srb2%/EBOOT.PBP" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ - $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \ - $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR) - -sdl/SRB2PSP/psp-prxsign/psp-prxsign: - -$(MAKE) -C sdl/SRB2PSP/psp-prxsign CFLAGS=-pipe CC="$(HOSTCC)" - -fix-up: $(BIN)/$(EXENAME) - @echo Running psp-fixup-imports on $(EXENAME) - $(FIXUP) $(BIN)/$(EXENAME) - -$(BIN)/$(PRXNAME): $(BIN)/$(EXENAME) fix-up - @echo Building $(PRXNAME) out of $(EXENAME) - $(PRXGEN) $(BIN)/$(EXENAME) $@ - -$(BIN)/EBOOT.PBP: $(BIN)/$(PRXNAME) $(SIGNER) $(PSP_EBOOT_SFO) - @echo Signing and running pack-pbp to make PBP - $(SIGNER) $(BIN)/$(PRXNAME) $(BIN)/$(PRXNAME).sign - $(PACK_PBP) $@ $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ - $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \ - $(PSP_EBOOT_SND0) $(BIN)/$(PRXNAME).sign $(PSP_EBOOT_PSAR) - $(REMOVE) $(BIN)/$(PRXNAME).sign - -$(PSP_EBOOT_SFO): - -$(MKDIR) $(BIN) - $(MKSFO) '$(PSP_EBOOT_TITLE)' $@ - -#include $(PSPSDK)/lib/build.mak diff --git a/src/sdl/SRB2PSP/PIC1.png b/src/sdl/SRB2PSP/PIC1.png deleted file mode 100644 index 0722a96b..00000000 Binary files a/src/sdl/SRB2PSP/PIC1.png and /dev/null differ diff --git a/src/sdl/SRB2PSP/psp-prxsign/.gitignore b/src/sdl/SRB2PSP/psp-prxsign/.gitignore deleted file mode 100644 index 6a07f1a5..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/psp-prxsign -/psp-prxsign.exe diff --git a/src/sdl/SRB2PSP/psp-prxsign/Makefile b/src/sdl/SRB2PSP/psp-prxsign/Makefile deleted file mode 100644 index 4a9b7da0..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -EXE=psp-prxsign -SRC=main.c cmac.c -OBJ=$(SRC:.c=.o)# replaces the .c from SRC with .o - -OPENSSL_PKGCONFIG?=openssl -OPENSSL_CFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --cflags) -OPENSSL_LDFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --libs) - -CFLAGS+=$(OPENSSL_CFLAGS) -LDFLAGS+=$(OPENSSL_LDFLAGS) - -.PHONY : all # .PHONY ignores files named all - -all: $(EXE) # all is dependent on $(BIN) to be complete - - -$(EXE): $(OBJ) # $(EXE) is dependent on all of the files in $(OBJ) to exist - $(CC) $^ $(LDFLAGS) -o $@ - -.PHONY : clean # .PHONY ignores files named clean -clean: - -$(RM) $(OBJ) $(EXE) diff --git a/src/sdl/SRB2PSP/psp-prxsign/cmac.c b/src/sdl/SRB2PSP/psp-prxsign/cmac.c deleted file mode 100644 index f527f7a7..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/cmac.c +++ /dev/null @@ -1,130 +0,0 @@ -#include "cmac.h" - -#define AES_128 0 -unsigned char const_Rb[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 -}; -unsigned char const_Zero[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) -{ - int i; - for (i=0;i<16; i++) - { - out[i] = a[i] ^ b[i]; - } -} - -/* AES-CMAC Generation Function */ - -static inline void leftshift_onebit(unsigned char *input,unsigned char *output) -{ - int i; - unsigned char overflow = 0; - - for ( i=15; i>=0; i-- ) - { - output[i] = input[i] << 1; - output[i] |= overflow; - overflow = (input[i] & 0x80)?1:0; - } -} - -void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2) -{ - unsigned char L[16]; - unsigned char Z[16]; - unsigned char tmp[16]; - int i; - - for ( i=0; i<16; i++ ) Z[i] = 0; - - AES_KEY aes; - AES_set_encrypt_key(key, 128, &aes); - - AES_encrypt(Z, L, &aes); - - if ( (L[0] & 0x80) == 0 ) /* If MSB(L) = 0, then K1 = L << 1 */ - { - leftshift_onebit(L,K1); - } else { /* Else K1 = ( L << 1 ) (+) Rb */ - leftshift_onebit(L,tmp); - xor_128(tmp,const_Rb,K1); - } - - if ( (K1[0] & 0x80) == 0 ) - { - leftshift_onebit(K1,K2); - } else { - leftshift_onebit(K1,tmp); - xor_128(tmp,const_Rb,K2); - } -} - -static inline void padding ( unsigned char *lastb, unsigned char *pad, int length ) -{ - int j; - - /* original last block */ - for ( j=0; j<16; j++ ) - { - if ( j < length ) - { - pad[j] = lastb[j]; - } else if ( j == length ) { - pad[j] = 0x80; - } else { - pad[j] = 0x00; - } - } -} - -void AES_CMAC ( unsigned char *key, unsigned char *input, int length, unsigned char *mac ) -{ - unsigned char X[16],Y[16], M_last[16], padded[16]; - unsigned char K1[16], K2[16]; - int n, i, flag; - generate_subkey(key,K1,K2); - - n = (length+15) / 16; /* n is number of rounds */ - - if ( n == 0 ) - { - n = 1; - flag = 0; - } else { - if ( (length%16) == 0 ) { /* last block is a complete block */ - flag = 1; - } else { /* last block is not complete block */ - flag = 0; - } - - } - - if ( flag ) { /* last block is complete block */ - xor_128(&input[16*(n-1)],K1,M_last); - } else { - padding(&input[16*(n-1)],padded,length%16); - xor_128(padded,K2,M_last); - } - AES_KEY aes; - AES_set_encrypt_key(key, 128, &aes); - - for ( i=0; i<16; i++ ) X[i] = 0; - for ( i=0; i -#include - -void xor_128(unsigned char *a, unsigned char *b, unsigned char *out); -void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2); -void AES_CMAC(unsigned char *key, unsigned char *input, int length, unsigned char *mac); - -#endif diff --git a/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h b/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h deleted file mode 100644 index 76c921ef..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __kirk_header__ -#define __kirk_header__ - -static unsigned int size_kirk_header = 272; -static unsigned char kirk_header[] __attribute__((aligned(16))) = { - 0x2a, 0x4f, 0x3c, 0x49, 0x8a, 0x73, 0x4e, 0xd1, 0xf4, 0x55, 0x93, 0x0b, 0x9b, 0x69, 0xdc, 0x65, - 0x73, 0x22, 0x69, 0xd3, 0x73, 0x96, 0x7a, 0x60, 0x66, 0x8c, 0x88, 0xcf, 0x2f, 0x83, 0x58, 0xbc, - 0xb2, 0x00, 0x0a, 0x11, 0x72, 0x43, 0xc5, 0xde, 0xef, 0xbb, 0x2c, 0xbf, 0x97, 0x79, 0x6b, 0x9c, - 0x10, 0x1e, 0x7c, 0x57, 0x0e, 0xdb, 0x1d, 0x61, 0x6e, 0xb5, 0xf9, 0x3d, 0x35, 0xe9, 0x5c, 0xd8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73, - 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, -}; - -#endif diff --git a/src/sdl/SRB2PSP/psp-prxsign/main.c b/src/sdl/SRB2PSP/psp-prxsign/main.c deleted file mode 100644 index a970ae6c..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/main.c +++ /dev/null @@ -1,190 +0,0 @@ -#include -#include -#include -#include -#include -#include "cmac.h" -#include "kirk_header.h" -#include "psp_header.h" - -typedef unsigned char byte; - -typedef struct { - byte key[16]; - byte ckey[16]; - byte head_hash[16]; - byte data_hash[16]; - byte unused[32]; - int unk1; // 1 - int unk2; // 0 - int unk3[2]; - int datasize; - int dataoffset; - int unk4[6]; -} kirk1head_t; - -// secret kirk command 1 key -byte kirk_key[] = { - 0x98, 0xc9, 0x40, 0x97, 0x5c, 0x1d, 0x10, 0xe8, 0x7f, 0xe6, 0x0e, 0xa3, 0xfd, 0x03, 0xa8, 0xba -}; - -int main(int argc, char **argv) -{ - int i, relrem, size, fullsize, blocks, datasize; - size_t j; - kirk1head_t kirk; - byte iv[16]; - byte cmac[32]; - byte subk[32]; - byte psph[0x150]; - byte *datablob; - byte *filebuff; - FILE *f; - AES_KEY aesKey; - Elf32_Ehdr *ehdr; - Elf32_Shdr *shdr; - Elf32_Rel *relo; - - if(argc < 3) { - printf("Usage: %s unsigned.prx signed.prx\n", argv[0]); - return 1; - } - - // clean kirk header, use modified PRXdecrypter to get it - /*f = fopen(argv[1], "rb"); - if(!f) { - printf("failed to open %s\n", argv[1]); - return 1; - } - fread(&kirk, 1, sizeof(kirk1head_t), f); - fclose(f);*/ - //memcpy(&kirk, kirk_header, size_kirk_header); - memcpy(&kirk, kirk_header, sizeof(kirk1head_t)); - - datasize = kirk.datasize; - if(datasize % 16) datasize += 16 - (datasize % 16); - - // original ~PSP header - /*f = fopen(argv[2], "rb"); - if(!f) { - free(datablob); - printf("failed to open %s\n", argv[2]); - return 1; - } - fread(psph, 1, 0x150, f); - fclose(f);*/ - memcpy(&psph, psp_header, size_psp_header); - - // file to encrypt - f = fopen(argv[1], "rb"); - if(!f) { - printf("psp-prxsign: Unable to open PRX\n"); - return 1; - } - fseek(f, 0, SEEK_END); - size = ftell(f); - if(size > datasize - 16) { - fclose(f); - printf("psp-prxsign: PRX is too large\n"); - return 1; - } - printf("%s : %i\n", argv[1], size); - fseek(f, 0, SEEK_SET); - - fullsize = datasize + 0x30 + kirk.dataoffset; - - // datablob holds everything needed to calculate data HASH - datablob = malloc(fullsize); - if(!datablob) { - fclose(f); - printf("psp-prxsign: Failed to allocate memory for blob\n"); - return 1; - } - memset(datablob, 0, fullsize); - memcpy(datablob, &kirk.unk1, 0x30); - memcpy(datablob + 0x30, psph, kirk.dataoffset); - filebuff = datablob + 0x30 + kirk.dataoffset; - - int whocares = fread(filebuff, 1, size, f); - (void)whocares; - fclose(f); - - // remove relocations type 7 - relrem = 0; - ehdr = (void *)filebuff; - if(!memcmp(ehdr->e_ident, ELFMAG, 4) && ehdr->e_shnum) { - shdr = (void *)(filebuff + ehdr->e_shoff); - for(i = 0; i < ehdr->e_shnum; i++) { - if(shdr[i].sh_type == 0x700000A0) { - relo = (void *)(filebuff + shdr[i].sh_offset); - for(j = 0; j < shdr[i].sh_size / sizeof(Elf32_Rel); j++) { - if((relo[j].r_info & 0xFF) == 7) { - relo[j].r_info = 0; - relrem++; - } - } - } - } - } - //printf("%i relocations type 7 removed\ncalculating ...\n", relrem); - - // get AES/CMAC key - AES_set_decrypt_key(kirk_key, 128, &aesKey); - memset(iv, 0, 16); - AES_cbc_encrypt(kirk.key, kirk.key, 32, &aesKey, iv, AES_DECRYPT); - - // check header hash, optional - // if you take correct kirk header, hash is always correct -/* AES_CMAC(kirk.ckey, datablob, 0x30, cmac); - if(memcmp(cmac, kirk.head_hash, 16)) { - free(datablob); - printf("header hash invalid\n"); - return 1; - } -*/ - - // encrypt input file - AES_set_encrypt_key(kirk.key, 128, &aesKey); - memset(iv, 0, 16); - AES_cbc_encrypt(filebuff, filebuff, datasize, &aesKey, iv, AES_ENCRYPT); - - // make CMAC correct - generate_subkey(kirk.ckey, subk, subk + 16); - AES_set_encrypt_key(kirk.ckey, 128, &aesKey); - blocks = fullsize / 16; - memset(cmac, 0, 16); - for(i = 0; i < blocks - 1; i++) { - xor_128(cmac, &datablob[16 * i], cmac + 16); - AES_encrypt(cmac + 16, cmac, &aesKey); - } - - AES_set_decrypt_key(kirk.ckey, 128, &aesKey); - AES_decrypt(kirk.data_hash, iv, &aesKey); - xor_128(cmac, iv, iv); - xor_128(iv, subk, &datablob[16 * (blocks-1)]); - // check it, optional - // it works, this is only if you want to change something -/* AES_CMAC(kirk.ckey, datablob, fullsize, cmac); - if(memcmp(cmac, kirk.data_hash, 16)) { - fclose(f); - free(datablob); - printf("data hash calculation error\n"); - return 1; - } -*/ - f = fopen(argv[2], "wb"); - if(!f) { - free(datablob); - printf("psp-prxsign: Failed to write signed PRX\n"); - return 1; - } - //printf("saving ...\n"); - // save ~PSP header - fwrite(psph, 1, 0x150, f); - // save encrypted file - fwrite(filebuff, 1, fullsize - 0x30 - kirk.dataoffset, f); - fclose(f); - free(datablob); - //printf("everything done\n"); - return 0; -} diff --git a/src/sdl/SRB2PSP/psp-prxsign/psp_header.h b/src/sdl/SRB2PSP/psp-prxsign/psp_header.h deleted file mode 100644 index 7faef832..00000000 --- a/src/sdl/SRB2PSP/psp-prxsign/psp_header.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __psp_header__ -#define __psp_header__ - -static unsigned int size_psp_header = 336; -static unsigned char psp_header[] __attribute__((aligned(16))) = { - 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73, - 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, - 0x90, 0x82, 0x4c, 0x48, 0xa3, 0x53, 0xb2, 0x1b, 0x13, 0x95, 0x2f, 0xf1, 0x0b, 0x90, 0x9c, 0x11, - 0x61, 0x40, 0x20, 0x67, 0xf8, 0xdb, 0xfc, 0x95, 0x5c, 0xbe, 0x8c, 0x80, 0xf3, 0x92, 0x03, 0x01, - 0xb0, 0xbe, 0xf5, 0xf8, 0xa1, 0xaf, 0xaf, 0xa8, 0x38, 0x26, 0x63, 0x09, 0x26, 0x0e, 0xb7, 0xd5, - 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5c, 0x3e, 0x03, 0x22, 0xe5, 0x7d, 0xb9, 0xd1, 0x13, 0x67, 0x97, 0xa3, 0x5b, 0xd8, 0x77, 0x1f, - 0xf0, 0x05, 0xf3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x4a, 0xd7, 0x37, - 0xc2, 0x8f, 0x15, 0x43, 0x33, 0x93, 0x4d, 0x5b, 0xc0, 0x6e, 0xe4, 0x00, 0xc6, 0x0a, 0x71, 0x11, - 0x98, 0xb6, 0xc3, 0xb7, 0x59, 0x66, 0x21, 0xa8, 0x65, 0xf6, 0x53, 0xa9, 0x7a, 0x48, 0x17, 0xb6, -}; - -#endif diff --git a/src/sdl/SRB2WII/Makefile.cfg b/src/sdl/SRB2WII/Makefile.cfg deleted file mode 100644 index 1b186304..00000000 --- a/src/sdl/SRB2WII/Makefile.cfg +++ /dev/null @@ -1,124 +0,0 @@ -# -# Makefile.cfg for SRB2Wii native using libogc -# - -# Check if DEVKITPPC is set in the environment. If so, continue with compilation. -.SUFFIXES: - -ifeq ($(strip $(DEVKITPPC)),) -$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") -endif - -# Set compiler flags - -SRB2NAME?=srb2wii -EXENAME?=$(SRB2NAME).elf -DBGNAME?=$(SRB2NAME).elf.debug -DOLNAME?=$(SRB2NAME).dol - -ICONPNG?=sdl/SRB2WII/icon.png -METAXML?=sdl/SRB2WII/meta.xml - -APPDIR=apps/$(SRB2NAME) -ZIPNAME=$(SRB2NAME).zip - -ELF2DOL=$(DEVKITPPC)/bin/elf2dol -WIILOADEXE=$(DEVKITPPC)/bin/wiiload -ZIP=zip -r -9 -WGET=wget -P srb2wii -c -nc -SED=sed -XARGS=xargs -SHXARGS:=$(XARGS) -SHSED:=$(SED) -FOR=for - -ifndef ECHO - ELF2DOL:=@$(ELF2DOL) - WIILOADEXE:=@$(WIILOADEXE) - ZIP:=@$(ZIP) - SED:=@$(SED) - XARGS:=@$(XARGS) - FOR:=@$(FOR) -endif - -# Disable same warning flags -WFLAGS+=-Wno-shadow -Wno-char-subscripts -Wno-old-style-definition -Wno-unsuffixed-float-constants - -# newlib has no support for networking -NONET=1 - -# use pkgconfig for PKG -PNG_PKGCONFIG=libpng - -# use absolute paths because changing PATH variable breaks distcc -PREFIX := $(DEVKITPPC)/bin/$(PREFIX) - -# FIXME: DevkitPPC and ready-compiled SDL Wii require these things to be in a silly order -# libogc/DevkitPro required stuff -LIBOGC := $(DEVKITPRO)/libogc -LIBOGC_INC := $(LIBOGC)/include -LIBOGC_LIB := $(LIBOGC)/lib - -PORTLIBS := $(DEVKITPRO)/portlibs/ppc -PORTLIBS_INC := $(PORTLIBS)/include -PORTLIBS_LIB := $(PORTLIBS)/lib - -SDL_CPPFLAGS := -I$(LIBOGC_INC)/SDL -SDL_LIB := $(DEVKITPRO)/libogc/lib/wii -INCLUDE := -I$(LIBOGC_INC) $(SDL_CPPFLAGS) -I$(PORTLIBS_INC) - -PKG_CONFIG_PATH := $(PORTLIBS)/lib/pkgconfig -PKG_BROKEN_SWTICH := --static --define-variable=DEVKITPRO=$(DEVKITPRO) -PNG_PKGCONFIG := $(PKG_CONFIG_PATH)/libpng.pc $(PKG_BROKEN_SWTICH) -ZLIB_PKGCONFIG := $(PKG_CONFIG_PATH)/zlib.pc $(PKG_BROKEN_SWTICH) - -ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags) -ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs) - -ifdef RDB - LIBS+=-ldb - OPTS+=-DREMOTE_DEBUGGING=$(RDB) -endif - -LIBS+= -L$(SDL_LIB) -ifndef NOMIXER - LD=$(CXX) - LIBS+=-lSDL_mixer -lvorbisidec -lsmpeg -endif -LIBS+=-lSDL - -LIBS+=$(ZLIB_LDFLAGS) -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -L$(LIBOGC_LIB) - -MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -OPTS+=-DWII -D_WII -DUNIXCOMMON -CFLAGS+=-D__BIG_ENDIAN__ -g -O3 -fsigned-char $(MACHDEP) $(INCLUDE) -CXXFLAGS+=$(CFLAGS) -LDFLAGS+=-g $(MACHDEP) -Wl,-Map,$(notdir $@).map - -SDL_CONFIG=/bin/true -SDL_CFLAGS= -SDL_LDFLAGS= - -$(BIN)/$(DOLNAME): $(BIN)/$(EXENAME) - @echo Linking $(DOLNAME)... - $(ELF2DOL) $(BIN)/$(EXENAME) $(BIN)/$(DOLNAME) - @echo Creating /apps/$(SRB2NAME)... - $(MKDIR) $(APPDIR) - $(CP) $(BIN)/$(DOLNAME) $(APPDIR)/boot.dol - $(CP) $(ICONPNG) $(APPDIR) - $(CP) $(METAXML) $(APPDIR) -ifdef WITHDATA - $(MKDIR) srb2wii - $(FOR) datafile in $(shell echo $(D_FILES) | $(SHSED) -e 's/\.srb/\.wad/' -e 's/music.dta//' | $(SHXARGS) -n 1 basename); do \ - $(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$datafile; \ - done - # downsampled music.dta specially for SRB2Wii - $(WGET) http://repos.srb2.org/srb2ports/music.dta - $(ZIP) $(BIN)/$(ZIPNAME) $(APPDIR) srb2wii -else - $(ZIP) $(BIN)/$(ZIPNAME) $(APPDIR) -endif - $(REMOVE) -r $(APPDIR) - -run: $(BIN)/$(EXENAME) - $(WIILOADEXE) $(BIN)/$(DBGNAME) diff --git a/src/sdl/SRB2WII/icon.png b/src/sdl/SRB2WII/icon.png deleted file mode 100644 index d22324bc..00000000 Binary files a/src/sdl/SRB2WII/icon.png and /dev/null differ diff --git a/src/sdl/SRB2WII/meta.xml b/src/sdl/SRB2WII/meta.xml deleted file mode 100644 index 843176d3..00000000 --- a/src/sdl/SRB2WII/meta.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - SRB2Wii - Callum - 2.0.6 - 20101207 - A 3D Sonic fangame - Sonic Robo Blast 2 is a 3D fangame by a small group called -Sonic Team Junior, using the Doom engine as a base. -The game has been worked on for almost 11 years so far, and -it is still being very much developed today, with a huge -fanbase developing custom content, including characters, -levels, and even large-scale modifications that play out -a brand new adventure. -Based on the Doom II engine, SRB2's system requirements -are very low, even the oldest computers can play it at a -decent speed. - diff --git a/src/sdl/SRB2XBOX/Makefile.cfg b/src/sdl/SRB2XBOX/Makefile.cfg deleted file mode 100644 index 56966d43..00000000 --- a/src/sdl/SRB2XBOX/Makefile.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# -# Makefile.cfg for SRB2/XBOX -# - -# -#hmmm, the XBOX -# - - NOHW=1 #No working OpenGL right now - NOHS=1 #No HWSound right now - NOASM=1 #No Fast code - NONET=1 #No network code - NOMD5=1 #No Slow MD5 - NOPNG=1 #No Screenshot - #SDLMAIN=1 #SDLMain! - -ifndef OPENXDK - OPENXDK=/usr/local/openxdk -endif - - CXBE=$(OPENXDK)/bin/cxbe - -ifdef ECHO - CXBE:=@$(CXBE) -endif - -ifndef NOHW - OPTS+=-DMINI_GL_COMPATIBILITY -endif - - BUILTLM=-fno-builtin - CFLAGS+=-D_XBOX -std=gnu99 -ffreestanding $(BUILTLM) -fno-exceptions - CFLAGS+=-I$(OPENXDK)/i386-pc-xbox/include -I$(OPENXDK)/include - OPTS+=-nostdlib -mno-cygwin -march=i386 - LDFLAGS+=-nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20 -shared -Wl,--entry,_WinMainCRTStartup -Wl,--strip-all -L$(OPENXDK)/i386-pc-xbox/lib -L$(OPENXDK)/lib - LIBS=-lg -lc -lm - SDL_CFLAGS?=-I$(OPENXDK)/include/SDL - SDL_LDFLAGS?=-lSDL -lopenxdk -lhal -lc -lhal -lusb -lhal -lc -lxboxkrnl - - i_system_o+=$(OBJDIR)/xboxhelp.o - - # name of the exefile - EXENAME?=SRB2XBOX.EXE - BINNAME?=default.xbe diff --git a/src/sdl/SRB2XBOX/xboxhelp.c b/src/sdl/SRB2XBOX/xboxhelp.c deleted file mode 100644 index 9de01712..00000000 --- a/src/sdl/SRB2XBOX/xboxhelp.c +++ /dev/null @@ -1,91 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2004 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// DESCRIPTION: -// stub and replacement "ANSI" C functions for use under OpenXDK -// -//----------------------------------------------------------------------------- - -#include "../../doomdef.h" -#include "xboxhelp.h" -#ifdef __GNUC__ -#include -#else -#include -#endif - -char *getcwd(char *_buf, size_t _size ) -{ - (void)_buf; - (void)_size; - return _buf; -} - -#ifdef _MSC_VER -int mkdir(const char *path) -{ - (void)path; - return 0; -} -#elif 0 //__GNUC__? -int mkdir(const char *path, mode_t _mode) -{ - (void)path; - (void)_mode; - return 0; -} -#endif - -int chdir (const char *__path ) -{ - (void)__path; - return 0; -} - -time_t time(time_t *T) -{ - long returntime = 0; - (void)T; -/* - SYSTEMTIME st; - FILETIME stft; - INT64 ftli; - if (!T) return returntime; - GetSystemTime(&st); - SystemTimeToFileTime(&st,&stft); - CopyMemory(&ftli,&stft,sizeof (LARGE_INTEGER)); - returntime = (long)ftli; - *T = returntime; -*/ - return returntime; -} - -#ifdef _MSC_VER -#include -void __cdecl _RTC_Initialize(void) -{ -} -char *getenv(const char *__env) -{ - __env = NULL; - return NULL; -} - -int putenv(const char *__env) -{ - __env = NULL; - return 0; -} -#endif diff --git a/src/sdl/SRB2XBOX/xboxhelp.h b/src/sdl/SRB2XBOX/xboxhelp.h deleted file mode 100644 index 97ef0a3b..00000000 --- a/src/sdl/SRB2XBOX/xboxhelp.h +++ /dev/null @@ -1,6 +0,0 @@ -#if defined (_MSC_VER) -int access(const char *path, int amode); -char *getcwd(char *_buf, size_t _size ); -int mkdir(const char *path); -int chdir (const char *__path ); -#endif diff --git a/src/sdl/filter/filters.c b/src/sdl/filter/filters.c deleted file mode 100644 index 1b2346e8..00000000 --- a/src/sdl/filter/filters.c +++ /dev/null @@ -1,1000 +0,0 @@ -#include -#include "filters.h" - -//Alam_GBC: C file based on sms_sdl's filter.c - -/* 2X SAI Filter */ -static Uint32 colorMask = 0xF7DEF7DE; -static Uint32 lowPixelMask = 0x08210821; -static Uint32 qcolorMask = 0xE79CE79C; -static Uint32 qlowpixelMask = 0x18631863; -static Uint32 redblueMask = 0xF81F; -static Uint32 greenMask = 0x7E0; - -SDL_Surface *filter_2x(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter) -{ - return filter_2xe(src,srcclp,filter,0,0,0); -} - -SDL_Surface *filter_2xe(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter,Uint8 R, Uint8 G, Uint8 B) -{ - SDL_Surface *srcfilter = NULL; - SDL_Rect dstclp = {0,3,0,0}; - SDL_Surface *dstfilter = NULL; - Uint32 Fillcolor = 0; - if(!src || !filter) return NULL; // Need src and filter - if(srcclp) // size by clp - { - dstclp.w = srcclp->w; //clp's width - dstclp.h = srcclp->h; //clp's height - } - else // size by src - { - dstclp.w = (Uint16)src->w; //src's width - dstclp.h = (Uint16)src->h; //src's height - } - if(filter == hq2x32 || filter == lq2x32) // src 0888 surface - srcfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w,dstclp.h+6,32,0x00FF0000,0x0000FF00,0x000000FF,0x00); - else // src 565 surface - srcfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w,dstclp.h+6,16,0x0000F800,0x000007E0,0x0000001F,0x00); - if(!srcfilter) return NULL; //No Memory? - Fillcolor = SDL_MapRGB(srcfilter->format,R,G,B); //Choose color - SDL_FillRect(srcfilter,NULL,Fillcolor); //fill it - if(filter == filter_hq2x || filter == hq2x32 || filter == lq2x32) // dst 0888 surface - dstfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w*2,dstclp.h*2,32,0x00FF0000,0x0000FF00,0x000000FF,0x00); - else // dst 565 surface - dstfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w*2,dstclp.h*2,16,0x0000F800,0x000007E0,0x0000001F,0x00); - if(!dstfilter || SDL_BlitSurface(src,srcclp,srcfilter,&dstclp) == -1) // No dstfilter or Blit failed - { - SDL_FreeSurface(srcfilter); // Free memory - return NULL; //No Memory? - } - else // have dstfilter ready and srcfilter done - { - SDL_FillRect(dstfilter,NULL,Fillcolor); //fill it too - filter(FILTER(srcfilter,dstfilter)); //filtering - SDL_FreeSurface(srcfilter); //almost - } - return dstfilter; //done -} - - -int filter_init_2xsai(SDL_PixelFormat *BitFormat) -{ - if (!BitFormat || BitFormat->BytesPerPixel != 2 ||BitFormat->Amask != 0x0) - { - return 0; - } - else if (BitFormat->Rmask == 0xF800 && BitFormat->Gmask == 0x7E0 - && BitFormat->Bmask == 0x1F && BitFormat->BitsPerPixel == 16) //565 - { - colorMask = 0xF7DEF7DE; - lowPixelMask = 0x08210821; - qcolorMask = 0xE79CE79C; - qlowpixelMask = 0x18631863; - redblueMask = 0xF81F; - greenMask = 0x7E0; - } - else if (BitFormat->Rmask == 0x7C00 && BitFormat->Gmask == 0x3E0 - && BitFormat->Bmask == 0x1F && BitFormat->BitsPerPixel == 15) //555 - { - colorMask = 0x7BDE7BDE; - lowPixelMask = 0x04210421; - qcolorMask = 0x739C739C; - qlowpixelMask = 0x0C630C63; - redblueMask = 0x7C1F; - greenMask = 0x3E0; - } - else - { - return 0; - } -#ifdef MMX - if(BitFormat->Gmask == 0x7E0) Init_2xSaIMMX(565); - else Init_2xSaIMMX(555); -#endif - return 1; -} - - -FUNCINLINE static ATTRINLINE int GetResult1 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 E) -{ - int x = 0; - int y = 0; - int r = 0; - (void)E; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -FUNCINLINE static ATTRINLINE int GetResult2 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 E) -{ - int x = 0; - int y = 0; - int r = 0; - (void)E; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r -= 1; - if (y <= 1) - r += 1; - return r; -} - -FUNCINLINE static ATTRINLINE int GetResult (Uint32 A, Uint32 B, Uint32 C, Uint32 D) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -FUNCINLINE static ATTRINLINE Uint32 INTERPOLATE (Uint32 A, Uint32 B) -{ - if (A != B) - { - return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + - (A & B & lowPixelMask)); - } - else - return A; -} - -FUNCINLINE static ATTRINLINE Uint32 Q_INTERPOLATE (Uint32 A, Uint32 B, Uint32 C, Uint32 D) -{ - register Uint32 x = ((A & qcolorMask) >> 2) + - ((B & qcolorMask) >> 2) + - ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2); - register Uint32 y = (A & qlowpixelMask) + - (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask); - y = (y >> 2) & qlowpixelMask; - return x + y; -} - -#define BLUE_MASK565 0x001F001F -#define RED_MASK565 0xF800F800 -#define GREEN_MASK565 0x07E007E0 - -#define BLUE_MASK555 0x001F001F -#define RED_MASK555 0x7C007C00 -#define GREEN_MASK555 0x03E003E0 - -void filter_super2xsai(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - Uint16 *bP; - Uint8 *dP; - Uint32 inc_bP; - Uint32 Nextline = srcPitch >> 1; - - Uint32 finish; - inc_bP = 1; - - for (; height; height--) - { - bP = (Uint16 *) srcPtr; - dP = (Uint8 *) dstPtr; - - for (finish = width; finish; finish -= inc_bP) - { - Uint32 color4, color5, color6; - Uint32 color1, color2, color3; - Uint32 colorA0, colorA1, colorA2, colorA3, - colorB0, colorB1, colorB2, colorB3, colorS1, colorS2; - Uint32 product1a, product1b, product2a, product2b; - -//--------------------------------------- B1 B2 -// 4 5 6 S2 -// 1 2 3 S1 -// A1 A2 - - colorB0 = *(bP - Nextline - 1); - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - colorB3 = *(bP - Nextline + 2); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA0 = *(bP + Nextline + Nextline - 1); - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - colorA3 = *(bP + Nextline + Nextline + 2); - -//-------------------------------------- - if (color2 == color6 && color5 != color3) - { - product2b = product1b = color2; - } - else if (color5 == color3 && color2 != color6) - { - product2b = product1b = color5; - } - else if (color5 == color3 && color2 == color6) - { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) - product2b = product1b = color6; - else if (r < 0) - product2b = product1b = color5; - else - { - product2b = product1b = INTERPOLATE (color5, color6); - } - } - else - { - if (color6 == color3 && color3 == colorA1 - && color2 != colorA2 && color3 != colorA0) - product2b = - Q_INTERPOLATE (color3, color3, color3, color2); - else if (color5 == color2 && color2 == colorA2 - && colorA1 != color3 && color2 != colorA3) - product2b = - Q_INTERPOLATE (color2, color2, color2, color3); - else - product2b = INTERPOLATE (color2, color3); - - if (color6 == color3 && color6 == colorB1 - && color5 != colorB2 && color6 != colorB0) - product1b = - Q_INTERPOLATE (color6, color6, color6, color5); - else if (color5 == color2 && color5 == colorB2 - && colorB1 != color6 && color5 != colorB3) - product1b = - Q_INTERPOLATE (color6, color5, color5, color5); - else - product1b = INTERPOLATE (color5, color6); - } - - if (color5 == color3 && color2 != color6 && color4 == color5 - && color5 != colorA2) - product2a = INTERPOLATE (color2, color5); - else - if (color5 == color1 && color6 == color5 - && color4 != color2 && color5 != colorA0) - product2a = INTERPOLATE (color2, color5); - else - product2a = color2; - - if (color2 == color6 && color5 != color3 && color1 == color2 - && color2 != colorB2) - product1a = INTERPOLATE (color2, color5); - else - if (color4 == color2 && color3 == color2 - && color1 != color5 && color2 != colorB0) - product1a = INTERPOLATE (color2, color5); - else - product1a = color5; - -#ifdef LSB_FIRST - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#else - product1a = (product1a << 16) | product1b; - product2a = (product2a << 16) | product2b; -#endif - *((Uint32 *) dP) = product1a; - *((Uint32 *) (dP + dstPitch)) = product2a; - - bP += inc_bP; - dP += sizeof (Uint32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - } // endof: for (; height; height--) -} - -void filter_supereagle(Uint8 *srcPtr, Uint32 srcPitch, /* Uint8 *deltaPtr, */ - Uint8 *dstPtr, Uint32 dstPitch, int width, int height) -{ - Uint8 *dP; - Uint16 *bP; - Uint32 inc_bP; - - - - Uint32 finish; - Uint32 Nextline = srcPitch >> 1; - - inc_bP = 1; - - for (; height ; height--) - { - bP = (Uint16 *) srcPtr; - dP = dstPtr; - for (finish = width; finish; finish -= inc_bP) - { - Uint32 color4, color5, color6; - Uint32 color1, color2, color3; - Uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2; - Uint32 product1a, product1b, product2a, product2b; - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - // -------------------------------------- - if (color2 == color6 && color5 != color3) - { - product1b = product2a = color2; - if ((color1 == color2) || (color6 == colorB2)) - { - product1a = INTERPOLATE (color2, color5); - product1a = INTERPOLATE (color2, product1a); -// product1a = color2; - } - else - { - product1a = INTERPOLATE (color5, color6); - } - - if ((color6 == colorS2) || (color2 == colorA1)) - { - product2b = INTERPOLATE (color2, color3); - product2b = INTERPOLATE (color2, product2b); -// product2b = color2; - } - else - { - product2b = INTERPOLATE (color2, color3); - } - } - else if (color5 == color3 && color2 != color6) - { - product2b = product1a = color5; - - if ((colorB1 == color5) || (color3 == colorS1)) - { - product1b = INTERPOLATE (color5, color6); - product1b = INTERPOLATE (color5, product1b); -// product1b = color5; - } - else - { - product1b = INTERPOLATE (color5, color6); - } - - if ((color3 == colorA2) || (color4 == color5)) - { - product2a = INTERPOLATE (color5, color2); - product2a = INTERPOLATE (color5, product2a); -// product2a = color5; - } - else - { - product2a = INTERPOLATE (color2, color3); - } - - } - else if (color5 == color3 && color2 == color6) - { - register int r = 0; - - r += GetResult (color6, color5, color1, colorA1); - r += GetResult (color6, color5, color4, colorB1); - r += GetResult (color6, color5, colorA2, colorS1); - r += GetResult (color6, color5, colorB2, colorS2); - - if (r > 0) - { - product1b = product2a = color2; - product1a = product2b = INTERPOLATE (color5, color6); - } - else if (r < 0) - { - product2b = product1a = color5; - product1b = product2a = INTERPOLATE (color5, color6); - } - else - { - product2b = product1a = color5; - product1b = product2a = color2; - } - } - else - { - product2b = product1a = INTERPOLATE (color2, color6); - product2b = - Q_INTERPOLATE (color3, color3, color3, product2b); - product1a = - Q_INTERPOLATE (color5, color5, color5, product1a); - - product2a = product1b = INTERPOLATE (color5, color3); - product2a = - Q_INTERPOLATE (color2, color2, color2, product2a); - product1b = - Q_INTERPOLATE (color6, color6, color6, product1b); - -// product1a = color5; -// product1b = color6; -// product2a = color2; -// product2b = color3; - } -#ifdef LSB_FIRST - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#else - product1a = (product1a << 16) | product1b; - product2a = (product2a << 16) | product2b; -#endif - - *((Uint32 *) dP) = product1a; - *((Uint32 *) (dP + dstPitch)) = product2a; - - bP += inc_bP; - dP += sizeof (Uint32); - } // end of for ( finish= width etc..) - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - } // endof: for (height; height; height--) -} - -void filter_2xsai (Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, int width, int height) -{ - Uint8 *dP; - Uint16 *bP; - Uint32 inc_bP; - - - Uint32 finish; - Uint32 Nextline = srcPitch >> 1; - inc_bP = 1; - - - for (; height; height--) - { - bP = (Uint16 *) srcPtr; - dP = dstPtr; - - for (finish = width; finish; finish -= inc_bP) - { - - register Uint32 colorA, colorB; - Uint32 colorC, colorD, - colorE, colorF, colorG, colorH, - colorI, colorJ, colorK, colorL, - - colorM, colorN, colorO, colorP; - Uint32 product, product1, product2; - -//--------------------------------------- -// Map of the pixels: I|E F|J -// G|A B|K -// H|C D|L -// M|N O|P - colorI = *(bP - Nextline - 1); - colorE = *(bP - Nextline); - colorF = *(bP - Nextline + 1); - colorJ = *(bP - Nextline + 2); - - colorG = *(bP - 1); - colorA = *(bP); - colorB = *(bP + 1); - colorK = *(bP + 2); - - colorH = *(bP + Nextline - 1); - colorC = *(bP + Nextline); - colorD = *(bP + Nextline + 1); - colorL = *(bP + Nextline + 2); - - colorM = *(bP + Nextline + Nextline - 1); - colorN = *(bP + Nextline + Nextline); - colorO = *(bP + Nextline + Nextline + 1); - colorP = *(bP + Nextline + Nextline + 2); - - if ((colorA == colorD) && (colorB != colorC)) - { - if (((colorA == colorE) && (colorB == colorL)) || - ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ))) - { - product = colorA; - } - else - { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorA == colorG) && (colorC == colorO)) || - ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM))) - { - product1 = colorA; - } - else - { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorA; - } - else if ((colorB == colorC) && (colorA != colorD)) - { - if (((colorB == colorF) && (colorA == colorH)) || - ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI))) - { - product = colorB; - } - else - { - product = INTERPOLATE (colorA, colorB); - } - - if (((colorC == colorH) && (colorA == colorF)) || - ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI))) - { - product1 = colorC; - } - else - { - product1 = INTERPOLATE (colorA, colorC); - } - product2 = colorB; - } - else if ((colorA == colorD) && (colorB == colorC)) - { - if (colorA == colorB) - { - product = colorA; - product1 = colorA; - product2 = colorA; - } - else - { - register int r = 0; - - product1 = INTERPOLATE (colorA, colorC); - product = INTERPOLATE (colorA, colorB); - - r += - GetResult1 (colorA, colorB, colorG, colorE, - colorI); - r += - GetResult2 (colorB, colorA, colorK, colorF, - colorJ); - r += - GetResult2 (colorB, colorA, colorH, colorN, - colorM); - r += - GetResult1 (colorA, colorB, colorL, colorO, - colorP); - - if (r > 0) - product2 = colorA; - else if (r < 0) - product2 = colorB; - else - { - product2 = - Q_INTERPOLATE (colorA, colorB, colorC, - colorD); - } - } - } - else - { - product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD); - - if ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ)) - { - product = colorA; - } - else - if ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI)) - { - product = colorB; - } - else - { - product = INTERPOLATE (colorA, colorB); - } - - if ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM)) - { - product1 = colorA; - } - else - if ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI)) - { - product1 = colorC; - } - else - { - product1 = INTERPOLATE (colorA, colorC); - } - } -#ifdef LSB_FIRST - product = colorA | (product << 16); - product1 = product1 | (product2 << 16); -#else - product = (colorA << 16) | product; - product1 = (product1 << 16) | product2; -#endif - *((Uint32 *) dP) = product; - *((Uint32 *) (dP + dstPitch)) = product1; - - bP += inc_bP; - dP += sizeof (Uint32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - } // endof: for (height; height; height--) -} - -#if 0 -static inline Uint32 Bilinear(Uint32 A, Uint32 B, Uint32 x) -{ - unsigned long areaA, areaB; - unsigned long result; - - if (A == B) - return A; - - areaB = (x >> 11) & 0x1f; // reduce 16 bit fraction to 5 bits - areaA = 0x20 - areaB; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - - result = ((areaA * A) + (areaB * B)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); - -} - -static inline Uint32 Bilinear4 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 x, - Uint32 y) -{ - unsigned long areaA, areaB, areaC, areaD; - unsigned long result, xy; - - x = (x >> 11) & 0x1f; - y = (y >> 11) & 0x1f; - xy = (x * y) >> 5; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - C = (C & redblueMask) | ((C & greenMask) << 16); - D = (D & redblueMask) | ((D & greenMask) << 16); - - areaA = 0x20 + xy - x - y; - areaB = x - xy; - areaC = y - xy; - areaD = xy; - - result = ((areaA * A) + (areaB * B) + (areaC * C) + (areaD * D)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); -} -#endif - - -void filter_advmame2x(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(short); - short *p = (short *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(short); - short *q = (short *)dstPtr; - - while(height--) { - int i = 0, j = 0; - for(i = 0; i < width; ++i, j += 2) { - short B = *(p + i - nextlineSrc); - short D = *(p + i - 1); - short E = *(p + i); - short F = *(p + i + 1); - short H = *(p + i + nextlineSrc); - - *(q + j) = (short)(D == B && B != F && D != H ? D : E); - *(q + j + 1) = (short)(B == F && B != D && F != H ? F : E); - *(q + j + nextlineDst) = (short)(D == H && D != B && H != F ? D : E); - *(q + j + nextlineDst + 1) = (short)(H == F && D != H && B != F ? F : E); - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -void filter_tv2x(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - while(height--) { - int i = 0, j = 0; - for(; i < width; ++i, j += 2) { - Uint16 p1 = *(p + i); - Uint32 pi; - - pi = (((p1 & redblueMask) * 7) >> 3) & redblueMask; - pi |= (((p1 & greenMask) * 7) >> 3) & greenMask; - - *(q + j) = (Uint16)p1; - *(q + j + 1) = (Uint16)p1; - *(q + j + nextlineDst) = (Uint16)pi; - *(q + j + nextlineDst + 1) = (Uint16)pi; - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - -void filter_normal2x(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - while(height--) { - int i = 0, j = 0; - for(; i < width; ++i, j += 2) { - Uint16 color = *(p + i); - - *(q + j) = color; - *(q + j + 1) = color; - *(q + j + nextlineDst) = color; - *(q + j + nextlineDst + 1) = color; - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - -void filter_scan50(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - while(height--) { - int i = 0, j = 0; - for(; i < width; ++i, j += 2) { - Uint16 p1 = *(p + i); - Uint16 p2 = *(p + i + nextlineSrc); - // 0111 1011 1110 1111 == 0x7BEF - Uint16 pm = (Uint16)(((p1 + p2) >> 2) & 0x7BEF); - - *(q + j) = p1; - *(q + j + 1) = p1; - *(q + j + nextlineDst) = pm; - *(q + j + nextlineDst + 1) = pm; - - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -void filter_scan100(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - while(height--) { - int i = 0, j = 0; - for(; i < width; ++i, j += 2) { - *(q + j) = *(q + j + 1) = *(p + i); - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -FUNCINLINE static ATTRINLINE Uint16 DOT_16(Uint16 c, int j, int i) { - static const Uint16 dotmatrix[16] = { - 0x01E0, 0x0007, 0x3800, 0x0000, - 0x39E7, 0x0000, 0x39E7, 0x0000, - 0x3800, 0x0000, 0x01E0, 0x0007, - 0x39E7, 0x0000, 0x39E7, 0x0000 - }; - return (Uint16)(c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3)))); -} - -void filter_dotmatrix(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - int i, ii, j, jj; - for(j = 0, jj = 0; j < height; ++j, jj += 2) { - for(i = 0, ii = 0; i < width; ++i, ii += 2) { - Uint16 c = *(p + i); - *(q + ii) = DOT_16(c, jj, ii); - *(q + ii + 1) = DOT_16(c, jj, ii + 1); - *(q + ii + nextlineDst) = DOT_16(c, jj + 1, ii); - *(q + ii + nextlineDst + 1) = DOT_16(c, jj + 1, ii + 1); - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -void filter_bilinear(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - - while(height--) { - int i, ii; - for(i = 0, ii = 0; i < width; ++i, ii += 2) { - Uint16 A = *(p + i); - Uint16 B = *(p + i + 1); - Uint16 C = *(p + i + nextlineSrc); - Uint16 D = *(p + i + nextlineSrc + 1); - *(q + ii) = A; - *(q + ii + 1) = (Uint16)INTERPOLATE(A, B); - *(q + ii + nextlineDst) = (Uint16)INTERPOLATE(A, C); - *(q + ii + nextlineDst + 1) = (Uint16)Q_INTERPOLATE(A, B, C, D); - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -// NEED_OPTIMIZE -static void MULT(Uint16 c, float* r, float* g, float* b, float alpha) { - *r += alpha * ((c & RED_MASK565 ) >> 11); - *g += alpha * ((c & GREEN_MASK565) >> 5); - *b += alpha * ((c & BLUE_MASK565 ) >> 0); -} - -static Uint16 MAKE_RGB565(float r, float g, float b) { - return (Uint16) - (((((Uint8)r) << 11) & RED_MASK565 ) | - ((((Uint8)g) << 5) & GREEN_MASK565) | - ((((Uint8)b) << 0) & BLUE_MASK565 )); -} - -FUNCINLINE static ATTRINLINE float CUBIC_WEIGHT(float x) { - // P(x) = { x, x>0 | 0, x<=0 } - // P(x + 2) ^ 3 - 4 * P(x + 1) ^ 3 + 6 * P(x) ^ 3 - 4 * P(x - 1) ^ 3 - double r = 0.; - if(x + 2 > 0) r += pow(x + 2, 3); - if(x + 1 > 0) r += -4 * pow(x + 1, 3); - if(x > 0) r += 6 * pow(x , 3); - if(x - 1 > 0) r += -4 * pow(x - 1, 3); - return (float)r / 6; -} - -void filter_bicubic(Uint8 *srcPtr, Uint32 srcPitch, - Uint8 *dstPtr, Uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(Uint16); - Uint16 *p = (Uint16 *)srcPtr; - unsigned int nextlineDst = dstPitch / sizeof(Uint16); - Uint16 *q = (Uint16 *)dstPtr; - int dx = width << 1, dy = height << 1; - float fsx = (float)width / dx; - float fsy = (float)height / dy; - float v = 0.0f; - int j = 0; - for(; j < dy; ++j) { - float u = 0.0f; - int iv = (int)v; - float decy = v - iv; - int i = 0; - for(; i < dx; ++i) { - int iu = (int)u; - float decx = u - iu; - float r, g, b; - int m; - r = g = b = 0.; - for(m = -1; m <= 2; ++m) { - float r1 = CUBIC_WEIGHT(decy - m); - int n; - for(n = -1; n <= 2; ++n) { - float r2 = CUBIC_WEIGHT(n - decx); - Uint16* pIn = p + (iu + n) + (iv + m) * nextlineSrc; - MULT(*pIn, &r, &g, &b, r1 * r2); - } - } - *(q + i) = MAKE_RGB565(r, g, b); - u += fsx; - } - q += nextlineDst; - v += fsy; - } -} diff --git a/src/sdl/filter/filters.h b/src/sdl/filter/filters.h deleted file mode 100644 index c4a84b4c..00000000 --- a/src/sdl/filter/filters.h +++ /dev/null @@ -1,212 +0,0 @@ -#ifndef __FILTERS_H__ -#define __FILTERS_H__ - -#ifdef _MSC_VER -#pragma warning(disable : 4514 4214 4244) -#endif - -#include "SDL.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -typedef enum { - FILTER_2XSAI = 0, - FILTER_SUPER2XSAI, - FILTER_SUPEREAGLE, - FILTER_ADVMAME2X , - FILTER_TV2X , - FILTER_NORMAL2X , - FILTER_BILINEAR , - FILTER_DOTMATRIX , - FILTER_NUM , -} t_filter; - -typedef void (*filter_2)(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -SDL_Surface *filter_2x(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter); -SDL_Surface *filter_2xe(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter,Uint8 R, Uint8 G, Uint8 B); -//Alam_GBC: Header file based on sms_sdl's filter.h -//Note: need 3 lines at the bottom and top? - -//int filter_init_2xsai(SDL_PixelFormat *BitFormat); -#define FILTER(src,dst) (Uint8 *)(src->pixels)+src->pitch*3, (Uint32)src->pitch, (Uint8 *)dst->pixels, (Uint32)dst->pitch, src->w, src->h-6 -#define SDLFILTER(src,dst) (Uint8 *)src->pixels, (Uint32)src->pitch, (Uint8 *)dst->pixels, (Uint32)dst->pitch, src->w, src->h -int filter_init_2xsai(SDL_PixelFormat *BitFormat); //unless? -void filter_scan50(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_scan100(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); - -void filter_2xsai(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_super2xsai(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_supereagle(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_advmame2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_tv2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_normal2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_bilinear(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_dotmatrix(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void filter_bicubic(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void lq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void hq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); - -void filter_hq2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void lq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); -void hq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height); - -#ifdef FILTERS -typedef struct filter_s { filter_2 filter; int bpp; } filter_t; -#define NUMFILTERS 13 -static filter_t filtermode[NUMFILTERS+1] = { - {NULL , 0}, //None - {filter_normal2x , 16}, //2xNormal - {filter_advmame2x , 16}, //AdvMAME2x - {filter_tv2x , 16}, //TV2x - {filter_bilinear , 16}, //Bilinear - {filter_dotmatrix , 16}, //DotMatrix - {lq2x16 , 16}, //16LQ2x - {hq2x16 , 16}, //16HQ2x - {lq2x32 , 32}, //32LQ2x - {hq2x32 , 32}, //32HQ2x -// {filter_bicubic , 16}, //Slow Bicubic - // BAD - {filter_2xsai , 16}, //2xSAI - {filter_super2xsai, 16}, //Super2xSAI - {filter_supereagle, 16}, //SuperEagle -}; -CV_PossibleValue_t CV_Filters[] = {{ 0, "None"}, { 1, "2xNormal"}, - { 2, "AdvMAME2x"}, { 3, "TV2x"}, { 4, "Bilinear"} , { 5, "DotMatrix"}, - { 6, "16LQ2x"}, { 7, "16HQ2x"}, { 8, "32LQ2x"} , { 9, "32HQ2x"}, - {10, "2xSAI"}, {11, "Super2xSAI"}, {12, "SuperEagle"}, {0, NULL},}; -static void Filterchange(void); -consvar_t cv_filter = {"filter", "None", CV_CALL|CV_NOINIT, CV_Filters,Filterchange,0,NULL,NULL,0,0,NULL}; -static filter_2 blitfilter = NULL; -static SDL_Surface *preSurface = NULL; -static SDL_Surface *f2xSurface = NULL; - -static void Filterchange(void) -{ - if(blitfilter) // only filtering? - { - int i=0; - for(;i < NUMFILTERS; i++)//find old filter - { - if(filtermode[i].filter == blitfilter) //Found it - break; //Stop - } - if(i < NUMFILTERS && filtermode[i].bpp == filtermode[cv_filter.value].bpp) //Easy to swap? - blitfilter = filtermode[cv_filter.value].filter; // Swap with new filter - } -} - -FUNCINLINE static ATTRINLINE void FilterBlit(SDL_Surface *froSurface) -{ - if(froSurface && blitfilter && preSurface && f2xSurface) - { - SDL_Rect dstclp = {0,3,0,0}; - int lockedpre = 0, lockedf2x = 0, blitpre = 0; - blitpre = SDL_BlitSurface(froSurface,NULL,preSurface,&dstclp); - if(SDL_MUSTLOCK(preSurface)) lockedpre = SDL_LockSurface(preSurface); - if(SDL_MUSTLOCK(f2xSurface)) lockedf2x = SDL_LockSurface(f2xSurface); - if(lockedpre == 0 && preSurface->pixels && lockedf2x == 0 && f2xSurface->pixels && blitpre == 0) - { - blitfilter(FILTER(preSurface,f2xSurface)); - if(SDL_MUSTLOCK(preSurface)) SDL_UnlockSurface(preSurface); - if(SDL_MUSTLOCK(f2xSurface)) SDL_UnlockSurface(f2xSurface); - } - } - else - { - blitfilter = NULL; - if(preSurface) SDL_FreeSurface(preSurface); - preSurface = NULL; - if(f2xSurface) SDL_FreeSurface(f2xSurface); - f2xSurface = NULL; - } -} - -FUNCINLINE static ATTRINLINE int Setupf2x(int width, int height, int bpp) -{ - blitfilter = NULL; - if(preSurface) SDL_FreeSurface(preSurface); - preSurface = NULL; - if(f2xSurface) SDL_FreeSurface(f2xSurface); - f2xSurface = NULL; - if( !(width%2) && !(height%2) && width >= BASEVIDWIDTH*2 && height >= BASEVIDHEIGHT*2 && cv_filter.value - && cv_filter.value <= NUMFILTERS && filtermode[cv_filter.value].filter && filtermode[cv_filter.value].bpp) - { - int hwidth = width/2 + 6; - int heighth = height/2 + 6; - int hbpp = filtermode[cv_filter.value].bpp; - switch(hbpp) - { - case 8: - preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth, 8,0x00000000,0x00000000,0x00000000,0x00); - f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height , 8,0x00000000,0x00000000,0x00000000,0x00); - case 15: - preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,15,0x00007C00,0x000003E0,0x0000001F,0x00); - f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,15,0x00007C00,0x000003E0,0x0000001F,0x00); - break; - case 16: - preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,16,0x0000F800,0x000007E0,0x0000001F,0x00); - f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,16,0x0000F800,0x000007E0,0x0000001F,0x00); - break; - case 24: - preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,24,0x00FF0000,0x0000FF00,0x000000FF,0x00); - f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,24,0x00FF0000,0x0000FF00,0x000000FF,0x00); - break; - case 32: - preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,32,0x00FF0000,0x0000FF00,0x000000FF,0x00); - f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,32,0x00FF0000,0x0000FF00,0x000000FF,0x00); - break; - default: - //I_Error("Filter help"); - break; - } - if(preSurface && f2xSurface) - { - blitfilter = filtermode[cv_filter.value].filter; - if(bpp < hbpp) bpp = hbpp; - } - else - { - if(preSurface) SDL_FreeSurface(preSurface); - preSurface = NULL; - if(f2xSurface) SDL_FreeSurface(f2xSurface); - f2xSurface = NULL; - } - } - return bpp; -} -#else - -#ifdef __GNUC__ // __attribute__ ((X)) -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) -#define FUNCINLINE __attribute__((always_inline)) -#endif -#define FUNCNOINLINE __attribute__((noinline)) -#elif defined(_MSC_VER) -#define inline __inline -#define ATTRNORETURN __declspec(noreturn) -#define ATTRINLINE __forceinline -#if _MSC_VER > 1200 -#define ATTRNOINLINE __declspec(noinline) -#endif -#endif - - - -#ifndef FUNCINLINE -#define FUNCINLINE -#endif -#ifndef FUNCNOINLINE -#define FUNCNOINLINE -#endif -#ifndef ATTRINLINE -#define ATTRINLINE inline -#endif -#ifndef ATTRNOINLINE -#define ATTRNOINLINE -#endif - -#endif - -#endif diff --git a/src/sdl/filter/hq2x.c b/src/sdl/filter/hq2x.c deleted file mode 100644 index acdbcb16..00000000 --- a/src/sdl/filter/hq2x.c +++ /dev/null @@ -1,3125 +0,0 @@ -//hq2x filter demo program -//---------------------------------------------------------- -//Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) - -//This program is free software; you can redistribute it and/or -//modify it under the terms of the GNU Lesser General Public -//License as published by the Free Software Foundation; either -//version 2.1 of the License, or (at your option) any later version. -// -//This program is distributed in the hope that it will be useful, -//but WITHOUT ANY WARRANTY; without even the implied warranty of -//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -//Lesser General Public License for more details. -// -//You should have received a copy of the GNU Lesser General Public -//License along with this program; if not, write to the Free Software -//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -#include "filters.h" -#include -#ifdef __GNUC__ -#include -#endif - - -#if (defined(__GNUC__) && defined(__i386__)) || (defined(_MSC_VER) && defined(_X86_)) -#define HQ2XASM -#endif - -#ifdef _MSC_VER -//#define HQ2XMMXASM -#endif - -static int LUT16to32[65536]; -static int RGBtoYUV[65536]; -#ifdef HQ2XMMXASM -#include "SDL_cpuinfo.h" -static SDL_bool hasMMX = 0; -const Sint64 reg_blank = 0; -const Sint64 const3 = 0x0000000300030003; -const Sint64 const5 = 0x0000000500050005; -const Sint64 const6 = 0x0000000600060006; -const Sint64 const14 = 0x0000000E000E000E; -const Sint64 tr3eshold = 0x0000000000300706; -#endif -static int YUV1, YUV2; -const int Ymask = 0x00FF0000; -const int Umask = 0x0000FF00; -const int Vmask = 0x000000FF; -const int trY = 0x00300000; -const int trU = 0x00000700; -const int trV = 0x00000006; - -FUNCINLINE static ATTRINLINE void Interp1(Uint8 * pc, int c1, int c2) -{ -#ifdef HQ2XASM - //*((int*)pc) = (c1*3+c2)/4; -#ifdef __GNUC__ - int c3 = c1; - __asm__("shl $2, %1; add %2, %1; sub %3, %1; shr $2, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2),"r"(c3):"memory"); -#else - __asm - { - mov eax, pc - mov edx, c1 - shl edx, 2 - add edx, c2 - sub edx, c1 - shr edx, 2 - mov [eax], edx - } -#endif -#else - *((int*)pc) = (c1*3+c2) >> 2; -#endif -} - -FUNCINLINE static ATTRINLINE void Interp2(Uint8 * pc, int c1, int c2, int c3) -{ -#ifdef HQ2XASM -// *((int*)pc) = (c1*2+c2+c3) >> 2; -#ifdef __GNUC__ - __asm__("shl $1, %1; add %2, %1; add %3, %1; shr $2, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2),"r"(c3):"memory"); -#else - __asm - { - mov eax, pc - mov edx, c1 - shl edx, 1 - add edx, c2 - add edx, c3 - shr edx, 2 - mov [eax], edx - } -#endif -#else - *((int*)pc) = (c1*2+c2+c3) >> 2; -#endif -} - -#if 0 -static inline void Interp5(Uint8 * pc, int c1, int c2) -{ -#ifdef HQ2XASM - //*((int*)pc) = (c1+c2)/2; -#ifdef __GNUC__ - __asm__("add %2, %1; shr $1, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2):"memory"); -#else - __asm - { - mov eax, pc - mov edx, c1 - add edx, c2 - shr edx, 1 - mov [eax], edx - } -#endif -#else - *((int*)pc) = (c1+c2) >> 1; -#endif -} -#endif - -FUNCINLINE static ATTRINLINE void Interp6(Uint8 * pc, int c1, int c2, int c3) -{ -#ifdef HQ2XMMXASM - //*((int*)pc) = (c1*5+c2*2+c3)/8; - if(hasMMX) -#ifdef __GNUC__ - __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmullw $_const5, %%mm1; psllw $1, %%mm2; paddw %%mm3, %%mm1; paddw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory"); -#else - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movd mm3, c3 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - punpcklbw mm3, reg_blank - pmullw mm1, const5 - psllw mm2, 1 - paddw mm1, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, reg_blank - movd [eax], mm1 - } -#endif - else -#endif - *((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) + - (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; -} - -FUNCINLINE static ATTRINLINE void Interp7(Uint8 * pc, int c1, int c2, int c3) -{ -#ifdef HQ2XMMXASM - //*((int*)pc) = (c1*6+c2+c3)/8; - if(hasMMX) -#ifdef __GNUC__ - __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmull2 $_const6, %%mm1; padw %%mm3, %%mm2; paddw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0 " : "=r" (*((int*)pc)): "r"(c1), "r"(c2), "r"(c3) : "memory"); -#else - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movd mm3, c3 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - punpcklbw mm3, reg_blank - pmullw mm1, const6 - paddw mm2, mm3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, reg_blank - movd [eax], mm1 - } -#endif - else -#endif - *((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) + - (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; -} - -FUNCINLINE static ATTRINLINE void Interp9(Uint8 * pc, int c1, int c2, int c3) -{ -#ifdef HQ2XMMXASM - //*((int*)pc) = (c1*2+(c2+c3)*3)/8; - if(hasMMX) -#ifdef __GNUC__ - __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; psllw $1, %%mm1; paddw %%mm3, %%mm2; pmullw $_const3, %%mm2; padw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0;" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory"); -#else - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movd mm3, c3 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - punpcklbw mm3, reg_blank - psllw mm1, 1 - paddw mm2, mm3 - pmullw mm2, const3 - paddw mm1, mm2 - psrlw mm1, 3 - packuswb mm1, reg_blank - movd [eax], mm1 - } -#endif - else -#endif - *((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) + - (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3; -} - -FUNCINLINE static ATTRINLINE void Interp10(Uint8 * pc, int c1, int c2, int c3) -{ -#ifdef HQ2XMMXASM - //*((int*)pc) = (c1*14+c2+c3)/16; - if(hasMMX) -#ifdef __GNUC__ - __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmullw $_const14, %%mm1; paddw %%mm3, %%mm2; paddw %%mm2, %%mm1; psrlw $4, %%mm1; packuswb $_req_blank, %%mm1; movd %%mm1, %0;" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory"); -#else - __asm - { - mov eax, pc - movd mm1, c1 - movd mm2, c2 - movd mm3, c3 - punpcklbw mm1, reg_blank - punpcklbw mm2, reg_blank - punpcklbw mm3, reg_blank - pmullw mm1, const14 - paddw mm2, mm3 - paddw mm1, mm2 - psrlw mm1, 4 - packuswb mm1, reg_blank - movd [eax], mm1 - } -#endif - else -#endif - *((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) + - (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4; -} -#define PIXEL00_0 *((int*)(pOut)) = c[5]; -#define PIXEL00_10 Interp1(pOut, c[5], c[1]); -#define PIXEL00_11 Interp1(pOut, c[5], c[4]); -#define PIXEL00_12 Interp1(pOut, c[5], c[2]); -#define PIXEL00_20 Interp2(pOut, c[5], c[4], c[2]); -#define PIXEL00_21 Interp2(pOut, c[5], c[1], c[2]); -#define PIXEL00_22 Interp2(pOut, c[5], c[1], c[4]); -#define PIXEL00_60 Interp6(pOut, c[5], c[2], c[4]); -#define PIXEL00_61 Interp6(pOut, c[5], c[4], c[2]); -#define PIXEL00_70 Interp7(pOut, c[5], c[4], c[2]); -#define PIXEL00_90 Interp9(pOut, c[5], c[4], c[2]); -#define PIXEL00_100 Interp10(pOut, c[5], c[4], c[2]); -#define PIXEL01_0 *((int*)(pOut+4)) = c[5]; -#define PIXEL01_10 Interp1(pOut+4, c[5], c[3]); -#define PIXEL01_11 Interp1(pOut+4, c[5], c[2]); -#define PIXEL01_12 Interp1(pOut+4, c[5], c[6]); -#define PIXEL01_20 Interp2(pOut+4, c[5], c[2], c[6]); -#define PIXEL01_21 Interp2(pOut+4, c[5], c[3], c[6]); -#define PIXEL01_22 Interp2(pOut+4, c[5], c[3], c[2]); -#define PIXEL01_60 Interp6(pOut+4, c[5], c[6], c[2]); -#define PIXEL01_61 Interp6(pOut+4, c[5], c[2], c[6]); -#define PIXEL01_70 Interp7(pOut+4, c[5], c[2], c[6]); -#define PIXEL01_90 Interp9(pOut+4, c[5], c[2], c[6]); -#define PIXEL01_100 Interp10(pOut+4, c[5], c[2], c[6]); -#define PIXEL10_0 *((int*)(pOut+BpL)) = c[5]; -#define PIXEL10_10 Interp1(pOut+BpL, c[5], c[7]); -#define PIXEL10_11 Interp1(pOut+BpL, c[5], c[8]); -#define PIXEL10_12 Interp1(pOut+BpL, c[5], c[4]); -#define PIXEL10_20 Interp2(pOut+BpL, c[5], c[8], c[4]); -#define PIXEL10_21 Interp2(pOut+BpL, c[5], c[7], c[4]); -#define PIXEL10_22 Interp2(pOut+BpL, c[5], c[7], c[8]); -#define PIXEL10_60 Interp6(pOut+BpL, c[5], c[4], c[8]); -#define PIXEL10_61 Interp6(pOut+BpL, c[5], c[8], c[4]); -#define PIXEL10_70 Interp7(pOut+BpL, c[5], c[8], c[4]); -#define PIXEL10_90 Interp9(pOut+BpL, c[5], c[8], c[4]); -#define PIXEL10_100 Interp10(pOut+BpL, c[5], c[8], c[4]); -#define PIXEL11_0 *((int*)(pOut+BpL+4)) = c[5]; -#define PIXEL11_10 Interp1(pOut+BpL+4, c[5], c[9]); -#define PIXEL11_11 Interp1(pOut+BpL+4, c[5], c[6]); -#define PIXEL11_12 Interp1(pOut+BpL+4, c[5], c[8]); -#define PIXEL11_20 Interp2(pOut+BpL+4, c[5], c[6], c[8]); -#define PIXEL11_21 Interp2(pOut+BpL+4, c[5], c[9], c[8]); -#define PIXEL11_22 Interp2(pOut+BpL+4, c[5], c[9], c[6]); -#define PIXEL11_60 Interp6(pOut+BpL+4, c[5], c[8], c[6]); -#define PIXEL11_61 Interp6(pOut+BpL+4, c[5], c[6], c[8]); -#define PIXEL11_70 Interp7(pOut+BpL+4, c[5], c[6], c[8]); -#define PIXEL11_90 Interp9(pOut+BpL+4, c[5], c[6], c[8]); -#define PIXEL11_100 Interp10(pOut+BpL+4, c[5], c[6], c[8]); - -#ifdef _MSC_VER -#pragma warning(disable: 4035) -#endif - -FUNCINLINE static ATTRINLINE int Diff(Uint32 w1, Uint32 w2) -{ -#ifdef HQ2XMMXASM - if(hasMMX) - { -#ifdef __GNUC__ - int diffresult = 0; - if(w1 != w2) - __asm__("movd %3+%1*4, %%mm1; movq %%mm1, %%mm5; movd %3+%2*4, %%mm2; psubusb %%mm2, %%mm1; psubusb %%mm5, %%mm2; por %%mm2, %%mm1; psubusb $_treshold, %%mm1; movd %%mm1, %0" : "=c" (diffresult):"d" (w1),"q" (w2),"c" (RGBtoYUV) : "memory"); - return diffresult; -#else - __asm - { - xor eax,eax - mov ebx,w1 - mov edx,w2 - cmp ebx,edx - je FIN - mov ecx,offset RGBtoYUV - movd mm1,[ecx + ebx*4] - movq mm5,mm1 - movd mm2,[ecx + edx*4] - psubusb mm1,mm2 - psubusb mm2,mm5 - por mm1,mm2 - psubusb mm1,treshold - movd eax,mm1 -FIN: - }// returns result in eax register -#endif - } - else -#endif - { - YUV1 = RGBtoYUV[w1]; - YUV2 = RGBtoYUV[w2]; - return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || - ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || - ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); - } -} - - -#ifdef _MSC_VER -#pragma warning(default: 4035) -#endif - - -static void hq2x_32( Uint8 * pIn, Uint8 * pOut, int Xres, int Yres, int BpL ) -{ - int i, j, k; - int prevline, nextline; - int w[10]; - int c[10]; - - // +----+----+----+ - // | | | | - // | w1 | w2 | w3 | - // +----+----+----+ - // | | | | - // | w4 | w5 | w6 | - // +----+----+----+ - // | | | | - // | w7 | w8 | w9 | - // +----+----+----+ - - for (j=0; j0) prevline = -Xres*2; else prevline = 0; - if (j0) - { - w[1] = *((Uint16*)(pIn + prevline - 2)); - w[4] = *((Uint16*)(pIn - 2)); - w[7] = *((Uint16*)(pIn + nextline - 2)); - } - else - { - w[1] = w[2]; - w[4] = w[5]; - w[7] = w[8]; - } - - if (i trY ) || - ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || - ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) - pattern |= flag; - } - flag <<= 1; - } - } - - for (k=1; k<=9; k++) - c[k] = LUT16to32[w[k]]; - - switch (pattern) - { - case 0: - case 1: - case 4: - case 32: - case 128: - case 5: - case 132: - case 160: - case 33: - case 129: - case 36: - case 133: - case 164: - case 161: - case 37: - case 165: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_20 - PIXEL11_20 - break; - } - case 2: - case 34: - case 130: - case 162: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - break; - } - case 16: - case 17: - case 48: - case 49: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_21 - break; - } - case 64: - case 65: - case 68: - case 69: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_22 - break; - } - case 8: - case 12: - case 136: - case 140: - { - PIXEL00_21 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - break; - } - case 3: - case 35: - case 131: - case 163: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - break; - } - case 6: - case 38: - case 134: - case 166: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 20: - case 21: - case 52: - case 53: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_21 - break; - } - case 144: - case 145: - case 176: - case 177: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_12 - break; - } - case 192: - case 193: - case 196: - case 197: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_11 - break; - } - case 96: - case 97: - case 100: - case 101: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_22 - break; - } - case 40: - case 44: - case 168: - case 172: - { - PIXEL00_21 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 9: - case 13: - case 137: - case 141: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - break; - } - case 18: - case 50: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_20 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 80: - case 81: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_20 - } - break; - } - case 72: - case 76: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 10: - case 138: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - break; - } - case 66: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - break; - } - case 24: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - break; - } - case 7: - case 39: - case 135: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 148: - case 149: - case 180: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - break; - } - case 224: - case 228: - case 225: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - break; - } - case 41: - case 169: - case 45: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 22: - case 54: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 208: - case 209: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 104: - case 108: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 11: - case 139: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - break; - } - case 19: - case 51: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_10 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 146: - case 178: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_20 - break; - } - case 84: - case 85: - { - PIXEL00_20 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_10 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_21 - break; - } - case 112: - case 113: - { - PIXEL00_20 - PIXEL01_22 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_10 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 200: - case 204: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 73: - case 77: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_10 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_20 - PIXEL11_22 - break; - } - case 42: - case 170: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_21 - PIXEL11_20 - break; - } - case 14: - case 142: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_22 - PIXEL11_20 - break; - } - case 67: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - break; - } - case 70: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - break; - } - case 28: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - break; - } - case 152: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - break; - } - case 194: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - break; - } - case 98: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - break; - } - case 56: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - break; - } - case 25: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - break; - } - case 26: - case 31: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_21 - break; - } - case 82: - case 214: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 88: - case 248: - { - PIXEL00_21 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 74: - case 107: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 27: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_22 - PIXEL11_21 - break; - } - case 86: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - PIXEL11_10 - break; - } - case 216: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 106: - { - PIXEL00_10 - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 30: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_21 - break; - } - case 210: - { - PIXEL00_22 - PIXEL01_10 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 120: - { - PIXEL00_21 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 75: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_10 - PIXEL11_22 - break; - } - case 29: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - break; - } - case 198: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - break; - } - case 184: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - break; - } - case 99: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - break; - } - case 57: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - break; - } - case 71: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - break; - } - case 156: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - break; - } - case 226: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - break; - } - case 60: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - break; - } - case 195: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - break; - } - case 102: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - break; - } - case 153: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - break; - } - case 58: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 83: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 92: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 202: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 78: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_22 - break; - } - case 154: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 114: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 89: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 90: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 55: - case 23: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_0 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 182: - case 150: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_20 - break; - } - case 213: - case 212: - { - PIXEL00_20 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_0 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_21 - break; - } - case 241: - case 240: - { - PIXEL00_20 - PIXEL01_22 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_0 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 236: - case 232: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 109: - case 105: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_0 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_20 - PIXEL11_22 - break; - } - case 171: - case 43: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_21 - PIXEL11_20 - break; - } - case 143: - case 15: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_22 - PIXEL11_20 - break; - } - case 124: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 203: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_10 - PIXEL11_11 - break; - } - case 62: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 211: - { - PIXEL00_11 - PIXEL01_10 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 118: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_12 - PIXEL11_10 - break; - } - case 217: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 110: - { - PIXEL00_10 - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 155: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_22 - PIXEL11_12 - break; - } - case 188: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - break; - } - case 185: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - break; - } - case 61: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - break; - } - case 157: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - break; - } - case 103: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - break; - } - case 227: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - break; - } - case 230: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - break; - } - case 199: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - break; - } - case 220: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 158: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 234: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_11 - break; - } - case 242: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 59: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 121: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 87: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 79: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_22 - break; - } - case 122: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 94: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 218: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 91: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 229: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - break; - } - case 167: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 173: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 181: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - break; - } - case 186: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_12 - break; - } - case 115: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 93: - { - PIXEL00_12 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 206: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 205: - case 201: - { - PIXEL00_12 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 174: - case 46: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - break; - } - case 179: - case 147: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_20 - PIXEL11_12 - break; - } - case 117: - case 116: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 189: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - break; - } - case 231: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - break; - } - case 126: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 219: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 125: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_0 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_11 - PIXEL11_10 - break; - } - case 221: - { - PIXEL00_12 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_0 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_10 - break; - } - case 207: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_10 - PIXEL11_11 - break; - } - case 238: - { - PIXEL00_10 - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 190: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_11 - break; - } - case 187: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_10 - PIXEL11_12 - break; - } - case 243: - { - PIXEL00_11 - PIXEL01_10 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_0 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 119: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_0 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_12 - PIXEL11_10 - break; - } - case 237: - case 233: - { - PIXEL00_12 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 175: - case 47: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - break; - } - case 183: - case 151: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_20 - PIXEL11_12 - break; - } - case 245: - case 244: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 250: - { - PIXEL00_10 - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 123: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 95: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_10 - PIXEL11_10 - break; - } - case 222: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 252: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 249: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 235: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 111: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 63: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 159: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 215: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 246: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 254: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 253: - { - PIXEL00_12 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 251: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 239: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 127: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 191: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_11 - PIXEL11_12 - break; - } - case 223: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 247: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 255: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - } - pIn+=2; - pOut+=8; - } - pOut+=BpL; - } -} - -FUNCINLINE static ATTRINLINE void InitLUTs(void) -{ - int i, j, k, r, g, b, Y, u, v; - -#ifdef HQ2XMMXASM - hasMMX = SDL_HasMMX(); -#endif - - for (i=0; i<65536; i++) - LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3); - - for (i=0; i<32; i++) - for (j=0; j<64; j++) - for (k=0; k<32; k++) - { - r = i << 3; - g = j << 2; - b = k << 3; - Y = (r + g + b) >> 2; - u = 128 + ((r - b) >> 2); - v = 128 + ((-r + 2*g -b)>>3); - RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v; - } -} - -void filter_hq2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height) -{ - static Uint8 doneLUT = 1; - (void)srcPitch; - if(doneLUT) InitLUTs(); - else doneLUT = 0; - hq2x_32( srcPtr, dstPtr, width, height, dstPitch ); -} diff --git a/src/sdl/filter/hq2x.h b/src/sdl/filter/hq2x.h deleted file mode 100644 index 49c0b268..00000000 --- a/src/sdl/filter/hq2x.h +++ /dev/null @@ -1,1824 +0,0 @@ -case 0 : -case 1 : -case 4 : -case 5 : -case 32 : -case 33 : -case 36 : -case 37 : -case 128 : -case 129 : -case 132 : -case 133 : -case 160 : -case 161 : -case 164 : -case 165 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 2 : -case 34 : -case 130 : -case 162 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 3 : -case 35 : -case 131 : -case 163 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 6 : -case 38 : -case 134 : -case 166 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 7 : -case 39 : -case 135 : -case 167 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I211(4, 3, 7); - P3 = I211(4, 5, 7); -} break; -case 8 : -case 12 : -case 136 : -case 140 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); -} break; -case 9 : -case 13 : -case 137 : -case 141 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); -} break; -case 10 : -case 138 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 11 : -case 139 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 14 : -case 142 : -{ - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 15 : -case 143 : -{ - P2 = I31(4, 6); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 16 : -case 17 : -case 48 : -case 49 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); -} break; -case 18 : -case 50 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 19 : -case 51 : -{ - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = I31(4, 2); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 20 : -case 21 : -case 52 : -case 53 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); -} break; -case 22 : -case 54 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 23 : -case 55 : -{ - P2 = I211(4, 3, 7); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = IC(4); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 24 : -case 66 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 25 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 26 : -case 31 : -case 95 : -{ - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 27 : -case 75 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 28 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 29 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 30 : -case 86 : -{ - P0 = I31(4, 0); - P2 = I31(4, 6); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 40 : -case 44 : -case 168 : -case 172 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); -} break; -case 41 : -case 45 : -case 169 : -case 173 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); -} break; -case 42 : -case 170 : -{ - P1 = I31(4, 2); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 43 : -case 171 : -{ - P1 = I31(4, 2); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 46 : -case 174 : -{ - P1 = I31(4, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 47 : -case 175 : -{ - P1 = I31(4, 5); - P2 = I31(4, 7); - P3 = I211(4, 5, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 56 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 57 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 58 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 59 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 60 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 61 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 8); -} break; -case 62 : -{ - P0 = I31(4, 0); - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 63 : -{ - P2 = I31(4, 7); - P3 = I31(4, 8); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 64 : -case 65 : -case 68 : -case 69 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 67 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 70 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 71 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 8); -} break; -case 72 : -case 76 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 73 : -case 77 : -{ - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = I31(4, 6); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 74 : -case 107 : -case 123 : -{ - P1 = I31(4, 2); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 78 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 79 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 80 : -case 81 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 82 : -case 214 : -case 222 : -{ - P0 = I31(4, 0); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 83 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 84 : -case 85 : -{ - P0 = I211(4, 1, 3); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = I31(4, 8); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 87 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 88 : -case 248 : -case 250 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 89 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 90 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 91 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 92 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 93 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 94 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 96 : -case 97 : -case 100 : -case 101 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 98 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 99 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 102 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 103 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 8); -} break; -case 104 : -case 108 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 105 : -case 109 : -{ - P1 = I211(4, 1, 5); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = IC(4); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 106 : -case 120 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 110 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 111 : -{ - P1 = I31(4, 5); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 112 : -case 113 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = I31(4, 8); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 114 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 115 : -{ - P0 = I31(4, 3); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 116 : -case 117 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I31(4, 3); - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 118 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - P3 = I31(4, 8); - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 119 : -{ - P2 = I31(4, 3); - P3 = I31(4, 8); - if (MUR) { - P0 = I31(4, 3); - P1 = IC(4); - } else { - P0 = I521(4, 1, 3); - P1 = I332(1, 5, 4); - } -} break; -case 121 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } -} break; -case 122 : -{ - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = I31(4, 8); - } else { - P3 = I611(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 124 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } -} break; -case 125 : -{ - P1 = I31(4, 1); - P3 = I31(4, 8); - if (MDL) { - P0 = I31(4, 1); - P2 = IC(4); - } else { - P0 = I521(4, 3, 1); - P2 = I332(3, 7, 4); - } -} break; -case 126 : -{ - P0 = I31(4, 0); - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 127 : -{ - P3 = I31(4, 8); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 144 : -case 145 : -case 176 : -case 177 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); -} break; -case 146 : -case 178 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - if (MUR) { - P1 = I31(4, 2); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 147 : -case 179 : -{ - P0 = I31(4, 3); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 148 : -case 149 : -case 180 : -case 181 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); -} break; -case 150 : -case 182 : -{ - P0 = I31(4, 0); - P2 = I211(4, 3, 7); - if (MUR) { - P1 = IC(4); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 151 : -case 183 : -{ - P0 = I31(4, 3); - P2 = I211(4, 3, 7); - P3 = I31(4, 7); - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 152 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 153 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 154 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 155 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 156 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 157 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 6); - P3 = I31(4, 7); -} break; -case 158 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 159 : -{ - P2 = I31(4, 6); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 184 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 185 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 186 : -{ - P2 = I31(4, 7); - P3 = I31(4, 7); - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 187 : -{ - P1 = I31(4, 2); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - P2 = I31(4, 7); - } else { - P0 = I332(1, 3, 4); - P2 = I521(4, 3, 7); - } -} break; -case 188 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 189 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - P2 = I31(4, 7); - P3 = I31(4, 7); -} break; -case 190 : -{ - P0 = I31(4, 0); - P2 = I31(4, 7); - if (MUR) { - P1 = IC(4); - P3 = I31(4, 7); - } else { - P1 = I332(1, 5, 4); - P3 = I521(4, 5, 7); - } -} break; -case 191 : -{ - P2 = I31(4, 7); - P3 = I31(4, 7); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 192 : -case 193 : -case 196 : -case 197 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 194 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 195 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 198 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 199 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 6); - P3 = I31(4, 5); -} break; -case 200 : -case 204 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - if (MDL) { - P2 = I31(4, 6); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 201 : -case 205 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } -} break; -case 202 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 203 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - P3 = I31(4, 5); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 206 : -{ - P1 = I31(4, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 207 : -{ - P2 = I31(4, 6); - P3 = I31(4, 5); - if (MUL) { - P0 = IC(4); - P1 = I31(4, 5); - } else { - P0 = I332(1, 3, 4); - P1 = I521(4, 1, 5); - } -} break; -case 208 : -case 209 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 210 : -case 216 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 211 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 212 : -case 213 : -{ - P0 = I211(4, 1, 3); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = IC(4); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 215 : -{ - P0 = I31(4, 3); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 217 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 218 : -{ - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 219 : -{ - P1 = I31(4, 2); - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 220 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = I31(4, 6); - } else { - P2 = I611(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 221 : -{ - P0 = I31(4, 1); - P2 = I31(4, 6); - if (MDR) { - P1 = I31(4, 1); - P3 = IC(4); - } else { - P1 = I521(4, 5, 1); - P3 = I332(5, 7, 4); - } -} break; -case 223 : -{ - P2 = I31(4, 6); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 224 : -case 225 : -case 228 : -case 229 : -{ - P0 = I211(4, 1, 3); - P1 = I211(4, 1, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 226 : -{ - P0 = I31(4, 0); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 227 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 230 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 231 : -{ - P0 = I31(4, 3); - P1 = I31(4, 5); - P2 = I31(4, 3); - P3 = I31(4, 5); -} break; -case 232 : -case 236 : -{ - P0 = I31(4, 0); - P1 = I211(4, 1, 5); - if (MDL) { - P2 = IC(4); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 233 : -case 237 : -{ - P0 = I31(4, 1); - P1 = I211(4, 1, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } -} break; -case 234 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = I31(4, 0); - } else { - P0 = I611(4, 1, 3); - } -} break; -case 235 : -{ - P1 = I31(4, 2); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 238 : -{ - P0 = I31(4, 0); - P1 = I31(4, 5); - if (MDL) { - P2 = IC(4); - P3 = I31(4, 5); - } else { - P2 = I332(3, 7, 4); - P3 = I521(4, 7, 5); - } -} break; -case 239 : -{ - P1 = I31(4, 5); - P3 = I31(4, 5); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 240 : -case 241 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = IC(4); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 242 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUR) { - P1 = I31(4, 2); - } else { - P1 = I611(4, 1, 5); - } -} break; -case 243 : -{ - P0 = I31(4, 3); - P1 = I31(4, 2); - if (MDR) { - P2 = I31(4, 3); - P3 = IC(4); - } else { - P2 = I521(4, 7, 3); - P3 = I332(5, 7, 4); - } -} break; -case 244 : -case 245 : -{ - P0 = I211(4, 1, 3); - P1 = I31(4, 1); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 246 : -{ - P0 = I31(4, 0); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 247 : -{ - P0 = I31(4, 3); - P2 = I31(4, 3); - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 249 : -{ - P0 = I31(4, 1); - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } -} break; -case 251 : -{ - P1 = I31(4, 2); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 252 : -{ - P0 = I31(4, 0); - P1 = I31(4, 1); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 253 : -{ - P0 = I31(4, 1); - P1 = I31(4, 1); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } -} break; -case 254 : -{ - P0 = I31(4, 0); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 255 : -{ - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; diff --git a/src/sdl/filter/interp.h b/src/sdl/filter/interp.h deleted file mode 100644 index e994387f..00000000 --- a/src/sdl/filter/interp.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * This file is part of the Advance project. - * - * Copyright (C) 2003 Andrea Mazzoleni - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * In addition, as a special exception, Andrea Mazzoleni - * gives permission to link the code of this program with - * the MAME library (or with modified versions of MAME that use the - * same license as MAME), and distribute linked combinations including - * the two. You must obey the GNU General Public License in all - * respects for all of the code used other than MAME. If you modify - * this file, you may extend this exception to your version of the - * file, but you are not obligated to do so. If you do not wish to - * do so, delete this exception statement from your version. - */ - -#ifndef __INTERP_H -#define __INTERP_H - -/***************************************************************************/ -/* Basic types */ - -/***************************************************************************/ -/* interpolation */ - -static Uint32 interp_mask[2] = {0xF81F,0x07E0}; -static Uint32 interp_bits_per_pixel = 16; - -#define INTERP_16_MASK_1(v) (v & interp_mask[0]) -#define INTERP_16_MASK_2(v) (v & interp_mask[1]) - -FUNCINLINE static ATTRINLINE Uint16 interp_16_521(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*2 + INTERP_16_MASK_1(p3)*1) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*2 + INTERP_16_MASK_2(p3)*1) / 8)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_332(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)*2) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)*2) / 8)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_611(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*6 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*6 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 8)); -} - -/* -FUNCINLINE static ATTRINLINE Uint16 interp_16_71(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*7 + INTERP_16_MASK_1(p2)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*7 + INTERP_16_MASK_2(p2)) / 8)); -} -*/ - -FUNCINLINE static ATTRINLINE Uint16 interp_16_211(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*2 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 4) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*2 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 4)); -} - -/* -FUNCINLINE static ATTRINLINE Uint16 interp_16_772(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1(((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2))*7 + INTERP_16_MASK_1(p3)*2) / 16) - | INTERP_16_MASK_2(((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2))*7 + INTERP_16_MASK_2(p3)*2) / 16)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_11(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2)) / 2) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2)) / 2)); -} -*/ - -FUNCINLINE static ATTRINLINE Uint16 interp_16_31(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)) / 4) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)) / 4)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_1411(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*14 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*14 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 16)); -} - -/* -FUNCINLINE static ATTRINLINE Uint16 interp_16_431(Uint16 p1, Uint16 p2, Uint16 p3) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*4 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*4 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)) / 8)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_53(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*3) / 8) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*3) / 8)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_151(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*15 + INTERP_16_MASK_1(p2)) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*15 + INTERP_16_MASK_2(p2)) / 16)); -} - -FUNCINLINE static ATTRINLINE Uint16 interp_16_97(Uint16 p1, Uint16 p2) -{ - return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*9 + INTERP_16_MASK_1(p2)*7) / 16) - | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*9 + INTERP_16_MASK_2(p2)*7) / 16)); -} -*/ - -#define INTERP_32_MASK_1(v) (v & 0xFF00FF) -#define INTERP_32_MASK_2(v) (v & 0x00FF00) - -FUNCINLINE static ATTRINLINE Uint32 interp_32_521(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*2 + INTERP_32_MASK_1(p3)*1) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*2 + INTERP_32_MASK_2(p3)*1) / 8); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_332(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)*2) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)*2) / 8); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_211(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*2 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 4) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*2 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 4); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_611(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*6 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*6 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 8); -} - -/* -FUNCINLINE static ATTRINLINE Uint32 interp_32_71(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*7 + INTERP_32_MASK_1(p2)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*7 + INTERP_32_MASK_2(p2)) / 8); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_772(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1(((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2))*7 + INTERP_32_MASK_1(p3)*2) / 16) - | INTERP_32_MASK_2(((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2))*7 + INTERP_32_MASK_2(p3)*2) / 16); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_11(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2)) / 2) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2)) / 2); -} -*/ - -FUNCINLINE static ATTRINLINE Uint32 interp_32_31(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)) / 4) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)) / 4); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_1411(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*14 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*14 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 16); -} - -/* -FUNCINLINE static ATTRINLINE Uint32 interp_32_431(Uint32 p1, Uint32 p2, Uint32 p3) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*4 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*4 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)) / 8); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_53(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*3) / 8) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*3) / 8); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_151(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*15 + INTERP_32_MASK_1(p2)) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*15 + INTERP_32_MASK_2(p2)) / 16); -} - -FUNCINLINE static ATTRINLINE Uint32 interp_32_97(Uint32 p1, Uint32 p2) -{ - return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*9 + INTERP_32_MASK_1(p2)*7) / 16) - | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*9 + INTERP_32_MASK_2(p2)*7) / 16); -} -*/ - -/***************************************************************************/ -/* diff */ - -#define INTERP_Y_LIMIT (0x30*4) -#define INTERP_U_LIMIT (0x07*4) -#define INTERP_V_LIMIT (0x06*8) - -static int interp_16_diff(Uint16 p1, Uint16 p2) -{ - int r, g, b; - int y, u, v; - - if (p1 == p2) - return 0; - - if (interp_bits_per_pixel == 16) { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3; - r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8; - } else { - b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3; - g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2; - r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7; - } - - y = r + g + b; - u = r - b; - v = -r + 2*g - b; - - if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) - return 1; - - if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) - return 1; - - if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) - return 1; - - return 0; -} - -static int interp_32_diff(Uint32 p1, Uint32 p2) -{ - int r, g, b; - int y, u, v; - - if ((p1 & 0xF8F8F8) == (p2 & 0xF8F8F8)) - return 0; - - b = (int)((p1 & 0xFF) - (p2 & 0xFF)); - g = (int)((p1 & 0xFF00) - (p2 & 0xFF00)) >> 8; - r = (int)((p1 & 0xFF0000) - (p2 & 0xFF0000)) >> 16; - - y = r + g + b; - u = r - b; - v = -r + 2*g - b; - - if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT) - return 1; - - if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT) - return 1; - - if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT) - return 1; - - return 0; -} - -/* -static void interp_set(Uint32 bits_per_pixel) -{ - interp_bits_per_pixel = bits_per_pixel; - - switch (bits_per_pixel) { - case 15 : - interp_mask[0] = 0x7C1F; - interp_mask[1] = 0x03E0; - break; - case 16 : - interp_mask[0] = 0xF81F; - interp_mask[1] = 0x07E0; - break; - case 32 : - interp_mask[0] = 0xFF00FF; - interp_mask[1] = 0x00FF00; - break; - } -} -*/ - -#endif diff --git a/src/sdl/filter/lq2x.c b/src/sdl/filter/lq2x.c deleted file mode 100644 index 8d06fa8c..00000000 --- a/src/sdl/filter/lq2x.c +++ /dev/null @@ -1,564 +0,0 @@ -#include "filters.h" -#include "interp.h" - -static void hq2x_16_def(Uint16* dst0, Uint16* dst1, const Uint16* src0, const Uint16* src1, const Uint16* src2, Uint32 count) -{ - Uint32 i; - - for(i=0;i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i> 1); - - Uint16 *src0 = (Uint16 *)srcPtr; - Uint16 *src1 = src0 + (srcPitch >> 1); - Uint16 *src2 = src1 + (srcPitch >> 1); - int count = height-2; - - hq2x_16_def(dst0, dst1, src0, src0, src1, width); - - while(count) { - dst0 += dstPitch; - dst1 += dstPitch; - hq2x_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - hq2x_16_def(dst0, dst1, src0, src1, src1, width); -} - -void hq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, - Uint32 dstPitch, int width, int height) -{ - Uint32 *dst0 = (Uint32 *)dstPtr; - Uint32 *dst1 = dst0 + (dstPitch >> 2); - - Uint32 *src0 = (Uint32 *)srcPtr; - Uint32 *src1 = src0 + (srcPitch >> 2); - Uint32 *src2 = src1 + (srcPitch >> 2); - int count = height-2; - - hq2x_32_def(dst0, dst1, src0, src0, src1, width); - - while(count) { - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2x_32_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 2; - --count; - } - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2x_32_def(dst0, dst1, src0, src1, src1, width); -} - -void lq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, - Uint32 dstPitch, int width, int height) -{ - Uint16 *dst0 = (Uint16 *)dstPtr; - Uint16 *dst1 = dst0 + (dstPitch >> 1); - - Uint16 *src0 = (Uint16 *)srcPtr; - Uint16 *src1 = src0 + (srcPitch >> 1); - Uint16 *src2 = src1 + (srcPitch >> 1); - int count = height-2; - - lq2x_16_def(dst0, dst1, src0, src0, src1, width); - - while(count) { - dst0 += dstPitch; - dst1 += dstPitch; - lq2x_16_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 1; - --count; - } - dst0 += dstPitch; - dst1 += dstPitch; - lq2x_16_def(dst0, dst1, src0, src1, src1, width); -} - -void lq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, - Uint32 dstPitch, int width, int height) -{ - Uint32 *dst0 = (Uint32 *)dstPtr; - Uint32 *dst1 = dst0 + (dstPitch >> 2); - - Uint32 *src0 = (Uint32 *)srcPtr; - Uint32 *src1 = src0 + (srcPitch >> 2); - Uint32 *src2 = src1 + (srcPitch >> 2); - int count = height-2; - - lq2x_32_def(dst0, dst1, src0, src0, src1, width); - - while(count) { - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - lq2x_32_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 2; - --count; - } - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - lq2x_32_def(dst0, dst1, src0, src1, src1, width); -} - -/* -static inline void hq2x_init(Uint32 bits_per_pixel) -{ - interp_set(bits_per_pixel); -} -*/ diff --git a/src/sdl/filter/lq2x.h b/src/sdl/filter/lq2x.h deleted file mode 100644 index 094c2b5a..00000000 --- a/src/sdl/filter/lq2x.h +++ /dev/null @@ -1,1284 +0,0 @@ -case 0 : -case 2 : -case 4 : -case 6 : -case 8 : -case 12 : -case 16 : -case 20 : -case 24 : -case 28 : -case 32 : -case 34 : -case 36 : -case 38 : -case 40 : -case 44 : -case 48 : -case 52 : -case 56 : -case 60 : -case 64 : -case 66 : -case 68 : -case 70 : -case 96 : -case 98 : -case 100 : -case 102 : -case 128 : -case 130 : -case 132 : -case 134 : -case 136 : -case 140 : -case 144 : -case 148 : -case 152 : -case 156 : -case 160 : -case 162 : -case 164 : -case 166 : -case 168 : -case 172 : -case 176 : -case 180 : -case 184 : -case 188 : -case 192 : -case 194 : -case 196 : -case 198 : -case 224 : -case 226 : -case 228 : -case 230 : -{ - P0 = IC(0); - P1 = IC(0); - P2 = IC(0); - P3 = IC(0); -} break; -case 1 : -case 5 : -case 9 : -case 13 : -case 17 : -case 21 : -case 25 : -case 29 : -case 33 : -case 37 : -case 41 : -case 45 : -case 49 : -case 53 : -case 57 : -case 61 : -case 65 : -case 69 : -case 97 : -case 101 : -case 129 : -case 133 : -case 137 : -case 141 : -case 145 : -case 149 : -case 153 : -case 157 : -case 161 : -case 165 : -case 169 : -case 173 : -case 177 : -case 181 : -case 185 : -case 189 : -case 193 : -case 197 : -case 225 : -case 229 : -{ - P0 = IC(1); - P1 = IC(1); - P2 = IC(1); - P3 = IC(1); -} break; -case 3 : -case 35 : -case 67 : -case 99 : -case 131 : -case 163 : -case 195 : -case 227 : -{ - P0 = IC(2); - P1 = IC(2); - P2 = IC(2); - P3 = IC(2); -} break; -case 7 : -case 39 : -case 71 : -case 103 : -case 135 : -case 167 : -case 199 : -case 231 : -{ - P0 = IC(3); - P1 = IC(3); - P2 = IC(3); - P3 = IC(3); -} break; -case 10 : -case 138 : -{ - P1 = IC(0); - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - } else { - P0 = I211(0, 1, 3); - } -} break; -case 11 : -case 27 : -case 75 : -case 139 : -case 155 : -case 203 : -{ - P1 = IC(2); - P2 = IC(2); - P3 = IC(2); - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } -} break; -case 14 : -case 142 : -{ - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - P1 = IC(0); - } else { - P0 = I332(1, 3, 0); - P1 = I31(0, 1); - } -} break; -case 15 : -case 143 : -case 207 : -{ - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - P1 = IC(4); - } else { - P0 = I332(1, 3, 4); - P1 = I31(4, 1); - } -} break; -case 18 : -case 22 : -case 30 : -case 50 : -case 54 : -case 62 : -case 86 : -case 118 : -{ - P0 = IC(0); - P2 = IC(0); - P3 = IC(0); - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 19 : -case 51 : -{ - P2 = IC(2); - P3 = IC(2); - if (MUR) { - P0 = IC(2); - P1 = IC(2); - } else { - P0 = I31(2, 1); - P1 = I332(1, 5, 2); - } -} break; -case 23 : -case 55 : -case 119 : -{ - P2 = IC(3); - P3 = IC(3); - if (MUR) { - P0 = IC(3); - P1 = IC(3); - } else { - P0 = I31(3, 1); - P1 = I332(1, 5, 3); - } -} break; -case 26 : -{ - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - } else { - P0 = I211(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 31 : -case 95 : -{ - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 42 : -case 170 : -{ - P1 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - P2 = IC(0); - } else { - P0 = I332(1, 3, 0); - P2 = I31(0, 3); - } -} break; -case 43 : -case 171 : -case 187 : -{ - P1 = IC(2); - P3 = IC(2); - if (MUL) { - P0 = IC(2); - P2 = IC(2); - } else { - P0 = I332(1, 3, 2); - P2 = I31(2, 3); - } -} break; -case 46 : -case 174 : -{ - P1 = IC(0); - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } -} break; -case 47 : -case 175 : -{ - P1 = IC(4); - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 58 : -case 154 : -case 186 : -{ - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 59 : -{ - P2 = IC(2); - P3 = IC(2); - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } - if (MUR) { - P1 = IC(2); - } else { - P1 = I611(2, 1, 5); - } -} break; -case 63 : -{ - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 72 : -case 76 : -case 104 : -case 106 : -case 108 : -case 110 : -case 120 : -case 124 : -{ - P0 = IC(0); - P1 = IC(0); - P3 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } -} break; -case 73 : -case 77 : -case 105 : -case 109 : -case 125 : -{ - P1 = IC(1); - P3 = IC(1); - if (MDL) { - P0 = IC(1); - P2 = IC(1); - } else { - P0 = I31(1, 3); - P2 = I332(3, 7, 1); - } -} break; -case 74 : -{ - P1 = IC(0); - P3 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I211(0, 1, 3); - } -} break; -case 78 : -case 202 : -case 206 : -{ - P1 = IC(0); - P3 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } -} break; -case 79 : -{ - P1 = IC(4); - P3 = IC(4); - if (MDL) { - P2 = IC(4); - } else { - P2 = I611(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } -} break; -case 80 : -case 208 : -case 210 : -case 216 : -{ - P0 = IC(0); - P1 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } -} break; -case 81 : -case 209 : -case 217 : -{ - P0 = IC(1); - P1 = IC(1); - P2 = IC(1); - if (MDR) { - P3 = IC(1); - } else { - P3 = I211(1, 5, 7); - } -} break; -case 82 : -case 214 : -case 222 : -{ - P0 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 83 : -case 115 : -{ - P0 = IC(2); - P2 = IC(2); - if (MDR) { - P3 = IC(2); - } else { - P3 = I611(2, 5, 7); - } - if (MUR) { - P1 = IC(2); - } else { - P1 = I611(2, 1, 5); - } -} break; -case 84 : -case 212 : -{ - P0 = IC(0); - P2 = IC(0); - if (MDR) { - P1 = IC(0); - P3 = IC(0); - } else { - P1 = I31(0, 5); - P3 = I332(5, 7, 0); - } -} break; -case 85 : -case 213 : -case 221 : -{ - P0 = IC(1); - P2 = IC(1); - if (MDR) { - P1 = IC(1); - P3 = IC(1); - } else { - P1 = I31(1, 5); - P3 = I332(5, 7, 1); - } -} break; -case 87 : -{ - P0 = IC(3); - P2 = IC(3); - if (MDR) { - P3 = IC(3); - } else { - P3 = I611(3, 5, 7); - } - if (MUR) { - P1 = IC(3); - } else { - P1 = I211(3, 1, 5); - } -} break; -case 88 : -case 248 : -case 250 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } -} break; -case 89 : -case 93 : -{ - P0 = IC(1); - P1 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I611(1, 3, 7); - } - if (MDR) { - P3 = IC(1); - } else { - P3 = I611(1, 5, 7); - } -} break; -case 90 : -{ - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 91 : -{ - if (MDL) { - P2 = IC(2); - } else { - P2 = I611(2, 3, 7); - } - if (MDR) { - P3 = IC(2); - } else { - P3 = I611(2, 5, 7); - } - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } - if (MUR) { - P1 = IC(2); - } else { - P1 = I611(2, 1, 5); - } -} break; -case 92 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } -} break; -case 94 : -{ - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 107 : -case 123 : -{ - P1 = IC(2); - P3 = IC(2); - if (MDL) { - P2 = IC(2); - } else { - P2 = I211(2, 3, 7); - } - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } -} break; -case 111 : -{ - P1 = IC(4); - P3 = IC(4); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 112 : -case 240 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDR) { - P2 = IC(0); - P3 = IC(0); - } else { - P2 = I31(0, 7); - P3 = I332(5, 7, 0); - } -} break; -case 113 : -case 241 : -{ - P0 = IC(1); - P1 = IC(1); - if (MDR) { - P2 = IC(1); - P3 = IC(1); - } else { - P2 = I31(1, 7); - P3 = I332(5, 7, 1); - } -} break; -case 114 : -{ - P0 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 116 : -{ - P0 = IC(0); - P1 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } -} break; -case 117 : -{ - P0 = IC(1); - P1 = IC(1); - P2 = IC(1); - if (MDR) { - P3 = IC(1); - } else { - P3 = I611(1, 5, 7); - } -} break; -case 121 : -{ - P0 = IC(1); - P1 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I211(1, 3, 7); - } - if (MDR) { - P3 = IC(1); - } else { - P3 = I611(1, 5, 7); - } -} break; -case 122 : -{ - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I611(0, 5, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 126 : -{ - P0 = IC(0); - P3 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 127 : -{ - P3 = IC(4); - if (MDL) { - P2 = IC(4); - } else { - P2 = I211(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I211(4, 1, 5); - } -} break; -case 146 : -case 150 : -case 178 : -case 182 : -case 190 : -{ - P0 = IC(0); - P2 = IC(0); - if (MUR) { - P1 = IC(0); - P3 = IC(0); - } else { - P1 = I332(1, 5, 0); - P3 = I31(0, 5); - } -} break; -case 147 : -case 179 : -{ - P0 = IC(2); - P2 = IC(2); - P3 = IC(2); - if (MUR) { - P1 = IC(2); - } else { - P1 = I611(2, 1, 5); - } -} break; -case 151 : -case 183 : -{ - P0 = IC(3); - P2 = IC(3); - P3 = IC(3); - if (MUR) { - P1 = IC(3); - } else { - P1 = I1411(3, 1, 5); - } -} break; -case 158 : -{ - P2 = IC(0); - P3 = IC(0); - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 159 : -{ - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 191 : -{ - P2 = IC(4); - P3 = IC(4); - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 200 : -case 204 : -case 232 : -case 236 : -case 238 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDL) { - P2 = IC(0); - P3 = IC(0); - } else { - P2 = I332(3, 7, 0); - P3 = I31(0, 7); - } -} break; -case 201 : -case 205 : -{ - P0 = IC(1); - P1 = IC(1); - P3 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I611(1, 3, 7); - } -} break; -case 211 : -{ - P0 = IC(2); - P1 = IC(2); - P2 = IC(2); - if (MDR) { - P3 = IC(2); - } else { - P3 = I211(2, 5, 7); - } -} break; -case 215 : -{ - P0 = IC(3); - P2 = IC(3); - if (MDR) { - P3 = IC(3); - } else { - P3 = I211(3, 5, 7); - } - if (MUR) { - P1 = IC(3); - } else { - P1 = I1411(3, 1, 5); - } -} break; -case 218 : -{ - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 219 : -{ - P1 = IC(2); - P2 = IC(2); - if (MDR) { - P3 = IC(2); - } else { - P3 = I211(2, 5, 7); - } - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } -} break; -case 220 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I611(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } -} break; -case 223 : -{ - P2 = IC(4); - if (MDR) { - P3 = IC(4); - } else { - P3 = I211(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I211(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; -case 233 : -case 237 : -{ - P0 = IC(1); - P1 = IC(1); - P3 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I1411(1, 3, 7); - } -} break; -case 234 : -{ - P1 = IC(0); - P3 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MUL) { - P0 = IC(0); - } else { - P0 = I611(0, 1, 3); - } -} break; -case 235 : -{ - P1 = IC(2); - P3 = IC(2); - if (MDL) { - P2 = IC(2); - } else { - P2 = I1411(2, 3, 7); - } - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } -} break; -case 239 : -{ - P1 = IC(4); - P3 = IC(4); - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } -} break; -case 242 : -{ - P0 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I211(0, 5, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I611(0, 1, 5); - } -} break; -case 243 : -{ - P0 = IC(2); - P1 = IC(2); - if (MDR) { - P2 = IC(2); - P3 = IC(2); - } else { - P2 = I31(2, 7); - P3 = I332(5, 7, 2); - } -} break; -case 244 : -{ - P0 = IC(0); - P1 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I1411(0, 5, 7); - } -} break; -case 245 : -{ - P0 = IC(1); - P1 = IC(1); - P2 = IC(1); - if (MDR) { - P3 = IC(1); - } else { - P3 = I1411(1, 5, 7); - } -} break; -case 246 : -{ - P0 = IC(0); - P2 = IC(0); - if (MDR) { - P3 = IC(0); - } else { - P3 = I1411(0, 5, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 247 : -{ - P0 = IC(3); - P2 = IC(3); - if (MDR) { - P3 = IC(3); - } else { - P3 = I1411(3, 5, 7); - } - if (MUR) { - P1 = IC(3); - } else { - P1 = I1411(3, 1, 5); - } -} break; -case 249 : -{ - P0 = IC(1); - P1 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I1411(1, 3, 7); - } - if (MDR) { - P3 = IC(1); - } else { - P3 = I211(1, 5, 7); - } -} break; -case 251 : -{ - P1 = IC(2); - if (MDL) { - P2 = IC(2); - } else { - P2 = I1411(2, 3, 7); - } - if (MDR) { - P3 = IC(2); - } else { - P3 = I211(2, 5, 7); - } - if (MUL) { - P0 = IC(2); - } else { - P0 = I211(2, 1, 3); - } -} break; -case 252 : -{ - P0 = IC(0); - P1 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I1411(0, 5, 7); - } -} break; -case 253 : -{ - P0 = IC(1); - P1 = IC(1); - if (MDL) { - P2 = IC(1); - } else { - P2 = I1411(1, 3, 7); - } - if (MDR) { - P3 = IC(1); - } else { - P3 = I1411(1, 5, 7); - } -} break; -case 254 : -{ - P0 = IC(0); - if (MDL) { - P2 = IC(0); - } else { - P2 = I211(0, 3, 7); - } - if (MDR) { - P3 = IC(0); - } else { - P3 = I1411(0, 5, 7); - } - if (MUR) { - P1 = IC(0); - } else { - P1 = I211(0, 1, 5); - } -} break; -case 255 : -{ - if (MDL) { - P2 = IC(4); - } else { - P2 = I1411(4, 3, 7); - } - if (MDR) { - P3 = IC(4); - } else { - P3 = I1411(4, 5, 7); - } - if (MUL) { - P0 = IC(4); - } else { - P0 = I1411(4, 1, 3); - } - if (MUR) { - P1 = IC(4); - } else { - P1 = I1411(4, 1, 5); - } -} break; diff --git a/src/sdl/filter/main.c b/src/sdl/filter/main.c deleted file mode 100644 index 98ab1541..00000000 --- a/src/sdl/filter/main.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "filters.h" - -int main(int argc, char *argv[]) -{ - SDL_Surface *src = NULL; - SDL_Surface *dst = NULL; - src = SDL_LoadBMP("src.bmp"); //load - if(!src) return -1; //check - dst = filter_2x(src, NULL, hq2x32); //prcoess - SDL_FreeSurface(src); //free - if(!dst) return 0; //error - SDL_SaveBMP(dst, "dst.bmp"); //save - SDL_FreeSurface(dst); //free - return 1; //good -} diff --git a/src/sdl/i_cdmus.c b/src/sdl/i_cdmus.c index 1eeac370..fc35eb9c 100644 --- a/src/sdl/i_cdmus.c +++ b/src/sdl/i_cdmus.c @@ -1,588 +1,38 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief cd music interface -/// - -#ifdef HAVE_SDL - -#if defined (DC) || defined (_WIN32_WCE) || defined(GP2X) || defined(_PS3) -#define NOSDLCD -#endif - -#include -#ifndef NOSDLCD - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#include "SDL.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#endif - -#include "../doomtype.h" -#include "../i_sound.h" #include "../command.h" -#include "../m_argv.h" #include "../s_sound.h" +#include "../i_sound.h" -#define MAX_CD_TRACKS 256 +// +// CD MUSIC I/O +// -#ifdef _XBOX -INT32 SDL_SYS_CDInit(void) -{ - return(0); -} - -void SDL_SYS_CDQuit(void) -{ - return; -} -#endif - -UINT8 cdaudio_started = 0; // for system startup/shutdown +UINT8 cdaudio_started = 0; consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifndef NOSDLCD -static SDL_bool cdValid = SDL_FALSE; -static SDL_bool cdPlaying = SDL_FALSE; -static SDL_bool wasPlaying = SDL_FALSE; -static SDL_bool cdEnabled = SDL_FALSE; -static SDL_bool playLooping = SDL_FALSE; -static Uint8 playTrack = 0; -static Uint8 maxTrack = MAX_CD_TRACKS-1; -static Uint8 cdRemap[MAX_CD_TRACKS]; -static INT32 cdvolume = -1; -static SDL_CD *cdrom = NULL; -static CDstatus cdStatus = CD_ERROR; -/************************************************************************** - * - * function: CDAudio_GetAudioDiskInfo - * - * description: - * set number of tracks if CD is available - * - **************************************************************************/ -static INT32 CDAudio_GetAudioDiskInfo(void) +void I_InitCD(void){} + +void I_StopCD(void){} + +void I_PauseCD(void){} + +void I_ResumeCD(void){} + +void I_ShutdownCD(void){} + +void I_UpdateCD(void){} + +void I_PlayCD(UINT8 track, UINT8 looping) { - cdValid = SDL_FALSE; - maxTrack = 0; - - if (!cdrom) - return 0;//Alam: Lies! - - cdStatus = SDL_CDStatus(cdrom); - - if (!CD_INDRIVE(cdStatus)) - { - CONS_Printf("%s", M_GetText("No CD in drive\n")); - return -1; - } - - if (cdStatus == CD_ERROR) - { - CONS_Printf(M_GetText("CD Error: %s\n"), SDL_GetError()); - return -1; - } - - cdValid = SDL_TRUE; - maxTrack = (Uint8)cdrom->numtracks; - - return 0; -} - - -/************************************************************************** - * - * function: I_EjectCD - * - * description: - * - * - **************************************************************************/ -static void I_EjectCD(void) -{ - if (!cdrom || !cdEnabled) - return; // no cd init'd - - I_StopCD(); - - if (SDL_CDEject(cdrom)) - CONS_Printf("%s", M_GetText("CD eject failed\n")); -} - -/************************************************************************** - * - * function: Command_Cd_f - * - * description: - * handles all CD commands from the console - * - **************************************************************************/ -static void Command_Cd_f (void) -{ - const char *command; - size_t ret, n; - - if (!cdaudio_started) - return; - - if (COM_Argc() < 2) - { - CONS_Printf ("%s", M_GetText("cd [on] [off] [remap] [reset] [select]\n" - " [open] [info] [play ] [resume]\n" - " [stop] [pause] [loop ]\n")); - return; - } - - command = COM_Argv (1); - - if (!strncmp(command, "on", 2)) - { - cdEnabled = SDL_TRUE; - return; - } - - if (!strncmp(command, "off", 3)) - { - I_StopCD(); - cdEnabled = SDL_FALSE; - return; - } - - if (!strncmp(command, "select", 6)) - { - INT32 newcddrive; - newcddrive = atoi(COM_Argv(2)); - command = SDL_CDName(newcddrive); - I_StopCD(); - cdEnabled = SDL_FALSE; - SDL_CDClose(cdrom); - cdrom = SDL_CDOpen(newcddrive); - if (cdrom) - { - cdEnabled = SDL_TRUE; - CONS_Printf(M_GetText("Opened CD-ROM drive %s\n"), command ? command : COM_Argv(2)); - } - else CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), command ? command : COM_Argv(2), SDL_GetError()); - return; - } - - if (!strncmp(command, "remap", 5)) - { - ret = COM_Argc() - 2; - if (ret <= 0) - { - for (n = 1; n < MAX_CD_TRACKS; n++) - { - if (cdRemap[n] != n) - CONS_Printf(" %s -> %u\n", sizeu1(n), cdRemap[n]); - } - return; - } - for (n = 1; n <= ret; n++) - cdRemap[n] = (Uint8)atoi(COM_Argv (n+1)); - return; - } - - if (!strncmp(command, "reset", 5)) - { - if (!cdrom) return; - cdEnabled = SDL_TRUE; - I_StopCD(); - for (n = 0; n < MAX_CD_TRACKS; n++) - cdRemap[n] = (Uint8)n; - CDAudio_GetAudioDiskInfo(); - return; - } - - if (!cdValid) - { - if (CDAudio_GetAudioDiskInfo()==-1 && !cdValid) - { - CONS_Printf("%s", M_GetText("No CD in drive\n")); - return; - } - } - - if (!strncmp(command, "open", 4)) - { - I_EjectCD(); - cdValid = SDL_FALSE; - return; - } - - if (!strncmp(command, "info", 4)) - { - CONS_Printf(M_GetText("%u tracks\n"), maxTrack); - if (cdPlaying) - CONS_Printf(M_GetText("Currently %s track %u\n"), playLooping ? M_GetText("looping") : M_GetText("playing"), playTrack); - else if (wasPlaying) - CONS_Printf(M_GetText("Paused %s track %u\n"), playLooping ? M_GetText("looping") : M_GetText("playing"), playTrack); - CONS_Printf(M_GetText("Volume is %d\n"), cdvolume); - return; - } - - if (!strncmp(command, "play", 4)) - { - I_PlayCD((UINT8)atoi(COM_Argv (2)), SDL_FALSE); - return; - } - - if (!strncmp(command, "loop", 4)) - { - I_PlayCD((UINT8)atoi(COM_Argv (2)), true); - return; - } - - if (!strncmp(command, "stop", 4)) - { - I_StopCD(); - return; - } - if (!strncmp(command, "pause", 5)) - { - I_PauseCD(); - return; - } - - if (!strncmp(command, "resume", 6)) - { - I_ResumeCD(); - return; - } - - CONS_Printf(M_GetText("Invalid CD command \"CD %s\"\n"), COM_Argv(1)); -} -#endif - -/************************************************************************** - * - * function: StopCD - * - * description: - * - * - **************************************************************************/ -void I_StopCD(void) -{ -#ifndef NOSDLCD - if (!cdrom || !cdEnabled) - return; - - if (!(cdPlaying || wasPlaying)) - return; - - if (SDL_CDStop(cdrom)) - I_OutputMsg("cdromstop failed\n"); - - wasPlaying = SDL_FALSE; - cdPlaying = SDL_FALSE; -#endif -} - -/************************************************************************** - * - * function: PauseCD - * - * description: - * - * - **************************************************************************/ -void I_PauseCD (void) -{ -#ifndef NOSDLCD - if (!cdrom || !cdEnabled) - return; - - if (!cdPlaying) - return; - - if (SDL_CDPause(cdrom)) - I_OutputMsg("cdrompause failed\n"); - - wasPlaying = cdPlaying; - cdPlaying = SDL_FALSE; -#endif -} - -/************************************************************************** - * - * function: ResumeCD - * - * description: - * - * - **************************************************************************/ -// continue after a pause -void I_ResumeCD (void) -{ -#ifndef NOSDLCD - if (!cdrom || !cdEnabled) - return; - - if (!cdValid) - return; - - if (!wasPlaying) - return; - - if (cd_volume.value == 0) - return; - - if (SDL_CDResume(cdrom)) - I_OutputMsg("cdromresume failed\n"); - - cdPlaying = SDL_TRUE; - wasPlaying = SDL_FALSE; -#endif -} - - -/************************************************************************** - * - * function: ShutdownCD - * - * description: - * - * - **************************************************************************/ -void I_ShutdownCD (void) -{ -#ifndef NOSDLCD - if (!cdaudio_started) - return; - - I_StopCD(); - - CONS_Printf("I_ShutdownCD: "); - SDL_CDClose(cdrom); - cdrom = NULL; - cdaudio_started = false; - CONS_Printf("%s", M_GetText("shut down\n")); - SDL_QuitSubSystem(SDL_INIT_CDROM); - cdEnabled = SDL_FALSE; -#endif -} - -/************************************************************************** - * - * function: InitCD - * - * description: - * Initialize the first CD drive SDL detects and add console command 'cd' - * - **************************************************************************/ -void I_InitCD (void) -{ -#ifndef NOSDLCD - INT32 i; - - // Has been checked in d_main.c, but doesn't hurt here - if (M_CheckParm ("-nocd")) - return; - - CONS_Printf("%s", M_GetText("I_InitCD: Init CD audio\n")); - - // Initialize SDL first - if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0) - { - CONS_Printf(M_GetText("Couldn't initialize SDL CDROM: %s\n"), SDL_GetError()); - return; - } - - // Open drive - cdrom = SDL_CDOpen(0); - - if (!cdrom) - { - const char *cdName = SDL_CDName(0); - if (!cdName) - CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), "\b", SDL_GetError()); - else - CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), cdName, SDL_GetError()); - //return; - } - - for (i = 0; i < MAX_CD_TRACKS; i++) - cdRemap[i] = (Uint8)i; - - cdaudio_started = true; - if (cdrom) cdEnabled = SDL_TRUE; - - if (CDAudio_GetAudioDiskInfo()==-1) - { - CONS_Printf("%s", M_GetText("No CD in drive\n")); - cdValid = SDL_FALSE; - } - - COM_AddCommand ("cd", Command_Cd_f); - - CONS_Printf("%s", M_GetText("CD audio Initialized\n")); -#endif -} - - - -// -/************************************************************************** - * - * function: UpdateCD - * - * description: - * sets CD volume (may have changed) and initiates play evey 2 seconds - * in case the song has elapsed - * - **************************************************************************/ -void I_UpdateCD (void) -{ -#ifndef NOSDLCD - static Uint32 lastchk = 0; - - if (!cdEnabled || !cdrom) - return; - - I_SetVolumeCD(cd_volume.value); - - if (cdPlaying && lastchk < SDL_GetTicks()) - { - lastchk = SDL_GetTicks() + 2000; //two seconds between chks - - if (CDAudio_GetAudioDiskInfo()==-1) - { - cdPlaying = SDL_FALSE; - return; - } - - if (cdStatus != CD_PLAYING && cdStatus != CD_PAUSED) - { - cdPlaying = SDL_FALSE; - if (playLooping) - I_PlayCD(playTrack, true); - } - } -#endif -} - - - -/************************************************************************** - * - * function: PlayCD - * - * description: - * play the requested track and set the looping flag - * pauses the CD if volume is 0 - * - **************************************************************************/ - -void I_PlayCD (UINT8 track, UINT8 looping) -{ -#ifdef NOSDLCD (void)track; (void)looping; -#else - if (!cdrom || !cdEnabled) - return; - - if (!cdValid) - { - CDAudio_GetAudioDiskInfo(); - if (!cdValid) - return; - } - - track = cdRemap[track]; - - if (track < 1 || track > maxTrack) - { - CONS_Printf(M_GetText("Bad track number %u.\n"), track); - return; - } - - // don't try to play a non-audio track - if (cdrom->track[track].type == SDL_DATA_TRACK) - { - CONS_Printf(M_GetText("Track %u is not audio\n"), track); - return; - } - - if (cdPlaying) - { - if (playTrack == track) - return; - I_StopCD(); - } - - if (SDL_CDPlayTracks(cdrom, track, 0, 1, 0)) - { - CONS_Printf(M_GetText("Error playing track %d: %s\n"), track, SDL_GetError()); - return; - } - - playLooping = looping; - playTrack = (Uint8)track; - cdPlaying = SDL_TRUE; - - if (cd_volume.value == 0) - I_PauseCD(); -#endif } - -/************************************************************************** - * - * function: SetVolumeCD - * - * description: - * SDL does not support setting the CD volume - * use pause instead and toggle between full and no music - * - **************************************************************************/ - -boolean I_SetVolumeCD (INT32 volume) +boolean I_SetVolumeCD(int volume) { -#ifdef NOSDLCD (void)volume; -#else - if (volume != cdvolume) - { - if (volume > 0 && volume < 16) - { - CV_SetValue(&cd_volume, 31); - cdvolume = 31; - I_ResumeCD(); - } - else if (volume > 15 && volume < 31) - { - CV_SetValue(&cd_volume, 0); - cdvolume = 0; - I_PauseCD(); - } - } -#endif return false; } -#endif diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 888a6a50..cfc2e210 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -996,8 +996,8 @@ void I_GetJoystickEvents(void) UINT64 joyhats = 0; #if 0 UINT64 joybuttons = 0; - Sint16 axisx, axisy; #endif + Sint16 axisx, axisy; if (!joystick_started) return; @@ -1070,7 +1070,6 @@ void I_GetJoystickEvents(void) } } -#if 0 // send joystick axis positions event.type = ev_joystick; @@ -1123,7 +1122,6 @@ void I_GetJoystickEvents(void) } D_PostEvent(&event); } -#endif } /** \brief Open joystick handle @@ -1156,7 +1154,7 @@ static int joy_open(const char *fname) { CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickName(i)); + CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); I_ShutdownJoystick(); return -1; } @@ -1177,7 +1175,7 @@ static int joy_open(const char *fname) { CONS_Printf(M_GetText("Found %d joysticks on this system\n"), num_joy); for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickName(i)); + CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); } else CONS_Printf("%s", M_GetText("Found no joysticks on this system\n")); @@ -1185,7 +1183,6 @@ static int joy_open(const char *fname) } JoyInfo.dev = SDL_JoystickOpen(joyindex-1); - CONS_Printf(M_GetText("Joystick: %s\n"), SDL_JoystickName(joyindex-1)); if (JoyInfo.dev == NULL) { @@ -1195,6 +1192,7 @@ static int joy_open(const char *fname) } else { + CONS_Printf(M_GetText("Joystick: %s\n"), SDL_JoystickName(JoyInfo.dev)); JoyInfo.axises = SDL_JoystickNumAxes(JoyInfo.dev); if (JoyInfo.axises > JOYAXISSET*2) JoyInfo.axises = JOYAXISSET*2; @@ -1219,7 +1217,7 @@ static int joy_open(const char *fname) JoyInfo.balls = SDL_JoystickNumBalls(JoyInfo.dev); #endif - //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(SDL_JoystickIndex(JoyInfo.dev)), "pad"); + //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(JoyInfo.dev), "pad"); return JoyInfo.axises; } @@ -1290,8 +1288,8 @@ void I_GetJoystick2Events(void) UINT64 joyhats = 0; #if 0 INT64 joybuttons = 0; - INT32 axisx, axisy; #endif + INT32 axisx, axisy; if (!joystick2_started) return; @@ -1361,7 +1359,6 @@ void I_GetJoystick2Events(void) } } -#if 0 // send joystick axis positions event.type = ev_joystick2; @@ -1416,7 +1413,6 @@ void I_GetJoystick2Events(void) } D_PostEvent(&event); } -#endif } @@ -1448,7 +1444,7 @@ static int joy_open2(const char *fname) { CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickName(i)); + CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); I_ShutdownJoystick2(); return -1; } @@ -1469,7 +1465,7 @@ static int joy_open2(const char *fname) { CONS_Printf(M_GetText("Found %d joysticks on this system\n"), num_joy); for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickName(i)); + CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); } else CONS_Printf("%s", M_GetText("Found no joysticks on this system\n")); @@ -1477,7 +1473,6 @@ static int joy_open2(const char *fname) } JoyInfo2.dev = SDL_JoystickOpen(joyindex-1); - CONS_Printf(M_GetText("Joystick2: %s\n"), SDL_JoystickName(joyindex-1)); if (!JoyInfo2.dev) { @@ -1487,6 +1482,7 @@ static int joy_open2(const char *fname) } else { + CONS_Printf(M_GetText("Joystick2: %s\n"), SDL_JoystickName(JoyInfo2.dev)); JoyInfo2.axises = SDL_JoystickNumAxes(JoyInfo2.dev); if (JoyInfo2.axises > JOYAXISSET*2) JoyInfo2.axises = JOYAXISSET*2; @@ -1511,7 +1507,7 @@ static int joy_open2(const char *fname) JoyInfo2.balls = SDL_JoystickNumBalls(JoyInfo2.dev); #endif - //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(SDL_JoystickIndex(JoyInfo2.dev)), "pad"); + //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(JoyInfo2.dev), "pad"); return JoyInfo2.axises; } @@ -1582,11 +1578,11 @@ const char *I_GetJoyName(INT32 joyindex) if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0) { if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != -1) - joyname = SDL_JoystickName(joyindex); + joyname = SDL_JoystickNameForIndex(joyindex); SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } else - joyname = SDL_JoystickName(joyindex); + joyname = SDL_JoystickNameForIndex(joyindex); return joyname; } @@ -2219,7 +2215,7 @@ void I_Sleep(void) INT32 I_StartupSystem(void) { SDL_version SDLcompiled; - const SDL_version *SDLlinked; + SDL_version SDLlinked; #ifdef _XBOX #ifdef __GNUC__ char DP[] =" Sonic Robo Blast 2!\n"; @@ -2240,12 +2236,12 @@ INT32 I_StartupSystem(void) #endif #endif SDL_VERSION(&SDLcompiled) - SDLlinked = SDL_Linked_Version(); + SDL_GetVersion(&SDLlinked); I_StartupConsole(); I_OutputMsg("Compiled for SDL version: %d.%d.%d\n", SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch); I_OutputMsg("Linked with SDL version: %d.%d.%d\n", - SDLlinked->major, SDLlinked->minor, SDLlinked->patch); + SDLlinked.major, SDLlinked.minor, SDLlinked.patch); #if 0 //#ifdef GP2X //start up everything if (SDL_Init(SDL_INIT_NOPARACHUTE|SDL_INIT_EVERYTHING) < 0) #else @@ -2875,7 +2871,7 @@ const char *I_LocateWad(void) return waddir; } -#ifdef LINUX +#if defined(LINUX) || defined(LINUX64) #define MEMINFO_FILE "/proc/meminfo" #define MEMTOTAL "MemTotal:" #define MEMFREE "MemFree:" @@ -2931,7 +2927,25 @@ UINT32 I_GetFreeMem(UINT32 *total) if (total) *total = 32 << 20; return 32 << 20; -#elif defined (LINUX) +#elif (defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX) + MEMORYSTATUS info; + + info.dwLength = sizeof (MEMORYSTATUS); + GlobalMemoryStatus( &info ); + if (total) + *total = (UINT32)info.dwTotalPhys; + return (UINT32)info.dwAvailPhys; +#elif defined (__OS2__) + UINT32 pr_arena; + + if (total) + DosQuerySysInfo( QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, + (PVOID) total, sizeof (UINT32)); + DosQuerySysInfo( QSV_MAXPRMEM, QSV_MAXPRMEM, + (PVOID) &pr_arena, sizeof (UINT32)); + + return pr_arena; +#elif defined (LINUX) || defined (LINUX64) /* Linux */ char buf[1024]; char *memTag; @@ -2975,24 +2989,6 @@ UINT32 I_GetFreeMem(UINT32 *total) if (total) *total = totalKBytes << 10; return freeKBytes << 10; -#elif (defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX) - MEMORYSTATUS info; - - info.dwLength = sizeof (MEMORYSTATUS); - GlobalMemoryStatus( &info ); - if (total) - *total = (UINT32)info.dwTotalPhys; - return (UINT32)info.dwAvailPhys; -#elif defined (__OS2__) - UINT32 pr_arena; - - if (total) - DosQuerySysInfo( QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, - (PVOID) total, sizeof (UINT32)); - DosQuerySysInfo( QSV_MAXPRMEM, QSV_MAXPRMEM, - (PVOID) &pr_arena, sizeof (UINT32)); - - return pr_arena; #else // Guess 48 MB. if (total) @@ -3039,8 +3035,8 @@ const CPUInfoFlags *I_CPUInfo(void) WIN_CPUInfo.SSE2 = SDL_HasSSE2(); WIN_CPUInfo.AltiVec = SDL_HasAltiVec(); } - WIN_CPUInfo.MMXExt = SDL_HasMMXExt(); - WIN_CPUInfo.AMD3DNowExt = SDL_Has3DNowExt(); + WIN_CPUInfo.MMXExt = SDL_FALSE; //SDL_HasMMXExt(); No longer in SDL2 + WIN_CPUInfo.AMD3DNowExt = SDL_FALSE; //SDL_Has3DNowExt(); No longer in SDL2 #endif GetSystemInfo(&SI); WIN_CPUInfo.CPUs = SI.dwNumberOfProcessors; @@ -3052,9 +3048,9 @@ const CPUInfoFlags *I_CPUInfo(void) memset(&SDL_CPUInfo,0,sizeof (CPUInfoFlags)); SDL_CPUInfo.RDTSC = SDL_HasRDTSC(); SDL_CPUInfo.MMX = SDL_HasMMX(); - SDL_CPUInfo.MMXExt = SDL_HasMMXExt(); + SDL_CPUInfo.MMXExt = SDL_FALSE; //SDL_HasMMXExt(); No longer in SDL2 SDL_CPUInfo.AMD3DNow = SDL_Has3DNow(); - SDL_CPUInfo.AMD3DNowExt = SDL_Has3DNowExt(); + SDL_CPUInfo.AMD3DNowExt = SDL_FALSE; //SDL_Has3DNowExt(); No longer in SDL2 SDL_CPUInfo.SSE = SDL_HasSSE(); SDL_CPUInfo.SSE2 = SDL_HasSSE2(); SDL_CPUInfo.AltiVec = SDL_HasAltiVec(); diff --git a/src/sdl/i_ttf.c b/src/sdl/i_ttf.c index 770a81d9..4a41f120 100644 --- a/src/sdl/i_ttf.c +++ b/src/sdl/i_ttf.c @@ -16,7 +16,7 @@ /// \file /// \brief SDL_ttf interface code. Necessary for platforms with no framebuffer console systems. -#if defined(SDL) && defined(HAVE_TTF) +#if defined(HAVE_SDL) && defined(HAVE_TTF) #include "SDL.h" #include "SDL_ttf.h" #include "../doomdef.h" diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 197924ed..fd029832 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -19,9 +19,7 @@ #include -#ifndef _WIN32_WCE #include -#endif #ifdef _MSC_VER #pragma warning(disable : 4214 4244) @@ -35,16 +33,6 @@ #pragma warning(default : 4214 4244) #endif -#if SDL_VERSION_ATLEAST(1,2,9) && defined (_arch_dreamcast) -#define HAVE_DCSDL -#include "SDL_dreamcast.h" -#endif - -#if SDL_VERSION_ATLEAST(1,2,9) && defined (GP2X) -#define HAVE_GP2XSDL -#include "SDL_gp2x.h" -#endif - #if SDL_VERSION_ATLEAST(1,3,0) #define SDLK_EQUALS SDLK_KP_EQUALSAS400 #define SDLK_LMETA SDLK_LGUI @@ -59,10 +47,6 @@ #ifdef HAVE_IMAGE #include "SDL_image.h" -#elseif !(defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)) -#define LOAD_XPM //I want XPM! -#include "IMG_xpm.c" //Alam: I don't want to add SDL_Image.dll/so -#define HAVE_IMAGE //I have SDL_Image, sortof #endif #ifdef HAVE_IMAGE @@ -71,24 +55,10 @@ #include "../doomdef.h" -#if defined (_WIN32) && !defined (_XBOX) +#if defined (_WIN32) #include "SDL_syswm.h" #endif -#ifdef _arch_dreamcast -#include -#include -#include -//#include "SRB2DC/VMU.xbm" -//#include -//#define malloc pvr_mem_malloc -//#define free pvr_mem_free -#endif - -#if defined (_XBOX) && defined (__GNUC__) -#include -#endif - #include "../doomstat.h" #include "../i_system.h" #include "../v_video.h" @@ -112,27 +82,8 @@ #include "ogl_sdl.h" #endif -#ifdef REMOTE_DEBUGGING -#ifdef _WII -#include -#endif -#endif - -#ifdef HAVE_FILTER -#define FILTERS -#include "filter/filters.h" -#endif - // maximum number of windowed modes (see windowedModes[][]) -#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) -#define MAXWINMODES (1) -#elif defined (WII) -#define MAXWINMODES (8) -#elif defined (_PS3) -#define MAXWINMODES (26) -#else -#define MAXWINMODES (27) -#endif +#define MAXWINMODES (17) /** \brief */ @@ -147,11 +98,7 @@ rendermode_t rendermode=render_soft; boolean highcolor = false; // synchronize page flipping with screen refresh -#if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL)) -consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c @@ -161,7 +108,7 @@ boolean allow_fullscreen = false; static SDL_bool disable_fullscreen = SDL_FALSE; #define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value static SDL_bool disable_mouse = SDL_FALSE; -#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && SDL_GetAppState() & SDL_APPACTIVE) +#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus) #define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN) #define MOUSEBUTTONS_MAX MOUSEBUTTONS @@ -169,155 +116,175 @@ static SDL_bool disable_mouse = SDL_FALSE; static INT32 firstEntry = 0; // SDL vars -#ifndef HWRENDER //[segabor] !!! I had problem compiling this source with gcc 3.3 static SDL_Surface *vidSurface = NULL; -#endif static SDL_Surface *bufSurface = NULL; static SDL_Surface *icoSurface = NULL; static SDL_Color localPalette[256]; +#if 0 static SDL_Rect **modeList = NULL; -#ifdef DC -static Uint8 BitsPerPixel = 15; -#else static Uint8 BitsPerPixel = 16; #endif static Uint16 realwidth = BASEVIDWIDTH; static Uint16 realheight = BASEVIDHEIGHT; -#ifdef _WIN32_WCE -static const Uint32 surfaceFlagsW = SDL_HWPALETTE; //Can't handle WinCE changing sides -#else -static const Uint32 surfaceFlagsW = SDL_HWPALETTE/*|SDL_RESIZABLE*/; -#endif -#ifdef _PSP -static const Uint32 surfaceFlagsF = SDL_HWSURFACE|SDL_FULLSCREEN; -#else -static const Uint32 surfaceFlagsF = SDL_HWPALETTE|SDL_FULLSCREEN; -#endif +static const Uint32 surfaceFlagsW = 0/*|SDL_RESIZABLE*/; +static const Uint32 surfaceFlagsF = 0; static SDL_bool mousegrabok = SDL_TRUE; -#define HalfWarpMouse(x,y) SDL_WarpMouse((Uint16)(x/2),(Uint16)(y/2)) -#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) -static SDL_bool videoblitok = SDL_TRUE; -#else +#define HalfWarpMouse(x,y) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2)) static SDL_bool videoblitok = SDL_FALSE; -#endif static SDL_bool exposevideo = SDL_FALSE; +static SDL_bool usesdl2soft = SDL_FALSE; +static SDL_bool borderlesswindow = SDL_FALSE; + +// SDL2 vars +SDL_Window *window; +SDL_Renderer *renderer; +static SDL_Texture *texture; +static SDL_bool havefocus = SDL_TRUE; +static const char *fallback_resolution_name = "Fallback"; // windowed video modes from which to choose from. static INT32 windowedModes[MAXWINMODES][2] = { -#if !(defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined (GP2X)) -#ifndef WII -#ifndef _PS3 {1920,1200}, // 1.60,6.00 -#endif + {1920,1080}, // 1.66 {1680,1050}, // 1.60,5.25 - {1600,1200}, // 1.33,5.00 - {1600,1000}, // 1.60,5.00 - {1536,1152}, // 1.33,4.80 - {1536, 960}, // 1.60,4.80 + {1600, 900}, // 1.66 + {1366, 768}, // 1.66 {1440, 900}, // 1.60,4.50 - {1400,1050}, // 1.33,4.375 - {1400, 875}, // 1.60,4.375 - {1360, 850}, // 1.60,4.25 + {1280,1024}, // 1.33? {1280, 960}, // 1.33,4.00 {1280, 800}, // 1.60,4.00 + {1280, 720}, // 1.66 {1152, 864}, // 1.33,3.60 - {1120, 700}, // 1.60,3.50 {1024, 768}, // 1.33,3.20 - { 960, 720}, // 1.33,3.00 - { 960, 600}, // 1.60,3.00 { 800, 600}, // 1.33,2.50 - { 800, 500}, // 1.60,2.50 -#endif { 640, 480}, // 1.33,2.00 { 640, 400}, // 1.60,2.00 - { 576, 432}, // 1.33,1.80 - { 512, 384}, // 1.33,1.60 - { 416, 312}, // 1.33,1.30 - { 400, 300}, // 1.33,1.25 { 320, 240}, // 1.33,1.00 -#endif { 320, 200}, // 1.60,1.00 }; -static void SDLSetMode(INT32 width, INT32 height, INT32 bpp, Uint32 flags) +static void Impl_VideoSetupSDLBuffer(void); +static void Impl_VideoSetupBuffer(void); +static SDL_bool Impl_CreateWindow(SDL_bool fullscreen); +static void Impl_SetWindowName(const char *title); +static void Impl_SetWindowIcon(void); + +static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) { - const char *SDLVD = I_GetEnv("SDL_VIDEODRIVER"); -#ifdef _WIN32_WCE - if (bpp < 16) - bpp = 16; // 256 mode poo -#endif -#ifdef _WII - bpp = 16; // 8-bit mode poo -#endif -#ifdef DC - if (bpp < 15) - bpp = 15; - height = 240; -#endif -#ifdef PSP - bpp = 16; -#endif -#ifdef GP2X - bpp = 16; -#ifdef HAVE_GP2XSDL - height = 240; -#endif -#endif -#ifdef FILTERS - bpp = Setupf2x(width, height, bpp); -#endif - if (SDLVD && strncasecmp(SDLVD,"glSDL",6) == 0) //for glSDL videodriver - vidSurface = SDL_SetVideoMode(width, height,0,SDL_DOUBLEBUF); -#ifdef _WII // don't want it to use HWSURFACE, so make it first here - else if (SDL_VideoModeOK(width, height, bpp, flags|SDL_SWSURFACE|SDL_DOUBLEBUF) >= bpp) // SDL Wii uses double buffering - vidSurface = SDL_SetVideoMode(width, height, bpp, flags|SDL_SWSURFACE|SDL_DOUBLEBUF); -#endif - else if (cv_vidwait.value && videoblitok && SDL_VideoModeOK(width, height, bpp, flags|SDL_HWSURFACE|SDL_DOUBLEBUF) >= bpp) - vidSurface = SDL_SetVideoMode(width, height, bpp, flags|SDL_HWSURFACE|SDL_DOUBLEBUF); - else if (videoblitok && SDL_VideoModeOK(width, height, bpp, flags|SDL_HWSURFACE) >= bpp) - vidSurface = SDL_SetVideoMode(width, height, bpp, flags|SDL_HWSURFACE); - else if (SDL_VideoModeOK(width, height, bpp, flags|SDL_SWSURFACE) >= bpp) - vidSurface = SDL_SetVideoMode(width, height, bpp, flags|SDL_SWSURFACE); - else return; - realwidth = (Uint16)width; - realheight = (Uint16)height; -#ifdef HAVE_DCSDL - //SDL_DC_SetWindow(320,200); - SDL_DC_EmulateMouse(SDL_FALSE); - SDL_DC_EmulateKeyboard(SDL_TRUE); -#endif -#ifdef HAVE_GP2XSDL - SDL_ShowCursor(SDL_DISABLE); //For GP2X Open2x -#endif -#ifdef FILTERS - if (vidSurface && preSurface && f2xSurface) + static SDL_bool wasfullscreen = SDL_FALSE; + static SDL_bool glfallbackresolution = SDL_FALSE; + Uint32 rmask; + Uint32 gmask; + Uint32 bmask; + Uint32 amask; + int bpp = 16; + int sw_texture_format = SDL_PIXELFORMAT_ABGR8888; + + realwidth = vid.width; + realheight = vid.height; + + if (window) { - vid.width = width/2; - vid.height = height/2; + if (fullscreen) + { + wasfullscreen = SDL_TRUE; + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + } + else if (!fullscreen && wasfullscreen) + { + wasfullscreen = SDL_FALSE; + glfallbackresolution = SDL_FALSE; + SDL_SetWindowFullscreen(window, 0); + SDL_SetWindowSize(window, width, height); + SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + } + else if (!wasfullscreen) + { + // Reposition window only in windowed mode + SDL_SetWindowSize(window, width, height); + SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + } + } + else + { + Impl_CreateWindow(fullscreen); + Impl_SetWindowIcon(); + wasfullscreen = fullscreen; + SDL_SetWindowSize(window, width, height); + if (fullscreen) + { + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + } + } + + if (rendermode == render_opengl) + { + int sdlw, sdlh; + SDL_GetWindowSize(window, &sdlw, &sdlh); + // Logical fullscreen is not implemented yet for OpenGL, so... + // Special case handling + if (glfallbackresolution == SDL_FALSE && fullscreen && width != sdlw && height != sdlh) + { + if (VID_GetModeForSize(sdlw, sdlh) != -1) + { + wasfullscreen = SDL_TRUE; + VID_SetMode(VID_GetModeForSize(sdlw, sdlh)); + return; + } + else + { + wasfullscreen = SDL_TRUE; + glfallbackresolution = SDL_TRUE; + VID_SetMode(-1); + return; + } + } + OglSdlSurface(vid.width, vid.height); + } + + if (rendermode == render_soft) + { + SDL_RenderClear(renderer); + SDL_RenderSetLogicalSize(renderer, width, height); + // Set up Texture + realwidth = width; + realheight = height; + if (texture != NULL) + { + SDL_DestroyTexture(texture); + } + + if (!usesdl2soft) + { + sw_texture_format = SDL_PIXELFORMAT_RGB565; + } + else + { + bpp = 32; + sw_texture_format = SDL_PIXELFORMAT_RGBA8888; + } + + texture = SDL_CreateTexture(renderer, sw_texture_format, SDL_TEXTUREACCESS_STREAMING, width, height); + + // Set up SW surface + if (vidSurface != NULL) + { + SDL_FreeSurface(vidSurface); + } + SDL_PixelFormatEnumToMasks(sw_texture_format, &bpp, &rmask, &gmask, &bmask, &amask); + vidSurface = SDL_CreateRGBSurface(0, width, height, bpp, rmask, gmask, bmask, amask); } -#endif } // // Translates the SDL key into SRB2 key // -static INT32 SDLatekey(SDLKey sym) +static INT32 SDLatekey(SDL_Keycode sym) { INT32 rc = sym + 0x80; -#ifdef _WIN32_WCE - if (sym == SDLK_KP8) - sym = SDLK_UP; - else if (sym == SDLK_KP4) - sym = SDLK_LEFT; - else if (sym == SDLK_KP6) - sym = SDLK_RIGHT; - else if (sym == SDLK_KP2) - sym = SDLK_DOWN; -#endif - switch (sym) { case SDLK_LEFT: @@ -430,10 +397,10 @@ static INT32 SDLatekey(SDLKey sym) rc = KEY_RALT; break; - case SDLK_NUMLOCK: + case SDLK_NUMLOCKCLEAR: rc = KEY_NUMLOCK; break; - case SDLK_SCROLLOCK: + case SDLK_SCROLLLOCK: rc = KEY_SCROLLLOCK; break; @@ -453,34 +420,34 @@ static INT32 SDLatekey(SDLKey sym) rc = KEY_INS; break; - case SDLK_KP0: + case SDLK_KP_0: rc = KEY_KEYPAD0; break; - case SDLK_KP1: + case SDLK_KP_1: rc = KEY_KEYPAD1; break; - case SDLK_KP2: + case SDLK_KP_2: rc = KEY_KEYPAD2; break; - case SDLK_KP3: + case SDLK_KP_3: rc = KEY_KEYPAD3; break; - case SDLK_KP4: + case SDLK_KP_4: rc = KEY_KEYPAD4; break; - case SDLK_KP5: + case SDLK_KP_5: rc = KEY_KEYPAD5; break; - case SDLK_KP6: + case SDLK_KP_6: rc = KEY_KEYPAD6; break; - case SDLK_KP7: + case SDLK_KP_7: rc = KEY_KEYPAD7; break; - case SDLK_KP8: + case SDLK_KP_8: rc = KEY_KEYPAD8; break; - case SDLK_KP9: + case SDLK_KP_9: rc = KEY_KEYPAD9; break; @@ -500,24 +467,16 @@ static INT32 SDLatekey(SDLKey sym) rc = KEY_PLUSPAD; break; -#ifndef _arch_dreamcast - case SDLK_LSUPER: -#ifdef HAVE_SDLMETAKEYS case SDLK_LMETA: -#endif rc = KEY_LEFTWIN; break; - case SDLK_RSUPER: -#ifdef HAVE_SDLMETAKEYS case SDLK_RMETA: -#endif rc = KEY_RIGHTWIN; break; case SDLK_MENU: rc = KEY_MENU; break; -#endif default: if (sym >= SDLK_SPACE && sym <= SDLK_DELETE) @@ -537,16 +496,15 @@ static INT32 SDLatekey(SDLKey sym) static void SDLdoUngrabMouse(void) { - if (SDL_GRAB_ON == SDL_WM_GrabInput(SDL_GRAB_QUERY)) - { - SDL_WM_GrabInput(SDL_GRAB_OFF); - } + SDL_SetWindowGrab(window, SDL_FALSE); } void SDLforceUngrabMouse(void) { - if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO) - SDL_WM_GrabInput(SDL_GRAB_OFF); + if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL) + { + SDL_SetWindowGrab(window, SDL_FALSE); + } } static void VID_Command_NumModes_f (void) @@ -556,6 +514,11 @@ static void VID_Command_NumModes_f (void) static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText) { +#if 1 + (void)infoSurface; + (void)SurfaceText; + SDL2STUB(); +#else INT32 vfBPP; const SDL_Surface *VidSur = SDL_GetVideoSurface(); @@ -612,11 +575,15 @@ static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText) CONS_Printf("%s", M_GetText(" Colorkey RLE acceleration blit\n")); if (infoSurface->flags&SDL_SRCALPHA) CONS_Printf("%s", M_GetText(" Use alpha blending acceleration blit\n")); - +#endif } static void VID_Command_Info_f (void) { +#if 0 + SDL2STUB(); +#else +#if 0 const SDL_VideoInfo *videoInfo; videoInfo = SDL_GetVideoInfo(); //Alam: Double-Check if (videoInfo) @@ -652,16 +619,18 @@ static void VID_Command_Info_f (void) CONS_Printf("%s", M_GetText(" There no video memory for SDL\n")); //*vfmt } - SurfaceInfo(bufSurface, M_GetText("Current Engine Mode")); -#ifdef FILTERS - SurfaceInfo(preSurface, M_GetText("Prebuffer Mode")); - SurfaceInfo(f2xSurface, M_GetText("Postbuffer Mode")); +#else + if (!M_CheckParm("-noblit")) videoblitok = SDL_TRUE; #endif + SurfaceInfo(bufSurface, M_GetText("Current Engine Mode")); SurfaceInfo(vidSurface, M_GetText("Current Video Mode")); +#endif } static void VID_Command_ModeList_f(void) { + SDL2STUB(); +#if 0 #if !defined (DC) && !defined (_WIN32_WCE) && !defined (_PSP) && !defined(GP2X) INT32 i; #ifdef HWRENDER @@ -697,10 +666,13 @@ static void VID_Command_ModeList_f(void) } CONS_Printf("%s", M_GetText("None\n")); #endif +#endif } static void VID_Command_Mode_f (void) { + SDL2STUB(); +#if 0 INT32 modenum; if (COM_Argc()!= 2) @@ -715,9 +687,11 @@ static void VID_Command_Mode_f (void) CONS_Printf(M_GetText("Video mode not present\n")); else setmodeneeded = modenum+1; // request vid mode change +#endif } -#if defined(RPC_NO_WINDOWS_H) && !defined(_WIN32_WCE) +#if 0 +#if defined(RPC_NO_WINDOWS_H) static VOID MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(hWnd); @@ -731,237 +705,17 @@ static VOID MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } } #endif - -#if 0 //#ifdef _WIN32 - // Disable Composition in Vista DWM (Desktop Window Manager) ---------------- -static HMODULE DMdll = NULL; -typedef HRESULT (CALLBACK *P_DwmIsCompositionEnabled) (BOOL *pfEnabled); -static P_DwmIsCompositionEnabled pfnDwmIsCompositionEnabled = NULL; -typedef HRESULT (CALLBACK *P_DwmEnableComposition) (BOOL fEnable); -static P_DwmEnableComposition pfnDwmEnableComposition = NULL; -static BOOL AeroWasEnabled = FALSE; - -static inline VOID UnloadDM(VOID) -{ - pfnDwmEnableComposition = NULL; - pfnDwmIsCompositionEnabled = NULL; - if (DMdll) FreeLibrary(DMdll); - DMdll = NULL; -} - -static inline BOOL LoadDM(VOID) -{ - if (DMdll) - return TRUE; - - DMdll = LoadLibraryA("dwmapi.dll"); - if (DMdll) - I_OutputMsg("dmwapi.dll loaded, Vista's Desktop Window Manager API\n"); - else - return FALSE; - - pfnDwmIsCompositionEnabled = (P_DwmIsCompositionEnabled)GetProcAddress(DMdll, "DwmIsCompositionEnabled"); - if (pfnDwmIsCompositionEnabled) - I_OutputMsg("Composition Aero API found, DwmIsCompositionEnabled\n"); - - pfnDwmEnableComposition = (P_DwmEnableComposition)GetProcAddress(DMdll, "DwmEnableComposition"); - if (pfnDwmEnableComposition) - I_OutputMsg("Composition Aero API found, DwmEnableComposition\n"); - - return TRUE; -} - -static inline VOID DisableAero(VOID) -{ - BOOL pfnDwmEnableCompositiond = FALSE; - AeroWasEnabled = FALSE; - - if (!LoadDM()) - return; - - if (pfnDwmIsCompositionEnabled && SUCCEEDED(pfnDwmIsCompositionEnabled(&pfnDwmEnableCompositiond))) - I_OutputMsg("Got the result of DwmIsCompositionEnabled, %i\n", pfnDwmEnableCompositiond); - else - return; - - if ((AeroWasEnabled = pfnDwmEnableCompositiond)) - I_OutputMsg("Disable the Aero rendering\n"); - else - return; - - if (pfnDwmEnableComposition && SUCCEEDED(pfnDwmEnableComposition(FALSE))) - I_OutputMsg("Aero rendering disabled\n"); - else - I_OutputMsg("We failed to disable the Aero rendering\n"); -} - -static inline VOID ResetAero(VOID) -{ - if (pfnDwmEnableComposition && AeroWasEnabled) - { - if (SUCCEEDED(pfnDwmEnableComposition(AeroWasEnabled))) - I_OutputMsg("Aero rendering setting restored\n"); - else - I_OutputMsg("We failed to restore Aero rendering\n"); - } - UnloadDM(); -} #endif static inline void SDLJoyRemap(event_t *event) { -#if defined(GP2X) -#define GP2X_BUTTON_UP (0) -#define GP2X_BUTTON_DOWN (4) -#define GP2X_BUTTON_LEFT (2) -#define GP2X_BUTTON_RIGHT (6) -#define GP2X_BUTTON_UPLEFT (1) -#define GP2X_BUTTON_UPRIGHT (7) -#define GP2X_BUTTON_DOWNLEFT (3) -#define GP2X_BUTTON_DOWNRIGHT (5) -#define GP2X_BUTTON_CLICK (18) -#define GP2X_BUTTON_A (12) -#define GP2X_BUTTON_B (13) -#define GP2X_BUTTON_X (14) -#define GP2X_BUTTON_Y (15) -#define GP2X_BUTTON_L (10) -#define GP2X_BUTTON_R (11) -#define GP2X_BUTTON_START (8) -#define GP2X_BUTTON_SELECT (9) -#define GP2X_BUTTON_VOLUP (16) -#define GP2X_BUTTON_VOLDOWN (17) - if ((event->type == ev_keydown || event->type == ev_keyup) && (KEY_JOY1 <= event->data1 && event->data1 <= KEY_JOY1+JOYBUTTONS)) - { - INT32 button = event->data1-KEY_JOY1; - if (button <= 7) - { - static UINT8 DPAD = 0; - if (event->type == ev_keyup) - { - event->type = ev_console; - DPAD &= ~(1<type = ev_joystick; - DPAD |= 1<data2 = event->data3 = INT32_MAX; - if ((DPAD & (1<type = ev_joystick; - event->data2 = event->data3 = 0; - } - else switch (button) - { - case GP2X_BUTTON_UP: - event->data3 = -1; - break; - case GP2X_BUTTON_DOWN: - event->data3 = 1; - break; - case GP2X_BUTTON_LEFT: - event->data2 = -1; - break; - case GP2X_BUTTON_RIGHT: - event->data2 = 1; - break; - case GP2X_BUTTON_UPLEFT: - event->data2 = -1; - event->data3 = -1; - break; - case GP2X_BUTTON_UPRIGHT: - event->data2 = 1; - event->data3 = -1; - break; - case GP2X_BUTTON_DOWNLEFT: - event->data2 = -1; - event->data3 = 1; - break; - case GP2X_BUTTON_DOWNRIGHT: - event->data2 = 1; - event->data3 = 1; - default: - break; - } - event->data1 = 0; - return; - } - else switch (button) - { - case GP2X_BUTTON_CLICK: - event->data1 = KEY_ENTER; - break; - case GP2X_BUTTON_A: - event->data1 = KEY_JOY1+0; - break; - case GP2X_BUTTON_B: - event->data1 = KEY_JOY1+2; - break; - case GP2X_BUTTON_X: - event->data1 = KEY_JOY1+3; - break; - case GP2X_BUTTON_Y: - event->data1 = KEY_JOY1+1; - break; - case GP2X_BUTTON_L: - event->data1 = KEY_JOY1+4; - break; - case GP2X_BUTTON_R: - event->data1 = KEY_JOY1+5; - break; - case GP2X_BUTTON_START: - event->data1 = KEY_ESCAPE; - break; - case GP2X_BUTTON_SELECT: - event->data1 = KEY_JOY1+8; - break; - case GP2X_BUTTON_VOLUP: - event->data1 = KEY_JOY1+6; - break; - case GP2X_BUTTON_VOLDOWN: - event->data1 = KEY_JOY1+7; - break; - default: - break; - } - //I_OutputMsg("Button %i: event key %i and type: %i\n", button, event->data1, event->type); - } -#elif defined(_PSP) - if (event->data1 > KEY_JOY1 + 9 + 2) // All button after D-Pad and Select/Start - event->data1 -= 4; // remap D-pad to Hats, offset of -4 - else if (event->data1 == KEY_JOY1 + 6) // Down - event->data1 = KEY_HAT1+1; - else if (event->data1 == KEY_JOY1 + 7) // Left - event->data1 = KEY_HAT1+2; - else if (event->data1 == KEY_JOY1 + 8) // Up - event->data1 = KEY_HAT1+0; - else if (event->data1 == KEY_JOY1 + 9) // Right - event->data1 = KEY_HAT1+3; - else if (event->data1 == KEY_JOY1 + 10) // Select - event->data1 = KEY_TAB; - else if (event->data1 == KEY_JOY1 + 11) // Start - event->data1 = KEY_ESCAPE; -#else (void)event; -#endif } static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which) { -#ifdef _arch_dreamcast // -128 to 127 SDL for DC have give us a smaller range - INT32 raxis = axis*8; -#else // -32768 to 32767 + // -32768 to 32767 INT32 raxis = axis/32; -#endif if (which == ev_joystick) { if (Joystick.bGamepadStyle) @@ -1008,8 +762,304 @@ static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which) return raxis; } +static void Impl_HandleWindowEvent(SDL_WindowEvent evt) +{ + static SDL_bool firsttimeonmouse = SDL_TRUE; + static SDL_bool mousefocus = SDL_TRUE; + static SDL_bool kbfocus = SDL_TRUE; + + switch (evt.event) + { + case SDL_WINDOWEVENT_ENTER: + mousefocus = SDL_TRUE; + break; + case SDL_WINDOWEVENT_LEAVE: + mousefocus = SDL_FALSE; + break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + kbfocus = SDL_TRUE; + mousefocus = SDL_TRUE; + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + kbfocus = SDL_FALSE; + mousefocus = SDL_FALSE; + break; + case SDL_WINDOWEVENT_MAXIMIZED: + break; + } + + if (mousefocus && kbfocus) + { + if (!firsttimeonmouse) + { + if (cv_usemouse.value) I_StartupMouse(); + } + //else firsttimeonmouse = SDL_FALSE; + if (gamestate == GS_LEVEL) + { + if (!paused) I_ResumeSong(0); //resume it + } + } + else if (!mousefocus && !kbfocus) + { + if (!disable_mouse) + { + SDLforceUngrabMouse(); + } + if (!netgame && gamestate == GS_LEVEL && !demoplayback && !demorecording && !modeattacking) + { + paused = true; + } + memset(gamekeydown, 0, NUMKEYS); // TODO this is a scary memset + if (gamestate == GS_LEVEL) + { + I_PauseSong(0); + } + + if (MOUSE_MENU) + { + SDLdoUngrabMouse(); + } + } + +} + +static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type) +{ + event_t event; + if (type == SDL_KEYUP) + { + event.type = ev_keyup; + } + else if (type == SDL_KEYDOWN) + { + event.type = ev_keydown; + } + else + { + return; + } + event.data1 = SDLatekey(evt.keysym.sym); + if (event.data1) D_PostEvent(&event); +} + +static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) +{ + event_t event; + int wwidth, wheight; + + SDL_GetWindowSize(window, &wwidth, &wheight); + + if ((SDL_GetMouseFocus() != window && SDL_GetKeyboardFocus() != window)) + { + SDLdoUngrabMouse(); + return; + } + + if ((evt.x == realwidth/2) && (evt.y == realheight/2)) + { + return; + } + else + { + event.data2 = (evt.xrel) * (wwidth / realwidth); + event.data3 = -evt.yrel * (wheight / realheight); + } + + event.type = ev_mouse; + + if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window) + { + D_PostEvent(&event); + HalfWarpMouse(wwidth, wheight); + } +} + +static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type) +{ + event_t event; + + SDL_memset(&event, 0, sizeof(event_t)); + + /// \todo inputEvent.button.which + if (USE_MOUSEINPUT) + { + if (type == SDL_MOUSEBUTTONUP) + { + event.type = ev_keyup; + } + else if (type == SDL_MOUSEBUTTONDOWN) + { + event.type = ev_keydown; + } + else return; + if (evt.button == SDL_BUTTON_MIDDLE) + event.data1 = KEY_MOUSE1+2; + else if (evt.button == SDL_BUTTON_RIGHT) + event.data1 = KEY_MOUSE1+1; + else if (evt.button == SDL_BUTTON_LEFT) + event.data1= KEY_MOUSE1; + else if (evt.button <= MOUSEBUTTONS) + event.data1 = KEY_MOUSE1 + evt.which - SDL_BUTTON_LEFT; + if (event.type == ev_keyup || event.type == ev_keydown) + { + D_PostEvent(&event); + } + } +} + +static void Impl_HandleMouseWheelEvent(SDL_MouseWheelEvent evt) +{ + event_t event; + + SDL_memset(&event, 0, sizeof(event_t)); + + if (evt.y > 0) + { + event.data1 = KEY_MOUSEWHEELUP; + event.type = ev_keydown; + } + if (evt.y < 0) + { + event.data1 = KEY_MOUSEWHEELDOWN; + event.type = ev_keydown; + } + if (evt.y == 0) + { + event.data1 = 0; + event.type = ev_keyup; + } + if (event.type == ev_keyup || event.type == ev_keydown) + { + D_PostEvent(&event); + } +} + +static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt) +{ + event_t event; + SDL_JoystickID joyid[2]; + + // Determine the Joystick IDs for each current open joystick + joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev); + joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev); + + evt.axis++; + event.data1 = event.data2 = event.data3 = INT32_MAX; + + if (evt.which == joyid[0]) + { + event.type = ev_joystick; + } + else if (evt.which == joyid[1]) + { + event.type = ev_joystick2; + } + else return; + //axis + if (evt.axis > JOYAXISSET*2) + return; + //vaule + if (evt.axis%2) + { + event.data1 = evt.axis / 2; + event.data2 = SDLJoyAxis(evt.value, event.type); + } + else + { + evt.axis--; + event.data1 = evt.axis / 2; + event.data3 = SDLJoyAxis(evt.value, event.type); + } + D_PostEvent(&event); +} + +static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type) +{ + event_t event; + SDL_JoystickID joyid[2]; + + // Determine the Joystick IDs for each current open joystick + joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev); + joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev); + + if (evt.which == joyid[0]) + { + event.data1 = KEY_JOY1; + } + else if (evt.which == joyid[1]) + { + event.data1 = KEY_2JOY1; + } + else return; + if (type == SDL_JOYBUTTONUP) + { + event.type = ev_keyup; + } + else if (type == SDL_JOYBUTTONDOWN) + { + event.type = ev_keydown; + } + else return; + if (evt.button < JOYBUTTONS) + { + event.data1 += evt.button; + } + else return; + + SDLJoyRemap(&event); + if (event.type != ev_console) D_PostEvent(&event); +} + void I_GetEvent(void) { + SDL_Event evt; + + if (!graphics_started) + { + return; + } + + while (SDL_PollEvent(&evt)) + { + switch (evt.type) + { + case SDL_WINDOWEVENT: + Impl_HandleWindowEvent(evt.window); + break; + case SDL_KEYUP: + case SDL_KEYDOWN: + Impl_HandleKeyboardEvent(evt.key, evt.type); + break; + case SDL_MOUSEMOTION: + Impl_HandleMouseMotionEvent(evt.motion); + break; + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + Impl_HandleMouseButtonEvent(evt.button, evt.type); + break; + case SDL_MOUSEWHEEL: + Impl_HandleMouseWheelEvent(evt.wheel); + break; + case SDL_JOYAXISMOTION: + Impl_HandleJoystickAxisEvent(evt.jaxis); + break; + case SDL_JOYBUTTONUP: + case SDL_JOYBUTTONDOWN: + Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type); + break; + case SDL_QUIT: + I_Quit(); + M_QuitResponse('y'); + break; + } + } + + // In order to make wheels act like buttons, we have to set their state to Up. + // This is because wheel messages don't have an up/down state. + gamekeydown[KEY_MOUSEWHEELDOWN] = gamekeydown[KEY_MOUSEWHEELUP] = 0; + +#if 0 SDL_Event inputEvent; static SDL_bool sdlquit = SDL_FALSE; //Alam: once, just once event_t event; @@ -1076,7 +1126,7 @@ void I_GetEvent(void) SDLdoUngrabMouse(); break; } - if (USE_MOUSEINPUT) + //if (USE_MOUSEINPUT) TODO SDL2 stub { // If the event is from warping the pointer back to middle // of the screen then ignore it. @@ -1183,7 +1233,6 @@ void I_GetEvent(void) SDLJoyRemap(&event); if (event.type != ev_console) D_PostEvent(&event); break; -#ifndef _WIN32_WCE case SDL_QUIT: if (!sdlquit) { @@ -1191,8 +1240,7 @@ void I_GetEvent(void) M_QuitResponse('y'); } break; -#endif -#if defined(RPC_NO_WINDOWS_H) && !defined(_WIN32_WCE) +#if defined(RPC_NO_WINDOWS_H) case SDL_SYSWMEVENT: MainWndproc(inputEvent.syswm.msg->hwnd, inputEvent.syswm.msg->msg, @@ -1205,15 +1253,8 @@ void I_GetEvent(void) setmodeneeded = VID_GetModeForSize(inputEvent.resize.w,inputEvent.resize.h)+1; if (render_soft == rendermode) { -#ifdef FILTERS - INT32 filtervalue = cv_filter.value; - if (blitfilter) CV_SetValue(&cv_filter,1); -#endif SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW); if (vidSurface) SDL_SetColors(vidSurface, localPalette, 0, 256); -#ifdef FILTERS - CV_SetValue(&cv_filter,filtervalue); -#endif } else SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW); @@ -1228,7 +1269,7 @@ void I_GetEvent(void) } } //reset wheel like in win32, I don't understand it but works - gamekeydown[KEY_MOUSEWHEELDOWN] = gamekeydown[KEY_MOUSEWHEELUP] = 0; +#endif } void I_StartupMouse(void) @@ -1261,9 +1302,6 @@ void I_OsPolling(void) I_GetJoystickEvents(); I_GetJoystick2Events(); } -#ifdef _arch_dreamcast - //vmu_set_icon(VMU_bits); -#endif I_GetMouseEvents(); @@ -1275,17 +1313,23 @@ void I_OsPolling(void) // void I_UpdateNoBlit(void) { - if (!vidSurface) + if (rendermode == render_none) return; + if (exposevideo) + { #ifdef HWRENDER - if (rendermode != render_soft) - OglSdlFinishUpdate(cv_vidwait.value); - else + if (rendermode == render_opengl) + { + OglSdlFinishUpdate(cv_vidwait.value); + } + else #endif - if (vidSurface->flags&SDL_DOUBLEBUF) - SDL_Flip(vidSurface); - else if (exposevideo) - SDL_UpdateRect(vidSurface, 0, 0, 0, 0); + if (rendermode == render_soft) + { + SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderPresent(renderer); + } + } exposevideo = SDL_FALSE; } @@ -1302,10 +1346,6 @@ static inline boolean I_SkipFrame(void) skip = !skip; -#if 0 //(defined (GP2X) || defined (PSP) || defined (_arch_dreamcast)) - return skip; -#endif - switch (gamestate) { case GS_LEVEL: @@ -1335,7 +1375,7 @@ static inline SDL_bool SDLmatchVideoformat(void) // void I_FinishUpdate(void) { - if (!vidSurface) + if (rendermode == render_none) return; //Alam: No software or OpenGl surface if (I_SkipFrame()) @@ -1346,152 +1386,30 @@ void I_FinishUpdate(void) if (render_soft == rendermode && screens[0]) { - SDL_Rect *dstrect = NULL; - SDL_Rect rect = {0, 0, 0, 0}; - SDL_PixelFormat *vidformat = vidSurface->format; - int lockedsf = 0, blited = 0; + SDL_Rect rect; - rect.w = (Sint16)vid.width; - rect.h = (Sint16)vid.height; + rect.x = 0; + rect.y = 0; + rect.w = vid.width; + rect.h = vid.height; - if (vidSurface->h > vid.height) - rect.y = (Sint16)((vidSurface->h-vid.height)/2); - - dstrect = ▭ - - - if (!bufSurface && !vid.direct) //Double-Check + if (!bufSurface) //Double-Check { - if (vid.bpp == 1) bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,8, - (int)vid.rowbytes,0x00000000,0x00000000,0x00000000,0x00000000); // 256 mode - else if (vid.bpp == 2) bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,15, - (int)vid.rowbytes,0x00007C00,0x000003E0,0x0000001F,0x00000000); // 555 mode - if (bufSurface) SDL_SetColors(bufSurface, localPalette, 0, 256); - else I_OutputMsg("No system memory for SDL buffer surface\n"); + Impl_VideoSetupSDLBuffer(); } - -#ifdef FILTERS - FilterBlit(bufSurface); - if (f2xSurface) //Alam: filter! + if (bufSurface) { - //I_OutputMsg("2x Filter Code\n"); - blited = SDL_BlitSurface(f2xSurface,NULL,vidSurface,NULL); + SDL_BlitSurface(bufSurface, NULL, vidSurface, &rect); + // Fury -- there's no way around UpdateTexture, the GL backend uses it anyway + SDL_LockSurface(vidSurface); + SDL_UpdateTexture(texture, &rect, vidSurface->pixels, vidSurface->pitch); + SDL_UnlockSurface(vidSurface); } - else -#endif -#if 0 - if (SDLmatchVideoformat() && !vid.direct)//Alam: DOS Way - { - if (SDL_MUSTLOCK(vidSurface)) lockedsf = SDL_LockSurface(vidSurface); - if (lockedsf == 0) - { - if (vidSurface->pixels > vid.height) - { - UINT8 *ptr = vidSurface->pixels; - size_t half_excess = vidSurface->pitch*(vidSurface->height-vid.height)/2; - memset(ptr, 0x1F, half_excess); - ptr += half_excess; - VID_BlitLinearScreen(screens[0], ptr, vid.width*vid.bpp, vid.height, - vid.rowbytes, vidSurface->pitch); - ptr += vid.height*vidSurface->pitch; - memset(ptr, 0x1F, half_excess); - } - else - VID_BlitLinearScreen(screens[0], vidSurface->pixels, vid.width*vid.bpp, - vid.height, vid.rowbytes, vidSurface->pitch ); - if (SDL_MUSTLOCK(vidSurface)) SDL_UnlockSurface(vidSurface); - } - } - else -#endif - if (bufSurface) //Alam: New Way to send video data - { - blited = SDL_BlitSurface(bufSurface,NULL,vidSurface,dstrect); - } - else if (vid.bpp == 1 && !vid.direct) - { - Uint8 *bP,*vP; //Src, Dst - Uint16 bW, vW; // Pitch Remainder - Sint32 pH, pW; //Height, Width - bP = (Uint8 *)screens[0]; - bW = (Uint16)(vid.rowbytes - vid.width); - //I_OutputMsg("Old Copy Code\n"); - if (SDL_MUSTLOCK(vidSurface)) lockedsf = SDL_LockSurface(vidSurface); - vP = (Uint8 *)vidSurface->pixels; - vW = (Uint16)(vidSurface->pitch - vidSurface->w*vidformat->BytesPerPixel); - if (vidSurface->h > vid.height) - vP += vidSurface->pitch*(vidSurface->h-vid.height)/2; - if (lockedsf == 0 && vidSurface->pixels) - { - if (vidformat->BytesPerPixel == 2) - { - for (pH=0;pH < vidSurface->h;pH++) - { - for (pW=0;pW < vidSurface->w;pW++) - { - *((Uint16 *)(void *)vP) = (Uint16)SDL_MapRGB(vidformat, - localPalette[*bP].r,localPalette[*bP].g,localPalette[*bP].b); - bP++; - vP += 2; - } - bP += bW; - vP += vW; - } - } - else if (vidformat->BytesPerPixel == 3) - { - for (pH=0;pH < vidSurface->h;pH++) - { - for (pW=0;pW < vidSurface->w;pW++) - { - *((Uint32 *)(void *)vP) = SDL_MapRGB(vidformat, - localPalette[*bP].r,localPalette[*bP].g,localPalette[*bP].b); - bP++; - vP += 3; - } - bP += bW; - vP += vW; - } - } - else if (vidformat->BytesPerPixel == 4) - { - for (pH=0;pH < vidSurface->h;pH++) - { - for (pW=0;pW < vidSurface->w;pW++) - { - *((Uint32 *)(void *)vP) = SDL_MapRGB(vidformat, - localPalette[*bP].r,localPalette[*bP].g,localPalette[*bP].b); - bP++; - vP += 4; - } - bP += bW; - vP += vW; - } - } - else - { - ;//NOP - } - } - if (SDL_MUSTLOCK(vidSurface)) SDL_UnlockSurface(vidSurface); - } - else /// \todo 15t15,15tN, others? - { - ;//NOP - } - -#ifdef HAVE_GP2XSDL - //if (blited == 0) - SDL_GP2X_WaitForBlitter(); -#endif - - if (lockedsf == 0 && blited == 0 && vidSurface->flags&SDL_DOUBLEBUF) - SDL_Flip(vidSurface); - else if (blited != -2 && lockedsf == 0) //Alam: -2 for Win32 Direct, yea, i know - SDL_UpdateRect(vidSurface, rect.x, rect.y, 0, 0); //Alam: almost always - else - I_OutputMsg("%s\n",SDL_GetError()); + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderPresent(renderer); } + #ifdef HWRENDER else { @@ -1537,8 +1455,9 @@ void I_SetPalette(RGBA_t *palette) localPalette[i].g = palette[i].s.green; localPalette[i].b = palette[i].s.blue; } - if (vidSurface) SDL_SetColors(vidSurface, localPalette, 0, 256); - if (bufSurface) SDL_SetColors(bufSurface, localPalette, 0, 256); + //if (vidSurface) SDL_SetPaletteColors(vidSurface->format->palette, localPalette, 0, 256); + // Fury -- SDL2 vidSurface is a 32-bit surface buffer copied to the texture. It's not palletized, like bufSurface. + if (bufSurface) SDL_SetPaletteColors(bufSurface->format->palette, localPalette, 0, 256); } // return number of fullscreen + X11 modes @@ -1552,6 +1471,7 @@ INT32 VID_NumModes(void) const char *VID_GetModeName(INT32 modeNum) { +#if 0 if (USE_FULLSCREEN && numVidModes != -1) // fullscreen modes { modeNum += firstEntry; @@ -1564,18 +1484,33 @@ const char *VID_GetModeName(INT32 modeNum) } else // windowed modes { +#endif + if (modeNum == -1) + { + return fallback_resolution_name; + } if (modeNum > MAXWINMODES) return NULL; sprintf(&vidModeName[modeNum][0], "%dx%d", windowedModes[modeNum][0], windowedModes[modeNum][1]); - } + //} return &vidModeName[modeNum][0]; } INT32 VID_GetModeForSize(INT32 w, INT32 h) { + int i; + for (i = 0; i < MAXWINMODES; i++) + { + if (windowedModes[i][0] == w && windowedModes[i][1] == h) + { + return i; + } + } + return -1; +#if 0 INT32 matchMode = -1, i; VID_PrepareModeList(); if (USE_FULLSCREEN && numVidModes != -1) @@ -1636,10 +1571,14 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h) } } return matchMode; +#endif } void VID_PrepareModeList(void) { + // Under SDL2, we just use the windowed modes list, and scale in windowed fullscreen. + allow_fullscreen = true; +#if 0 INT32 i; firstEntry = 0; @@ -1667,42 +1606,18 @@ void VID_PrepareModeList(void) } } allow_fullscreen = true; +#endif } static inline void SDLESSet(void) { -#ifdef HAVE_DCSDL - INT32 j; - SDL_DC_SetVideoDriver(SDL_DC_DIRECT_VIDEO); //SDL_DC_DMA_VIDEO - for (j=0;j<4;j++) - { - SDL_DC_MapKey(j,SDL_DC_START,SDLK_ESCAPE); - SDL_DC_MapKey(j,SDL_DC_A,SDLK_UNKNOWN); - SDL_DC_MapKey(j,SDL_DC_B,SDLK_UNKNOWN); - SDL_DC_MapKey(j,SDL_DC_X,SDLK_UNKNOWN); - SDL_DC_MapKey(j,SDL_DC_Y,SDLK_UNKNOWN); - SDL_DC_MapKey(j,SDL_DC_L,SDLK_UNKNOWN); - SDL_DC_MapKey(j,SDL_DC_R,SDLK_UNKNOWN); - //SDL_DC_MapKey(j,SDL_DC_LEFT,SDLK_UNKNOWN); - //SDL_DC_MapKey(j,SDL_DC_RIGHT,SDLK_UNKNOWN); - //SDL_DC_MapKey(j,SDL_DC_UP,SDLK_UNKNOWN); - //SDL_DC_MapKey(j,SDL_DC_DOWN,SDLK_UNKNOWN); - } - //SDL_DC_MapKey(0,SDL_DC_L,SDLK_LEFTBRACKET); - //SDL_DC_MapKey(0,SDL_DC_R,SDLK_RIGHTBRACKET); - //SDL_DC_MapKey(0,SDL_DC_START,SDLK_UNKNOWN); - //SDL_DC_MapKey(1,SDL_DC_L,SDLK_z); - //SDL_DC_MapKey(1,SDL_DC_R,SDLK_x); -#endif -#ifdef HAVE_GP2XSDL - SDL_GP2X_MiniDisplay(0,0); - //SDL_GP2X_DenyGfxMemory(NULL, 0); - SDL_GP2X_AllowGfxMemory(NULL, 0); -#endif + SDL2STUB(); } static void SDLWMSet(void) { + SDL2STUB(); +#if 0 #ifdef RPC_NO_WINDOWS_H SDL_SysWMinfo SDLWM; memset(&SDLWM,0,sizeof (SDL_SysWMinfo)); @@ -1716,142 +1631,195 @@ static void SDLWMSet(void) SetFocus(vid.WndParent); ShowWindow(vid.WndParent, SW_SHOW); } -#ifndef _WIN32_WCE SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); -#endif #endif SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE); +#endif } +#if 0 static void* SDLGetDirect(void) { -#if 0 //#ifndef __MACH__ // Do not directly access the MacOSX's OpenGL memory - if (!SDL_MUSTLOCK(vidSurface) && SDLmatchVideoformat()) - { - vid.rowbytes = vidSurface->pitch; - return vidSurface->pixels; - } -#endif // you can not use the video memory in pixels member in fullscreen mode + // you can not use the video memory in pixels member in fullscreen mode return NULL; } +#endif INT32 VID_SetMode(INT32 modeNum) { -#ifdef _WIN32_WCE - (void)modeNum; -#else SDLdoUngrabMouse(); - vid.recalc = true; - BitsPerPixel = (Uint8)cv_scr_depth.value; - //vid.bpp = BitsPerPixel==8?1:2; - // Window title - SDL_WM_SetCaption("SRB2 "VERSIONSTRING, "SRB2"); - if (render_soft == rendermode) - { - //Alam: SDL_Video system free vidSurface for me - if (vid.buffer) free(vid.buffer); - vid.buffer = NULL; - if (bufSurface) SDL_FreeSurface(bufSurface); - bufSurface = NULL; - } + vid.recalc = 1; + vid.bpp = 1; - if (USE_FULLSCREEN) - { - if (numVidModes != -1) - { - modeNum += firstEntry; - vid.width = modeList[modeNum]->w; - vid.height = modeList[modeNum]->h; - } - else - { - vid.width = windowedModes[modeNum][0]; - vid.height = windowedModes[modeNum][1]; - } - if (render_soft == rendermode) - { - SDLSetMode(vid.width, vid.height, BitsPerPixel, surfaceFlagsF); - - if (!vidSurface) - { - cv_fullscreen.value = 0; - modeNum = VID_GetModeForSize(vid.width,vid.height); - vid.width = windowedModes[modeNum][0]; - vid.height = windowedModes[modeNum][1]; - SDLSetMode(vid.width, vid.height, BitsPerPixel, surfaceFlagsW); - if (!vidSurface) - I_Error("Could not set vidmode: %s\n",SDL_GetError()); - } - } -#ifdef HWRENDER - else // (render_soft != rendermode) - { - if (!OglSdlSurface(vid.width, vid.height, true)) - { - cv_fullscreen.value = 0; - modeNum = VID_GetModeForSize(vid.width,vid.height); - vid.width = windowedModes[modeNum][0]; - vid.height = windowedModes[modeNum][1]; - if (!OglSdlSurface(vid.width, vid.height,false)) - I_Error("Could not set vidmode: %s\n",SDL_GetError()); - } - - realwidth = (Uint16)vid.width; - realheight = (Uint16)vid.height; - } -#endif - } - else //(cv_fullscreen.value) + if (modeNum >= 0 && modeNum < MAXWINMODES-1) { vid.width = windowedModes[modeNum][0]; vid.height = windowedModes[modeNum][1]; - - if (render_soft == rendermode) - { - SDLSetMode(vid.width, vid.height, BitsPerPixel, surfaceFlagsW); - if (!vidSurface) - I_Error("Could not set vidmode: %s\n",SDL_GetError()); - } -#ifdef HWRENDER - else //(render_soft != rendermode) - { - if (!OglSdlSurface(vid.width, vid.height, false)) - I_Error("Could not set vidmode: %s\n",SDL_GetError()); - realwidth = (Uint16)vid.width; - realheight = (Uint16)vid.height; - } -#endif + vid.modenum = modeNum; } + else + { + // just set the desktop resolution as a fallback + SDL_DisplayMode mode; + SDL_GetWindowDisplayMode(window, &mode); + if (mode.w >= 2048) + { + vid.width = 1920; + vid.height = 1200; + } + else + { + vid.width = mode.w; + vid.height = mode.h; + } + vid.modenum = -1; + } + Impl_SetWindowName("SRB2 "VERSIONSTRING); - vid.modenum = VID_GetModeForSize(vidSurface->w,vidSurface->h); + SDLSetMode(windowedModes[modeNum][0], windowedModes[modeNum][1], USE_FULLSCREEN); if (render_soft == rendermode) { - vid.rowbytes = vid.width*vid.bpp; - vid.direct = SDLGetDirect(); - vid.buffer = malloc(vid.rowbytes*vid.height*NUMSCREENS); - if (vid.buffer) memset(vid.buffer,0x00,vid.rowbytes*vid.height*NUMSCREENS); - else I_Error ("Not enough memory for video buffer\n"); + if (bufSurface) + { + SDL_FreeSurface(bufSurface); + bufSurface = NULL; + } + + Impl_VideoSetupBuffer(); } -#if 0 // broken - if (!cv_stretch.value && (float)vid.width/vid.height != ((float)BASEVIDWIDTH/BASEVIDHEIGHT)) - vid.height = (INT32)(vid.width * ((float)BASEVIDHEIGHT/BASEVIDWIDTH));// Adjust the height to match -#endif -#endif - I_StartupMouse(); + return SDL_TRUE; +} - SDLWMSet(); +static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) +{ + int flags = 0; + if (window != NULL) + { + return SDL_FALSE; + } - return true; + if (fullscreen) + { + flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + + if (borderlesswindow) + { + flags |= SDL_WINDOW_BORDERLESS; + } + +#ifdef HWRENDER + if (rendermode == render_opengl) + { + window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + realwidth, realheight, flags | SDL_WINDOW_OPENGL); + if (window != NULL) + { + sdlglcontext = SDL_GL_CreateContext(window); + if (sdlglcontext == NULL) + { + SDL_DestroyWindow(window); + I_Error("Failed to create a GL context: %s\n", SDL_GetError()); + } + else + { + SDL_GL_MakeCurrent(window, sdlglcontext); + } + } + else return SDL_FALSE; + } +#endif + if (rendermode == render_soft) + { + window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + realwidth, realheight, flags); + if (window != NULL) + { + renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0)); + if (renderer != NULL) + { + SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT); + } + else return SDL_FALSE; + } + else return SDL_FALSE; + } + + return SDL_TRUE; +} + +static void Impl_SetWindowName(const char *title) +{ + if (window != NULL) + { + return; + } + SDL2STUB(); + SDL_SetWindowTitle(window, title); +} + +static void Impl_SetWindowIcon(void) +{ + if (window == NULL || icoSurface == NULL) + { + return; + } + SDL2STUB(); + SDL_SetWindowIcon(window, icoSurface); +} + +static void Impl_VideoSetupSDLBuffer(void) +{ + if (bufSurface != NULL) + { + SDL_FreeSurface(bufSurface); + bufSurface = NULL; + } + // Set up the SDL palletized buffer (copied to vidbuffer before being rendered to texture) + if (vid.bpp == 1) + { + bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,8, + (int)vid.rowbytes,0x00000000,0x00000000,0x00000000,0x00000000); // 256 mode + } + else if (vid.bpp == 2) // Fury -- don't think this is used at all anymore + { + bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,15, + (int)vid.rowbytes,0x00007C00,0x000003E0,0x0000001F,0x00000000); // 555 mode + } + if (bufSurface) + { + SDL_SetPaletteColors(bufSurface->format->palette, localPalette, 0, 256); + } + else + { + I_Error("%s", M_GetText("No system memory for SDL buffer surface\n")); + } +} + +static void Impl_VideoSetupBuffer(void) +{ + // Set up game's software render buffer + if (rendermode == render_soft) + { + vid.rowbytes = vid.width * vid.bpp; + vid.direct = NULL; + vid.buffer = malloc(vid.rowbytes*vid.height*NUMSCREENS); + if (vid.buffer) + { + memset(vid.buffer,0x00,vid.rowbytes*vid.height*NUMSCREENS); + } + else + { + I_Error("%s", M_GetText("Not enough memory for video buffer\n")); + } + } } void I_StartupGraphics(void) { - static char SDLNOMOUSE[] = "SDL_NOMOUSE=1"; - static char SDLVIDEOMID[] = "SDL_VIDEO_CENTERED=center"; - if (dedicated) { rendermode = render_none; @@ -1866,24 +1834,10 @@ void I_StartupGraphics(void) COM_AddCommand ("vid_mode", VID_Command_Mode_f); CV_RegisterVar (&cv_vidwait); CV_RegisterVar (&cv_stretch); -#ifdef FILTERS - CV_RegisterVar (&cv_filter); -#endif -#ifdef _PSP // pitch is 0, mod of 0 crash - disable_mouse = true; -#else disable_mouse = M_CheckParm("-nomouse"); -#endif - if (disable_mouse) - I_PutEnv(SDLNOMOUSE); - if (!I_GetEnv("SDL_VIDEO_CENTERED")) - I_PutEnv(SDLVIDEOMID); - disable_fullscreen = M_CheckParm("-win"); + disable_fullscreen = M_CheckParm("-win") ? 1 : 0; keyboard_started = true; -#ifdef _arch_dreamcast - conio_shutdown(); -#endif #if !defined(HAVE_TTF) #ifdef _WIN32 // Initialize Audio as well, otherwise Win32's DirectX can not use audio @@ -1902,52 +1856,24 @@ void I_StartupGraphics(void) return; } } -#ifdef REMOTE_DEBUGGING -#ifdef _WII - _break(); // break for debugger -#endif -#endif #endif { char vd[100]; //stack space for video name - CONS_Printf(M_GetText("Starting up with video driver : %s\n"), SDL_VideoDriverName(vd,100)); + //CONS_Printf(M_GetText("Starting up with video driver : %s\n"), SDL_VideoDriverName(vd,100)); if (strncasecmp(vd, "gcvideo", 8) == 0 || strncasecmp(vd, "fbcon", 6) == 0 || strncasecmp(vd, "wii", 4) == 0 || strncasecmp(vd, "psl1ght", 8) == 0) framebuffer = SDL_TRUE; } if (M_CheckParm("-software")) + { rendermode = render_soft; - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); + } + + usesdl2soft = M_CheckParm("-softblit"); + borderlesswindow = M_CheckParm("-borderless"); + + //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); SDLESSet(); VID_Command_ModeList_f(); - vid.buffer = NULL; // For software mode - vid.width = BASEVIDWIDTH; // Default size for startup - vid.height = BASEVIDHEIGHT; // BitsPerPixel is the SDL interface's - vid.recalc = true; // Set up the console stufff - vid.direct = NULL; // Maybe direct access? - vid.bpp = 1; // This is the game engine's Bpp - vid.WndParent = NULL; //For the window? - -#ifdef HAVE_TTF - I_ShutdownTTF(); -#endif - - // Window title -#ifdef _WIN32_WCE - SDL_WM_SetCaption("SRB2 "VERSIONSTRING, "SRB2"); -#else - SDL_WM_SetCaption("SRB2: Starting up", "SRB2"); -#endif - - // Window icon -#ifdef HAVE_IMAGE - icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm); -#endif - SDL_WM_SetIcon(icoSurface, NULL); - -#ifdef _WIN32 - //DisableAero(); //also disable Aero on Vista -#endif - #ifdef HWRENDER if (M_CheckParm("-opengl") || rendermode == render_opengl) { @@ -1980,68 +1906,49 @@ void I_StartupGraphics(void) // check gl renderer lib if (HWD.pfnGetRenderVersion() != VERSION) I_Error("%s", M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); -#if 1 //#ifdef _WIN32_WCE - vid.width = BASEVIDWIDTH; - vid.height = BASEVIDHEIGHT; -#else - vid.width = 640; // hack to make voodoo cards work in 640x480 - vid.height = 480; -#endif - if (HWD.pfnInit(I_Error)) // let load the OpenGL library + if (!HWD.pfnInit(I_Error)) // let load the OpenGL library { - /* - * We want at least 1 bit R, G, and B, - * and at least 16 bpp. Why 1 bit? May be more? - */ - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 1); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 1); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 1); - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if (!OglSdlSurface(vid.width, vid.height, (USE_FULLSCREEN))) - if (!OglSdlSurface(vid.width, vid.height, !(USE_FULLSCREEN))) - rendermode = render_soft; - } - else rendermode = render_soft; - } -#else - rendermode = render_soft; //force software mode when there no HWRENDER code -#endif - if (render_soft == rendermode) - { -#if defined(_WII) - vid.width = 640; - vid.height = 480; -#elif defined(_PS3) - vid.width = 720; - vid.height = 480; -#else - vid.width = BASEVIDWIDTH; - vid.height = BASEVIDHEIGHT; -#endif - SDLSetMode(vid.width, vid.height, BitsPerPixel, surfaceFlagsW); - if (!vidSurface) - { - CONS_Printf(M_GetText("Could not set vidmode: %s\n") ,SDL_GetError()); - vid.rowbytes = 0; - graphics_started = true; - return; } - vid.rowbytes = vid.width * vid.bpp; - vid.direct = SDLGetDirect(); - vid.buffer = malloc(vid.rowbytes*vid.height*NUMSCREENS); - if (vid.buffer) memset(vid.buffer,0x00,vid.rowbytes*vid.height*NUMSCREENS); - else CONS_Printf("%s", M_GetText("Not enough memory for video buffer\n")); } +#endif + + // Fury: we do window initialization after GL setup to allow + // SDL_GL_LoadLibrary to work well on Windows + + // Create window + //Impl_CreateWindow(USE_FULLSCREEN); + //Impl_SetWindowName("SRB2"); + VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); + + vid.buffer = NULL; // For software mode + vid.width = BASEVIDWIDTH; // Default size for startup + vid.height = BASEVIDHEIGHT; // BitsPerPixel is the SDL interface's + vid.recalc = true; // Set up the console stufff + vid.direct = NULL; // Maybe direct access? + vid.bpp = 1; // This is the game engine's Bpp + vid.WndParent = NULL; //For the window? + +#ifdef HAVE_TTF + I_ShutdownTTF(); +#endif + // Window icon +#ifdef HAVE_IMAGE + icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm); +#endif + Impl_SetWindowIcon(); + + VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); + if (M_CheckParm("-nomousegrab")) mousegrabok = SDL_FALSE; -#ifdef _DEBUG +#if 0 // defined (_DEBUG) else { char videodriver[4] = {'S','D','L',0}; if (!M_CheckParm("-mousegrab") && - SDL_VideoDriverName(videodriver,4) && - strncasecmp("X11",videodriver,4) == 0) + *strncpy(videodriver, SDL_GetCurrentVideoDriver(), 4) != '\0' && + strncasecmp("x11",videodriver,4) == 0) mousegrabok = SDL_FALSE; //X11's XGrabPointer not good } #endif @@ -2071,30 +1978,23 @@ void I_ShutdownGraphics(void) vid.buffer = NULL; if (bufSurface) SDL_FreeSurface(bufSurface); bufSurface = NULL; -#ifdef FILTERS - if (preSurface) SDL_FreeSurface(preSurface); - preSurface = NULL; - if (f2xSurface) SDL_FreeSurface(f2xSurface); - f2xSurface = NULL; -#endif } // was graphics initialized anyway? if (!graphics_started) return; CONS_Printf("I_ShutdownGraphics: "); -#ifdef _WIN32 - //ResetAero(); -#endif graphics_started = false; CONS_Printf("%s", M_GetText("shut down\n")); #ifdef HWRENDER if (GLUhandle) hwClose(GLUhandle); + if (sdlglcontext) + { + SDL_GL_DeleteContext(sdlglcontext); + } #endif -#ifndef _arch_dreamcast SDL_QuitSubSystem(SDL_INIT_VIDEO); -#endif framebuffer = SDL_FALSE; } #endif diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 15166875..8c90557f 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -617,7 +617,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping) } #endif - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len)); + music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); if (!music) { CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); @@ -778,7 +778,7 @@ void I_SetMIDIMusicVolume(UINT8 volume) INT32 I_RegisterSong(void *data, size_t len) { - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len)); + music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); if (!music) { CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index e726bf07..62055e10 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -25,6 +25,8 @@ #include "SDL.h" +#include "sdlmain.h" + #ifdef _MSC_VER #pragma warning(default : 4214 4244) #endif @@ -62,19 +64,11 @@ PFNglGetIntegerv pglGetIntegerv; PFNglGetString pglGetString; #endif -#ifdef _PSP -static const Uint32 WOGLFlags = SDL_HWSURFACE|SDL_OPENGL/*|SDL_RESIZABLE*/; -static const Uint32 FOGLFlags = SDL_HWSURFACE|SDL_OPENGL|SDL_FULLSCREEN; -#else -static const Uint32 WOGLFlags = SDL_OPENGL/*|SDL_RESIZABLE*/; -static const Uint32 FOGLFlags = SDL_OPENGL|SDL_FULLSCREEN; -#endif - /** \brief SDL video display surface */ -SDL_Surface *vidSurface = NULL; INT32 oglflags = 0; void *GLUhandle = NULL; +SDL_GLContext sdlglcontext = 0; #ifndef STATIC_OPENGL void *GetGLFunc(const char *proc) @@ -156,36 +150,13 @@ boolean LoadGL(void) \return if true, changed video mode */ -boolean OglSdlSurface(INT32 w, INT32 h, boolean isFullscreen) +boolean OglSdlSurface(INT32 w, INT32 h) { INT32 cbpp; - Uint32 OGLFlags; const GLvoid *glvendor = NULL, *glrenderer = NULL, *glversion = NULL; cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; - if (vidSurface) - { - //Alam: SDL_Video system free vidSurface for me -#ifdef VOODOOSAFESWITCHING - SDL_QuitSubSystem(SDL_INIT_VIDEO); - SDL_InitSubSystem(SDL_INIT_VIDEO); -#endif - } - - if (isFullscreen) - OGLFlags = FOGLFlags; - else - OGLFlags = WOGLFlags; - - cbpp = SDL_VideoModeOK(w, h, cbpp, OGLFlags); - if (cbpp < 16) - return true; //Alam: Let just say we did, ok? - - vidSurface = SDL_SetVideoMode(w, h, cbpp, OGLFlags); - if (!vidSurface) - return false; - glvendor = pglGetString(GL_VENDOR); // Get info and extensions. //BP: why don't we make it earlier ? @@ -200,55 +171,21 @@ boolean OglSdlSurface(INT32 w, INT32 h, boolean isFullscreen) DBG_Printf("Extensions : %s\n", gl_extensions); oglflags = 0; -#ifdef _WIN32 - // BP: disable advenced feature that don't work on somes hardware - // Hurdler: Now works on G400 with bios 1.6 and certified drivers 6.04 - if (strstr(glrenderer, "810")) oglflags |= GLF_NOZBUFREAD; -#elif defined (unix) || defined (UNIXCOMMON) - // disable advanced features not working on somes hardware - if (strstr(glrenderer, "G200")) oglflags |= GLF_NOTEXENV; - if (strstr(glrenderer, "G400")) oglflags |= GLF_NOTEXENV; -#endif - DBG_Printf("oglflags : 0x%X\n", oglflags ); - -#ifdef USE_PALETTED_TEXTURE - if (isExtAvailable("GL_EXT_paletted_texture", gl_extensions)) - glColorTableEXT = SDL_GL_GetProcAddress("glColorTableEXT"); - else - glColorTableEXT = NULL; -#endif - -#ifdef USE_WGL_SWAP - if (isExtAvailable("WGL_EXT_swap_control", gl_extensions)) - wglSwapIntervalEXT = SDL_GL_GetProcAddress("wglSwapIntervalEXT"); - else - wglSwapIntervalEXT = NULL; -#else - if (isExtAvailable("GLX_SGI_swap_control", gl_extensions)) - glXSwapIntervalSGIEXT = SDL_GL_GetProcAddress("glXSwapIntervalSGI"); - else - glXSwapIntervalSGIEXT = NULL; -#endif - -#ifndef KOS_GL_COMPATIBILITY if (isExtAvailable("GL_EXT_texture_filter_anisotropic", gl_extensions)) pglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maximumAnisotropy); else -#endif - maximumAnisotropy = 0; + maximumAnisotropy = 1; granisotropicmode_cons_t[1].value = maximumAnisotropy; + SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0); + SetModelView(w, h); SetStates(); pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); HWR_Startup(); -#ifdef KOS_GL_COMPATIBILITY - textureformatGL = GL_ARGB4444; -#else textureformatGL = cbpp > 16 ? GL_RGBA : GL_RGB5_A1; -#endif return true; } @@ -264,17 +201,11 @@ void OglSdlFinishUpdate(boolean waitvbl) static boolean oldwaitvbl = false; if (oldwaitvbl != waitvbl) { -#ifdef USE_WGL_SWAP - if (wglSwapIntervalEXT) - wglSwapIntervalEXT(waitvbl); -#else - if (glXSwapIntervalSGIEXT) - glXSwapIntervalSGIEXT(waitvbl); -#endif + SDL_GL_SetSwapInterval(waitvbl ? 1 : 0); } oldwaitvbl = waitvbl; - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(window); } EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette, RGBA_t *pgamma) @@ -283,10 +214,6 @@ EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette, RGBA_t *pgamma) UINT32 redgamma = pgamma->s.red, greengamma = pgamma->s.green, bluegamma = pgamma->s.blue; -#if 0 // changing the gamma to 127 is a bad idea - i = SDL_SetGamma(byteasfloat(redgamma), byteasfloat(greengamma), byteasfloat(bluegamma)); -#endif - if (i == 0) redgamma = greengamma = bluegamma = 0x7F; //Alam: cool for (i = 0; i < 256; i++) { myPaletteData[i].s.red = (UINT8)MIN((palette[i].s.red * redgamma) /127, 255); @@ -294,20 +221,6 @@ EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette, RGBA_t *pgamma) myPaletteData[i].s.blue = (UINT8)MIN((palette[i].s.blue * bluegamma) /127, 255); myPaletteData[i].s.alpha = palette[i].s.alpha; } -#ifdef USE_PALETTED_TEXTURE - if (glColorTableEXT) - { - for (i = 0; i < 256; i++) - { - palette_tex[(3*i)+0] = palette[i].s.red; - palette_tex[(3*i)+1] = palette[i].s.green; - palette_tex[(3*i)+2] = palette[i].s.blue; - } - glColorTableEXT(GL_TEXTURE_2D, GL_RGB8, 256, GL_RGB, GL_UNSIGNED_BYTE, palette_tex); - } -#endif - // on a chang�de palette, il faut recharger toutes les textures - // jaja, und noch viel mehr ;-) Flush(); } diff --git a/src/sdl/ogl_sdl.h b/src/sdl/ogl_sdl.h index 43c28fa4..72f130a5 100644 --- a/src/sdl/ogl_sdl.h +++ b/src/sdl/ogl_sdl.h @@ -18,13 +18,16 @@ #include "../v_video.h" -extern SDL_Surface *vidSurface; extern void *GLUhandle; -boolean OglSdlSurface(INT32 w, INT32 h, boolean isFullscreen); +boolean OglSdlSurface(INT32 w, INT32 h); void OglSdlFinishUpdate(boolean vidwait); +extern SDL_Window *window; +extern SDL_Renderer *renderer; +extern SDL_GLContext sdlglcontext; + #ifdef _CREATE_DLL_ EXPORT void HWRAPI( OglSdlSetPalette ) (RGBA_t *palette, RGBA_t *pgamma); #endif diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 6ba83104..5d6c007b 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -856,6 +856,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16S(Uint8 *stream, int len) if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); + // Mix sounds into the mixing buffer. // Loop over len while (len--) @@ -945,6 +946,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16M(Uint8 *stream, int len) if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); + // Mix sounds into the mixing buffer. // Loop over len while (len--) @@ -1050,10 +1052,7 @@ static void SDLCALL I_UpdateStream(void *userdata, Uint8 *stream, int len) if (!sound_started || !userdata) return; -#if SDL_VERSION_ATLEAST(1,3,0) - if (musicStarted) - memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80 -#endif + memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80 if ((audio.channels != 1 && audio.channels != 2) || (audio.format != AUDIO_S8 && audio.format != AUDIO_S16SYS)) @@ -1320,8 +1319,8 @@ void I_StartupSound(void) } else { - char ad[100]; - CONS_Printf(M_GetText(" Starting up with audio driver : %s\n"), SDL_AudioDriverName(ad, (int)sizeof ad)); + //char ad[100]; + //CONS_Printf(M_GetText(" Starting up with audio driver : %s\n"), SDL_AudioDriverName(ad, (int)sizeof ad)); } samplecount = audio.samples; CV_SetValue(&cv_samplerate, audio.freq); @@ -1782,7 +1781,9 @@ static boolean I_StartGMESong(const char *musicname, boolean looping) gme_set_user_data(emu, data); gme_set_user_cleanup(emu, I_CleanupGME); gme_start_track(emu, 0); +#ifdef HAVE_MIXER gme_set_fade(emu, Digfade); +#endif Snd_LockAudio(); localdata.gme_emu = emu; diff --git a/src/sdl/sdlmain.h b/src/sdl/sdlmain.h index 1e497b10..af4e48f7 100644 --- a/src/sdl/sdlmain.h +++ b/src/sdl/sdlmain.h @@ -22,6 +22,11 @@ extern SDL_bool consolevent; extern SDL_bool framebuffer; +#include "../m_fixed.h" + +// SDL2 stub macro +#define SDL2STUB(name) CONS_Printf("SDL2: stubbed: %s:%d\n", __func__, __LINE__) + /** \brief The JoyInfo_s struct info about joystick diff --git a/src/sdl2/IMG_xpm.c b/src/sdl2/IMG_xpm.c deleted file mode 100644 index e08736d6..00000000 --- a/src/sdl2/IMG_xpm.c +++ /dev/null @@ -1,506 +0,0 @@ -/* - SDL_image: An example image loading library for use with SDL - Copyright (C) 1999-2004 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* $Id: IMG_xpm.c,v 1.10 2004/01/04 22:04:38 slouken Exp $ */ - -/* - * XPM (X PixMap) image loader: - * - * Supports the XPMv3 format, EXCEPT: - * - hotspot coordinates are ignored - * - only colour ('c') colour symbols are used - * - rgb.txt is not used (for portability), so only RGB colours - * are recognized (#rrggbb etc) - only a few basic colour names are - * handled - * - * The result is an 8bpp indexed surface if possible, otherwise 32bpp. - * The colourkey is correctly set if transparency is used. - * - * Besides the standard API, also provides - * - * SDL_Surface *IMG_ReadXPMFromArray(char **xpm) - * - * that reads the image data from an XPM file included in the C source. - * - * TODO: include rgb.txt here. The full table (from solaris 2.6) only - * requires about 13K in binary form. - */ - -#include -#include -#include -#include - -//#include "SDL_image.h" - - -#ifdef LOAD_XPM - -/* See if an image is contained in a data source */ -#if 0 -int IMG_isXPM(SDL_RWops *src) -{ - char magic[9]; - - return (SDL_RWread(src, magic, sizeof (magic), 1) - && memcmp(magic, "/* XPM */", 9) == 0); -} -#endif - -/* Hash table to look up colors from pixel strings */ -#define STARTING_HASH_SIZE 256 - -struct hash_entry { - char *key; - Uint32 color; - struct hash_entry *next; -}; - -struct color_hash { - struct hash_entry **table; - struct hash_entry *entries; /* array of all entries */ - struct hash_entry *next_free; - size_t size; - int maxnum; -}; - -static int hash_key(const char *key, int cpp, size_t size) -{ - int hash; - - hash = 0; - while ( cpp-- > 0 ) { - hash = hash * 33 + *key++; - } - return (int)(hash & (size - 1)); -} - -static struct color_hash *create_colorhash(int maxnum) -{ - size_t bytes; - int s; - struct color_hash *hash; - - /* we know how many entries we need, so we can allocate - everything here */ - hash = malloc(sizeof *hash); - if (!hash) - return NULL; - - /* use power-of-2 sized hash table for decoding speed */ - for (s = STARTING_HASH_SIZE; s < maxnum; s <<= 1) - ; - hash->size = s; - hash->maxnum = maxnum; - bytes = hash->size * sizeof (struct hash_entry **); - hash->entries = NULL; /* in case malloc fails */ - hash->table = malloc(bytes); - if (!hash->table) - return NULL; - memset(hash->table, 0, bytes); - hash->entries = malloc(maxnum * sizeof (struct hash_entry)); - if (!hash->entries) - { - free(hash->table); - return NULL; - } - hash->next_free = hash->entries; - return hash; -} - -static int add_colorhash(struct color_hash *hash, - char *key, int cpp, Uint32 color) -{ - const int indexkey = hash_key(key, cpp, hash->size); - struct hash_entry *e = hash->next_free++; - e->color = color; - e->key = key; - e->next = hash->table[indexkey]; - hash->table[indexkey] = e; - return 1; -} - -/* fast lookup that works if cpp == 1 */ -#define QUICK_COLORHASH(hash, key) ((hash)->table[*(const Uint8 *)(key)]->color) - -static Uint32 get_colorhash(struct color_hash *hash, const char *key, int cpp) -{ - struct hash_entry *entry = hash->table[hash_key(key, cpp, hash->size)]; - while (entry) { - if (memcmp(key, entry->key, cpp) == 0) - return entry->color; - entry = entry->next; - } - return 0; /* garbage in - garbage out */ -} - -static void free_colorhash(struct color_hash *hash) -{ - if (hash && hash->table) { - free(hash->table); - free(hash->entries); - free(hash); - } -} - -/* portable case-insensitive string comparison */ -static int string_equal(const char *a, const char *b, size_t n) -{ - while (*a && *b && n) { - if (toupper((unsigned char)*a) != toupper((unsigned char)*b)) - return 0; - a++; - b++; - n--; - } - return *a == *b; -} - -#undef ARRAYSIZE -#define ARRAYSIZE(a) (int)(sizeof (a) / sizeof ((a)[0])) - -/* - * convert colour spec to RGB (in 0xrrggbb format). - * return 1 if successful. - */ -static int color_to_rgb(const char *spec, size_t speclen, Uint32 *rgb) -{ - /* poor man's rgb.txt */ - static struct { const char *name; Uint32 rgb; } known[] = { - {"none", 0xffffffff}, - {"black", 0x00000000}, - {"white", 0x00ffffff}, - {"red", 0x00ff0000}, - {"green", 0x0000ff00}, - {"blue", 0x000000ff} - }; - - if (spec[0] == '#') { - char buf[7]; - switch (speclen) { - case 4: - buf[0] = buf[1] = spec[1]; - buf[2] = buf[3] = spec[2]; - buf[4] = buf[5] = spec[3]; - break; - case 7: - memcpy(buf, spec + 1, 6); - break; - case 13: - buf[0] = spec[1]; - buf[1] = spec[2]; - buf[2] = spec[5]; - buf[3] = spec[6]; - buf[4] = spec[9]; - buf[5] = spec[10]; - break; - } - buf[6] = '\0'; - *rgb = (Uint32)strtol(buf, NULL, 16); - return 1; - } else { - int i; - for (i = 0; i < ARRAYSIZE(known); i++) - if (string_equal(known[i].name, spec, speclen)) { - *rgb = known[i].rgb; - return 1; - } - return 0; - } -} - -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - -static char *linebuf; -static int buflen; -static const char *error; - -/* - * Read next line from the source. - * If len > 0, it's assumed to be at least len chars (for efficiency). - * Return NULL and set error upon EOF or parse error. - */ -static const char *get_next_line(const char ***lines, SDL_RWops *src, int len) -{ - char *linebufnew; - if (lines) { - return *(*lines)++; - } else { - char c; - int n; - do { - if (SDL_RWread(src, &c, 1, 1) <= 0) { - error = "Premature end of data"; - return NULL; - } - } while (c != '"'); - if (len) { - len += 4; /* "\",\n\0" */ - if (len > buflen){ - buflen = len; - linebufnew = realloc(linebuf, buflen); - if(!linebufnew) { - free(linebuf); - error = "Out of memory"; - return NULL; - } - linebuf = linebufnew; - } - if (SDL_RWread(src, linebuf, len - 1, 1) <= 0) { - error = "Premature end of data"; - return NULL; - } - n = len - 2; - } else { - n = 0; - do { - if (n >= buflen - 1) { - if (buflen == 0) - buflen = 16; - buflen *= 2; - linebufnew = realloc(linebuf, buflen); - if(!linebufnew) { - free(linebuf); - error = "Out of memory"; - return NULL; - } - linebuf = linebufnew; - } - if (SDL_RWread(src, linebuf + n, 1, 1) <= 0) { - error = "Premature end of data"; - return NULL; - } - } while (linebuf[n++] != '"'); - n--; - } - linebuf[n] = '\0'; - return linebuf; - } -} - -#define SKIPSPACE(p) \ -do { \ - while (isspace((unsigned char)*(p))) \ - ++(p); \ -} while (0) - -#define SKIPNONSPACE(p) \ -do { \ - while (!isspace((unsigned char)*(p)) && *p) \ - ++(p); \ -} while (0) - -/* read XPM from either array or RWops */ -static SDL_Surface *load_xpm(const char **xpm, SDL_RWops *src) -{ - SDL_Surface *image = NULL; - int indexc; - int x, y; - int w, h, ncolors, cpp; - int indexed; - Uint8 *dst; - struct color_hash *colors = NULL; - SDL_Color *im_colors = NULL; - char *keystrings = NULL, *nextkey; - const char *line; - const char ***xpmlines = NULL; - int pixels_len; - - error = NULL; - linebuf = NULL; - buflen = 0; - - if (xpm) - xpmlines = &xpm; - - line = get_next_line(xpmlines, src, 0); - if (!line) - goto done; - /* - * The header string of an XPMv3 image has the format - * - * [ ] - * - * where the hotspot coords are intended for mouse cursors. - * Right now we don't use the hotspots but it should be handled - * one day. - */ - if (sscanf(line, "%d %d %d %d", &w, &h, &ncolors, &cpp) != 4 - || w <= 0 || h <= 0 || ncolors <= 0 || cpp <= 0) { - error = "Invalid format description"; - goto done; - } - - keystrings = malloc(ncolors * cpp); - if (!keystrings) { - error = "Out of memory"; - goto done; - } - nextkey = keystrings; - - /* Create the new surface */ - if (ncolors <= 256) { - indexed = 1; - image = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 8, - 0, 0, 0, 0); - im_colors = image->format->palette->colors; - image->format->palette->ncolors = ncolors; - } else { - indexed = 0; - image = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, - 0xff0000, 0x00ff00, 0x0000ff, 0); - } - if (!image) { - /* Hmm, some SDL error (out of memory?) */ - goto done; - } - - /* Read the colors */ - colors = create_colorhash(ncolors); - if (!colors) { - error = "Out of memory"; - goto done; - } - for (indexc = 0; indexc < ncolors; ++indexc ) { - const char *p; - line = get_next_line(xpmlines, src, 0); - if (!line) - goto done; - - p = line + cpp + 1; - - /* parse a colour definition */ - for (;;) { - char nametype; - const char *colname; - Uint32 rgb, pixel; - - SKIPSPACE(p); - if (!*p) { - error = "colour parse error"; - goto done; - } - nametype = *p; - SKIPNONSPACE(p); - SKIPSPACE(p); - colname = p; - SKIPNONSPACE(p); - if (nametype == 's') - continue; /* skip symbolic colour names */ - - if (!color_to_rgb(colname, p - colname, &rgb)) - continue; - - memcpy(nextkey, line, cpp); - if (indexed) { - SDL_Color *c = im_colors + indexc; - c->r = (Uint8)(rgb >> 16); - c->g = (Uint8)(rgb >> 8); - c->b = (Uint8)(rgb); - pixel = indexc; - } else - pixel = rgb; - add_colorhash(colors, nextkey, cpp, pixel); - nextkey += cpp; - if (rgb == 0xffffffff) - SDL_SetColorKey(image, SDL_SRCCOLORKEY, pixel); - break; - } - } - - /* Read the pixels */ - pixels_len = w * cpp; - dst = image->pixels; - for (y = 0; y < h; y++) { - line = get_next_line(xpmlines, src, pixels_len); - if (indexed) { - /* optimization for some common cases */ - if (cpp == 1) - for (x = 0; x < w; x++) - dst[x] = (Uint8)QUICK_COLORHASH(colors, - line + x); - else - for (x = 0; x < w; x++) - dst[x] = (Uint8)get_colorhash(colors, - line + x * cpp, - cpp); - } else { - for (x = 0; x < w; x++) - ((Uint32*)dst)[x] = get_colorhash(colors, - line + x * cpp, - cpp); - } - dst += image->pitch; - } - -done: - if (error) { - SDL_FreeSurface(image); - image = NULL; - SDL_SetError(error); - } - free(keystrings); - free_colorhash(colors); - free(linebuf); - return(image); -} - -/* Load a XPM type image from an RWops datasource */ -#if 0 -SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src) -{ - if ( !src ) { - /* The error message has been set in SDL_RWFromFile */ - return NULL; - } - return load_xpm(NULL, src); -} -#endif - -static inline SDL_Surface *IMG_ReadXPMFromArray(const char **xpm) -{ - return load_xpm(xpm, NULL); -} - -#else /* not LOAD_XPM */ - -/* See if an image is contained in a data source */ -#if 0 -int IMG_isXPM(SDL_RWops *src) -{ - return(0); -} - -/* Load a XPM type image from an SDL datasource */ -SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src) -{ - return(NULL); -} -#endif - -static inline SDL_Surface *IMG_ReadXPMFromArray(const char **xpm) -{ - return NULL; -} -#endif /* not LOAD_XPM */ diff --git a/src/sdl2/MakeCYG.cfg b/src/sdl2/MakeCYG.cfg deleted file mode 100644 index 5907579c..00000000 --- a/src/sdl2/MakeCYG.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# -# sdl/makeCYG.cfg for SRB2/Cygwin -# - -# -#Cygwin, for debugging - - NOHW=1 - NOHS=1 - NOASM=1 - - OPTS+=-DLINUX - - i_system_o+=$(OBJDIR)/SRB2.res - - # name of the exefile - EXENAME?=lsdlsrb2.exe diff --git a/src/sdl2/MakeNIX.cfg b/src/sdl2/MakeNIX.cfg deleted file mode 100644 index f5c9b207..00000000 --- a/src/sdl2/MakeNIX.cfg +++ /dev/null @@ -1,96 +0,0 @@ -# -# sdl/makeNIX.cfg for SRB2/?nix -# - -#Valgrind support -ifdef VALGRIND -VALGRIND_PKGCONFIG?=valgrind -VALGRIND_CFLAGS?=$(shell $(PKG_CONFIG) $(VALGRIND_PKGCONFIG) --cflags) -VALGRIND_LDFLAGS?=$(shell $(PKG_CONFIG) $(VALGRIND_PKGCONFIG) --libs) -ZDEBUG=1 -LIBS+=$(VALGRIND_LDFLAGS) -ifdef GCC46 -WFLAGS+=-Wno-error=unused-but-set-variable -WFLAGS+=-Wno-unused-but-set-variable -endif -endif - -# -#here is GNU/Linux and other -# - - OPTS=-DUNIXCOMMON - - #LDFLAGS = -L/usr/local/lib - LIBS=-lm -ifdef LINUX - LIBS+=-lrt -ifdef NOTERMIOS - OPTS+=-DNOTERMIOS -endif -endif - -ifdef LINUX64 - OPTS+=-DLINUX64 -endif - -# -#here is Solaris -# -ifdef SOLARIS - NOIPX=1 - NOASM=1 - OPTS+=-DSOLARIS -DINADDR_NONE=INADDR_ANY -DBSD_COMP - OPTS+=-I/usr/local/include -I/opt/sfw/include - LDFLAGS+=-L/opt/sfw/lib - LIBS+=-lsocket -lnsl -endif - -# -#here is FreeBSD -# -ifdef FREEBSD - OPTS+=-DLINUX -DFREEBSD -I/usr/X11R6/include - SDL_CONFIG?=sdl11-config - LDFLAGS+=-L/usr/X11R6/lib - LIBS+=-lipx -lkvm -endif - -# -#here is GP2x (arm-gp2x-linux) -# -ifdef GP2X - PNG_CONFIG?=$(PREFIX)-libpng12-config -ifdef STATIC #need a better setting name - CFLAGS+=-I$(OPEN2X)/include -ifndef NOMIXER - LIBS+=-lvorbisidec -ifdef MIKMOD - LIBS+=-lmikmod -endif -ifdef SMPEGLIB - LIBS+=-lsmpeg - LD=$(CXX) -endif -endif - NONET=1 -endif -ifndef ARCHNAME -"error" -endif - NONX86=1 - NOHW=1 - NOHS=1 - NOMD5=1 - WFLAGS+=-O0 - OPTS+=-DGP2X -ffast-math -mcpu=arm920t - EXENAME?=SRB2GP2X.gpe -endif - -ifndef NOHW - OPTS+=-I/usr/X11R6/include - LDFLAGS+=-L/usr/X11R6/lib -endif - - # name of the exefile - EXENAME?=lsdl2srb2 diff --git a/src/sdl2/Makefile.cfg b/src/sdl2/Makefile.cfg deleted file mode 100644 index c729252b..00000000 --- a/src/sdl2/Makefile.cfg +++ /dev/null @@ -1,158 +0,0 @@ -# -# sdl/makefile.cfg for SRB2/SDL -# - -# -#SDL...., *looks at Alam*, THIS IS A MESS! -# - -ifdef UNIXCOMMON -include sdl2/MakeNIX.cfg -endif - -ifdef PANDORA -include sdl/SRB2Pandora/Makefile.cfg -endif #ifdef PANDORA - -ifdef DC -include sdl/SRB2DC/Makefile.cfg -endif #ifdef DC - -ifdef PS3N -include sdl/SRB2PS3/Makefile.cfg -endif #ifdef PS3N - -ifdef PSP -include sdl/SRB2PSP/Makefile.cfg -endif #ifdef PSP - -ifdef XBOX -include sdl/SRB2XBOX/Makefile.cfg -endif #ifdef XBOX - -ifdef WINCE -include sdl/SRB2CE/Makefile.cfg -endif #ifef WINCE - -ifdef CYGWIN32 -include sdl2/MakeCYG.cfg -endif #ifdef CYGWIN32 - -ifdef SDL_PKGCONFIG -SDL_CFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --cflags) -SDL_LDFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --libs) -else -ifdef PREFIX - SDL_CONFIG?=$(PREFIX)-sdl2-config -else - SDL_CONFIG?=sdl2-config -endif - -ifdef STATIC - SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags) - SDL_LDFLAGS?=$(shell $(SDL_CONFIG) --static-libs) -else - SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags) - SDL_LDFLAGS?=$(shell $(SDL_CONFIG) --libs) -endif -endif - - - #use the x86 asm code -ifndef CYGWIN32 -ifndef NOASM - USEASM=1 -endif -endif - - OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/dosstr.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o - - OPTS+=-DDIRECTFULLSCREEN -DHAVE_SDL - -ifndef NOHW - OBJS+=$(OBJDIR)/r_opengl.o $(OBJDIR)/ogl_sdl.o -endif - -ifndef NOHS -ifdef OPENAL - OBJS+=$(OBJDIR)/s_openal.o - OPTS+=-DSTATIC3DS - STATICHS=1 -else -ifdef FMOD - OBJS+=$(OBJDIR)/s_fmod.o - OPTS+=-DSTATIC3DS - STATICHS=1 -else -ifdef MINGW -ifdef DS3D - OBJS+=$(OBJDIR)/s_ds3d.o - OPTS+=-DSTATIC3DS - STATICHS=1 -endif -endif -endif -endif -endif - -ifdef NOMIXER - i_sound_o=$(OBJDIR)/sdl_sound.o -else - i_sound_o=$(OBJDIR)/mixer_sound.o - OPTS+=-DHAVE_MIXER - SDL_LDFLAGS+=-lSDL2_mixer -endif - -ifdef SDL_TTF - OPTS+=-DHAVE_TTF - SDL_LDFLAGS+=-lSDL2_ttf -lfreetype -lz - OBJS+=$(OBJDIR)/i_ttf.o -endif - -ifdef SDL_IMAGE - OPTS+=-DHAVE_IMAGE - SDL_LDFLAGS+=-lSDL2_image -endif - -ifdef SDL_NET - OPTS+=-DHAVE_SDLNET - SDL_LDFLAGS+=-lSDL2_net -endif - -ifdef SDLMAIN - OPTS+=-DSDLMAIN -else -ifdef MINGW - SDL_CFLAGS+=-Umain - SDL_LDFLAGS+=-mconsole -endif -endif - -ifndef NOHW -ifdef OPENAL -ifdef MINGW - LIBS:=-lopenal32 $(LIBS) -else - LIBS:=-lopenal $(LIBS) -endif -else -ifdef MINGW -ifdef DS3D - LIBS:=-ldsound -luuid $(LIBS) -endif -endif -endif -endif - -# FIXME: DevkitPPC and ready-compiled SDL Wii require these things to be in a silly order -ifdef WII -include sdl/SRB2WII/Makefile.cfg -endif #ifdef WII - -CFLAGS+=$(SDL_CFLAGS) -LIBS:=$(SDL_LDFLAGS) $(LIBS) -ifndef WII -ifdef STATIC - LIBS+=$(shell $(SDL_CONFIG) --static-libs) -endif -endif diff --git a/src/sdl2/SDL_icon.xpm b/src/sdl2/SDL_icon.xpm deleted file mode 100644 index 70bb02d3..00000000 --- a/src/sdl2/SDL_icon.xpm +++ /dev/null @@ -1,80 +0,0 @@ -/* XPM */ -static const char * SDL_icon_xpm[] = { -"32 32 45 1", -" c None", -". c #6B6BFF", -"+ c #3D00B9", -"@ c #4848FF", -"# c #2525FF", -"$ c #310096", -"% c #003196", -"& c #003DB9", -"* c #620096", -"= c #6E6E6E", -"- c #966200", -"; c #250073", -"> c #626262", -", c #FF8F6B", -"' c #FFC66B", -") c #FFAB8E", -"! c #000080", -"~ c #B6B6B6", -"{ c #929292", -"] c #FFD48E", -"^ c #0000B9", -"/ c #565656", -"( c #868686", -"_ c #808080", -": c #C0C0C0", -"< c #DADADA", -"[ c #F2F2F2", -"} c #FFFFFF", -"| c #CECECE", -"1 c #AAAAAA", -"2 c #E6E6E6", -"3 c #000096", -"4 c #AB8EFF", -"5 c #190050", -"6 c #000000", -"7 c #8E8EFF", -"8 c #3E3E3E", -"9 c #7A7A7A", -"0 c #0E0E0E", -"a c #9E9E9E", -"b c #001950", -"c c #C2C2C2", -"d c #323232", -"e c #002573", -"f c #A0A0A4", -" ", -" ", -" ", -" .+@##@. ", -" @@.@#######@ ", -" @@....######### ", -" .. .@.....@+##$%%%&&% ", -" ..@# @@....@+#*=-;%%%%% ", -" ..@#@......@>,')!%%%$ ", -" ~..$#.........{])^#+%/ ", -" +##@.........()^@@@@@_ ", -" $####@........#=#######+ ", -" +######....@@##^#########_ ", -" +#####=:<<:+##############/ ", -"[<=####{<}}}}|###############= ", -" }1###=2}}}}}}.############### ", -" }<3#3~}}}}}}}4################ ", -" }<5#6:}}}}}}}7################/", -" }:6861}}}}}}}.########$$ 9 .@$", -" }:0a6~}}}}}}}@######5b ", -"22cd262}}}}}}2######5b$ ", -" 2>1a}}}}}}}{(*###%be## ", -" 860)1<[22c1)]]+##be### ", -" ~)]]]))))]]]]]=#bb#### ", -" )]]]]]]]]](]]=eb$#### ", -" :]]]]]]]]]'9bbb$##### ", -" ),'''''( >db+### ", -" =##f ", -" { ", -" ", -" ", -" "}; diff --git a/src/sdl2/SDL_main/SDL_dummy_main.c b/src/sdl2/SDL_main/SDL_dummy_main.c deleted file mode 100644 index d8cfdd5b..00000000 --- a/src/sdl2/SDL_main/SDL_dummy_main.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Include the SDL main definition header */ -#include "SDL_main.h" - -#ifdef main -#undef main -int main(int argc, char *argv[]) -{ - return(SDL_main(argc, argv)); -} -#else -/* Nothing to do on this platform */; -#endif diff --git a/src/sdl2/SDL_main/SDL_macosx_main.h b/src/sdl2/SDL_main/SDL_macosx_main.h deleted file mode 100644 index 4683df57..00000000 --- a/src/sdl2/SDL_main/SDL_macosx_main.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#import - -@interface SDLMain : NSObject -@end diff --git a/src/sdl2/SDL_main/SDL_macosx_main.m b/src/sdl2/SDL_main/SDL_macosx_main.m deleted file mode 100644 index 226afe13..00000000 --- a/src/sdl2/SDL_main/SDL_macosx_main.m +++ /dev/null @@ -1,374 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#import "SDL.h" -#import "SDL_macosx_main.h" -#import /* for MAXPATHLEN */ -#import - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#if SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; - -static void addArgument(const char *value) -{ - if(!gArgc) - gArgv = (char **)malloc(sizeof(*gArgv)); - else - { - char **newgArgv = (char **)realloc(gArgv, sizeof(*gArgv) * (gArgc + 1)); - if (!newgArgv) - { - newgArgv = malloc(sizeof(*gArgv) * (gArgc + 1)); - memcpy(newgArgv, gArgv, sizeof(*gArgv) * gArgc); - free(gArgv); - } - gArgv = newgArgv; - } - gArgc++; - gArgv[gArgc - 1] = (char *)malloc(sizeof(char) * (strlen(value) + 1)); - strcpy(gArgv[gArgc - 1], value); -} - -static NSString *getApplicationName(void) -{ - NSDictionary *dict; - NSString *appName = NULL; - - /* Determine the application name */ - dict = ( NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - (void)sender; -#endif - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) - { - assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } - -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - (void)argc; - (void)argv; -#endif - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#if SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - (void)theApplication; -#endif - addArgument("-iwad"); - addArgument([filename UTF8String]); - return YES; -} - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ -#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - (void)note; -#endif - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - if (!getenv("SRB2WADDIR")) - setenv("SRB2WADDIR", [[[NSBundle mainBundle] resourcePath] UTF8String], 1); - - /* Hand off to main application code */ - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - size_t bufferSize; - size_t selfLen = [self length]; - size_t aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - - /* Copy the arguments into a global variable */ - - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgc = 1; - gFinderLaunch = YES; - } else { - gArgc = argc; - gFinderLaunch = NO; - } - gArgv = argv; - - /* Some additional arguments we always want to run with. */ - //addArgument("-opengl"); - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} diff --git a/src/sdl2/SDL_main/SDL_openxdk_main.c b/src/sdl2/SDL_main/SDL_openxdk_main.c deleted file mode 100644 index 63db8da2..00000000 --- a/src/sdl2/SDL_main/SDL_openxdk_main.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Include the SDL main definition header */ -#include "SDL_main.h" - -void XBoxStartup() -{ - SDL_main(0, NULL); /// \todo ? -} diff --git a/src/sdl2/SDL_main/SDL_win32_main.c b/src/sdl2/SDL_main/SDL_win32_main.c deleted file mode 100644 index 46b20d0b..00000000 --- a/src/sdl2/SDL_main/SDL_win32_main.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 - - The WinMain function -- calls your program's main() function -*/ - -#include -#include -#include -#include -#define RPC_NO_WINDOWS_H -#include -#include /* For _alloca() */ - -#include - -#ifdef _WIN32_WCE -# define DIR_SEPERATOR TEXT("\\") -# define _tgetcwd(str,len) wcscpy(str,TEXT("")) -# define setbuf(f,b) -# define setvbuf(w,x,y,z) -# define _tremove(x) DeleteFile(x) -#else -# define DIR_SEPERATOR TEXT("/") -# include -#endif - -/* Include the SDL main definition header */ -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif -#include "SDL.h" -#include "SDL_main.h" -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif -#include "../../win32/win_dbg.h" -#define USE_MESSAGEBOX - -#ifdef main -# ifndef _WIN32_WCE_EMULATION -# undef main -# endif /* _WIN32_WCE_EMULATION */ -#endif /* main */ - -/* The standard output files */ -//#ifdef _WIN32_WCE -//#define STDOUT_FILE TEXT("/Storage Card/SRB2DEMO/stdout.txt") -//#define STDERR_FILE TEXT("/Storage Card/SRB2DEMO/stderr.txt") -//#else -#define STDOUT_FILE TEXT("stdout.txt") -#define STDERR_FILE TEXT("stderr.txt") -//#endif - -#ifndef NO_STDIO_REDIRECT - static TCHAR stdoutPath[MAX_PATH]; - static TCHAR stderrPath[MAX_PATH]; -#endif - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 -/* seems to be undefined in Win CE although in online help */ -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) - -/* seems to be undefined in Win CE although in online help */ -char *strrchr(char *str, int c) -{ - char *p; - - /* Skip to the end of the string */ - p=str; - while (*p) - p++; - - /* Look for the given character */ - while ( (p >= str) && (*p != (CHAR)c) ) - p--; - - /* Return NULL if character not found */ - if ( p < str ) { - p = NULL; - } - return p; -} -#endif /* _WIN32_WCE < 300 */ - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) -{ - char *bufp; - int argc; - - argc = 0; - for ( bufp = cmdline; *bufp; ) { - /* Skip leading whitespace */ - while ( isspace(*bufp) ) { - ++bufp; - } - /* Skip over argument */ - if ( *bufp == '"' ) { - ++bufp; - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && (*bufp != '"') ) { - ++bufp; - } - } else { - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ! isspace(*bufp) ) { - ++bufp; - } - } - if ( *bufp ) { - if ( argv ) { - *bufp = '\0'; - } - ++bufp; - } - } - if ( argv ) { - argv[argc] = NULL; - } - return(argc); -} - -/* Show an error message */ -static void ShowError(const char *title, const char *message) -{ -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ -#ifdef USE_MESSAGEBOX - MessageBoxA(NULL, - message, - title, - MB_ICONEXCLAMATION|MB_OK); -#else - fprintf(stderr, "%s: %s\n", title, message); -#endif -} - -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) -{ - ShowError("Fatal Error", "Out of memory - aborting"); - return FALSE; -} - -/* Remove the output files if there was no output written */ -static void __cdecl cleanup_output(void) -{ -#ifndef NO_STDIO_REDIRECT - FILE *file; - int empty; -#endif - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - -#ifndef NO_STDIO_REDIRECT - /* See if the files have any output in them */ - if ( stdoutPath[0] ) { - file = _tfopen(stdoutPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - _tremove(stdoutPath); - } - } - } - if ( stderrPath[0] ) { - file = _tfopen(stderrPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - _tremove(stderrPath); - } - } - } -#endif -} - -#if defined(_MSC_VER) && !defined(_WIN32_WCE) -/* The VC++ compiler needs main defined */ -#define console_main main -#endif - -/* This is where execution begins [console apps] */ -int console_main(int argc, char *argv[]) -{ - size_t n; - int st; - char *bufp, *appname; - - /* Get the class name from argv[0] */ - appname = argv[0]; - if ( (bufp=strrchr(argv[0], '\\')) != NULL ) { - appname = bufp+1; - } else - if ( (bufp=strrchr(argv[0], '/')) != NULL ) { - appname = bufp+1; - } - - if ( (bufp=strrchr(appname, '.')) == NULL ) - n = strlen(appname); - else - n = (bufp-appname); - - bufp = (char *)alloca(n+1); - if ( bufp == NULL ) { - return OutOfMemory(); - } - strncpy(bufp, appname, n); - bufp[n] = '\0'; - appname = bufp; - - /* Load SDL dynamic link library */ - if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) { - ShowError("WinMain() error", SDL_GetError()); - return(FALSE); - } - atexit(cleanup_output); - atexit(SDL_Quit); - -#ifndef DISABLE_VIDEO -#if 0 - /* Create and register our class * - DJM: If we do this here, the user nevers gets a chance to - putenv(SDL_WINDOWID). This is already called later by - the (DIB|DX5)_CreateWindow function, so it should be - safe to comment it out here. - if ( SDL_RegisterApp(appname, CS_BYTEALIGNCLIENT, - GetModuleHandle(NULL)) < 0 ) { - ShowError("WinMain() error", SDL_GetError()); - exit(1); - }*/ -#else - /* Sam: - We still need to pass in the application handle so that - DirectInput will initialize properly when SDL_RegisterApp() - is called later in the video initialization. - */ - SDL_SetModuleHandle(GetModuleHandle(NULL)); -#endif /* 0 */ -#endif /* !DISABLE_VIDEO */ - - /* Run the application main() code */ - st = SDL_main(argc, argv); - - /* Exit cleanly, calling atexit() functions */ - //exit(0); - cleanup_output(); - SDL_Quit(); - - /* Hush little compiler, don't you cry... */ - return st; -} - -/* This is where execution begins [windowed apps] */ -#ifdef _WIN32_WCE -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) -#else -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) -#endif -{ - HINSTANCE handle; - int Result = -1; - char **argv; - int argc; - LPSTR cmdline; -#ifdef _WIN32_WCE - size_t nLen; - LPTSTR bufp; -#else - LPSTR bufp; -#endif -#ifndef NO_STDIO_REDIRECT - FILE *newfp; -#endif - - /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't - keep them open. This is a hack.. hopefully it will be fixed - someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded. - */ - hPrev = hInst = NULL; - sw = 0; - handle = LoadLibrary(TEXT("DDRAW.DLL")); - if ( handle != NULL ) { - FreeLibrary(handle); - } - -#ifndef NO_STDIO_REDIRECT - _tgetcwd( stdoutPath, sizeof( stdoutPath ) ); - _tcscat( stdoutPath, DIR_SEPERATOR STDOUT_FILE ); - - /* Redirect standard input and standard output */ - newfp = _tfreopen(stdoutPath, TEXT("w"), stdout); - -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stdout) - stdout = _tfopen(stdoutPath, TEXT("w")); -#else - newfp = _tfopen(stdoutPath, TEXT("w")); - if ( newfp ) { - *stdout = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - - _tgetcwd( stderrPath, sizeof( stderrPath ) ); - _tcscat( stderrPath, DIR_SEPERATOR STDERR_FILE ); - - newfp = _tfreopen(stderrPath, TEXT("w"), stderr); -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stderr) - stderr = _tfopen(stderrPath, TEXT("w")); -#else - newfp = _tfopen(stderrPath, TEXT("w")); - if ( newfp ) { - *stderr = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - - setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */ - setbuf(stderr, NULL); /* No buffering */ -#endif /* !NO_STDIO_REDIRECT */ - -#ifdef _WIN32_WCE - nLen = wcslen(szCmdLine)+128+1; - bufp = (wchar_t *)alloca(nLen*2); - wcscpy (bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp+1, 128-3); - wcscpy (bufp+wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); - nLen = wcslen(bufp)+1; - cmdline = (char *)alloca(nLen); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); -#else - szCmdLine = NULL; - /* Grab the command line (use alloca() on Windows) */ - bufp = GetCommandLineA(); - cmdline = (LPSTR)alloca(strlen(bufp)+1); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - strcpy(cmdline, bufp); -#endif - - /* Parse it into argv and argc */ - argc = ParseCommandLine(cmdline, NULL); - argv = (char **)alloca((argc+1)*(sizeof *argv)); - if ( argv == NULL ) { - return OutOfMemory(); - } - ParseCommandLine(cmdline, argv); - -#ifdef BUGTRAP - /* Try BugTrap. */ - if(InitBugTrap()) - Result = console_main(argc, argv); - else - { -#endif - - /* Run the main program (after a little SDL initialization) */ -#ifndef _WIN32_WCE - __try -#endif - { - Result = console_main(argc, argv); - } -#ifndef _WIN32_WCE - __except ( RecordExceptionInfo(GetExceptionInformation())) - { - SetUnhandledExceptionFilter(EXCEPTION_CONTINUE_SEARCH); //Do nothing here. - } -#endif - -#ifdef BUGTRAP - } /* BT failure clause. */ - - /* This is safe even if BT didn't start. */ - ShutdownBugTrap(); -#endif - - return Result; -} diff --git a/src/sdl2/SRB2Pandora/Makefile.cfg b/src/sdl2/SRB2Pandora/Makefile.cfg deleted file mode 100644 index c7f0f844..00000000 --- a/src/sdl2/SRB2Pandora/Makefile.cfg +++ /dev/null @@ -1,39 +0,0 @@ -# Quick Pandora target to make a compliant SRB2 PND file. - -PNDNAME=SRB2.pnd -PNDDIR=$(BIN)/pnd -ICON=sdl/SRB2Pandora/icon.png -PXML=sdl/SRB2Pandora/PXML.xml - -SED=sed -CAT=cat -CP=cp -XARGS=xargs -FOR=for -WGET=wget -P $(PNDDIR) -c -nc - -SHXARGS:=$(XARGS) -SHSED:=$(SED) - -ifndef ECHO - CP:=@$(CP) - CAT:=@$(CAT) - SED:=@$(SED) - XARGS:=@$(XARGS) - FOR:=@(FOR) -endif - -$(BIN)/$(PNDNAME): $(BIN)/$(EXENAME) - @echo Linking $(PNDNAME)... - $(MKDIR) $(PNDDIR) - $(CP) $(BIN)/$(EXENAME) $(PNDDIR) - $(CP) $(ICON) $(PNDDIR) - $(CP) $(PXML) $(PNDDIR) -ifdef WITHDATA - $(FOR) datafile in $(shell echo $(D_FILES) | $(SHSED) 's/\.srb/\.wad/' | $(SHXARGS) -n 1 basename); do \ - $(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$datafile; \ - done -endif - $(MKISOFS) -l -r -o $@ $(PNDDIR) - $(CAT) $(PXML) >> $@ - $(REMOVE) -r $(PNDDIR) diff --git a/src/sdl2/SRB2Pandora/PXML.xml b/src/sdl2/SRB2Pandora/PXML.xml deleted file mode 100644 index 33a9587d..00000000 --- a/src/sdl2/SRB2Pandora/PXML.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Sonic Robo Blast 2 - ソニック・ロボ・ブラスト・2 - A 3D Sonic fangame with a huge fanbase developing custom content, including characters, levels, and even large-scale modifications - - - - - - - - - - - diff --git a/src/sdl2/SRB2Pandora/icon.png b/src/sdl2/SRB2Pandora/icon.png deleted file mode 100644 index 63af73ac..00000000 Binary files a/src/sdl2/SRB2Pandora/icon.png and /dev/null differ diff --git a/src/sdl2/Srb2SDL-vc10.vcxproj b/src/sdl2/Srb2SDL-vc10.vcxproj deleted file mode 100644 index 958cd7d0..00000000 --- a/src/sdl2/Srb2SDL-vc10.vcxproj +++ /dev/null @@ -1,1464 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Srb2SDL - {61BA7D3C-F77D-4D31-B718-1177FE482CF2} - Srb2SDL - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\..\..\bin\VC10\$(Platform)\$(Configuration)\ - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\ - true - .\..\..\bin\VC10\$(Platform)\$(Configuration)\ - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\ - true - .\..\..\bin\VC10\$(Platform)\$(Configuration)\ - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\ - false - .\..\..\bin\VC10\$(Platform)\$(Configuration)\ - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\ - false - $(SDL12_PREFIX)\include;$(SDL12_MIXER_PREFIX)\include;$(FMOD3_PREFIX)api\inc;$(IncludePath) - $(SDL12_PREFIX)\include;$(SDL12_MIXER_PREFIX)\include;$(FMOD3_PREFIX)api\inc;$(IncludePath) - $(SDL12_PREFIX)\include;$(SDL12_MIXER_PREFIX)\include;$(FMOD3_PREFIX)api\inc;$(IncludePath) - $(SDL12_PREFIX)\include;$(SDL12_MIXER_PREFIX)\include;$(FMOD3_PREFIX)api\inc;$(IncludePath) - $(SDL12_PREFIX)\lib;$(SDL12_MIXER_PREFIX)\lib;$(LibraryPath) - $(SDL12_PREFIX)\lib;$(SDL12_MIXER_PREFIX)\lib;$(LibraryPath) - $(SDL12_PREFIX)\lib\x64;$(SDL12_MIXER_PREFIX)\lib\x64;$(LibraryPath) - $(SDL12_PREFIX)\lib\x64;$(SDL12_MIXER_PREFIX)\lib\x64;$(LibraryPath) - - - - Getting revision number from the SCM system - "$(ProjectDir)..\..\comptime.bat" "$(ProjectDir).." - - - .\..\..\bin\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.tlb - - - - - Disabled - $(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories) - _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - $(IntDir) - $(IntDir)Srb2SDL.pdb - true - Level4 - true - true - EditAndContinue - CompileAsC - 4121;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;SDL_mixer.lib;ws2_32.lib;%(AdditionalDependencies) - $(OutDir)srb2sdl.exe - true - true - $(OutDir)srb2sdl.pdb - Console - false - - - MachineX86 - - - true - $(OutDir)Srb2sdl.bsc - - - - - Getting revision number from the SCM system - "$(ProjectDir)..\..\comptime.bat" "$(ProjectDir).." - - - X64 - .\..\..\bin\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.tlb - - - - - Disabled - $(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories) - _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - $(IntDir) - $(IntDir)Srb2SDL.pdb - true - Level4 - true - true - ProgramDatabase - CompileAsC - 4121;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;SDL_mixer.lib;ws2_32.lib;%(AdditionalDependencies) - $(OutDir)srb2sdl.exe - true - true - $(OutDir)srb2sdl.pdb - Console - false - - - MachineX64 - - - true - $(OutDir)Srb2sdl.bsc - - - - - Getting revision number from the SCM system - "$(ProjectDir)..\..\comptime.bat" "$(ProjectDir).." - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\bin\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.tlb - - - - - /MP %(AdditionalOptions) - Disabled - OnlyExplicitInline - true - Speed - true - $(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories) - NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreaded - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch - $(IntDir) - $(IntDir)Srb2SDL.pdb - true - Level3 - true - ProgramDatabase - CompileAsC - 4121;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;SDL_mixer.lib;ws2_32.lib;%(AdditionalDependencies) - $(OutDir)srb2sdl.exe - true - true - $(OutDir)srb2sdl.pdb - Windows - false - - - MachineX86 - - - true - $(OutDir)Srb2sdl.bsc - - - - - Getting revision number from the SCM system - "$(ProjectDir)..\..\comptime.bat" "$(ProjectDir).." - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\..\..\bin\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.tlb - - - - - /MP %(AdditionalOptions) - Disabled - OnlyExplicitInline - true - Speed - true - $(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories) - NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreaded - .\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch - $(IntDir) - $(IntDir)Srb2SDL.pdb - true - Level3 - true - ProgramDatabase - CompileAsC - 4121;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - SDL.lib;SDL_mixer.lib;ws2_32.lib;%(AdditionalDependencies) - $(OutDir)srb2sdl.exe - true - true - $(OutDir)srb2sdl.pdb - Windows - false - - - MachineX64 - - - true - $(OutDir)Srb2sdl.bsc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - - - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - - - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - true - Compiling %(Filename).nas with NASM... - nasm -g -o $(IntDir)%(Filename).obj -f win32 "%(FullPath)" - $(IntDir)%(Filename).obj;%(Outputs) - - - - - - - - - - %(PreprocessorDefinitions) - \Users\alam\svn\srb2mods\SRB2\branches\ALAM\src\win32;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \Users\alam\svn\srb2mods\SRB2\branches\ALAM\src\win32;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \Users\alam\svn\srb2mods\SRB2\branches\ALAM\src\win32;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \Users\alam\svn\srb2mods\SRB2\branches\ALAM\src\win32;%(AdditionalIncludeDirectories) - - - - - {72b01aca-7a1a-4f7b-acef-2607299cf052} - false - - - {73a5729c-7323-41d4-ab48-8a03c9f81603} - false - - - - - - diff --git a/src/sdl2/Srb2SDL-vc9.vcproj b/src/sdl2/Srb2SDL-vc9.vcproj deleted file mode 100644 index d2a268f8..00000000 --- a/src/sdl2/Srb2SDL-vc9.vcproj +++ /dev/null @@ -1,5845 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/sdl2/Srb2SDL.dsp b/src/sdl2/Srb2SDL.dsp deleted file mode 100644 index 879113ca..00000000 --- a/src/sdl2/Srb2SDL.dsp +++ /dev/null @@ -1,1057 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Srb2SDL" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=Srb2SDL - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "Srb2SDL.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Srb2SDL.mak" CFG="Srb2SDL - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Srb2SDL - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "Srb2SDL - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Srb2SDL - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\bin\VC\Release\SDL" -# PROP Intermediate_Dir "..\..\objs\VC\Release\SDL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G5 /W3 /GX /Zi /Ot /Og /Oi /Op /Oy /Ob1 /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "NDEBUG" /D "SDLMAIN" /D "NO_STDIO_REDIRECT" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "HAVE_SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GF /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -# SUBTRACT RSC /x -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo /o"..\..\objs\SDL\Release\SRB2.bsc" -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 SDL.lib SDL_mixer.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:windows /pdb:"C:\srb2demo2\srb2sdl.pdb" /debug /machine:I386 /out:"C:\srb2demo2\srb2sdl.exe" -# SUBTRACT LINK32 /profile /pdb:none /incremental:yes - -!ELSEIF "$(CFG)" == "Srb2SDL - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\bin\VC\Debug\SDL" -# PROP Intermediate_Dir "..\..\objs\VC\Debug\SDL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /W4 /WX /Gm /GX /ZI /Od /Op /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "_DEBUG" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "HAVE_SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -# SUBTRACT RSC /x -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo /o"..\..\objs\SDL\Debug\SRB2.bsc" -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 SDL.lib SDL_mixer.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /pdb:"C:\srb2demo2\srb2sdldebug.pdb" /debug /machine:I386 /out:"C:\srb2demo2\srb2sdldebug.exe" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "Srb2SDL - Win32 Release" -# Name "Srb2SDL - Win32 Debug" -# Begin Group "SDLapp" - -# PROP Default_Filter "" -# Begin Group "filter" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\filter\filters.c -# End Source File -# Begin Source File - -SOURCE=.\filter\filters.h -# End Source File -# Begin Source File - -SOURCE=.\filter\hq2x.c -# End Source File -# Begin Source File - -SOURCE=.\filter\hq2x.h -# End Source File -# Begin Source File - -SOURCE=.\filter\interp.h -# End Source File -# Begin Source File - -SOURCE=.\filter\lq2x.c -# End Source File -# Begin Source File - -SOURCE=.\filter\lq2x.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\dosstr.c -# End Source File -# Begin Source File - -SOURCE=.\endtxt.c -# End Source File -# Begin Source File - -SOURCE=.\endtxt.h -# End Source File -# Begin Source File - -SOURCE=..\filesrch.c -# End Source File -# Begin Source File - -SOURCE=..\filesrch.h -# End Source File -# Begin Source File - -SOURCE=.\hwsym_sdl.c -# End Source File -# Begin Source File - -SOURCE=.\hwsym_sdl.h -# End Source File -# Begin Source File - -SOURCE=.\i_cdmus.c -# End Source File -# Begin Source File - -SOURCE=.\i_main.c -# End Source File -# Begin Source File - -SOURCE=.\i_net.c -# End Source File -# Begin Source File - -SOURCE=.\i_sound.c -# End Source File -# Begin Source File - -SOURCE=.\i_system.c -# End Source File -# Begin Source File - -SOURCE=.\i_video.c -# End Source File -# Begin Source File - -SOURCE=.\IMG_xpm.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\ogl_sdl.c -# End Source File -# Begin Source File - -SOURCE=.\ogl_sdl.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\r_opengl\r_opengl.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\r_opengl\r_opengl.h -# End Source File -# Begin Source File - -SOURCE=.\SDL_icon.xpm -# End Source File -# Begin Source File - -SOURCE=.\SDL_main\SDL_win32_main.c - -!IF "$(CFG)" == "Srb2SDL - Win32 Release" - -!ELSEIF "$(CFG)" == "Srb2SDL - Win32 Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\sdlmain.h -# End Source File -# Begin Source File - -SOURCE=..\win32\Srb2win.rc -# End Source File -# Begin Source File - -SOURCE=..\win32\win_dbg.c -# End Source File -# Begin Source File - -SOURCE=..\win32\win_dbg.h -# End Source File -# Begin Source File - -SOURCE=..\win32\win_main.h -# End Source File -# End Group -# Begin Group "A_Asm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\p5prof.h -# End Source File -# Begin Source File - -SOURCE=..\tmap.nas - -!IF "$(CFG)" == "Srb2SDL - Win32 Release" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Compiling $(InputName).nas with NASM... -IntDir=.\..\..\objs\VC\Release\SDL -InputPath=..\tmap.nas -InputName=tmap - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "Srb2SDL - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Compiling $(InputName).nas with NASM... -IntDir=.\..\..\objs\VC\Debug\SDL -InputPath=..\tmap.nas -InputName=tmap - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\tmap_mmx.nas - -!IF "$(CFG)" == "Srb2SDL - Win32 Release" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Compiling $(InputName).nas with NASM... -IntDir=.\..\..\objs\VC\Release\SDL -InputPath=..\tmap_mmx.nas -InputName=tmap_mmx - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "Srb2SDL - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Compiling $(InputName).nas with NASM... - -IntDir=.\..\..\objs\VC\Debug\SDL -InputPath=..\tmap_mmx.nas -InputName=tmap_mmx - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\tmap_vc.nas - -!IF "$(CFG)" == "Srb2SDL - Win32 Release" - -# Begin Custom Build - Compiling $(InputName).nas with NASM... -IntDir=.\..\..\objs\VC\Release\SDL -InputPath=..\tmap_vc.nas -InputName=tmap_vc - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ELSEIF "$(CFG)" == "Srb2SDL - Win32 Debug" - -# Begin Custom Build - Compiling $(InputName).nas with NASM... -IntDir=.\..\..\objs\VC\Debug\SDL -InputPath=..\tmap_vc.nas -InputName=tmap_vc - -"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasm -g -o $(IntDir)/$(InputName).obj -f win32 $(InputPath) - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "D_Doom" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\comptime.c -# End Source File -# Begin Source File - -SOURCE=..\d_clisrv.c -# End Source File -# Begin Source File - -SOURCE=..\d_clisrv.h -# End Source File -# Begin Source File - -SOURCE=..\d_event.h -# End Source File -# Begin Source File - -SOURCE=..\d_main.c -# End Source File -# Begin Source File - -SOURCE=..\d_main.h -# End Source File -# Begin Source File - -SOURCE=..\d_net.c -# End Source File -# Begin Source File - -SOURCE=..\d_net.h -# End Source File -# Begin Source File - -SOURCE=..\d_netcmd.c -# End Source File -# Begin Source File - -SOURCE=..\d_netcmd.h -# End Source File -# Begin Source File - -SOURCE=..\d_netfil.c -# End Source File -# Begin Source File - -SOURCE=..\d_netfil.h -# End Source File -# Begin Source File - -SOURCE=..\d_player.h -# End Source File -# Begin Source File - -SOURCE=..\d_think.h -# End Source File -# Begin Source File - -SOURCE=..\d_ticcmd.h -# End Source File -# Begin Source File - -SOURCE=..\dehacked.c -# End Source File -# Begin Source File - -SOURCE=..\dehacked.h -# End Source File -# Begin Source File - -SOURCE=..\doomdata.h -# End Source File -# Begin Source File - -SOURCE=..\doomdef.h -# End Source File -# Begin Source File - -SOURCE=..\doomstat.h -# End Source File -# Begin Source File - -SOURCE=..\doomtype.h -# End Source File -# Begin Source File - -SOURCE=..\z_zone.c -# End Source File -# Begin Source File - -SOURCE=..\z_zone.h -# End Source File -# End Group -# Begin Group "F_Frame" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\f_finale.c -# End Source File -# Begin Source File - -SOURCE=..\f_finale.h -# End Source File -# Begin Source File - -SOURCE=..\f_wipe.c -# End Source File -# End Group -# Begin Group "G_Game" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\g_game.c -# End Source File -# Begin Source File - -SOURCE=..\g_game.h -# End Source File -# Begin Source File - -SOURCE=..\g_input.c -# End Source File -# Begin Source File - -SOURCE=..\g_input.h -# End Source File -# Begin Source File - -SOURCE=..\g_state.h -# End Source File -# End Group -# Begin Group "H_Hud" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\am_map.c -# End Source File -# Begin Source File - -SOURCE=..\am_map.h -# End Source File -# Begin Source File - -SOURCE=..\command.c -# End Source File -# Begin Source File - -SOURCE=..\command.h -# End Source File -# Begin Source File - -SOURCE=..\console.c -# End Source File -# Begin Source File - -SOURCE=..\console.h -# End Source File -# Begin Source File - -SOURCE=..\hu_stuff.c -# End Source File -# Begin Source File - -SOURCE=..\hu_stuff.h -# End Source File -# Begin Source File - -SOURCE=..\st_stuff.c -# End Source File -# Begin Source File - -SOURCE=..\st_stuff.h -# End Source File -# Begin Source File - -SOURCE=..\y_inter.c -# End Source File -# Begin Source File - -SOURCE=..\y_inter.h -# End Source File -# End Group -# Begin Group "Hw_Hardware" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\hardware\hw3dsdrv.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw3sound.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw3sound.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_bsp.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_cache.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_data.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_defs.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_dll.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_draw.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_drv.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_glide.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_glob.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_light.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_light.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_main.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_main.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_md2.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_md2.h -# End Source File -# Begin Source File - -SOURCE=..\hardware\hw_trick.c -# End Source File -# Begin Source File - -SOURCE=..\hardware\hws_data.h -# End Source File -# End Group -# Begin Group "I_Interface" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\byteptr.h -# End Source File -# Begin Source File - -SOURCE=..\i_joy.h -# End Source File -# Begin Source File - -SOURCE=..\i_net.h -# End Source File -# Begin Source File - -SOURCE=..\i_sound.h -# End Source File -# Begin Source File - -SOURCE=..\i_system.h -# End Source File -# Begin Source File - -SOURCE=..\i_tcp.c -# End Source File -# Begin Source File - -SOURCE=..\i_tcp.h -# End Source File -# Begin Source File - -SOURCE=..\i_video.h -# End Source File -# Begin Source File - -SOURCE=..\keys.h -# End Source File -# Begin Source File - -SOURCE=..\mserv.c -# End Source File -# Begin Source File - -SOURCE=..\mserv.h -# End Source File -# End Group -# Begin Group "M_Misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\m_argv.c -# End Source File -# Begin Source File - -SOURCE=..\m_argv.h -# End Source File -# Begin Source File - -SOURCE=..\m_bbox.c -# End Source File -# Begin Source File - -SOURCE=..\m_bbox.h -# End Source File -# Begin Source File - -SOURCE=..\m_cheat.c -# End Source File -# Begin Source File - -SOURCE=..\m_cheat.h -# End Source File -# Begin Source File - -SOURCE=..\m_dllist.h -# End Source File -# Begin Source File - -SOURCE=..\m_fixed.c -# End Source File -# Begin Source File - -SOURCE=..\m_fixed.h -# End Source File -# Begin Source File - -SOURCE=..\m_menu.c -# End Source File -# Begin Source File - -SOURCE=..\m_menu.h -# End Source File -# Begin Source File - -SOURCE=..\m_misc.c -# End Source File -# Begin Source File - -SOURCE=..\m_misc.h -# End Source File -# Begin Source File - -SOURCE=..\m_queue.c -# End Source File -# Begin Source File - -SOURCE=..\m_queue.h -# End Source File -# Begin Source File - -SOURCE=..\m_random.c -# End Source File -# Begin Source File - -SOURCE=..\m_random.h -# End Source File -# Begin Source File - -SOURCE=..\m_swap.h -# End Source File -# Begin Source File - -SOURCE=..\string.c -# End Source File -# End Group -# Begin Group "P_Play" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\info.c -# End Source File -# Begin Source File - -SOURCE=..\info.h -# End Source File -# Begin Source File - -SOURCE=..\p_ceilng.c -# End Source File -# Begin Source File - -SOURCE=..\p_enemy.c -# End Source File -# Begin Source File - -SOURCE=..\p_fab.c -# End Source File -# Begin Source File - -SOURCE=..\p_floor.c -# End Source File -# Begin Source File - -SOURCE=..\p_inter.c -# End Source File -# Begin Source File - -SOURCE=..\p_lights.c -# End Source File -# Begin Source File - -SOURCE=..\p_local.h -# End Source File -# Begin Source File - -SOURCE=..\p_map.c -# End Source File -# Begin Source File - -SOURCE=..\p_maputl.c -# End Source File -# Begin Source File - -SOURCE=..\p_maputl.h -# End Source File -# Begin Source File - -SOURCE=..\p_mobj.c -# End Source File -# Begin Source File - -SOURCE=..\p_mobj.h -# End Source File -# Begin Source File - -SOURCE=..\p_polyobj.c -# End Source File -# Begin Source File - -SOURCE=..\p_polyobj.h -# End Source File -# Begin Source File - -SOURCE=..\p_pspr.h -# End Source File -# Begin Source File - -SOURCE=..\p_saveg.c -# End Source File -# Begin Source File - -SOURCE=..\p_saveg.h -# End Source File -# Begin Source File - -SOURCE=..\p_setup.c -# End Source File -# Begin Source File - -SOURCE=..\p_setup.h -# End Source File -# Begin Source File - -SOURCE=..\p_sight.c -# End Source File -# Begin Source File - -SOURCE=..\p_spec.c -# End Source File -# Begin Source File - -SOURCE=..\p_spec.h -# End Source File -# Begin Source File - -SOURCE=..\p_telept.c -# End Source File -# Begin Source File - -SOURCE=..\p_tick.c -# End Source File -# Begin Source File - -SOURCE=..\p_tick.h -# End Source File -# Begin Source File - -SOURCE=..\p_user.c -# End Source File -# Begin Source File - -SOURCE=..\tables.c -# End Source File -# Begin Source File - -SOURCE=..\tables.h -# End Source File -# End Group -# Begin Group "R_Rend" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\r_bsp.c -# End Source File -# Begin Source File - -SOURCE=..\r_bsp.h -# End Source File -# Begin Source File - -SOURCE=..\r_data.c -# End Source File -# Begin Source File - -SOURCE=..\r_data.h -# End Source File -# Begin Source File - -SOURCE=..\r_defs.h -# End Source File -# Begin Source File - -SOURCE=..\r_draw.c -# End Source File -# Begin Source File - -SOURCE=..\r_draw.h -# End Source File -# Begin Source File - -SOURCE=..\r_draw16.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=..\r_draw8.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=..\r_local.h -# End Source File -# Begin Source File - -SOURCE=..\r_main.c -# End Source File -# Begin Source File - -SOURCE=..\r_main.h -# End Source File -# Begin Source File - -SOURCE=..\r_plane.c -# End Source File -# Begin Source File - -SOURCE=..\r_plane.h -# End Source File -# Begin Source File - -SOURCE=..\r_segs.c -# End Source File -# Begin Source File - -SOURCE=..\r_segs.h -# End Source File -# Begin Source File - -SOURCE=..\r_sky.c -# End Source File -# Begin Source File - -SOURCE=..\r_sky.h -# End Source File -# Begin Source File - -SOURCE=..\r_splats.c -# End Source File -# Begin Source File - -SOURCE=..\r_splats.h -# End Source File -# Begin Source File - -SOURCE=..\r_state.h -# End Source File -# Begin Source File - -SOURCE=..\r_things.c -# End Source File -# Begin Source File - -SOURCE=..\r_things.h -# End Source File -# Begin Source File - -SOURCE=..\screen.c -# End Source File -# Begin Source File - -SOURCE=..\screen.h -# End Source File -# Begin Source File - -SOURCE=..\v_video.c -# End Source File -# Begin Source File - -SOURCE=..\v_video.h -# End Source File -# End Group -# Begin Group "S_Sounds" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\s_sound.c -# End Source File -# Begin Source File - -SOURCE=..\s_sound.h -# End Source File -# Begin Source File - -SOURCE=..\sounds.c -# End Source File -# Begin Source File - -SOURCE=..\sounds.h -# End Source File -# End Group -# Begin Group "W_Wad" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\lzf.c -# End Source File -# Begin Source File - -SOURCE=..\lzf.h -# End Source File -# Begin Source File - -SOURCE=..\md5.c -# End Source File -# Begin Source File - -SOURCE=..\md5.h -# End Source File -# Begin Source File - -SOURCE=..\w_wad.c -# End Source File -# Begin Source File - -SOURCE=..\w_wad.h -# End Source File -# End Group -# Begin Group "Docs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\doc\copying -# End Source File -# Begin Source File - -SOURCE=..\..\doc\faq.txt -# End Source File -# Begin Source File - -SOURCE=..\..\readme.txt -# End Source File -# Begin Source File - -SOURCE=..\..\doc\source.txt -# End Source File -# End Group -# Begin Source File - -SOURCE=..\win32\Srb2win.ico -# End Source File -# End Target -# End Project diff --git a/src/sdl2/Srb2SDL.dsw b/src/sdl2/Srb2SDL.dsw deleted file mode 100644 index 4f8f7bdc..00000000 --- a/src/sdl2/Srb2SDL.dsw +++ /dev/null @@ -1,74 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Srb2SDL"=.\Srb2SDL.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libpng - End Project Dependency - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "libpng"="..\..\libs\libpng-src\projects\visualc6\libpng.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "s_openal"=..\hardware\s_openal\s_openal.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "zlib"=..\..\libs\zlib\projects\visualc6\zlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/sdl2/Srb2SDL.ico b/src/sdl2/Srb2SDL.ico deleted file mode 100644 index 5ab791af..00000000 Binary files a/src/sdl2/Srb2SDL.ico and /dev/null differ diff --git a/src/sdl2/dosstr.c b/src/sdl2/dosstr.c deleted file mode 100644 index f9bbee9b..00000000 --- a/src/sdl2/dosstr.c +++ /dev/null @@ -1,38 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// This file is in the public domain. -// (Re)written by Graue in 2006. -// -//----------------------------------------------------------------------------- -/// \file -/// \brief String uppercasing/lowercasing functions for non-DOS non-Win32 -/// systems - -#include "../doomtype.h" - -#ifndef HAVE_DOSSTR_FUNCS - -#include - -int strupr(char *n) -{ - while (*n != '\0') - { - *n = toupper(*n); - n++; - } - return 1; -} - -int strlwr(char *n) -{ - while (*n != '\0') - { - *n = tolower(*n); - n++; - } - return 1; -} - -#endif diff --git a/src/sdl2/endtxt.c b/src/sdl2/endtxt.c deleted file mode 100644 index 1d7756b4..00000000 --- a/src/sdl2/endtxt.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Function to write the SRB2 end message text - * - * Copyright (C) 1998 by Udo Munk - * - * This code is provided AS IS and there are no guarantees, none. - * Feel free to share and modify. - */ -//----------------------------------------------------------------------------- -/// \file -/// \brief Support to show ENDOOM text -/// -/// Loads the lump ENDOOM, set up the console to print -/// out the colors and text - -#include -#include - -// need this 19990118 by Kin -#include "../doomdef.h" -#include "../w_wad.h" -#include "../z_zone.h" -#include "endtxt.h" -/** \brief The ShowEndTxt function - - - Prints out the ENDOOM the way DOOM.EXE/DOOM2.EXE did for Win32 or Linux/GNU - - \return void - - -*/ - -void ShowEndTxt(void) -{ -#if !(defined (_WIN32_WCE) || defined (_XBOX) || defined (_arch_dreamcast)) - INT32 i; - UINT16 j, att = 0; - INT32 nlflag = 1; -#ifdef _WIN32 - HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE); - DWORD mode, bytesWritten; - CONSOLE_SCREEN_BUFFER_INFO backupcon; - COORD resizewin = {80,-1}; - CHAR let = 0; -#endif - UINT16 *ptext; - void *data; - lumpnum_t endoomnum = W_GetNumForName("ENDOOM"); - //char *col; - - /* if the xterm has more then 80 columns we need to add nl's */ - /* doesn't work, COLUMNS is not in the environment at this time ??? - col = I_getenv("COLUMNS"); - if (col) { - if (atoi(col) > 80) - nlflag++; - } - */ - - /* get the lump with the text */ - data = ptext = W_CacheLumpNum(endoomnum, PU_CACHE); - -#ifdef _WIN32 - if (co == INVALID_HANDLE_VALUE || GetFileType(co) != FILE_TYPE_CHAR || !GetConsoleMode(co, &mode)) // test if it a good handle - { - Z_Free(data); - return; - } - - backupcon.wAttributes = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE; // Just in case - GetConsoleScreenBufferInfo(co, &backupcon); //Store old state - resizewin.Y = backupcon.dwSize.Y; - if (backupcon.dwSize.X < resizewin.X) - SetConsoleScreenBufferSize(co, resizewin); - - for (i=1; i<=80*25; i++) // print 80x25 text and deal with the attributes too - { - j = (UINT16)(*ptext >> 8); // attribute first - let = (char)(*ptext & 0xff); // text second - if (j != att) // attribute changed? - { - att = j; // save current attribute - SetConsoleTextAttribute(co, j); //set fg and bg color for buffer - } - - WriteConsoleA(co, &let, 1, &bytesWritten, NULL); // now the text - - if (nlflag && !(i % 80) && backupcon.dwSize.X > resizewin.X) // do we need a nl? - { - att = backupcon.wAttributes; - SetConsoleTextAttribute(co, att); // all attributes off - WriteConsoleA(co, "\n", 1, &bytesWritten, NULL); // newline to console - } - ptext++; - } - SetConsoleTextAttribute(co, backupcon.wAttributes); // all attributes off -#else - /* print 80x25 text and deal with the attributes too */ - for (i=1; i<=80*25; i++) { - /* attribute first */ - /* attribute changed? */ - if ((j = *ptext >> 8) != att) { - /* save current attribute */ - att = j; - /* set new attribute, forground color first */ - printf("\033["); - switch (j & 0x0f) { - case 0: /* black */ - printf("30"); - break; - case 1: /* blue */ - printf("34"); - break; - case 2: /* green */ - printf("32"); - break; - case 3: /* cyan */ - printf("36"); - break; - case 4: /* red */ - printf("31"); - break; - case 5: /* magenta */ - printf("35"); - break; - case 6: /* brown */ - printf("33"); - break; - case 7: /* bright grey */ - printf("37"); - break; - case 8: /* dark grey */ - printf("1;30"); - break; - case 9: /* bright blue */ - printf("1;34"); - break; - case 10: /* bright green */ - printf("1;32"); - break; - case 11: /* bright cyan */ - printf("1;36"); - break; - case 12: /* bright red */ - printf("1;31"); - break; - case 13: /* bright magenta */ - printf("1;35"); - break; - case 14: /* yellow */ - printf("1;33"); - break; - case 15: /* white */ - printf("1;37"); - break; - } - printf("m"); - /* now background color */ - printf("\033["); - switch ((j >> 4) & 0x0f) { - case 0: /* black */ - printf("40"); - break; - case 1: /* blue */ - printf("44"); - break; - case 2: /* green */ - printf("42"); - break; - case 3: /* cyan */ - printf("46"); - break; - case 4: /* red */ - printf("41"); - break; - case 5: /* magenta */ - printf("45"); - break; - case 6: /* brown */ - printf("43"); - break; - case 7: /* bright grey */ - printf("47"); - break; - case 8: /* dark grey */ - printf("1;40"); - break; - case 9: /* bright blue */ - printf("1;44"); - break; - case 10: /* bright green */ - printf("1;42"); - break; - case 11: /* bright cyan */ - printf("1;46"); - break; - case 12: /* bright red */ - printf("1;41"); - break; - case 13: /* bright magenta */ - printf("1;45"); - break; - case 14: /* yellow */ - printf("1;43"); - break; - case 15: /* white */ - printf("1;47"); - break; - } - printf("m"); - } - - /* now the text */ - printf("%c",*ptext++ & 0xff); - - /* do we need a nl? */ - if (nlflag) - { - if (!(i % 80)) - { - printf("\033[0m"); - att = 0; - printf("\n"); - } - } - } - /* all attributes off */ - printf("\033[0m"); -#endif - if (nlflag) - printf("\n"); - - Z_Free(data); -#endif -} diff --git a/src/sdl2/endtxt.h b/src/sdl2/endtxt.h deleted file mode 100644 index 41f8e51a..00000000 --- a/src/sdl2/endtxt.h +++ /dev/null @@ -1,24 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Support to show ENDOOM text - -#ifndef __ENDTXT__ -#define __ENDTXT__ - -void ShowEndTxt (void); - -#endif diff --git a/src/sdl2/hwsym_sdl.c b/src/sdl2/hwsym_sdl.c deleted file mode 100644 index 44ddf830..00000000 --- a/src/sdl2/hwsym_sdl.c +++ /dev/null @@ -1,183 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -/// \file -/// \brief Tool for dynamic referencing of hardware rendering functions -/// -/// Declaration and definition of the HW rendering -/// functions do have the same name. Originally, the -/// implementation was stored in a separate library. -/// For SDL, we need some function to return the addresses, -/// otherwise we have a conflict with the compiler. - -#include "hwsym_sdl.h" -#include "../doomdef.h" - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#ifdef HAVE_SDL - -#include "SDL.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#if defined (_XBOX) || defined (_arch_dreamcast) || defined(GP2X) -#define NOLOADSO -#endif - -#if SDL_VERSION_ATLEAST(1,2,6) && !defined (NOLOADSO) -#include "SDL_loadso.h" // 1.2.6+ -#elif !defined (NOLOADSO) -#define NOLOADSO -#endif - -#define _CREATE_DLL_ // necessary for Unix AND Windows - -#ifdef HWRENDER -#include "../hardware/hw_drv.h" -#include "ogl_sdl.h" -#ifdef STATIC_OPENGL -#include "../hardware/r_opengl/r_opengl.h" -#endif -#endif - -#ifdef HW3SOUND -#include "../hardware/hw3dsdrv.h" -#endif - -#define GETFUNC(func) \ - else if (0 == strcmp(#func, funcName)) \ - funcPointer = &func \ -// -// -/** \brief The *hwSym function - - Stupid function to return function addresses - - \param funcName the name of the function - \param handle an object to look in(NULL for self) - - \return void -*/ -// -void *hwSym(const char *funcName,void *handle) -{ - void *funcPointer = NULL; -#ifdef HWRENDER - if (0 == strcmp("SetPalette", funcName)) - funcPointer = &OglSdlSetPalette; - GETFUNC(Init); - GETFUNC(Draw2DLine); - GETFUNC(DrawPolygon); - GETFUNC(SetBlend); - GETFUNC(ClearBuffer); - GETFUNC(SetTexture); - GETFUNC(ReadRect); - GETFUNC(GClipRect); - GETFUNC(ClearMipMapCache); - GETFUNC(SetSpecialState); - GETFUNC(GetTextureUsed); - GETFUNC(DrawMD2); - GETFUNC(DrawMD2i); - GETFUNC(SetTransform); - GETFUNC(GetRenderVersion); -#ifdef SHUFFLE - GETFUNC(PostImgRedraw); -#endif //SHUFFLE - GETFUNC(StartScreenWipe); - GETFUNC(EndScreenWipe); - GETFUNC(DoScreenWipe); - GETFUNC(DrawIntermissionBG); - GETFUNC(MakeScreenTexture); -#else //HWRENDER - if (0 == strcmp("FinishUpdate", funcName)) - return funcPointer; //&FinishUpdate; -#endif //!HWRENDER -#ifdef STATIC3DS - GETFUNC(Startup); - GETFUNC(AddSfx); - GETFUNC(AddSource); - GETFUNC(StartSource); - GETFUNC(StopSource); - GETFUNC(GetHW3DSVersion); - GETFUNC(BeginFrameUpdate); - GETFUNC(EndFrameUpdate); - GETFUNC(IsPlaying); - GETFUNC(UpdateListener); - GETFUNC(UpdateSourceParms); - GETFUNC(SetGlobalSfxVolume); - GETFUNC(SetCone); - GETFUNC(Update3DSource); - GETFUNC(ReloadSource); - GETFUNC(KillSource); - GETFUNC(Shutdown); - GETFUNC(GetHW3DSTitle); -#endif -#ifdef NOLOADSO - else - funcPointer = handle; -#else - else if (handle) - funcPointer = SDL_LoadFunction(handle,funcName); -#endif - if (!funcPointer) - I_OutputMsg("hwSym for %s: %s\n", funcName, SDL_GetError()); - return funcPointer; -} - -/** \brief The *hwOpen function - - \param hwfile Open a handle to the SO - - \return Handle to SO - - -*/ - -void *hwOpen(const char *hwfile) -{ -#ifdef NOLOADSO - (void)hwfile; - return NULL; -#else - void *tempso = NULL; - tempso = SDL_LoadObject(hwfile); - if (!tempso) I_OutputMsg("hwOpen of %s: %s\n", hwfile, SDL_GetError()); - return tempso; -#endif -} - -/** \brief The hwClose function - - \param handle Close the handle of the SO - - \return void - - -*/ - -void hwClose(void *handle) -{ -#ifdef NOLOADSO - (void)handle; -#else - SDL_UnloadObject(handle); -#endif -} -#endif diff --git a/src/sdl2/hwsym_sdl.h b/src/sdl2/hwsym_sdl.h deleted file mode 100644 index 7297587b..00000000 --- a/src/sdl2/hwsym_sdl.h +++ /dev/null @@ -1,23 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Tool for dynamic referencing of hardware rendering/3D sound functions - -void *hwSym(const char *funcName,void *handle); - -void *hwOpen(const char *hwfile); - -void hwClose(void *handle); diff --git a/src/sdl2/i_cdmus.c b/src/sdl2/i_cdmus.c deleted file mode 100644 index fc35eb9c..00000000 --- a/src/sdl2/i_cdmus.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "../command.h" -#include "../s_sound.h" -#include "../i_sound.h" - -// -// CD MUSIC I/O -// - -UINT8 cdaudio_started = 0; - -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; - - -void I_InitCD(void){} - -void I_StopCD(void){} - -void I_PauseCD(void){} - -void I_ResumeCD(void){} - -void I_ShutdownCD(void){} - -void I_UpdateCD(void){} - -void I_PlayCD(UINT8 track, UINT8 looping) -{ - (void)track; - (void)looping; -} - -boolean I_SetVolumeCD(int volume) -{ - (void)volume; - return false; -} - diff --git a/src/sdl2/i_main.c b/src/sdl2/i_main.c deleted file mode 100644 index 1c438e08..00000000 --- a/src/sdl2/i_main.c +++ /dev/null @@ -1,247 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Main program, simply calls D_SRB2Main and D_SRB2Loop, the high level loop. - -#include "../doomdef.h" -#include "../m_argv.h" -#include "../d_main.h" -#include "../i_system.h" - -#ifdef __GNUC__ -#include -#endif - -#ifdef _WII -#include -#include -#include -#ifdef REMOTE_DEBUGGING -#include -#endif -static char wiicwd[PATH_MAX] = "sd:/"; -static char localip[16] = {0}; -static char gateway[16] = {0}; -static char netmask[16] = {0}; -#endif - -#ifdef _PSP -#include -#include -PSP_HEAP_SIZE_KB(24*1024); -PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER | PSP_THREAD_ATTR_VFPU); -PSP_MAIN_THREAD_NAME("SRB2"); -PSP_MAIN_THREAD_STACK_SIZE_KB(256); -#endif - -#ifdef HAVE_SDL - -#ifdef HAVE_TTF -#include "SDL.h" -#include "i_ttf.h" -#endif - -#ifdef SDLMAIN -#include "SDL_main.h" -#elif defined(FORCESDLMAIN) -extern int SDL_main(int argc, char *argv[]); -#endif - -#ifdef LOGMESSAGES -FILE *logstream = NULL; -#endif - -#ifndef DOXYGEN -#ifndef O_TEXT -#define O_TEXT 0 -#endif - -#ifndef O_SEQUENTIAL -#define O_SEQUENTIAL 0 -#endif -#endif - -#if defined (_WIN32) && !defined (_XBOX) -#include "../win32/win_dbg.h" -typedef BOOL (WINAPI *p_IsDebuggerPresent)(VOID); -#endif - -#ifdef _arch_dreamcast -#include -KOS_INIT_FLAGS(INIT_DEFAULT -//| INIT_NET -//| INIT_MALLOCSTATS -//| INIT_QUIET -//| INIT_OCRAM -//| INIT_NO_DCLOAD -); -#endif - -#if defined (_WIN32) && !defined (_XBOX) && !defined (_WIN32_WCE) -static inline VOID MakeCodeWritable(VOID) -{ -#ifdef USEASM // Disable write-protection of code segment - DWORD OldRights; - const DWORD NewRights = PAGE_EXECUTE_READWRITE; - PBYTE pBaseOfImage = (PBYTE)GetModuleHandle(NULL); - PIMAGE_DOS_HEADER dosH =(PIMAGE_DOS_HEADER)pBaseOfImage; - PIMAGE_NT_HEADERS ntH = (PIMAGE_NT_HEADERS)(pBaseOfImage + dosH->e_lfanew); - PIMAGE_OPTIONAL_HEADER oH = (PIMAGE_OPTIONAL_HEADER) - ((PBYTE)ntH + sizeof (IMAGE_NT_SIGNATURE) + sizeof (IMAGE_FILE_HEADER)); - LPVOID pA = pBaseOfImage+oH->BaseOfCode; - SIZE_T pS = oH->SizeOfCode; -#if 1 // try to find the text section - PIMAGE_SECTION_HEADER ntS = IMAGE_FIRST_SECTION (ntH); - WORD s; - for (s = 0; s < ntH->FileHeader.NumberOfSections; s++) - { - if (memcmp (ntS[s].Name, ".text\0\0", 8) == 0) - { - pA = pBaseOfImage+ntS[s].VirtualAddress; - pS = ntS[s].Misc.VirtualSize; - break; - } - } -#endif - - if (!VirtualProtect(pA,pS,NewRights,&OldRights)) - I_Error("Could not make code writable\n"); -#endif -} -#endif - - -/** \brief The main function - - \param argc number of arg - \param *argv string table - - \return int -*/ -FUNCNORETURN -#if defined (_XBOX) && defined (__GNUC__) -void XBoxStartup() -{ - const char *logdir = NULL; - myargc = -1; - myargv = NULL; -#else -#ifdef FORCESDLMAIN -int SDL_main(int argc, char **argv) -#else -int main(int argc, char **argv) -#endif -{ - const char *logdir = NULL; - myargc = argc; - myargv = argv; /// \todo pull out path to exe from this string -#endif - -#ifdef HAVE_TTF -#ifdef _PS3 - // apparently there is a bug in SDL_PSL1GHT which needs this to be set to work around - SDL_setenv("SDL_VIDEODRIVER", "psl1ght", 1); - I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO, SDL_SWSURFACE|SDL_DOUBLEBUF); -#elif defined(_WIN32) - I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE); -#else - I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO, SDL_SWSURFACE); -#endif -#endif - -#ifdef _PS3 - // initialise controllers. - //ioPadInit(7); -#endif - -// init Wii-specific stuff -#ifdef _WII - // Start network - if_config(localip, netmask, gateway, TRUE); - -#ifdef REMOTE_DEBUGGING -#if REMOTE_DEBUGGING == 0 - DEBUG_Init(GDBSTUB_DEVICE_TCP, GDBSTUB_DEF_TCPPORT); // Port 2828 -#elif REMOTE_DEBUGGING > 2 - DEBUG_Init(GDBSTUB_DEVICE_TCP, REMOTE_DEBUGGING); // Custom Port -#elif REMOTE_DEBUGGING < 0 - DEBUG_Init(GDBSTUB_DEVICE_USB, GDBSTUB_DEF_CHANNEL); // Slot 1 -#else - DEBUG_Init(GDBSTUB_DEVICE_USB, REMOTE_DEBUGGING-1); // Custom Slot -#endif -#endif - // Start FAT filesystem - fatInitDefault(); - - if (getcwd(wiicwd, PATH_MAX)) - I_PutEnv(va("HOME=%ssrb2wii", wiicwd)); -#endif - - logdir = D_Home(); - -#ifdef LOGMESSAGES -#if defined(_WIN32_WCE) || defined(GP2X) - logstream = fopen(va("%s.log",argv[0]), "a"); -#elif defined (_WII) - logstream = fopen(va("%s/srb2log.txt",logdir), "a"); -#elif defined (DEFAULTDIR) - if (logdir) - logstream = fopen(va("%s/"DEFAULTDIR"/srb2log.txt",logdir), "a"); - else -#endif - logstream = fopen("./srb2log.txt", "a"); -#endif - - //I_OutputMsg("I_StartupSystem() ...\n"); - I_StartupSystem(); -#if defined (_WIN32) && !defined (_XBOX) -#ifndef _WIN32_WCE - { - p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsDebuggerPresent"); - if ((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) -#ifdef BUGTRAP - && !InitBugTrap() -#endif - ) - { - LoadLibraryA("exchndl.dll"); - } - } -#endif - prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo); -#ifndef _WIN32_WCE - MakeCodeWritable(); -#endif -#endif - // startup SRB2 - CONS_Printf("%s", M_GetText("Setting up SRB2...\n")); - D_SRB2Main(); - CONS_Printf("%s", M_GetText("Entering main game loop...\n")); - // never return - D_SRB2Loop(); - -#ifdef BUGTRAP - // This is safe even if BT didn't start. - ShutdownBugTrap(); -#endif - - // return to OS -#ifndef __GNUC__ - return 0; -#endif -} -#endif diff --git a/src/sdl2/i_net.c b/src/sdl2/i_net.c deleted file mode 100644 index ee4a34c1..00000000 --- a/src/sdl2/i_net.c +++ /dev/null @@ -1,442 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL network interface - -#include "../doomdef.h" - -#include "../i_system.h" -#include "../d_event.h" -#include "../d_net.h" -#include "../m_argv.h" - -#include "../doomstat.h" - -#include "../i_net.h" - -#include "../z_zone.h" - -#include "../i_tcp.h" - -#ifdef HAVE_SDL - -#ifdef HAVE_SDLNET - -#include "SDL_net.h" - -#define MAXBANS 20 - -static IPaddress clientaddress[MAXNETNODES+1]; -static IPaddress banned[MAXBANS]; - -static UDPpacket mypacket; -static UDPsocket mysocket = NULL; -static SDLNet_SocketSet myset = NULL; - -static size_t numbans = 0; -static boolean NET_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? -static boolean init_SDLNet_driver = false; - -static const char *NET_AddrToStr(IPaddress* sk) -{ - static char s[22]; // 255.255.255.255:65535 - strcpy(s, SDLNet_ResolveIP(sk)); - if (sk->port != 0) strcat(s, va(":%d", sk->port)); - return s; -} - -static const char *NET_GetNodeAddress(INT32 node) -{ - if (!nodeconnected[node]) - return NULL; - return NET_AddrToStr(&clientaddress[node]); -} - -static const char *NET_GetBanAddress(size_t ban) -{ - if (ban > numbans) - return NULL; - return NET_AddrToStr(&banned[ban]); -} - -static boolean NET_cmpaddr(IPaddress* a, IPaddress* b) -{ - return (a->host == b->host && (b->port == 0 || a->port == b->port)); -} - -static boolean NET_CanGet(void) -{ - return myset?(SDLNet_CheckSockets(myset,0) == 1):false; -} - -static void NET_Get(void) -{ - INT32 mystatus; - INT32 newnode; - mypacket.len = MAXPACKETLENGTH; - if (!NET_CanGet()) - { - doomcom->remotenode = -1; // no packet - return; - } - mystatus = SDLNet_UDP_Recv(mysocket,&mypacket); - if (mystatus != -1) - { - if (mypacket.channel != -1) - { - doomcom->remotenode = mypacket.channel+1; // good packet from a game player - doomcom->datalength = mypacket.len; - return; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&mypacket.address); - if (newnode != -1) - { - size_t i; - newnode++; - M_Memcpy(&clientaddress[newnode], &mypacket.address, sizeof (IPaddress)); - DEBFILE(va("New node detected: node:%d address:%s\n", newnode, - NET_GetNodeAddress(newnode))); - doomcom->remotenode = newnode; // good packet from a game player - doomcom->datalength = mypacket.len; - for (i = 0; i < numbans; i++) - { - if (NET_cmpaddr(&mypacket.address, &banned[i])) - { - DEBFILE("This dude has been banned\n"); - NET_bannednode[newnode] = true; - break; - } - } - if (i == numbans) - NET_bannednode[newnode] = false; - return; - } - else - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - else if (mystatus == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - - DEBFILE("New node detected: No more free slots\n"); - doomcom->remotenode = -1; // no packet -} - -#if 0 -static boolean NET_CanSend(void) -{ - return true; -} -#endif - -static void NET_Send(void) -{ - if (!doomcom->remotenode) - return; - mypacket.len = doomcom->datalength; - if (SDLNet_UDP_Send(mysocket,doomcom->remotenode-1,&mypacket) == 0) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } -} - -static void NET_FreeNodenum(INT32 numnode) -{ - // can't disconnect from self :) - if (!numnode) - return; - - DEBFILE(va("Free node %d (%s)\n", numnode, NET_GetNodeAddress(numnode))); - - SDLNet_UDP_Unbind(mysocket,numnode-1); - - memset(&clientaddress[numnode], 0, sizeof (IPaddress)); -} - -static UDPsocket NET_Socket(void) -{ - UDPsocket temp = NULL; - Uint16 portnum = 0; - IPaddress tempip = {INADDR_BROADCAST,0}; - //Hurdler: I'd like to put a server and a client on the same computer - //Logan: Me too - //BP: in fact for client we can use any free port we want i have read - // in some doc that connect in udp can do it for us... - //Alam: where? - if (M_CheckParm("-clientport")) - { - if (!M_IsNextParm()) - I_Error("syntax: -clientport "); - portnum = atoi(M_GetNextParm()); - } - else - portnum = sock_port; - temp = SDLNet_UDP_Open(portnum); - if (!temp) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return NULL; - } - if (SDLNet_UDP_Bind(temp,BROADCASTADDR-1,&tempip) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - SDLNet_UDP_Close(temp); - return NULL; - } - clientaddress[BROADCASTADDR].port = sock_port; - clientaddress[BROADCASTADDR].host = INADDR_BROADCAST; - - doomcom->extratics = 1; // internet is very high ping - - return temp; -} - -static void I_ShutdownSDLNetDriver(void) -{ - if (myset) SDLNet_FreeSocketSet(myset); - myset = NULL; - SDLNet_Quit(); - init_SDLNet_driver = false; -} - -static void I_InitSDLNetDriver(void) -{ - if (init_SDLNet_driver) - I_ShutdownSDLNetDriver(); - if (SDLNet_Init() == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return; // No good! - } - D_SetDoomcom(); - mypacket.data = doomcom->data; - init_SDLNet_driver = true; -} - -static void NET_CloseSocket(void) -{ - if (mysocket) - SDLNet_UDP_Close(mysocket); - mysocket = NULL; -} - -static SINT8 NET_NetMakeNodewPort(const char *hostname, const char *port) -{ - INT32 newnode; - UINT16 portnum = sock_port; - IPaddress hostnameIP; - - // retrieve portnum from address! - if (port && !port[0]) - portnum = atoi(port); - - if (SDLNet_ResolveHost(&hostnameIP,hostname,portnum) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return -1; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&hostnameIP); - if (newnode == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return newnode; - } - newnode++; - M_Memcpy(&clientaddress[newnode],&hostnameIP,sizeof (IPaddress)); - return (SINT8)newnode; -} - - -static boolean NET_OpenSocket(void) -{ - memset(clientaddress, 0, sizeof (clientaddress)); - - //I_OutputMsg("SDL_Net Code starting up\n"); - - I_NetSend = NET_Send; - I_NetGet = NET_Get; - I_NetCloseSocket = NET_CloseSocket; - I_NetFreeNodenum = NET_FreeNodenum; - I_NetMakeNodewPort = NET_NetMakeNodewPort; - - //I_NetCanSend = NET_CanSend; - - // build the socket but close it first - NET_CloseSocket(); - mysocket = NET_Socket(); - - if (!mysocket) - return false; - - // for select - myset = SDLNet_AllocSocketSet(1); - if (!myset) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - if (SDLNet_UDP_AddSocket(myset,mysocket) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - return true; -} - -static boolean NET_Ban(INT32 node) -{ - if (numbans == MAXBANS) - return false; - - M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress)); - banned[numbans].port = 0; - numbans++; - return true; -} - -static boolean NET_SetBanAddress(const char *address, const char *mask) -{ - (void)mask; - if (bans == MAXBANS) - return false; - - if (SDLNet_ResolveHost(&banned[numbans], address, 0) == -1) - return false; - numbans++; - return true; -} - -static void NET_ClearBans(void) -{ - numbans = 0; -} -#endif - -// -// I_InitNetwork -// Only required for DOS, so this is more a dummy -// -boolean I_InitNetwork(void) -{ -#ifdef HAVE_SDLNET - char serverhostname[255]; - boolean ret = false; - SDL_version SDLcompiled; - const SDL_version *SDLlinked = SDLNet_Linked_Version(); - SDL_NET_VERSION(&SDLcompiled) - I_OutputMsg("Compiled for SDL_Net version: %d.%d.%d\n", - SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch); - I_OutputMsg("Linked with SDL_Net version: %d.%d.%d\n", - SDLlinked->major, SDLlinked->minor, SDLlinked->patch); - //if (!M_CheckParm ("-sdlnet")) - // return false; - // initilize the driver - I_InitSDLNetDriver(); - I_AddExitFunc(I_ShutdownSDLNetDriver); - if (!init_SDLNet_driver) - return false; - - if (M_CheckParm("-udpport")) - { - if (M_IsNextParm()) - sock_port = (UINT16)atoi(M_GetNextParm()); - else - sock_port = 0; - } - - // parse network game options, - if (M_CheckParm("-server") || dedicated) - { - server = true; - - // If a number of clients (i.e. nodes) is specified, the server will wait for the clients - // to connect before starting. - // If no number is specified here, the server starts with 1 client, and others can join - // in-game. - // Since Boris has implemented join in-game, there is no actual need for specifying a - // particular number here. - // FIXME: for dedicated server, numnodes needs to be set to 0 upon start -/* if (M_IsNextParm()) - doomcom->numnodes = (INT16)atoi(M_GetNextParm()); - else */if (dedicated) - doomcom->numnodes = 0; - else - doomcom->numnodes = 1; - - if (doomcom->numnodes < 0) - doomcom->numnodes = 0; - if (doomcom->numnodes > MAXNETNODES) - doomcom->numnodes = MAXNETNODES; - - // server - servernode = 0; - // FIXME: - // ??? and now ? - // server on a big modem ??? 4*isdn - net_bandwidth = 16000; - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - - ret = true; - } - else if (M_CheckParm("-connect")) - { - if (M_IsNextParm()) - strcpy(serverhostname, M_GetNextParm()); - else - serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it - - // server address only in ip - if (serverhostname[0]) - { - COM_BufAddText("connect \""); - COM_BufAddText(serverhostname); - COM_BufAddText("\"\n"); - - // probably modem - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - } - else - { - // so we're on a LAN - COM_BufAddText("connect any\n"); - - net_bandwidth = 800000; - hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - } - } - - mypacket.maxlen = hardware_MAXPACKETLENGTH; - I_NetOpenSocket = NET_OpenSocket; - I_Ban = NET_Ban; - I_ClearBans = NET_ClearBans; - I_GetNodeAddress = NET_GetNodeAddress; - I_GetBenAddress = NET_GetBenAddress; - I_SetBanAddress = NET_SetBanAddress; - bannednode = NET_bannednode; - - return ret; -#else - if ( M_CheckParm ("-net") ) - { - I_Error("-net not supported, use -server and -connect\n" - "see docs for more\n"); - } - return false; -#endif -} -#endif diff --git a/src/sdl2/i_system.c b/src/sdl2/i_system.c deleted file mode 100644 index cfc2e210..00000000 --- a/src/sdl2/i_system.c +++ /dev/null @@ -1,3111 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// Changes by Graue are in the public domain. -// -//----------------------------------------------------------------------------- -/// \file -/// \brief SRB2 system stuff for SDL - -#ifndef _WIN32_WCE -#include -#endif - -#ifdef _XBOX -#include "SRB2XBOX/xboxhelp.h" -#endif - -#if defined (_WIN32) && !defined (_XBOX) -#define RPC_NO_WINDOWS_H -#include -#include "../doomtype.h" -#ifndef _WIN32_WCE -typedef BOOL (WINAPI *p_GetDiskFreeSpaceExA)(LPCSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER); -typedef BOOL (WINAPI *p_IsProcessorFeaturePresent) (DWORD); -typedef DWORD (WINAPI *p_timeGetTime) (void); -typedef UINT (WINAPI *p_timeEndPeriod) (UINT); -typedef HANDLE (WINAPI *p_OpenFileMappingA) (DWORD, BOOL, LPCSTR); -typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); -typedef HANDLE (WINAPI *p_GetCurrentProcess) (VOID); -typedef BOOL (WINAPI *p_GetProcessAffinityMask) (HANDLE, PDWORD_PTR, PDWORD_PTR); -typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR); -#endif -#endif -#include -#include -#include -#ifdef __GNUC__ -#include -#elif defined (_MSC_VER) -#include -#endif -#if defined (__unix__) || defined (UNIXCOMMON) -#include -#endif - -#ifdef _arch_dreamcast -#include -#include -#include -#include -void __set_fpscr(long); // in libgcc / kernel's startup.s? -#else -#include -#if defined (_WIN32) && !defined (_WIN32_WCE) && !defined (_XBOX) -#include -#endif -#endif - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#ifdef HAVE_SDL - -#include "SDL.h" - -#ifdef HAVE_TTF -#include "i_ttf.h" -#endif - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#if SDL_VERSION_ATLEAST(1,2,7) && !defined (DC) -#include "SDL_cpuinfo.h" // 1.2.7 or greater -#define HAVE_SDLCPUINFO -#endif - -#ifdef _PSP -//#include -#elif !defined(_PS3) -#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (_arch_dreamcast) && !defined (__HAIKU__) && !defined (_WII)) -#if defined (__linux__) -#include -#else -#include -#include -/*For meminfo*/ -#include -#ifdef FREEBSD -#include -#endif -#include -#include -#endif -#endif -#endif - -#ifndef _PS3 -#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (_arch_dreamcast) && !defined (_PSP) && !defined (__HAIKU__) && !defined (_WII)) -#ifndef NOTERMIOS -#include -#include // ioctl -#define HAVE_TERMIOS -#endif -#endif -#endif - -#ifndef NOMUMBLE -#if defined (__linux__) && !defined(_PS3) // need -lrt -#include -#ifdef MAP_FAILED -#define HAVE_SHM -#endif -#include -#endif - -#if defined (_WIN32) && !defined (_WIN32_WCE) && !defined (_XBOX) -#define HAVE_MUMBLE -#define WINMUMBLE -#elif defined (HAVE_SHM) -#define HAVE_MUMBLE -#endif -#endif // NOMUMBLE - -#ifdef _WIN32_WCE -#include "SRB2CE/cehelp.h" -#endif - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -// Locations for searching the srb2.srb -#ifdef _arch_dreamcast -#define DEFAULTWADLOCATION1 "/cd" -#define DEFAULTWADLOCATION2 "/pc" -#define DEFAULTWADLOCATION3 "/pc/home/alam/srb2code/data" -#define DEFAULTSEARCHPATH1 "/cd" -#define DEFAULTSEARCHPATH2 "/pc" -//#define DEFAULTSEARCHPATH3 "/pc/home/alam/srb2code/data" -#elif defined (GP2X) -#define DEFAULTWADLOCATION1 "/mnt/sd" -#define DEFAULTWADLOCATION2 "/mnt/sd/SRB2" -#define DEFAULTWADLOCATION3 "/tmp/mnt/sd" -#define DEFAULTWADLOCATION4 "/tmp/mnt/sd/SRB2" -#define DEFAULTSEARCHPATH1 "/mnt/sd" -#define DEFAULTSEARCHPATH2 "/tmp/mnt/sd" -#elif defined (_WII) -#define NOCWD -#define NOHOME -#define NEED_SDL_GETENV -#define DEFAULTWADLOCATION1 "sd:/srb2wii" -#define DEFAULTWADLOCATION2 "usb:/srb2wii" -#define DEFAULTSEARCHPATH1 "sd:/srb2wii" -#define DEFAULTSEARCHPATH2 "usb:/srb2wii" -// PS3: TODO: this will need modification most likely -#elif defined (_PS3) -#define NOCWD -#define NOHOME -#define DEFAULTWADLOCATION1 "/dev_hdd0/game/SRB2-PS3_/USRDIR/etc" -#define DEFAULTWADLOCATION2 "/dev_usb/SRB2PS3" -#define DEFAULTSEARCHPATH1 "/dev_hdd0/game/SRB2-PS3_/USRDIR/etc" -#define DEFAULTSEARCHPATH2 "/dev_usb/SRB2PS3" -#elif defined (_PSP) -#define NOCWD -#define NOHOME -#define DEFAULTWADLOCATION1 "host0:/bin/Resources" -#define DEFAULTWADLOCATION2 "ms0:/PSP/GAME/SRB2PSP" -#define DEFAULTSEARCHPATH1 "host0:/" -#define DEFAULTSEARCHPATH2 "ms0:/PSP/GAME/SRB2PSP" -#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) -#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2" -#define DEFAULTWADLOCATION2 "/usr/local/games/SRB2" -#define DEFAULTWADLOCATION3 "/usr/share/games/SRB2" -#define DEFAULTWADLOCATION4 "/usr/games/SRB2" -#define DEFAULTSEARCHPATH1 "/usr/local/games" -#define DEFAULTSEARCHPATH2 "/usr/games" -#define DEFAULTSEARCHPATH3 "/usr/local" -#elif defined (_XBOX) -#define NOCWD -#ifdef __GNUC__ -#include -#endif -#define DEFAULTWADLOCATION1 "c:\\srb2" -#define DEFAULTWADLOCATION2 "d:\\srb2" -#define DEFAULTWADLOCATION3 "e:\\srb2" -#define DEFAULTWADLOCATION4 "f:\\srb2" -#define DEFAULTWADLOCATION5 "g:\\srb2" -#define DEFAULTWADLOCATION6 "h:\\srb2" -#define DEFAULTWADLOCATION7 "i:\\srb2" -#elif defined (_WIN32_WCE) -#define NOCWD -#define NOHOME -#define DEFAULTWADLOCATION1 "\\Storage Card\\SRB2DEMO" -#define DEFAULTSEARCHPATH1 "\\Storage Card" -#elif defined (_WIN32) -#define DEFAULTWADLOCATION1 "c:\\games\\srb2" -#define DEFAULTWADLOCATION2 "\\games\\srb2" -#define DEFAULTSEARCHPATH1 "c:\\games" -#define DEFAULTSEARCHPATH2 "\\games" -#endif - -/** \brief WAD file to look for -*/ -#define WADKEYWORD1 "srb2.srb" -#define WADKEYWORD2 "srb2.wad" -/** \brief holds wad path -*/ -static char returnWadPath[256]; - -//Alam_GBC: SDL - -#include "../doomdef.h" -#include "../m_misc.h" -#include "../i_video.h" -#include "../i_sound.h" -#include "../i_system.h" -#include "../screen.h" //vid.WndParent -#include "../d_net.h" -#include "../g_game.h" -#include "../filesrch.h" -#include "endtxt.h" -#include "sdlmain.h" - -#include "../i_joy.h" - -#include "../m_argv.h" - -#ifdef MAC_ALERT -#include "macosx/mac_alert.h" -#endif - -#include "../d_main.h" - -#if !defined(NOMUMBLE) && defined(HAVE_MUMBLE) -// Mumble context string -#include "../d_clisrv.h" -#include "../byteptr.h" -#endif - -/** \brief The JoyReset function - - \param JoySet Joystick info to reset - - \return void -*/ -static void JoyReset(SDLJoyInfo_t *JoySet) -{ - if (JoySet->dev) - { -#ifdef GP2X //GP2X's SDL does an illegal free on the 1st joystick... - if (SDL_JoystickIndex(JoySet->dev) != 0) -#endif - SDL_JoystickClose(JoySet->dev); - } - JoySet->dev = NULL; - JoySet->oldjoy = -1; - JoySet->axises = JoySet->buttons = JoySet->hats = JoySet->balls = 0; - //JoySet->scale -} - -/** \brief First joystick up and running -*/ -static INT32 joystick_started = 0; - -/** \brief SDL info about joystick 1 -*/ -SDLJoyInfo_t JoyInfo; - - -/** \brief Second joystick up and running -*/ -static INT32 joystick2_started = 0; - -/** \brief SDL inof about joystick 2 -*/ -SDLJoyInfo_t JoyInfo2; - -#ifdef HAVE_TERMIOS -static INT32 fdmouse2 = -1; -static INT32 mouse2_started = 0; -#endif - -SDL_bool consolevent = SDL_FALSE; -SDL_bool framebuffer = SDL_FALSE; - -UINT8 keyboard_started = false; - -#if 0 -static void signal_handler(INT32 num) -{ - //static char msg[] = "oh no! back to reality!\r\n"; - char * sigmsg; - char sigdef[32]; - - switch (num) - { - case SIGINT: - sigmsg = "interrupt"; - break; - case SIGILL: - sigmsg = "illegal instruction - invalid function image"; - break; - case SIGFPE: - sigmsg = "floating point exception"; - break; - case SIGSEGV: - sigmsg = "segment violation"; - break; - case SIGTERM: - sigmsg = "Software termination signal from kill"; - break; -#if !(defined (__unix_) || defined (UNIXCOMMON)) - case SIGBREAK: - sigmsg = "Ctrl-Break sequence"; - break; -#endif - case SIGABRT: - sigmsg = "abnormal termination triggered by abort call"; - break; - default: - sprintf(sigdef,"signal number %d", num); - sigmsg = sigdef; - } - - I_OutputMsg("signal_handler() error: %s\n", sigmsg); - signal(num, SIG_DFL); //default signal action - raise(num); - I_Quit(); -} -#endif - -#if defined (NDEBUG) && !defined (DC) && !defined (_WIN32_WCE) -FUNCNORETURN static ATTRNORETURN void quit_handler(int num) -{ - signal(num, SIG_DFL); //default signal action - raise(num); - I_Quit(); -} -#endif - -#ifdef HAVE_TERMIOS -// TERMIOS console code from Quake3: thank you! -SDL_bool stdin_active = SDL_TRUE; - -typedef struct -{ - size_t cursor; - char buffer[256]; -} feild_t; - -feild_t tty_con; - -// when printing general stuff to stdout stderr (Sys_Printf) -// we need to disable the tty console stuff -// this increments so we can recursively disable -static INT32 ttycon_hide = 0; -// some key codes that the terminal may be using -// TTimo NOTE: I'm not sure how relevant this is -static INT32 tty_erase; -static INT32 tty_eof; - -static struct termios tty_tc; - -// ============================================================= -// tty console routines -// NOTE: if the user is editing a line when something gets printed to the early console then it won't look good -// so we provide tty_Clear and tty_Show to be called before and after a stdout or stderr output -// ============================================================= - -// flush stdin, I suspect some terminals are sending a LOT of garbage -// FIXME TTimo relevant? -#if 0 -static inline void tty_FlushIn(void) -{ - char key; - while (read(STDIN_FILENO, &key, 1)!=-1); -} -#endif - -// do a backspace -// TTimo NOTE: it seems on some terminals just sending '\b' is not enough -// so for now, in any case we send "\b \b" .. yeah well .. -// (there may be a way to find out if '\b' alone would work though) -static void tty_Back(void) -{ - char key; - ssize_t d; - key = '\b'; - d = write(STDOUT_FILENO, &key, 1); - key = ' '; - d = write(STDOUT_FILENO, &key, 1); - key = '\b'; - d = write(STDOUT_FILENO, &key, 1); - (void)d; -} - -static void tty_Clear(void) -{ - size_t i; - if (tty_con.cursor>0) - { - for (i=0; i0); - ttycon_hide--; - if (ttycon_hide == 0 && tty_con.cursor) - { - for (i=0; i 0) - { - tty_con.cursor--; - tty_con.buffer[tty_con.cursor] = '\0'; - tty_Back(); - } - ev.data1 = KEY_BACKSPACE; - } - else if (key < ' ') // check if this is a control char - { - if (key == '\n') - { - tty_Clear(); - tty_con.cursor = 0; - ev.data1 = KEY_ENTER; - } - else return; - } - else - { - // push regular character - ev.data1 = tty_con.buffer[tty_con.cursor] = key; - tty_con.cursor++; - // print the current line (this is differential) - d = write(STDOUT_FILENO, &key, 1); - } - if (ev.data1) D_PostEvent(&ev); - //tty_FlushIn(); - (void)d; -} - -#elif defined (_WIN32) && !(defined (_XBOX) || defined (_WIN32_WCE)) -static BOOL I_ReadyConsole(HANDLE ci) -{ - DWORD gotinput; - if (ci == INVALID_HANDLE_VALUE) return FALSE; - if (WaitForSingleObject(ci,0) != WAIT_OBJECT_0) return FALSE; - if (GetFileType(ci) != FILE_TYPE_CHAR) return FALSE; - if (!GetConsoleMode(ci, &gotinput)) return FALSE; - return (GetNumberOfConsoleInputEvents(ci, &gotinput) && gotinput); -} - -static boolean entering_con_command = false; - -void I_GetConsoleEvents(void) -{ - event_t ev = {0,0,0,0}; - HANDLE ci = GetStdHandle(STD_INPUT_HANDLE); - HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE); - CONSOLE_SCREEN_BUFFER_INFO CSBI; - INPUT_RECORD input; - DWORD t; - - while (I_ReadyConsole(ci) && ReadConsoleInput(ci, &input, 1, &t) && t) - { - memset(&ev,0x00,sizeof (ev)); - switch (input.EventType) - { - case KEY_EVENT: - if (input.Event.KeyEvent.bKeyDown) - { - ev.type = ev_console; - entering_con_command = true; - switch (input.Event.KeyEvent.wVirtualKeyCode) - { - case VK_ESCAPE: - case VK_TAB: - ev.data1 = KEY_NULL; - break; - case VK_SHIFT: - ev.data1 = KEY_LSHIFT; - break; - case VK_RETURN: - entering_con_command = false; - // Fall through. - default: - ev.data1 = MapVirtualKey(input.Event.KeyEvent.wVirtualKeyCode,2); // convert in to char - } - if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t)) - { - if (ev.data1 && ev.data1 != KEY_LSHIFT && ev.data1 != KEY_RSHIFT) - { -#ifdef _UNICODE - WriteConsole(co, &input.Event.KeyEvent.uChar.UnicodeChar, 1, &t, NULL); -#else - WriteConsole(co, &input.Event.KeyEvent.uChar.AsciiChar, 1 , &t, NULL); -#endif - } - if (input.Event.KeyEvent.wVirtualKeyCode == VK_BACK - && GetConsoleScreenBufferInfo(co,&CSBI)) - { - WriteConsoleOutputCharacterA(co, " ",1, CSBI.dwCursorPosition, &t); - } - } - } - else - { - ev.type = ev_keyup; - switch (input.Event.KeyEvent.wVirtualKeyCode) - { - case VK_SHIFT: - ev.data1 = KEY_LSHIFT; - break; - default: - break; - } - } - if (ev.data1) D_PostEvent(&ev); - break; - case MOUSE_EVENT: - case WINDOW_BUFFER_SIZE_EVENT: - case MENU_EVENT: - case FOCUS_EVENT: - break; - } - } -} - -static void I_StartupConsole(void) -{ - HANDLE ci, co; - const INT32 ded = M_CheckParm("-dedicated"); -#ifdef SDLMAIN - BOOL gotConsole = FALSE; - if (M_CheckParm("-console") || ded) - gotConsole = AllocConsole(); -#else - BOOL gotConsole = TRUE; - if (M_CheckParm("-detachconsole")) - { - FreeConsole(); - gotConsole = AllocConsole(); - } -#ifdef _DEBUG - else if (M_CheckParm("-noconsole") && !ded) -#else - else if (!M_CheckParm("-console") && !ded) -#endif - { - FreeConsole(); - gotConsole = FALSE; - } -#endif - - if (gotConsole) - { - SetConsoleTitleA("SRB2 Console"); - consolevent = SDL_TRUE; - } - - //Let get the real console HANDLE, because Mingw's Bash is bad! - ci = CreateFile(TEXT("CONIN$") , GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - co = CreateFile(TEXT("CONOUT$"), GENERIC_WRITE|GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (ci != INVALID_HANDLE_VALUE) - { - const DWORD CM = ENABLE_LINE_INPUT|ENABLE_ECHO_INPUT|ENABLE_PROCESSED_INPUT; - SetStdHandle(STD_INPUT_HANDLE, ci); - if (GetFileType(ci) == FILE_TYPE_CHAR) - SetConsoleMode(ci, CM); //default mode but no ENABLE_MOUSE_INPUT - } - if (co != INVALID_HANDLE_VALUE) - { - SetStdHandle(STD_OUTPUT_HANDLE, co); - SetStdHandle(STD_ERROR_HANDLE, co); - } -} -static inline void I_ShutdownConsole(void){} -#else -void I_GetConsoleEvents(void){} -static inline void I_StartupConsole(void) -{ -#ifdef _arch_dreamcast - char title[] = "SRB2 for Dreamcast!\n"; - __set_fpscr(0x00040000); /* ignore FPU underflow */ - //printf("\nHello world!\n\n"); - pvr_init_defaults(); - conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE); - conio_set_theme(CONIO_THEME_MATRIX); - conio_clear(); - conio_putstr(title); - //printf("\nHello world!\n\n"); -#endif -#ifdef _DEBUG - consolevent = !M_CheckParm("-noconsole"); -#else - consolevent = M_CheckParm("-console"); -#endif - - framebuffer = M_CheckParm("-framebuffer"); - - if (framebuffer) - consolevent = SDL_FALSE; -} -static inline void I_ShutdownConsole(void){} -#endif - -// -// StartupKeyboard -// -void I_StartupKeyboard (void) -{ -#if defined (NDEBUG) && !defined (DC) -#ifdef SIGILL -// signal(SIGILL , signal_handler); -#endif -#ifdef SIGINT - signal(SIGINT , quit_handler); -#endif -#ifdef SIGSEGV -// signal(SIGSEGV , signal_handler); -#endif -#ifdef SIGBREAK - signal(SIGBREAK , quit_handler); -#endif -#ifdef SIGABRT -// signal(SIGABRT , signal_handler); -#endif -#ifdef SIGTERM - signal(SIGTERM , quit_handler); -#endif -#endif -} - -// -//I_OutputMsg -// -void I_OutputMsg(const char *fmt, ...) -{ - size_t len; - XBOXSTATIC char txt[8192]; - va_list argptr; - -#ifdef _arch_dreamcast - if (!keyboard_started) conio_printf(fmt); -#endif - - va_start(argptr,fmt); - vsprintf(txt, fmt, argptr); - va_end(argptr); - -#ifdef HAVE_TTF - if (TTF_WasInit()) I_TTFDrawText(currentfont, solid, DEFAULTFONTFGR, DEFAULTFONTFGG, DEFAULTFONTFGB, DEFAULTFONTFGA, - DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt); -#endif - -#if defined (_WIN32) && !defined (_XBOX) && defined (_MSC_VER) - OutputDebugStringA(txt); -#endif - - len = strlen(txt); - -#ifdef LOGMESSAGES - if (logstream) - { - size_t d = fwrite(txt, len, 1, logstream); - fflush(logstream); - (void)d; - } -#endif - -#if defined (_WIN32) && !defined (_XBOX) && !defined(_WIN32_WCE) -#ifdef DEBUGFILE - if (debugfile != stderr) -#endif - { - HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE); - DWORD bytesWritten; - - if (co == INVALID_HANDLE_VALUE) - return; - - if (GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &bytesWritten)) - { - static COORD coordNextWrite = {0,0}; - LPVOID oldLines = NULL; - INT oldLength; - CONSOLE_SCREEN_BUFFER_INFO csbi; - - // Save the lines that we're going to obliterate. - GetConsoleScreenBufferInfo(co, &csbi); - oldLength = csbi.dwSize.X * (csbi.dwCursorPosition.Y - coordNextWrite.Y) + csbi.dwCursorPosition.X - coordNextWrite.X; - - if (oldLength > 0) - { - LPVOID blank = malloc(oldLength); - if (!blank) return; - memset(blank, ' ', oldLength); // Blank out. - oldLines = malloc(oldLength*sizeof(TCHAR)); - if (!oldLines) - { - free(blank); - return; - } - - ReadConsoleOutputCharacter(co, oldLines, oldLength, coordNextWrite, &bytesWritten); - - // Move to where we what to print - which is where we would've been, - // had console input not been in the way, - SetConsoleCursorPosition(co, coordNextWrite); - - WriteConsoleA(co, blank, oldLength, &bytesWritten, NULL); - free(blank); - - // And back to where we want to print again. - SetConsoleCursorPosition(co, coordNextWrite); - } - - // Actually write the string now! - WriteConsoleA(co, txt, (DWORD)len, &bytesWritten, NULL); - - // Next time, output where we left off. - GetConsoleScreenBufferInfo(co, &csbi); - coordNextWrite = csbi.dwCursorPosition; - - // Restore what was overwritten. - if (oldLines && entering_con_command) - WriteConsole(co, oldLines, oldLength, &bytesWritten, NULL); - if (oldLines) free(oldLines); - } - else // Redirected to a file. - WriteFile(co, txt, (DWORD)len, &bytesWritten, NULL); - } -#else -#ifdef HAVE_TERMIOS - if (consolevent) - { - tty_Hide(); - } -#endif - - if (!framebuffer) - fprintf(stderr, "%s", txt); -#ifdef HAVE_TERMIOS - if (consolevent) - { - tty_Show(); - } -#endif - - // 2004-03-03 AJR Since not all messages end in newline, some were getting displayed late. - if (!framebuffer) - fflush(stderr); - -#endif -} - -// -// I_GetKey -// -INT32 I_GetKey (void) -{ - // Warning: I_GetKey empties the event queue till next keypress - event_t *ev; - INT32 rc = 0; - - // return the first keypress from the event queue - for (; eventtail != eventhead; eventtail = (eventtail+1)&(MAXEVENTS-1)) - { - ev = &events[eventtail]; - if (ev->type == ev_keydown || ev->type == ev_console) - { - rc = ev->data1; - continue; - } - } - - return rc; -} - -// -// I_JoyScale -// -void I_JoyScale(void) -{ -#ifdef GP2X - if (JoyInfo.dev && SDL_JoystickIndex(JoyInfo.dev) == 0) - Joystick.bGamepadStyle = true; - else -#endif - Joystick.bGamepadStyle = cv_joyscale.value==0; - JoyInfo.scale = Joystick.bGamepadStyle?1:cv_joyscale.value; -} - -void I_JoyScale2(void) -{ -#ifdef GP2X - if (JoyInfo2.dev && SDL_JoystickIndex(JoyInfo2.dev) == 0) - Joystick.bGamepadStyle = true; - else -#endif - Joystick2.bGamepadStyle = cv_joyscale2.value==0; - JoyInfo2.scale = Joystick2.bGamepadStyle?1:cv_joyscale2.value; -} - -/** \brief Joystick 1 buttons states -*/ -static UINT64 lastjoybuttons = 0; - -/** \brief Joystick 1 hats state -*/ -static UINT64 lastjoyhats = 0; - -/** \brief Shuts down joystick 1 - - - \return void - - -*/ -static void I_ShutdownJoystick(void) -{ - INT32 i; - event_t event; - event.type=ev_keyup; - event.data2 = 0; - event.data3 = 0; - - lastjoybuttons = lastjoyhats = 0; - - // emulate the up of all joystick buttons - for (i=0;i= 0; i--) - { - joybuttons <<= 1; - if (SDL_JoystickGetButton(JoyInfo.dev,i)) - joybuttons |= 1; - } - - if (joybuttons != lastjoybuttons) - { - INT64 j = 1; // keep only bits that changed since last time - INT64 newbuttons = joybuttons ^ lastjoybuttons; - lastjoybuttons = joybuttons; - - for (i = 0; i < JOYBUTTONS; i++, j <<= 1) - { - if (newbuttons & j) // button changed state? - { - if (joybuttons & j) - event.type = ev_keydown; - else - event.type = ev_keyup; -#ifdef _PSP - if (i == 12) - event.data1 = KEY_ESCAPE; - else -#endif - event.data1 = KEY_JOY1 + i; - D_PostEvent(&event); - } - } - } -#endif - - for (i = JoyInfo.hats - 1; i >= 0; i--) - { - Uint8 hat = SDL_JoystickGetHat(JoyInfo.dev, i); - - if (hat & SDL_HAT_UP ) joyhats|=(UINT64)0x1<<(0 + 4*i); - if (hat & SDL_HAT_DOWN ) joyhats|=(UINT64)0x1<<(1 + 4*i); - if (hat & SDL_HAT_LEFT ) joyhats|=(UINT64)0x1<<(2 + 4*i); - if (hat & SDL_HAT_RIGHT) joyhats|=(UINT64)0x1<<(3 + 4*i); - } - - if (joyhats != lastjoyhats) - { - INT64 j = 1; // keep only bits that changed since last time - INT64 newhats = joyhats ^ lastjoyhats; - lastjoyhats = joyhats; - - for (i = 0; i < JOYHATS*4; i++, j <<= 1) - { - if (newhats & j) // hat changed state? - { - if (joyhats & j) - event.type = ev_keydown; - else - event.type = ev_keyup; - event.data1 = KEY_HAT1 + i; - D_PostEvent(&event); - } - } - } - - // send joystick axis positions - event.type = ev_joystick; - - for (i = JOYAXISSET - 1; i >= 0; i--) - { - event.data1 = i; - if (i*2 + 1 <= JoyInfo.axises) - axisx = SDL_JoystickGetAxis(JoyInfo.dev, i*2 + 0); - else axisx = 0; - if (i*2 + 2 <= JoyInfo.axises) - axisy = SDL_JoystickGetAxis(JoyInfo.dev, i*2 + 1); - else axisy = 0; - -#ifdef _arch_dreamcast // -128 to 127 - axisx = axisx*8; - axisy = axisy*8; -#else // -32768 to 32767 - axisx = axisx/32; - axisy = axisy/32; -#endif - - if (Joystick.bGamepadStyle) - { - // gamepad control type, on or off, live or die - if (axisx < -(JOYAXISRANGE/2)) - event.data2 = -1; - else if (axisx > (JOYAXISRANGE/2)) - event.data2 = 1; - else event.data2 = 0; - if (axisy < -(JOYAXISRANGE/2)) - event.data3 = -1; - else if (axisy > (JOYAXISRANGE/2)) - event.data3 = 1; - else event.data3 = 0; - } - else - { - - axisx = JoyInfo.scale?((axisx/JoyInfo.scale)*JoyInfo.scale):axisx; - axisy = JoyInfo.scale?((axisy/JoyInfo.scale)*JoyInfo.scale):axisy; - -#ifdef SDL_JDEADZONE - if (-SDL_JDEADZONE <= axisx && axisx <= SDL_JDEADZONE) axisx = 0; - if (-SDL_JDEADZONE <= axisy && axisy <= SDL_JDEADZONE) axisy = 0; -#endif - - // analog control style , just send the raw data - event.data2 = axisx; // x axis - event.data3 = axisy; // y axis - } - D_PostEvent(&event); - } -} - -/** \brief Open joystick handle - - \param fname name of joystick - - \return axises - - -*/ -static int joy_open(const char *fname) -{ - int joyindex = atoi(fname); - int num_joy = 0; - int i; - - if (joystick_started == 0 && joystick2_started == 0) - { - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) - { - CONS_Printf(M_GetText("Couldn't initialize joystick: %s\n"), SDL_GetError()); - return -1; - } - else - { - num_joy = SDL_NumJoysticks(); - } - - if (num_joy < joyindex) - { - CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); - for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); - I_ShutdownJoystick(); - return -1; - } - } - else - { - JoyReset(&JoyInfo); - //I_ShutdownJoystick(); - //joy_open(fname); - } - - num_joy = SDL_NumJoysticks(); - - if (joyindex <= 0 || num_joy == 0 || JoyInfo.oldjoy == joyindex) - { -// I_OutputMsg("Unable to use that joystick #(%s), non-number\n",fname); - if (num_joy != 0) - { - CONS_Printf(M_GetText("Found %d joysticks on this system\n"), num_joy); - for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); - } - else - CONS_Printf("%s", M_GetText("Found no joysticks on this system\n")); - if (joyindex <= 0 || num_joy == 0) return 0; - } - - JoyInfo.dev = SDL_JoystickOpen(joyindex-1); - - if (JoyInfo.dev == NULL) - { - CONS_Printf(M_GetText("Couldn't open joystick: %s\n"), SDL_GetError()); - I_ShutdownJoystick(); - return -1; - } - else - { - CONS_Printf(M_GetText("Joystick: %s\n"), SDL_JoystickName(JoyInfo.dev)); - JoyInfo.axises = SDL_JoystickNumAxes(JoyInfo.dev); - if (JoyInfo.axises > JOYAXISSET*2) - JoyInfo.axises = JOYAXISSET*2; -/* if (joyaxes<2) - { - I_OutputMsg("Not enought axes?\n"); - I_ShutdownJoystick(); - return 0; - }*/ - - JoyInfo.buttons = SDL_JoystickNumButtons(JoyInfo.dev); - if (JoyInfo.buttons > JOYBUTTONS) - JoyInfo.buttons = JOYBUTTONS; - -#ifdef DC - JoyInfo.hats = 0; -#else - JoyInfo.hats = SDL_JoystickNumHats(JoyInfo.dev); - if (JoyInfo.hats > JOYHATS) - JoyInfo.hats = JOYHATS; - - JoyInfo.balls = SDL_JoystickNumBalls(JoyInfo.dev); -#endif - - //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(JoyInfo.dev), "pad"); - - return JoyInfo.axises; - } -} - -//Joystick2 - -/** \brief Joystick 2 buttons states -*/ -static UINT64 lastjoy2buttons = 0; - -/** \brief Joystick 2 hats state -*/ -static UINT64 lastjoy2hats = 0; - -/** \brief Shuts down joystick 2 - - - \return void -*/ -static void I_ShutdownJoystick2(void) -{ - INT32 i; - event_t event; - event.type = ev_keyup; - event.data2 = 0; - event.data3 = 0; - - lastjoy2buttons = lastjoy2hats = 0; - - // emulate the up of all joystick buttons - for (i = 0; i < JOYBUTTONS; i++) - { - event.data1 = KEY_2JOY1 + i; - D_PostEvent(&event); - } - - // emulate the up of all joystick hats - for (i = 0; i < JOYHATS*4; i++) - { - event.data1 = KEY_2HAT1 + i; - D_PostEvent(&event); - } - - // reset joystick position - event.type = ev_joystick2; - for (i = 0; i < JOYAXISSET; i++) - { - event.data1 = i; - D_PostEvent(&event); - } - - JoyReset(&JoyInfo2); - if (!joystick_started && !joystick2_started && SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK) - { - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - if (cv_usejoystick2.value == 0) - { - DEBFILE("I_Joystick2: SDL's Joystick system has been shutdown\n"); - } - } -} - -void I_GetJoystick2Events(void) -{ - static event_t event = {0,0,0,0}; - INT32 i = 0; - UINT64 joyhats = 0; -#if 0 - INT64 joybuttons = 0; -#endif - INT32 axisx, axisy; - - if (!joystick2_started) - return; - - if (!JoyInfo2.dev) //I_ShutdownJoystick2(); - return; - - -#if 0 - //faB: look for as much buttons as g_input code supports, - // we don't use the others - for (i = JoyInfo2.buttons - 1; i >= 0; i--) - { - joybuttons <<= 1; - if (SDL_JoystickGetButton(JoyInfo2.dev,i)) - joybuttons |= 1; - } - - if (joybuttons != lastjoy2buttons) - { - INT64 j = 1; // keep only bits that changed since last time - INT64 newbuttons = joybuttons ^ lastjoy2buttons; - lastjoy2buttons = joybuttons; - - for (i = 0; i < JOYBUTTONS; i++, j <<= 1) - { - if (newbuttons & j) // button changed state? - { - if (joybuttons & j) - event.type = ev_keydown; - else - event.type = ev_keyup; - event.data1 = KEY_2JOY1 + i; - D_PostEvent(&event); - } - } - } -#endif - - for (i = JoyInfo2.hats - 1; i >= 0; i--) - { - Uint8 hat = SDL_JoystickGetHat(JoyInfo2.dev, i); - - if (hat & SDL_HAT_UP ) joyhats|=(UINT64)0x1<<(0 + 4*i); - if (hat & SDL_HAT_DOWN ) joyhats|=(UINT64)0x1<<(1 + 4*i); - if (hat & SDL_HAT_LEFT ) joyhats|=(UINT64)0x1<<(2 + 4*i); - if (hat & SDL_HAT_RIGHT) joyhats|=(UINT64)0x1<<(3 + 4*i); - } - - if (joyhats != lastjoy2hats) - { - INT64 j = 1; // keep only bits that changed since last time - INT64 newhats = joyhats ^ lastjoy2hats; - lastjoy2hats = joyhats; - - for (i = 0; i < JOYHATS*4; i++, j <<= 1) - { - if (newhats & j) // hat changed state? - { - if (joyhats & j) - event.type = ev_keydown; - else - event.type = ev_keyup; - event.data1 = KEY_2HAT1 + i; - D_PostEvent(&event); - } - } - } - - // send joystick axis positions - event.type = ev_joystick2; - - for (i = JOYAXISSET - 1; i >= 0; i--) - { - event.data1 = i; - if (i*2 + 1 <= JoyInfo2.axises) - axisx = SDL_JoystickGetAxis(JoyInfo2.dev, i*2 + 0); - else axisx = 0; - if (i*2 + 2 <= JoyInfo2.axises) - axisy = SDL_JoystickGetAxis(JoyInfo2.dev, i*2 + 1); - else axisy = 0; - -#ifdef _arch_dreamcast // -128 to 127 - axisx = axisx*8; - axisy = axisy*8; -#else // -32768 to 32767 - axisx = axisx/32; - axisy = axisy/32; -#endif - - if (Joystick2.bGamepadStyle) - { - // gamepad control type, on or off, live or die - if (axisx < -(JOYAXISRANGE/2)) - event.data2 = -1; - else if (axisx > (JOYAXISRANGE/2)) - event.data2 = 1; - else - event.data2 = 0; - if (axisy < -(JOYAXISRANGE/2)) - event.data3 = -1; - else if (axisy > (JOYAXISRANGE/2)) - event.data3 = 1; - else - event.data3 = 0; - } - else - { - - axisx = JoyInfo2.scale?((axisx/JoyInfo2.scale)*JoyInfo2.scale):axisx; - axisy = JoyInfo2.scale?((axisy/JoyInfo2.scale)*JoyInfo2.scale):axisy; - -#ifdef SDL_JDEADZONE - if (-SDL_JDEADZONE <= axisx && axisx <= SDL_JDEADZONE) axisx = 0; - if (-SDL_JDEADZONE <= axisy && axisy <= SDL_JDEADZONE) axisy = 0; -#endif - - // analog control style , just send the raw data - event.data2 = axisx; // x axis - event.data3 = axisy; // y axis - } - D_PostEvent(&event); - } - -} - -/** \brief Open joystick handle - - \param fname name of joystick - - \return axises - - -*/ -static int joy_open2(const char *fname) -{ - int joyindex = atoi(fname); - int num_joy = 0; - int i; - - if (joystick_started == 0 && joystick2_started == 0) - { - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) - { - CONS_Printf(M_GetText("Couldn't initialize joystick: %s\n"), SDL_GetError()); - return -1; - } - else - num_joy = SDL_NumJoysticks(); - - if (num_joy < joyindex) - { - CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); - for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); - I_ShutdownJoystick2(); - return -1; - } - } - else - { - JoyReset(&JoyInfo2); - //I_ShutdownJoystick(); - //joy_open(fname); - } - - num_joy = SDL_NumJoysticks(); - - if (joyindex <= 0 || num_joy == 0 || JoyInfo2.oldjoy == joyindex) - { -// I_OutputMsg("Unable to use that joystick #(%s), non-number\n",fname); - if (num_joy != 0) - { - CONS_Printf(M_GetText("Found %d joysticks on this system\n"), num_joy); - for (i = 0; i < num_joy; i++) - CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); - } - else - CONS_Printf("%s", M_GetText("Found no joysticks on this system\n")); - if (joyindex <= 0 || num_joy == 0) return 0; - } - - JoyInfo2.dev = SDL_JoystickOpen(joyindex-1); - - if (!JoyInfo2.dev) - { - CONS_Printf(M_GetText("Couldn't open joystick2: %s\n"), SDL_GetError()); - I_ShutdownJoystick2(); - return -1; - } - else - { - CONS_Printf(M_GetText("Joystick2: %s\n"), SDL_JoystickName(JoyInfo2.dev)); - JoyInfo2.axises = SDL_JoystickNumAxes(JoyInfo2.dev); - if (JoyInfo2.axises > JOYAXISSET*2) - JoyInfo2.axises = JOYAXISSET*2; -/* if (joyaxes < 2) - { - I_OutputMsg("Not enought axes?\n"); - I_ShutdownJoystick2(); - return 0; - }*/ - - JoyInfo2.buttons = SDL_JoystickNumButtons(JoyInfo2.dev); - if (JoyInfo2.buttons > JOYBUTTONS) - JoyInfo2.buttons = JOYBUTTONS; - -#ifdef DC - JoyInfo2.hats = 0; -#else - JoyInfo2.hats = SDL_JoystickNumHats(JoyInfo2.dev); - if (JoyInfo2.hats > JOYHATS) - JoyInfo2.hats = JOYHATS; - - JoyInfo2.balls = SDL_JoystickNumBalls(JoyInfo2.dev); -#endif - - //Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(JoyInfo2.dev), "pad"); - - return JoyInfo2.axises; - } -} - -// -// I_InitJoystick -// -void I_InitJoystick(void) -{ - I_ShutdownJoystick(); - if (!strcmp(cv_usejoystick.string, "0") || M_CheckParm("-nojoy")) - return; - if (joy_open(cv_usejoystick.string) != -1) - JoyInfo.oldjoy = atoi(cv_usejoystick.string); - else - { - cv_usejoystick.value = 0; - return; - } - joystick_started = 1; -} - -void I_InitJoystick2(void) -{ - I_ShutdownJoystick2(); - if (!strcmp(cv_usejoystick2.string, "0") || M_CheckParm("-nojoy")) - return; - if (joy_open2(cv_usejoystick2.string) != -1) - JoyInfo2.oldjoy = atoi(cv_usejoystick2.string); - else - { - cv_usejoystick2.value = 0; - return; - } - joystick2_started = 1; -} - -static void I_ShutdownInput(void) -{ - if (SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK) - { - JoyReset(&JoyInfo); - JoyReset(&JoyInfo2); - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - } - -} - -INT32 I_NumJoys(void) -{ - INT32 numjoy = 0; - if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0) - { - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != -1) - numjoy = SDL_NumJoysticks(); - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - } - else - numjoy = SDL_NumJoysticks(); - return numjoy; -} - -const char *I_GetJoyName(INT32 joyindex) -{ - const char *joyname = "NA"; - joyindex--; //SDL's Joystick System starts at 0, not 1 - if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0) - { - if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != -1) - joyname = SDL_JoystickNameForIndex(joyindex); - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - } - else - joyname = SDL_JoystickNameForIndex(joyindex); - return joyname; -} - -#ifndef NOMUMBLE -#ifdef HAVE_MUMBLE -// Best Mumble positional audio settings: -// Minimum distance 3.0 m -// Bloom 175% -// Maximum distance 80.0 m -// Minimum volume 50% -#define DEG2RAD (0.017453292519943295769236907684883l) // TAU/360 or PI/180 -#define MUMBLEUNIT (64.0f) // FRACUNITS in a Meter - -static struct { -#ifdef WINMUMBLE - UINT32 uiVersion; - DWORD uiTick; -#else - Uint32 uiVersion; - Uint32 uiTick; -#endif - float fAvatarPosition[3]; - float fAvatarFront[3]; - float fAvatarTop[3]; // defaults to Y-is-up (only used for leaning) - wchar_t name[256]; // game name - float fCameraPosition[3]; - float fCameraFront[3]; - float fCameraTop[3]; // defaults to Y-is-up (only used for leaning) - wchar_t identity[256]; // player id -#ifdef WINMUMBLE - UINT32 context_len; -#else - Uint32 context_len; -#endif - unsigned char context[256]; // server/team - wchar_t description[2048]; // game description -} *mumble = NULL; -#endif // HAVE_MUMBLE - -static void I_SetupMumble(void) -{ -#ifdef WINMUMBLE - HANDLE hMap = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"MumbleLink"); - if (!hMap) - return; - - mumble = MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(*mumble)); - if (!mumble) - CloseHandle(hMap); -#elif defined (HAVE_SHM) - int shmfd; - char memname[256]; - - snprintf(memname, 256, "/MumbleLink.%d", getuid()); - shmfd = shm_open(memname, O_RDWR, S_IRUSR | S_IWUSR); - - if(shmfd < 0) - return; - - mumble = mmap(NULL, sizeof(*mumble), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, 0); - if (mumble == MAP_FAILED) - mumble = NULL; -#endif -} - -void I_UpdateMumble(const mobj_t *mobj, const listener_t listener) -{ -#ifdef HAVE_MUMBLE - double angle; - fixed_t anglef; - - if (!mumble) - return; - - if(mumble->uiVersion != 2) { - wcsncpy(mumble->name, L"SRB2 "VERSIONSTRING, 256); - wcsncpy(mumble->description, L"Sonic Robo Blast 2 with integrated Mumble Link support.", 2048); - mumble->uiVersion = 2; - } - mumble->uiTick++; - - if (!netgame || gamestate != GS_LEVEL) { // Zero out, but never delink. - mumble->fAvatarPosition[0] = mumble->fAvatarPosition[1] = mumble->fAvatarPosition[2] = 0.0f; - mumble->fAvatarFront[0] = 1.0f; - mumble->fAvatarFront[1] = mumble->fAvatarFront[2] = 0.0f; - mumble->fCameraPosition[0] = mumble->fCameraPosition[1] = mumble->fCameraPosition[2] = 0.0f; - mumble->fCameraFront[0] = 1.0f; - mumble->fCameraFront[1] = mumble->fCameraFront[2] = 0.0f; - return; - } - - { - UINT8 *p = mumble->context; - WRITEMEM(p, server_context, 8); - WRITEINT16(p, gamemap); - mumble->context_len = p - mumble->context; - } - - if (mobj) { - mumble->fAvatarPosition[0] = FIXED_TO_FLOAT(mobj->x) / MUMBLEUNIT; - mumble->fAvatarPosition[1] = FIXED_TO_FLOAT(mobj->z) / MUMBLEUNIT; - mumble->fAvatarPosition[2] = FIXED_TO_FLOAT(mobj->y) / MUMBLEUNIT; - - anglef = AngleFixed(mobj->angle); - angle = FIXED_TO_FLOAT(anglef)*DEG2RAD; - mumble->fAvatarFront[0] = (float)cos(angle); - mumble->fAvatarFront[1] = 0.0f; - mumble->fAvatarFront[2] = (float)sin(angle); - } else { - mumble->fAvatarPosition[0] = mumble->fAvatarPosition[1] = mumble->fAvatarPosition[2] = 0.0f; - mumble->fAvatarFront[0] = 1.0f; - mumble->fAvatarFront[1] = mumble->fAvatarFront[2] = 0.0f; - } - - mumble->fCameraPosition[0] = FIXED_TO_FLOAT(listener.x) / MUMBLEUNIT; - mumble->fCameraPosition[1] = FIXED_TO_FLOAT(listener.z) / MUMBLEUNIT; - mumble->fCameraPosition[2] = FIXED_TO_FLOAT(listener.y) / MUMBLEUNIT; - - anglef = AngleFixed(listener.angle); - angle = FIXED_TO_FLOAT(anglef)*DEG2RAD; - mumble->fCameraFront[0] = (float)cos(angle); - mumble->fCameraFront[1] = 0.0f; - mumble->fCameraFront[2] = (float)sin(angle); -#else - (void)mobj; - (void)listener; -#endif // HAVE_MUMBLE -} -#undef WINMUMBLE -#endif // NOMUMBLE - -#ifdef HAVE_TERMIOS - -void I_GetMouseEvents(void) -{ - static UINT8 mdata[5]; - static INT32 i = 0,om2b = 0; - INT32 di, j, mlp, button; - event_t event; - const INT32 mswap[8] = {0, 4, 1, 5, 2, 6, 3, 7}; - - if (!mouse2_started) return; - for (mlp = 0; mlp < 20; mlp++) - { - for (; i < 5; i++) - { - di = read(fdmouse2, mdata+i, 1); - if (di == -1) return; - } - if ((mdata[0] & 0xf8) != 0x80) - { - for (j = 1; j < 5; j++) - if ((mdata[j] & 0xf8) == 0x80) - for (i = 0; i < 5-j; i++) // shift - mdata[i] = mdata[i+j]; - if (i < 5) continue; - } - else - { - button = mswap[~mdata[0] & 0x07]; - for (j = 0; j < MOUSEBUTTONS; j++) - { - if (om2b & (1<> 4); - } - else if (bytenum == 3) - { - dx = (char)((combytes[0] & 3) << 6); - dy = (char)((combytes[0] & 12) << 4); - dx = (char)(dx + combytes[1]); - dy = (char)(dy + combytes[2]); - handlermouse2x+= dx; - handlermouse2y+= dy; - } - else if (bytenum == 4) // fourth UINT8 (logitech mouses) - { - if (buffer[i] & 32) - handlermouse2buttons |= 4; - else - handlermouse2buttons &= ~4; - } - } -} - -void I_GetMouseEvents(void) -{ - static UINT8 lastbuttons2 = 0; //mouse movement - event_t event; - - if (mouse2filehandle == INVALID_HANDLE_VALUE) - return; - - I_PoolMouse2(); - // post key event for buttons - if (handlermouse2buttons != lastbuttons2) - { - INT32 i, j = 1, k; - k = (handlermouse2buttons ^ lastbuttons2); // only changed bit to 1 - lastbuttons2 = (UINT8)handlermouse2buttons; - - for (i = 0; i < MOUSEBUTTONS; i++, j <<= 1) - if (k & j) - { - if (handlermouse2buttons & j) - event.type = ev_keydown; - else - event.type = ev_keyup; - event.data1 = KEY_2MOUSE1+i; - D_PostEvent(&event); - } - } - - if (handlermouse2x != 0 || handlermouse2y != 0) - { - event.type = ev_mouse2; - event.data1 = 0; -// event.data1 = buttons; // not needed - event.data2 = handlermouse2x << 1; - event.data3 = -handlermouse2y << 1; - handlermouse2x = 0; - handlermouse2y = 0; - - D_PostEvent(&event); - } -} -#else -void I_GetMouseEvents(void){}; -#endif - -// -// I_StartupMouse2 -// -void I_StartupMouse2(void) -{ -#ifdef HAVE_TERMIOS - struct termios m2tio; - size_t i; - INT32 dtr = -1, rts = -1;; - I_ShutdownMouse2(); - if (cv_usemouse2.value == 0) return; - if ((fdmouse2 = open(cv_mouse2port.string, O_RDONLY|O_NONBLOCK|O_NOCTTY)) == -1) - { - CONS_Printf(M_GetText("Error opening %s!\n"), cv_mouse2port.string); - return; - } - tcflush(fdmouse2, TCIOFLUSH); - m2tio.c_iflag = IGNBRK; - m2tio.c_oflag = 0; - m2tio.c_cflag = CREAD|CLOCAL|HUPCL|CS8|CSTOPB|B1200; - m2tio.c_lflag = 0; - m2tio.c_cc[VTIME] = 0; - m2tio.c_cc[VMIN] = 1; - tcsetattr(fdmouse2, TCSANOW, &m2tio); - for (i = 0; i < strlen(cv_mouse2opt.string); i++) - { - if (toupper(cv_mouse2opt.string[i]) == 'D') - { - if (cv_mouse2opt.string[i+1] == '-') - dtr = 0; - else - dtr = 1; - } - if (toupper(cv_mouse2opt.string[i]) == 'R') - { - if (cv_mouse2opt.string[i+1] == '-') - rts = 0; - else - rts = 1; - } - if (dtr != -1 || rts != -1) - { - INT32 c; - if (!ioctl(fdmouse2, TIOCMGET, &c)) - { - if (!dtr) - c &= ~TIOCM_DTR; - else if (dtr > 0) - c |= TIOCM_DTR; - } - if (!rts) - c &= ~TIOCM_RTS; - else if (rts > 0) - c |= TIOCM_RTS; - ioctl(fdmouse2, TIOCMSET, &c); - } - } - mouse2_started = 1; - I_AddExitFunc(I_ShutdownMouse2); -#elif defined (_WIN32) && !defined (_XBOX) - DCB dcb; - - if (mouse2filehandle != INVALID_HANDLE_VALUE) - I_ShutdownMouse2(); - - if (cv_usemouse2.value == 0) - return; - - if (mouse2filehandle == INVALID_HANDLE_VALUE) - { - // COM file handle - mouse2filehandle = CreateFileA(cv_mouse2port.string, GENERIC_READ | GENERIC_WRITE, - 0, // exclusive access - NULL, // no security attrs - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (mouse2filehandle == INVALID_HANDLE_VALUE) - { - INT32 e = GetLastError(); - if (e == 5) - CONS_Alert(CONS_ERROR, M_GetText("Can't open %s: Access denied\n"), cv_mouse2port.string); - else - CONS_Alert(CONS_ERROR, M_GetText("Can't open %s: error %d\n"), cv_mouse2port.string, e); - return; - } - } - - // getevent when somthing happens - //SetCommMask(mouse2filehandle, EV_RXCHAR); - - // buffers - SetupComm(mouse2filehandle, MOUSECOMBUFFERSIZE, MOUSECOMBUFFERSIZE); - - // purge buffers - PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT - | PURGE_TXCLEAR | PURGE_RXCLEAR); - - // setup port to 1200 7N1 - dcb.DCBlength = sizeof (DCB); - - GetCommState(mouse2filehandle, &dcb); - - dcb.BaudRate = CBR_1200; - dcb.ByteSize = 7; - dcb.Parity = NOPARITY; - dcb.StopBits = ONESTOPBIT; - - dcb.fDtrControl = DTR_CONTROL_ENABLE; - dcb.fRtsControl = RTS_CONTROL_ENABLE; - - dcb.fBinary = TRUE; - dcb.fParity = TRUE; - - SetCommState(mouse2filehandle, &dcb); - I_AddExitFunc(I_ShutdownMouse2); -#endif -} - -// -// I_Tactile -// -void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect) -{ - // UNUSED. - (void)pFFType; - (void)FFEffect; -} - -void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect) -{ - // UNUSED. - (void)pFFType; - (void)FFEffect; -} - -/** \brief empty ticcmd for player 1 -*/ -static ticcmd_t emptycmd; - -ticcmd_t *I_BaseTiccmd(void) -{ - return &emptycmd; -} - -/** \brief empty ticcmd for player 2 -*/ -static ticcmd_t emptycmd2; - -ticcmd_t *I_BaseTiccmd2(void) -{ - return &emptycmd2; -} - -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) -static HMODULE winmm = NULL; -static DWORD starttickcount = 0; // hack for win2k time bug -static p_timeGetTime pfntimeGetTime = NULL; - -// --------- -// I_GetTime -// Use the High Resolution Timer if available, -// else use the multimedia timer which has 1 millisecond precision on Windowz 95, -// but lower precision on Windows NT -// --------- - -tic_t I_GetTime(void) -{ - tic_t newtics = 0; - - if (!starttickcount) // high precision timer - { - LARGE_INTEGER currtime; // use only LowPart if high resolution counter is not available - static LARGE_INTEGER basetime = {{0, 0}}; - - // use this if High Resolution timer is found - static LARGE_INTEGER frequency; - - if (!basetime.LowPart) - { - if (!QueryPerformanceFrequency(&frequency)) - frequency.QuadPart = 0; - else - QueryPerformanceCounter(&basetime); - } - - if (frequency.LowPart && QueryPerformanceCounter(&currtime)) - { - newtics = (INT32)((currtime.QuadPart - basetime.QuadPart) * NEWTICRATE - / frequency.QuadPart); - } - else if (pfntimeGetTime) - { - currtime.LowPart = pfntimeGetTime(); - if (!basetime.LowPart) - basetime.LowPart = currtime.LowPart; - newtics = ((currtime.LowPart - basetime.LowPart)/(1000/NEWTICRATE)); - } - } - else - newtics = (GetTickCount() - starttickcount)/(1000/NEWTICRATE); - - return newtics; -} - -static void I_ShutdownTimer(void) -{ - pfntimeGetTime = NULL; - if (winmm) - { - p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeEndPeriod"); - if (pfntimeEndPeriod) - pfntimeEndPeriod(1); - FreeLibrary(winmm); - winmm = NULL; - } -} -#else -// -// I_GetTime -// returns time in 1/TICRATE second tics -// -tic_t I_GetTime (void) -{ -#ifdef _arch_dreamcast - static Uint64 basetime = 0; - Uint64 ticks = timer_ms_gettime64(); //using timer_ms_gettime64 instand of SDL_GetTicks for the Dreamcast -#else - static Uint32 basetime = 0; - Uint32 ticks = SDL_GetTicks(); -#endif - - if (!basetime) - basetime = ticks; - - ticks -= basetime; - - ticks = (ticks*TICRATE); - -#if 0 //#ifdef _WIN32_WCE - ticks = (ticks/10); -#else - ticks = (ticks/1000); -#endif - - return (tic_t)ticks; -} -#endif - -// -//I_StartupTimer -// -void I_StartupTimer(void) -{ -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) - // for win2k time bug - if (M_CheckParm("-gettickcount")) - { - starttickcount = GetTickCount(); - CONS_Printf("%s", M_GetText("Using GetTickCount()\n")); - } - winmm = LoadLibraryA("winmm.dll"); - if (winmm) - { - p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeBeginPeriod"); - if (pfntimeBeginPeriod) - pfntimeBeginPeriod(1); - pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime"); - } - I_AddExitFunc(I_ShutdownTimer); -#elif 0 //#elif !defined (_arch_dreamcast) && !defined(GP2X) // the DC have it own timer and GP2X have broken pthreads? - if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0) - I_Error("SRB2: Needs SDL_Timer, Error: %s", SDL_GetError()); -#endif -} - - - -void I_Sleep(void) -{ -#if !(defined (_arch_dreamcast) || defined (_XBOX)) - if (cv_sleep.value != -1) - SDL_Delay(cv_sleep.value); -#endif -} - -INT32 I_StartupSystem(void) -{ - SDL_version SDLcompiled; - SDL_version SDLlinked; -#ifdef _XBOX -#ifdef __GNUC__ - char DP[] =" Sonic Robo Blast 2!\n"; - debugPrint(DP); -#endif - unlink("e:/Games/SRB2/stdout.txt"); - freopen("e:/Games/SRB2/stdout.txt", "w+", stdout); - unlink("e:/Games/SRB2/stderr.txt"); - freopen("e:/Games/SRB2/stderr.txt", "w+", stderr); -#endif -#ifdef _arch_dreamcast -#ifdef _DEBUG - //gdb_init(); -#endif - printf(__FILE__":%i\n",__LINE__); -#ifdef _DEBUG - //gdb_breakpoint(); -#endif -#endif - SDL_VERSION(&SDLcompiled) - SDL_GetVersion(&SDLlinked); - I_StartupConsole(); - I_OutputMsg("Compiled for SDL version: %d.%d.%d\n", - SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch); - I_OutputMsg("Linked with SDL version: %d.%d.%d\n", - SDLlinked.major, SDLlinked.minor, SDLlinked.patch); -#if 0 //#ifdef GP2X //start up everything - if (SDL_Init(SDL_INIT_NOPARACHUTE|SDL_INIT_EVERYTHING) < 0) -#else - if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0) -#endif - I_Error("SRB2: SDL System Error: %s", SDL_GetError()); //Alam: Oh no.... -#ifndef NOMUMBLE - I_SetupMumble(); -#endif - return 0; -} - - -// -// I_Quit -// -void I_Quit(void) -{ - static SDL_bool quiting = SDL_FALSE; - - /* prevent recursive I_Quit() */ - if (quiting) goto death; - SDLforceUngrabMouse(); - quiting = SDL_FALSE; - I_ShutdownConsole(); - M_SaveConfig(NULL); //save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif - G_SaveGameData(); // Tails 12-08-2002 - //added:16-02-98: when recording a demo, should exit using 'q' key, - // but sometimes we forget and use 'F10'.. so save here too. - - if (demorecording) - G_CheckDemoStatus(); - if (metalrecording) - G_StopMetalRecording(); - - D_QuitNetGame(); - I_ShutdownMusic(); - I_ShutdownSound(); - I_ShutdownCD(); - // use this for 1.28 19990220 by Kin - I_ShutdownGraphics(); - I_ShutdownInput(); - I_ShutdownSystem(); -#ifndef _arch_dreamcast - SDL_Quit(); -#endif - /* if option -noendtxt is set, don't print the text */ - if (!M_CheckParm("-noendtxt") && W_CheckNumForName("ENDOOM") != LUMPERROR) - { - printf("\r"); - ShowEndTxt(); - } -death: - W_Shutdown(); -#ifdef GP2X - chdir("/usr/gp2x"); - execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL); -#endif - exit(0); -} - -void I_WaitVBL(INT32 count) -{ - count = 1; - SDL_Delay(count); -} - -void I_BeginRead(void) -{ -} - -void I_EndRead(void) -{ -} - -// -// I_Error -// -/** \brief phuck recursive errors -*/ -static INT32 errorcount = 0; - -/** \brief recursive error detecting -*/ -static boolean shutdowning = false; - -void I_Error(const char *error, ...) -{ - va_list argptr; -#if (defined (MAC_ALERT) || defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX) - char buffer[8192]; -#endif - - // recursive error detecting - if (shutdowning) - { - errorcount++; - if (errorcount == 1) - SDLforceUngrabMouse(); - // try to shutdown each subsystem separately - if (errorcount == 2) - I_ShutdownMusic(); - if (errorcount == 3) - I_ShutdownSound(); - if (errorcount == 4) - I_ShutdownCD(); - if (errorcount == 5) - I_ShutdownGraphics(); - if (errorcount == 6) - I_ShutdownInput(); - if (errorcount == 7) - I_ShutdownSystem(); -#ifndef _arch_dreamcast - if (errorcount == 8) - SDL_Quit(); -#endif - if (errorcount == 9) - { - M_SaveConfig(NULL); - G_SaveGameData(); - } - if (errorcount > 20) - { -#ifdef MAC_ALERT - va_start(argptr, error); - vsprintf(buffer, error, argptr); - va_end(argptr); - // 2004-03-03 AJR Since the Mac user is most likely double clicking to run the game, give them a panel. - MacShowAlert("Recursive Error", buffer, "Quit", NULL, NULL); -#elif (defined (_WIN32) || (defined (_WIN32_WCE)) && !defined (__GNUC__)) && !defined (_XBOX) - va_start(argptr,error); - vsprintf(buffer, error, argptr); - va_end(argptr); -#ifndef _WIN32_WCE - { - HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE); - DWORD bytesWritten; - if (co != INVALID_HANDLE_VALUE) - { - if (GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &bytesWritten)) - WriteConsoleA(co, buffer, (DWORD)strlen(buffer), NULL, NULL); - else - WriteFile(co, buffer, (DWORD)strlen(buffer), &bytesWritten, NULL); - } - } -#endif - OutputDebugStringA(buffer); - MessageBoxA(vid.WndParent, buffer, "SRB2 Recursive Error", MB_OK|MB_ICONERROR); -#else - // Don't print garbage - va_start(argptr, error); - if (!framebuffer) - vfprintf (stderr, error, argptr); - va_end(argptr); -#endif - W_Shutdown(); -#ifdef GP2X - chdir("/usr/gp2x"); - execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL); -#endif - exit(-1); // recursive errors detected - } - } - shutdowning = true; - I_ShutdownConsole(); -#ifndef MAC_ALERT - // Message first. - va_start(argptr,error); - if (!framebuffer) - { - fprintf(stderr, "Error: "); - vfprintf(stderr,error,argptr); - fprintf(stderr, "\n"); - } - va_end(argptr); - - if (!framebuffer) - fflush(stderr); -#endif - M_SaveConfig(NULL); // save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif - G_SaveGameData(); // Tails 12-08-2002 - - // Shutdown. Here might be other errors. - if (demorecording) - G_CheckDemoStatus(); - if (metalrecording) - G_StopMetalRecording(); - - D_QuitNetGame(); - I_ShutdownMusic(); - I_ShutdownSound(); - I_ShutdownCD(); - // use this for 1.28 19990220 by Kin - I_ShutdownGraphics(); - I_ShutdownInput(); - I_ShutdownSystem(); -#ifndef _arch_dreamcast - SDL_Quit(); -#endif -#ifdef MAC_ALERT - va_start(argptr, error); - vsprintf(buffer, error, argptr); - va_end(argptr); - // 2004-03-03 AJR Since the Mac user is most likely double clicking to run the game, give them a panel. - MacShowAlert("Critical Error", buffer, "Quit", NULL, NULL); -#endif - W_Shutdown(); -#if defined (PARANOIA) && defined (__CYGWIN__) - *(INT32 *)2 = 4; //Alam: Debug! -#endif -#ifdef GP2X - chdir("/usr/gp2x"); - execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL); -#endif - exit(-1); -} - -/** \brief quit function table -*/ -static quitfuncptr quit_funcs[MAX_QUIT_FUNCS]; /* initialized to all bits 0 */ - -// -// Adds a function to the list that need to be called by I_SystemShutdown(). -// -void I_AddExitFunc(void (*func)()) -{ - INT32 c; - - for (c = 0; c < MAX_QUIT_FUNCS; c++) - { - if (!quit_funcs[c]) - { - quit_funcs[c] = func; - break; - } - } -} - - -// -// Removes a function from the list that need to be called by -// I_SystemShutdown(). -// -void I_RemoveExitFunc(void (*func)()) -{ - INT32 c; - - for (c = 0; c < MAX_QUIT_FUNCS; c++) - { - if (quit_funcs[c] == func) - { - while (c < MAX_QUIT_FUNCS-1) - { - quit_funcs[c] = quit_funcs[c+1]; - c++; - } - quit_funcs[MAX_QUIT_FUNCS-1] = NULL; - break; - } - } -} - -// -// Closes down everything. This includes restoring the initial -// palette and video mode, and removing whatever mouse, keyboard, and -// timer routines have been installed. -// -// NOTE: Shutdown user funcs are effectively called in reverse order. -// -void I_ShutdownSystem(void) -{ - INT32 c; - - for (c = MAX_QUIT_FUNCS-1; c >= 0; c--) - if (quit_funcs[c]) - (*quit_funcs[c])(); -#ifdef LOGMESSAGES - if (logstream) - { - fclose(logstream); - logstream = NULL; - } -#endif - -} - -void I_GetDiskFreeSpace(INT64 *freespace) -{ -#if defined (_arch_dreamcast) || defined (_PSP) - *freespace = 0; -#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) -#if defined (SOLARIS) || defined (__HAIKU__) || defined (_WII) || defined (_PS3) - *freespace = INT32_MAX; - return; -#else // Both Linux and BSD have this, apparently. - struct statfs stfs; - if (statfs(".", &stfs) == -1) - { - *freespace = INT32_MAX; - return; - } - *freespace = stfs.f_bavail * stfs.f_bsize; -#endif -#elif (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) - static p_GetDiskFreeSpaceExA pfnGetDiskFreeSpaceEx = NULL; - static boolean testwin95 = false; - ULARGE_INTEGER usedbytes, lfreespace; - - if (!testwin95) - { - pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); - testwin95 = true; - } - if (pfnGetDiskFreeSpaceEx) - { - if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL)) - *freespace = lfreespace.QuadPart; - else - *freespace = INT32_MAX; - } - else - { - DWORD SectorsPerCluster, BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters; - GetDiskFreeSpace(NULL, &SectorsPerCluster, &BytesPerSector, - &NumberOfFreeClusters, &TotalNumberOfClusters); - *freespace = BytesPerSector*SectorsPerCluster*NumberOfFreeClusters; - } -#else // Dummy for platform independent; 1GB should be enough - *freespace = 1024*1024*1024; -#endif -} - -char *I_GetUserName(void) -{ -#ifdef GP2X - static char username[MAXPLAYERNAME] = "GP2XUSER"; - return username; -#elif defined (PSP) - static char username[MAXPLAYERNAME] = "PSPUSER"; - return username; -#elif !(defined (_WIN32_WCE) || defined (_XBOX)) - static char username[MAXPLAYERNAME]; - char *p; -#ifdef _WIN32 - DWORD i = MAXPLAYERNAME; - - if (!GetUserNameA(username, &i)) -#endif - { - p = I_GetEnv("USER"); - if (!p) - { - p = I_GetEnv("user"); - if (!p) - { - p = I_GetEnv("USERNAME"); - if (!p) - { - p = I_GetEnv("username"); - if (!p) - { - return NULL; - } - } - } - } - strncpy(username, p, MAXPLAYERNAME); - } - - - if (strcmp(username, "") != 0) - return username; -#endif - return NULL; // dummy for platform independent version -} - -INT32 I_mkdir(const char *dirname, INT32 unixright) -{ -//[segabor] -#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (__CYGWIN__) || defined (__OS2__) - return mkdir(dirname, unixright); -#elif (defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX) - UNREFERENCED_PARAMETER(unixright); /// \todo should implement ntright under nt... - return CreateDirectoryA(dirname, NULL); -#else - (void)dirname; - (void)unixright; - return false; -#endif -} - -char *I_GetEnv(const char *name) -{ -#ifdef NEED_SDL_GETENV - return SDL_getenv(name); -#elif defined(_WIN32_WCE) - (void)name; - return NULL; -#else - return getenv(name); -#endif -} - -INT32 I_PutEnv(char *variable) -{ -#ifdef NEED_SDL_GETENV - return SDL_putenv(variable); -#elif defined(_WIN32_WCE) - return ((variable)?-1:0); -#else - return putenv(variable); -#endif -} - -/** \brief The isWadPathOk function - - \param path string path to check - - \return if true, wad file found - - -*/ -static boolean isWadPathOk(const char *path) -{ - char *wad3path = malloc(256); - - if (!wad3path) - return false; - - sprintf(wad3path, pandf, path, WADKEYWORD1); - - if (FIL_ReadFileOK(wad3path)) - { - free(wad3path); - return true; - } - - sprintf(wad3path, pandf, path, WADKEYWORD2); - - if (FIL_ReadFileOK(wad3path)) - { - free(wad3path); - return true; - } - - free(wad3path); - return false; -} - -static void pathonly(char *s) -{ - size_t j; - - for (j = strlen(s); j != (size_t)-1; j--) - if ((s[j] == '\\') || (s[j] == ':') || (s[j] == '/')) - { - if (s[j] == ':') s[j+1] = 0; - else s[j] = 0; - return; - } -} - -/** \brief search for srb2.srb in the given path - - \param searchDir starting path - - \return WAD path if not NULL - - -*/ -static const char *searchWad(const char *searchDir) -{ - static char tempsw[256] = ""; - filestatus_t fstemp; - - strcpy(tempsw, WADKEYWORD1); - fstemp = filesearch(tempsw,searchDir,NULL,true,20); - if (fstemp == FS_FOUND) - { - pathonly(tempsw); - return tempsw; - } - - strcpy(tempsw, WADKEYWORD2); - fstemp = filesearch(tempsw, searchDir, NULL, true, 20); - if (fstemp == FS_FOUND) - { - pathonly(tempsw); - return tempsw; - } - return NULL; -} - -/** \brief go through all possible paths and look for srb2.srb - - \return path to srb2.srb if any -*/ -static const char *locateWad(void) -{ - const char *envstr; - const char *WadPath; - - I_OutputMsg("SRB2WADDIR"); - // does SRB2WADDIR exist? - if (((envstr = I_GetEnv("SRB2WADDIR")) != NULL) && isWadPathOk(envstr)) - return envstr; - -#if defined(_WIN32_WCE) || defined(_PS3) || defined(_PSP) - // examine argv[0] - strcpy(returnWadPath, myargv[0]); - pathonly(returnWadPath); - I_PutEnv(va("HOME=%s",returnWadPath)); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif - -#ifndef NOCWD - I_OutputMsg(",."); - // examine current dir - strcpy(returnWadPath, "."); - if (isWadPathOk(returnWadPath)) - return NULL; -#endif - - // examine default dirs -#ifdef DEFAULTWADLOCATION1 - I_OutputMsg(","DEFAULTWADLOCATION1); - strcpy(returnWadPath, DEFAULTWADLOCATION1); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION2 - I_OutputMsg(","DEFAULTWADLOCATION2); - strcpy(returnWadPath, DEFAULTWADLOCATION2); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION3 - I_OutputMsg(","DEFAULTWADLOCATION3); - strcpy(returnWadPath, DEFAULTWADLOCATION3); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION4 - I_OutputMsg(","DEFAULTWADLOCATION4); - strcpy(returnWadPath, DEFAULTWADLOCATION4); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION5 - I_OutputMsg(","DEFAULTWADLOCATION5); - strcpy(returnWadPath, DEFAULTWADLOCATION5); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION6 - I_OutputMsg(","DEFAULTWADLOCATION6); - strcpy(returnWadPath, DEFAULTWADLOCATION6); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifdef DEFAULTWADLOCATION7 - I_OutputMsg(","DEFAULTWADLOCATION7); - strcpy(returnWadPath, DEFAULTWADLOCATION7); - if (isWadPathOk(returnWadPath)) - return returnWadPath; -#endif -#ifndef NOHOME - // find in $HOME - I_OutputMsg(",HOME"); - if ((envstr = I_GetEnv("HOME")) != NULL) - { - WadPath = searchWad(envstr); - if (WadPath) - return WadPath; - } -#endif -#ifdef DEFAULTSEARCHPATH1 - // find in /usr/local - I_OutputMsg(", in:"DEFAULTSEARCHPATH1); - WadPath = searchWad(DEFAULTSEARCHPATH1); - if (WadPath) - return WadPath; -#endif -#ifdef DEFAULTSEARCHPATH2 - // find in /usr/games - I_OutputMsg(", in:"DEFAULTSEARCHPATH2); - WadPath = searchWad(DEFAULTSEARCHPATH2); - if (WadPath) - return WadPath; -#endif -#ifdef DEFAULTSEARCHPATH3 - // find in ??? - I_OutputMsg(", in:"DEFAULTSEARCHPATH3); - WadPath = searchWad(DEFAULTSEARCHPATH3); - if (WadPath) - return WadPath; -#endif - // if nothing was found - return NULL; -} - -const char *I_LocateWad(void) -{ - const char *waddir; - - I_OutputMsg("Looking for WADs in: "); - waddir = locateWad(); - I_OutputMsg("\n"); - - if (waddir) - { - // change to the directory where we found srb2.srb -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) - SetCurrentDirectoryA(waddir); -#elif !defined (_WIN32_WCE) && !defined (_PS3) - if (chdir(waddir) == -1) - I_OutputMsg("Couldn't change working directory\n"); -#endif - } - return waddir; -} - -#if defined(LINUX) || defined(LINUX64) -#define MEMINFO_FILE "/proc/meminfo" -#define MEMTOTAL "MemTotal:" -#define MEMFREE "MemFree:" -#endif - -// quick fix for compil -UINT32 I_GetFreeMem(UINT32 *total) -{ -#if defined (_arch_dreamcast) - //Dreamcast! - if (total) - *total = 16<<20; - return 8<<20; -#elif defined (_PSP) - // PSP - if (total) - *total = 32<<20; - return 16<<20; -#elif defined (FREEBSD) - struct vmmeter sum; - kvm_t *kd; - struct nlist namelist[] = - { -#define X_SUM 0 - {"_cnt"}, - {NULL} - }; - if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) - { - *total = 0L; - return 0; - } - if (kvm_nlist(kd, namelist) != 0) - { - kvm_close (kd); - *total = 0L; - return 0; - } - if (kvm_read(kd, namelist[X_SUM].n_value, &sum, - sizeof (sum)) != sizeof (sum)) - { - kvm_close(kd); - *total = 0L; - return 0; - } - kvm_close(kd); - - if (total) - *total = sum.v_page_count * sum.v_page_size; - return sum.v_free_count * sum.v_page_size; -#elif defined (SOLARIS) - /* Just guess */ - if (total) - *total = 32 << 20; - return 32 << 20; -#elif (defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX) - MEMORYSTATUS info; - - info.dwLength = sizeof (MEMORYSTATUS); - GlobalMemoryStatus( &info ); - if (total) - *total = (UINT32)info.dwTotalPhys; - return (UINT32)info.dwAvailPhys; -#elif defined (__OS2__) - UINT32 pr_arena; - - if (total) - DosQuerySysInfo( QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, - (PVOID) total, sizeof (UINT32)); - DosQuerySysInfo( QSV_MAXPRMEM, QSV_MAXPRMEM, - (PVOID) &pr_arena, sizeof (UINT32)); - - return pr_arena; -#elif defined (LINUX) || defined (LINUX64) - /* Linux */ - char buf[1024]; - char *memTag; - UINT32 freeKBytes; - UINT32 totalKBytes; - INT32 n; - INT32 meminfo_fd = -1; - - meminfo_fd = open(MEMINFO_FILE, O_RDONLY); - n = read(meminfo_fd, buf, 1023); - close(meminfo_fd); - - if (n < 0) - { - // Error - *total = 0L; - return 0; - } - - buf[n] = '\0'; - if (NULL == (memTag = strstr(buf, MEMTOTAL))) - { - // Error - *total = 0L; - return 0; - } - - memTag += sizeof (MEMTOTAL); - totalKBytes = atoi(memTag); - - if (NULL == (memTag = strstr(buf, MEMFREE))) - { - // Error - *total = 0L; - return 0; - } - - memTag += sizeof (MEMFREE); - freeKBytes = atoi(memTag); - - if (total) - *total = totalKBytes << 10; - return freeKBytes << 10; -#else - // Guess 48 MB. - if (total) - *total = 48<<20; - return 48<<20; -#endif /* LINUX */ -} - -const CPUInfoFlags *I_CPUInfo(void) -{ -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) - static CPUInfoFlags WIN_CPUInfo; - SYSTEM_INFO SI; - p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); - - ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo)); - if (pfnCPUID) - { - WIN_CPUInfo.FPPE = pfnCPUID( 0); //PF_FLOATING_POINT_PRECISION_ERRATA - WIN_CPUInfo.FPE = pfnCPUID( 1); //PF_FLOATING_POINT_EMULATED - WIN_CPUInfo.cmpxchg = pfnCPUID( 2); //PF_COMPARE_EXCHANGE_DOUBLE - WIN_CPUInfo.MMX = pfnCPUID( 3); //PF_MMX_INSTRUCTIONS_AVAILABLE - WIN_CPUInfo.PPCMM64 = pfnCPUID( 4); //PF_PPC_MOVEMEM_64BIT_OK - WIN_CPUInfo.ALPHAbyte = pfnCPUID( 5); //PF_ALPHA_BYTE_INSTRUCTIONS - WIN_CPUInfo.SSE = pfnCPUID( 6); //PF_XMMI_INSTRUCTIONS_AVAILABLE - WIN_CPUInfo.AMD3DNow = pfnCPUID( 7); //PF_3DNOW_INSTRUCTIONS_AVAILABLE - WIN_CPUInfo.RDTSC = pfnCPUID( 8); //PF_RDTSC_INSTRUCTION_AVAILABLE - WIN_CPUInfo.PAE = pfnCPUID( 9); //PF_PAE_ENABLED - WIN_CPUInfo.SSE2 = pfnCPUID(10); //PF_XMMI64_INSTRUCTIONS_AVAILABLE - //WIN_CPUInfo.blank = pfnCPUID(11); //PF_SSE_DAZ_MODE_AVAILABLE - WIN_CPUInfo.DEP = pfnCPUID(12); //PF_NX_ENABLED - WIN_CPUInfo.SSE3 = pfnCPUID(13); //PF_SSE3_INSTRUCTIONS_AVAILABLE - WIN_CPUInfo.cmpxchg16b = pfnCPUID(14); //PF_COMPARE_EXCHANGE128 - WIN_CPUInfo.cmp8xchg16 = pfnCPUID(15); //PF_COMPARE64_EXCHANGE128 - WIN_CPUInfo.PFC = pfnCPUID(16); //PF_CHANNELS_ENABLED - } -#ifdef HAVE_SDLCPUINFO - else - { - WIN_CPUInfo.RDTSC = SDL_HasRDTSC(); - WIN_CPUInfo.MMX = SDL_HasMMX(); - WIN_CPUInfo.AMD3DNow = SDL_Has3DNow(); - WIN_CPUInfo.SSE = SDL_HasSSE(); - WIN_CPUInfo.SSE2 = SDL_HasSSE2(); - WIN_CPUInfo.AltiVec = SDL_HasAltiVec(); - } - WIN_CPUInfo.MMXExt = SDL_FALSE; //SDL_HasMMXExt(); No longer in SDL2 - WIN_CPUInfo.AMD3DNowExt = SDL_FALSE; //SDL_Has3DNowExt(); No longer in SDL2 -#endif - GetSystemInfo(&SI); - WIN_CPUInfo.CPUs = SI.dwNumberOfProcessors; - WIN_CPUInfo.IA64 = (SI.dwProcessorType == 2200); // PROCESSOR_INTEL_IA64 - WIN_CPUInfo.AMD64 = (SI.dwProcessorType == 8664); // PROCESSOR_AMD_X8664 - return &WIN_CPUInfo; -#elif defined (HAVE_SDLCPUINFO) - static CPUInfoFlags SDL_CPUInfo; - memset(&SDL_CPUInfo,0,sizeof (CPUInfoFlags)); - SDL_CPUInfo.RDTSC = SDL_HasRDTSC(); - SDL_CPUInfo.MMX = SDL_HasMMX(); - SDL_CPUInfo.MMXExt = SDL_FALSE; //SDL_HasMMXExt(); No longer in SDL2 - SDL_CPUInfo.AMD3DNow = SDL_Has3DNow(); - SDL_CPUInfo.AMD3DNowExt = SDL_FALSE; //SDL_Has3DNowExt(); No longer in SDL2 - SDL_CPUInfo.SSE = SDL_HasSSE(); - SDL_CPUInfo.SSE2 = SDL_HasSSE2(); - SDL_CPUInfo.AltiVec = SDL_HasAltiVec(); - return &SDL_CPUInfo; -#else - return NULL; /// \todo CPUID asm -#endif -} - -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) -static void CPUAffinity_OnChange(void); -static consvar_t cv_cpuaffinity = {"cpuaffinity", "-1", CV_SAVE | CV_CALL, NULL, CPUAffinity_OnChange, 0, NULL, NULL, 0, 0, NULL}; - -static p_GetCurrentProcess pfnGetCurrentProcess = NULL; -static p_GetProcessAffinityMask pfnGetProcessAffinityMask = NULL; -static p_SetProcessAffinityMask pfnSetProcessAffinityMask = NULL; - -static inline VOID GetAffinityFuncs(VOID) -{ - HMODULE h = GetModuleHandleA("kernel32.dll"); - pfnGetCurrentProcess = (p_GetCurrentProcess)GetProcAddress(h, "GetCurrentProcess"); - pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)GetProcAddress(h, "GetProcessAffinityMask"); - pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)GetProcAddress(h, "SetProcessAffinityMask"); -} - -static void CPUAffinity_OnChange(void) -{ - DWORD_PTR dwProcMask, dwSysMask; - HANDLE selfpid; - - if (!pfnGetCurrentProcess || !pfnGetProcessAffinityMask || !pfnSetProcessAffinityMask) - return; - else - selfpid = pfnGetCurrentProcess(); - - pfnGetProcessAffinityMask(selfpid, &dwProcMask, &dwSysMask); - - /* If resulting mask is zero, don't change anything and fall back to - * actual mask. - */ - if(dwSysMask & cv_cpuaffinity.value) - { - pfnSetProcessAffinityMask(selfpid, dwSysMask & cv_cpuaffinity.value); - CV_StealthSetValue(&cv_cpuaffinity, (INT32)(dwSysMask & cv_cpuaffinity.value)); - } - else - CV_StealthSetValue(&cv_cpuaffinity, (INT32)dwProcMask); -} -#endif - -void I_RegisterSysCommands(void) -{ -#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) - GetAffinityFuncs(); - CV_RegisterVar(&cv_cpuaffinity); -#endif -} -#endif diff --git a/src/sdl2/i_ttf.c b/src/sdl2/i_ttf.c deleted file mode 100644 index 4a41f120..00000000 --- a/src/sdl2/i_ttf.c +++ /dev/null @@ -1,340 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2011 by Callum Dickinson. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL_ttf interface code. Necessary for platforms with no framebuffer console systems. - -#if defined(HAVE_SDL) && defined(HAVE_TTF) -#include "SDL.h" -#include "SDL_ttf.h" -#include "../doomdef.h" -#include "../doomstat.h" -#include "../d_netfil.h" -#include "../filesrch.h" -#include "i_ttf.h" - -// Search directories to find aforementioned TTF file. -#ifdef _PS3 -#include -#define FONTSEARCHPATH1 "/dev_hdd0/game/SRB2-PS3_/USRDIR/etc" -#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) -#define FONTSEARCHPATH1 "/usr/share/fonts" -#define FONTSEARCHPATH2 "/usr/local/share/fonts" -#define FONTSEARCHPATH3 "/usr/games/SRB2" -#define FONTSEARCHPATH4 "/usr/local/games/SRB2" -#define FONTSEARCHPATH5 "/usr/local/share/games/SRB2" -#else -#define FONTSEARCHPATH1 "." -#endif - -#define FONTHANDLE -1 - -// Renduring surfaces. -SDL_Surface *TTFSurface = NULL; -SDL_Surface *TTFRendSurface = NULL; -// Text box. -SDL_Rect TTFRect; -// Temporary storage for the new TTFRect, used to check for -// line wrapping. -SDL_Rect TTFRectCheck; -// Text rendering resolution. -videoResolution res; -// Text storage buffer, the contents get printed to the SDL surface. -char textbuffer[8192]; - -// look for default ttf file in given directory -static char *searchFont(const char *fontsearchDir) -{ - static char tempsw[256] = ""; - filestatus_t fstemp; - - strcpy(tempsw, FONTFILE); - fstemp = filesearch(tempsw, fontsearchDir, NULL, true, 20); - if (fstemp == FS_FOUND) - { - return tempsw; - } - return NULL; -} - -// Load TTF font from file. -INT32 I_TTFLoadFont(const char *file, UINT32 ptsize) -{ - TTF_Font *tmpfont = NULL; - float fontsize; - - // If a font is currently loaded, unload it. - if (currentfont) - { - TTF_CloseFont(currentfont); - } - - // Scale the specified font point size for the current resolution. - fontsize = (ptsize * 0.005f) * (res.width - res.height); - - tmpfont = TTF_OpenFont(file, fontsize); - - if (!tmpfont) - return FONTHANDLE; - - // set pointer for current font - currentfont = tmpfont; - - // set current font point size - currentfontpoint = ptsize; - - // get font properties, and set them - currentfontstyle = TTF_GetFontStyle(currentfont); - TTF_SetFontStyle(currentfont, currentfontstyle); - - // these functions only exist in SDL_ttf 2.0.10 onwards -#if SDL_TTF_VERSION_ATLEAST(2,0,10) - currentfontkerning = TTF_GetFontKerning(currentfont); - TTF_SetFontKerning(currentfont, currentfontkerning); - - currentfonthinting = TTF_GetFontHinting(currentfont); - TTF_SetFontHinting(currentfont, currentfonthinting); - - currentfontoutline = TTF_GetFontOutline(currentfont); - TTF_SetFontOutline(currentfont, currentfontoutline); -#endif - - return 0; -} - -static void I_TTFRendSurface(const char *textmsg, TTF_Font *font, TextQuality quality, SDL_Color fontfgcolor, SDL_Color fontbgcolor) -{ - // Print text in the buffer. - // SDL_ttf has three modes to draw text. - // Solid rendering is quick, but dirty. Use it if you need speed more than quality. - switch (quality) - { - case solid: - TTFRendSurface = TTF_RenderText_Solid(font, textmsg, fontfgcolor); - break; - // Shaded rendering adds a background to the rendered text. Because of this, I_TTFDrawText - // takes an extra color more than the other styles to be a background color. - // Shaded is supposedly as fast as solid rendering and about as good quality as blended. - case shaded: - TTFRendSurface = TTF_RenderText_Shaded(font, textmsg, fontfgcolor, fontbgcolor); - break; - // Blended rendering is the opposite of solid. Good quality, but slow. - case blended: - TTFRendSurface = TTF_RenderText_Blended(font, textmsg, fontfgcolor); - break; - } - - // Get SDL to update the main surface. - SDL_BlitSurface(TTFRendSurface, NULL, TTFSurface, &TTFRect); - SDL_Flip(TTFSurface); -} - -// Draw text to screen. It will accept four colour vales (red, green, blue and alpha) -// with foreground for draw modes Solid and Blended, and an extra four values for background -// colour with draw type Shaded. -void I_TTFDrawText(TTF_Font *font, TextQuality quality, INT32 fgR, INT32 fgG, INT32 fgB, INT32 fgA, INT32 bgR, INT32 bgG, INT32 bgB, INT32 bgA, const char *textmsg) -{ - // Temporary small buffer to store character to process. - // NULL pointer to prevc to kill warning - char c, prevc = 0x0; - // hack to allow TTF_SizeText to work properly. - char linebuffer[2]; - // Don't need h, but TTF_SizeText needs a height parameter - INT32 w, h; - - // Globally declare foreground and background text colours, - // text drawing mode and the font to draw. - SDL_Color fontfgcolor = {fgR, fgG, fgB, fgA}; - SDL_Color fontbgcolor = {bgR, bgG, bgB, bgA}; - - // Keep on processing until the null terminator in the text buffer is reached. - while (*textmsg != '\0') - { - // Copy pointer for current character into the temporary buffer. - c = *textmsg; - // If c is a newline, move to the next available line. - if (c == '\n') - { - TTFRectCheck.x = 0; - TTFRectCheck.y += (currentfontpoint + 1); - } - // Otherwise... - else - { - // If the previous character was a newline, actually move to the next line. - if (prevc == '\n') - { - if (textbuffer != NULL) - { - // Render cached text to the SDL surface. - I_TTFRendSurface(textbuffer, font, quality, fontfgcolor, fontbgcolor); - // Empty text buffer. - memset(textbuffer, '\0', 1); - } - TTFRect.x = TTFRectCheck.x; - TTFRect.y = TTFRectCheck.y; - } - // Copy the character to the text buffer. - sprintf(textbuffer, "%s%c", textbuffer, c); - // Hack to allow TTF_SizeText to work properly. - sprintf(linebuffer, "%c", c); - // If we have reached the end of the screen, move to the next available line. - TTF_SizeText(currentfont, linebuffer, &w, &h); - TTFRectCheck.x += w; - if (TTFRectCheck.x >= res.width) - { - // Render cached text to the SDL surface. - I_TTFRendSurface(textbuffer, font, quality, fontfgcolor, fontbgcolor); - // Empty text buffer. - memset(textbuffer, '\0', 1); - // Move to the next line. - TTFRectCheck.x = 0; - TTFRectCheck.y += (currentfontpoint + 1); - // Set stored co-ordinates for next line. - TTFRect.x = TTFRectCheck.x; - TTFRect.y = TTFRectCheck.y; - } - } - // Add 1 to the pointer reference for the character to process. - textmsg++; - // Copy contents of the now-old buffer to somewhere else, so it can be referenced in next loop. - prevc = c; - } - - // If the buffer was previously emptied by a line wrapping operation and - // no text came after that, don't print anything. Otherwise, print everything - // still in the buffer. - if (textbuffer != NULL) - { - // Render cached text to the SDL surface. - I_TTFRendSurface(textbuffer, font, quality, fontfgcolor, fontbgcolor); - // Empty text buffer. - memset(textbuffer, '\0', 1); - // Set stored co-ordinates for next line. - TTFRect.x = TTFRectCheck.x; - TTFRect.y = TTFRectCheck.y; - } -} - -// Initialise SDL_ttf. -void I_StartupTTF(UINT32 fontpointsize, Uint32 initflags, Uint32 vidmodeflags) -{ - char *fontpath = NULL; - INT32 fontstatus = -1; -#ifdef _PS3 - videoState state; - videoGetState(0, 0, &state); - videoGetResolution(state.displayMode.resolution, &res); - bitsperpixel = 24; -#else - res.width = 320; - res.height = 200; - bitsperpixel = 8; -#endif - - // what's the point of trying to display an error? - // SDL_ttf is not started, can't display anything to screen (presumably)... - if (SDL_InitSubSystem(initflags) < 0) - I_Error("Couldn't initialize SDL: %s\n", SDL_GetError()); - - TTFSurface = SDL_SetVideoMode(res.width, res.height, bitsperpixel, vidmodeflags); - if (!TTFSurface) - I_Error("Couldn't set SDL Video resolution: %s\n", SDL_GetError()); - - if (TTF_Init() < 0) - I_Error("Couldn't start SDL_ttf: %s\n", TTF_GetError()); - - // look for default font in many directories -#ifdef FONTSEARCHPATH1 - fontpath = searchFont(FONTSEARCHPATH1); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); -#endif -#ifdef FONTSEARCHPATH2 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH2); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif -#ifdef FONTSEARCHPATH3 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH3); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif -#ifdef FONTSEARCHPATH4 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH4); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif -#ifdef FONTSEARCHPATH5 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH5); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif -#ifdef FONTSEARCHPATH6 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH6); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif -#ifdef FONTSEARCHPATH7 - if (fontstatus < 0) - { - fontpath = searchFont(FONTSEARCHPATH7); - if (fontpath) fontstatus = I_TTFLoadFont(fontpath, fontpointsize); - } -#endif - // argh! no font file found! disable SDL_ttf code - if (fontstatus < 0) - { - I_ShutdownTTF(); - CONS_Printf("Unable to find default font files! Not loading SDL_ttf\n"); - } - else - { - // Get SDL_ttf compiled and linked version - SDL_version TTFcompiled; - const SDL_version *TTFlinked; - - SDL_TTF_VERSION(&TTFcompiled); - TTFlinked = TTF_Linked_Version(); - - // Display it on screen - CONS_Printf("Compiled for SDL_ttf version: %d.%d.%d\n", - TTFcompiled.major, TTFcompiled.minor, TTFcompiled.patch); - CONS_Printf("Linked with SDL_ttf version: %d.%d.%d\n", - TTFlinked->major, TTFlinked->minor, TTFlinked->patch); - } -} - -void I_ShutdownTTF(void) -{ - // close current font - TTF_CloseFont(currentfont); - // shutdown SDL_ttf - TTF_Quit(); - - // Free TTF rendering surfaces. - SDL_FreeSurface(TTFSurface); - SDL_FreeSurface(TTFRendSurface); -} -#endif diff --git a/src/sdl2/i_ttf.h b/src/sdl2/i_ttf.h deleted file mode 100644 index 929c8021..00000000 --- a/src/sdl2/i_ttf.h +++ /dev/null @@ -1,88 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2011 by Callum Dickinson. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL_ttf interface code. Necessary for platforms with SDL inits that need to run immediately. - -#ifndef __I_TTF__ -#define __I_TTF__ - -#include "../doomdef.h" -#include "SDL_ttf.h" - -// Default name for standard TTF file. -#define FONTFILE "srb2.ttf" -#define FONTPOINTSIZE 12 - -// Default font foreground colours -#define DEFAULTFONTFGR 255 -#define DEFAULTFONTFGG 255 -#define DEFAULTFONTFGB 255 -#define DEFAULTFONTFGA 255 - -// Default font background colours -#define DEFAULTFONTBGR 0 -#define DEFAULTFONTBGG 0 -#define DEFAULTFONTBGB 0 -#define DEFAULTFONTBGA 255 - -#ifndef SDL_TTF_COMPILEDVERSION -#define SDL_TTF_COMPILEDVERSION \ - SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) -#endif - -#ifndef SDL_TTF_VERSION_ATLEAST -#define SDL_TTF_VERSION_ATLEAST(X, Y, Z) \ - (SDL_TTF_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) -#endif - -TTF_Font* currentfont; -int currentfontpoint; -int currentfontstyle; -#if SDL_TTF_VERSION_ATLEAST(2,0,10) -int currentfontkerning; -int currentfonthinting; -int currentfontoutline; -#endif - -#ifndef _PS3 -typedef struct -{ - UINT16 width; - UINT16 height; -} VideoResolution; -#endif -UINT8 bitsperpixel; - -typedef enum -{ - solid, - shaded, - blended -} TextQuality; - -// Load TTF font from file. -INT32 I_TTFLoadFont(const char *file, UINT32 ptsize); - -// Draw TTF text to screen. It will accept four colour vales (red, green, blue and alpha) -// with foreground for draw modes Solid and Blended, and an extra four values for background -// colour with draw type Shaded. -void I_TTFDrawText(TTF_Font *font, TextQuality quality, INT32 fgR, INT32 fgG, INT32 fgB, INT32 fgA, INT32 bgR, INT32 bgG, INT32 bgB, INT32 bgA, const char *textmsg); - -// Initialise SDL_ttf. -void I_StartupTTF(UINT32 fontpointsize, Uint32 initflags, Uint32 vidmodeflags); - -void I_ShutdownTTF(void); -#endif diff --git a/src/sdl2/i_video.c b/src/sdl2/i_video.c deleted file mode 100644 index fd029832..00000000 --- a/src/sdl2/i_video.c +++ /dev/null @@ -1,2000 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SRB2 graphics stuff for SDL - -#include - -#include - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#ifdef HAVE_SDL - -#include "SDL.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#if SDL_VERSION_ATLEAST(1,3,0) -#define SDLK_EQUALS SDLK_KP_EQUALSAS400 -#define SDLK_LMETA SDLK_LGUI -#define SDLK_RMETA SDLK_RGUI -#else -#define HAVE_SDLMETAKEYS -#endif - -#ifdef HAVE_TTF -#include "i_ttf.h" -#endif - -#ifdef HAVE_IMAGE -#include "SDL_image.h" -#endif - -#ifdef HAVE_IMAGE -#include "SDL_icon.xpm" -#endif - -#include "../doomdef.h" - -#if defined (_WIN32) -#include "SDL_syswm.h" -#endif - -#include "../doomstat.h" -#include "../i_system.h" -#include "../v_video.h" -#include "../m_argv.h" -#include "../m_menu.h" -#include "../d_main.h" -#include "../s_sound.h" -#include "../i_sound.h" // midi pause/unpause -#include "../i_joy.h" -#include "../st_stuff.h" -#include "../g_game.h" -#include "../i_video.h" -#include "../console.h" -#include "../command.h" -#include "sdlmain.h" -#ifdef HWRENDER -#include "../hardware/hw_main.h" -#include "../hardware/hw_drv.h" -// For dynamic referencing of HW rendering functions -#include "hwsym_sdl.h" -#include "ogl_sdl.h" -#endif - -// maximum number of windowed modes (see windowedModes[][]) -#define MAXWINMODES (17) - -/** \brief -*/ -static INT32 numVidModes = -1; - -/** \brief -*/ -static char vidModeName[33][32]; // allow 33 different modes - -rendermode_t rendermode=render_soft; - -boolean highcolor = false; - -// synchronize page flipping with screen refresh -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; - -UINT8 graphics_started = 0; // Is used in console.c and screen.c - -// To disable fullscreen at startup; is set in VID_PrepareModeList -boolean allow_fullscreen = false; -static SDL_bool disable_fullscreen = SDL_FALSE; -#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value -static SDL_bool disable_mouse = SDL_FALSE; -#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus) -#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN) -#define MOUSEBUTTONS_MAX MOUSEBUTTONS - -// first entry in the modelist which is not bigger than MAXVIDWIDTHxMAXVIDHEIGHT -static INT32 firstEntry = 0; - -// SDL vars -static SDL_Surface *vidSurface = NULL; -static SDL_Surface *bufSurface = NULL; -static SDL_Surface *icoSurface = NULL; -static SDL_Color localPalette[256]; -#if 0 -static SDL_Rect **modeList = NULL; -static Uint8 BitsPerPixel = 16; -#endif -static Uint16 realwidth = BASEVIDWIDTH; -static Uint16 realheight = BASEVIDHEIGHT; -static const Uint32 surfaceFlagsW = 0/*|SDL_RESIZABLE*/; -static const Uint32 surfaceFlagsF = 0; -static SDL_bool mousegrabok = SDL_TRUE; -#define HalfWarpMouse(x,y) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2)) -static SDL_bool videoblitok = SDL_FALSE; -static SDL_bool exposevideo = SDL_FALSE; -static SDL_bool usesdl2soft = SDL_FALSE; -static SDL_bool borderlesswindow = SDL_FALSE; - -// SDL2 vars -SDL_Window *window; -SDL_Renderer *renderer; -static SDL_Texture *texture; -static SDL_bool havefocus = SDL_TRUE; -static const char *fallback_resolution_name = "Fallback"; - -// windowed video modes from which to choose from. -static INT32 windowedModes[MAXWINMODES][2] = -{ - {1920,1200}, // 1.60,6.00 - {1920,1080}, // 1.66 - {1680,1050}, // 1.60,5.25 - {1600, 900}, // 1.66 - {1366, 768}, // 1.66 - {1440, 900}, // 1.60,4.50 - {1280,1024}, // 1.33? - {1280, 960}, // 1.33,4.00 - {1280, 800}, // 1.60,4.00 - {1280, 720}, // 1.66 - {1152, 864}, // 1.33,3.60 - {1024, 768}, // 1.33,3.20 - { 800, 600}, // 1.33,2.50 - { 640, 480}, // 1.33,2.00 - { 640, 400}, // 1.60,2.00 - { 320, 240}, // 1.33,1.00 - { 320, 200}, // 1.60,1.00 -}; - -static void Impl_VideoSetupSDLBuffer(void); -static void Impl_VideoSetupBuffer(void); -static SDL_bool Impl_CreateWindow(SDL_bool fullscreen); -static void Impl_SetWindowName(const char *title); -static void Impl_SetWindowIcon(void); - -static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) -{ - static SDL_bool wasfullscreen = SDL_FALSE; - static SDL_bool glfallbackresolution = SDL_FALSE; - Uint32 rmask; - Uint32 gmask; - Uint32 bmask; - Uint32 amask; - int bpp = 16; - int sw_texture_format = SDL_PIXELFORMAT_ABGR8888; - - realwidth = vid.width; - realheight = vid.height; - - if (window) - { - if (fullscreen) - { - wasfullscreen = SDL_TRUE; - SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); - } - else if (!fullscreen && wasfullscreen) - { - wasfullscreen = SDL_FALSE; - glfallbackresolution = SDL_FALSE; - SDL_SetWindowFullscreen(window, 0); - SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); - } - else if (!wasfullscreen) - { - // Reposition window only in windowed mode - SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); - } - } - else - { - Impl_CreateWindow(fullscreen); - Impl_SetWindowIcon(); - wasfullscreen = fullscreen; - SDL_SetWindowSize(window, width, height); - if (fullscreen) - { - SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); - } - } - - if (rendermode == render_opengl) - { - int sdlw, sdlh; - SDL_GetWindowSize(window, &sdlw, &sdlh); - // Logical fullscreen is not implemented yet for OpenGL, so... - // Special case handling - if (glfallbackresolution == SDL_FALSE && fullscreen && width != sdlw && height != sdlh) - { - if (VID_GetModeForSize(sdlw, sdlh) != -1) - { - wasfullscreen = SDL_TRUE; - VID_SetMode(VID_GetModeForSize(sdlw, sdlh)); - return; - } - else - { - wasfullscreen = SDL_TRUE; - glfallbackresolution = SDL_TRUE; - VID_SetMode(-1); - return; - } - } - OglSdlSurface(vid.width, vid.height); - } - - if (rendermode == render_soft) - { - SDL_RenderClear(renderer); - SDL_RenderSetLogicalSize(renderer, width, height); - // Set up Texture - realwidth = width; - realheight = height; - if (texture != NULL) - { - SDL_DestroyTexture(texture); - } - - if (!usesdl2soft) - { - sw_texture_format = SDL_PIXELFORMAT_RGB565; - } - else - { - bpp = 32; - sw_texture_format = SDL_PIXELFORMAT_RGBA8888; - } - - texture = SDL_CreateTexture(renderer, sw_texture_format, SDL_TEXTUREACCESS_STREAMING, width, height); - - // Set up SW surface - if (vidSurface != NULL) - { - SDL_FreeSurface(vidSurface); - } - SDL_PixelFormatEnumToMasks(sw_texture_format, &bpp, &rmask, &gmask, &bmask, &amask); - vidSurface = SDL_CreateRGBSurface(0, width, height, bpp, rmask, gmask, bmask, amask); - } -} - -// -// Translates the SDL key into SRB2 key -// - -static INT32 SDLatekey(SDL_Keycode sym) -{ - INT32 rc = sym + 0x80; - - switch (sym) - { - case SDLK_LEFT: - rc = KEY_LEFTARROW; - break; - case SDLK_RIGHT: - rc = KEY_RIGHTARROW; - break; - case SDLK_DOWN: - rc = KEY_DOWNARROW; - break; - case SDLK_UP: - rc = KEY_UPARROW; - break; - - case SDLK_ESCAPE: - rc = KEY_ESCAPE; - break; - case SDLK_SPACE: - rc = KEY_SPACE; - break; - case SDLK_RETURN: - case SDLK_KP_ENTER: - rc = KEY_ENTER; - break; - case SDLK_TAB: - rc = KEY_TAB; - break; - case SDLK_F1: - rc = KEY_F1; - break; - case SDLK_F2: - rc = KEY_F2; - break; - case SDLK_F3: - rc = KEY_F3; - break; - case SDLK_F4: - rc = KEY_F4; - break; - case SDLK_F5: - rc = KEY_F5; - break; - case SDLK_F6: - rc = KEY_F6; - break; - case SDLK_F7: - rc = KEY_F7; - break; - case SDLK_F8: - rc = KEY_F8; - break; - case SDLK_F9: - rc = KEY_F9; - break; - case SDLK_F10: - rc = KEY_F10; - break; - case SDLK_F11: - rc = KEY_F11; - break; - case SDLK_F12: - rc = KEY_F12; - break; - - case SDLK_BACKSPACE: - rc = KEY_BACKSPACE; - break; - case SDLK_DELETE: - rc = KEY_DEL; - break; - - case SDLK_KP_EQUALS: //Alam & Logan: WTF? Mac KB haves one! XD - case SDLK_PAUSE: - rc = KEY_PAUSE; - break; - - case SDLK_EQUALS: - case SDLK_PLUS: - rc = KEY_EQUALS; - break; - - case SDLK_MINUS: - rc = KEY_MINUS; - break; - - case SDLK_LSHIFT: - rc = KEY_LSHIFT; - break; - - case SDLK_RSHIFT: - rc = KEY_RSHIFT; - break; - - case SDLK_CAPSLOCK: - rc = KEY_CAPSLOCK; - break; - - case SDLK_LCTRL: - rc = KEY_LCTRL; - break; - case SDLK_RCTRL: - rc = KEY_RCTRL; - break; - - case SDLK_LALT: - rc = KEY_LALT; - break; - case SDLK_RALT: - rc = KEY_RALT; - break; - - case SDLK_NUMLOCKCLEAR: - rc = KEY_NUMLOCK; - break; - case SDLK_SCROLLLOCK: - rc = KEY_SCROLLLOCK; - break; - - case SDLK_PAGEUP: - rc = KEY_PGUP; - break; - case SDLK_PAGEDOWN: - rc = KEY_PGDN; - break; - case SDLK_END: - rc = KEY_END; - break; - case SDLK_HOME: - rc = KEY_HOME; - break; - case SDLK_INSERT: - rc = KEY_INS; - break; - - case SDLK_KP_0: - rc = KEY_KEYPAD0; - break; - case SDLK_KP_1: - rc = KEY_KEYPAD1; - break; - case SDLK_KP_2: - rc = KEY_KEYPAD2; - break; - case SDLK_KP_3: - rc = KEY_KEYPAD3; - break; - case SDLK_KP_4: - rc = KEY_KEYPAD4; - break; - case SDLK_KP_5: - rc = KEY_KEYPAD5; - break; - case SDLK_KP_6: - rc = KEY_KEYPAD6; - break; - case SDLK_KP_7: - rc = KEY_KEYPAD7; - break; - case SDLK_KP_8: - rc = KEY_KEYPAD8; - break; - case SDLK_KP_9: - rc = KEY_KEYPAD9; - break; - - case SDLK_KP_PERIOD: - rc = KEY_KPADDEL; - break; - case SDLK_KP_DIVIDE: - rc = KEY_KPADSLASH; - break; - case SDLK_KP_MULTIPLY: - rc = '*'; - break; - case SDLK_KP_MINUS: - rc = KEY_MINUSPAD; - break; - case SDLK_KP_PLUS: - rc = KEY_PLUSPAD; - break; - - case SDLK_LMETA: - rc = KEY_LEFTWIN; - break; - case SDLK_RMETA: - rc = KEY_RIGHTWIN; - break; - - case SDLK_MENU: - rc = KEY_MENU; - break; - - default: - if (sym >= SDLK_SPACE && sym <= SDLK_DELETE) - rc = sym - SDLK_SPACE + ' '; - else if (sym >= 'A' && sym <= 'Z') - rc = sym - 'A' + 'a'; - else if (sym) - { - I_OutputMsg("Unknown Keycode %i, Name: %s\n",sym, SDL_GetKeyName( sym )); - } - else if (!sym) rc = 0; - break; - } - - return rc; -} - -static void SDLdoUngrabMouse(void) -{ - SDL_SetWindowGrab(window, SDL_FALSE); -} - -void SDLforceUngrabMouse(void) -{ - if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL) - { - SDL_SetWindowGrab(window, SDL_FALSE); - } -} - -static void VID_Command_NumModes_f (void) -{ - CONS_Printf(M_GetText("%d video mode(s) available(s)\n"), VID_NumModes()); -} - -static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText) -{ -#if 1 - (void)infoSurface; - (void)SurfaceText; - SDL2STUB(); -#else - INT32 vfBPP; - const SDL_Surface *VidSur = SDL_GetVideoSurface(); - - if (!infoSurface) - return; - - if (!SurfaceText) - SurfaceText = M_GetText("Unknown Surface"); - - vfBPP = infoSurface->format?infoSurface->format->BitsPerPixel:0; - - CONS_Printf("\x82" "%s\n", SurfaceText); - CONS_Printf(M_GetText(" %ix%i at %i bit color\n"), infoSurface->w, infoSurface->h, vfBPP); - - if (infoSurface->flags&SDL_HWSURFACE) - CONS_Printf("%s", M_GetText(" Stored in video memory\n")); - else if (infoSurface->flags&SDL_OPENGL) - CONS_Printf("%s", M_GetText(" Stored in an OpenGL context\n")); - else if (infoSurface->flags&SDL_PREALLOC) - CONS_Printf("%s", M_GetText(" Uses preallocated memory\n")); - else - CONS_Printf("%s", M_GetText(" Stored in system memory\n")); - - if (infoSurface->flags&SDL_ASYNCBLIT) - CONS_Printf("%s", M_GetText(" Uses asynchronous blits if possible\n")); - else - CONS_Printf("%s", M_GetText(" Uses synchronous blits if possible\n")); - - if (infoSurface->flags&SDL_ANYFORMAT) - CONS_Printf("%s", M_GetText(" Allows any pixel-format\n")); - - if (infoSurface->flags&SDL_HWPALETTE) - CONS_Printf("%s", M_GetText(" Has exclusive palette access\n")); - else if (VidSur == infoSurface) - CONS_Printf("%s", M_GetText(" Has nonexclusive palette access\n")); - - if (infoSurface->flags&SDL_DOUBLEBUF) - CONS_Printf("%s", M_GetText(" Double buffered\n")); - else if (VidSur == infoSurface) - CONS_Printf("%s", M_GetText(" No hardware flipping\n")); - - if (infoSurface->flags&SDL_FULLSCREEN) - CONS_Printf("%s", M_GetText(" Full screen\n")); - else if (infoSurface->flags&SDL_RESIZABLE) - CONS_Printf("%s", M_GetText(" Resizable window\n")); - else if (VidSur == infoSurface) - CONS_Printf("%s", M_GetText(" Nonresizable window\n")); - - if (infoSurface->flags&SDL_HWACCEL) - CONS_Printf("%s", M_GetText(" Uses hardware acceleration blit\n")); - if (infoSurface->flags&SDL_SRCCOLORKEY) - CONS_Printf("%s", M_GetText(" Use colorkey blitting\n")); - if (infoSurface->flags&SDL_RLEACCEL) - CONS_Printf("%s", M_GetText(" Colorkey RLE acceleration blit\n")); - if (infoSurface->flags&SDL_SRCALPHA) - CONS_Printf("%s", M_GetText(" Use alpha blending acceleration blit\n")); -#endif -} - -static void VID_Command_Info_f (void) -{ -#if 0 - SDL2STUB(); -#else -#if 0 - const SDL_VideoInfo *videoInfo; - videoInfo = SDL_GetVideoInfo(); //Alam: Double-Check - if (videoInfo) - { - CONS_Printf("%s", M_GetText("Video Interface Capabilities:\n")); - if (videoInfo->hw_available) - CONS_Printf("%s", M_GetText(" Hardware surfaces\n")); - if (videoInfo->wm_available) - CONS_Printf("%s", M_GetText(" Window manager\n")); - //UnusedBits1 :6 - //UnusedBits2 :1 - if (videoInfo->blit_hw) - CONS_Printf("%s", M_GetText(" Accelerated blits HW-2-HW\n")); - if (videoInfo->blit_hw_CC) - CONS_Printf("%s", M_GetText(" Accelerated blits HW-2-HW with Colorkey\n")); - if (videoInfo->wm_available) - CONS_Printf("%s", M_GetText(" Accelerated blits HW-2-HW with Alpha\n")); - if (videoInfo->blit_sw) - { - CONS_Printf("%s", M_GetText(" Accelerated blits SW-2-HW\n")); - if (!M_CheckParm("-noblit")) videoblitok = SDL_TRUE; - } - if (videoInfo->blit_sw_CC) - CONS_Printf("%s", M_GetText(" Accelerated blits SW-2-HW with Colorkey\n")); - if (videoInfo->blit_sw_A) - CONS_Printf("%s", M_GetText(" Accelerated blits SW-2-HW with Alpha\n")); - if (videoInfo->blit_fill) - CONS_Printf("%s", M_GetText(" Accelerated Color filling\n")); - //UnusedBits3 :16 - if (videoInfo->video_mem) - CONS_Printf(M_GetText(" There is %i KB of video memory\n"), videoInfo->video_mem); - else - CONS_Printf("%s", M_GetText(" There no video memory for SDL\n")); - //*vfmt - } -#else - if (!M_CheckParm("-noblit")) videoblitok = SDL_TRUE; -#endif - SurfaceInfo(bufSurface, M_GetText("Current Engine Mode")); - SurfaceInfo(vidSurface, M_GetText("Current Video Mode")); -#endif -} - -static void VID_Command_ModeList_f(void) -{ - SDL2STUB(); -#if 0 -#if !defined (DC) && !defined (_WIN32_WCE) && !defined (_PSP) && !defined(GP2X) - INT32 i; -#ifdef HWRENDER - if (rendermode == render_opengl) - modeList = SDL_ListModes(NULL, SDL_OPENGL|SDL_FULLSCREEN); - else -#endif - modeList = SDL_ListModes(NULL, surfaceFlagsF|SDL_HWSURFACE); //Alam: At least hardware surface - - if (modeList == (SDL_Rect **)0 && cv_fullscreen.value) - { - CONS_Printf("%s", M_GetText("No video modes present\n")); - cv_fullscreen.value = 0; - } - else if (modeList != (SDL_Rect **)0) - { - numVidModes = 0; - if (modeList == (SDL_Rect **)-1) - numVidModes = -1; // should not happen with fullscreen modes - else while (modeList[numVidModes]) - numVidModes++; - } - CONS_Printf(M_GetText("Found %d FullScreen Video Modes:\n"), numVidModes); - for (i=0 ; i= numVidModes) - break; - - CONS_Printf(M_GetText("%dx%d and "), - modeList[modeNum]->w, - modeList[modeNum]->h); - } - CONS_Printf("%s", M_GetText("None\n")); -#endif -#endif -} - -static void VID_Command_Mode_f (void) -{ - SDL2STUB(); -#if 0 - INT32 modenum; - - if (COM_Argc()!= 2) - { - CONS_Printf(M_GetText("vid_mode : set video mode, current video mode %i\n"), vid.modenum); - return; - } - - modenum = atoi(COM_Argv(1)); - - if (modenum >= VID_NumModes()) - CONS_Printf(M_GetText("Video mode not present\n")); - else - setmodeneeded = modenum+1; // request vid mode change -#endif -} - -#if 0 -#if defined(RPC_NO_WINDOWS_H) -static VOID MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(message); - UNREFERENCED_PARAMETER(wParam); - switch (message) - { - case WM_SETTEXT: - COM_BufAddText((LPCSTR)lParam); - break; - } -} -#endif -#endif - -static inline void SDLJoyRemap(event_t *event) -{ - (void)event; -} - -static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which) -{ - // -32768 to 32767 - INT32 raxis = axis/32; - if (which == ev_joystick) - { - if (Joystick.bGamepadStyle) - { - // gamepad control type, on or off, live or die - if (raxis < -(JOYAXISRANGE/2)) - raxis = -1; - else if (raxis > (JOYAXISRANGE/2)) - raxis = 1; - else - raxis = 0; - } - else - { - raxis = JoyInfo.scale!=1?((raxis/JoyInfo.scale)*JoyInfo.scale):raxis; - -#ifdef SDL_JDEADZONE - if (-SDL_JDEADZONE <= raxis && raxis <= SDL_JDEADZONE) - raxis = 0; -#endif - } - } - else if (which == ev_joystick2) - { - if (Joystick2.bGamepadStyle) - { - // gamepad control type, on or off, live or die - if (raxis < -(JOYAXISRANGE/2)) - raxis = -1; - else if (raxis > (JOYAXISRANGE/2)) - raxis = 1; - else raxis = 0; - } - else - { - raxis = JoyInfo2.scale!=1?((raxis/JoyInfo2.scale)*JoyInfo2.scale):raxis; - -#ifdef SDL_JDEADZONE - if (-SDL_JDEADZONE <= raxis && raxis <= SDL_JDEADZONE) - raxis = 0; -#endif - } - } - return raxis; -} - -static void Impl_HandleWindowEvent(SDL_WindowEvent evt) -{ - static SDL_bool firsttimeonmouse = SDL_TRUE; - static SDL_bool mousefocus = SDL_TRUE; - static SDL_bool kbfocus = SDL_TRUE; - - switch (evt.event) - { - case SDL_WINDOWEVENT_ENTER: - mousefocus = SDL_TRUE; - break; - case SDL_WINDOWEVENT_LEAVE: - mousefocus = SDL_FALSE; - break; - case SDL_WINDOWEVENT_FOCUS_GAINED: - kbfocus = SDL_TRUE; - mousefocus = SDL_TRUE; - break; - case SDL_WINDOWEVENT_FOCUS_LOST: - kbfocus = SDL_FALSE; - mousefocus = SDL_FALSE; - break; - case SDL_WINDOWEVENT_MAXIMIZED: - break; - } - - if (mousefocus && kbfocus) - { - if (!firsttimeonmouse) - { - if (cv_usemouse.value) I_StartupMouse(); - } - //else firsttimeonmouse = SDL_FALSE; - if (gamestate == GS_LEVEL) - { - if (!paused) I_ResumeSong(0); //resume it - } - } - else if (!mousefocus && !kbfocus) - { - if (!disable_mouse) - { - SDLforceUngrabMouse(); - } - if (!netgame && gamestate == GS_LEVEL && !demoplayback && !demorecording && !modeattacking) - { - paused = true; - } - memset(gamekeydown, 0, NUMKEYS); // TODO this is a scary memset - if (gamestate == GS_LEVEL) - { - I_PauseSong(0); - } - - if (MOUSE_MENU) - { - SDLdoUngrabMouse(); - } - } - -} - -static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type) -{ - event_t event; - if (type == SDL_KEYUP) - { - event.type = ev_keyup; - } - else if (type == SDL_KEYDOWN) - { - event.type = ev_keydown; - } - else - { - return; - } - event.data1 = SDLatekey(evt.keysym.sym); - if (event.data1) D_PostEvent(&event); -} - -static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) -{ - event_t event; - int wwidth, wheight; - - SDL_GetWindowSize(window, &wwidth, &wheight); - - if ((SDL_GetMouseFocus() != window && SDL_GetKeyboardFocus() != window)) - { - SDLdoUngrabMouse(); - return; - } - - if ((evt.x == realwidth/2) && (evt.y == realheight/2)) - { - return; - } - else - { - event.data2 = (evt.xrel) * (wwidth / realwidth); - event.data3 = -evt.yrel * (wheight / realheight); - } - - event.type = ev_mouse; - - if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window) - { - D_PostEvent(&event); - HalfWarpMouse(wwidth, wheight); - } -} - -static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type) -{ - event_t event; - - SDL_memset(&event, 0, sizeof(event_t)); - - /// \todo inputEvent.button.which - if (USE_MOUSEINPUT) - { - if (type == SDL_MOUSEBUTTONUP) - { - event.type = ev_keyup; - } - else if (type == SDL_MOUSEBUTTONDOWN) - { - event.type = ev_keydown; - } - else return; - if (evt.button == SDL_BUTTON_MIDDLE) - event.data1 = KEY_MOUSE1+2; - else if (evt.button == SDL_BUTTON_RIGHT) - event.data1 = KEY_MOUSE1+1; - else if (evt.button == SDL_BUTTON_LEFT) - event.data1= KEY_MOUSE1; - else if (evt.button <= MOUSEBUTTONS) - event.data1 = KEY_MOUSE1 + evt.which - SDL_BUTTON_LEFT; - if (event.type == ev_keyup || event.type == ev_keydown) - { - D_PostEvent(&event); - } - } -} - -static void Impl_HandleMouseWheelEvent(SDL_MouseWheelEvent evt) -{ - event_t event; - - SDL_memset(&event, 0, sizeof(event_t)); - - if (evt.y > 0) - { - event.data1 = KEY_MOUSEWHEELUP; - event.type = ev_keydown; - } - if (evt.y < 0) - { - event.data1 = KEY_MOUSEWHEELDOWN; - event.type = ev_keydown; - } - if (evt.y == 0) - { - event.data1 = 0; - event.type = ev_keyup; - } - if (event.type == ev_keyup || event.type == ev_keydown) - { - D_PostEvent(&event); - } -} - -static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt) -{ - event_t event; - SDL_JoystickID joyid[2]; - - // Determine the Joystick IDs for each current open joystick - joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev); - joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev); - - evt.axis++; - event.data1 = event.data2 = event.data3 = INT32_MAX; - - if (evt.which == joyid[0]) - { - event.type = ev_joystick; - } - else if (evt.which == joyid[1]) - { - event.type = ev_joystick2; - } - else return; - //axis - if (evt.axis > JOYAXISSET*2) - return; - //vaule - if (evt.axis%2) - { - event.data1 = evt.axis / 2; - event.data2 = SDLJoyAxis(evt.value, event.type); - } - else - { - evt.axis--; - event.data1 = evt.axis / 2; - event.data3 = SDLJoyAxis(evt.value, event.type); - } - D_PostEvent(&event); -} - -static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type) -{ - event_t event; - SDL_JoystickID joyid[2]; - - // Determine the Joystick IDs for each current open joystick - joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev); - joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev); - - if (evt.which == joyid[0]) - { - event.data1 = KEY_JOY1; - } - else if (evt.which == joyid[1]) - { - event.data1 = KEY_2JOY1; - } - else return; - if (type == SDL_JOYBUTTONUP) - { - event.type = ev_keyup; - } - else if (type == SDL_JOYBUTTONDOWN) - { - event.type = ev_keydown; - } - else return; - if (evt.button < JOYBUTTONS) - { - event.data1 += evt.button; - } - else return; - - SDLJoyRemap(&event); - if (event.type != ev_console) D_PostEvent(&event); -} - -void I_GetEvent(void) -{ - SDL_Event evt; - - if (!graphics_started) - { - return; - } - - while (SDL_PollEvent(&evt)) - { - switch (evt.type) - { - case SDL_WINDOWEVENT: - Impl_HandleWindowEvent(evt.window); - break; - case SDL_KEYUP: - case SDL_KEYDOWN: - Impl_HandleKeyboardEvent(evt.key, evt.type); - break; - case SDL_MOUSEMOTION: - Impl_HandleMouseMotionEvent(evt.motion); - break; - case SDL_MOUSEBUTTONUP: - case SDL_MOUSEBUTTONDOWN: - Impl_HandleMouseButtonEvent(evt.button, evt.type); - break; - case SDL_MOUSEWHEEL: - Impl_HandleMouseWheelEvent(evt.wheel); - break; - case SDL_JOYAXISMOTION: - Impl_HandleJoystickAxisEvent(evt.jaxis); - break; - case SDL_JOYBUTTONUP: - case SDL_JOYBUTTONDOWN: - Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type); - break; - case SDL_QUIT: - I_Quit(); - M_QuitResponse('y'); - break; - } - } - - // In order to make wheels act like buttons, we have to set their state to Up. - // This is because wheel messages don't have an up/down state. - gamekeydown[KEY_MOUSEWHEELDOWN] = gamekeydown[KEY_MOUSEWHEELUP] = 0; - -#if 0 - SDL_Event inputEvent; - static SDL_bool sdlquit = SDL_FALSE; //Alam: once, just once - event_t event; - - if (!graphics_started) - return; - - memset(&inputEvent, 0x00, sizeof(inputEvent)); - while (SDL_PollEvent(&inputEvent)) - { - memset(&event,0x00,sizeof (event_t)); - switch (inputEvent.type) - { - case SDL_ACTIVEEVENT: - if (inputEvent.active.state & (SDL_APPACTIVE|SDL_APPINPUTFOCUS)) - { - // pause music when alt-tab - if (inputEvent.active.gain /*&& !paused */) - { - static SDL_bool firsttimeonmouse = SDL_TRUE; - if (!firsttimeonmouse) - { - if (cv_usemouse.value) I_StartupMouse(); - } - else firsttimeonmouse = SDL_FALSE; - //if (!netgame && !con_destlines) paused = false; - if (gamestate == GS_LEVEL) - if (!paused) I_ResumeSong(0); //resume it - } - else /*if (!paused)*/ - { - if (!disable_mouse) - SDLforceUngrabMouse(); - if (!netgame && gamestate == GS_LEVEL) paused = true; - memset(gamekeydown, 0, NUMKEYS); - //S_PauseSound(); - if (gamestate == GS_LEVEL) - I_PauseSong(0); //pause it - } - } - if (MOUSE_MENU) - { - SDLdoUngrabMouse(); - break; - } - if ((SDL_APPMOUSEFOCUS&inputEvent.active.state) && USE_MOUSEINPUT && inputEvent.active.gain) - HalfWarpMouse(realwidth, realheight); - break; - case SDL_KEYDOWN: - case SDL_KEYUP: - /// \todo inputEvent.key.which? - if (inputEvent.type == SDL_KEYUP) - event.type = ev_keyup; - else if (inputEvent.type == SDL_KEYDOWN) - event.type = ev_keydown; - else break; - event.data1 = SDLatekey(inputEvent.key.keysym.sym); - if (event.data1) D_PostEvent(&event); - break; - case SDL_MOUSEMOTION: - /// \todo inputEvent.motion.which - if (MOUSE_MENU) - { - SDLdoUngrabMouse(); - break; - } - //if (USE_MOUSEINPUT) TODO SDL2 stub - { - // If the event is from warping the pointer back to middle - // of the screen then ignore it. - if ((inputEvent.motion.x == realwidth/2) && - (inputEvent.motion.y == realheight/2)) - { - break; - } - else - { - event.data2 = +inputEvent.motion.xrel; - event.data3 = -inputEvent.motion.yrel; - } - event.type = ev_mouse; - D_PostEvent(&event); - // Warp the pointer back to the middle of the window - // or we cannot move any further if it's at a border. - if ((inputEvent.motion.x < (realwidth/2 )-(realwidth/4 )) || - (inputEvent.motion.y < (realheight/2)-(realheight/4)) || - (inputEvent.motion.x > (realwidth/2 )+(realwidth/4 )) || - (inputEvent.motion.y > (realheight/2)+(realheight/4) ) ) - { - //if (SDL_GRAB_ON == SDL_WM_GrabInput(SDL_GRAB_QUERY) || !mousegrabok) - HalfWarpMouse(realwidth, realheight); - } - } - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - /// \todo inputEvent.button.which - if (USE_MOUSEINPUT) - { - if (inputEvent.type == SDL_MOUSEBUTTONUP) - event.type = ev_keyup; - else if (inputEvent.type == SDL_MOUSEBUTTONDOWN) - event.type = ev_keydown; - else break; - if (inputEvent.button.button==SDL_BUTTON_WHEELUP || inputEvent.button.button==SDL_BUTTON_WHEELDOWN) - { - if (inputEvent.type == SDL_MOUSEBUTTONUP) - event.data1 = 0; //Alam: dumb! this could be a real button with some mice - else - event.data1 = KEY_MOUSEWHEELUP + inputEvent.button.button - SDL_BUTTON_WHEELUP; - } - else if (inputEvent.button.button == SDL_BUTTON_MIDDLE) - event.data1 = KEY_MOUSE1+2; - else if (inputEvent.button.button == SDL_BUTTON_RIGHT) - event.data1 = KEY_MOUSE1+1; - else if (inputEvent.button.button <= MOUSEBUTTONS) - event.data1 = KEY_MOUSE1 + inputEvent.button.button - SDL_BUTTON_LEFT; - if (event.data1) D_PostEvent(&event); - } - break; - case SDL_JOYAXISMOTION: - inputEvent.jaxis.which++; - inputEvent.jaxis.axis++; - event.data1 = event.data2 = event.data3 = INT32_MAX; - if (cv_usejoystick.value == inputEvent.jaxis.which) - { - event.type = ev_joystick; - } - else if (cv_usejoystick.value == inputEvent.jaxis.which) - { - event.type = ev_joystick2; - } - else break; - //axis - if (inputEvent.jaxis.axis > JOYAXISSET*2) - break; - //vaule - if (inputEvent.jaxis.axis%2) - { - event.data1 = inputEvent.jaxis.axis / 2; - event.data2 = SDLJoyAxis(inputEvent.jaxis.value, event.type); - } - else - { - inputEvent.jaxis.axis--; - event.data1 = inputEvent.jaxis.axis / 2; - event.data3 = SDLJoyAxis(inputEvent.jaxis.value, event.type); - } - D_PostEvent(&event); - break; - case SDL_JOYBALLMOTION: - case SDL_JOYHATMOTION: - break; //NONE - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - inputEvent.jbutton.which++; - if (cv_usejoystick.value == inputEvent.jbutton.which) - event.data1 = KEY_JOY1; - else if (cv_usejoystick.value == inputEvent.jbutton.which) - event.data1 = KEY_2JOY1; - else break; - if (inputEvent.type == SDL_JOYBUTTONUP) - event.type = ev_keyup; - else if (inputEvent.type == SDL_JOYBUTTONDOWN) - event.type = ev_keydown; - else break; - if (inputEvent.jbutton.button < JOYBUTTONS) - event.data1 += inputEvent.jbutton.button; - else - break; - SDLJoyRemap(&event); - if (event.type != ev_console) D_PostEvent(&event); - break; - case SDL_QUIT: - if (!sdlquit) - { - sdlquit = SDL_TRUE; - M_QuitResponse('y'); - } - break; -#if defined(RPC_NO_WINDOWS_H) - case SDL_SYSWMEVENT: - MainWndproc(inputEvent.syswm.msg->hwnd, - inputEvent.syswm.msg->msg, - inputEvent.syswm.msg->wParam, - inputEvent.syswm.msg->lParam); - break; -#endif - case SDL_VIDEORESIZE: - if (gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN || gamestate == GS_EVALUATION) - setmodeneeded = VID_GetModeForSize(inputEvent.resize.w,inputEvent.resize.h)+1; - if (render_soft == rendermode) - { - SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW); - if (vidSurface) SDL_SetColors(vidSurface, localPalette, 0, 256); - } - else - SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW); - if (!vidSurface) - I_Error("Could not reset vidmode: %s\n",SDL_GetError()); - break; - case SDL_VIDEOEXPOSE: - exposevideo = SDL_TRUE; - break; - default: - break; - } - } - //reset wheel like in win32, I don't understand it but works -#endif -} - -void I_StartupMouse(void) -{ - static SDL_bool firsttimeonmouse = SDL_TRUE; - - if (disable_mouse) - return; - - if (!firsttimeonmouse) - HalfWarpMouse(realwidth, realheight); // warp to center - else - firsttimeonmouse = SDL_FALSE; - if (cv_usemouse.value) - return; - else - SDLdoUngrabMouse(); -} - -// -// I_OsPolling -// -void I_OsPolling(void) -{ - if (consolevent) - I_GetConsoleEvents(); - if (SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK) - { - SDL_JoystickUpdate(); - I_GetJoystickEvents(); - I_GetJoystick2Events(); - } - - I_GetMouseEvents(); - - I_GetEvent(); -} - -// -// I_UpdateNoBlit -// -void I_UpdateNoBlit(void) -{ - if (rendermode == render_none) - return; - if (exposevideo) - { -#ifdef HWRENDER - if (rendermode == render_opengl) - { - OglSdlFinishUpdate(cv_vidwait.value); - } - else -#endif - if (rendermode == render_soft) - { - SDL_RenderCopy(renderer, texture, NULL, NULL); - SDL_RenderPresent(renderer); - } - } - exposevideo = SDL_FALSE; -} - -// I_SkipFrame -// -// Returns true if it thinks we can afford to skip this frame -// from PrBoom's src/SDL/i_video.c -static inline boolean I_SkipFrame(void) -{ - static boolean skip = false; - - if (render_soft != rendermode) - return false; - - skip = !skip; - - switch (gamestate) - { - case GS_LEVEL: - if (!paused) - return false; - case GS_TIMEATTACK: - case GS_WAITINGPLAYERS: - return skip; // Skip odd frames - default: - return false; - } -} - -static inline SDL_bool SDLmatchVideoformat(void) -{ - const SDL_PixelFormat *vidformat = vidSurface->format; - const INT32 vfBPP = vidformat?vidformat->BitsPerPixel:0; - return (((vfBPP == 8 && vid.bpp == 1 && - !vidformat->Rmask && !vidformat->Gmask && !vidformat->Bmask) || - (vfBPP == 15 && vid.bpp == 2 && vidformat->Rmask == 0x7C00 && - vidformat->Gmask == 0x03E0 && vidformat->Bmask == 0x001F )) && - !vidformat->Amask && (vidSurface->flags & SDL_RLEACCEL) == 0); -} - -// -// I_FinishUpdate -// -void I_FinishUpdate(void) -{ - if (rendermode == render_none) - return; //Alam: No software or OpenGl surface - - if (I_SkipFrame()) - return; - - if (cv_ticrate.value) - SCR_DisplayTicRate(); - - if (render_soft == rendermode && screens[0]) - { - SDL_Rect rect; - - rect.x = 0; - rect.y = 0; - rect.w = vid.width; - rect.h = vid.height; - - if (!bufSurface) //Double-Check - { - Impl_VideoSetupSDLBuffer(); - } - if (bufSurface) - { - SDL_BlitSurface(bufSurface, NULL, vidSurface, &rect); - // Fury -- there's no way around UpdateTexture, the GL backend uses it anyway - SDL_LockSurface(vidSurface); - SDL_UpdateTexture(texture, &rect, vidSurface->pixels, vidSurface->pitch); - SDL_UnlockSurface(vidSurface); - } - SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, texture, NULL, NULL); - SDL_RenderPresent(renderer); - } - -#ifdef HWRENDER - else - { - OglSdlFinishUpdate(cv_vidwait.value); - } -#endif - exposevideo = SDL_FALSE; -} - -// -// I_UpdateNoVsync -// -void I_UpdateNoVsync(void) -{ - INT32 real_vidwait = cv_vidwait.value; - cv_vidwait.value = 0; - I_FinishUpdate(); - cv_vidwait.value = real_vidwait; -} - -// -// I_ReadScreen -// -void I_ReadScreen(UINT8 *scr) -{ - if (rendermode != render_soft) - I_Error ("I_ReadScreen: called while in non-software mode"); - else - VID_BlitLinearScreen(screens[0], scr, - vid.width*vid.bpp, vid.height, - vid.rowbytes, vid.rowbytes); -} - -// -// I_SetPalette -// -void I_SetPalette(RGBA_t *palette) -{ - size_t i; - for (i=0; i<256; i++) - { - localPalette[i].r = palette[i].s.red; - localPalette[i].g = palette[i].s.green; - localPalette[i].b = palette[i].s.blue; - } - //if (vidSurface) SDL_SetPaletteColors(vidSurface->format->palette, localPalette, 0, 256); - // Fury -- SDL2 vidSurface is a 32-bit surface buffer copied to the texture. It's not palletized, like bufSurface. - if (bufSurface) SDL_SetPaletteColors(bufSurface->format->palette, localPalette, 0, 256); -} - -// return number of fullscreen + X11 modes -INT32 VID_NumModes(void) -{ - if (USE_FULLSCREEN && numVidModes != -1) - return numVidModes - firstEntry; - else - return MAXWINMODES; -} - -const char *VID_GetModeName(INT32 modeNum) -{ -#if 0 - if (USE_FULLSCREEN && numVidModes != -1) // fullscreen modes - { - modeNum += firstEntry; - if (modeNum >= numVidModes) - return NULL; - - sprintf(&vidModeName[modeNum][0], "%dx%d", - modeList[modeNum]->w, - modeList[modeNum]->h); - } - else // windowed modes - { -#endif - if (modeNum == -1) - { - return fallback_resolution_name; - } - if (modeNum > MAXWINMODES) - return NULL; - - sprintf(&vidModeName[modeNum][0], "%dx%d", - windowedModes[modeNum][0], - windowedModes[modeNum][1]); - //} - return &vidModeName[modeNum][0]; -} - -INT32 VID_GetModeForSize(INT32 w, INT32 h) -{ - int i; - for (i = 0; i < MAXWINMODES; i++) - { - if (windowedModes[i][0] == w && windowedModes[i][1] == h) - { - return i; - } - } - return -1; -#if 0 - INT32 matchMode = -1, i; - VID_PrepareModeList(); - if (USE_FULLSCREEN && numVidModes != -1) - { - for (i=firstEntry; iw == w && - modeList[i]->h == h) - { - matchMode = i; - break; - } - } - if (-1 == matchMode) // use smaller mode - { - w -= w%BASEVIDWIDTH; - h -= h%BASEVIDHEIGHT; - for (i=firstEntry; iw == w && - modeList[i]->h == h) - { - matchMode = i; - break; - } - } - if (-1 == matchMode) // use smallest mode - matchMode = numVidModes-1; - } - matchMode -= firstEntry; - } - else - { - for (i=0; iw <= MAXVIDWIDTH && - modeList[i]->h <= MAXVIDHEIGHT) - { - firstEntry = i; - break; - } - } - } - } - allow_fullscreen = true; -#endif -} - -static inline void SDLESSet(void) -{ - SDL2STUB(); -} - -static void SDLWMSet(void) -{ - SDL2STUB(); -#if 0 -#ifdef RPC_NO_WINDOWS_H - SDL_SysWMinfo SDLWM; - memset(&SDLWM,0,sizeof (SDL_SysWMinfo)); - SDL_VERSION(&SDLWM.version) - if (SDL_GetWMInfo(&SDLWM)) - vid.WndParent = SDLWM.window; - else - vid.WndParent = INVALID_HANDLE_VALUE; - if (vid.WndParent != INVALID_HANDLE_VALUE) - { - SetFocus(vid.WndParent); - ShowWindow(vid.WndParent, SW_SHOW); - } - SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); -#endif - SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE); -#endif -} - -#if 0 -static void* SDLGetDirect(void) -{ - // you can not use the video memory in pixels member in fullscreen mode - return NULL; -} -#endif - -INT32 VID_SetMode(INT32 modeNum) -{ - SDLdoUngrabMouse(); - - vid.recalc = 1; - vid.bpp = 1; - - if (modeNum >= 0 && modeNum < MAXWINMODES-1) - { - vid.width = windowedModes[modeNum][0]; - vid.height = windowedModes[modeNum][1]; - vid.modenum = modeNum; - } - else - { - // just set the desktop resolution as a fallback - SDL_DisplayMode mode; - SDL_GetWindowDisplayMode(window, &mode); - if (mode.w >= 2048) - { - vid.width = 1920; - vid.height = 1200; - } - else - { - vid.width = mode.w; - vid.height = mode.h; - } - vid.modenum = -1; - } - Impl_SetWindowName("SRB2 "VERSIONSTRING); - - SDLSetMode(windowedModes[modeNum][0], windowedModes[modeNum][1], USE_FULLSCREEN); - - if (render_soft == rendermode) - { - if (bufSurface) - { - SDL_FreeSurface(bufSurface); - bufSurface = NULL; - } - - Impl_VideoSetupBuffer(); - } - - return SDL_TRUE; -} - -static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) -{ - int flags = 0; - if (window != NULL) - { - return SDL_FALSE; - } - - if (fullscreen) - { - flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; - } - - if (borderlesswindow) - { - flags |= SDL_WINDOW_BORDERLESS; - } - -#ifdef HWRENDER - if (rendermode == render_opengl) - { - window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - realwidth, realheight, flags | SDL_WINDOW_OPENGL); - if (window != NULL) - { - sdlglcontext = SDL_GL_CreateContext(window); - if (sdlglcontext == NULL) - { - SDL_DestroyWindow(window); - I_Error("Failed to create a GL context: %s\n", SDL_GetError()); - } - else - { - SDL_GL_MakeCurrent(window, sdlglcontext); - } - } - else return SDL_FALSE; - } -#endif - if (rendermode == render_soft) - { - window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - realwidth, realheight, flags); - if (window != NULL) - { - renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0)); - if (renderer != NULL) - { - SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT); - } - else return SDL_FALSE; - } - else return SDL_FALSE; - } - - return SDL_TRUE; -} - -static void Impl_SetWindowName(const char *title) -{ - if (window != NULL) - { - return; - } - SDL2STUB(); - SDL_SetWindowTitle(window, title); -} - -static void Impl_SetWindowIcon(void) -{ - if (window == NULL || icoSurface == NULL) - { - return; - } - SDL2STUB(); - SDL_SetWindowIcon(window, icoSurface); -} - -static void Impl_VideoSetupSDLBuffer(void) -{ - if (bufSurface != NULL) - { - SDL_FreeSurface(bufSurface); - bufSurface = NULL; - } - // Set up the SDL palletized buffer (copied to vidbuffer before being rendered to texture) - if (vid.bpp == 1) - { - bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,8, - (int)vid.rowbytes,0x00000000,0x00000000,0x00000000,0x00000000); // 256 mode - } - else if (vid.bpp == 2) // Fury -- don't think this is used at all anymore - { - bufSurface = SDL_CreateRGBSurfaceFrom(screens[0],vid.width,vid.height,15, - (int)vid.rowbytes,0x00007C00,0x000003E0,0x0000001F,0x00000000); // 555 mode - } - if (bufSurface) - { - SDL_SetPaletteColors(bufSurface->format->palette, localPalette, 0, 256); - } - else - { - I_Error("%s", M_GetText("No system memory for SDL buffer surface\n")); - } -} - -static void Impl_VideoSetupBuffer(void) -{ - // Set up game's software render buffer - if (rendermode == render_soft) - { - vid.rowbytes = vid.width * vid.bpp; - vid.direct = NULL; - vid.buffer = malloc(vid.rowbytes*vid.height*NUMSCREENS); - if (vid.buffer) - { - memset(vid.buffer,0x00,vid.rowbytes*vid.height*NUMSCREENS); - } - else - { - I_Error("%s", M_GetText("Not enough memory for video buffer\n")); - } - } -} - -void I_StartupGraphics(void) -{ - if (dedicated) - { - rendermode = render_none; - return; - } - if (graphics_started) - return; - - COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f); - COM_AddCommand ("vid_info", VID_Command_Info_f); - COM_AddCommand ("vid_modelist", VID_Command_ModeList_f); - COM_AddCommand ("vid_mode", VID_Command_Mode_f); - CV_RegisterVar (&cv_vidwait); - CV_RegisterVar (&cv_stretch); - disable_mouse = M_CheckParm("-nomouse"); - disable_fullscreen = M_CheckParm("-win") ? 1 : 0; - - keyboard_started = true; - -#if !defined(HAVE_TTF) -#ifdef _WIN32 // Initialize Audio as well, otherwise Win32's DirectX can not use audio - if (SDL_InitSubSystem(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0) -#else //SDL_OpenAudio will do SDL_InitSubSystem(SDL_INIT_AUDIO) - if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) -#endif - { -#ifdef _WIN32 - if (SDL_WasInit(SDL_INIT_AUDIO)==0) - CONS_Printf(M_GetText("Couldn't initialize SDL's Audio System with Video System: %s\n"), SDL_GetError()); - if (SDL_WasInit(SDL_INIT_VIDEO)==0) -#endif - { - CONS_Printf(M_GetText("Couldn't initialize SDL's Video System: %s\n"), SDL_GetError()); - return; - } - } -#endif - { - char vd[100]; //stack space for video name - //CONS_Printf(M_GetText("Starting up with video driver : %s\n"), SDL_VideoDriverName(vd,100)); - if (strncasecmp(vd, "gcvideo", 8) == 0 || strncasecmp(vd, "fbcon", 6) == 0 || strncasecmp(vd, "wii", 4) == 0 || strncasecmp(vd, "psl1ght", 8) == 0) - framebuffer = SDL_TRUE; - } - if (M_CheckParm("-software")) - { - rendermode = render_soft; - } - - usesdl2soft = M_CheckParm("-softblit"); - borderlesswindow = M_CheckParm("-borderless"); - - //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); - SDLESSet(); - VID_Command_ModeList_f(); -#ifdef HWRENDER - if (M_CheckParm("-opengl") || rendermode == render_opengl) - { - rendermode = render_opengl; - HWD.pfnInit = hwSym("Init",NULL); - HWD.pfnFinishUpdate = NULL; - HWD.pfnDraw2DLine = hwSym("Draw2DLine",NULL); - HWD.pfnDrawPolygon = hwSym("DrawPolygon",NULL); - HWD.pfnSetBlend = hwSym("SetBlend",NULL); - HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL); - HWD.pfnSetTexture = hwSym("SetTexture",NULL); - HWD.pfnReadRect = hwSym("ReadRect",NULL); - HWD.pfnGClipRect = hwSym("GClipRect",NULL); - HWD.pfnClearMipMapCache = hwSym("ClearMipMapCache",NULL); - HWD.pfnSetSpecialState = hwSym("SetSpecialState",NULL); - HWD.pfnSetPalette = hwSym("SetPalette",NULL); - HWD.pfnGetTextureUsed = hwSym("GetTextureUsed",NULL); - HWD.pfnDrawMD2 = hwSym("DrawMD2",NULL); - HWD.pfnDrawMD2i = hwSym("DrawMD2i",NULL); - HWD.pfnSetTransform = hwSym("SetTransform",NULL); - HWD.pfnGetRenderVersion = hwSym("GetRenderVersion",NULL); -#ifdef SHUFFLE - HWD.pfnPostImgRedraw = hwSym("PostImgRedraw",NULL); -#endif - HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL); - HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL); - HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL); - HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL); - HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL); - // check gl renderer lib - if (HWD.pfnGetRenderVersion() != VERSION) - I_Error("%s", M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); - if (!HWD.pfnInit(I_Error)) // let load the OpenGL library - { - rendermode = render_soft; - } - } -#endif - - // Fury: we do window initialization after GL setup to allow - // SDL_GL_LoadLibrary to work well on Windows - - // Create window - //Impl_CreateWindow(USE_FULLSCREEN); - //Impl_SetWindowName("SRB2"); - VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); - - vid.buffer = NULL; // For software mode - vid.width = BASEVIDWIDTH; // Default size for startup - vid.height = BASEVIDHEIGHT; // BitsPerPixel is the SDL interface's - vid.recalc = true; // Set up the console stufff - vid.direct = NULL; // Maybe direct access? - vid.bpp = 1; // This is the game engine's Bpp - vid.WndParent = NULL; //For the window? - -#ifdef HAVE_TTF - I_ShutdownTTF(); -#endif - // Window icon -#ifdef HAVE_IMAGE - icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm); -#endif - Impl_SetWindowIcon(); - - VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); - - if (M_CheckParm("-nomousegrab")) - mousegrabok = SDL_FALSE; -#if 0 // defined (_DEBUG) - else - { - char videodriver[4] = {'S','D','L',0}; - if (!M_CheckParm("-mousegrab") && - *strncpy(videodriver, SDL_GetCurrentVideoDriver(), 4) != '\0' && - strncasecmp("x11",videodriver,4) == 0) - mousegrabok = SDL_FALSE; //X11's XGrabPointer not good - } -#endif - realwidth = (Uint16)vid.width; - realheight = (Uint16)vid.height; - - VID_Command_Info_f(); - if (!disable_mouse) SDL_ShowCursor(SDL_DISABLE); - SDLdoUngrabMouse(); - - SDLWMSet(); - - graphics_started = true; -} - -void I_ShutdownGraphics(void) -{ - const rendermode_t oldrendermode = rendermode; - - rendermode = render_none; - if (icoSurface) SDL_FreeSurface(icoSurface); - icoSurface = NULL; - if (render_soft == oldrendermode) - { - vidSurface = NULL; //Alam: SDL_Video system free vidSurface for me - if (vid.buffer) free(vid.buffer); - vid.buffer = NULL; - if (bufSurface) SDL_FreeSurface(bufSurface); - bufSurface = NULL; - } - - // was graphics initialized anyway? - if (!graphics_started) - return; - CONS_Printf("I_ShutdownGraphics: "); - graphics_started = false; - CONS_Printf("%s", M_GetText("shut down\n")); -#ifdef HWRENDER - if (GLUhandle) - hwClose(GLUhandle); - if (sdlglcontext) - { - SDL_GL_DeleteContext(sdlglcontext); - } -#endif - SDL_QuitSubSystem(SDL_INIT_VIDEO); - framebuffer = SDL_FALSE; -} -#endif diff --git a/src/sdl2/macosx/English.lproj/InfoPlist.strings b/src/sdl2/macosx/English.lproj/InfoPlist.strings deleted file mode 100644 index e69de29b..00000000 diff --git a/src/sdl2/macosx/Info.plist b/src/sdl2/macosx/Info.plist deleted file mode 100644 index ae0ce24d..00000000 --- a/src/sdl2/macosx/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - Srb2mac.icns - CFBundleIdentifier - com.yourcompany.Srb2mac - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - - diff --git a/src/sdl2/macosx/Srb2mac.icns b/src/sdl2/macosx/Srb2mac.icns deleted file mode 100644 index 4baedc1c..00000000 Binary files a/src/sdl2/macosx/Srb2mac.icns and /dev/null differ diff --git a/src/sdl2/macosx/Srb2mac.pbproj/project.pbxproj b/src/sdl2/macosx/Srb2mac.pbproj/project.pbxproj deleted file mode 100644 index de12201f..00000000 --- a/src/sdl2/macosx/Srb2mac.pbproj/project.pbxproj +++ /dev/null @@ -1,3546 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 38; - objects = { - 6726EB5E10190F860074DCBA = { - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 7; - files = ( - 6755C8D0101802C300A80195, - 6755C8D1101802C300A80195, - 6755C8D2101802C300A80195, - 6755C8D3101802C300A80195, - 6755C8D4101802C300A80195, - 6755C8D5101802C300A80195, - 6755C8D6101802C300A80195, - 6755C8D7101802C300A80195, - 6755C8D8101802C300A80195, - ); - isa = PBXCopyFilesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 6726EB5F10190FFC0074DCBA = { - buildActionMask = 2147483647; - files = ( - ); - generatedFileNames = ( - ); - isa = PBXShellScriptBuildPhase; - neededFileNames = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "touch -c $SRCROOT/../../comptime.c"; - }; - 6755C7A91017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = lzf.c; - path = ../../lzf.c; - refType = 2; - }; - 6755C7AA1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = lzf.h; - path = ../../lzf.h; - refType = 2; - }; - 6755C7AB1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_dllist.h; - path = ../../m_dllist.h; - refType = 2; - }; - 6755C7AC1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_queue.c; - path = ../../m_queue.c; - refType = 2; - }; - 6755C7AD1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_queue.h; - path = ../../m_queue.h; - refType = 2; - }; - 6755C7AE1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_polyobj.c; - path = ../../p_polyobj.c; - refType = 2; - }; - 6755C7AF1017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_polyobj.h; - path = ../../p_polyobj.h; - refType = 2; - }; - 6755C7B11017FE2500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = string.c; - path = ../../string.c; - refType = 2; - }; - 6755C7B21017FE2500A80195 = { - fileRef = 6755C7A91017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7B31017FE2500A80195 = { - fileRef = 6755C7AA1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7B51017FE2500A80195 = { - fileRef = 6755C7AC1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7B71017FE2500A80195 = { - fileRef = 6755C7AE1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7B81017FE2500A80195 = { - fileRef = 6755C7AF1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7BB1017FE2500A80195 = { - fileRef = 6755C7A91017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7BC1017FE2500A80195 = { - fileRef = 6755C7AA1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7BD1017FE2500A80195 = { - fileRef = 6755C7AB1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7BE1017FE2500A80195 = { - fileRef = 6755C7AC1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7BF1017FE2500A80195 = { - fileRef = 6755C7AD1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7C01017FE2500A80195 = { - fileRef = 6755C7AE1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7C11017FE2500A80195 = { - fileRef = 6755C7AF1017FE2500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C7C41017FE4400A80195 = { - children = ( - 6755C7FA1017FE4500A80195, - 6755C7FB1017FE4500A80195, - ); - isa = PBXGroup; - name = macosx; - path = ""; - refType = 2; - }; - 6755C7FA1017FE4500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - path = mac_alert.c; - refType = 2; - }; - 6755C7FB1017FE4500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - path = mac_alert.h; - refType = 2; - }; - 6755C82A1017FE4500A80195 = { - fileEncoding = 30; - isa = PBXFileReference; - name = sdlmain.h; - path = ../sdlmain.h; - refType = 2; - }; - 6755C84B1017FE4500A80195 = { - fileRef = 6755C7FA1017FE4500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8651017FE4500A80195 = { - fileRef = 6755C82A1017FE4500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8861017FE4500A80195 = { - fileRef = 6755C7FA1017FE4500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8871017FE4500A80195 = { - fileRef = 6755C7FB1017FE4500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8A01017FE4500A80195 = { - fileRef = 6755C82A1017FE4500A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8A41017FE8000A80195 = { - children = ( - 84177748085A1097000C01D8, - 84177749085A1097000C01D8, - 8417774A085A1097000C01D8, - 8417774B085A1097000C01D8, - 8417774C085A1097000C01D8, - 8417774D085A1097000C01D8, - 8417774E085A1097000C01D8, - 8417774F085A1097000C01D8, - 84177750085A1097000C01D8, - 84177751085A1097000C01D8, - 84177752085A1097000C01D8, - 84177753085A1097000C01D8, - 84177754085A1097000C01D8, - 84177755085A10AA000C01D8, - 84177756085A10AA000C01D8, - 6755C82A1017FE4500A80195, - 84177757085A10AA000C01D8, - 6755C7C41017FE4400A80195, - ); - isa = PBXGroup; - name = SDL; - path = ""; - refType = 2; - }; - 6755C8BE101802C300A80195 = { - isa = PBXFileReference; - name = drill.dta; - path = ../../../bin/Resources/drill.dta; - refType = 2; - }; - 6755C8BF101802C300A80195 = { - isa = PBXFileReference; - name = fmod.dll; - path = ../../../bin/Resources/fmod.dll; - refType = 2; - }; - 6755C8C0101802C300A80195 = { - isa = PBXFileReference; - name = knux.plr; - path = ../../../bin/Resources/knux.plr; - refType = 2; - }; - 6755C8C1101802C300A80195 = { - isa = PBXFileReference; - name = music.dta; - path = ../../../bin/Resources/music.dta; - refType = 2; - }; - 6755C8C2101802C300A80195 = { - isa = PBXFileReference; - name = rings.wpn; - path = ../../../bin/Resources/rings.wpn; - refType = 2; - }; - 6755C8C3101802C300A80195 = { - isa = PBXFileReference; - name = soar.dta; - path = ../../../bin/Resources/soar.dta; - refType = 2; - }; - 6755C8C4101802C300A80195 = { - isa = PBXFileReference; - name = sonic.plr; - path = ../../../bin/Resources/sonic.plr; - refType = 2; - }; - 6755C8C5101802C300A80195 = { - isa = PBXFileReference; - name = srb2.wad; - path = ../../../bin/Resources/srb2.wad; - refType = 2; - }; - 6755C8C6101802C300A80195 = { - isa = PBXFileReference; - name = tails.plr; - path = ../../../bin/Resources/tails.plr; - refType = 2; - }; - 6755C8C7101802C300A80195 = { - fileRef = 6755C8BE101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8C8101802C300A80195 = { - fileRef = 6755C8BF101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8C9101802C300A80195 = { - fileRef = 6755C8C0101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CA101802C300A80195 = { - fileRef = 6755C8C1101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CB101802C300A80195 = { - fileRef = 6755C8C2101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CC101802C300A80195 = { - fileRef = 6755C8C3101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CD101802C300A80195 = { - fileRef = 6755C8C4101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CE101802C300A80195 = { - fileRef = 6755C8C5101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8CF101802C300A80195 = { - fileRef = 6755C8C6101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D0101802C300A80195 = { - fileRef = 6755C8BE101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D1101802C300A80195 = { - fileRef = 6755C8BF101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D2101802C300A80195 = { - fileRef = 6755C8C0101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D3101802C300A80195 = { - fileRef = 6755C8C1101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D4101802C300A80195 = { - fileRef = 6755C8C2101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D5101802C300A80195 = { - fileRef = 6755C8C3101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D6101802C300A80195 = { - fileRef = 6755C8C4101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D7101802C300A80195 = { - fileRef = 6755C8C5101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 6755C8D8101802C300A80195 = { - fileRef = 6755C8C6101802C300A80195; - isa = PBXBuildFile; - settings = { - }; - }; - 677B5EC810180D4E00A80195 = { - fileRef = 84177758085A10D2000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 677B5EC910180D6600A80195 = { - children = ( - 84177758085A10D2000C01D8, - ); - isa = PBXGroup; - name = r_opengl; - refType = 4; - }; - 677B5ECA10180D7100A80195 = { - children = ( - 84F202CA08A92AA0000C01D8, - ); - isa = PBXGroup; - name = s_openal; - refType = 4; - }; - 67B2D0C91018779900A80195 = { - fileRef = 84177748085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 67B2D0CA1018779D00A80195 = { - fileRef = 84177748085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; -//670 -//671 -//672 -//673 -//674 -//840 -//841 -//842 -//843 -//844 - 840CE6B009198AA7000C01D8 = { - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 840CE6B309198ABB000C01D8, - 840CE6B409198ABB000C01D8, - 849BD32D0A7E471D000C01D8, - ); - isa = PBXCopyFilesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 840CE6B309198ABB000C01D8 = { - fileRef = 84C4E04B08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 840CE6B409198ABB000C01D8 = { - fileRef = 84C4E04C08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 841776FE085A0C64000C01D8 = { - children = ( - 84C4E00D0862063C000C01D8, - 84177705085A0CDB000C01D8, - 84177706085A0D9D000C01D8, - 84177708085A0DB5000C01D8, - 84177709085A0DD1000C01D8, - 84177712085A0EB5000C01D8, - 8417770B085A0E17000C01D8, - 8417770C085A0E40000C01D8, - 8417770D085A0E4E000C01D8, - 8417770E085A0E5B000C01D8, - 8417770F085A0E66000C01D8, - 84177710085A0E71000C01D8, - 84177711085A0E77000C01D8, - 841779E2085A138F000C01D8, - 84F202C708A92A5D000C01D8, - 84C4E03F0862096F000C01D8, - 84C4E0420862098A000C01D8, - 84C4E045086209D3000C01D8, - 84C4E048086209FF000C01D8, - 84C4E04C08620A46000C01D8, - 84C4E04B08620A46000C01D8, - 849BD31C0A7E45B3000C01D8, - ); - isa = PBXGroup; - refType = 4; - }; - 84177700085A0C64000C01D8 = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = NO; - }; - isa = PBXBuildStyle; - name = Development; - }; - 84177701085A0C64000C01D8 = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = YES; - }; - isa = PBXBuildStyle; - name = Deployment; - }; - 84177702085A0C64000C01D8 = { - buildStyles = ( - 84177700085A0C64000C01D8, - 84177701085A0C64000C01D8, - ); - hasScannedForEncodings = 1; - isa = PBXProject; - mainGroup = 841776FE085A0C64000C01D8; - productRefGroup = 841779E2085A138F000C01D8; - projectDirPath = ""; - targets = ( - 841779E0085A138F000C01D8, - 841779E9085A13B1000C01D8, - ); - }; - 84177705085A0CDB000C01D8 = { - children = ( - 849603A80A791C11000C01D8, - 84177713085A0FCE000C01D8, - 84177714085A0FCE000C01D8, - 84177716085A0FCE000C01D8, - 84177717085A0FCE000C01D8, - 84177718085A0FCE000C01D8, - 84177719085A0FCE000C01D8, - 8417771A085A0FCE000C01D8, - 8417771B085A0FCE000C01D8, - 8417771C085A0FCE000C01D8, - 8417771D085A0FCE000C01D8, - 8417771E085A0FCE000C01D8, - 8417771F085A0FCE000C01D8, - 84177720085A0FCE000C01D8, - 84177721085A0FCE000C01D8, - 84177722085A0FCE000C01D8, - 84177723085A0FCE000C01D8, - 84177724085A0FF2000C01D8, - 84177725085A0FF2000C01D8, - 84177726085A0FF2000C01D8, - 84177727085A0FF2000C01D8, - 6755C7B11017FE2500A80195, - ); - isa = PBXGroup; - name = D_SRB2; - path = ""; - refType = 2; - }; - 84177706085A0D9D000C01D8 = { - children = ( - 8417772A085A100E000C01D8, - 8417772B085A100E000C01D8, - 8417772C085A100E000C01D8, - ); - isa = PBXGroup; - name = F_Frame; - path = ""; - refType = 2; - }; - 84177708085A0DB5000C01D8 = { - children = ( - 841779DA085A1347000C01D8, - 841778C6085A1295000C01D8, - 841778C4085A1295000C01D8, - 841778C5085A1295000C01D8, - 8417772D085A1029000C01D8, - 8417772E085A1029000C01D8, - 8417772F085A1029000C01D8, - 84177730085A1029000C01D8, - 84177731085A1029000C01D8, - 841779D4085A1296000C01D8, - 841779D5085A1296000C01D8, - ); - isa = PBXGroup; - name = G_Game; - path = ""; - refType = 2; - }; - 84177709085A0DD1000C01D8 = { - children = ( - 841778BE085A1295000C01D8, - 841778BF085A1295000C01D8, - 841778C2085A1295000C01D8, - 841778C3085A1295000C01D8, - 841778C0085A1295000C01D8, - 841778C1085A1295000C01D8, - 84177732085A1040000C01D8, - 84177733085A1040000C01D8, - 841779D2085A1296000C01D8, - 841779D3085A1296000C01D8, - 841779D8085A1296000C01D8, - 8490D433085DF537000C01D8, - ); - isa = PBXGroup; - name = H_Hud; - path = ""; - refType = 2; - }; - 8417770B085A0E17000C01D8 = { - children = ( - 6755C8A41017FE8000A80195, - 84177759085A10D2000C01D8, - 841777A4085A1200000C01D8, - 841777A5085A1200000C01D8, - 841777A6085A1200000C01D8, - 841777A8085A1200000C01D8, - 841777A9085A1200000C01D8, - 841777AA085A1200000C01D8, - 841777AB085A1200000C01D8, - 841777AC085A1200000C01D8, - 841777AD085A1200000C01D8, - 841777AE085A1200000C01D8, - ); - isa = PBXGroup; - name = I_Interface; - path = ""; - refType = 2; - }; - 8417770C085A0E40000C01D8 = { - children = ( - 8417775A085A10EB000C01D8, - 8417775B085A10EB000C01D8, - 8417775C085A10EB000C01D8, - 8417775D085A10EB000C01D8, - 8417775E085A10EB000C01D8, - 8417775F085A10EB000C01D8, - 6755C7AB1017FE2500A80195, - 84177760085A10EB000C01D8, - 84177761085A10EB000C01D8, - 84177762085A10EB000C01D8, - 84177763085A10EB000C01D8, - 84177764085A10EB000C01D8, - 84177765085A10EB000C01D8, - 6755C7AC1017FE2500A80195, - 6755C7AD1017FE2500A80195, - 84177766085A10EB000C01D8, - 84177767085A10EB000C01D8, - 84177768085A10EB000C01D8, - ); - isa = PBXGroup; - name = M_Misc; - path = ""; - refType = 2; - }; - 8417770D085A0E4E000C01D8 = { - children = ( - 84177769085A1104000C01D8, - 8417776A085A1104000C01D8, - 8417776B085A1104000C01D8, - 8417776C085A1104000C01D8, - 8417776D085A1104000C01D8, - 8417776E085A1104000C01D8, - 8417776F085A1104000C01D8, - 84177770085A1104000C01D8, - 84177771085A1104000C01D8, - 84177772085A1104000C01D8, - 84177773085A1104000C01D8, - 84177774085A1104000C01D8, - 6755C7AE1017FE2500A80195, - 6755C7AF1017FE2500A80195, - 84177775085A1104000C01D8, - 84177776085A1104000C01D8, - 84177777085A1104000C01D8, - 84177778085A1104000C01D8, - 84177779085A1104000C01D8, - 8417777A085A1104000C01D8, - 8417777B085A1104000C01D8, - 8417777C085A1104000C01D8, - 8417777D085A1104000C01D8, - 8417777E085A1104000C01D8, - 8417777F085A1104000C01D8, - 84177780085A1104000C01D8, - ); - isa = PBXGroup; - name = P_Play; - path = ""; - refType = 2; - }; - 8417770E085A0E5B000C01D8 = { - children = ( - 84177781085A111B000C01D8, - 84177782085A111B000C01D8, - 84177783085A111B000C01D8, - 84177784085A111B000C01D8, - 84177785085A111B000C01D8, - 84177786085A111B000C01D8, - 84177787085A111B000C01D8, - 84177788085A111B000C01D8, - 84177789085A111B000C01D8, - 8417778A085A111B000C01D8, - 8417778B085A111B000C01D8, - 8417778C085A111B000C01D8, - 8417778D085A111B000C01D8, - 8417778E085A111B000C01D8, - 8417778F085A111B000C01D8, - 84177790085A111B000C01D8, - 84177791085A111B000C01D8, - 84177792085A111B000C01D8, - 84177793085A111B000C01D8, - 84177794085A111B000C01D8, - 84177795085A111B000C01D8, - 84177796085A111B000C01D8, - 84177797085A111B000C01D8, - 841777A2085A1197000C01D8, - 841777A3085A1197000C01D8, - 8490D436085DF57B000C01D8, - 841779D7085A1296000C01D8, - ); - isa = PBXGroup; - name = R_Rend; - path = ""; - refType = 2; - }; - 8417770F085A0E66000C01D8 = { - children = ( - 84177798085A1138000C01D8, - 84177799085A1138000C01D8, - 8417779A085A1138000C01D8, - 8417779B085A1138000C01D8, - ); - isa = PBXGroup; - name = S_Sounds; - path = ""; - refType = 2; - }; - 84177710085A0E71000C01D8 = { - children = ( - 8417779C085A114C000C01D8, - 8417779D085A114C000C01D8, - 8417779E085A116B000C01D8, - 8417779F085A116B000C01D8, - ); - isa = PBXGroup; - name = SDL_main; - path = ""; - refType = 2; - }; - 84177711085A0E77000C01D8 = { - children = ( - 6755C7A91017FE2500A80195, - 6755C7AA1017FE2500A80195, - 841777AF085A1228000C01D8, - 841777B0085A1228000C01D8, - 841777A0085A117F000C01D8, - 841777A1085A117F000C01D8, - 841778BC085A122A000C01D8, - 841778BD085A122A000C01D8, - ); - isa = PBXGroup; - name = W_Wad; - path = ""; - refType = 2; - }; - 84177712085A0EB5000C01D8 = { - children = ( - 677B5EC910180D6600A80195, - 677B5ECA10180D7100A80195, - 84177734085A106C000C01D8, - 84177735085A106C000C01D8, - 84177736085A106C000C01D8, - 84177737085A106C000C01D8, - 84177738085A106C000C01D8, - 84177739085A106C000C01D8, - 8417773A085A106C000C01D8, - 8417773B085A106C000C01D8, - 8417773C085A106C000C01D8, - 8417773D085A106C000C01D8, - 8417773E085A106C000C01D8, - 8417773F085A106C000C01D8, - 84177740085A106C000C01D8, - 84177741085A106C000C01D8, - 84177742085A106C000C01D8, - 84177743085A106C000C01D8, - 84177744085A106C000C01D8, - 84177745085A106C000C01D8, - 84177746085A106C000C01D8, - 84177747085A106C000C01D8, - ); - isa = PBXGroup; - name = Hw_Hardware; - path = ""; - refType = 2; - }; - 84177713085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_clisrv.c; - path = ../../d_clisrv.c; - refType = 2; - }; - 84177714085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_clisrv.h; - path = ../../d_clisrv.h; - refType = 2; - }; - 84177716085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_event.h; - path = ../../d_event.h; - refType = 2; - }; - 84177717085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_main.c; - path = ../../d_main.c; - refType = 2; - }; - 84177718085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_main.h; - path = ../../d_main.h; - refType = 2; - }; - 84177719085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_net.c; - path = ../../d_net.c; - refType = 2; - }; - 8417771A085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_net.h; - path = ../../d_net.h; - refType = 2; - }; - 8417771B085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_netcmd.c; - path = ../../d_netcmd.c; - refType = 2; - }; - 8417771C085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_netcmd.h; - path = ../../d_netcmd.h; - refType = 2; - }; - 8417771D085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_netfil.c; - path = ../../d_netfil.c; - refType = 2; - }; - 8417771E085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_netfil.h; - path = ../../d_netfil.h; - refType = 2; - }; - 8417771F085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_player.h; - path = ../../d_player.h; - refType = 2; - }; - 84177720085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_think.h; - path = ../../d_think.h; - refType = 2; - }; - 84177721085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = d_ticcmd.h; - path = ../../d_ticcmd.h; - refType = 2; - }; - 84177722085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = dehacked.c; - path = ../../dehacked.c; - refType = 2; - }; - 84177723085A0FCE000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = dehacked.h; - path = ../../dehacked.h; - refType = 2; - }; - 84177724085A0FF2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = doomdata.h; - path = ../../doomdata.h; - refType = 2; - }; - 84177725085A0FF2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = doomdef.h; - path = ../../doomdef.h; - refType = 2; - }; - 84177726085A0FF2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = doomstat.h; - path = ../../doomstat.h; - refType = 2; - }; - 84177727085A0FF2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = doomtype.h; - path = ../../doomtype.h; - refType = 2; - }; - 8417772A085A100E000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = f_finale.c; - path = ../../f_finale.c; - refType = 2; - }; - 8417772B085A100E000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = f_finale.h; - path = ../../f_finale.h; - refType = 2; - }; - 8417772C085A100E000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = f_wipe.c; - path = ../../f_wipe.c; - refType = 2; - }; - 8417772D085A1029000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = g_game.c; - path = ../../g_game.c; - refType = 2; - }; - 8417772E085A1029000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = g_game.h; - path = ../../g_game.h; - refType = 2; - }; - 8417772F085A1029000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = g_input.c; - path = ../../g_input.c; - refType = 2; - }; - 84177730085A1029000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = g_input.h; - path = ../../g_input.h; - refType = 2; - }; - 84177731085A1029000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = g_state.h; - path = ../../g_state.h; - refType = 2; - }; - 84177732085A1040000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hu_stuff.c; - path = ../../hu_stuff.c; - refType = 2; - }; - 84177733085A1040000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hu_stuff.h; - path = ../../hu_stuff.h; - refType = 2; - }; - 84177734085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_bsp.c; - path = ../../hardware/hw_bsp.c; - refType = 2; - }; - 84177735085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_cache.c; - path = ../../hardware/hw_cache.c; - refType = 2; - }; - 84177736085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_data.h; - path = ../../hardware/hw_data.h; - refType = 2; - }; - 84177737085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_defs.h; - path = ../../hardware/hw_defs.h; - refType = 2; - }; - 84177738085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_dll.h; - path = ../../hardware/hw_dll.h; - refType = 2; - }; - 84177739085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_draw.c; - path = ../../hardware/hw_draw.c; - refType = 2; - }; - 8417773A085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_drv.h; - path = ../../hardware/hw_drv.h; - refType = 2; - }; - 8417773B085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_glide.h; - path = ../../hardware/hw_glide.h; - refType = 2; - }; - 8417773C085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_glob.h; - path = ../../hardware/hw_glob.h; - refType = 2; - }; - 8417773D085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_light.c; - path = ../../hardware/hw_light.c; - refType = 2; - }; - 8417773E085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_light.h; - path = ../../hardware/hw_light.h; - refType = 2; - }; - 8417773F085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_main.c; - path = ../../hardware/hw_main.c; - refType = 2; - }; - 84177740085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_main.h; - path = ../../hardware/hw_main.h; - refType = 2; - }; - 84177741085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_md2.c; - path = ../../hardware/hw_md2.c; - refType = 2; - }; - 84177742085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_md2.h; - path = ../../hardware/hw_md2.h; - refType = 2; - }; - 84177743085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_trick.c; - path = ../../hardware/hw_trick.c; - refType = 2; - }; - 84177744085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw3dsdrv.h; - path = ../../hardware/hw3dsdrv.h; - refType = 2; - }; - 84177745085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw3sound.c; - path = ../../hardware/hw3sound.c; - refType = 2; - }; - 84177746085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw3sound.h; - path = ../../hardware/hw3sound.h; - refType = 2; - }; - 84177747085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hws_data.h; - path = ../../hardware/hws_data.h; - refType = 2; - }; - 84177748085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = dosstr.c; - path = ../dosstr.c; - refType = 2; - }; - 84177749085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = endtxt.c; - path = ../endtxt.c; - refType = 2; - }; - 8417774A085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = endtxt.h; - path = ../endtxt.h; - refType = 2; - }; - 8417774B085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = filesrch.c; - path = ../../filesrch.c; - refType = 2; - }; - 8417774C085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hwsym_sdl.c; - path = ../hwsym_sdl.c; - refType = 2; - }; - 8417774D085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hwsym_sdl.h; - path = ../hwsym_sdl.h; - refType = 2; - }; - 8417774E085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_cdmus.c; - path = ../i_cdmus.c; - refType = 2; - }; - 8417774F085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_main.c; - path = ../i_main.c; - refType = 2; - }; - 84177750085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_net.c; - path = ../i_net.c; - refType = 2; - }; - 84177751085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_sound.c; - path = ../i_sound.c; - refType = 2; - }; - 84177752085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_system.c; - path = ../i_system.c; - refType = 2; - }; - 84177753085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_video.c; - path = ../i_video.c; - refType = 2; - }; - 84177754085A1097000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = IMG_xpm.c; - path = ../IMG_xpm.c; - refType = 2; - }; - 84177755085A10AA000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = ogl_sdl.c; - path = ../ogl_sdl.c; - refType = 2; - }; - 84177756085A10AA000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = ogl_sdl.h; - path = ../ogl_sdl.h; - refType = 2; - }; - 84177757085A10AA000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = SDL_icon.xpm; - path = ../SDL_icon.xpm; - refType = 2; - }; - 84177758085A10D2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_opengl.c; - path = ../../hardware/r_opengl/r_opengl.c; - refType = 2; - }; - 84177759085A10D2000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_opengl.h; - path = ../../hardware/r_opengl/r_opengl.h; - refType = 2; - }; - 8417775A085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_argv.c; - path = ../../m_argv.c; - refType = 2; - }; - 8417775B085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_argv.h; - path = ../../m_argv.h; - refType = 2; - }; - 8417775C085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_bbox.c; - path = ../../m_bbox.c; - refType = 2; - }; - 8417775D085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_bbox.h; - path = ../../m_bbox.h; - refType = 2; - }; - 8417775E085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_cheat.c; - path = ../../m_cheat.c; - refType = 2; - }; - 8417775F085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_cheat.h; - path = ../../m_cheat.h; - refType = 2; - }; - 84177760085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_fixed.c; - path = ../../m_fixed.c; - refType = 2; - }; - 84177761085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_fixed.h; - path = ../../m_fixed.h; - refType = 2; - }; - 84177762085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_menu.c; - path = ../../m_menu.c; - refType = 2; - }; - 84177763085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_menu.h; - path = ../../m_menu.h; - refType = 2; - }; - 84177764085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_misc.c; - path = ../../m_misc.c; - refType = 2; - }; - 84177765085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_misc.h; - path = ../../m_misc.h; - refType = 2; - }; - 84177766085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_random.c; - path = ../../m_random.c; - refType = 2; - }; - 84177767085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_random.h; - path = ../../m_random.h; - refType = 2; - }; - 84177768085A10EB000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = m_swap.h; - path = ../../m_swap.h; - refType = 2; - }; - 84177769085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_ceilng.c; - path = ../../p_ceilng.c; - refType = 2; - }; - 8417776A085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_enemy.c; - path = ../../p_enemy.c; - refType = 2; - }; - 8417776B085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_fab.c; - path = ../../p_fab.c; - refType = 2; - }; - 8417776C085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_floor.c; - path = ../../p_floor.c; - refType = 2; - }; - 8417776D085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_inter.c; - path = ../../p_inter.c; - refType = 2; - }; - 8417776E085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_lights.c; - path = ../../p_lights.c; - refType = 2; - }; - 8417776F085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_local.h; - path = ../../p_local.h; - refType = 2; - }; - 84177770085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_map.c; - path = ../../p_map.c; - refType = 2; - }; - 84177771085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_maputl.c; - path = ../../p_maputl.c; - refType = 2; - }; - 84177772085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_maputl.h; - path = ../../p_maputl.h; - refType = 2; - }; - 84177773085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_mobj.c; - path = ../../p_mobj.c; - refType = 2; - }; - 84177774085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_mobj.h; - path = ../../p_mobj.h; - refType = 2; - }; - 84177775085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_pspr.h; - path = ../../p_pspr.h; - refType = 2; - }; - 84177776085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_saveg.c; - path = ../../p_saveg.c; - refType = 2; - }; - 84177777085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_saveg.h; - path = ../../p_saveg.h; - refType = 2; - }; - 84177778085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_setup.c; - path = ../../p_setup.c; - refType = 2; - }; - 84177779085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_setup.h; - path = ../../p_setup.h; - refType = 2; - }; - 8417777A085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_sight.c; - path = ../../p_sight.c; - refType = 2; - }; - 8417777B085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_spec.c; - path = ../../p_spec.c; - refType = 2; - }; - 8417777C085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_spec.h; - path = ../../p_spec.h; - refType = 2; - }; - 8417777D085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_telept.c; - path = ../../p_telept.c; - refType = 2; - }; - 8417777E085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_tick.c; - path = ../../p_tick.c; - refType = 2; - }; - 8417777F085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_tick.h; - path = ../../p_tick.h; - refType = 2; - }; - 84177780085A1104000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = p_user.c; - path = ../../p_user.c; - refType = 2; - }; - 84177781085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_bsp.c; - path = ../../r_bsp.c; - refType = 2; - }; - 84177782085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_bsp.h; - path = ../../r_bsp.h; - refType = 2; - }; - 84177783085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_data.c; - path = ../../r_data.c; - refType = 2; - }; - 84177784085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_data.h; - path = ../../r_data.h; - refType = 2; - }; - 84177785085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_defs.h; - path = ../../r_defs.h; - refType = 2; - }; - 84177786085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_draw.c; - path = ../../r_draw.c; - refType = 2; - }; - 84177787085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_draw.h; - path = ../../r_draw.h; - refType = 2; - }; - 84177788085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_draw8.c; - path = ../../r_draw8.c; - refType = 2; - }; - 84177789085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_draw16.c; - path = ../../r_draw16.c; - refType = 2; - }; - 8417778A085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_local.h; - path = ../../r_local.h; - refType = 2; - }; - 8417778B085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_main.c; - path = ../../r_main.c; - refType = 2; - }; - 8417778C085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_main.h; - path = ../../r_main.h; - refType = 2; - }; - 8417778D085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_plane.c; - path = ../../r_plane.c; - refType = 2; - }; - 8417778E085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_plane.h; - path = ../../r_plane.h; - refType = 2; - }; - 8417778F085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_segs.c; - path = ../../r_segs.c; - refType = 2; - }; - 84177790085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_segs.h; - path = ../../r_segs.h; - refType = 2; - }; - 84177791085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_sky.c; - path = ../../r_sky.c; - refType = 2; - }; - 84177792085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_sky.h; - path = ../../r_sky.h; - refType = 2; - }; - 84177793085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_splats.c; - path = ../../r_splats.c; - refType = 2; - }; - 84177794085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_splats.h; - path = ../../r_splats.h; - refType = 2; - }; - 84177795085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_state.h; - path = ../../r_state.h; - refType = 2; - }; - 84177796085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_things.c; - path = ../../r_things.c; - refType = 2; - }; - 84177797085A111B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = r_things.h; - path = ../../r_things.h; - refType = 2; - }; - 84177798085A1138000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = s_sound.c; - path = ../../s_sound.c; - refType = 2; - }; - 84177799085A1138000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = s_sound.h; - path = ../../s_sound.h; - refType = 2; - }; - 8417779A085A1138000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = sounds.c; - path = ../../sounds.c; - refType = 2; - }; - 8417779B085A1138000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = sounds.h; - path = ../../sounds.h; - refType = 2; - }; - 8417779C085A114C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - path = mac_alert.c; - refType = 2; - }; - 8417779D085A114C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - path = mac_alert.h; - refType = 2; - }; - 8417779E085A116B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = SDL_macosx_main.h; - path = ../SDL_main/SDL_macosx_main.h; - refType = 2; - }; - 8417779F085A116B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = SDL_macosx_main.m; - path = ../SDL_main/SDL_macosx_main.m; - refType = 2; - }; - 841777A0085A117F000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = w_wad.c; - path = ../../w_wad.c; - refType = 2; - }; - 841777A1085A117F000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = w_wad.h; - path = ../../w_wad.h; - refType = 2; - }; - 841777A2085A1197000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = screen.c; - path = ../../screen.c; - refType = 2; - }; - 841777A3085A1197000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = screen.h; - path = ../../screen.h; - refType = 2; - }; - 841777A4085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = filesrch.h; - path = ../../filesrch.h; - refType = 2; - }; - 841777A5085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_joy.h; - path = ../../i_joy.h; - refType = 2; - }; - 841777A6085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_net.h; - path = ../../i_net.h; - refType = 2; - }; - 841777A8085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_sound.h; - path = ../../i_sound.h; - refType = 2; - }; - 841777A9085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_system.h; - path = ../../i_system.h; - refType = 2; - }; - 841777AA085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_tcp.c; - path = ../../i_tcp.c; - refType = 2; - }; - 841777AB085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_tcp.h; - path = ../../i_tcp.h; - refType = 2; - }; - 841777AC085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = i_video.h; - path = ../../i_video.h; - refType = 2; - }; - 841777AD085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = mserv.c; - path = ../../mserv.c; - refType = 2; - }; - 841777AE085A1200000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = mserv.h; - path = ../../mserv.h; - refType = 2; - }; - 841777AF085A1228000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = md5.c; - path = ../../md5.c; - refType = 2; - }; - 841777B0085A1228000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = md5.h; - path = ../../md5.h; - refType = 2; - }; - 841778BC085A122A000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = z_zone.c; - path = ../../z_zone.c; - refType = 2; - }; - 841778BD085A122A000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = z_zone.h; - path = ../../z_zone.h; - refType = 2; - }; - 841778BE085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = am_map.c; - path = ../../am_map.c; - refType = 2; - }; - 841778BF085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = am_map.h; - path = ../../am_map.h; - refType = 2; - }; - 841778C0085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = command.c; - path = ../../command.c; - refType = 2; - }; - 841778C1085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = command.h; - path = ../../command.h; - refType = 2; - }; - 841778C2085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = console.c; - path = ../../console.c; - refType = 2; - }; - 841778C3085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = console.h; - path = ../../console.h; - refType = 2; - }; - 841778C4085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = info.c; - path = ../../info.c; - refType = 2; - }; - 841778C5085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = info.h; - path = ../../info.h; - refType = 2; - }; - 841778C6085A1295000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = keys.h; - path = ../../keys.h; - refType = 2; - }; - 841779D2085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = st_stuff.c; - path = ../../st_stuff.c; - refType = 2; - }; - 841779D3085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = st_stuff.h; - path = ../../st_stuff.h; - refType = 2; - }; - 841779D4085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = tables.c; - path = ../../tables.c; - refType = 2; - }; - 841779D5085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = tables.h; - path = ../../tables.h; - refType = 2; - }; - 841779D7085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = v_video.h; - path = ../../v_video.h; - refType = 2; - }; - 841779D8085A1296000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = y_inter.c; - path = ../../y_inter.c; - refType = 2; - }; - 841779DA085A1347000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = byteptr.h; - path = ../../byteptr.h; - refType = 2; - }; - 841779DC085A138F000C01D8 = { - buildActionMask = 2147483647; - files = ( - 6755C8C7101802C300A80195, - 6755C8C8101802C300A80195, - 6755C8C9101802C300A80195, - 6755C8CA101802C300A80195, - 6755C8CB101802C300A80195, - 6755C8CC101802C300A80195, - 6755C8CD101802C300A80195, - 6755C8CE101802C300A80195, - 6755C8CF101802C300A80195, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 841779DD085A138F000C01D8 = { - buildActionMask = 2147483647; - files = ( - 84177A2A085A18A8000C01D8, - 84177A2E085A18D2000C01D8, - 84177A30085A18D3000C01D8, - 84177A32085A18D4000C01D8, - 84177A34085A18D5000C01D8, - 84177A39085A18D8000C01D8, - 84177A3F085A18DC000C01D8, - 84177A41085A18E0000C01D8, - 84177A43085A18E1000C01D8, - 84177A46085A18E8000C01D8, - 84177A4A085A18EA000C01D8, - 84177A4E085A18EC000C01D8, - 84177A50085A18F2000C01D8, - 84177A52085A193F000C01D8, - 84177A53085A1940000C01D8, - 84177A54085A1942000C01D8, - 84177A55085A1943000C01D8, - 84177A56085A195A000C01D8, - 84177A57085A195B000C01D8, - 84177A58085A1968000C01D8, - 84177A59085A1969000C01D8, - 84177A5A085A196B000C01D8, - 84177A5B085A197A000C01D8, - 84177A5C085A197C000C01D8, - 84177A5D085A197D000C01D8, - 84177A5E085A197E000C01D8, - 84177A5F085A1980000C01D8, - 84177A61085A1985000C01D8, - 84177A62085A1986000C01D8, - 84177A63085A1988000C01D8, - 84177A64085A1989000C01D8, - 84177A65085A198A000C01D8, - 84177A66085A198A000C01D8, - 84177A67085A198B000C01D8, - 84177A68085A198C000C01D8, - 84177A69085A198E000C01D8, - 84177A6B085A1994000C01D8, - 84177A6C085A1995000C01D8, - 84177A6D085A199D000C01D8, - 84177A6E085A19A0000C01D8, - 84177A6F085A19A1000C01D8, - 84177A70085A19A2000C01D8, - 84177A71085A19A4000C01D8, - 84177A72085A19A5000C01D8, - 84177A73085A19A6000C01D8, - 84177A74085A19A7000C01D8, - 84177A75085A19AC000C01D8, - 84177A76085A19AD000C01D8, - 84177A77085A19AE000C01D8, - 84177A78085A19AE000C01D8, - 84177A79085A19AF000C01D8, - 84177A7A085A19B0000C01D8, - 84177A7B085A19B3000C01D8, - 84177A7C085A19B4000C01D8, - 84177A7D085A19B5000C01D8, - 84177A7E085A19B7000C01D8, - 84177A7F085A19B8000C01D8, - 84177A80085A19B9000C01D8, - 84177A81085A19BA000C01D8, - 84177A82085A19BB000C01D8, - 84177A83085A19BB000C01D8, - 84177A84085A19BC000C01D8, - 84177A85085A19C1000C01D8, - 84177A86085A19C2000C01D8, - 84177A87085A19C3000C01D8, - 84177A88085A19C6000C01D8, - 84177A89085A19C7000C01D8, - 84177A8A085A19C9000C01D8, - 84177A8B085A19CC000C01D8, - 84177A8C085A19CD000C01D8, - 84177A8D085A19CF000C01D8, - 84177A8E085A19D0000C01D8, - 84177A90085A19D8000C01D8, - 84177A91085A19D9000C01D8, - 84177A92085A19DD000C01D8, - 84177A93085A19DF000C01D8, - 84177A94085A19E1000C01D8, - 84177A95085A19E3000C01D8, - 84177A96085A19E6000C01D8, - 8490D438085DF57B000C01D8, - 849603AA0A791C11000C01D8, - 6755C7B21017FE2500A80195, - 6755C7B31017FE2500A80195, - 6755C7B51017FE2500A80195, - 6755C7B71017FE2500A80195, - 6755C7B81017FE2500A80195, - 6755C84B1017FE4500A80195, - 6755C8651017FE4500A80195, - 677B5EC810180D4E00A80195, - 67B2D0C91018779900A80195, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 841779DE085A138F000C01D8 = { - buildActionMask = 2147483647; - files = ( - 84C4E0410862096F000C01D8, - 84C4E0440862098A000C01D8, - 84C4E047086209D3000C01D8, - 84C4E04A086209FF000C01D8, - 84C4E04F08620A46000C01D8, - 84C4E05008620A46000C01D8, - 849BD31E0A7E45B3000C01D8, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 841779E0085A138F000C01D8 = { - buildPhases = ( - 841779DC085A138F000C01D8, - 841779DD085A138F000C01D8, - 841779DE085A138F000C01D8, - ); - buildSettings = { - DEBUGGING_SYMBOLS = NO; - FRAMEWORK_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks\""; - HEADER_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_mixer.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/OpenAL.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/libpng.framework/Headers\""; - INSTALL_PATH = "$(HOME)/Applications"; - JAVA_COMPILER_DEBUGGING_SYMBOLS = NO; - OPTIMIZATION_CFLAGS = "-O2"; - OTHER_CFLAGS = "-DMAC_ALERT -DUNIXCOMMON -DSDLMAIN -DHAVE_MIXER -DHAVE_PNG -D_BIG_ENDIAN -DSTDC_HEADERS -DSDL -Wall -Winline -fno-strict-aliasing"; - OTHER_REZFLAGS = ""; - PREBINDING = NO; - PRODUCT_NAME = Srb2; - SECTORDER_FLAGS = ""; - USE_GCC3_PFE_SUPPORT = NO; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas -Wno-long-double"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - ); - isa = PBXApplicationTarget; - name = Srb2; - productInstallPath = "$(HOME)/Applications"; - productName = Srb2; - productReference = 841779E1085A138F000C01D8; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Srb2 - CFBundleGetInfoString - - CFBundleIconFile - Srb2mac - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Sonic Robo Blast 2 - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.09 - CFBundleSignature - ???? - CFBundleVersion - 1.09 - NSMainNibFile - SDL_Main.nib - NSPrincipalClass - NSApplication - - -"; - }; - 841779E1085A138F000C01D8 = { - isa = PBXApplicationReference; - path = Srb2.app; - refType = 3; - }; - 841779E2085A138F000C01D8 = { - children = ( - 841779E1085A138F000C01D8, - 841779EA085A13B1000C01D8, - ); - isa = PBXGroup; - name = Products; - refType = 4; - }; - 841779E6085A13B1000C01D8 = { - buildActionMask = 2147483647; - files = ( - 84177A98085A1A0B000C01D8, - 84177A99085A1A0E000C01D8, - 84177A9A085A1A0F000C01D8, - 84177A9B085A1A11000C01D8, - 84177A9C085A1A12000C01D8, - 84177A9D085A1A14000C01D8, - 84177A9E085A1A16000C01D8, - 84177A9F085A1A1E000C01D8, - 84177AA0085A1A1F000C01D8, - 84177AA1085A1A24000C01D8, - 84177AA2085A1A25000C01D8, - 84177AA3085A1A27000C01D8, - 84177AA4085A1A28000C01D8, - 84177AA5085A1A2B000C01D8, - 84177AA6085A1A2C000C01D8, - 84177AA7085A1A2D000C01D8, - 84177AA8085A1A2F000C01D8, - 84177AA9085A1A30000C01D8, - 84177AAA085A1A31000C01D8, - 84177AB4085A1A5E000C01D8, - 84177AB5085A1A60000C01D8, - 84177AB8085A1A65000C01D8, - 84177AB9085A1A65000C01D8, - 84177ABA085A1A66000C01D8, - 84177ABB085A1A67000C01D8, - 84177ABC085A1A67000C01D8, - 84177ABD085A1A68000C01D8, - 84177AC1085A1A70000C01D8, - 84177AC2085A1A72000C01D8, - 84177AC3085A1A77000C01D8, - 84177AC4085A1A78000C01D8, - 84177AC5085A1A7A000C01D8, - 84177AC6085A1A7B000C01D8, - 84177AC7085A1A7C000C01D8, - 84177AC8085A1A7D000C01D8, - 84177AC9085A1A7F000C01D8, - 84177ACA085A1A87000C01D8, - 84177ACB085A1A88000C01D8, - 84177ACC085A1A88000C01D8, - 84177ACD085A1A89000C01D8, - 84177ACE085A1A8A000C01D8, - 84177ACF085A1A8B000C01D8, - 84177AD0085A1A8C000C01D8, - 84177AD1085A1A8D000C01D8, - 84177AD2085A1A90000C01D8, - 84177AD4085A1A92000C01D8, - 84177AD5085A1A93000C01D8, - 84177AD6085A1A94000C01D8, - 84177AD7085A1A97000C01D8, - 84177AD8085A1A97000C01D8, - 84177AD9085A1A99000C01D8, - 84177ADA085A1A9F000C01D8, - 84177ADB085A1AA0000C01D8, - 84177ADC085A1AA2000C01D8, - 84177ADF085A1AA4000C01D8, - 84177AE0085A1AA6000C01D8, - 84177AE1085A1AA7000C01D8, - 84177AE2085A1AA8000C01D8, - 84177AE3085A1AA9000C01D8, - 84177AE4085A1AAA000C01D8, - 84177AE5085A1AAE000C01D8, - 84177AE7085A1AB5000C01D8, - 84177AE8085A1AB6000C01D8, - 84177AEB085A1ABD000C01D8, - 84177AEC085A1ABF000C01D8, - 84177AED085A1ABF000C01D8, - 8490D432085DF3D6000C01D8, - 8490D437085DF57B000C01D8, - 8490D43C085E0518000C01D8, - 8490D43D085E05F6000C01D8, - 8490D43E085E05F7000C01D8, - 8490D43F085E05F8000C01D8, - 8490D440085E05FA000C01D8, - 8490D441085E05FB000C01D8, - 8490D442085E05FC000C01D8, - 8490D443085E05FE000C01D8, - 8490D444085E05FF000C01D8, - 8490D445085E0606000C01D8, - 8490D446085E060A000C01D8, - 8490D447085E060B000C01D8, - 8490D448085E067E000C01D8, - 849603A90A791C11000C01D8, - 6755C7BB1017FE2500A80195, - 6755C7BC1017FE2500A80195, - 6755C7BD1017FE2500A80195, - 6755C7BE1017FE2500A80195, - 6755C7BF1017FE2500A80195, - 6755C7C01017FE2500A80195, - 6755C7C11017FE2500A80195, - 6755C8861017FE4500A80195, - 6755C8871017FE4500A80195, - 6755C8A01017FE4500A80195, - 67B2D0CA1018779D00A80195, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 841779E7085A13B1000C01D8 = { - buildActionMask = 2147483647; - files = ( - 84C4E0400862096F000C01D8, - 84C4E0430862098A000C01D8, - 84C4E046086209D3000C01D8, - 84C4E049086209FF000C01D8, - 84C4E04E08620A46000C01D8, - 8494DFE80886EA0D000C01D8, - 849BD31D0A7E45B3000C01D8, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 841779E9085A13B1000C01D8 = { - buildPhases = ( - 840CE6B009198AA7000C01D8, - 6726EB5E10190F860074DCBA, - 6726EB5F10190FFC0074DCBA, - 841779E6085A13B1000C01D8, - 841779E7085A13B1000C01D8, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks\""; - HEADER_SEARCH_PATHS = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_mixer.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/OpenAL.framework/Headers\" \"$(LOCAL_LIBRARY_DIR)/Frameworks/libpng.framework/Headers\""; - INSTALL_PATH = "$(HOME)/Applications"; - OPTIMIZATION_CFLAGS = "-O0"; - OTHER_CFLAGS = "-DMAC_ALERT -DUNIXCOMMON -DSDLMAIN -DHAVE_MIXER -DHAVE_PNG -D_BIG_ENDIAN -DSTDC_HEADERS -DSDL -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -fno-exceptions -D_DEBUG"; - OTHER_REZFLAGS = ""; - PREBINDING = NO; - PRODUCT_NAME = Srb2Debug; - SECTORDER_FLAGS = ""; - USE_GCC3_PFE_SUPPORT = NO; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas -Wno-long-double"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - ); - isa = PBXApplicationTarget; - name = Srb2Debug; - productInstallPath = "$(HOME)/Applications"; - productName = Srb2Debug; - productReference = 841779EA085A13B1000C01D8; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Srb2Debug - CFBundleGetInfoString - - CFBundleIconFile - srb2mac - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Sonic Robo Blast 2 - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.09 - CFBundleSignature - ???? - CFBundleVersion - 1.09 Debug - NSMainNibFile - SDL_Main.nib - NSPrincipalClass - NSApplication - - -"; - }; - 841779EA085A13B1000C01D8 = { - isa = PBXApplicationReference; - path = Srb2Debug.app; - refType = 3; - }; - 84177A2A085A18A8000C01D8 = { - fileRef = 84177713085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A2E085A18D2000C01D8 = { - fileRef = 84177717085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A30085A18D3000C01D8 = { - fileRef = 84177719085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A32085A18D4000C01D8 = { - fileRef = 8417771B085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A34085A18D5000C01D8 = { - fileRef = 8417771D085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A39085A18D8000C01D8 = { - fileRef = 84177722085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A41085A18E0000C01D8 = { - fileRef = 8417772A085A100E000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A43085A18E1000C01D8 = { - fileRef = 8417772C085A100E000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A46085A18E8000C01D8 = { - fileRef = 841778C4085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A4A085A18EA000C01D8 = { - fileRef = 8417772D085A1029000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A4E085A18EC000C01D8 = { - fileRef = 841779D4085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A50085A18F2000C01D8 = { - fileRef = 8417772F085A1029000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A52085A193F000C01D8 = { - fileRef = 841778C2085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A53085A1940000C01D8 = { - fileRef = 841778C0085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A54085A1942000C01D8 = { - fileRef = 841778BE085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A55085A1943000C01D8 = { - fileRef = 84177732085A1040000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A56085A195A000C01D8 = { - fileRef = 841779D2085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A57085A195B000C01D8 = { - fileRef = 841779D8085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A58085A1968000C01D8 = { - fileRef = 84177734085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A59085A1969000C01D8 = { - fileRef = 84177735085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5A085A196B000C01D8 = { - fileRef = 84177739085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5B085A197A000C01D8 = { - fileRef = 8417773D085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5C085A197C000C01D8 = { - fileRef = 8417773F085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5D085A197D000C01D8 = { - fileRef = 84177741085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5E085A197E000C01D8 = { - fileRef = 84177743085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A5F085A1980000C01D8 = { - fileRef = 84177745085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A61085A1985000C01D8 = { - fileRef = 84177749085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A62085A1986000C01D8 = { - fileRef = 8417774B085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A63085A1988000C01D8 = { - fileRef = 8417774E085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A64085A1989000C01D8 = { - fileRef = 8417774F085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A65085A198A000C01D8 = { - fileRef = 84177750085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A66085A198A000C01D8 = { - fileRef = 84177751085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A67085A198B000C01D8 = { - fileRef = 84177752085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A68085A198C000C01D8 = { - fileRef = 84177753085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A69085A198E000C01D8 = { - fileRef = 84177755085A10AA000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A6B085A1994000C01D8 = { - fileRef = 841777AA085A1200000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A6C085A1995000C01D8 = { - fileRef = 841777AD085A1200000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A6D085A199D000C01D8 = { - fileRef = 8417774C085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A6E085A19A0000C01D8 = { - fileRef = 8417775A085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A6F085A19A1000C01D8 = { - fileRef = 8417775C085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A70085A19A2000C01D8 = { - fileRef = 8417775E085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A71085A19A4000C01D8 = { - fileRef = 84177760085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A72085A19A5000C01D8 = { - fileRef = 84177762085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A73085A19A6000C01D8 = { - fileRef = 84177764085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A74085A19A7000C01D8 = { - fileRef = 84177766085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A75085A19AC000C01D8 = { - fileRef = 84177769085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A76085A19AD000C01D8 = { - fileRef = 8417776A085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A77085A19AE000C01D8 = { - fileRef = 8417776B085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A78085A19AE000C01D8 = { - fileRef = 8417776C085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A79085A19AF000C01D8 = { - fileRef = 8417776D085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7A085A19B0000C01D8 = { - fileRef = 8417776E085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7B085A19B3000C01D8 = { - fileRef = 84177770085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7C085A19B4000C01D8 = { - fileRef = 84177771085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7D085A19B5000C01D8 = { - fileRef = 84177773085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7E085A19B7000C01D8 = { - fileRef = 84177776085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A7F085A19B8000C01D8 = { - fileRef = 84177778085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A80085A19B9000C01D8 = { - fileRef = 8417777A085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A81085A19BA000C01D8 = { - fileRef = 8417777B085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A82085A19BB000C01D8 = { - fileRef = 8417777D085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A83085A19BB000C01D8 = { - fileRef = 8417777E085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A84085A19BC000C01D8 = { - fileRef = 84177780085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A85085A19C1000C01D8 = { - fileRef = 84177781085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A86085A19C2000C01D8 = { - fileRef = 84177783085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A87085A19C3000C01D8 = { - fileRef = 84177786085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A88085A19C6000C01D8 = { - fileRef = 8417778B085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A89085A19C7000C01D8 = { - fileRef = 8417778D085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A8A085A19C9000C01D8 = { - fileRef = 8417778F085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A8B085A19CC000C01D8 = { - fileRef = 84177791085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A8C085A19CD000C01D8 = { - fileRef = 84177793085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A8D085A19CF000C01D8 = { - fileRef = 84177796085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A8E085A19D0000C01D8 = { - fileRef = 841777A2085A1197000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A90085A19D8000C01D8 = { - fileRef = 84177798085A1138000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A91085A19D9000C01D8 = { - fileRef = 8417779A085A1138000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A92085A19DD000C01D8 = { - fileRef = 8417779C085A114C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A93085A19DF000C01D8 = { - fileRef = 8417779F085A116B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A94085A19E1000C01D8 = { - fileRef = 841777A0085A117F000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A95085A19E3000C01D8 = { - fileRef = 841777AF085A1228000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A96085A19E6000C01D8 = { - fileRef = 841778BC085A122A000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A98085A1A0B000C01D8 = { - fileRef = 84177713085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A99085A1A0E000C01D8 = { - fileRef = 84177717085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A9A085A1A0F000C01D8 = { - fileRef = 84177719085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A9B085A1A11000C01D8 = { - fileRef = 8417771B085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A9C085A1A12000C01D8 = { - fileRef = 8417771D085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A9D085A1A14000C01D8 = { - fileRef = 84177722085A0FCE000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177A9F085A1A1E000C01D8 = { - fileRef = 8417772A085A100E000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA0085A1A1F000C01D8 = { - fileRef = 8417772C085A100E000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA1085A1A24000C01D8 = { - fileRef = 841778C4085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA2085A1A25000C01D8 = { - fileRef = 8417772D085A1029000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA3085A1A27000C01D8 = { - fileRef = 8417772F085A1029000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA4085A1A28000C01D8 = { - fileRef = 841779D4085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA5085A1A2B000C01D8 = { - fileRef = 841778BE085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA6085A1A2C000C01D8 = { - fileRef = 841778C2085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA7085A1A2D000C01D8 = { - fileRef = 841778C0085A1295000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA8085A1A2F000C01D8 = { - fileRef = 84177732085A1040000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AA9085A1A30000C01D8 = { - fileRef = 841779D2085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AAA085A1A31000C01D8 = { - fileRef = 841779D8085A1296000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AB4085A1A5E000C01D8 = { - fileRef = 84177749085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AB5085A1A60000C01D8 = { - fileRef = 8417774B085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AB8085A1A65000C01D8 = { - fileRef = 8417774E085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AB9085A1A65000C01D8 = { - fileRef = 8417774F085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ABA085A1A66000C01D8 = { - fileRef = 84177750085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ABB085A1A67000C01D8 = { - fileRef = 84177751085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ABC085A1A67000C01D8 = { - fileRef = 84177752085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ABD085A1A68000C01D8 = { - fileRef = 84177753085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC1085A1A70000C01D8 = { - fileRef = 841777AA085A1200000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC2085A1A72000C01D8 = { - fileRef = 841777AD085A1200000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC3085A1A77000C01D8 = { - fileRef = 8417775A085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC4085A1A78000C01D8 = { - fileRef = 8417775C085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC5085A1A7A000C01D8 = { - fileRef = 8417775E085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC6085A1A7B000C01D8 = { - fileRef = 84177760085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC7085A1A7C000C01D8 = { - fileRef = 84177762085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC8085A1A7D000C01D8 = { - fileRef = 84177764085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AC9085A1A7F000C01D8 = { - fileRef = 84177766085A10EB000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACA085A1A87000C01D8 = { - fileRef = 84177769085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACB085A1A88000C01D8 = { - fileRef = 8417776A085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACC085A1A88000C01D8 = { - fileRef = 8417776B085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACD085A1A89000C01D8 = { - fileRef = 8417776C085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACE085A1A8A000C01D8 = { - fileRef = 8417776D085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ACF085A1A8B000C01D8 = { - fileRef = 8417776E085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD0085A1A8C000C01D8 = { - fileRef = 84177770085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD1085A1A8D000C01D8 = { - fileRef = 84177771085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD2085A1A90000C01D8 = { - fileRef = 84177773085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD4085A1A92000C01D8 = { - fileRef = 84177778085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD5085A1A93000C01D8 = { - fileRef = 8417777A085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD6085A1A94000C01D8 = { - fileRef = 8417777B085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD7085A1A97000C01D8 = { - fileRef = 8417777D085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD8085A1A97000C01D8 = { - fileRef = 8417777E085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AD9085A1A99000C01D8 = { - fileRef = 84177780085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ADA085A1A9F000C01D8 = { - fileRef = 84177781085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ADB085A1AA0000C01D8 = { - fileRef = 84177783085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ADC085A1AA2000C01D8 = { - fileRef = 84177786085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177ADF085A1AA4000C01D8 = { - fileRef = 8417778B085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE0085A1AA6000C01D8 = { - fileRef = 8417778D085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE1085A1AA7000C01D8 = { - fileRef = 8417778F085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE2085A1AA8000C01D8 = { - fileRef = 84177791085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE3085A1AA9000C01D8 = { - fileRef = 84177793085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE4085A1AAA000C01D8 = { - fileRef = 84177796085A111B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE5085A1AAE000C01D8 = { - fileRef = 841777A2085A1197000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE7085A1AB5000C01D8 = { - fileRef = 84177798085A1138000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AE8085A1AB6000C01D8 = { - fileRef = 8417779A085A1138000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AEB085A1ABD000C01D8 = { - fileRef = 841777AF085A1228000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AEC085A1ABF000C01D8 = { - fileRef = 841777A0085A117F000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84177AED085A1ABF000C01D8 = { - fileRef = 841778BC085A122A000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D432085DF3D6000C01D8 = { - fileRef = 84177776085A1104000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D433085DF537000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = y_inter.h; - path = ../../y_inter.h; - refType = 2; - }; - 8490D436085DF57B000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = v_video.c; - path = ../../v_video.c; - refType = 2; - }; - 8490D437085DF57B000C01D8 = { - fileRef = 8490D436085DF57B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D438085DF57B000C01D8 = { - fileRef = 8490D436085DF57B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D43C085E0518000C01D8 = { - fileRef = 8417779F085A116B000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D43D085E05F6000C01D8 = { - fileRef = 84177734085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D43E085E05F7000C01D8 = { - fileRef = 84177735085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D43F085E05F8000C01D8 = { - fileRef = 84177739085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D440085E05FA000C01D8 = { - fileRef = 8417773D085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D441085E05FB000C01D8 = { - fileRef = 8417773F085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D442085E05FC000C01D8 = { - fileRef = 84177741085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D443085E05FE000C01D8 = { - fileRef = 84177743085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D444085E05FF000C01D8 = { - fileRef = 84177745085A106C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D445085E0606000C01D8 = { - fileRef = 8417774C085A1097000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D446085E060A000C01D8 = { - fileRef = 84177755085A10AA000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D447085E060B000C01D8 = { - fileRef = 84177758085A10D2000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8490D448085E067E000C01D8 = { - fileRef = 8417779C085A114C000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 8494DFE80886EA0D000C01D8 = { - fileRef = 84C4E04B08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 849603A80A791C11000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = comptime.c; - path = ../../comptime.c; - refType = 2; - }; - 849603A90A791C11000C01D8 = { - fileRef = 849603A80A791C11000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 849603AA0A791C11000C01D8 = { - fileRef = 849603A80A791C11000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 849BD31C0A7E45B3000C01D8 = { - isa = PBXFrameworkReference; - name = libpng.framework; - path = /Library/Frameworks/libpng.framework; - refType = 0; - }; - 849BD31D0A7E45B3000C01D8 = { - fileRef = 849BD31C0A7E45B3000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 849BD31E0A7E45B3000C01D8 = { - fileRef = 849BD31C0A7E45B3000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 849BD32D0A7E471D000C01D8 = { - fileRef = 849BD31C0A7E45B3000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E00D0862063C000C01D8 = { - children = ( - 6755C8BE101802C300A80195, - 6755C8BF101802C300A80195, - 6755C8C0101802C300A80195, - 6755C8C1101802C300A80195, - 6755C8C2101802C300A80195, - 6755C8C3101802C300A80195, - 6755C8C4101802C300A80195, - 6755C8C5101802C300A80195, - 6755C8C6101802C300A80195, - ); - isa = PBXGroup; - name = Data; - refType = 4; - }; - 84C4E03F0862096F000C01D8 = { - isa = PBXFrameworkReference; - name = AppKit.framework; - path = /System/Library/Frameworks/AppKit.framework; - refType = 0; - }; - 84C4E0400862096F000C01D8 = { - fileRef = 84C4E03F0862096F000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E0410862096F000C01D8 = { - fileRef = 84C4E03F0862096F000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E0420862098A000C01D8 = { - isa = PBXFrameworkReference; - name = Foundation.framework; - path = /System/Library/Frameworks/Foundation.framework; - refType = 0; - }; - 84C4E0430862098A000C01D8 = { - fileRef = 84C4E0420862098A000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E0440862098A000C01D8 = { - fileRef = 84C4E0420862098A000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E045086209D3000C01D8 = { - isa = PBXFrameworkReference; - name = CoreFoundation.framework; - path = /System/Library/Frameworks/CoreFoundation.framework; - refType = 0; - }; - 84C4E046086209D3000C01D8 = { - fileRef = 84C4E045086209D3000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E047086209D3000C01D8 = { - fileRef = 84C4E045086209D3000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E048086209FF000C01D8 = { - isa = PBXFrameworkReference; - name = ApplicationServices.framework; - path = /System/Library/Frameworks/ApplicationServices.framework; - refType = 0; - }; - 84C4E049086209FF000C01D8 = { - fileRef = 84C4E048086209FF000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E04A086209FF000C01D8 = { - fileRef = 84C4E048086209FF000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E04B08620A46000C01D8 = { - isa = PBXFrameworkReference; - name = SDL_mixer.framework; - path = /Library/Frameworks/SDL_mixer.framework; - refType = 0; - }; - 84C4E04C08620A46000C01D8 = { - isa = PBXFrameworkReference; - name = SDL.framework; - path = /Library/Frameworks/SDL.framework; - refType = 0; - }; - 84C4E04E08620A46000C01D8 = { - fileRef = 84C4E04C08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E04F08620A46000C01D8 = { - fileRef = 84C4E04B08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84C4E05008620A46000C01D8 = { - fileRef = 84C4E04C08620A46000C01D8; - isa = PBXBuildFile; - settings = { - }; - }; - 84F202C708A92A5D000C01D8 = { - isa = PBXFrameworkReference; - name = OpenAL.framework; - path = /Library/Frameworks/OpenAL.framework; - refType = 0; - }; - 84F202CA08A92AA0000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = s_openal.c; - path = ../../hardware/s_openal/s_openal.c; - refType = 2; - }; - }; - rootObject = 84177702085A0C64000C01D8; -} diff --git a/src/sdl2/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl2/macosx/Srb2mac.xcodeproj/project.pbxproj deleted file mode 100644 index 5c34c55c..00000000 --- a/src/sdl2/macosx/Srb2mac.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1510 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 44; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 1E308E720B71172D0015728C /* lzf.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44B2240B67EADE00BAD059 /* lzf.c */; }; - 1E32C4290B6E6D5D0029E058 /* libpng.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E32C4140B6E6D5D0029E058 /* libpng.framework */; }; - 1E32C42B0B6E6D6E0029E058 /* libpng.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 1E32C4140B6E6D5D0029E058 /* libpng.framework */; }; - 1E44AE750B67CC2B00BAD059 /* hw_bsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE610B67CC2B00BAD059 /* hw_bsp.c */; }; - 1E44AE770B67CC2B00BAD059 /* hw3sound.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE630B67CC2B00BAD059 /* hw3sound.c */; }; - 1E44AE780B67CC2B00BAD059 /* hw_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE640B67CC2B00BAD059 /* hw_cache.c */; }; - 1E44AE7C0B67CC2B00BAD059 /* hw_light.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE680B67CC2B00BAD059 /* hw_light.c */; }; - 1E44AE800B67CC2B00BAD059 /* hw_draw.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE6C0B67CC2B00BAD059 /* hw_draw.c */; }; - 1E44AE820B67CC2B00BAD059 /* hw_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE6E0B67CC2B00BAD059 /* hw_main.c */; }; - 1E44AE840B67CC2B00BAD059 /* hw_md2.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE700B67CC2B00BAD059 /* hw_md2.c */; }; - 1E44AE860B67CC2B00BAD059 /* hw_trick.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE720B67CC2B00BAD059 /* hw_trick.c */; }; - 1E44AEA40B67CC8500BAD059 /* d_clisrv.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE8D0B67CC8400BAD059 /* d_clisrv.c */; }; - 1E44AEA70B67CC8500BAD059 /* d_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE900B67CC8400BAD059 /* d_main.c */; }; - 1E44AEA80B67CC8500BAD059 /* d_net.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE910B67CC8500BAD059 /* d_net.c */; }; - 1E44AEAB0B67CC8500BAD059 /* d_netfil.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE940B67CC8500BAD059 /* d_netfil.c */; }; - 1E44AEAF0B67CC8500BAD059 /* d_netcmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE980B67CC8500BAD059 /* d_netcmd.c */; }; - 1E44AEB30B67CC8500BAD059 /* dehacked.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AE9C0B67CC8500BAD059 /* dehacked.c */; }; - 1E44AEBF0B67CCA900BAD059 /* f_wipe.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEBC0B67CCA900BAD059 /* f_wipe.c */; }; - 1E44AEC00B67CCA900BAD059 /* f_finale.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEBD0B67CCA900BAD059 /* f_finale.c */; }; - 1E44AEC80B67CCC600BAD059 /* g_game.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEC30B67CCC600BAD059 /* g_game.c */; }; - 1E44AECC0B67CCC600BAD059 /* g_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEC70B67CCC600BAD059 /* g_input.c */; }; - 1E44AED00B67CCEE00BAD059 /* hu_stuff.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AECE0B67CCEE00BAD059 /* hu_stuff.c */; }; - 1E44AEDC0B67CD1300BAD059 /* i_tcp.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AED50B67CD1200BAD059 /* i_tcp.c */; }; - 1E44AEE30B67CD2B00BAD059 /* am_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEE10B67CD2B00BAD059 /* am_map.c */; }; - 1E44AEE90B67CD3F00BAD059 /* command.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEE70B67CD3F00BAD059 /* command.c */; }; - 1E44AEEC0B67CD4400BAD059 /* comptime.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEEB0B67CD4400BAD059 /* comptime.c */; }; - 1E44AEEF0B67CD5400BAD059 /* console.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEED0B67CD5400BAD059 /* console.c */; }; - 1E44AEF30B67CD7F00BAD059 /* filesrch.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEF10B67CD7F00BAD059 /* filesrch.c */; }; - 1E44AF070B67CDE900BAD059 /* m_argv.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEF80B67CDE900BAD059 /* m_argv.c */; }; - 1E44AF0A0B67CDE900BAD059 /* m_cheat.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEFB0B67CDE900BAD059 /* m_cheat.c */; }; - 1E44AF0B0B67CDE900BAD059 /* m_bbox.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEFC0B67CDE900BAD059 /* m_bbox.c */; }; - 1E44AF0D0B67CDE900BAD059 /* m_fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEFE0B67CDE900BAD059 /* m_fixed.c */; }; - 1E44AF0F0B67CDE900BAD059 /* m_menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF000B67CDE900BAD059 /* m_menu.c */; }; - 1E44AF110B67CDE900BAD059 /* m_misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF020B67CDE900BAD059 /* m_misc.c */; }; - 1E44AF130B67CDE900BAD059 /* m_random.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF040B67CDE900BAD059 /* m_random.c */; }; - 1E44AF1A0B67CE2A00BAD059 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF180B67CE2A00BAD059 /* info.c */; }; - 1E44AF1E0B67CE3600BAD059 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF1C0B67CE3600BAD059 /* md5.c */; }; - 1E44AF220B67CE4100BAD059 /* mserv.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF200B67CE4100BAD059 /* mserv.c */; }; - 1E44AF3C0B67CE5F00BAD059 /* p_enemy.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF240B67CE5F00BAD059 /* p_enemy.c */; }; - 1E44AF3D0B67CE5F00BAD059 /* p_inter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF250B67CE5F00BAD059 /* p_inter.c */; }; - 1E44AF3E0B67CE5F00BAD059 /* p_fab.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF260B67CE5F00BAD059 /* p_fab.c */; }; - 1E44AF3F0B67CE5F00BAD059 /* p_lights.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF270B67CE5F00BAD059 /* p_lights.c */; }; - 1E44AF400B67CE5F00BAD059 /* p_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF280B67CE5F00BAD059 /* p_map.c */; }; - 1E44AF410B67CE5F00BAD059 /* p_maputl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF290B67CE5F00BAD059 /* p_maputl.c */; }; - 1E44AF430B67CE5F00BAD059 /* p_mobj.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF2B0B67CE5F00BAD059 /* p_mobj.c */; }; - 1E44AF450B67CE5F00BAD059 /* p_floor.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF2D0B67CE5F00BAD059 /* p_floor.c */; }; - 1E44AF480B67CE5F00BAD059 /* p_saveg.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF300B67CE5F00BAD059 /* p_saveg.c */; }; - 1E44AF4A0B67CE5F00BAD059 /* p_setup.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF320B67CE5F00BAD059 /* p_setup.c */; }; - 1E44AF4C0B67CE5F00BAD059 /* p_sight.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF340B67CE5F00BAD059 /* p_sight.c */; }; - 1E44AF4D0B67CE5F00BAD059 /* p_spec.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF350B67CE5F00BAD059 /* p_spec.c */; }; - 1E44AF4F0B67CE5F00BAD059 /* p_telept.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF370B67CE5F00BAD059 /* p_telept.c */; }; - 1E44AF500B67CE5F00BAD059 /* p_tick.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF380B67CE5F00BAD059 /* p_tick.c */; }; - 1E44AF520B67CE5F00BAD059 /* p_user.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF3A0B67CE5F00BAD059 /* p_user.c */; }; - 1E44AF530B67CE5F00BAD059 /* p_ceilng.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF3B0B67CE5F00BAD059 /* p_ceilng.c */; }; - 1E44AF6C0B67CEC200BAD059 /* r_bsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF550B67CEC100BAD059 /* r_bsp.c */; }; - 1E44AF6F0B67CEC200BAD059 /* r_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF580B67CEC100BAD059 /* r_data.c */; }; - 1E44AF700B67CEC200BAD059 /* r_draw.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF590B67CEC100BAD059 /* r_draw.c */; }; - 1E44AF730B67CEC200BAD059 /* r_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF5C0B67CEC100BAD059 /* r_main.c */; }; - 1E44AF780B67CEC200BAD059 /* r_plane.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF610B67CEC100BAD059 /* r_plane.c */; }; - 1E44AF7A0B67CEC200BAD059 /* r_segs.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF630B67CEC100BAD059 /* r_segs.c */; }; - 1E44AF7C0B67CEC200BAD059 /* r_sky.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF650B67CEC200BAD059 /* r_sky.c */; }; - 1E44AF7E0B67CEC200BAD059 /* r_splats.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF670B67CEC200BAD059 /* r_splats.c */; }; - 1E44AF810B67CEC200BAD059 /* r_things.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF6A0B67CEC200BAD059 /* r_things.c */; }; - 1E44AF870B67CEE000BAD059 /* s_sound.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF850B67CEE000BAD059 /* s_sound.c */; }; - 1E44AF8B0B67CEE900BAD059 /* screen.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF890B67CEE900BAD059 /* screen.c */; }; - 1E44AF8F0B67CEF000BAD059 /* sounds.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF8D0B67CEF000BAD059 /* sounds.c */; }; - 1E44AF930B67CEFF00BAD059 /* st_stuff.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF910B67CEFF00BAD059 /* st_stuff.c */; }; - 1E44AF9B0B67CF2E00BAD059 /* tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF990B67CF2E00BAD059 /* tables.c */; }; - 1E44AFA50B67CF5D00BAD059 /* v_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFA30B67CF5D00BAD059 /* v_video.c */; }; - 1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFA70B67CF6400BAD059 /* w_wad.c */; }; - 1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAB0B67CF6F00BAD059 /* y_inter.c */; }; - 1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAF0B67CF7A00BAD059 /* z_zone.c */; }; - 1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB40B67CFDC00BAD059 /* dosstr.c */; }; - 1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB50B67CFDC00BAD059 /* endtxt.c */; }; - 1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */; }; - 1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB90B67CFDC00BAD059 /* i_cdmus.c */; }; - 1E44AFCA0B67CFDC00BAD059 /* i_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFBA0B67CFDC00BAD059 /* i_main.c */; }; - 1E44AFCB0B67CFDC00BAD059 /* i_net.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFBB0B67CFDC00BAD059 /* i_net.c */; }; - 1E44AFCD0B67CFDC00BAD059 /* i_system.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFBD0B67CFDC00BAD059 /* i_system.c */; }; - 1E44AFCE0B67CFDC00BAD059 /* i_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFBE0B67CFDC00BAD059 /* i_video.c */; }; - 1E44AFD00B67CFDC00BAD059 /* ogl_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFC00B67CFDC00BAD059 /* ogl_sdl.c */; }; - 1E44AFEA0B67D06200BAD059 /* Srb2mac.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1E44AFE70B67D06200BAD059 /* Srb2mac.icns */; }; - 1E44AFEB0B67D06200BAD059 /* mac_alert.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFE80B67D06200BAD059 /* mac_alert.c */; }; - 1E44AFED0B67D0AB00BAD059 /* r_opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFEC0B67D0AB00BAD059 /* r_opengl.c */; }; - 1E44B0590B67D81E00BAD059 /* SDL_macosx_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E44B0570B67D81E00BAD059 /* SDL_macosx_main.m */; }; - 1E66921C0B690C5B00B7313A /* SDL_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E66921B0B690C5B00B7313A /* SDL_mixer.framework */; }; - 1E66921D0B690C6B00B7313A /* SDL_mixer.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 1E66921B0B690C5B00B7313A /* SDL_mixer.framework */; }; - 67259DFD18D2687D00F02971 /* lua_hudlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259DFB18D2687D00F02971 /* lua_hudlib.c */; }; - 67259DFE18D2687D00F02971 /* lua_skinlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259DFC18D2687D00F02971 /* lua_skinlib.c */; }; - 67259E0118D268AE00F02971 /* m_anigif.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259DFF18D268AE00F02971 /* m_anigif.c */; }; - 67259E0618D268F700F02971 /* i_ttf.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259E0218D268F600F02971 /* i_ttf.c */; }; - 67259E0718D268F700F02971 /* mixer_sound.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259E0418D268F600F02971 /* mixer_sound.c */; }; - 67259E0818D268F700F02971 /* sdl_sound.c in Sources */ = {isa = PBXBuildFile; fileRef = 67259E0518D268F600F02971 /* sdl_sound.c */; }; - 67259E2E18D26D5700F02971 /* patch.dta in Resources */ = {isa = PBXBuildFile; fileRef = 67259E2B18D26D5700F02971 /* patch.dta */; }; - 67259E2F18D26D5700F02971 /* rings.dta in Resources */ = {isa = PBXBuildFile; fileRef = 67259E2C18D26D5700F02971 /* rings.dta */; }; - 67259E3018D26D5700F02971 /* srb2.srb in Resources */ = {isa = PBXBuildFile; fileRef = 67259E2D18D26D5700F02971 /* srb2.srb */; }; - 67259E3218D26DD200F02971 /* music.dta in Resources */ = {isa = PBXBuildFile; fileRef = 1E44AE440B67CBE800BAD059 /* music.dta */; }; - 67259E3318D26DD300F02971 /* player.dta in Resources */ = {isa = PBXBuildFile; fileRef = 67A1F91813FAD026009FA3E5 /* player.dta */; }; - 67259E3518D26DD500F02971 /* zones.dta in Resources */ = {isa = PBXBuildFile; fileRef = 6766C0AE11B057E50065F389 /* zones.dta */; }; - 676BB5200E0DE06100C95963 /* m_queue.c in Sources */ = {isa = PBXBuildFile; fileRef = 676BB51C0E0DE06100C95963 /* m_queue.c */; }; - 676BB5220E0DE06100C95963 /* p_polyobj.c in Sources */ = {isa = PBXBuildFile; fileRef = 676BB51E0E0DE06100C95963 /* p_polyobj.c */; }; - 67B83BFA14F57EAB00AAAE4E /* lapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BCB14F57EAB00AAAE4E /* lapi.c */; }; - 67B83BFB14F57EAB00AAAE4E /* lauxlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BCD14F57EAB00AAAE4E /* lauxlib.c */; }; - 67B83BFC14F57EAB00AAAE4E /* lbaselib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BCF14F57EAB00AAAE4E /* lbaselib.c */; }; - 67B83BFD14F57EAB00AAAE4E /* lcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD014F57EAB00AAAE4E /* lcode.c */; }; - 67B83BFE14F57EAB00AAAE4E /* ldebug.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD214F57EAB00AAAE4E /* ldebug.c */; }; - 67B83BFF14F57EAB00AAAE4E /* ldo.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD414F57EAB00AAAE4E /* ldo.c */; }; - 67B83C0014F57EAB00AAAE4E /* ldump.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD614F57EAB00AAAE4E /* ldump.c */; }; - 67B83C0114F57EAB00AAAE4E /* lfunc.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD714F57EAB00AAAE4E /* lfunc.c */; }; - 67B83C0214F57EAB00AAAE4E /* lgc.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BD914F57EAB00AAAE4E /* lgc.c */; }; - 67B83C0314F57EAB00AAAE4E /* linit.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BDB14F57EAB00AAAE4E /* linit.c */; }; - 67B83C0414F57EAB00AAAE4E /* llex.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BDC14F57EAB00AAAE4E /* llex.c */; }; - 67B83C0514F57EAB00AAAE4E /* lmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BDF14F57EAB00AAAE4E /* lmem.c */; }; - 67B83C0614F57EAB00AAAE4E /* lobject.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BE114F57EAB00AAAE4E /* lobject.c */; }; - 67B83C0714F57EAB00AAAE4E /* lopcodes.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BE314F57EAB00AAAE4E /* lopcodes.c */; }; - 67B83C0814F57EAB00AAAE4E /* lparser.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BE514F57EAB00AAAE4E /* lparser.c */; }; - 67B83C0914F57EAB00AAAE4E /* lstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BE714F57EAB00AAAE4E /* lstate.c */; }; - 67B83C0A14F57EAB00AAAE4E /* lstring.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BE914F57EAB00AAAE4E /* lstring.c */; }; - 67B83C0B14F57EAB00AAAE4E /* lstrlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BEB14F57EAB00AAAE4E /* lstrlib.c */; }; - 67B83C0C14F57EAB00AAAE4E /* ltable.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BEC14F57EAB00AAAE4E /* ltable.c */; }; - 67B83C0D14F57EAB00AAAE4E /* ltablib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BEE14F57EAB00AAAE4E /* ltablib.c */; }; - 67B83C0E14F57EAB00AAAE4E /* ltm.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BEF14F57EAB00AAAE4E /* ltm.c */; }; - 67B83C0F14F57EAB00AAAE4E /* lundump.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BF414F57EAB00AAAE4E /* lundump.c */; }; - 67B83C1014F57EAB00AAAE4E /* lvm.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BF614F57EAB00AAAE4E /* lvm.c */; }; - 67B83C1114F57EAB00AAAE4E /* lzio.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83BF814F57EAB00AAAE4E /* lzio.c */; }; - 67B83C1414F57ECA00AAAE4E /* b_bot.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1214F57ECA00AAAE4E /* b_bot.c */; }; - 67B83C2214F57EE600AAAE4E /* lua_baselib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1514F57EE600AAAE4E /* lua_baselib.c */; }; - 67B83C2314F57EE600AAAE4E /* lua_consolelib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1614F57EE600AAAE4E /* lua_consolelib.c */; }; - 67B83C2414F57EE600AAAE4E /* lua_hooklib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1814F57EE600AAAE4E /* lua_hooklib.c */; }; - 67B83C2514F57EE600AAAE4E /* lua_infolib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1914F57EE600AAAE4E /* lua_infolib.c */; }; - 67B83C2614F57EE600AAAE4E /* lua_maplib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1B14F57EE600AAAE4E /* lua_maplib.c */; }; - 67B83C2714F57EE600AAAE4E /* lua_mathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1C14F57EE600AAAE4E /* lua_mathlib.c */; }; - 67B83C2814F57EE600AAAE4E /* lua_mobjlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1D14F57EE600AAAE4E /* lua_mobjlib.c */; }; - 67B83C2914F57EE600AAAE4E /* lua_playerlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1E14F57EE600AAAE4E /* lua_playerlib.c */; }; - 67B83C2A14F57EE600AAAE4E /* lua_script.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C1F14F57EE600AAAE4E /* lua_script.c */; }; - 67B83C2B14F57EE600AAAE4E /* lua_thinkerlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C2114F57EE600AAAE4E /* lua_thinkerlib.c */; }; - 67B83C3314F57F1500AAAE4E /* m_cond.c in Sources */ = {isa = PBXBuildFile; fileRef = 67B83C2F14F57F1500AAAE4E /* m_cond.c */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 1E32C42B0B6E6D6E0029E058 /* libpng.framework in Copy Frameworks into .app bundle */, - 1E66921D0B690C6B00B7313A /* SDL_mixer.framework in Copy Frameworks into .app bundle */, - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 1E32C4140B6E6D5D0029E058 /* libpng.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libpng.framework; path = /Library/Frameworks/libpng.framework; sourceTree = ""; }; - 1E44AE440B67CBE800BAD059 /* music.dta */ = {isa = PBXFileReference; lastKnownFileType = text; name = music.dta; path = ../../../bin/Resources/music.dta; sourceTree = SOURCE_ROOT; }; - 1E44AE4B0B67CBE800BAD059 /* srb2.wad */ = {isa = PBXFileReference; lastKnownFileType = text; name = srb2.wad; path = ../../../bin/Resources/srb2.wad; sourceTree = SOURCE_ROOT; }; - 1E44AE600B67CC2B00BAD059 /* hw3dsdrv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw3dsdrv.h; path = ../../hardware/hw3dsdrv.h; sourceTree = SOURCE_ROOT; }; - 1E44AE610B67CC2B00BAD059 /* hw_bsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_bsp.c; path = ../../hardware/hw_bsp.c; sourceTree = SOURCE_ROOT; }; - 1E44AE620B67CC2B00BAD059 /* hw_defs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_defs.h; path = ../../hardware/hw_defs.h; sourceTree = SOURCE_ROOT; }; - 1E44AE630B67CC2B00BAD059 /* hw3sound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw3sound.c; path = ../../hardware/hw3sound.c; sourceTree = SOURCE_ROOT; }; - 1E44AE640B67CC2B00BAD059 /* hw_cache.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_cache.c; path = ../../hardware/hw_cache.c; sourceTree = SOURCE_ROOT; }; - 1E44AE650B67CC2B00BAD059 /* hw_dll.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_dll.h; path = ../../hardware/hw_dll.h; sourceTree = SOURCE_ROOT; }; - 1E44AE660B67CC2B00BAD059 /* hw_drv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_drv.h; path = ../../hardware/hw_drv.h; sourceTree = SOURCE_ROOT; }; - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_glide.h; path = ../../hardware/hw_glide.h; sourceTree = SOURCE_ROOT; }; - 1E44AE680B67CC2B00BAD059 /* hw_light.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_light.c; path = ../../hardware/hw_light.c; sourceTree = SOURCE_ROOT; }; - 1E44AE690B67CC2B00BAD059 /* hw_light.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_light.h; path = ../../hardware/hw_light.h; sourceTree = SOURCE_ROOT; }; - 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw3sound.h; path = ../../hardware/hw3sound.h; sourceTree = SOURCE_ROOT; }; - 1E44AE6B0B67CC2B00BAD059 /* hw_data.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_data.h; path = ../../hardware/hw_data.h; sourceTree = SOURCE_ROOT; }; - 1E44AE6C0B67CC2B00BAD059 /* hw_draw.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_draw.c; path = ../../hardware/hw_draw.c; sourceTree = SOURCE_ROOT; }; - 1E44AE6D0B67CC2B00BAD059 /* hw_glob.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_glob.h; path = ../../hardware/hw_glob.h; sourceTree = SOURCE_ROOT; }; - 1E44AE6E0B67CC2B00BAD059 /* hw_main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_main.c; path = ../../hardware/hw_main.c; sourceTree = SOURCE_ROOT; }; - 1E44AE6F0B67CC2B00BAD059 /* hw_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_main.h; path = ../../hardware/hw_main.h; sourceTree = SOURCE_ROOT; }; - 1E44AE700B67CC2B00BAD059 /* hw_md2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_md2.c; path = ../../hardware/hw_md2.c; sourceTree = SOURCE_ROOT; }; - 1E44AE710B67CC2B00BAD059 /* hw_md2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_md2.h; path = ../../hardware/hw_md2.h; sourceTree = SOURCE_ROOT; }; - 1E44AE720B67CC2B00BAD059 /* hw_trick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_trick.c; path = ../../hardware/hw_trick.c; sourceTree = SOURCE_ROOT; }; - 1E44AE730B67CC2B00BAD059 /* hws_data.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hws_data.h; path = ../../hardware/hws_data.h; sourceTree = SOURCE_ROOT; }; - 1E44AE8A0B67CC6000BAD059 /* asm_defs.inc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.pascal; name = asm_defs.inc; path = ../../asm_defs.inc; sourceTree = SOURCE_ROOT; }; - 1E44AE8D0B67CC8400BAD059 /* d_clisrv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = d_clisrv.c; path = ../../d_clisrv.c; sourceTree = SOURCE_ROOT; }; - 1E44AE8E0B67CC8400BAD059 /* d_clisrv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_clisrv.h; path = ../../d_clisrv.h; sourceTree = SOURCE_ROOT; }; - 1E44AE8F0B67CC8400BAD059 /* d_event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_event.h; path = ../../d_event.h; sourceTree = SOURCE_ROOT; }; - 1E44AE900B67CC8400BAD059 /* d_main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = d_main.c; path = ../../d_main.c; sourceTree = SOURCE_ROOT; }; - 1E44AE910B67CC8500BAD059 /* d_net.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = d_net.c; path = ../../d_net.c; sourceTree = SOURCE_ROOT; }; - 1E44AE920B67CC8500BAD059 /* d_net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_net.h; path = ../../d_net.h; sourceTree = SOURCE_ROOT; }; - 1E44AE930B67CC8500BAD059 /* d_netcmd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_netcmd.h; path = ../../d_netcmd.h; sourceTree = SOURCE_ROOT; }; - 1E44AE940B67CC8500BAD059 /* d_netfil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = d_netfil.c; path = ../../d_netfil.c; sourceTree = SOURCE_ROOT; }; - 1E44AE950B67CC8500BAD059 /* d_player.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_player.h; path = ../../d_player.h; sourceTree = SOURCE_ROOT; }; - 1E44AE960B67CC8500BAD059 /* d_think.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_think.h; path = ../../d_think.h; sourceTree = SOURCE_ROOT; }; - 1E44AE980B67CC8500BAD059 /* d_netcmd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = d_netcmd.c; path = ../../d_netcmd.c; sourceTree = SOURCE_ROOT; }; - 1E44AE990B67CC8500BAD059 /* d_ticcmd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_ticcmd.h; path = ../../d_ticcmd.h; sourceTree = SOURCE_ROOT; }; - 1E44AE9A0B67CC8500BAD059 /* d_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_main.h; path = ../../d_main.h; sourceTree = SOURCE_ROOT; }; - 1E44AE9B0B67CC8500BAD059 /* d_netfil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = d_netfil.h; path = ../../d_netfil.h; sourceTree = SOURCE_ROOT; }; - 1E44AE9C0B67CC8500BAD059 /* dehacked.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dehacked.c; path = ../../dehacked.c; sourceTree = SOURCE_ROOT; }; - 1E44AE9D0B67CC8500BAD059 /* dehacked.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dehacked.h; path = ../../dehacked.h; sourceTree = SOURCE_ROOT; }; - 1E44AE9E0B67CC8500BAD059 /* doomdata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = doomdata.h; path = ../../doomdata.h; sourceTree = SOURCE_ROOT; }; - 1E44AE9F0B67CC8500BAD059 /* doomdef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = doomdef.h; path = ../../doomdef.h; sourceTree = SOURCE_ROOT; }; - 1E44AEA00B67CC8500BAD059 /* doomstat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = doomstat.h; path = ../../doomstat.h; sourceTree = SOURCE_ROOT; }; - 1E44AEA10B67CC8500BAD059 /* doomtype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = doomtype.h; path = ../../doomtype.h; sourceTree = SOURCE_ROOT; }; - 1E44AEBC0B67CCA900BAD059 /* f_wipe.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = f_wipe.c; path = ../../f_wipe.c; sourceTree = SOURCE_ROOT; }; - 1E44AEBD0B67CCA900BAD059 /* f_finale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = f_finale.c; path = ../../f_finale.c; sourceTree = SOURCE_ROOT; }; - 1E44AEBE0B67CCA900BAD059 /* f_finale.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = f_finale.h; path = ../../f_finale.h; sourceTree = SOURCE_ROOT; }; - 1E44AEC30B67CCC600BAD059 /* g_game.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = g_game.c; path = ../../g_game.c; sourceTree = SOURCE_ROOT; }; - 1E44AEC40B67CCC600BAD059 /* g_game.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = g_game.h; path = ../../g_game.h; sourceTree = SOURCE_ROOT; }; - 1E44AEC50B67CCC600BAD059 /* g_input.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = g_input.h; path = ../../g_input.h; sourceTree = SOURCE_ROOT; }; - 1E44AEC60B67CCC600BAD059 /* g_state.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = g_state.h; path = ../../g_state.h; sourceTree = SOURCE_ROOT; }; - 1E44AEC70B67CCC600BAD059 /* g_input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = g_input.c; path = ../../g_input.c; sourceTree = SOURCE_ROOT; }; - 1E44AECE0B67CCEE00BAD059 /* hu_stuff.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hu_stuff.c; path = ../../hu_stuff.c; sourceTree = SOURCE_ROOT; }; - 1E44AECF0B67CCEE00BAD059 /* hu_stuff.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hu_stuff.h; path = ../../hu_stuff.h; sourceTree = SOURCE_ROOT; }; - 1E44AED30B67CD1200BAD059 /* i_net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_net.h; path = ../../i_net.h; sourceTree = SOURCE_ROOT; }; - 1E44AED40B67CD1200BAD059 /* i_sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_sound.h; path = ../../i_sound.h; sourceTree = SOURCE_ROOT; }; - 1E44AED50B67CD1200BAD059 /* i_tcp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_tcp.c; path = ../../i_tcp.c; sourceTree = SOURCE_ROOT; }; - 1E44AED60B67CD1200BAD059 /* i_tcp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_tcp.h; path = ../../i_tcp.h; sourceTree = SOURCE_ROOT; }; - 1E44AED70B67CD1200BAD059 /* i_system.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_system.h; path = ../../i_system.h; sourceTree = SOURCE_ROOT; }; - 1E44AED80B67CD1200BAD059 /* i_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_video.h; path = ../../i_video.h; sourceTree = SOURCE_ROOT; }; - 1E44AED90B67CD1300BAD059 /* i_joy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = i_joy.h; path = ../../i_joy.h; sourceTree = SOURCE_ROOT; }; - 1E44AEE10B67CD2B00BAD059 /* am_map.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = am_map.c; path = ../../am_map.c; sourceTree = SOURCE_ROOT; }; - 1E44AEE20B67CD2B00BAD059 /* am_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = am_map.h; path = ../../am_map.h; sourceTree = SOURCE_ROOT; }; - 1E44AEE50B67CD3200BAD059 /* byteptr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = byteptr.h; path = ../../byteptr.h; sourceTree = SOURCE_ROOT; }; - 1E44AEE70B67CD3F00BAD059 /* command.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = command.c; path = ../../command.c; sourceTree = SOURCE_ROOT; }; - 1E44AEE80B67CD3F00BAD059 /* command.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = command.h; path = ../../command.h; sourceTree = SOURCE_ROOT; }; - 1E44AEEB0B67CD4400BAD059 /* comptime.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = comptime.c; path = ../../comptime.c; sourceTree = SOURCE_ROOT; }; - 1E44AEED0B67CD5400BAD059 /* console.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = console.c; path = ../../console.c; sourceTree = SOURCE_ROOT; }; - 1E44AEEE0B67CD5400BAD059 /* console.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = console.h; path = ../../console.h; sourceTree = SOURCE_ROOT; }; - 1E44AEF10B67CD7F00BAD059 /* filesrch.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = filesrch.c; path = ../../filesrch.c; sourceTree = SOURCE_ROOT; }; - 1E44AEF20B67CD7F00BAD059 /* filesrch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filesrch.h; path = ../../filesrch.h; sourceTree = SOURCE_ROOT; }; - 1E44AEF50B67CD9F00BAD059 /* keys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = keys.h; path = ../../keys.h; sourceTree = SOURCE_ROOT; }; - 1E44AEF80B67CDE900BAD059 /* m_argv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_argv.c; path = ../../m_argv.c; sourceTree = SOURCE_ROOT; }; - 1E44AEF90B67CDE900BAD059 /* m_bbox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_bbox.h; path = ../../m_bbox.h; sourceTree = SOURCE_ROOT; }; - 1E44AEFA0B67CDE900BAD059 /* m_argv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_argv.h; path = ../../m_argv.h; sourceTree = SOURCE_ROOT; }; - 1E44AEFB0B67CDE900BAD059 /* m_cheat.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_cheat.c; path = ../../m_cheat.c; sourceTree = SOURCE_ROOT; }; - 1E44AEFC0B67CDE900BAD059 /* m_bbox.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_bbox.c; path = ../../m_bbox.c; sourceTree = SOURCE_ROOT; }; - 1E44AEFD0B67CDE900BAD059 /* m_cheat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_cheat.h; path = ../../m_cheat.h; sourceTree = SOURCE_ROOT; }; - 1E44AEFE0B67CDE900BAD059 /* m_fixed.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_fixed.c; path = ../../m_fixed.c; sourceTree = SOURCE_ROOT; }; - 1E44AEFF0B67CDE900BAD059 /* m_fixed.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_fixed.h; path = ../../m_fixed.h; sourceTree = SOURCE_ROOT; }; - 1E44AF000B67CDE900BAD059 /* m_menu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_menu.c; path = ../../m_menu.c; sourceTree = SOURCE_ROOT; }; - 1E44AF010B67CDE900BAD059 /* m_menu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_menu.h; path = ../../m_menu.h; sourceTree = SOURCE_ROOT; }; - 1E44AF020B67CDE900BAD059 /* m_misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_misc.c; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; }; - 1E44AF030B67CDE900BAD059 /* m_misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_misc.h; path = ../../m_misc.h; sourceTree = SOURCE_ROOT; }; - 1E44AF040B67CDE900BAD059 /* m_random.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_random.c; path = ../../m_random.c; sourceTree = SOURCE_ROOT; }; - 1E44AF050B67CDE900BAD059 /* m_random.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_random.h; path = ../../m_random.h; sourceTree = SOURCE_ROOT; }; - 1E44AF060B67CDE900BAD059 /* m_swap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_swap.h; path = ../../m_swap.h; sourceTree = SOURCE_ROOT; }; - 1E44AF180B67CE2A00BAD059 /* info.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = info.c; path = ../../info.c; sourceTree = SOURCE_ROOT; }; - 1E44AF190B67CE2A00BAD059 /* info.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = info.h; path = ../../info.h; sourceTree = SOURCE_ROOT; }; - 1E44AF1C0B67CE3600BAD059 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ../../md5.c; sourceTree = SOURCE_ROOT; }; - 1E44AF1D0B67CE3600BAD059 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = md5.h; path = ../../md5.h; sourceTree = SOURCE_ROOT; }; - 1E44AF200B67CE4100BAD059 /* mserv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = mserv.c; path = ../../mserv.c; sourceTree = SOURCE_ROOT; }; - 1E44AF210B67CE4100BAD059 /* mserv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = mserv.h; path = ../../mserv.h; sourceTree = SOURCE_ROOT; }; - 1E44AF240B67CE5F00BAD059 /* p_enemy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_enemy.c; path = ../../p_enemy.c; sourceTree = SOURCE_ROOT; }; - 1E44AF250B67CE5F00BAD059 /* p_inter.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_inter.c; path = ../../p_inter.c; sourceTree = SOURCE_ROOT; }; - 1E44AF260B67CE5F00BAD059 /* p_fab.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_fab.c; path = ../../p_fab.c; sourceTree = SOURCE_ROOT; }; - 1E44AF270B67CE5F00BAD059 /* p_lights.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_lights.c; path = ../../p_lights.c; sourceTree = SOURCE_ROOT; }; - 1E44AF280B67CE5F00BAD059 /* p_map.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_map.c; path = ../../p_map.c; sourceTree = SOURCE_ROOT; }; - 1E44AF290B67CE5F00BAD059 /* p_maputl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_maputl.c; path = ../../p_maputl.c; sourceTree = SOURCE_ROOT; }; - 1E44AF2A0B67CE5F00BAD059 /* p_maputl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_maputl.h; path = ../../p_maputl.h; sourceTree = SOURCE_ROOT; }; - 1E44AF2B0B67CE5F00BAD059 /* p_mobj.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_mobj.c; path = ../../p_mobj.c; sourceTree = SOURCE_ROOT; }; - 1E44AF2C0B67CE5F00BAD059 /* p_mobj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_mobj.h; path = ../../p_mobj.h; sourceTree = SOURCE_ROOT; }; - 1E44AF2D0B67CE5F00BAD059 /* p_floor.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_floor.c; path = ../../p_floor.c; sourceTree = SOURCE_ROOT; }; - 1E44AF2E0B67CE5F00BAD059 /* p_local.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_local.h; path = ../../p_local.h; sourceTree = SOURCE_ROOT; }; - 1E44AF2F0B67CE5F00BAD059 /* p_pspr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_pspr.h; path = ../../p_pspr.h; sourceTree = SOURCE_ROOT; }; - 1E44AF300B67CE5F00BAD059 /* p_saveg.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_saveg.c; path = ../../p_saveg.c; sourceTree = SOURCE_ROOT; }; - 1E44AF310B67CE5F00BAD059 /* p_saveg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_saveg.h; path = ../../p_saveg.h; sourceTree = SOURCE_ROOT; }; - 1E44AF320B67CE5F00BAD059 /* p_setup.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_setup.c; path = ../../p_setup.c; sourceTree = SOURCE_ROOT; }; - 1E44AF330B67CE5F00BAD059 /* p_setup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_setup.h; path = ../../p_setup.h; sourceTree = SOURCE_ROOT; }; - 1E44AF340B67CE5F00BAD059 /* p_sight.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_sight.c; path = ../../p_sight.c; sourceTree = SOURCE_ROOT; }; - 1E44AF350B67CE5F00BAD059 /* p_spec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_spec.c; path = ../../p_spec.c; sourceTree = SOURCE_ROOT; }; - 1E44AF360B67CE5F00BAD059 /* p_spec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_spec.h; path = ../../p_spec.h; sourceTree = SOURCE_ROOT; }; - 1E44AF370B67CE5F00BAD059 /* p_telept.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_telept.c; path = ../../p_telept.c; sourceTree = SOURCE_ROOT; }; - 1E44AF380B67CE5F00BAD059 /* p_tick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_tick.c; path = ../../p_tick.c; sourceTree = SOURCE_ROOT; }; - 1E44AF390B67CE5F00BAD059 /* p_tick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = p_tick.h; path = ../../p_tick.h; sourceTree = SOURCE_ROOT; }; - 1E44AF3A0B67CE5F00BAD059 /* p_user.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_user.c; path = ../../p_user.c; sourceTree = SOURCE_ROOT; }; - 1E44AF3B0B67CE5F00BAD059 /* p_ceilng.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = p_ceilng.c; path = ../../p_ceilng.c; sourceTree = SOURCE_ROOT; }; - 1E44AF550B67CEC100BAD059 /* r_bsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_bsp.c; path = ../../r_bsp.c; sourceTree = SOURCE_ROOT; }; - 1E44AF560B67CEC100BAD059 /* r_bsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_bsp.h; path = ../../r_bsp.h; sourceTree = SOURCE_ROOT; }; - 1E44AF570B67CEC100BAD059 /* r_defs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_defs.h; path = ../../r_defs.h; sourceTree = SOURCE_ROOT; }; - 1E44AF580B67CEC100BAD059 /* r_data.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_data.c; path = ../../r_data.c; sourceTree = SOURCE_ROOT; }; - 1E44AF590B67CEC100BAD059 /* r_draw.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_draw.c; path = ../../r_draw.c; sourceTree = SOURCE_ROOT; }; - 1E44AF5A0B67CEC100BAD059 /* r_draw16.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_draw16.c; path = ../../r_draw16.c; sourceTree = SOURCE_ROOT; }; - 1E44AF5B0B67CEC100BAD059 /* r_draw8.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_draw8.c; path = ../../r_draw8.c; sourceTree = SOURCE_ROOT; }; - 1E44AF5C0B67CEC100BAD059 /* r_main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_main.c; path = ../../r_main.c; sourceTree = SOURCE_ROOT; }; - 1E44AF5D0B67CEC100BAD059 /* r_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_main.h; path = ../../r_main.h; sourceTree = SOURCE_ROOT; }; - 1E44AF5E0B67CEC100BAD059 /* r_data.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_data.h; path = ../../r_data.h; sourceTree = SOURCE_ROOT; }; - 1E44AF5F0B67CEC100BAD059 /* r_draw.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_draw.h; path = ../../r_draw.h; sourceTree = SOURCE_ROOT; }; - 1E44AF600B67CEC100BAD059 /* r_local.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_local.h; path = ../../r_local.h; sourceTree = SOURCE_ROOT; }; - 1E44AF610B67CEC100BAD059 /* r_plane.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_plane.c; path = ../../r_plane.c; sourceTree = SOURCE_ROOT; }; - 1E44AF620B67CEC100BAD059 /* r_plane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_plane.h; path = ../../r_plane.h; sourceTree = SOURCE_ROOT; }; - 1E44AF630B67CEC100BAD059 /* r_segs.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_segs.c; path = ../../r_segs.c; sourceTree = SOURCE_ROOT; }; - 1E44AF640B67CEC100BAD059 /* r_segs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_segs.h; path = ../../r_segs.h; sourceTree = SOURCE_ROOT; }; - 1E44AF650B67CEC200BAD059 /* r_sky.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_sky.c; path = ../../r_sky.c; sourceTree = SOURCE_ROOT; }; - 1E44AF660B67CEC200BAD059 /* r_sky.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_sky.h; path = ../../r_sky.h; sourceTree = SOURCE_ROOT; }; - 1E44AF670B67CEC200BAD059 /* r_splats.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_splats.c; path = ../../r_splats.c; sourceTree = SOURCE_ROOT; }; - 1E44AF680B67CEC200BAD059 /* r_splats.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_splats.h; path = ../../r_splats.h; sourceTree = SOURCE_ROOT; }; - 1E44AF690B67CEC200BAD059 /* r_state.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_state.h; path = ../../r_state.h; sourceTree = SOURCE_ROOT; }; - 1E44AF6A0B67CEC200BAD059 /* r_things.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_things.c; path = ../../r_things.c; sourceTree = SOURCE_ROOT; }; - 1E44AF6B0B67CEC200BAD059 /* r_things.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = r_things.h; path = ../../r_things.h; sourceTree = SOURCE_ROOT; }; - 1E44AF850B67CEE000BAD059 /* s_sound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = s_sound.c; path = ../../s_sound.c; sourceTree = SOURCE_ROOT; }; - 1E44AF860B67CEE000BAD059 /* s_sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = s_sound.h; path = ../../s_sound.h; sourceTree = SOURCE_ROOT; }; - 1E44AF890B67CEE900BAD059 /* screen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = screen.c; path = ../../screen.c; sourceTree = SOURCE_ROOT; }; - 1E44AF8A0B67CEE900BAD059 /* screen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = screen.h; path = ../../screen.h; sourceTree = SOURCE_ROOT; }; - 1E44AF8D0B67CEF000BAD059 /* sounds.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sounds.c; path = ../../sounds.c; sourceTree = SOURCE_ROOT; }; - 1E44AF8E0B67CEF000BAD059 /* sounds.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sounds.h; path = ../../sounds.h; sourceTree = SOURCE_ROOT; }; - 1E44AF910B67CEFF00BAD059 /* st_stuff.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = st_stuff.c; path = ../../st_stuff.c; sourceTree = SOURCE_ROOT; }; - 1E44AF920B67CEFF00BAD059 /* st_stuff.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = st_stuff.h; path = ../../st_stuff.h; sourceTree = SOURCE_ROOT; }; - 1E44AF950B67CF1300BAD059 /* string.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = string.c; path = ../../string.c; sourceTree = SOURCE_ROOT; }; - 1E44AF990B67CF2E00BAD059 /* tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = tables.c; path = ../../tables.c; sourceTree = SOURCE_ROOT; }; - 1E44AF9A0B67CF2E00BAD059 /* tables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tables.h; path = ../../tables.h; sourceTree = SOURCE_ROOT; }; - 1E44AF9D0B67CF3D00BAD059 /* tmap.nas */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = tmap.nas; path = ../../tmap.nas; sourceTree = SOURCE_ROOT; }; - 1E44AF9F0B67CF4900BAD059 /* tmap_mmx.nas */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = tmap_mmx.nas; path = ../../tmap_mmx.nas; sourceTree = SOURCE_ROOT; }; - 1E44AFA00B67CF4900BAD059 /* tmap_vc.nas */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = tmap_vc.nas; path = ../../tmap_vc.nas; sourceTree = SOURCE_ROOT; }; - 1E44AFA30B67CF5D00BAD059 /* v_video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = v_video.c; path = ../../v_video.c; sourceTree = SOURCE_ROOT; }; - 1E44AFA40B67CF5D00BAD059 /* v_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = v_video.h; path = ../../v_video.h; sourceTree = SOURCE_ROOT; }; - 1E44AFA70B67CF6400BAD059 /* w_wad.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = w_wad.c; path = ../../w_wad.c; sourceTree = SOURCE_ROOT; }; - 1E44AFA80B67CF6400BAD059 /* w_wad.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = w_wad.h; path = ../../w_wad.h; sourceTree = SOURCE_ROOT; }; - 1E44AFAB0B67CF6F00BAD059 /* y_inter.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = y_inter.c; path = ../../y_inter.c; sourceTree = SOURCE_ROOT; }; - 1E44AFAC0B67CF6F00BAD059 /* y_inter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = y_inter.h; path = ../../y_inter.h; sourceTree = SOURCE_ROOT; }; - 1E44AFAF0B67CF7A00BAD059 /* z_zone.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = z_zone.c; path = ../../z_zone.c; sourceTree = SOURCE_ROOT; }; - 1E44AFB00B67CF7A00BAD059 /* z_zone.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = z_zone.h; path = ../../z_zone.h; sourceTree = SOURCE_ROOT; }; - 1E44AFB40B67CFDC00BAD059 /* dosstr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dosstr.c; path = ../dosstr.c; sourceTree = SOURCE_ROOT; }; - 1E44AFB50B67CFDC00BAD059 /* endtxt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = endtxt.c; path = ../endtxt.c; sourceTree = SOURCE_ROOT; }; - 1E44AFB60B67CFDC00BAD059 /* endtxt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = endtxt.h; path = ../endtxt.h; sourceTree = SOURCE_ROOT; }; - 1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hwsym_sdl.c; path = ../hwsym_sdl.c; sourceTree = SOURCE_ROOT; }; - 1E44AFB80B67CFDC00BAD059 /* hwsym_sdl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hwsym_sdl.h; path = ../hwsym_sdl.h; sourceTree = SOURCE_ROOT; }; - 1E44AFB90B67CFDC00BAD059 /* i_cdmus.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_cdmus.c; path = ../i_cdmus.c; sourceTree = SOURCE_ROOT; }; - 1E44AFBA0B67CFDC00BAD059 /* i_main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_main.c; path = ../i_main.c; sourceTree = SOURCE_ROOT; }; - 1E44AFBB0B67CFDC00BAD059 /* i_net.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_net.c; path = ../i_net.c; sourceTree = SOURCE_ROOT; }; - 1E44AFBD0B67CFDC00BAD059 /* i_system.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_system.c; path = ../i_system.c; sourceTree = SOURCE_ROOT; }; - 1E44AFBE0B67CFDC00BAD059 /* i_video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = i_video.c; path = ../i_video.c; sourceTree = SOURCE_ROOT; }; - 1E44AFBF0B67CFDC00BAD059 /* IMG_xpm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = IMG_xpm.c; path = ../IMG_xpm.c; sourceTree = SOURCE_ROOT; }; - 1E44AFC00B67CFDC00BAD059 /* ogl_sdl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ogl_sdl.c; path = ../ogl_sdl.c; sourceTree = SOURCE_ROOT; }; - 1E44AFC10B67CFDC00BAD059 /* ogl_sdl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ogl_sdl.h; path = ../ogl_sdl.h; sourceTree = SOURCE_ROOT; }; - 1E44AFC20B67CFDC00BAD059 /* SDL_icon.xpm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = SDL_icon.xpm; path = ../SDL_icon.xpm; sourceTree = SOURCE_ROOT; }; - 1E44AFC30B67CFDC00BAD059 /* sdlmain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sdlmain.h; path = ../sdlmain.h; sourceTree = SOURCE_ROOT; }; - 1E44AFD50B67D03100BAD059 /* filters.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = filters.c; path = ../filter/filters.c; sourceTree = SOURCE_ROOT; }; - 1E44AFD60B67D03100BAD059 /* filters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filters.h; path = ../filter/filters.h; sourceTree = SOURCE_ROOT; }; - 1E44AFD70B67D03100BAD059 /* hq2x.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hq2x.c; path = ../filter/hq2x.c; sourceTree = SOURCE_ROOT; }; - 1E44AFD80B67D03100BAD059 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hq2x.h; path = ../filter/hq2x.h; sourceTree = SOURCE_ROOT; }; - 1E44AFD90B67D03100BAD059 /* interp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = interp.h; path = ../filter/interp.h; sourceTree = SOURCE_ROOT; }; - 1E44AFDA0B67D03100BAD059 /* lq2x.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lq2x.c; path = ../filter/lq2x.c; sourceTree = SOURCE_ROOT; }; - 1E44AFDB0B67D03100BAD059 /* lq2x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lq2x.h; path = ../filter/lq2x.h; sourceTree = SOURCE_ROOT; }; - 1E44AFDC0B67D03100BAD059 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../filter/main.c; sourceTree = SOURCE_ROOT; }; - 1E44AFE60B67D06200BAD059 /* mac_alert.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mac_alert.h; sourceTree = SOURCE_ROOT; }; - 1E44AFE70B67D06200BAD059 /* Srb2mac.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Srb2mac.icns; sourceTree = SOURCE_ROOT; }; - 1E44AFE80B67D06200BAD059 /* mac_alert.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mac_alert.c; sourceTree = SOURCE_ROOT; }; - 1E44AFEC0B67D0AB00BAD059 /* r_opengl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = r_opengl.c; path = ../../hardware/r_opengl/r_opengl.c; sourceTree = SOURCE_ROOT; }; - 1E44B0560B67D81E00BAD059 /* SDL_macosx_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_macosx_main.h; path = ../SDL_main/SDL_macosx_main.h; sourceTree = SOURCE_ROOT; }; - 1E44B0570B67D81E00BAD059 /* SDL_macosx_main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDL_macosx_main.m; path = ../SDL_main/SDL_macosx_main.m; sourceTree = SOURCE_ROOT; }; - 1E44B2240B67EADE00BAD059 /* lzf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lzf.c; path = ../../lzf.c; sourceTree = SOURCE_ROOT; }; - 1E44B2250B67EADE00BAD059 /* lzf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lzf.h; path = ../../lzf.h; sourceTree = SOURCE_ROOT; }; - 1E66921B0B690C5B00B7313A /* SDL_mixer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_mixer.framework; path = /Library/Frameworks/SDL_mixer.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 67259DFA18D2687D00F02971 /* lua_hud.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_hud.h; path = ../../lua_hud.h; sourceTree = SOURCE_ROOT; }; - 67259DFB18D2687D00F02971 /* lua_hudlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_hudlib.c; path = ../../lua_hudlib.c; sourceTree = SOURCE_ROOT; }; - 67259DFC18D2687D00F02971 /* lua_skinlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_skinlib.c; path = ../../lua_skinlib.c; sourceTree = SOURCE_ROOT; }; - 67259DFF18D268AE00F02971 /* m_anigif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m_anigif.c; path = ../../m_anigif.c; sourceTree = SOURCE_ROOT; }; - 67259E0018D268AE00F02971 /* m_anigif.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m_anigif.h; path = ../../m_anigif.h; sourceTree = SOURCE_ROOT; }; - 67259E0218D268F600F02971 /* i_ttf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = i_ttf.c; path = ../i_ttf.c; sourceTree = SOURCE_ROOT; }; - 67259E0318D268F600F02971 /* i_ttf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = i_ttf.h; path = ../i_ttf.h; sourceTree = SOURCE_ROOT; }; - 67259E0418D268F600F02971 /* mixer_sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mixer_sound.c; path = ../mixer_sound.c; sourceTree = SOURCE_ROOT; }; - 67259E0518D268F600F02971 /* sdl_sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdl_sound.c; path = ../sdl_sound.c; sourceTree = SOURCE_ROOT; }; - 67259E2B18D26D5700F02971 /* patch.dta */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = patch.dta; path = ../../../bin/Resources/patch.dta; sourceTree = SOURCE_ROOT; }; - 67259E2C18D26D5700F02971 /* rings.dta */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rings.dta; path = ../../../bin/Resources/rings.dta; sourceTree = SOURCE_ROOT; }; - 67259E2D18D26D5700F02971 /* srb2.srb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = srb2.srb; path = ../../../bin/Resources/srb2.srb; sourceTree = SOURCE_ROOT; }; - 6766C0AE11B057E50065F389 /* zones.dta */ = {isa = PBXFileReference; lastKnownFileType = text; name = zones.dta; path = ../../../bin/Resources/zones.dta; sourceTree = SOURCE_ROOT; }; - 676BB51C0E0DE06100C95963 /* m_queue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m_queue.c; path = ../../m_queue.c; sourceTree = SOURCE_ROOT; }; - 676BB51D0E0DE06100C95963 /* m_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m_queue.h; path = ../../m_queue.h; sourceTree = SOURCE_ROOT; }; - 676BB51E0E0DE06100C95963 /* p_polyobj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = p_polyobj.c; path = ../../p_polyobj.c; sourceTree = SOURCE_ROOT; }; - 676BB51F0E0DE06100C95963 /* p_polyobj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = p_polyobj.h; path = ../../p_polyobj.h; sourceTree = SOURCE_ROOT; }; - 67A1F91813FAD026009FA3E5 /* player.dta */ = {isa = PBXFileReference; lastKnownFileType = text; name = player.dta; path = ../../../bin/Resources/player.dta; sourceTree = SOURCE_ROOT; }; - 67B2071C1180FA8200E93654 /* vid_copy.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = vid_copy.s; path = ../../vid_copy.s; sourceTree = SOURCE_ROOT; }; - 67B83BCB14F57EAB00AAAE4E /* lapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lapi.c; path = ../../blua/lapi.c; sourceTree = SOURCE_ROOT; }; - 67B83BCC14F57EAB00AAAE4E /* lapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lapi.h; path = ../../blua/lapi.h; sourceTree = SOURCE_ROOT; }; - 67B83BCD14F57EAB00AAAE4E /* lauxlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lauxlib.c; path = ../../blua/lauxlib.c; sourceTree = SOURCE_ROOT; }; - 67B83BCE14F57EAB00AAAE4E /* lauxlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lauxlib.h; path = ../../blua/lauxlib.h; sourceTree = SOURCE_ROOT; }; - 67B83BCF14F57EAB00AAAE4E /* lbaselib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lbaselib.c; path = ../../blua/lbaselib.c; sourceTree = SOURCE_ROOT; }; - 67B83BD014F57EAB00AAAE4E /* lcode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lcode.c; path = ../../blua/lcode.c; sourceTree = SOURCE_ROOT; }; - 67B83BD114F57EAB00AAAE4E /* lcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lcode.h; path = ../../blua/lcode.h; sourceTree = SOURCE_ROOT; }; - 67B83BD214F57EAB00AAAE4E /* ldebug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldebug.c; path = ../../blua/ldebug.c; sourceTree = SOURCE_ROOT; }; - 67B83BD314F57EAB00AAAE4E /* ldebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ldebug.h; path = ../../blua/ldebug.h; sourceTree = SOURCE_ROOT; }; - 67B83BD414F57EAB00AAAE4E /* ldo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldo.c; path = ../../blua/ldo.c; sourceTree = SOURCE_ROOT; }; - 67B83BD514F57EAB00AAAE4E /* ldo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ldo.h; path = ../../blua/ldo.h; sourceTree = SOURCE_ROOT; }; - 67B83BD614F57EAB00AAAE4E /* ldump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldump.c; path = ../../blua/ldump.c; sourceTree = SOURCE_ROOT; }; - 67B83BD714F57EAB00AAAE4E /* lfunc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lfunc.c; path = ../../blua/lfunc.c; sourceTree = SOURCE_ROOT; }; - 67B83BD814F57EAB00AAAE4E /* lfunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lfunc.h; path = ../../blua/lfunc.h; sourceTree = SOURCE_ROOT; }; - 67B83BD914F57EAB00AAAE4E /* lgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lgc.c; path = ../../blua/lgc.c; sourceTree = SOURCE_ROOT; }; - 67B83BDA14F57EAB00AAAE4E /* lgc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lgc.h; path = ../../blua/lgc.h; sourceTree = SOURCE_ROOT; }; - 67B83BDB14F57EAB00AAAE4E /* linit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = linit.c; path = ../../blua/linit.c; sourceTree = SOURCE_ROOT; }; - 67B83BDC14F57EAB00AAAE4E /* llex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = llex.c; path = ../../blua/llex.c; sourceTree = SOURCE_ROOT; }; - 67B83BDD14F57EAB00AAAE4E /* llex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = llex.h; path = ../../blua/llex.h; sourceTree = SOURCE_ROOT; }; - 67B83BDE14F57EAB00AAAE4E /* llimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = llimits.h; path = ../../blua/llimits.h; sourceTree = SOURCE_ROOT; }; - 67B83BDF14F57EAB00AAAE4E /* lmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lmem.c; path = ../../blua/lmem.c; sourceTree = SOURCE_ROOT; }; - 67B83BE014F57EAB00AAAE4E /* lmem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lmem.h; path = ../../blua/lmem.h; sourceTree = SOURCE_ROOT; }; - 67B83BE114F57EAB00AAAE4E /* lobject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lobject.c; path = ../../blua/lobject.c; sourceTree = SOURCE_ROOT; }; - 67B83BE214F57EAB00AAAE4E /* lobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lobject.h; path = ../../blua/lobject.h; sourceTree = SOURCE_ROOT; }; - 67B83BE314F57EAB00AAAE4E /* lopcodes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lopcodes.c; path = ../../blua/lopcodes.c; sourceTree = SOURCE_ROOT; }; - 67B83BE414F57EAB00AAAE4E /* lopcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lopcodes.h; path = ../../blua/lopcodes.h; sourceTree = SOURCE_ROOT; }; - 67B83BE514F57EAB00AAAE4E /* lparser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lparser.c; path = ../../blua/lparser.c; sourceTree = SOURCE_ROOT; }; - 67B83BE614F57EAB00AAAE4E /* lparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lparser.h; path = ../../blua/lparser.h; sourceTree = SOURCE_ROOT; }; - 67B83BE714F57EAB00AAAE4E /* lstate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstate.c; path = ../../blua/lstate.c; sourceTree = SOURCE_ROOT; }; - 67B83BE814F57EAB00AAAE4E /* lstate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstate.h; path = ../../blua/lstate.h; sourceTree = SOURCE_ROOT; }; - 67B83BE914F57EAB00AAAE4E /* lstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstring.c; path = ../../blua/lstring.c; sourceTree = SOURCE_ROOT; }; - 67B83BEA14F57EAB00AAAE4E /* lstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstring.h; path = ../../blua/lstring.h; sourceTree = SOURCE_ROOT; }; - 67B83BEB14F57EAB00AAAE4E /* lstrlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstrlib.c; path = ../../blua/lstrlib.c; sourceTree = SOURCE_ROOT; }; - 67B83BEC14F57EAB00AAAE4E /* ltable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltable.c; path = ../../blua/ltable.c; sourceTree = SOURCE_ROOT; }; - 67B83BED14F57EAB00AAAE4E /* ltable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ltable.h; path = ../../blua/ltable.h; sourceTree = SOURCE_ROOT; }; - 67B83BEE14F57EAB00AAAE4E /* ltablib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltablib.c; path = ../../blua/ltablib.c; sourceTree = SOURCE_ROOT; }; - 67B83BEF14F57EAB00AAAE4E /* ltm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltm.c; path = ../../blua/ltm.c; sourceTree = SOURCE_ROOT; }; - 67B83BF014F57EAB00AAAE4E /* ltm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ltm.h; path = ../../blua/ltm.h; sourceTree = SOURCE_ROOT; }; - 67B83BF114F57EAB00AAAE4E /* lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua.h; path = ../../blua/lua.h; sourceTree = SOURCE_ROOT; }; - 67B83BF214F57EAB00AAAE4E /* luaconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = luaconf.h; path = ../../blua/luaconf.h; sourceTree = SOURCE_ROOT; }; - 67B83BF314F57EAB00AAAE4E /* lualib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lualib.h; path = ../../blua/lualib.h; sourceTree = SOURCE_ROOT; }; - 67B83BF414F57EAB00AAAE4E /* lundump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lundump.c; path = ../../blua/lundump.c; sourceTree = SOURCE_ROOT; }; - 67B83BF514F57EAB00AAAE4E /* lundump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lundump.h; path = ../../blua/lundump.h; sourceTree = SOURCE_ROOT; }; - 67B83BF614F57EAB00AAAE4E /* lvm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lvm.c; path = ../../blua/lvm.c; sourceTree = SOURCE_ROOT; }; - 67B83BF714F57EAB00AAAE4E /* lvm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lvm.h; path = ../../blua/lvm.h; sourceTree = SOURCE_ROOT; }; - 67B83BF814F57EAB00AAAE4E /* lzio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lzio.c; path = ../../blua/lzio.c; sourceTree = SOURCE_ROOT; }; - 67B83BF914F57EAB00AAAE4E /* lzio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lzio.h; path = ../../blua/lzio.h; sourceTree = SOURCE_ROOT; }; - 67B83C1214F57ECA00AAAE4E /* b_bot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = b_bot.c; path = ../../b_bot.c; sourceTree = SOURCE_ROOT; }; - 67B83C1314F57ECA00AAAE4E /* b_bot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = b_bot.h; path = ../../b_bot.h; sourceTree = SOURCE_ROOT; }; - 67B83C1514F57EE600AAAE4E /* lua_baselib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_baselib.c; path = ../../lua_baselib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1614F57EE600AAAE4E /* lua_consolelib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_consolelib.c; path = ../../lua_consolelib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1714F57EE600AAAE4E /* lua_hook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_hook.h; path = ../../lua_hook.h; sourceTree = SOURCE_ROOT; }; - 67B83C1814F57EE600AAAE4E /* lua_hooklib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_hooklib.c; path = ../../lua_hooklib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1914F57EE600AAAE4E /* lua_infolib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_infolib.c; path = ../../lua_infolib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1A14F57EE600AAAE4E /* lua_libs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_libs.h; path = ../../lua_libs.h; sourceTree = SOURCE_ROOT; }; - 67B83C1B14F57EE600AAAE4E /* lua_maplib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_maplib.c; path = ../../lua_maplib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1C14F57EE600AAAE4E /* lua_mathlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_mathlib.c; path = ../../lua_mathlib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1D14F57EE600AAAE4E /* lua_mobjlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_mobjlib.c; path = ../../lua_mobjlib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1E14F57EE600AAAE4E /* lua_playerlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_playerlib.c; path = ../../lua_playerlib.c; sourceTree = SOURCE_ROOT; }; - 67B83C1F14F57EE600AAAE4E /* lua_script.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_script.c; path = ../../lua_script.c; sourceTree = SOURCE_ROOT; }; - 67B83C2014F57EE600AAAE4E /* lua_script.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua_script.h; path = ../../lua_script.h; sourceTree = SOURCE_ROOT; }; - 67B83C2114F57EE600AAAE4E /* lua_thinkerlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua_thinkerlib.c; path = ../../lua_thinkerlib.c; sourceTree = SOURCE_ROOT; }; - 67B83C2C14F57F1500AAAE4E /* fastcmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fastcmp.h; path = ../../fastcmp.h; sourceTree = SOURCE_ROOT; }; - 67B83C2D14F57F1500AAAE4E /* i_addrinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = i_addrinfo.c; path = ../../i_addrinfo.c; sourceTree = SOURCE_ROOT; }; - 67B83C2E14F57F1500AAAE4E /* i_addrinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = i_addrinfo.h; path = ../../i_addrinfo.h; sourceTree = SOURCE_ROOT; }; - 67B83C2F14F57F1500AAAE4E /* m_cond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m_cond.c; path = ../../m_cond.c; sourceTree = SOURCE_ROOT; }; - 67B83C3014F57F1500AAAE4E /* m_cond.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m_cond.h; path = ../../m_cond.h; sourceTree = SOURCE_ROOT; }; - 67B83C3114F57F1500AAAE4E /* m_dllist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m_dllist.h; path = ../../m_dllist.h; sourceTree = SOURCE_ROOT; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* Srb2mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Srb2mac.app; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 1E66921C0B690C5B00B7313A /* SDL_mixer.framework in Frameworks */, - 1E32C4290B6E6D5D0029E058 /* libpng.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 1E44AE890B67CC4E00BAD059 /* A_Asm */, - 67B83BCA14F57DD400AAAE4E /* B_Bot */, - 67B83BC914F57D7F00AAAE4E /* BLUA */, - 1E44AE8C0B67CC6500BAD059 /* D_Doom */, - 1E44AEBB0B67CC9800BAD059 /* F_Frame */, - 1E44AEC20B67CCB500BAD059 /* G_Game */, - 1E44AECD0B67CCD200BAD059 /* H_Hud */, - 1E44AE5C0B67CC0F00BAD059 /* Hw_Hardware */, - 1E44AED20B67CCF600BAD059 /* I_Interface */, - 67B83BC814F57D6E00AAAE4E /* LUA */, - 1E44AEF70B67CDA900BAD059 /* M_Misc */, - 1E44AF160B67CDFB00BAD059 /* P_Play */, - 1E44AF540B67CE8C00BAD059 /* R_Render */, - 1E44AF830B67CEC900BAD059 /* S_Sound */, - 1E44AF170B67CE1000BAD059 /* W_Wad */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 1E32C4140B6E6D5D0029E058 /* libpng.framework */, - 1E66921B0B690C5B00B7313A /* SDL_mixer.framework */, - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* Srb2mac.app */, - ); - name = Products; - sourceTree = ""; - }; - 1E44AE5C0B67CC0F00BAD059 /* Hw_Hardware */ = { - isa = PBXGroup; - children = ( - 1E44AE600B67CC2B00BAD059 /* hw3dsdrv.h */, - 1E44AE610B67CC2B00BAD059 /* hw_bsp.c */, - 1E44AE620B67CC2B00BAD059 /* hw_defs.h */, - 1E44AE630B67CC2B00BAD059 /* hw3sound.c */, - 1E44AE640B67CC2B00BAD059 /* hw_cache.c */, - 1E44AE650B67CC2B00BAD059 /* hw_dll.h */, - 1E44AE660B67CC2B00BAD059 /* hw_drv.h */, - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */, - 1E44AE680B67CC2B00BAD059 /* hw_light.c */, - 1E44AE690B67CC2B00BAD059 /* hw_light.h */, - 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */, - 1E44AE6B0B67CC2B00BAD059 /* hw_data.h */, - 1E44AE6C0B67CC2B00BAD059 /* hw_draw.c */, - 1E44AE6D0B67CC2B00BAD059 /* hw_glob.h */, - 1E44AE6E0B67CC2B00BAD059 /* hw_main.c */, - 1E44AE6F0B67CC2B00BAD059 /* hw_main.h */, - 1E44AE700B67CC2B00BAD059 /* hw_md2.c */, - 1E44AE710B67CC2B00BAD059 /* hw_md2.h */, - 1E44AE720B67CC2B00BAD059 /* hw_trick.c */, - 1E44AE730B67CC2B00BAD059 /* hws_data.h */, - ); - name = Hw_Hardware; - sourceTree = ""; - }; - 1E44AE890B67CC4E00BAD059 /* A_Asm */ = { - isa = PBXGroup; - children = ( - 67B2071C1180FA8200E93654 /* vid_copy.s */, - 1E44AE8A0B67CC6000BAD059 /* asm_defs.inc */, - 1E44AF9D0B67CF3D00BAD059 /* tmap.nas */, - 1E44AF9F0B67CF4900BAD059 /* tmap_mmx.nas */, - 1E44AFA00B67CF4900BAD059 /* tmap_vc.nas */, - ); - name = A_Asm; - sourceTree = ""; - }; - 1E44AE8C0B67CC6500BAD059 /* D_Doom */ = { - isa = PBXGroup; - children = ( - 1E44AEEB0B67CD4400BAD059 /* comptime.c */, - 1E44AE8D0B67CC8400BAD059 /* d_clisrv.c */, - 1E44AE8E0B67CC8400BAD059 /* d_clisrv.h */, - 1E44AE8F0B67CC8400BAD059 /* d_event.h */, - 1E44AE900B67CC8400BAD059 /* d_main.c */, - 1E44AE910B67CC8500BAD059 /* d_net.c */, - 1E44AE920B67CC8500BAD059 /* d_net.h */, - 1E44AE930B67CC8500BAD059 /* d_netcmd.h */, - 1E44AE940B67CC8500BAD059 /* d_netfil.c */, - 1E44AE950B67CC8500BAD059 /* d_player.h */, - 1E44AE960B67CC8500BAD059 /* d_think.h */, - 1E44AE980B67CC8500BAD059 /* d_netcmd.c */, - 1E44AE990B67CC8500BAD059 /* d_ticcmd.h */, - 1E44AE9A0B67CC8500BAD059 /* d_main.h */, - 1E44AE9B0B67CC8500BAD059 /* d_netfil.h */, - 1E44AE9C0B67CC8500BAD059 /* dehacked.c */, - 1E44AE9D0B67CC8500BAD059 /* dehacked.h */, - 1E44AE9E0B67CC8500BAD059 /* doomdata.h */, - 1E44AE9F0B67CC8500BAD059 /* doomdef.h */, - 1E44AEA00B67CC8500BAD059 /* doomstat.h */, - 1E44AEA10B67CC8500BAD059 /* doomtype.h */, - 1E44AFAF0B67CF7A00BAD059 /* z_zone.c */, - 1E44AFB00B67CF7A00BAD059 /* z_zone.h */, - ); - name = D_Doom; - sourceTree = ""; - }; - 1E44AEBB0B67CC9800BAD059 /* F_Frame */ = { - isa = PBXGroup; - children = ( - 1E44AEBC0B67CCA900BAD059 /* f_wipe.c */, - 1E44AEBD0B67CCA900BAD059 /* f_finale.c */, - 1E44AEBE0B67CCA900BAD059 /* f_finale.h */, - 1E44AFAB0B67CF6F00BAD059 /* y_inter.c */, - 1E44AFAC0B67CF6F00BAD059 /* y_inter.h */, - ); - name = F_Frame; - sourceTree = ""; - }; - 1E44AEC20B67CCB500BAD059 /* G_Game */ = { - isa = PBXGroup; - children = ( - 1E44AEC30B67CCC600BAD059 /* g_game.c */, - 1E44AEC40B67CCC600BAD059 /* g_game.h */, - 1E44AEC50B67CCC600BAD059 /* g_input.h */, - 1E44AEC60B67CCC600BAD059 /* g_state.h */, - 1E44AEC70B67CCC600BAD059 /* g_input.c */, - ); - name = G_Game; - sourceTree = ""; - }; - 1E44AECD0B67CCD200BAD059 /* H_Hud */ = { - isa = PBXGroup; - children = ( - 1E44AEE10B67CD2B00BAD059 /* am_map.c */, - 1E44AEE20B67CD2B00BAD059 /* am_map.h */, - 1E44AEE70B67CD3F00BAD059 /* command.c */, - 1E44AEE80B67CD3F00BAD059 /* command.h */, - 1E44AEED0B67CD5400BAD059 /* console.c */, - 1E44AEEE0B67CD5400BAD059 /* console.h */, - 1E44AECE0B67CCEE00BAD059 /* hu_stuff.c */, - 1E44AECF0B67CCEE00BAD059 /* hu_stuff.h */, - 1E44AF000B67CDE900BAD059 /* m_menu.c */, - 1E44AF010B67CDE900BAD059 /* m_menu.h */, - 1E44AF910B67CEFF00BAD059 /* st_stuff.c */, - 1E44AF920B67CEFF00BAD059 /* st_stuff.h */, - ); - name = H_Hud; - sourceTree = ""; - }; - 1E44AED20B67CCF600BAD059 /* I_Interface */ = { - isa = PBXGroup; - children = ( - 67259E0218D268F600F02971 /* i_ttf.c */, - 67259E0318D268F600F02971 /* i_ttf.h */, - 67259E0418D268F600F02971 /* mixer_sound.c */, - 67259E0518D268F600F02971 /* sdl_sound.c */, - 1E44AFB30B67CF8500BAD059 /* SDL */, - 67B83C2D14F57F1500AAAE4E /* i_addrinfo.c */, - 67B83C2E14F57F1500AAAE4E /* i_addrinfo.h */, - 1E44AEE50B67CD3200BAD059 /* byteptr.h */, - 1E44AEF10B67CD7F00BAD059 /* filesrch.c */, - 1E44AEF20B67CD7F00BAD059 /* filesrch.h */, - 1E44AED30B67CD1200BAD059 /* i_net.h */, - 1E44AED40B67CD1200BAD059 /* i_sound.h */, - 1E44AED50B67CD1200BAD059 /* i_tcp.c */, - 1E44AED60B67CD1200BAD059 /* i_tcp.h */, - 1E44AED70B67CD1200BAD059 /* i_system.h */, - 1E44AED80B67CD1200BAD059 /* i_video.h */, - 1E44AED90B67CD1300BAD059 /* i_joy.h */, - 1E44AEF50B67CD9F00BAD059 /* keys.h */, - 1E44AF200B67CE4100BAD059 /* mserv.c */, - 1E44AF210B67CE4100BAD059 /* mserv.h */, - ); - name = I_Interface; - sourceTree = ""; - }; - 1E44AEF70B67CDA900BAD059 /* M_Misc */ = { - isa = PBXGroup; - children = ( - 67259DFF18D268AE00F02971 /* m_anigif.c */, - 67259E0018D268AE00F02971 /* m_anigif.h */, - 1E44AEF80B67CDE900BAD059 /* m_argv.c */, - 1E44AEFA0B67CDE900BAD059 /* m_argv.h */, - 1E44AEFC0B67CDE900BAD059 /* m_bbox.c */, - 1E44AEF90B67CDE900BAD059 /* m_bbox.h */, - 1E44AEFB0B67CDE900BAD059 /* m_cheat.c */, - 1E44AEFD0B67CDE900BAD059 /* m_cheat.h */, - 67B83C2F14F57F1500AAAE4E /* m_cond.c */, - 67B83C3014F57F1500AAAE4E /* m_cond.h */, - 67B83C3114F57F1500AAAE4E /* m_dllist.h */, - 1E44AEFE0B67CDE900BAD059 /* m_fixed.c */, - 1E44AEFF0B67CDE900BAD059 /* m_fixed.h */, - 1E44AF020B67CDE900BAD059 /* m_misc.c */, - 1E44AF030B67CDE900BAD059 /* m_misc.h */, - 676BB51C0E0DE06100C95963 /* m_queue.c */, - 676BB51D0E0DE06100C95963 /* m_queue.h */, - 1E44AF040B67CDE900BAD059 /* m_random.c */, - 1E44AF050B67CDE900BAD059 /* m_random.h */, - 1E44AF060B67CDE900BAD059 /* m_swap.h */, - 1E44AF950B67CF1300BAD059 /* string.c */, - ); - name = M_Misc; - sourceTree = ""; - }; - 1E44AF160B67CDFB00BAD059 /* P_Play */ = { - isa = PBXGroup; - children = ( - 1E44AF180B67CE2A00BAD059 /* info.c */, - 1E44AF190B67CE2A00BAD059 /* info.h */, - 1E44AF3B0B67CE5F00BAD059 /* p_ceilng.c */, - 1E44AF240B67CE5F00BAD059 /* p_enemy.c */, - 1E44AF250B67CE5F00BAD059 /* p_inter.c */, - 1E44AF260B67CE5F00BAD059 /* p_fab.c */, - 1E44AF270B67CE5F00BAD059 /* p_lights.c */, - 1E44AF280B67CE5F00BAD059 /* p_map.c */, - 1E44AF290B67CE5F00BAD059 /* p_maputl.c */, - 1E44AF2A0B67CE5F00BAD059 /* p_maputl.h */, - 1E44AF2B0B67CE5F00BAD059 /* p_mobj.c */, - 1E44AF2C0B67CE5F00BAD059 /* p_mobj.h */, - 1E44AF2D0B67CE5F00BAD059 /* p_floor.c */, - 1E44AF2E0B67CE5F00BAD059 /* p_local.h */, - 676BB51E0E0DE06100C95963 /* p_polyobj.c */, - 676BB51F0E0DE06100C95963 /* p_polyobj.h */, - 1E44AF2F0B67CE5F00BAD059 /* p_pspr.h */, - 1E44AF300B67CE5F00BAD059 /* p_saveg.c */, - 1E44AF310B67CE5F00BAD059 /* p_saveg.h */, - 1E44AF320B67CE5F00BAD059 /* p_setup.c */, - 1E44AF330B67CE5F00BAD059 /* p_setup.h */, - 1E44AF340B67CE5F00BAD059 /* p_sight.c */, - 1E44AF350B67CE5F00BAD059 /* p_spec.c */, - 1E44AF360B67CE5F00BAD059 /* p_spec.h */, - 1E44AF370B67CE5F00BAD059 /* p_telept.c */, - 1E44AF380B67CE5F00BAD059 /* p_tick.c */, - 1E44AF390B67CE5F00BAD059 /* p_tick.h */, - 1E44AF3A0B67CE5F00BAD059 /* p_user.c */, - 1E44AF990B67CF2E00BAD059 /* tables.c */, - 1E44AF9A0B67CF2E00BAD059 /* tables.h */, - ); - name = P_Play; - sourceTree = ""; - }; - 1E44AF170B67CE1000BAD059 /* W_Wad */ = { - isa = PBXGroup; - children = ( - 1E44B2240B67EADE00BAD059 /* lzf.c */, - 1E44B2250B67EADE00BAD059 /* lzf.h */, - 1E44AF1C0B67CE3600BAD059 /* md5.c */, - 1E44AF1D0B67CE3600BAD059 /* md5.h */, - 1E44AFA70B67CF6400BAD059 /* w_wad.c */, - 1E44AFA80B67CF6400BAD059 /* w_wad.h */, - ); - name = W_Wad; - sourceTree = ""; - }; - 1E44AF540B67CE8C00BAD059 /* R_Render */ = { - isa = PBXGroup; - children = ( - 1E44AF550B67CEC100BAD059 /* r_bsp.c */, - 1E44AF560B67CEC100BAD059 /* r_bsp.h */, - 1E44AF570B67CEC100BAD059 /* r_defs.h */, - 1E44AF580B67CEC100BAD059 /* r_data.c */, - 1E44AF590B67CEC100BAD059 /* r_draw.c */, - 1E44AF5A0B67CEC100BAD059 /* r_draw16.c */, - 1E44AF5B0B67CEC100BAD059 /* r_draw8.c */, - 1E44AF5C0B67CEC100BAD059 /* r_main.c */, - 1E44AF5D0B67CEC100BAD059 /* r_main.h */, - 1E44AF5E0B67CEC100BAD059 /* r_data.h */, - 1E44AF5F0B67CEC100BAD059 /* r_draw.h */, - 1E44AF600B67CEC100BAD059 /* r_local.h */, - 1E44AF610B67CEC100BAD059 /* r_plane.c */, - 1E44AF620B67CEC100BAD059 /* r_plane.h */, - 1E44AF630B67CEC100BAD059 /* r_segs.c */, - 1E44AF640B67CEC100BAD059 /* r_segs.h */, - 1E44AF650B67CEC200BAD059 /* r_sky.c */, - 1E44AF660B67CEC200BAD059 /* r_sky.h */, - 1E44AF670B67CEC200BAD059 /* r_splats.c */, - 1E44AF680B67CEC200BAD059 /* r_splats.h */, - 1E44AF690B67CEC200BAD059 /* r_state.h */, - 1E44AF6A0B67CEC200BAD059 /* r_things.c */, - 1E44AF6B0B67CEC200BAD059 /* r_things.h */, - 1E44AF890B67CEE900BAD059 /* screen.c */, - 1E44AF8A0B67CEE900BAD059 /* screen.h */, - 1E44AFA30B67CF5D00BAD059 /* v_video.c */, - 1E44AFA40B67CF5D00BAD059 /* v_video.h */, - ); - name = R_Render; - sourceTree = ""; - }; - 1E44AF830B67CEC900BAD059 /* S_Sound */ = { - isa = PBXGroup; - children = ( - 1E44AF850B67CEE000BAD059 /* s_sound.c */, - 1E44AF860B67CEE000BAD059 /* s_sound.h */, - 1E44AF8D0B67CEF000BAD059 /* sounds.c */, - 1E44AF8E0B67CEF000BAD059 /* sounds.h */, - ); - name = S_Sound; - sourceTree = ""; - }; - 1E44AFB30B67CF8500BAD059 /* SDL */ = { - isa = PBXGroup; - children = ( - 1E44AFE50B67D04900BAD059 /* macosx */, - 1E44AFD40B67D03100BAD059 /* filter */, - 1E44AFB40B67CFDC00BAD059 /* dosstr.c */, - 1E44AFB50B67CFDC00BAD059 /* endtxt.c */, - 1E44AFB60B67CFDC00BAD059 /* endtxt.h */, - 1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */, - 1E44AFB80B67CFDC00BAD059 /* hwsym_sdl.h */, - 1E44AFB90B67CFDC00BAD059 /* i_cdmus.c */, - 1E44AFBA0B67CFDC00BAD059 /* i_main.c */, - 1E44AFBB0B67CFDC00BAD059 /* i_net.c */, - 1E44AFBD0B67CFDC00BAD059 /* i_system.c */, - 1E44AFBE0B67CFDC00BAD059 /* i_video.c */, - 1E44AFBF0B67CFDC00BAD059 /* IMG_xpm.c */, - 1E44AFEC0B67D0AB00BAD059 /* r_opengl.c */, - 1E44AFC00B67CFDC00BAD059 /* ogl_sdl.c */, - 1E44AFC10B67CFDC00BAD059 /* ogl_sdl.h */, - 1E44AFC20B67CFDC00BAD059 /* SDL_icon.xpm */, - 1E44AFC30B67CFDC00BAD059 /* sdlmain.h */, - ); - name = SDL; - sourceTree = ""; - }; - 1E44AFD40B67D03100BAD059 /* filter */ = { - isa = PBXGroup; - children = ( - 1E44AFD50B67D03100BAD059 /* filters.c */, - 1E44AFD60B67D03100BAD059 /* filters.h */, - 1E44AFD70B67D03100BAD059 /* hq2x.c */, - 1E44AFD80B67D03100BAD059 /* hq2x.h */, - 1E44AFD90B67D03100BAD059 /* interp.h */, - 1E44AFDA0B67D03100BAD059 /* lq2x.c */, - 1E44AFDB0B67D03100BAD059 /* lq2x.h */, - 1E44AFDC0B67D03100BAD059 /* main.c */, - ); - name = filter; - path = ../filter; - sourceTree = SOURCE_ROOT; - }; - 1E44AFE50B67D04900BAD059 /* macosx */ = { - isa = PBXGroup; - children = ( - 1E44AFE60B67D06200BAD059 /* mac_alert.h */, - 1E44AFE70B67D06200BAD059 /* Srb2mac.icns */, - 1E44AFE80B67D06200BAD059 /* mac_alert.c */, - 1E44B0560B67D81E00BAD059 /* SDL_macosx_main.h */, - 1E44B0570B67D81E00BAD059 /* SDL_macosx_main.m */, - ); - name = macosx; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* Srb2mac */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = Srb2mac; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 67259E2B18D26D5700F02971 /* patch.dta */, - 67259E2C18D26D5700F02971 /* rings.dta */, - 67259E2D18D26D5700F02971 /* srb2.srb */, - 67A1F91813FAD026009FA3E5 /* player.dta */, - 6766C0AE11B057E50065F389 /* zones.dta */, - 1E44AE440B67CBE800BAD059 /* music.dta */, - 1E44AE4B0B67CBE800BAD059 /* srb2.wad */, - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 67B83BC814F57D6E00AAAE4E /* LUA */ = { - isa = PBXGroup; - children = ( - 67259DFA18D2687D00F02971 /* lua_hud.h */, - 67259DFB18D2687D00F02971 /* lua_hudlib.c */, - 67259DFC18D2687D00F02971 /* lua_skinlib.c */, - 67B83C2C14F57F1500AAAE4E /* fastcmp.h */, - 67B83C1514F57EE600AAAE4E /* lua_baselib.c */, - 67B83C1614F57EE600AAAE4E /* lua_consolelib.c */, - 67B83C1714F57EE600AAAE4E /* lua_hook.h */, - 67B83C1814F57EE600AAAE4E /* lua_hooklib.c */, - 67B83C1914F57EE600AAAE4E /* lua_infolib.c */, - 67B83C1A14F57EE600AAAE4E /* lua_libs.h */, - 67B83C1B14F57EE600AAAE4E /* lua_maplib.c */, - 67B83C1C14F57EE600AAAE4E /* lua_mathlib.c */, - 67B83C1D14F57EE600AAAE4E /* lua_mobjlib.c */, - 67B83C1E14F57EE600AAAE4E /* lua_playerlib.c */, - 67B83C1F14F57EE600AAAE4E /* lua_script.c */, - 67B83C2014F57EE600AAAE4E /* lua_script.h */, - 67B83C2114F57EE600AAAE4E /* lua_thinkerlib.c */, - ); - name = LUA; - sourceTree = ""; - }; - 67B83BC914F57D7F00AAAE4E /* BLUA */ = { - isa = PBXGroup; - children = ( - 67B83BCB14F57EAB00AAAE4E /* lapi.c */, - 67B83BCC14F57EAB00AAAE4E /* lapi.h */, - 67B83BCD14F57EAB00AAAE4E /* lauxlib.c */, - 67B83BCE14F57EAB00AAAE4E /* lauxlib.h */, - 67B83BCF14F57EAB00AAAE4E /* lbaselib.c */, - 67B83BD014F57EAB00AAAE4E /* lcode.c */, - 67B83BD114F57EAB00AAAE4E /* lcode.h */, - 67B83BD214F57EAB00AAAE4E /* ldebug.c */, - 67B83BD314F57EAB00AAAE4E /* ldebug.h */, - 67B83BD414F57EAB00AAAE4E /* ldo.c */, - 67B83BD514F57EAB00AAAE4E /* ldo.h */, - 67B83BD614F57EAB00AAAE4E /* ldump.c */, - 67B83BD714F57EAB00AAAE4E /* lfunc.c */, - 67B83BD814F57EAB00AAAE4E /* lfunc.h */, - 67B83BD914F57EAB00AAAE4E /* lgc.c */, - 67B83BDA14F57EAB00AAAE4E /* lgc.h */, - 67B83BDB14F57EAB00AAAE4E /* linit.c */, - 67B83BDC14F57EAB00AAAE4E /* llex.c */, - 67B83BDD14F57EAB00AAAE4E /* llex.h */, - 67B83BDE14F57EAB00AAAE4E /* llimits.h */, - 67B83BDF14F57EAB00AAAE4E /* lmem.c */, - 67B83BE014F57EAB00AAAE4E /* lmem.h */, - 67B83BE114F57EAB00AAAE4E /* lobject.c */, - 67B83BE214F57EAB00AAAE4E /* lobject.h */, - 67B83BE314F57EAB00AAAE4E /* lopcodes.c */, - 67B83BE414F57EAB00AAAE4E /* lopcodes.h */, - 67B83BE514F57EAB00AAAE4E /* lparser.c */, - 67B83BE614F57EAB00AAAE4E /* lparser.h */, - 67B83BE714F57EAB00AAAE4E /* lstate.c */, - 67B83BE814F57EAB00AAAE4E /* lstate.h */, - 67B83BE914F57EAB00AAAE4E /* lstring.c */, - 67B83BEA14F57EAB00AAAE4E /* lstring.h */, - 67B83BEB14F57EAB00AAAE4E /* lstrlib.c */, - 67B83BEC14F57EAB00AAAE4E /* ltable.c */, - 67B83BED14F57EAB00AAAE4E /* ltable.h */, - 67B83BEE14F57EAB00AAAE4E /* ltablib.c */, - 67B83BEF14F57EAB00AAAE4E /* ltm.c */, - 67B83BF014F57EAB00AAAE4E /* ltm.h */, - 67B83BF114F57EAB00AAAE4E /* lua.h */, - 67B83BF214F57EAB00AAAE4E /* luaconf.h */, - 67B83BF314F57EAB00AAAE4E /* lualib.h */, - 67B83BF414F57EAB00AAAE4E /* lundump.c */, - 67B83BF514F57EAB00AAAE4E /* lundump.h */, - 67B83BF614F57EAB00AAAE4E /* lvm.c */, - 67B83BF714F57EAB00AAAE4E /* lvm.h */, - 67B83BF814F57EAB00AAAE4E /* lzio.c */, - 67B83BF914F57EAB00AAAE4E /* lzio.h */, - ); - name = BLUA; - sourceTree = ""; - }; - 67B83BCA14F57DD400AAAE4E /* B_Bot */ = { - isa = PBXGroup; - children = ( - 67B83C1214F57ECA00AAAE4E /* b_bot.c */, - 67B83C1314F57ECA00AAAE4E /* b_bot.h */, - ); - name = B_Bot; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* Srb2mac */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Srb2mac" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 677E4CB30E1765500034519D /* Get SCM Info */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - 679B708A102B872300AA9E4C /* Make DMG */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Srb2mac; - productInstallPath = "$(HOME)/Applications"; - productName = Srb2mac; - productReference = 8D1107320486CEB800E47090 /* Srb2mac.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Srb2mac" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* Srb2mac */; - projectDirPath = ""; - projectRoot = ../../..; - targets = ( - 8D1107260486CEB800E47090 /* Srb2mac */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 1E44AFEA0B67D06200BAD059 /* Srb2mac.icns in Resources */, - 67259E2E18D26D5700F02971 /* patch.dta in Resources */, - 67259E2F18D26D5700F02971 /* rings.dta in Resources */, - 67259E3018D26D5700F02971 /* srb2.srb in Resources */, - 67259E3218D26DD200F02971 /* music.dta in Resources */, - 67259E3318D26DD300F02971 /* player.dta in Resources */, - 67259E3518D26DD500F02971 /* zones.dta in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 677E4CB30E1765500034519D /* Get SCM Info */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - comments = "update the time and date stamps in src/comptime.c"; - files = ( - ); - inputPaths = ( - ); - name = "Get SCM Info"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "PATH=\"/usr/local/bin:$PATH\" $SRCROOT/../../../comptime.sh $SRCROOT/../../"; - }; - 679B708A102B872300AA9E4C /* Make DMG */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - comments = "make DMG file for Release builds"; - files = ( - ); - inputPaths = ( - $BUILT_PRODUCTS_DIR/$WRAPPER_NAME, - ); - name = "Make DMG"; - outputPaths = ( - $BUILT_PRODUCTS_DIR/$TARGET_NAME.nodata.dmg, - $BUILT_PRODUCTS_DIR/$TARGET_NAME.dmg, - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "set -ex\n\n[ \"$ACTION\" = build ] || exit 0\n[ \"$CURRENT_VARIANT\" = \"normal\" ] || exit 0\n[ \"$BUILD_STYLE\" = \"Release\" ] || exit 0\n\ndir=\"$TEMP_FILES_DIR/$TARGET_NAME.disk\"\ndmg=\"$BUILT_PRODUCTS_DIR/$TARGET_NAME.dmg\"\ndmg_nodata=\"$BUILT_PRODUCTS_DIR/$TARGET_NAME.nodata.dmg\"\n\nrm -rf -- \"$dir\"\nmkdir \"$dir\"\ncp -R \"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME\" \"$dir\"\nrm -f -- \"$dmg\"\nhdiutil create -ov -fs HFS+ -srcfolder \"$dir\" -volname \"$TARGET_NAME\" \"$dmg\"\nhdiutil internet-enable -yes \"$dmg\"\ncd \"$dir/$WRAPPER_NAME/Contents/Resources\"\nrm -f -- *.wad\nrm -f -- *.dta\nrm -f -- *.plr\nrm -f -- *.wpn\nrm -f -- *.srb2\ncd \"$OLDPWD\"\nrm -f -- \"$dmg_nodata\"\nhdiutil create -ov -fs HFS+ -srcfolder \"$dir\" -volname \"$TARGET_NAME Lite\" \"$dmg_nodata\"\nhdiutil internet-enable -yes \"$dmg_nodata\"\nrm -rf -- \"$dir\""; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E44AE750B67CC2B00BAD059 /* hw_bsp.c in Sources */, - 1E44AE770B67CC2B00BAD059 /* hw3sound.c in Sources */, - 1E44AE780B67CC2B00BAD059 /* hw_cache.c in Sources */, - 1E44AE7C0B67CC2B00BAD059 /* hw_light.c in Sources */, - 1E44AE800B67CC2B00BAD059 /* hw_draw.c in Sources */, - 1E44AE820B67CC2B00BAD059 /* hw_main.c in Sources */, - 1E44AE840B67CC2B00BAD059 /* hw_md2.c in Sources */, - 1E44AE860B67CC2B00BAD059 /* hw_trick.c in Sources */, - 1E44AEA40B67CC8500BAD059 /* d_clisrv.c in Sources */, - 1E44AEA70B67CC8500BAD059 /* d_main.c in Sources */, - 1E44AEA80B67CC8500BAD059 /* d_net.c in Sources */, - 1E44AEAB0B67CC8500BAD059 /* d_netfil.c in Sources */, - 1E44AEAF0B67CC8500BAD059 /* d_netcmd.c in Sources */, - 1E44AEB30B67CC8500BAD059 /* dehacked.c in Sources */, - 1E44AEBF0B67CCA900BAD059 /* f_wipe.c in Sources */, - 1E44AEC00B67CCA900BAD059 /* f_finale.c in Sources */, - 1E44AEC80B67CCC600BAD059 /* g_game.c in Sources */, - 1E44AECC0B67CCC600BAD059 /* g_input.c in Sources */, - 1E44AED00B67CCEE00BAD059 /* hu_stuff.c in Sources */, - 1E44AEDC0B67CD1300BAD059 /* i_tcp.c in Sources */, - 1E44AEE30B67CD2B00BAD059 /* am_map.c in Sources */, - 1E44AEE90B67CD3F00BAD059 /* command.c in Sources */, - 1E44AEEC0B67CD4400BAD059 /* comptime.c in Sources */, - 1E44AEEF0B67CD5400BAD059 /* console.c in Sources */, - 1E44AEF30B67CD7F00BAD059 /* filesrch.c in Sources */, - 1E44AF070B67CDE900BAD059 /* m_argv.c in Sources */, - 1E44AF0A0B67CDE900BAD059 /* m_cheat.c in Sources */, - 1E44AF0B0B67CDE900BAD059 /* m_bbox.c in Sources */, - 1E44AF0D0B67CDE900BAD059 /* m_fixed.c in Sources */, - 1E44AF0F0B67CDE900BAD059 /* m_menu.c in Sources */, - 1E44AF110B67CDE900BAD059 /* m_misc.c in Sources */, - 1E44AF130B67CDE900BAD059 /* m_random.c in Sources */, - 1E44AF1A0B67CE2A00BAD059 /* info.c in Sources */, - 1E44AF1E0B67CE3600BAD059 /* md5.c in Sources */, - 1E44AF220B67CE4100BAD059 /* mserv.c in Sources */, - 1E44AF3C0B67CE5F00BAD059 /* p_enemy.c in Sources */, - 1E44AF3D0B67CE5F00BAD059 /* p_inter.c in Sources */, - 1E44AF3E0B67CE5F00BAD059 /* p_fab.c in Sources */, - 1E44AF3F0B67CE5F00BAD059 /* p_lights.c in Sources */, - 1E44AF400B67CE5F00BAD059 /* p_map.c in Sources */, - 1E44AF410B67CE5F00BAD059 /* p_maputl.c in Sources */, - 1E44AF430B67CE5F00BAD059 /* p_mobj.c in Sources */, - 1E44AF450B67CE5F00BAD059 /* p_floor.c in Sources */, - 1E44AF480B67CE5F00BAD059 /* p_saveg.c in Sources */, - 1E44AF4A0B67CE5F00BAD059 /* p_setup.c in Sources */, - 1E44AF4C0B67CE5F00BAD059 /* p_sight.c in Sources */, - 1E44AF4D0B67CE5F00BAD059 /* p_spec.c in Sources */, - 1E44AF4F0B67CE5F00BAD059 /* p_telept.c in Sources */, - 1E44AF500B67CE5F00BAD059 /* p_tick.c in Sources */, - 1E44AF520B67CE5F00BAD059 /* p_user.c in Sources */, - 1E44AF530B67CE5F00BAD059 /* p_ceilng.c in Sources */, - 1E44AF6C0B67CEC200BAD059 /* r_bsp.c in Sources */, - 1E44AF6F0B67CEC200BAD059 /* r_data.c in Sources */, - 1E44AF700B67CEC200BAD059 /* r_draw.c in Sources */, - 1E44AF730B67CEC200BAD059 /* r_main.c in Sources */, - 1E44AF780B67CEC200BAD059 /* r_plane.c in Sources */, - 1E44AF7A0B67CEC200BAD059 /* r_segs.c in Sources */, - 1E44AF7C0B67CEC200BAD059 /* r_sky.c in Sources */, - 1E44AF7E0B67CEC200BAD059 /* r_splats.c in Sources */, - 1E44AF810B67CEC200BAD059 /* r_things.c in Sources */, - 1E44AF870B67CEE000BAD059 /* s_sound.c in Sources */, - 1E44AF8B0B67CEE900BAD059 /* screen.c in Sources */, - 1E44AF8F0B67CEF000BAD059 /* sounds.c in Sources */, - 1E44AF930B67CEFF00BAD059 /* st_stuff.c in Sources */, - 1E44AF9B0B67CF2E00BAD059 /* tables.c in Sources */, - 1E44AFA50B67CF5D00BAD059 /* v_video.c in Sources */, - 1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */, - 1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */, - 1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */, - 1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */, - 1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */, - 1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */, - 1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */, - 1E44AFCA0B67CFDC00BAD059 /* i_main.c in Sources */, - 1E44AFCB0B67CFDC00BAD059 /* i_net.c in Sources */, - 1E44AFCD0B67CFDC00BAD059 /* i_system.c in Sources */, - 1E44AFCE0B67CFDC00BAD059 /* i_video.c in Sources */, - 1E44AFD00B67CFDC00BAD059 /* ogl_sdl.c in Sources */, - 1E44AFEB0B67D06200BAD059 /* mac_alert.c in Sources */, - 1E44AFED0B67D0AB00BAD059 /* r_opengl.c in Sources */, - 1E44B0590B67D81E00BAD059 /* SDL_macosx_main.m in Sources */, - 1E308E720B71172D0015728C /* lzf.c in Sources */, - 676BB5200E0DE06100C95963 /* m_queue.c in Sources */, - 676BB5220E0DE06100C95963 /* p_polyobj.c in Sources */, - 67B83BFA14F57EAB00AAAE4E /* lapi.c in Sources */, - 67B83BFB14F57EAB00AAAE4E /* lauxlib.c in Sources */, - 67B83BFC14F57EAB00AAAE4E /* lbaselib.c in Sources */, - 67B83BFD14F57EAB00AAAE4E /* lcode.c in Sources */, - 67B83BFE14F57EAB00AAAE4E /* ldebug.c in Sources */, - 67B83BFF14F57EAB00AAAE4E /* ldo.c in Sources */, - 67B83C0014F57EAB00AAAE4E /* ldump.c in Sources */, - 67B83C0114F57EAB00AAAE4E /* lfunc.c in Sources */, - 67B83C0214F57EAB00AAAE4E /* lgc.c in Sources */, - 67B83C0314F57EAB00AAAE4E /* linit.c in Sources */, - 67B83C0414F57EAB00AAAE4E /* llex.c in Sources */, - 67B83C0514F57EAB00AAAE4E /* lmem.c in Sources */, - 67B83C0614F57EAB00AAAE4E /* lobject.c in Sources */, - 67B83C0714F57EAB00AAAE4E /* lopcodes.c in Sources */, - 67B83C0814F57EAB00AAAE4E /* lparser.c in Sources */, - 67B83C0914F57EAB00AAAE4E /* lstate.c in Sources */, - 67B83C0A14F57EAB00AAAE4E /* lstring.c in Sources */, - 67B83C0B14F57EAB00AAAE4E /* lstrlib.c in Sources */, - 67B83C0C14F57EAB00AAAE4E /* ltable.c in Sources */, - 67B83C0D14F57EAB00AAAE4E /* ltablib.c in Sources */, - 67B83C0E14F57EAB00AAAE4E /* ltm.c in Sources */, - 67B83C0F14F57EAB00AAAE4E /* lundump.c in Sources */, - 67B83C1014F57EAB00AAAE4E /* lvm.c in Sources */, - 67B83C1114F57EAB00AAAE4E /* lzio.c in Sources */, - 67B83C1414F57ECA00AAAE4E /* b_bot.c in Sources */, - 67B83C2214F57EE600AAAE4E /* lua_baselib.c in Sources */, - 67B83C2314F57EE600AAAE4E /* lua_consolelib.c in Sources */, - 67B83C2414F57EE600AAAE4E /* lua_hooklib.c in Sources */, - 67B83C2514F57EE600AAAE4E /* lua_infolib.c in Sources */, - 67B83C2614F57EE600AAAE4E /* lua_maplib.c in Sources */, - 67B83C2714F57EE600AAAE4E /* lua_mathlib.c in Sources */, - 67B83C2814F57EE600AAAE4E /* lua_mobjlib.c in Sources */, - 67B83C2914F57EE600AAAE4E /* lua_playerlib.c in Sources */, - 67B83C2A14F57EE600AAAE4E /* lua_script.c in Sources */, - 67B83C2B14F57EE600AAAE4E /* lua_thinkerlib.c in Sources */, - 67B83C3314F57F1500AAAE4E /* m_cond.c in Sources */, - 67259DFD18D2687D00F02971 /* lua_hudlib.c in Sources */, - 67259DFE18D2687D00F02971 /* lua_skinlib.c in Sources */, - 67259E0118D268AE00F02971 /* m_anigif.c in Sources */, - 67259E0618D268F700F02971 /* i_ttf.c in Sources */, - 67259E0718D268F700F02971 /* mixer_sound.c in Sources */, - 67259E0818D268F700F02971 /* sdl_sound.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.8; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - NORMALSRB2, - ); - PRODUCT_NAME = Srb2mac; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.8; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - NORMALSRB2, - ); - PRODUCT_NAME = Srb2mac; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - i386, - ppc, - ); - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.0.0; - DEBUG_INFORMATION_FORMAT = dwarf; - DSTROOT = "$(HOME)/Applications"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_ENABLE_PASCAL_STRINGS = NO; - GCC_FAST_OBJC_DISPATCH = NO; - "GCC_MODEL_TUNING[arch=ppc]" = G3; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_ALERT, - SDLMAIN, - HAVE_SDL, - HAVE_MIXER, - HAVE_PNG, - HAVE_BLUA, - LUA_USE_POSIX, - COMPVERSION, - ); - GCC_THREADSAFE_STATICS = NO; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc0 = 3.3; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INHIBIT_ALL_WARNINGS = NO; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PEDANTIC = NO; - GCC_WARN_PROTOTYPE_CONVERSION = NO; - GCC_WARN_SHADOW = NO; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_STRICT_SELECTOR_MATCH = YES; - GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = NO; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_PARAMETER = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GGG_MODEL_TUNING_ppc = G3; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HOME)/Library/Frameworks/SDL_mixer.framework/Headers", - /Library/Frameworks/SDL_mixer.framework/Headers, - "$(HOME)/Library/Frameworks/libz.framework/Headers", - /Library/Frameworks/libz.framework/Headers, - "$(HOME)/Library/Frameworks/libpng.framework/Headers", - /Library/Frameworks/libpng.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - MACH_O_TYPE = mh_execute; - MACOSX_DEPLOYMENT_TARGET = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.2; - OBJROOT = "$(inherited)/$(PRODUCT_NAME)/$(CURRENT_PROJECT_VERSION)"; - OTHER_CFLAGS_normal = "-D_DEBUG -DPARANOIA -DRANGECHECK"; - PREBINDING = NO; - PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; - PRODUCT_NAME = SRB2dummy; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=i386]" = macosx10.4; - "SDKROOT[arch=ppc]" = macosx10.3.9; - SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "$(inherited)/$(PRODUCT_NAME)/$(CURRENT_PROJECT_VERSION)"; - WARNING_CFLAGS = ( - "-Wall", - "-W", - "-Wno-undef", - "-Wpointer-arith", - "-Wbad-function-cast", - "-Wno-cast-qual", - "-Wcast-align", - "-Wwrite-strings", - "-Waggregate-return", - "-Wmissing-prototypes", - "-Wmissing-declarations", - "-Wno-missing-noreturn", - "-Wnested-externs", - "-Winline", - ); - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - i386, - ppc, - ); - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.0.0; - DSTROOT = "$(HOME)/Applications"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_ENABLE_PASCAL_STRINGS = NO; - GCC_FAST_OBJC_DISPATCH = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - "GCC_MODEL_TUNING[arch=ppc]" = G3; - GCC_OPTIMIZATION_LEVEL = 2; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_ALERT, - SDLMAIN, - HAVE_SDL, - HAVE_MIXER, - HAVE_PNG, - HAVE_BLUA, - LUA_USE_POSIX, - COMPVERSION, - ); - GCC_THREADSAFE_STATICS = NO; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc0 = 3.3; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INHIBIT_ALL_WARNINGS = NO; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PEDANTIC = NO; - GCC_WARN_PROTOTYPE_CONVERSION = NO; - GCC_WARN_SHADOW = NO; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_STRICT_SELECTOR_MATCH = YES; - GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_PARAMETER = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GGG_MODEL_TUNING_ppc = G3; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HOME)/Library/Frameworks/SDL_mixer.framework/Headers", - /Library/Frameworks/SDL_mixer.framework/Headers, - "$(HOME)/Library/Frameworks/libz.framework/Headers", - /Library/Frameworks/libz.framework/Headers, - "$(HOME)/Library/Frameworks/libpng.framework/Headers", - /Library/Frameworks/libpng.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - INFOPLIST_FILE = Info.plist; - MACH_O_TYPE = mh_execute; - MACOSX_DEPLOYMENT_TARGET = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.2; - OBJROOT = "$(inherited)/$(PRODUCT_NAME)/$(CURRENT_PROJECT_VERSION)"; - OTHER_CFLAGS_normal = "-DNDEBUG"; - PREBINDING = NO; - PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; - PRODUCT_NAME = SRB2dummy; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=i386]" = macosx10.4; - "SDKROOT[arch=ppc]" = macosx10.3.9; - SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "$(inherited)/$(PRODUCT_NAME)/$(CURRENT_PROJECT_VERSION)"; - WARNING_CFLAGS = ( - "-Wall", - "-W", - "-Wno-undef", - "-Wpointer-arith", - "-Wbad-function-cast", - "-Wno-cast-qual", - "-Wcast-align", - "-Wwrite-strings", - "-Waggregate-return", - "-Wmissing-prototypes", - "-Wmissing-declarations", - "-Wno-missing-noreturn", - "-Wnested-externs", - "-Winline", - "-Wno-aggregate-return", - ); - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Srb2mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Srb2mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/src/sdl2/macosx/mac_alert.c b/src/sdl2/macosx/mac_alert.c deleted file mode 100644 index 455e3650..00000000 --- a/src/sdl2/macosx/mac_alert.c +++ /dev/null @@ -1,45 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Graphical Alerts for MacOSX -/// -/// Shows alerts, since we can't just print these to the screen when -/// launched graphically on a mac. - -#ifdef __APPLE_CC__ - -#include "mac_alert.h" -#include - -int MacShowAlert(const char *title, const char *message, const char *button1, const char *button2, const char *button3) -{ - CFOptionFlags results; - - CFUserNotificationDisplayAlert(0, - kCFUserNotificationStopAlertLevel | kCFUserNotificationNoDefaultButtonFlag, - NULL, NULL, NULL, - CFStringCreateWithCString(NULL, title, kCFStringEncodingASCII), - CFStringCreateWithCString(NULL, message, kCFStringEncodingASCII), - button1 != NULL ? CFStringCreateWithCString(NULL, button1, kCFStringEncodingASCII) : NULL, - button2 != NULL ? CFStringCreateWithCString(NULL, button2, kCFStringEncodingASCII) : NULL, - button3 != NULL ? CFStringCreateWithCString(NULL, button3, kCFStringEncodingASCII) : NULL, - &results); - - return (int)results; -} - -#endif diff --git a/src/sdl2/macosx/mac_alert.h b/src/sdl2/macosx/mac_alert.h deleted file mode 100644 index 82a28d12..00000000 --- a/src/sdl2/macosx/mac_alert.h +++ /dev/null @@ -1,27 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Graphical Alerts for MacOSX -/// -/// Shows alerts, since we can't just print these to the screen when -/// launched graphically on a mac. - -#ifdef __APPLE_CC__ - -extern int MacShowAlert(const char *title, const char *message, const char *button1, const char *button2, const char *button3); - -#endif diff --git a/src/sdl2/mixer_sound.c b/src/sdl2/mixer_sound.c deleted file mode 100644 index 8c90557f..00000000 --- a/src/sdl2/mixer_sound.c +++ /dev/null @@ -1,824 +0,0 @@ -/// \file -/// \brief SDL Mixer interface for sound - -#include "../doomdef.h" - -#if defined(HAVE_SDL) && defined(HAVE_MIXER) && SOUND==SOUND_MIXER - -#include "../sounds.h" -#include "../s_sound.h" -#include "../i_sound.h" -#include "../w_wad.h" -#include "../z_zone.h" -#include "../byteptr.h" - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif -#include "SDL.h" -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#include "SDL_mixer.h" - -/* This is the version number macro for the current SDL_mixer version: */ -#ifndef SDL_MIXER_COMPILEDVERSION -#define SDL_MIXER_COMPILEDVERSION \ - SDL_VERSIONNUM(MIX_MAJOR_VERSION, MIX_MINOR_VERSION, MIX_PATCHLEVEL) -#endif - -/* This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z */ -#ifndef SDL_MIXER_VERSION_ATLEAST -#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \ - (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) -#endif - -#ifdef HAVE_LIBGME -#include "gme/gme.h" -#define GME_TREBLE 5.0 -#define GME_BASS 1.0 -#ifdef HAVE_PNG /// TODO: compile with zlib support without libpng - -#define HAVE_ZLIB - -#ifndef _MSC_VER -#ifndef _WII -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif -#endif -#endif - -#ifndef _LFS64_LARGEFILE -#define _LFS64_LARGEFILE -#endif - -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 0 -#endif - -#include "zlib.h" -#endif -#endif - -UINT8 sound_started = false; - -static boolean midimode; -static Mix_Music *music; -static UINT8 music_volume, midi_volume, sfx_volume; -static float loop_point; - -#ifdef HAVE_LIBGME -static Music_Emu *gme; -static INT32 current_track; -#endif - -void I_StartupSound(void) -{ - I_Assert(!sound_started); - sound_started = true; - - midimode = false; - music = NULL; - music_volume = midi_volume = sfx_volume = 0; - -#if SDL_MIXER_VERSION_ATLEAST(1,2,11) - Mix_Init(MIX_INIT_FLAC|MIX_INIT_MOD|MIX_INIT_MP3|MIX_INIT_OGG); -#endif - Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 2048); - Mix_AllocateChannels(256); -} - -void I_ShutdownSound(void) -{ - I_Assert(sound_started); - sound_started = false; - - Mix_CloseAudio(); -#if SDL_MIXER_VERSION_ATLEAST(1,2,11) - Mix_Quit(); -#endif -#ifdef HAVE_LIBGME - if (gme) - gme_delete(gme); -#endif -} - -void I_UpdateSound(void) -{ -} - -// this is as fast as I can possibly make it. -// sorry. more asm needed. -static Mix_Chunk *ds2chunk(void *stream) -{ - UINT16 ver,freq; - UINT32 samples, i, newsamples; - UINT8 *sound; - - SINT8 *s; - INT16 *d; - INT16 o; - fixed_t step, frac; - - // lump header - ver = READUINT16(stream); // sound version format? - if (ver != 3) // It should be 3 if it's a doomsound... - return NULL; // onos! it's not a doomsound! - freq = READUINT16(stream); - samples = READUINT32(stream); - - // convert from signed 8bit ???hz to signed 16bit 44100hz. - switch(freq) - { - case 44100: - if (samples >= UINT32_MAX>>2) - return NULL; // would wrap, can't store. - newsamples = samples; - break; - case 22050: - if (samples >= UINT32_MAX>>3) - return NULL; // would wrap, can't store. - newsamples = samples<<1; - break; - case 11025: - if (samples >= UINT32_MAX>>4) - return NULL; // would wrap, can't store. - newsamples = samples<<2; - break; - default: - frac = (44100 << FRACBITS) / (UINT32)freq; - if (!(frac & 0xFFFF)) // other solid multiples (change if FRACBITS != 16) - newsamples = samples * (frac >> FRACBITS); - else // strange and unusual fractional frequency steps, plus anything higher than 44100hz. - newsamples = FixedMul(FixedDiv(samples, freq), 44100) + 1; // add 1 to counter truncation. - if (newsamples >= UINT32_MAX>>2) - return NULL; // would and/or did wrap, can't store. - break; - } - sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels - - s = (SINT8 *)stream; - d = (INT16 *)sound; - - i = 0; - switch(freq) - { - case 44100: // already at the same rate? well that makes it simple. - while(i++ < samples) - { - o = ((INT16)(*s++)+0x80)<<8; // changed signedness and shift up to 16 bits - *d++ = o; // left channel - *d++ = o; // right channel - } - break; - case 22050: // unwrap 2x - while(i++ < samples) - { - o = ((INT16)(*s++)+0x80)<<8; // changed signedness and shift up to 16 bits - *d++ = o; // left channel - *d++ = o; // right channel - *d++ = o; // left channel - *d++ = o; // right channel - } - break; - case 11025: // unwrap 4x - while(i++ < samples) - { - o = ((INT16)(*s++)+0x80)<<8; // changed signedness and shift up to 16 bits - *d++ = o; // left channel - *d++ = o; // right channel - *d++ = o; // left channel - *d++ = o; // right channel - *d++ = o; // left channel - *d++ = o; // right channel - *d++ = o; // left channel - *d++ = o; // right channel - } - break; - default: // convert arbitrary hz to 44100. - step = 0; - frac = ((UINT32)freq << FRACBITS) / 44100; - while (i < samples) - { - o = (INT16)(*s+0x80)<<8; // changed signedness and shift up to 16 bits - while (step < FRACUNIT) // this is as fast as I can make it. - { - *d++ = o; // left channel - *d++ = o; // right channel - step += frac; - } - do { - i++; s++; - step -= FRACUNIT; - } while (step >= FRACUNIT); - } - break; - } - - // return Mixer Chunk. - return Mix_QuickLoad_RAW(sound, (UINT8*)d-sound); -} - -void *I_GetSfx(sfxinfo_t *sfx) -{ - void *lump; - Mix_Chunk *chunk; -#ifdef HAVE_LIBGME - Music_Emu *emu; - gme_info_t *info; -#endif - - if (sfx->lumpnum == LUMPERROR) - sfx->lumpnum = S_GetSfxLumpNum(sfx); - sfx->length = W_LumpLength(sfx->lumpnum); - - lump = W_CacheLumpNum(sfx->lumpnum, PU_SOUND); - - // convert from standard DoomSound format. - chunk = ds2chunk(lump); - if (chunk) - { - Z_Free(lump); - return chunk; - } - - // Not a doom sound? Try something else. -#ifdef HAVE_LIBGME - // VGZ format - if (((UINT8 *)lump)[0] == 0x1F - && ((UINT8 *)lump)[1] == 0x8B) - { -#ifdef HAVE_ZLIB - UINT8 *inflatedData; - size_t inflatedLen; - z_stream stream; - int zErr; // Somewhere to handle any error messages zlib tosses out - - memset(&stream, 0x00, sizeof (z_stream)); // Init zlib stream - // Begin the inflation process - inflatedLen = *(UINT32 *)lump + (sfx->length-4); // Last 4 bytes are the decompressed size, typically - inflatedData = (UINT8 *)Z_Malloc(inflatedLen, PU_SOUND, NULL); // Make room for the decompressed data - stream.total_in = stream.avail_in = sfx->length; - stream.total_out = stream.avail_out = inflatedLen; - stream.next_in = (UINT8 *)lump; - stream.next_out = inflatedData; - - zErr = inflateInit2(&stream, 32 + MAX_WBITS); - if (zErr == Z_OK) // We're good to go - { - zErr = inflate(&stream, Z_FINISH); - if (zErr == Z_STREAM_END) { - // Run GME on new data - if (!gme_open_data(inflatedData, inflatedLen, &emu, 44100)) - { - short *mem; - UINT32 len; - gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0}; - - Z_Free(inflatedData); // GME supposedly makes a copy for itself, so we don't need this lying around - Z_Free(lump); // We're done with the uninflated lump now, too. - - gme_start_track(emu, 0); - gme_set_equalizer(emu, &eq); - gme_track_info(emu, &info, 0); - - len = (info->play_length * 441 / 10) << 2; - mem = Z_Malloc(len, PU_SOUND, NULL); - gme_play(emu, len >> 1, mem); - gme_delete(emu); - - return Mix_QuickLoad_RAW((Uint8 *)mem, len); - } - } - else - { - const char *errorType; - switch (zErr) - { - case Z_ERRNO: - errorType = "Z_ERRNO"; break; - case Z_STREAM_ERROR: - errorType = "Z_STREAM_ERROR"; break; - case Z_DATA_ERROR: - errorType = "Z_DATA_ERROR"; break; - case Z_MEM_ERROR: - errorType = "Z_MEM_ERROR"; break; - case Z_BUF_ERROR: - errorType = "Z_BUF_ERROR"; break; - case Z_VERSION_ERROR: - errorType = "Z_VERSION_ERROR"; break; - default: - errorType = "unknown error"; - } - CONS_Alert(CONS_ERROR,"Encountered %s when running inflate: %s\n", errorType, stream.msg); - } - (void)inflateEnd(&stream); - } - else // Hold up, zlib's got a problem - { - const char *errorType; - switch (zErr) - { - case Z_ERRNO: - errorType = "Z_ERRNO"; break; - case Z_STREAM_ERROR: - errorType = "Z_STREAM_ERROR"; break; - case Z_DATA_ERROR: - errorType = "Z_DATA_ERROR"; break; - case Z_MEM_ERROR: - errorType = "Z_MEM_ERROR"; break; - case Z_BUF_ERROR: - errorType = "Z_BUF_ERROR"; break; - case Z_VERSION_ERROR: - errorType = "Z_VERSION_ERROR"; break; - default: - errorType = "unknown error"; - } - CONS_Alert(CONS_ERROR,"Encountered %s when running inflateInit: %s\n", errorType, stream.msg); - } - Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up -#else - //CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); -#endif - } - // Try to read it as a GME sound - else if (!gme_open_data(lump, sfx->length, &emu, 44100)) - { - short *mem; - UINT32 len; - gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0}; - - Z_Free(lump); - - gme_start_track(emu, 0); - gme_set_equalizer(emu, &eq); - gme_track_info(emu, &info, 0); - - len = (info->play_length * 441 / 10) << 2; - mem = Z_Malloc(len, PU_SOUND, NULL); - gme_play(emu, len >> 1, mem); - gme_delete(emu); - - return Mix_QuickLoad_RAW((Uint8 *)mem, len); - } -#endif - - // Try to load it as a WAVE or OGG using Mixer. - return Mix_LoadWAV_RW(SDL_RWFromMem(lump, sfx->length), 1); -} - -void I_FreeSfx(sfxinfo_t *sfx) -{ - if (sfx->data) - Mix_FreeChunk(sfx->data); - sfx->data = NULL; -} - -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) -{ - UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); - Mix_Volume(handle, volume); - Mix_SetPanning(handle, min((UINT16)sep<<1, 0xff), min((UINT16)(0xff-sep)<<1, 0xff)); - (void)pitch; // Mixer can't handle pitch - (void)priority; // priority and channel management is handled by SRB2... - return handle; -} - -void I_StopSound(INT32 handle) -{ - Mix_HaltChannel(handle); -} - -boolean I_SoundIsPlaying(INT32 handle) -{ - return Mix_Playing(handle); -} - -void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch) -{ - UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - Mix_Volume(handle, volume); - Mix_SetPanning(handle, min((UINT16)sep<<1, 0xff), min((UINT16)(0xff-sep)<<1, 0xff)); - (void)pitch; -} - -void I_SetSfxVolume(UINT8 volume) -{ - sfx_volume = volume; -} - -// -// Music -// - -// Music hooks -static void music_loop(void) -{ - Mix_PlayMusic(music, 0); - Mix_SetMusicPosition(loop_point); -} - -#ifdef HAVE_LIBGME -static void mix_gme(void *udata, Uint8 *stream, int len) -{ - int i; - short *p; - - (void)udata; - - // no gme? no music. - if (!gme || gme_track_ended(gme)) - return; - - // play gme into stream - gme_play(gme, len/2, (short *)stream); - - // apply volume to stream - for (i = 0, p = (short *)stream; i < len/2; i++, p++) - *p = ((INT32)*p) * music_volume / 31; -} -#endif - -void I_InitMusic(void) -{ -} - -void I_ShutdownMusic(void) -{ - I_ShutdownDigMusic(); - I_ShutdownMIDIMusic(); -} - -void I_PauseSong(INT32 handle) -{ - (void)handle; - Mix_PauseMusic(); -} - -void I_ResumeSong(INT32 handle) -{ - (void)handle; - Mix_ResumeMusic(); -} - -// -// Digital Music -// - -void I_InitDigMusic(void) -{ -#ifdef HAVE_LIBGME - gme = NULL; - current_track = -1; -#endif -} - -void I_ShutdownDigMusic(void) -{ - if (midimode) - return; -#ifdef HAVE_LIBGME - if (gme) - { - Mix_HookMusic(NULL, NULL); - gme_delete(gme); - gme = NULL; - } -#endif - if (!music) - return; - Mix_HookMusicFinished(NULL); - Mix_FreeMusic(music); - music = NULL; -} - -boolean I_StartDigSong(const char *musicname, boolean looping) -{ - char *data; - size_t len; - lumpnum_t lumpnum = W_CheckNumForName(va("O_%s",musicname)); - - I_Assert(!music); -#ifdef HAVE_LIBGME - I_Assert(!gme); -#endif - - if (lumpnum == LUMPERROR) - { - lumpnum = W_CheckNumForName(va("D_%s",musicname)); - if (lumpnum == LUMPERROR) - return false; - midimode = true; - } - else - midimode = false; - - data = (char *)W_CacheLumpNum(lumpnum, PU_MUSIC); - len = W_LumpLength(lumpnum); - -#ifdef HAVE_LIBGME - if ((UINT8)data[0] == 0x1F - && (UINT8)data[1] == 0x8B) - { -#ifdef HAVE_ZLIB - UINT8 *inflatedData; - size_t inflatedLen; - z_stream stream; - int zErr; // Somewhere to handle any error messages zlib tosses out - - memset(&stream, 0x00, sizeof (z_stream)); // Init zlib stream - // Begin the inflation process - inflatedLen = *(UINT32 *)(data + (len-4)); // Last 4 bytes are the decompressed size, typically - inflatedData = (UINT8 *)Z_Calloc(inflatedLen, PU_MUSIC, NULL); // Make room for the decompressed data - stream.total_in = stream.avail_in = len; - stream.total_out = stream.avail_out = inflatedLen; - stream.next_in = (UINT8 *)data; - stream.next_out = inflatedData; - - zErr = inflateInit2(&stream, 32 + MAX_WBITS); - if (zErr == Z_OK) // We're good to go - { - zErr = inflate(&stream, Z_FINISH); - if (zErr == Z_STREAM_END) { - // Run GME on new data - if (!gme_open_data(inflatedData, inflatedLen, &gme, 44100)) - { - gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0}; - gme_start_track(gme, 0); - current_track = 0; - gme_set_equalizer(gme, &eq); - Mix_HookMusic(mix_gme, gme); - Z_Free(inflatedData); // GME supposedly makes a copy for itself, so we don't need this lying around - return true; - } - } - else - { - const char *errorType; - switch (zErr) - { - case Z_ERRNO: - errorType = "Z_ERRNO"; break; - case Z_STREAM_ERROR: - errorType = "Z_STREAM_ERROR"; break; - case Z_DATA_ERROR: - errorType = "Z_DATA_ERROR"; break; - case Z_MEM_ERROR: - errorType = "Z_MEM_ERROR"; break; - case Z_BUF_ERROR: - errorType = "Z_BUF_ERROR"; break; - case Z_VERSION_ERROR: - errorType = "Z_VERSION_ERROR"; break; - default: - errorType = "unknown error"; - } - CONS_Alert(CONS_ERROR,"Encountered %s when running inflate: %s\n", errorType, stream.msg); - } - (void)inflateEnd(&stream); - } - else // Hold up, zlib's got a problem - { - const char *errorType; - switch (zErr) - { - case Z_ERRNO: - errorType = "Z_ERRNO"; break; - case Z_STREAM_ERROR: - errorType = "Z_STREAM_ERROR"; break; - case Z_DATA_ERROR: - errorType = "Z_DATA_ERROR"; break; - case Z_MEM_ERROR: - errorType = "Z_MEM_ERROR"; break; - case Z_BUF_ERROR: - errorType = "Z_BUF_ERROR"; break; - case Z_VERSION_ERROR: - errorType = "Z_VERSION_ERROR"; break; - default: - errorType = "unknown error"; - } - CONS_Alert(CONS_ERROR,"Encountered %s when running inflateInit: %s\n", errorType, stream.msg); - } - Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up -#else - //CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); -#endif - } - else if (!gme_open_data(data, len, &gme, 44100)) - { - gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0}; - gme_start_track(gme, 0); - current_track = 0; - gme_set_equalizer(gme, &eq); - Mix_HookMusic(mix_gme, gme); - return true; - } -#endif - - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); - if (!music) - { - CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); - return true; - } - - // Find the OGG loop point. - loop_point = 0.0f; - if (looping) - { - const char *key1 = "LOOP"; - const char *key2 = "POINT="; - const char *key3 = "MS="; - const UINT8 key1len = strlen(key1); - const UINT8 key2len = strlen(key2); - const UINT8 key3len = strlen(key3); - char *p = data; - while ((UINT32)(p - data) < len) - { - if (strncmp(p++, key1, key1len)) - continue; - p += key1len-1; // skip OOP (the L was skipped in strncmp) - if (!strncmp(p, key2, key2len)) // is it LOOPPOINT=? - { - p += key2len; // skip POINT= - loop_point = (float)((44.1L+atoi(p)) / 44100.0L); // LOOPPOINT works by sample count. - // because SDL_Mixer is USELESS and can't even tell us - // something simple like the frequency of the streaming music, - // we are unfortunately forced to assume that ALL MUSIC is 44100hz. - // This means a lot of tracks that are only 22050hz for a reasonable downloadable file size will loop VERY badly. - } - else if (!strncmp(p, key3, key3len)) // is it LOOPMS=? - { - p += key3len; // skip MS= - loop_point = atoi(p) / 1000.0L; // LOOPMS works by real time, as miliseconds. - // Everything that uses LOOPMS will work perfectly with SDL_Mixer. - } - // Neither?! Continue searching. - } - } - - if (Mix_PlayMusic(music, looping && loop_point == 0.0f ? -1 : 0) == -1) - { - CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError()); - return true; - } - if (midimode) - Mix_VolumeMusic((UINT32)midi_volume*128/31); - else - Mix_VolumeMusic((UINT32)music_volume*128/31); - - if (loop_point != 0.0f) - Mix_HookMusicFinished(music_loop); - return true; -} - -void I_StopDigSong(void) -{ - if (midimode) - return; -#ifdef HAVE_LIBGME - if (gme) - { - Mix_HookMusic(NULL, NULL); - gme_delete(gme); - gme = NULL; - current_track = -1; - return; - } -#endif - if (!music) - return; - Mix_HookMusicFinished(NULL); - Mix_FreeMusic(music); - music = NULL; -} - -void I_SetDigMusicVolume(UINT8 volume) -{ - music_volume = volume; - if (midimode || !music) - return; - Mix_VolumeMusic((UINT32)volume*128/31); -} - -boolean I_SetSongSpeed(float speed) -{ - if (speed > 250.0f) - speed = 250.0f; //limit speed up to 250x -#ifdef HAVE_LIBGME - if (gme) - { - SDL_LockAudio(); - gme_set_tempo(gme, speed); - SDL_UnlockAudio(); - return true; - } -#else - (void)speed; -#endif - return false; -} - -boolean I_SetSongTrack(int track) -{ -#ifdef HAVE_LIBGME - if (current_track == track) - return false; - - // If the specified track is within the number of tracks playing, then change it - if (gme) - { - SDL_LockAudio(); - if (track >= 0 - && track < gme_track_count(gme)) - { - gme_err_t gme_e = gme_start_track(gme, track); - if (gme_e != NULL) - { - CONS_Alert(CONS_ERROR, "GME error: %s\n", gme_e); - return false; - } - current_track = track; - SDL_UnlockAudio(); - return true; - } - SDL_UnlockAudio(); - return false; - } -#endif - (void)track; - return false; -} - -// -// MIDI Music -// - -void I_InitMIDIMusic(void) -{ -} - -void I_ShutdownMIDIMusic(void) -{ - if (!midimode || !music) - return; - Mix_FreeMusic(music); - music = NULL; -} - -void I_SetMIDIMusicVolume(UINT8 volume) -{ - midi_volume = volume; - if (!midimode || !music) - return; - Mix_VolumeMusic((UINT32)volume*128/31); -} - -INT32 I_RegisterSong(void *data, size_t len) -{ - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); - if (!music) - { - CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); - return -1; - } - return 1337; -} - -boolean I_PlaySong(INT32 handle, boolean looping) -{ - (void)handle; - - midimode = true; - - if (Mix_PlayMusic(music, looping ? -1 : 0) == -1) - { - CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError()); - return false; - } - Mix_VolumeMusic((UINT32)music_volume*128/31); - return true; -} - -void I_StopSong(INT32 handle) -{ - if (!midimode || !music) - return; - - (void)handle; - Mix_HaltMusic(); -} - -void I_UnRegisterSong(INT32 handle) -{ - if (!midimode || !music) - return; - - (void)handle; - Mix_FreeMusic(music); - music = NULL; -} - -#endif diff --git a/src/sdl2/ogl_sdl.c b/src/sdl2/ogl_sdl.c deleted file mode 100644 index 62055e10..00000000 --- a/src/sdl2/ogl_sdl.c +++ /dev/null @@ -1,228 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL specific part of the OpenGL API for SRB2 - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#ifdef HAVE_SDL - -#include "SDL.h" - -#include "sdlmain.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#include "../doomdef.h" - -#ifdef HWRENDER -#include "../hardware/r_opengl/r_opengl.h" -#include "ogl_sdl.h" -#include "../i_system.h" -#include "hwsym_sdl.h" -#include "../m_argv.h" - -#ifdef DEBUG_TO_FILE -#include -#if defined (_WIN32) && !defined (__CYGWIN__) -#include -#else -#include -#endif -#include -#include -#endif - -#ifdef USE_WGL_SWAP -PFNWGLEXTSWAPCONTROLPROC wglSwapIntervalEXT = NULL; -#else -typedef int (*PFNGLXSWAPINTERVALPROC) (int); -PFNGLXSWAPINTERVALPROC glXSwapIntervalSGIEXT = NULL; -#endif - -#ifndef STATIC_OPENGL -PFNglClear pglClear; -PFNglGetIntegerv pglGetIntegerv; -PFNglGetString pglGetString; -#endif - -/** \brief SDL video display surface -*/ -INT32 oglflags = 0; -void *GLUhandle = NULL; -SDL_GLContext sdlglcontext = 0; - -#ifndef STATIC_OPENGL -void *GetGLFunc(const char *proc) -{ - if (strncmp(proc, "glu", 3) == 0) - { - if (GLUhandle) - return hwSym(proc, GLUhandle); - else - return NULL; - } - return SDL_GL_GetProcAddress(proc); -} -#endif - -boolean LoadGL(void) -{ -#ifndef STATIC_OPENGL - const char *OGLLibname = NULL; - const char *GLULibname = NULL; - - if (M_CheckParm ("-OGLlib") && M_IsNextParm()) - OGLLibname = M_GetNextParm(); - - if (SDL_GL_LoadLibrary(OGLLibname) != 0) - { - I_OutputMsg("Could not load OpenGL Library: %s\n" - "Falling back to Software mode.\n", SDL_GetError()); - if (!M_CheckParm ("-OGLlib")) - I_OutputMsg("If you know what is the OpenGL library's name, use -OGLlib\n"); - return 0; - } - -#if 0 - GLULibname = "/proc/self/exe"; -#elif defined (_WIN32) - GLULibname = "GLU32.DLL"; -#elif defined (__MACH__) - GLULibname = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"; -#elif defined (macintos) - GLULibname = "OpenGLLibrary"; -#elif defined (__unix__) - GLULibname = "libGLU.so.1"; -#elif defined (__HAIKU__) - GLULibname = "libGLU.so"; -#else - GLULibname = NULL; -#endif - - if (M_CheckParm ("-GLUlib") && M_IsNextParm()) - GLULibname = M_GetNextParm(); - - if (GLULibname) - { - GLUhandle = hwOpen(GLULibname); - if (GLUhandle) - return SetupGLfunc(); - else - { - I_OutputMsg("Could not load GLU Library: %s\n", GLULibname); - if (!M_CheckParm ("-GLUlib")) - I_OutputMsg("If you know what is the GLU library's name, use -GLUlib\n"); - } - } - else - { - I_OutputMsg("Could not load GLU Library\n"); - I_OutputMsg("If you know what is the GLU library's name, use -GLUlib\n"); - } -#endif - return SetupGLfunc(); -} - -/** \brief The OglSdlSurface function - - \param w width - \param h height - \param isFullscreen if true, go fullscreen - - \return if true, changed video mode -*/ -boolean OglSdlSurface(INT32 w, INT32 h) -{ - INT32 cbpp; - const GLvoid *glvendor = NULL, *glrenderer = NULL, *glversion = NULL; - - cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; - - glvendor = pglGetString(GL_VENDOR); - // Get info and extensions. - //BP: why don't we make it earlier ? - //Hurdler: we cannot do that before intialising gl context - glrenderer = pglGetString(GL_RENDERER); - glversion = pglGetString(GL_VERSION); - gl_extensions = pglGetString(GL_EXTENSIONS); - - DBG_Printf("Vendor : %s\n", glvendor); - DBG_Printf("Renderer : %s\n", glrenderer); - DBG_Printf("Version : %s\n", glversion); - DBG_Printf("Extensions : %s\n", gl_extensions); - oglflags = 0; - - if (isExtAvailable("GL_EXT_texture_filter_anisotropic", gl_extensions)) - pglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maximumAnisotropy); - else - maximumAnisotropy = 1; - - granisotropicmode_cons_t[1].value = maximumAnisotropy; - - SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0); - - SetModelView(w, h); - SetStates(); - pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - - HWR_Startup(); - textureformatGL = cbpp > 16 ? GL_RGBA : GL_RGB5_A1; - - return true; -} - -/** \brief The OglSdlFinishUpdate function - - \param vidwait wait for video sync - - \return void -*/ -void OglSdlFinishUpdate(boolean waitvbl) -{ - static boolean oldwaitvbl = false; - if (oldwaitvbl != waitvbl) - { - SDL_GL_SetSwapInterval(waitvbl ? 1 : 0); - } - oldwaitvbl = waitvbl; - - SDL_GL_SwapWindow(window); -} - -EXPORT void HWRAPI( OglSdlSetPalette) (RGBA_t *palette, RGBA_t *pgamma) -{ - INT32 i = -1; - UINT32 redgamma = pgamma->s.red, greengamma = pgamma->s.green, - bluegamma = pgamma->s.blue; - - for (i = 0; i < 256; i++) - { - myPaletteData[i].s.red = (UINT8)MIN((palette[i].s.red * redgamma) /127, 255); - myPaletteData[i].s.green = (UINT8)MIN((palette[i].s.green * greengamma)/127, 255); - myPaletteData[i].s.blue = (UINT8)MIN((palette[i].s.blue * bluegamma) /127, 255); - myPaletteData[i].s.alpha = palette[i].s.alpha; - } - Flush(); -} - -#endif //HWRENDER -#endif //SDL diff --git a/src/sdl2/ogl_sdl.h b/src/sdl2/ogl_sdl.h deleted file mode 100644 index 72f130a5..00000000 --- a/src/sdl2/ogl_sdl.h +++ /dev/null @@ -1,33 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL specific part of the OpenGL API for SRB2 - -#include "../v_video.h" - -extern void *GLUhandle; - -boolean OglSdlSurface(INT32 w, INT32 h); - -void OglSdlFinishUpdate(boolean vidwait); - -extern SDL_Window *window; -extern SDL_Renderer *renderer; -extern SDL_GLContext sdlglcontext; - -#ifdef _CREATE_DLL_ -EXPORT void HWRAPI( OglSdlSetPalette ) (RGBA_t *palette, RGBA_t *pgamma); -#endif diff --git a/src/sdl2/sdl_sound.c b/src/sdl2/sdl_sound.c deleted file mode 100644 index 5d6c007b..00000000 --- a/src/sdl2/sdl_sound.c +++ /dev/null @@ -1,2031 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL interface for sound - -#include -#include "../doomdef.h" - -#ifdef _MSC_VER -#pragma warning(disable : 4214 4244) -#endif - -#if defined(HAVE_SDL) && SOUND==SOUND_SDL - -#include "SDL.h" - -#ifdef _MSC_VER -#pragma warning(default : 4214 4244) -#endif - -#ifdef HAVE_MIXER -#include "SDL_mixer.h" -/* This is the version number macro for the current SDL_mixer version: */ -#ifndef SDL_MIXER_COMPILEDVERSION -#define SDL_MIXER_COMPILEDVERSION \ - SDL_VERSIONNUM(MIX_MAJOR_VERSION, MIX_MINOR_VERSION, MIX_PATCHLEVEL) -#endif - -/* This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z */ -#ifndef SDL_MIXER_VERSION_ATLEAST -#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \ - (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) -#endif - -#else -#define MIX_CHANNELS 8 -#endif - -#if defined (_WIN32) && !defined (_WIN32_WCE) && !defined (_XBOX) -#include -#elif defined (__GNUC__) -#include -#endif -#include "../z_zone.h" - -#include "../m_swap.h" -#include "../i_system.h" -#include "../i_sound.h" -#include "../m_argv.h" -#include "../m_misc.h" -#include "../w_wad.h" -#include "../screen.h" //vid.WndParent -#include "../doomdef.h" -#include "../doomstat.h" -#include "../s_sound.h" - -#include "../d_main.h" - -#ifdef HW3SOUND -#include "../hardware/hw3dsdrv.h" -#include "../hardware/hw3sound.h" -#include "hwsym_sdl.h" -#endif - -#ifdef HAVE_LIBGME -#include "gme/gme.h" -#endif - -// The number of internal mixing channels, -// the samples calculated for each mixing step, -// the size of the 16bit, 2 hardware channel (stereo) -// mixing buffer, and the samplerate of the raw data. - -// Needed for calling the actual sound output. -#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) -#define NUM_CHANNELS MIX_CHANNELS -#else -#define NUM_CHANNELS MIX_CHANNELS*4 -#endif - -#define INDEXOFSFX(x) ((sfxinfo_t *)x - S_sfx) - -#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) -static Uint16 samplecount = 512; //Alam: .5KB samplecount at 11025hz is 46.439909297052154195011337868481ms of buffer -#elif defined(GP2X) -static Uint16 samplecount = 128; -#else -static Uint16 samplecount = 1024; //Alam: 1KB samplecount at 22050hz is 46.439909297052154195011337868481ms of buffer -#endif - -typedef struct chan_struct -{ - // The channel data pointers, start and end. - Uint8 *data; //static unsigned char *channels[NUM_CHANNELS]; - Uint8 *end; //static unsigned char *channelsend[NUM_CHANNELS]; - - // pitch - Uint32 realstep; // The channel step amount... - Uint32 step; //static UINT32 channelstep[NUM_CHANNELS]; - Uint32 stepremainder; //static UINT32 channelstepremainder[NUM_CHANNELS]; - Uint32 samplerate; // ... and a 0.16 bit remainder of last step. - - // Time/gametic that the channel started playing, - // used to determine oldest, which automatically - // has lowest priority. - tic_t starttic; //static INT32 channelstart[NUM_CHANNELS]; - - // The sound handle, determined on registration, - // used to unregister/stop/modify, - INT32 handle; //static INT32 channelhandles[NUM_CHANNELS]; - - // SFX id of the playing sound effect. - void *id; // Used to catch duplicates (like chainsaw). - sfxenum_t sfxid; //static INT32 channelids[NUM_CHANNELS]; - INT32 vol; //the channel volume - INT32 sep; //the channel pan - - // Hardware left and right channel volume lookup. - Sint16* leftvol_lookup; //static INT32 *channelleftvol_lookup[NUM_CHANNELS]; - Sint16* rightvol_lookup; //static INT32 *channelrightvol_lookup[NUM_CHANNELS]; -} chan_t; - -static chan_t channels[NUM_CHANNELS]; - -// Pitch to stepping lookup -static INT32 steptable[256]; - -// Volume lookups. -static Sint16 vol_lookup[128 * 256]; - -UINT8 sound_started = false; -static SDL_mutex *Snd_Mutex = NULL; - -//SDL's Audio -static SDL_AudioSpec audio; - -static SDL_bool musicStarted = SDL_FALSE; -#ifdef HAVE_MIXER -static SDL_mutex *Msc_Mutex = NULL; -/* FIXME: Make this file instance-specific */ -#ifdef _arch_dreamcast -#define MIDI_PATH "/ram" -#elif defined(GP2X) -#define MIDI_PATH "/mnt/sd/srb2" -#define MIDI_PATH2 "/tmp/mnt/sd/srb2" -#else -#define MIDI_PATH srb2home -#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) -#define MIDI_PATH2 "/tmp" -#endif -#endif -#define MIDI_TMPFILE "srb2music" -#define MIDI_TMPFILE2 "srb2wav" -static INT32 musicvol = 62; - -#if SDL_MIXER_VERSION_ATLEAST(1,2,2) -#define MIXER_POS //Mix_FadeInMusicPos in 1.2.2+ -static void SDLCALL I_FinishMusic(void); -static double loopstartDig = 0.0l; -static SDL_bool loopingDig = SDL_FALSE; -static SDL_bool canlooping = SDL_TRUE; -#endif - -#if SDL_MIXER_VERSION_ATLEAST(1,2,7) -#define USE_RWOPS // ok, USE_RWOPS is in here -#if defined (DC) || defined (_WIN32_WCE) || defined (_XBOX) //|| defined(_WIN32) || defined(GP2X) -#undef USE_RWOPS -#endif -#endif - -#if SDL_MIXER_VERSION_ATLEAST(1,2,10) -//#define MIXER_INIT -#endif - -#ifdef USE_RWOPS -static void * Smidi[2] = { NULL, NULL }; -static SDL_bool canuseRW = SDL_TRUE; -#endif -static const char *fmidi[2] = { MIDI_TMPFILE, MIDI_TMPFILE2}; - -static const INT32 MIDIfade = 500; -static const INT32 Digfade = 0; - -static Mix_Music *music[2] = { NULL, NULL }; -#endif - -typedef struct srb2audio_s { - void *userdata; -#ifdef HAVE_LIBGME - Music_Emu *gme_emu; - UINT8 gme_pause; - UINT8 gme_loop; -#endif -} srb2audio_t; - -static srb2audio_t localdata; - -static void Snd_LockAudio(void) //Alam: Lock audio data and uninstall audio callback -{ - if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); - else if (nosound) return; - else if (nomidimusic && nodigimusic -#ifdef HW3SOUND - && hws_mode == HWS_DEFAULT_MODE -#endif - ) SDL_LockAudio(); -#ifdef HAVE_MIXER - else if (musicStarted) Mix_SetPostMix(NULL, NULL); -#endif -} - -static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio callback -{ - if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); - else if (nosound) return; - else if (nomidimusic && nodigimusic -#ifdef HW3SOUND - && hws_mode == HWS_DEFAULT_MODE -#endif - ) SDL_UnlockAudio(); -#ifdef HAVE_MIXER - else if (musicStarted) Mix_SetPostMix(audio.callback, audio.userdata); -#endif -} - -FUNCMATH static inline Uint16 Snd_LowerRate(Uint16 sr) -{ - if (sr <= audio.freq) // already lowered rate? - return sr; // good then - for (;sr > audio.freq;) // not good? - { // then let see... - if (sr % 2) // can we div by half? - return sr; // no, just use the currect rate - sr /= 2; // we can? wonderful - } // let start over again - if (sr == audio.freq) // did we drop to the desired rate? - return sr; // perfect! but if not - return sr*2; // just keep it just above the output sample rate -} - -#ifdef _MSC_VER -#pragma warning(disable : 4200) -#pragma pack(1) -#endif - -typedef struct -{ - Uint16 header; // 3? - Uint16 samplerate; // 11025+ - Uint16 samples; // number of samples - Uint16 dummy; // 0 - Uint8 data[0]; // data; -} ATTRPACK dssfx_t; - -#ifdef _MSC_VER -#pragma pack() -#pragma warning(default : 4200) -#endif - -// -// This function loads the sound data from the WAD lump, -// for single sound. -// -static void *getsfx(lumpnum_t sfxlump, size_t *len) -{ - dssfx_t *sfx, *paddedsfx; - Uint16 sr , csr; - size_t size = *len; - SDL_AudioCVT sfxcvt; - - sfx = (dssfx_t *)malloc(size); - if (sfx) W_ReadLump(sfxlump, (void *)sfx); - else return NULL; - sr = SHORT(sfx->samplerate); - csr = Snd_LowerRate(sr); - - if (sr > csr && SDL_BuildAudioCVT(&sfxcvt, AUDIO_U8, 1, sr, AUDIO_U8, 1, csr)) - {//Alam: Setup the AudioCVT for the SFX - - sfxcvt.len = (INT32)size-8; //Alam: Chop off the header - sfxcvt.buf = malloc(sfxcvt.len * sfxcvt.len_mult); //Alam: make room - if (sfxcvt.buf) M_Memcpy(sfxcvt.buf, &(sfx->data), sfxcvt.len); //Alam: copy the sfx sample - - if (sfxcvt.buf && SDL_ConvertAudio(&sfxcvt) == 0) //Alam: let convert it! - { - size = sfxcvt.len_cvt + 8; - *len = sfxcvt.len_cvt; - - // Allocate from zone memory. - paddedsfx = (dssfx_t *) Z_Malloc(size, PU_SOUND, NULL); - - // Now copy and pad. - M_Memcpy(paddedsfx->data, sfxcvt.buf, sfxcvt.len_cvt); - free(sfxcvt.buf); - M_Memcpy(paddedsfx,sfx,8); - paddedsfx->samplerate = SHORT(csr); // new freq - } - else //Alam: the convert failed, not needed or I couldn't malloc the buf - { - if (sfxcvt.buf) free(sfxcvt.buf); - *len = size - 8; - - // Allocate from zone memory then copy and pad - paddedsfx = (dssfx_t *)M_Memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size); - } - } - else - { - // Pads the sound effect out to the mixing buffer size. - // The original realloc would interfere with zone memory. - *len = size - 8; - - // Allocate from zone memory then copy and pad - paddedsfx = (dssfx_t *)M_Memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size); - } - - // Remove the cached lump. - free(sfx); - - // Return allocated padded data. - return paddedsfx; -} - -// used to (re)calculate channel params based on vol, sep, pitch -static void I_SetChannelParams(chan_t *c, INT32 vol, INT32 sep, INT32 step) -{ - INT32 leftvol; - INT32 rightvol; - c->vol = vol; - c->sep = sep; - c->step = c->realstep = step; - - if (step != steptable[128]) - c->step += (((c->samplerate<<16)/audio.freq)-65536); - else if (c->samplerate != (unsigned)audio.freq) - c->step = ((c->samplerate<<16)/audio.freq); - // x^2 separation, that is, orientation/stereo. - // range is: 0 (left) - 255 (right) - - // Volume arrives in range 0..255 and it must be in 0..cv_soundvolume... - vol = (vol * cv_soundvolume.value) >> 7; - // note: >> 6 would use almost the entire dynamical range, but - // then there would be no "dynamical room" for other sounds :-/ - - leftvol = vol - ((vol*sep*sep) >> 16); ///(256*256); - sep = 255 - sep; - rightvol = vol - ((vol*sep*sep) >> 16); - - // Sanity check, clamp volume. - if (rightvol < 0) - rightvol = 0; - else if (rightvol > 127) - rightvol = 127; - if (leftvol < 0) - leftvol = 0; - else if (leftvol > 127) - leftvol = 127; - - // Get the proper lookup table piece - // for this volume level - c->leftvol_lookup = &vol_lookup[leftvol*256]; - c->rightvol_lookup = &vol_lookup[rightvol*256]; -} - -static INT32 FindChannel(INT32 handle) -{ - INT32 i; - - for (i = 0; i < NUM_CHANNELS; i++) - if (channels[i].handle == handle) - return i; - - // not found - return -1; -} - -// -// This function adds a sound to the -// list of currently active sounds, -// which is maintained as a given number -// (eight, usually) of internal channels. -// Returns a handle. -// -static INT32 addsfx(sfxenum_t sfxid, INT32 volume, INT32 step, INT32 seperation) -{ - static UINT16 handlenums = 0; - INT32 i, slot, oldestnum = 0; - tic_t oldest = gametic; - - // Play these sound effects only one at a time. -#if 1 - if ( -#if 0 - sfxid == sfx_stnmov || sfxid == sfx_sawup || sfxid == sfx_sawidl || sfxid == sfx_sawful || sfxid == sfx_sawhit || sfxid == sfx_pistol -#else - ( sfx_litng1 <= sfxid && sfxid >= sfx_litng4 ) - || sfxid == sfx_trfire || sfxid == sfx_alarm || sfxid == sfx_spin - || sfxid == sfx_athun1 || sfxid == sfx_athun2 || sfxid == sfx_rainin -#endif - ) - { - // Loop all channels, check. - for (i = 0; i < NUM_CHANNELS; i++) - { - // Active, and using the same SFX? - if ((channels[i].end) && (channels[i].sfxid == sfxid)) - { - // Reset. - channels[i].end = NULL; - // We are sure that iff, - // there will only be one. - break; - } - } - } -#endif - - // Loop all channels to find oldest SFX. - for (i = 0; (i < NUM_CHANNELS) && (channels[i].end); i++) - { - if (channels[i].starttic < oldest) - { - oldestnum = i; - oldest = channels[i].starttic; - } - } - - // Tales from the cryptic. - // If we found a channel, fine. - // If not, we simply overwrite the first one, 0. - // Probably only happens at startup. - if (i == NUM_CHANNELS) - slot = oldestnum; - else - slot = i; - - channels[slot].end = NULL; - // Okay, in the less recent channel, - // we will handle the new SFX. - // Set pointer to raw data. - channels[slot].data = (Uint8 *)S_sfx[sfxid].data; - channels[slot].samplerate = (channels[slot].data[3]<<8)+channels[slot].data[2]; - channels[slot].data += 8; //Alam: offset of the sound header - - while (FindChannel(handlenums)!=-1) - { - handlenums++; - // Reset current handle number, limited to 0..65535. - if (handlenums == UINT16_MAX) - handlenums = 0; - } - - // Assign current handle number. - // Preserved so sounds could be stopped. - channels[slot].handle = handlenums; - - // Restart steper - channels[slot].stepremainder = 0; - // Should be gametic, I presume. - channels[slot].starttic = gametic; - - I_SetChannelParams(&channels[slot], volume, seperation, step); - - // Preserve sound SFX id, - // e.g. for avoiding duplicates of chainsaw. - channels[slot].id = S_sfx[sfxid].data; - - channels[slot].sfxid = sfxid; - - // Set pointer to end of raw data. - channels[slot].end = channels[slot].data + S_sfx[sfxid].length; - - - // You tell me. - return handlenums; -} - -// -// SFX API -// Note: this was called by S_Init. -// However, whatever they did in the -// old DPMS based DOS version, this -// were simply dummies in the Linux -// version. -// See soundserver initdata(). -// -// Well... To keep compatibility with legacy doom, I have to call this in -// I_InitSound since it is not called in S_Init... (emanne@absysteme.fr) - -static inline void I_SetChannels(void) -{ - // Init internal lookups (raw data, mixing buffer, channels). - // This function sets up internal lookups used during - // the mixing process. - INT32 i; - INT32 j; - - INT32 *steptablemid = steptable + 128; - - if (nosound) - return; - - // This table provides step widths for pitch parameters. - for (i = -128; i < 128; i++) - { - const double po = pow((double)(2.0l), (double)(i / 64.0l)); - steptablemid[i] = (INT32)(po * 65536.0l); - } - - // Generates volume lookup tables - // which also turn the unsigned samples - // into signed samples. - for (i = 0; i < 128; i++) - for (j = 0; j < 256; j++) - { - //From PrDoom - // proff - made this a little bit softer, because with - // full volume the sound clipped badly - vol_lookup[i * 256 + j] = (Sint16)((i * (j - 128) * 256) / 127); - } -} - -void I_SetSfxVolume(UINT8 volume) -{ - INT32 i; - - (void)volume; - //Snd_LockAudio(); - - for (i = 0; i < NUM_CHANNELS; i++) - if (channels[i].end) I_SetChannelParams(&channels[i], channels[i].vol, channels[i].sep, channels[i].realstep); - - //Snd_UnlockAudio(); -} - -void *I_GetSfx(sfxinfo_t *sfx) -{ - if (sfx->lumpnum == LUMPERROR) - sfx->lumpnum = S_GetSfxLumpNum(sfx); -// else if (sfx->lumpnum != S_GetSfxLumpNum(sfx)) -// I_FreeSfx(sfx); - -#ifdef HW3SOUND - if (hws_mode != HWS_DEFAULT_MODE) - return HW3S_GetSfx(sfx); -#endif - - if (sfx->data) - return sfx->data; //Alam: I have it done! - - sfx->length = W_LumpLength(sfx->lumpnum); - - return getsfx(sfx->lumpnum, &sfx->length); - -} - -void I_FreeSfx(sfxinfo_t * sfx) -{ -// if (sfx->lumpnum<0) -// return; - -#ifdef HW3SOUND - if (hws_mode != HWS_DEFAULT_MODE) - { - HW3S_FreeSfx(sfx); - } - else -#endif - { - size_t i; - - for (i = 1; i < NUMSFX; i++) - { - // Alias? Example is the chaingun sound linked to pistol. - if (S_sfx[i].data == sfx->data) - { - if (S_sfx+i != sfx) S_sfx[i].data = NULL; - S_sfx[i].lumpnum = LUMPERROR; - S_sfx[i].length = 0; - } - } - //Snd_LockAudio(); //Alam: too much? - // Loop all channels, check. - for (i = 0; i < NUM_CHANNELS; i++) - { - // Active, and using the same SFX? - if (channels[i].end && channels[i].id == sfx->data) - { - channels[i].end = NULL; // Reset. - } - } - //Snd_UnlockAudio(); //Alam: too much? - Z_Free(sfx->data); - } - sfx->data = NULL; - sfx->lumpnum = LUMPERROR; -} - -// -// Starting a sound means adding it -// to the current list of active sounds -// in the internal channels. -// As the SFX info struct contains -// e.g. a pointer to the raw data, -// it is ignored. -// As our sound handling does not handle -// priority, it is ignored. -// Pitching (that is, increased speed of playback) -// is set, but currently not used by mixing. -// -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) -{ - (void)priority; - (void)pitch; - - if (nosound) - return 0; - - if (S_sfx[id].data == NULL) return -1; - - Snd_LockAudio(); - id = addsfx(id, vol, steptable[pitch], sep); - Snd_UnlockAudio(); - - return id; // Returns a handle (not used). -} - -void I_StopSound(INT32 handle) -{ - // You need the handle returned by StartSound. - // Would be looping all channels, - // tracking down the handle, - // an setting the channel to zero. - INT32 i; - - i = FindChannel(handle); - - if (i != -1) - { - //Snd_LockAudio(); //Alam: too much? - channels[i].end = NULL; - //Snd_UnlockAudio(); //Alam: too much? - channels[i].handle = -1; - channels[i].starttic = 0; - } - -} - -boolean I_SoundIsPlaying(INT32 handle) -{ - boolean isplaying = false; - int chan = FindChannel(handle); - if (chan != -1) - isplaying = (channels[chan].end != NULL); - return isplaying; -} - -FUNCINLINE static ATTRINLINE void I_UpdateStream8S(Uint8 *stream, int len) -{ - // Mix current sound data. - // Data, from raw sound - register Sint16 dr; // Right 8bit stream - register Uint8 sample; // Center 8bit sfx - register Sint16 dl; // Left 8bit stream - - // Pointers in audio stream - Sint8 *rightout = (Sint8 *)stream; // currect right - Sint8 *leftout = rightout + 1;// currect left - const Uint8 step = 2; // Step in stream, left and right, thus two. - - INT32 chan; // Mixing channel index. - - // Determine end of the stream - len /= 2; // not 8bit mono samples, 8bit stereo ones - - if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); - - // Mix sounds into the mixing buffer. - // Loop over len - while (len--) - { - // Reset left/right value. - dl = *leftout; - dr = *rightout; - - // Love thy L2 cache - made this a loop. - // Now more channels could be set at compile time - // as well. Thus loop those channels. - for (chan = 0; chan < NUM_CHANNELS; chan++) - { - // Check channel, if active. - if (channels[chan].end) - { -#if 1 - // Get the raw data from the channel. - sample = channels[chan].data[0]; -#else - // linear filtering from PrDoom - sample = (((Uint32)channels[chan].data[0] *(0x10000 - channels[chan].stepremainder)) - + ((Uint32)channels[chan].data[1]) * (channels[chan].stepremainder))) >> 16; -#endif - // Add left and right part - // for this channel (sound) - // to the current data. - // Adjust volume accordingly. - dl = (Sint16)(dl+(channels[chan].leftvol_lookup[sample]>>8)); - dr = (Sint16)(dr+(channels[chan].rightvol_lookup[sample]>>8)); - // Increment stepage - channels[chan].stepremainder += channels[chan].step; - // Check whether we are done. - if (channels[chan].data + (channels[chan].stepremainder >> 16) >= channels[chan].end) - channels[chan].end = NULL; - else - { - // step to next sample - channels[chan].data += (channels[chan].stepremainder >> 16); - // Limit to LSB??? - channels[chan].stepremainder &= 0xffff; - } - } - } - - // Clamp to range. Left hardware channel. - // Has been char instead of short. - - if (dl > 0x7f) - *leftout = 0x7f; - else if (dl < -0x80) - *leftout = -0x80; - else - *leftout = (Sint8)dl; - - // Same for right hardware channel. - if (dr > 0x7f) - *rightout = 0x7f; - else if (dr < -0x80) - *rightout = -0x80; - else - *rightout = (Sint8)dr; - - // Increment current pointers in stream - leftout += step; - rightout += step; - - } - if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); -} - -FUNCINLINE static ATTRINLINE void I_UpdateStream8M(Uint8 *stream, int len) -{ - // Mix current sound data. - // Data, from raw sound - register Sint16 d; // Mono 8bit stream - register Uint8 sample; // Center 8bit sfx - - // Pointers in audio stream - Sint8 *monoout = (Sint8 *)stream; // currect mono - const Uint8 step = 1; // Step in stream, left and right, thus two. - - INT32 chan; // Mixing channel index. - - // Determine end of the stream - //len /= 1; // not 8bit mono samples, 8bit mono ones? - - if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); - - // Mix sounds into the mixing buffer. - // Loop over len - while (len--) - { - // Reset left/right value. - d = *monoout; - - // Love thy L2 cache - made this a loop. - // Now more channels could be set at compile time - // as well. Thus loop those channels. - for (chan = 0; chan < NUM_CHANNELS; chan++) - { - // Check channel, if active. - if (channels[chan].end) - { -#if 1 - // Get the raw data from the channel. - sample = channels[chan].data[0]; -#else - // linear filtering from PrDoom - sample = (((Uint32)channels[chan].data[0] *(0x10000 - channels[chan].stepremainder)) - + ((Uint32)channels[chan].data[1]) * (channels[chan].stepremainder))) >> 16; -#endif - // Add left and right part - // for this channel (sound) - // to the current data. - // Adjust volume accordingly. - d = (Sint16)(d+((channels[chan].leftvol_lookup[sample] + channels[chan].rightvol_lookup[sample])>>9)); - // Increment stepage - channels[chan].stepremainder += channels[chan].step; - // Check whether we are done. - if (channels[chan].data + (channels[chan].stepremainder >> 16) >= channels[chan].end) - channels[chan].end = NULL; - else - { - // step to next sample - channels[chan].data += (channels[chan].stepremainder >> 16); - // Limit to LSB??? - channels[chan].stepremainder &= 0xffff; - } - } - } - - // Clamp to range. Left hardware channel. - // Has been char instead of short. - - if (d > 0x7f) - *monoout = 0x7f; - else if (d < -0x80) - *monoout = -0x80; - else - *monoout = (Sint8)d; - - // Increment current pointers in stream - monoout += step; - } - if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); -} - -FUNCINLINE static ATTRINLINE void I_UpdateStream16S(Uint8 *stream, int len) -{ - // Mix current sound data. - // Data, from raw sound - register Sint32 dr; // Right 16bit stream - register Uint8 sample; // Center 8bit sfx - register Sint32 dl; // Left 16bit stream - - // Pointers in audio stream - Sint16 *rightout = (Sint16 *)(void *)stream; // currect right - Sint16 *leftout = rightout + 1;// currect left - const Uint8 step = 2; // Step in stream, left and right, thus two. - - INT32 chan; // Mixing channel index. - - // Determine end of the stream - len /= 4; // not 8bit mono samples, 16bit stereo ones - - if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); - - - // Mix sounds into the mixing buffer. - // Loop over len - while (len--) - { - // Reset left/right value. - dl = *leftout; - dr = *rightout; - - // Love thy L2 cache - made this a loop. - // Now more channels could be set at compile time - // as well. Thus loop those channels. - for (chan = 0; chan < NUM_CHANNELS; chan++) - { - // Check channel, if active. - if (channels[chan].end) - { -#if 1 - // Get the raw data from the channel. - sample = channels[chan].data[0]; -#else - // linear filtering from PrDoom - sample = (((Uint32)channels[chan].data[0] *(0x10000 - channels[chan].stepremainder)) - + ((Uint32)channels[chan].data[1]) * (channels[chan].stepremainder))) >> 16; -#endif - // Add left and right part - // for this channel (sound) - // to the current data. - // Adjust volume accordingly. - dl += channels[chan].leftvol_lookup[sample]; - dr += channels[chan].rightvol_lookup[sample]; - // Increment stepage - channels[chan].stepremainder += channels[chan].step; - // Check whether we are done. - if (channels[chan].data + (channels[chan].stepremainder >> 16) >= channels[chan].end) - channels[chan].end = NULL; - else - { - // step to next sample - channels[chan].data += (channels[chan].stepremainder >> 16); - // Limit to LSB??? - channels[chan].stepremainder &= 0xffff; - } - } - } - - // Clamp to range. Left hardware channel. - // Has been char instead of short. - - if (dl > 0x7fff) - *leftout = 0x7fff; - else if (dl < -0x8000) - *leftout = -0x8000; - else - *leftout = (Sint16)dl; - - // Same for right hardware channel. - if (dr > 0x7fff) - *rightout = 0x7fff; - else if (dr < -0x8000) - *rightout = -0x8000; - else - *rightout = (Sint16)dr; - - // Increment current pointers in stream - leftout += step; - rightout += step; - - } - if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); -} - -FUNCINLINE static ATTRINLINE void I_UpdateStream16M(Uint8 *stream, int len) -{ - // Mix current sound data. - // Data, from raw sound - register Sint32 d; // Mono 16bit stream - register Uint8 sample; // Center 8bit sfx - - // Pointers in audio stream - Sint16 *monoout = (Sint16 *)(void *)stream; // currect mono - const Uint8 step = 1; // Step in stream, left and right, thus two. - - INT32 chan; // Mixing channel index. - - // Determine end of the stream - len /= 2; // not 8bit mono samples, 16bit mono ones - - if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); - - - // Mix sounds into the mixing buffer. - // Loop over len - while (len--) - { - // Reset left/right value. - d = *monoout; - - // Love thy L2 cache - made this a loop. - // Now more channels could be set at compile time - // as well. Thus loop those channels. - for (chan = 0; chan < NUM_CHANNELS; chan++) - { - // Check channel, if active. - if (channels[chan].end) - { -#if 1 - // Get the raw data from the channel. - sample = channels[chan].data[0]; -#else - // linear filtering from PrDoom - sample = (((Uint32)channels[chan].data[0] *(0x10000 - channels[chan].stepremainder)) - + ((Uint32)channels[chan].data[1]) * (channels[chan].stepremainder))) >> 16; -#endif - // Add left and right part - // for this channel (sound) - // to the current data. - // Adjust volume accordingly. - d += (channels[chan].leftvol_lookup[sample] + channels[chan].rightvol_lookup[sample])>>1; - // Increment stepage - channels[chan].stepremainder += channels[chan].step; - // Check whether we are done. - if (channels[chan].data + (channels[chan].stepremainder >> 16) >= channels[chan].end) - channels[chan].end = NULL; - else - { - // step to next sample - channels[chan].data += (channels[chan].stepremainder >> 16); - // Limit to LSB??? - channels[chan].stepremainder &= 0xffff; - } - } - } - - // Clamp to range. Left hardware channel. - // Has been char instead of short. - - if (d > 0x7fff) - *monoout = 0x7fff; - else if (d < -0x8000) - *monoout = -0x8000; - else - *monoout = (Sint16)d; - - // Increment current pointers in stream - monoout += step; - } - if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); -} - -#ifdef HAVE_LIBGME -static void I_UpdateSteamGME(Music_Emu *emu, INT16 *stream, int len, UINT8 looping) -{ - #define GME_BUFFER_LEN 44100*2048 - // Mix current sound data. - // Data, from raw sound - register Sint32 da; - - static short gme_buffer[GME_BUFFER_LEN]; // a large buffer for gme - Sint16 *in = gme_buffer; - - do - { - int out = min(GME_BUFFER_LEN, len); - if ( gme_play( emu, len, gme_buffer ) ) { } // ignore error - len -= out; - while (out--) - { - //Left - da = *in; - in++; - da += *stream; - stream++; - //Right - da = *in; - in++; - da += *stream; - stream++; - } - if (gme_track_ended( emu )) - { - if (looping) - gme_seek( emu, 0); - else - break; - } - } while ( len ); - #undef GME_BUFFER_LEN -} -#endif - -static void SDLCALL I_UpdateStream(void *userdata, Uint8 *stream, int len) -{ - if (!sound_started || !userdata) - return; - - memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80 - - if ((audio.channels != 1 && audio.channels != 2) || - (audio.format != AUDIO_S8 && audio.format != AUDIO_S16SYS)) - ; // no function to encode this type of stream - else if (audio.channels == 1 && audio.format == AUDIO_S8) - I_UpdateStream8M(stream, len); - else if (audio.channels == 2 && audio.format == AUDIO_S8) - I_UpdateStream8S(stream, len); - else if (audio.channels == 1 && audio.format == AUDIO_S16SYS) - I_UpdateStream16M(stream, len); - else if (audio.channels == 2 && audio.format == AUDIO_S16SYS) - { - I_UpdateStream16S(stream, len); -#ifdef HAVE_LIBGME - if (userdata) - { - srb2audio_t *sa_userdata = userdata; - if (!sa_userdata->gme_pause) - I_UpdateSteamGME(sa_userdata->gme_emu, (INT16 *)stream, len/4, sa_userdata->gme_loop); - } -#endif - - } -} - -void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch) -{ - // Would be using the handle to identify - // on which channel the sound might be active, - // and resetting the channel parameters. - - INT32 i = FindChannel(handle); - - if (i != -1 && channels[i].end) - { - //Snd_LockAudio(); //Alam: too much? - I_SetChannelParams(&channels[i], vol, sep, steptable[pitch]); - //Snd_UnlockAudio(); //Alam: too much? - } - -} - -#ifdef HW3SOUND - -static void *soundso = NULL; - -static INT32 Init3DSDriver(const char *soName) -{ - if (soName) soundso = hwOpen(soName); -#if defined (_WIN32) && defined (_X86_) && !defined (STATIC3DS) - HW3DS.pfnStartup = hwSym("Startup@8",soundso); - HW3DS.pfnShutdown = hwSym("Shutdown@0",soundso); - HW3DS.pfnAddSfx = hwSym("AddSfx@4",soundso); - HW3DS.pfnAddSource = hwSym("AddSource@8",soundso); - HW3DS.pfnStartSource = hwSym("StartSource@4",soundso); - HW3DS.pfnStopSource = hwSym("StopSource@4",soundso); - HW3DS.pfnGetHW3DSVersion = hwSym("GetHW3DSVersion@0",soundso); - HW3DS.pfnBeginFrameUpdate = hwSym("BeginFrameUpdate@0",soundso); - HW3DS.pfnEndFrameUpdate = hwSym("EndFrameUpdate@0",soundso); - HW3DS.pfnIsPlaying = hwSym("IsPlaying@4",soundso); - HW3DS.pfnUpdateListener = hwSym("UpdateListener@8",soundso); - HW3DS.pfnUpdateSourceParms = hwSym("UpdateSourceParms@12",soundso); - HW3DS.pfnSetCone = hwSym("SetCone@8",soundso); - HW3DS.pfnSetGlobalSfxVolume = hwSym("SetGlobalSfxVolume@4",soundso); - HW3DS.pfnUpdate3DSource = hwSym("Update3DSource@8",soundso); - HW3DS.pfnReloadSource = hwSym("ReloadSource@8",soundso); - HW3DS.pfnKillSource = hwSym("KillSource@4",soundso); - HW3DS.pfnKillSfx = hwSym("KillSfx@4",soundso); - HW3DS.pfnGetHW3DSTitle = hwSym("GetHW3DSTitle@8",soundso); -#else - HW3DS.pfnStartup = hwSym("Startup",soundso); - HW3DS.pfnShutdown = hwSym("Shutdown",soundso); - HW3DS.pfnAddSfx = hwSym("AddSfx",soundso); - HW3DS.pfnAddSource = hwSym("AddSource",soundso); - HW3DS.pfnStartSource = hwSym("StartSource",soundso); - HW3DS.pfnStopSource = hwSym("StopSource",soundso); - HW3DS.pfnGetHW3DSVersion = hwSym("GetHW3DSVersion",soundso); - HW3DS.pfnBeginFrameUpdate = hwSym("BeginFrameUpdate",soundso); - HW3DS.pfnEndFrameUpdate = hwSym("EndFrameUpdate",soundso); - HW3DS.pfnIsPlaying = hwSym("IsPlaying",soundso); - HW3DS.pfnUpdateListener = hwSym("UpdateListener",soundso); - HW3DS.pfnUpdateSourceParms = hwSym("UpdateSourceParms",soundso); - HW3DS.pfnSetCone = hwSym("SetCone",soundso); - HW3DS.pfnSetGlobalSfxVolume = hwSym("SetGlobalSfxVolume",soundso); - HW3DS.pfnUpdate3DSource = hwSym("Update3DSource",soundso); - HW3DS.pfnReloadSource = hwSym("ReloadSource",soundso); - HW3DS.pfnKillSource = hwSym("KillSource",soundso); - HW3DS.pfnKillSfx = hwSym("KillSfx",soundso); - HW3DS.pfnGetHW3DSTitle = hwSym("GetHW3DSTitle",soundso); -#endif - -// if (HW3DS.pfnUpdateListener2 && HW3DS.pfnUpdateListener2 != soundso) - return true; -// else -// return false; -} -#endif - -void I_ShutdownSound(void) -{ - if (nosound || !sound_started) - return; - - CONS_Printf("I_ShutdownSound: "); - -#ifdef HW3SOUND - if (hws_mode != HWS_DEFAULT_MODE) - { - HW3S_Shutdown(); - hwClose(soundso); - return; - } -#endif - - if (nomidimusic && nodigimusic) - SDL_CloseAudio(); - CONS_Printf("%s", M_GetText("shut down\n")); - sound_started = false; - SDL_QuitSubSystem(SDL_INIT_AUDIO); - if (Snd_Mutex) - SDL_DestroyMutex(Snd_Mutex); - Snd_Mutex = NULL; -} - -void I_UpdateSound(void) -{ -} - -void I_StartupSound(void) -{ -#ifdef HW3SOUND - const char *sdrv_name = NULL; -#endif -#ifndef HAVE_MIXER - nomidimusic = nodigimusic = true; -#endif -#ifdef DC - //nosound = true; -#ifdef HAVE_MIXER - nomidimusic = true; - nodigimusic = true; -#endif -#endif - - memset(channels, 0, sizeof (channels)); //Alam: Clean it - - audio.format = AUDIO_S16SYS; - audio.channels = 2; - audio.callback = I_UpdateStream; - audio.userdata = &localdata; - - if (dedicated) - { - nosound = nomidimusic = nodigimusic = true; - return; - } - - // Configure sound device - CONS_Printf("I_StartupSound:\n"); - - // Open the audio device - if (M_CheckParm ("-freq") && M_IsNextParm()) - { - audio.freq = atoi(M_GetNextParm()); - if (!audio.freq) audio.freq = cv_samplerate.value; - audio.samples = (Uint16)((samplecount/2)*(INT32)(audio.freq/11025)); //Alam: to keep it around the same XX ms - CONS_Printf (M_GetText(" requested frequency of %d hz\n"), audio.freq); - } - else - { - audio.samples = samplecount; - audio.freq = cv_samplerate.value; - } - - if (M_CheckParm ("-mono")) - { - audio.channels = 1; - audio.samples /= 2; - } - -#if defined (_PSP) && defined (HAVE_MIXER) // Bug in PSP's SDL_OpenAudio, can not open twice - I_SetChannels(); - sound_started = true; - Snd_Mutex = SDL_CreateMutex(); -#else - if (nosound) -#endif - return; - -#ifdef HW3SOUND -#ifdef STATIC3DS - if (M_CheckParm("-3dsound") || M_CheckParm("-ds3d")) - { - hws_mode = HWS_OPENAL; - } -#elif defined (_WIN32) - if (M_CheckParm("-ds3d")) - { - hws_mode = HWS_DS3D; - sdrv_name = "s_ds3d.dll"; - } - else if (M_CheckParm("-fmod3d")) - { - hws_mode = HWS_FMOD3D; - sdrv_name = "s_fmod.dll"; - } - else if (M_CheckParm("-openal")) - { - hws_mode = HWS_OPENAL; - sdrv_name = "s_openal.dll"; - } -#else - if (M_CheckParm("-fmod3d")) - { - hws_mode = HWS_FMOD3D; - sdrv_name = "./s_fmod.so"; - } - else if (M_CheckParm("-openal")) - { - hws_mode = HWS_OPENAL; - sdrv_name = "./s_openal.so"; - } -#endif - else if (M_CheckParm("-sounddriver") && M_IsNextParm()) - { - hws_mode = HWS_OTHER; - sdrv_name = M_GetNextParm(); - } - if (hws_mode != HWS_DEFAULT_MODE) - { - if (Init3DSDriver(sdrv_name)) - { - snddev_t snddev; - - //nosound = true; - //I_AddExitFunc(I_ShutdownSound); - snddev.bps = 16; - snddev.sample_rate = audio.freq; - snddev.numsfxs = NUMSFX; -#if defined (_WIN32) && !defined (_XBOX) - snddev.cooplevel = 0x00000002; - snddev.hWnd = vid.WndParent; -#endif - if (HW3S_Init(I_Error, &snddev)) - { - audio.userdata = NULL; - CONS_Printf("%s", M_GetText(" Using 3D sound driver\n")); - return; - } - CONS_Printf("%s", M_GetText(" Failed loading 3D sound driver\n")); - // Falls back to default sound system - HW3S_Shutdown(); - hwClose(soundso); - } - CONS_Printf("%s", M_GetText(" Failed loading 3D sound driver\n")); - hws_mode = HWS_DEFAULT_MODE; - } -#endif - if (!musicStarted && SDL_OpenAudio(&audio, &audio) < 0) - { - CONS_Printf("%s", M_GetText(" couldn't open audio with desired format\n")); - nosound = true; - return; - } - else - { - //char ad[100]; - //CONS_Printf(M_GetText(" Starting up with audio driver : %s\n"), SDL_AudioDriverName(ad, (int)sizeof ad)); - } - samplecount = audio.samples; - CV_SetValue(&cv_samplerate, audio.freq); - CONS_Printf(M_GetText(" configured audio device with %d samples/slice at %ikhz(%dms buffer)\n"), samplecount, audio.freq/1000, (INT32) (((float)audio.samples * 1000.0f) / audio.freq)); - // Finished initialization. - CONS_Printf("%s", M_GetText(" Sound module ready\n")); - //[segabor] - if (!musicStarted) SDL_PauseAudio(0); - //Mix_Pause(0); - I_SetChannels(); - sound_started = true; - Snd_Mutex = SDL_CreateMutex(); -} - -// -// MUSIC API. -// - -void I_ShutdownMIDIMusic(void) -{ - nomidimusic = false; - if (nodigimusic) I_ShutdownMusic(); -} - -#ifdef HAVE_LIBGME -static void I_ShutdownGMEMusic(void) -{ - Snd_LockAudio(); - if (localdata.gme_emu) - gme_delete(localdata.gme_emu); - localdata.gme_emu = NULL; - Snd_UnlockAudio(); -} -#endif - -void I_ShutdownDigMusic(void) -{ - nodigimusic = false; - if (nomidimusic) I_ShutdownMusic(); -} - -#ifdef HAVE_MIXER -static boolean LoadSong(void *data, size_t lumplength, size_t selectpos) -{ - FILE *midfile; - const char *tempname; -#ifdef USE_RWOPS - if (canuseRW) - { - SDL_RWops *SDLRW; - void *olddata = Smidi[selectpos]; //quick shortcut to set - - Z_Free(olddata); //free old memory - Smidi[selectpos] = NULL; - - if (!data) - return olddata != NULL; //was there old data? - - SDLRW = SDL_RWFromConstMem(data, (int)lumplength); //new RWops from Z_zone - if (!SDLRW) //ERROR while making RWops! - { - CONS_Printf(M_GetText("Couldn't load music lump: %s\n"), SDL_GetError()); - Z_Free(data); - return false; - } - - music[selectpos] = Mix_LoadMUS_RW(SDLRW); // new Mix_Chuck from RWops - if (music[selectpos]) - Smidi[selectpos] = data; //all done - else //ERROR while making Mix_Chuck - { - CONS_Printf(M_GetText("Couldn't load music data: %s\n"), Mix_GetError()); - Z_Free(data); - SDL_RWclose(SDLRW); - Smidi[selectpos] = NULL; - } - return true; - } -#endif - tempname = va("%s/%s", MIDI_PATH, fmidi[selectpos]); - - if (!data) - { - if (FIL_FileExists(tempname)) - return unlink(tempname)+1; -#ifdef MIDI_PATH2 - else if (FIL_FileExists(tempname = va("%s/%s", MIDI_PATH2, fmidi[selectpos]))) - return unlink(tempname)+1; -#endif - else - return false; - } - - midfile = fopen(tempname, "wb"); - -#ifdef MIDI_PATH2 - if (!midfile) - { - tempname = va("%s/%s", MIDI_PATH2, fmidi[selectpos]); - midfile = fopen(tempname, "wb"); - } -#endif - - if (!midfile) - { - CONS_Printf(M_GetText("Couldn't open file %s to write music in\n"), tempname); - Z_Free(data); - return false; - } - - if (fwrite(data, lumplength, 1, midfile) == 0) - { - CONS_Printf(M_GetText("Couldn't write music into file %s because %s\n"), tempname, strerror(ferror(midfile))); - Z_Free(data); - fclose(midfile); - return false; - } - - fclose(midfile); - - Z_Free(data); - - music[selectpos] = Mix_LoadMUS(tempname); - if (!music[selectpos]) //ERROR while making Mix_Chuck - { - CONS_Printf(M_GetText("Couldn't load music file %s: %s\n"), tempname, Mix_GetError()); - return false; - } - return true; -} -#endif - - -void I_ShutdownMusic(void) -{ -#ifdef HAVE_MIXER - if ((nomidimusic && nodigimusic) || !musicStarted) - return; - - CONS_Printf("%s", M_GetText("I_ShutdownMusic: ")); - - I_UnRegisterSong(0); - I_StopDigSong(); - Mix_CloseAudio(); -#ifdef MIX_INIT - Mix_Quit(); -#endif - CONS_Printf("%s", M_GetText("shut down\n")); - musicStarted = SDL_FALSE; - if (Msc_Mutex) - SDL_DestroyMutex(Msc_Mutex); - Msc_Mutex = NULL; -#endif -} - -void I_InitMIDIMusic(void) -{ - if (nodigimusic) I_InitMusic(); -} - -void I_InitDigMusic(void) -{ - if (nomidimusic) I_InitMusic(); -} - -void I_InitMusic(void) -{ -#ifdef HAVE_MIXER - char ad[100]; - SDL_version MIXcompiled; - const SDL_version *MIXlinked; -#ifdef MIXER_INIT - const int mixstart = MIX_INIT_OGG; - int mixflags; -#endif -#endif -#ifdef HAVE_LIBGME - I_AddExitFunc(I_ShutdownGMEMusic); -#endif - - if ((nomidimusic && nodigimusic) || dedicated) - return; - -#ifdef HAVE_MIXER - MIX_VERSION(&MIXcompiled) - MIXlinked = Mix_Linked_Version(); - I_OutputMsg("Compiled for SDL_mixer version: %d.%d.%d\n", - MIXcompiled.major, MIXcompiled.minor, MIXcompiled.patch); -#ifdef MIXER_POS -#ifndef _WII - if (MIXlinked->major == 1 && MIXlinked->minor == 2 && MIXlinked->patch < 7) -#endif - canlooping = SDL_FALSE; -#endif -#ifdef USE_RWOPS - if (M_CheckParm("-noRW")) - canuseRW = SDL_FALSE; -#endif - I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n", - MIXlinked->major, MIXlinked->minor, MIXlinked->patch); -#if !(defined (DC) || defined (PSP) || defined(GP2X) || defined (WII)) - if (audio.freq < 44100 && !M_CheckParm ("-freq")) //I want atleast 44Khz - { - audio.samples = (Uint16)(audio.samples*(INT32)(44100/audio.freq)); - audio.freq = 44100; //Alam: to keep it around the same XX ms - } -#endif - - if (sound_started -#ifdef HW3SOUND - && hws_mode == HWS_DEFAULT_MODE -#endif - ) - { - I_OutputMsg("Temp Shutdown of SDL Audio System"); - SDL_CloseAudio(); - I_OutputMsg(" Done\n"); - } - - CONS_Printf("%s", M_GetText("I_InitMusic:")); - -#ifdef MIXER_INIT - mixflags = Mix_Init(mixstart); - if ((mixstart & MIX_INIT_FLAC) != (mixflags & MIX_INIT_FLAC)) - { - CONS_Printf("%s", M_GetText(" Unable to load FLAC support\n")); - } - if ((mixstart & MIX_INIT_MOD ) != (mixflags & MIX_INIT_MOD )) - { - CONS_Printf("%s", M_GetText(" Unable to load MOD support\n")); - } - if ((mixstart & MIX_INIT_MP3 ) != (mixflags & MIX_INIT_MP3 )) - { - CONS_Printf("%s", M_GetText(" Unable to load MP3 support\n")); - } - if ((mixstart & MIX_INIT_OGG ) != (mixflags & MIX_INIT_OGG )) - { - CONS_Printf("%s", M_GetText(" Unable to load OGG support\n")); - } -#endif - - if (Mix_OpenAudio(audio.freq, audio.format, audio.channels, audio.samples) < 0) //open_music(&audio) - { - CONS_Printf(M_GetText(" Unable to open music: %s\n"), Mix_GetError()); - nomidimusic = nodigimusic = true; - if (sound_started -#ifdef HW3SOUND - && hws_mode == HWS_DEFAULT_MODE -#endif - ) - { - if (SDL_OpenAudio(&audio, NULL) < 0) //retry - { - CONS_Printf("%s", M_GetText(" couldn't open audio with desired format\n")); - nosound = true; - sound_started = false; - } - else - { - CONS_Printf(M_GetText(" Starting with audio driver : %s\n"), SDL_AudioDriverName(ad, (int)sizeof ad)); - } - } - return; - } - else - CONS_Printf(M_GetText(" Starting up with audio driver : %s with SDL_Mixer\n"), SDL_AudioDriverName(ad, (int)sizeof ad)); - - samplecount = audio.samples; - CV_SetValue(&cv_samplerate, audio.freq); - if (sound_started -#ifdef HW3SOUND - && hws_mode == HWS_DEFAULT_MODE -#endif - ) - I_OutputMsg(" Reconfigured SDL Audio System"); - else I_OutputMsg(" Configured SDL_Mixer System"); - I_OutputMsg(" with %d samples/slice at %ikhz(%dms buffer)\n", samplecount, audio.freq/1000, (INT32) ((audio.samples * 1000.0f) / audio.freq)); - Mix_SetPostMix(audio.callback, audio.userdata); // after mixing music, add sound effects - Mix_Resume(-1); - CONS_Printf("%s", M_GetText("Music initialized\n")); - musicStarted = SDL_TRUE; - Msc_Mutex = SDL_CreateMutex(); -#endif -} - -boolean I_PlaySong(INT32 handle, boolean looping) -{ - (void)handle; -#ifdef HAVE_MIXER - if (nomidimusic || !musicStarted || !music[handle]) - return false; - -#ifdef MIXER_POS - if (canlooping) - Mix_HookMusicFinished(NULL); -#endif - - if (Mix_FadeInMusic(music[handle], looping ? -1 : 0, MIDIfade) == -1) - CONS_Printf(M_GetText("Couldn't play song because %s\n"), Mix_GetError()); - else - { - Mix_VolumeMusic(musicvol); - return true; - } -#else - (void)looping; -#endif - return false; -} - -static void I_PauseGME(void) -{ -#ifdef HAVE_LIBGME - localdata.gme_pause = true; -#endif -} - -void I_PauseSong(INT32 handle) -{ - (void)handle; - I_PauseGME(); -#ifdef HAVE_MIXER - if ((nomidimusic && nodigimusic) || !musicStarted) - return; - - Mix_PauseMusic(); - //I_StopSong(handle); -#endif -} - -static void I_ResumeGME(void) -{ -#ifdef HAVE_LIBGME - localdata.gme_pause = false; -#endif -} - -void I_ResumeSong(INT32 handle) -{ - (void)handle; - I_ResumeGME(); -#ifdef HAVE_MIXER - if ((nomidimusic && nodigimusic) || !musicStarted) - return; - - Mix_VolumeMusic(musicvol); - Mix_ResumeMusic(); - //I_PlaySong(handle, true); -#endif -} - -void I_StopSong(INT32 handle) -{ - (void)handle; -#ifdef HAVE_MIXER - if (nomidimusic || !musicStarted) - return; - Mix_FadeOutMusic(MIDIfade); -#endif -} - -void I_UnRegisterSong(INT32 handle) -{ -#ifdef HAVE_MIXER - - if (nomidimusic || !musicStarted) - return; - - Mix_HaltMusic(); - while (Mix_PlayingMusic()) - ; - - if (music[handle]) - Mix_FreeMusic(music[handle]); - music[handle] = NULL; - LoadSong(NULL, 0, handle); -#else - (void)handle; -#endif -} - -INT32 I_RegisterSong(void *data, size_t len) -{ -#ifdef HAVE_MIXER - if (nomidimusic || !musicStarted) - return false; - - if (!LoadSong(data, len, 0)) - return false; - - if (music[0]) - return true; - - CONS_Printf(M_GetText("Couldn't load MIDI: %s\n"), Mix_GetError()); -#else - (void)len; - (void)data; -#endif - return false; -} - -void I_SetMIDIMusicVolume(UINT8 volume) -{ -#ifdef HAVE_MIXER - if ((nomidimusic && nodigimusic) || !musicStarted) - return; - - if (Msc_Mutex) SDL_LockMutex(Msc_Mutex); - musicvol = volume * 2; - if (Msc_Mutex) SDL_UnlockMutex(Msc_Mutex); - Mix_VolumeMusic(musicvol); -#else - (void)volume; -#endif -} - -#ifdef HAVE_LIBGME -static void I_CleanupGME(void *userdata) -{ - Z_Free(userdata); -} -#endif - -static boolean I_StartGMESong(const char *musicname, boolean looping) -{ -#ifdef HAVE_LIBGME - XBOXSTATIC char filename[9]; - void *data; - lumpnum_t lumpnum; - size_t lumplength; - Music_Emu *emu; - const char* gme_err; - - Snd_LockAudio(); - if (localdata.gme_emu) - gme_delete(localdata.gme_emu); - localdata.gme_emu = NULL; - Snd_UnlockAudio(); - - snprintf(filename, sizeof filename, "o_%s", musicname); - - lumpnum = W_CheckNumForName(filename); - - if (lumpnum == LUMPERROR) - { - return false; // No music found. Oh well! - } - else - lumplength = W_LumpLength(lumpnum); - - data = W_CacheLumpNum(lumpnum, PU_MUSIC); - - gme_err = gme_open_data(data, (long)lumplength, &emu, audio.freq); - if (gme_err != NULL) { - //I_OutputMsg("I_StartGMESong: error %s\n",gme_err); - return false; - } - gme_set_user_data(emu, data); - gme_set_user_cleanup(emu, I_CleanupGME); - gme_start_track(emu, 0); -#ifdef HAVE_MIXER - gme_set_fade(emu, Digfade); -#endif - - Snd_LockAudio(); - localdata.gme_emu = emu; - localdata.gme_pause = false; - localdata.gme_loop = (UINT8)looping; - Snd_UnlockAudio(); - - return true; -#else - (void)musicname; - (void)looping; -#endif - return false; -} - -boolean I_StartDigSong(const char *musicname, boolean looping) -{ -#ifdef HAVE_MIXER - XBOXSTATIC char filename[9]; - void *data; - lumpnum_t lumpnum; - size_t lumplength; -#endif - - if(I_StartGMESong(musicname, looping)) - return true; - -#ifdef HAVE_MIXER - if (nodigimusic) - return false; - - snprintf(filename, sizeof filename, "o_%s", musicname); - - lumpnum = W_CheckNumForName(filename); - - I_StopDigSong(); - - if (lumpnum == LUMPERROR) - { - // Alam_GBC: like in win32/win_snd.c: Graue 02-29-2004: don't worry about missing music, there might still be a MIDI - //I_OutputMsg("Music lump %s not found!\n", filename); - return false; // No music found. Oh well! - } - else - lumplength = W_LumpLength(lumpnum); - - data = W_CacheLumpNum(lumpnum, PU_MUSIC); - - if (Msc_Mutex) SDL_LockMutex(Msc_Mutex); - -#ifdef MIXER_POS - if (canlooping && (loopingDig = looping) == SDL_TRUE && strcmp(data, "OggS") == 0) - looping = false; // Only on looping Ogg files, will we will do our own looping - - // Scan the Ogg Vorbis file for the COMMENT= field for a custom - // loop point - if (!looping && loopingDig) - { - size_t scan; - const char *dataum = data; - XBOXSTATIC char looplength[64]; - UINT32 loopstart = 0; - UINT8 newcount = 0; - - Mix_HookMusicFinished(I_FinishMusic); - - for (scan = 0; scan < lumplength; scan++) - { - if (*dataum++ == 'C'){ - if (*dataum++ == 'O'){ - if (*dataum++ == 'M'){ - if (*dataum++ == 'M'){ - if (*dataum++ == 'E'){ - if (*dataum++ == 'N'){ - if (*dataum++ == 'T'){ - if (*dataum++ == '='){ - if (*dataum++ == 'L'){ - if (*dataum++ == 'O'){ - if (*dataum++ == 'O'){ - if (*dataum++ == 'P'){ - if (*dataum++ == 'P'){ - if (*dataum++ == 'O'){ - if (*dataum++ == 'I'){ - if (*dataum++ == 'N'){ - if (*dataum++ == 'T'){ - if (*dataum++ == '=') - { - - while (*dataum != 1 && newcount != 63) - looplength[newcount++] = *dataum++; - - looplength[newcount] = '\0'; - - loopstart = atoi(looplength); - - } - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - else - dataum--;} - } - - if (loopstart > 0) - { - loopstartDig = (double)((44.1l+loopstart) / 44100.0l); //8 PCM chucks off and PCM to secs -//#ifdef GP2X//#ifdef PARANOIA - //I_OutputMsg("I_StartDigSong: setting looping point to %ul PCMs(%f seconds)\n", loopstart, loopstartDig); -//#endif - } - else - { - looping = true; // loopingDig true, but couldn't find start loop point - } - } - else - loopstartDig = 0.0l; -#else - if (looping && strcmp(data, "OggS") == 0) - I_OutputMsg("I_StartDigSong: SRB2 was not compiled with looping music support(no Mix_FadeInMusicPos)\n"); -#endif - - if (!LoadSong(data, lumplength, 1)) - { - if (Msc_Mutex) SDL_UnlockMutex(Msc_Mutex); - return false; - } - - // Note: LoadSong() frees the data. Let's make sure - // we don't try to use the data again. - data = NULL; - - if (Mix_FadeInMusic(music[1], looping ? -1 : 0, Digfade) == -1) - { - if (Msc_Mutex) SDL_UnlockMutex(Msc_Mutex); - I_OutputMsg("I_StartDigSong: Couldn't play song %s because %s\n", musicname, Mix_GetError()); - return false; - } - Mix_VolumeMusic(musicvol); - - if (Msc_Mutex) SDL_UnlockMutex(Msc_Mutex); - return true; -#else - (void)looping; - (void)musicname; - return false; -#endif -} - -static void I_StopGME(void) -{ -#ifdef HAVE_LIBGME - Snd_LockAudio(); - gme_seek(localdata.gme_emu, 0); - Snd_UnlockAudio(); -#endif -} - -void I_StopDigSong(void) -{ - I_StopGME(); -#ifdef HAVE_MIXER - if (nodigimusic) - return; - -#ifdef MIXER_POS - if (canlooping) - Mix_HookMusicFinished(NULL); -#endif - - Mix_HaltMusic(); - while (Mix_PlayingMusic()) - ; - - if (music[1]) - Mix_FreeMusic(music[1]); - music[1] = NULL; - LoadSong(NULL, 0, 1); -#endif -} - -void I_SetDigMusicVolume(UINT8 volume) -{ - I_SetMIDIMusicVolume(volume); -} - -boolean I_SetSongSpeed(float speed) -{ - - (void)speed; - return false; -} - -boolean I_SetSongTrack(int track) -{ - (void)track; - return false; -} - -#ifdef MIXER_POS -static void SDLCALL I_FinishMusic(void) -{ - if (!music[1]) - return; - else if (Msc_Mutex) SDL_LockMutex(Msc_Mutex); -// I_OutputMsg("I_FinishMusic: Loopping song to %g seconds\n", loopstartDig); - - if (Mix_FadeInMusicPos(music[1], loopstartDig ? 0 : -1, Digfade, loopstartDig) == 0) - Mix_VolumeMusic(musicvol); - else - I_OutputMsg("I_FinishMusic: Couldn't loop song because %s\n", Mix_GetError()); - - if (Msc_Mutex) SDL_UnlockMutex(Msc_Mutex); -} -#endif -#endif //HAVE_SDL diff --git a/src/sdl2/sdlmain.h b/src/sdl2/sdlmain.h deleted file mode 100644 index af4e48f7..00000000 --- a/src/sdl2/sdlmain.h +++ /dev/null @@ -1,70 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 2006 by Sonic Team Jr. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief System specific interface stuff. - -#ifndef __sdlmain__ -#define __sdlmain__ - -extern SDL_bool consolevent; -extern SDL_bool framebuffer; - -#include "../m_fixed.h" - -// SDL2 stub macro -#define SDL2STUB(name) CONS_Printf("SDL2: stubbed: %s:%d\n", __func__, __LINE__) - -/** \brief The JoyInfo_s struct - - info about joystick -*/ -typedef struct SDLJoyInfo_s -{ - /// Joystick handle - SDL_Joystick *dev; - /// number of old joystick - int oldjoy; - /// number of axies - int axises; - /// scale of axises - INT32 scale; - /// number of buttons - int buttons; - /// number of hats - int hats; - /// number of balls - int balls; - -} SDLJoyInfo_t; - -/** \brief SDL info about joystick 1 -*/ -extern SDLJoyInfo_t JoyInfo; - -/** \brief joystick axis deadzone -*/ -#define SDL_JDEADZONE 153 -#undef SDL_JDEADZONE - -/** \brief SDL inof about joystick 2 -*/ -extern SDLJoyInfo_t JoyInfo2; - -void I_GetConsoleEvents(void); - -void SDLforceUngrabMouse(void); - -#endif diff --git a/src/sdl2/srb2.ttf b/src/sdl2/srb2.ttf deleted file mode 100644 index 53f4c6a2..00000000 Binary files a/src/sdl2/srb2.ttf and /dev/null differ