diff options
author | Jan Cholasta | 2016-02-24 22:27:42 +0100 |
---|---|---|
committer | Jan Cholasta | 2016-03-03 07:38:52 +0100 |
commit | e304d0c7d2ef131ccedfe3e26d9fa054e0dd5fa3 (patch) | |
tree | bf7ace73c0af55a818fa0f96b27ed3e92b0cea9a | |
parent | 7d6429d31f54f53fd47c60141602239811ee5093 (diff) | |
download | aur-e304d0c7d2ef131ccedfe3e26d9fa054e0dd5fa3.tar.gz |
Update to 2.1.1
-rw-r--r-- | .SRCINFO | 60 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | 0001-Mark-stack-as-not-executable-in-assembler-sources.patch | 116 | ||||
-rw-r--r-- | 0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch | 24 | ||||
-rw-r--r-- | PKGBUILD | 212 | ||||
-rw-r--r-- | config-update-fix.patch | 12 | ||||
-rw-r--r-- | desktop.template (renamed from gzdoom.desktop) | 8 | ||||
-rw-r--r-- | doom-share-dir.patch | 11 | ||||
-rw-r--r-- | git-276ca5b7.patch | 106 | ||||
-rw-r--r-- | git-37321d1.patch | 182 | ||||
-rw-r--r-- | git-3a477f69.patch | 52 | ||||
-rw-r--r-- | git-c915049.patch | 1125 | ||||
-rw-r--r-- | git-cab509c.patch | 143 | ||||
-rw-r--r-- | git-fb3bf0e.patch | 25 | ||||
-rw-r--r-- | gitinfo.h | 8 | ||||
-rw-r--r-- | install | 16 | ||||
-rw-r--r-- | stack-noexec.patch | 93 |
17 files changed, 334 insertions, 1861 deletions
@@ -1,22 +1,32 @@ pkgbase = gzdoom - pkgdesc = Doom source port based on ZDoom with an OpenGL renderer. - pkgver = 2.0.05 - pkgrel = 2 - url = http://www.osnanet.de/c.oelckers/gzdoom/ + pkgdesc = Advanced Doom source port with OpenGL support + pkgver = 2.1.1 + pkgrel = 1 + url = http://www.zdoom.org/ + install = install arch = i686 arch = x86_64 - license = custom - makedepends = nasm + license = BSD + license = custom:BUILD + license = custom:doom + license = custom:dumb + license = LGPL makedepends = cmake + makedepends = desktop-file-utils + makedepends = git makedepends = imagemagick - makedepends = mesa + makedepends = xdg-utils depends = fluidsynth - depends = fmodex4.26.36 - depends = glew + depends = fmodex=4.26.36 depends = gtk2 depends = gxmessage + depends = libgl + depends = libgme + depends = libsndfile + depends = mpg123 + depends = openal depends = sdl2 - optdepends = blasphemer: Blasphemer (free Heretic) game data + optdepends = blasphemer-wad: Blasphemer (free Heretic) game data optdepends = chexquest3-wad: Chex Quest 3 game data optdepends = doom1-wad: Doom shareware game data optdepends = freedoom: FreeDoom game data @@ -25,27 +35,17 @@ pkgbase = gzdoom optdepends = heretic1-wad: Heretic shareware game data optdepends = hexen1-wad: Hexen demo game data optdepends = strife0-wad: Strife shareware game data + optdepends = square1-wad: The Adventures of Square, Episode 1 game data optdepends = urbanbrawl-wad: Urban Brawl: Action Doom 2 game data - source = https://github.com/coelckers/gzdoom/archive/g2.0.05.tar.gz - source = gitinfo.h - source = git-c915049.patch - source = git-37321d1.patch - source = git-cab509c.patch - source = git-fb3bf0e.patch - source = config-update-fix.patch - source = doom-share-dir.patch - source = stack-noexec.patch - source = gzdoom.desktop - sha256sums = 7d03f13fad52ff58944283dff566a4622cfeb2e8680e1a529a72ac2a16191203 - sha256sums = 6a8721bead8b4f080ec7ca4a10dbcd628e96f072e31a7c295f1689bf0aead596 - sha256sums = 121d25ee4bbcc13cceb0f51559f126551d704523ba63736baa4624502b26cd14 - sha256sums = 48562c7a6110b19cdd4d795b5d28b5445243831533269f8bb25cc19ba67333ff - sha256sums = 5150353839bc653282720b8e434b09930b2747d91115afdb1eda32daa6162f59 - sha256sums = acb5a37bff36f866345c68b8b512bc3bb4c549d347020ea8e1f0c52b271049bc - sha256sums = 7c68a97e95987117093552b5b0628db7e0f19e8ffa2c1919eaaa7b84d973e0ea - sha256sums = 0b22552e0550a01cf6c652804aff6a7157471740630a9c7158e4ee709bc24b80 - sha256sums = cd13c6582fa1eb09ccba377f4593d3c552e97e07d231911e152e5dd5395b3529 - sha256sums = 2a0b837ddc423d3a6be50f60735c55ee27cd26f58c42540b44aab395030b9cc4 + source = gzdoom::git://github.com/coelckers/gzdoom.git#tag=g2.1.1 + source = desktop.template + source = 0001-Mark-stack-as-not-executable-in-assembler-sources.patch + source = 0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch + sha256sums = SKIP + sha256sums = f2c58925238fe0d01e630527c8c4431681ccaec2d763ba075429b747d1a98a8c + sha256sums = 695a17860f7f71789f085da02022f9926a098b570c4672c6c9bf23556caceb72 + sha256sums = 23ded6a031724252d4ba442dabd4c79dcbec053594adc9fd6a91e8871ce69f85 + makedepends_i686 = nasm pkgname = gzdoom diff --git a/.gitignore b/.gitignore index 5642e2f2619b..7bb10554e78c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +gzdoom + /*.tar.gz /*.tar.bz2 /*.tar.xz diff --git a/0001-Mark-stack-as-not-executable-in-assembler-sources.patch b/0001-Mark-stack-as-not-executable-in-assembler-sources.patch new file mode 100644 index 000000000000..a43289319aa8 --- /dev/null +++ b/0001-Mark-stack-as-not-executable-in-assembler-sources.patch @@ -0,0 +1,116 @@ +From e3c21e9833c878e7edb60212dbf1f2fd03393fa5 Mon Sep 17 00:00:00 2001 +From: Jan Cholasta <grubber@grubber.cz> +Date: Thu, 18 Feb 2016 10:56:03 +0100 +Subject: [PATCH] Mark stack as not executable in assembler sources + +--- + src/asm_ia32/a.asm | 10 ++++++++++ + src/asm_ia32/misc.asm | 10 ++++++++++ + src/asm_ia32/tmap.asm | 10 ++++++++++ + src/asm_ia32/tmap2.asm | 10 ++++++++++ + src/asm_ia32/tmap3.asm | 10 ++++++++++ + src/asm_x86_64/tmap3.s | 1 + + 6 files changed, 51 insertions(+) + +diff --git a/src/asm_ia32/a.asm b/src/asm_ia32/a.asm +index b4bc529..bbde26b 100644 +--- a/src/asm_ia32/a.asm ++++ b/src/asm_ia32/a.asm +@@ -810,3 +810,13 @@ align 16 + GLOBAL _rtext_a_end
+ _rtext_a_end:
+ %endif
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+diff --git a/src/asm_ia32/misc.asm b/src/asm_ia32/misc.asm +index 69e7238..ddd94ec 100644 +--- a/src/asm_ia32/misc.asm ++++ b/src/asm_ia32/misc.asm +@@ -198,3 +198,13 @@ BestColor_MMX: + pop ebx
+ emms
+ ret
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+diff --git a/src/asm_ia32/tmap.asm b/src/asm_ia32/tmap.asm +index 00e6333..539d74d 100644 +--- a/src/asm_ia32/tmap.asm ++++ b/src/asm_ia32/tmap.asm +@@ -1891,3 +1891,13 @@ _ASM_PatchPitch: + selfmod rtext_start, rtext_end
+ call setpitch3
+ jmp setvlinebpl_
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+diff --git a/src/asm_ia32/tmap2.asm b/src/asm_ia32/tmap2.asm +index e1f1668..39603fb 100644 +--- a/src/asm_ia32/tmap2.asm ++++ b/src/asm_ia32/tmap2.asm +@@ -638,3 +638,13 @@ rtext_end: + GLOBAL _rtext_tmap2_end
+ _rtext_tmap2_end:
+ %endif
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+diff --git a/src/asm_ia32/tmap3.asm b/src/asm_ia32/tmap3.asm +index 3161ff3..39233eb 100644 +--- a/src/asm_ia32/tmap3.asm ++++ b/src/asm_ia32/tmap3.asm +@@ -342,3 +342,13 @@ shift12: shr ecx,16 + GLOBAL _rtext_tmap3_end
+ _rtext_tmap3_end:
+ %endif
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+diff --git a/src/asm_x86_64/tmap3.s b/src/asm_x86_64/tmap3.s +index 867d11c..e27f05f 100644 +--- a/src/asm_x86_64/tmap3.s ++++ b/src/asm_x86_64/tmap3.s +@@ -139,3 +139,4 @@ vltepilog: + .align 16 + + ++ .section .note.GNU-stack,"",@progbits +-- +2.7.1 + diff --git a/0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch b/0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch new file mode 100644 index 000000000000..fdd3810b19bc --- /dev/null +++ b/0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch @@ -0,0 +1,24 @@ +From 8323d748f52fe27ff1ba9fdc615ad23ff267db10 Mon Sep 17 00:00:00 2001 +From: Jan Cholasta <grubber@grubber.cz> +Date: Thu, 18 Feb 2016 13:34:59 +0100 +Subject: [PATCH] Include SHARE_DIR in IWADSearch.Directories + +--- + src/gameconfigfile.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp +index 3d396d9..c258b2d 100644 +--- a/src/gameconfigfile.cpp ++++ b/src/gameconfigfile.cpp +@@ -133,6 +133,7 @@ FGameConfigFile::FGameConfigFile () + SetValueForKey ("Path", "$PROGDIR", true);
+ #else
+ SetValueForKey ("Path", "~/" GAME_DIR, true);
++ SetValueForKey ("Path", SHARE_DIR, true);
+ // Arch Linux likes them in /usr/share/doom
+ // Debian likes them in /usr/share/games/doom
+ // I assume other distributions don't do anything radically different
+-- +2.7.1 + @@ -1,16 +1,45 @@ # Maintainer: Jan Cholasta <grubber at grubber cz> # Contributor: Christoph Zeiler <rabyte*gmail> -pkgname=gzdoom -pkgver=2.0.05 -pkgrel=2 -pkgdesc="Doom source port based on ZDoom with an OpenGL renderer." +# Build with the recommended fmodex version: +_fmodex=4.26.36 +# Build with the currently installed fmodex version: +#_fmodex=$(LC_ALL=C pacman -Q fmodex | grep -Po '(?<= ).+(?=-)') +# Build without fmodex: +#_fmodex= + +# Build with OpenAL: +_openal=1 +# Build without OpenAL: +#_openal= + +_name=gzdoom +pkgname=${_name} +pkgver=2.1.1 +pkgrel=1 +_label='GZDoom' +_desc='Advanced Doom source port with OpenGL support' +pkgdesc="${_desc}" arch=('i686' 'x86_64') -url="http://www.osnanet.de/c.oelckers/gzdoom/" -license=('custom') -depends=('fluidsynth' 'fmodex4.26.36' 'glew' 'gtk2' 'gxmessage' 'sdl2') -makedepends=('nasm' 'cmake' 'imagemagick' 'mesa') -optdepends=('blasphemer: Blasphemer (free Heretic) game data' +url='http://www.zdoom.org/' +license=('BSD' 'custom:BUILD' 'custom:doom' 'custom:dumb' 'LGPL') +depends=('fluidsynth' + ${_fmodex:+"fmodex=$_fmodex"} + 'gtk2' + 'gxmessage' + 'libgl' + 'libgme' + ${_openal:+'libsndfile'} + ${_openal:+'mpg123'} + ${_openal:+'openal'} + 'sdl2') +makedepends=('cmake' + 'desktop-file-utils' + 'git' + 'imagemagick' + 'xdg-utils') +makedepends_i686=('nasm') +optdepends=('blasphemer-wad: Blasphemer (free Heretic) game data' 'chexquest3-wad: Chex Quest 3 game data' 'doom1-wad: Doom shareware game data' 'freedoom: FreeDoom game data' @@ -19,76 +48,123 @@ optdepends=('blasphemer: Blasphemer (free Heretic) game data' 'heretic1-wad: Heretic shareware game data' 'hexen1-wad: Hexen demo game data' 'strife0-wad: Strife shareware game data' + 'square1-wad: The Adventures of Square, Episode 1 game data' 'urbanbrawl-wad: Urban Brawl: Action Doom 2 game data') -source=(https://github.com/coelckers/gzdoom/archive/g${pkgver}.tar.gz - gitinfo.h - git-c915049.patch - git-37321d1.patch - git-cab509c.patch - git-fb3bf0e.patch - config-update-fix.patch - doom-share-dir.patch - stack-noexec.patch - gzdoom.desktop) -sha256sums=('7d03f13fad52ff58944283dff566a4622cfeb2e8680e1a529a72ac2a16191203' - '6a8721bead8b4f080ec7ca4a10dbcd628e96f072e31a7c295f1689bf0aead596' - '121d25ee4bbcc13cceb0f51559f126551d704523ba63736baa4624502b26cd14' - '48562c7a6110b19cdd4d795b5d28b5445243831533269f8bb25cc19ba67333ff' - '5150353839bc653282720b8e434b09930b2747d91115afdb1eda32daa6162f59' - 'acb5a37bff36f866345c68b8b512bc3bb4c549d347020ea8e1f0c52b271049bc' - '7c68a97e95987117093552b5b0628db7e0f19e8ffa2c1919eaaa7b84d973e0ea' - '0b22552e0550a01cf6c652804aff6a7157471740630a9c7158e4ee709bc24b80' - 'cd13c6582fa1eb09ccba377f4593d3c552e97e07d231911e152e5dd5395b3529' - '2a0b837ddc423d3a6be50f60735c55ee27cd26f58c42540b44aab395030b9cc4') - -_fmodver=4.26.36 -_libdir=/usr/lib/gzdoom -_sharedir=/usr/share/games/gzdoom +install=install +source=("${_name}::git://github.com/coelckers/${_name}.git#tag=g${pkgver}" + 'desktop.template' + '0001-Mark-stack-as-not-executable-in-assembler-sources.patch' + '0002-Include-SHARE_DIR-in-IWADSearch.Directories.patch') +_srcsubdir="${_name}" +sha256sums=('SKIP' + 'f2c58925238fe0d01e630527c8c4431681ccaec2d763ba075429b747d1a98a8c' + '695a17860f7f71789f085da02022f9926a098b570c4672c6c9bf23556caceb72' + '23ded6a031724252d4ba442dabd4c79dcbec053594adc9fd6a91e8871ce69f85') prepare() { - cd gzdoom-g$pkgver + cd "${_srcsubdir}" - cp "$srcdir"/gitinfo.h src/gitinfo.h + local _file + for _file in "${source[@]}"; do + if [[ "${_file}" == *.patch ]]; then + patch -p1 <"${srcdir}/${_file}" + fi + done +} - patch -p1 <"$srcdir"/git-c915049.patch - patch -p1 <"$srcdir"/git-37321d1.patch - patch -p1 <"$srcdir"/git-cab509c.patch - patch -p1 <"$srcdir"/git-fb3bf0e.patch +build() { + cd "${_srcsubdir}" - patch -p1 <"$srcdir/config-update-fix.patch" - patch -p1 <"$srcdir/doom-share-dir.patch" - patch -p1 <"$srcdir/stack-noexec.patch" + cat >"${_name}.sh" <<EOF +#!/bin/sh +exec /usr/lib/${_name}/${_name} "\$@" +EOF - sed -i "s|setPluginPath(progdir)|setPluginPath(\"$_libdir\")|" src/sound/fmodsound.cpp -} + local _nofmod _noopenal _fmodincdir -build() { - cd gzdoom-g$pkgver + if [[ -n "${_fmodex}" ]]; then + _nofmod=OFF + + _fmodincdir="/usr/include/fmodex-${_fmodex}" + if [[ ! -e "${_fmodincdir}" ]]; then + _fmodincdir='/usr/include/fmodex' + fi + else + _nofmod=ON + fi + + if [[ -n "${_openal}" ]]; then + _noopenal=OFF + else + _noopenal=ON + fi + + cmake -DNO_FMOD=${_nofmod} \ + -DNO_OPENAL=${_noopenal} \ + -DGME_INCLUDE_DIR='/usr/include/gme' \ + -DFMOD_INCLUDE_DIR="${_fmodincdir}" \ + -DFMOD_LIBRARY="/usr/lib/libfmodex-${_fmodex}.so" \ + -DFORCE_INTERNAL_GME=OFF \ + -DCMAKE_C_FLAGS="$CFLAGS -DSHARE_DIR=\\\"/usr/share/${_name}\\\"" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS -DSHARE_DIR=\\\"/usr/share/${_name}\\\"" \ + . + make - cmake -DFMOD_INCLUDE_DIR=/usr/include/fmodex-$_fmodver \ - -DFMOD_LIBRARY=/usr/lib/libfmodex-$_fmodver.so \ - -DCMAKE_C_FLAGS="$CFLAGS -DSHARE_DIR=\\\"$_sharedir\\\"" \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS -DSHARE_DIR=\\\"$_sharedir\\\"" \ - . - make + sed -n '/\*\*-/,/\*\*-/p' 'src/version.h' >'bsd.txt' - convert "src/win32/icon1.ico[2]" gzdoom.png + cp "${srcdir}/desktop.template" "${_name}.desktop" + desktop-file-edit --set-name="${_label}" \ + --set-generic-name="${_desc}" \ + --set-icon="${_name}" \ + --set-key=Exec --set-value="${_name} %F" \ + "${_name}.desktop" + + mkdir 'icons' + convert 'src/win32/icon1.ico[2]' 'icons/48.png' + convert 'src/win32/icon1.ico[3]' 'icons/32.png' + convert 'src/win32/icon1.ico[4]' 'icons/16.png' } package() { - cd gzdoom-g$pkgver - - install -Dm755 gzdoom "$pkgdir/usr/bin/gzdoom" - install -Dm755 liboutput_sdl.so "$pkgdir/$_libdir/liboutput_sdl.so" - install -Dm644 gzdoom.pk3 "$pkgdir/$_sharedir/gzdoom.pk3" - install -Dm644 brightmaps.pk3 "$pkgdir/$_sharedir/brightmaps.pk3" - install -Dm644 lights.pk3 "$pkgdir/$_sharedir/lights.pk3" - ln -s /usr/share/doom/doom.wad "$pkgdir/$_sharedir/freedoomu.wad" - ln -s /usr/share/doom/doom2.wad "$pkgdir/$_sharedir/freedoom.wad" - ln -s /usr/share/doom/hexen.wad "$pkgdir/$_sharedir/hexendemo.wad" - - install -Dm644 gzdoom.png "$pkgdir/usr/share/pixmaps/gzdoom.png" - install -Dm644 "$srcdir/gzdoom.desktop" "$pkgdir/usr/share/applications/gzdoom.desktop" - install -Dm644 docs/BUILDLIC.TXT "$pkgdir/usr/share/licenses/$pkgname/buildlic.txt" - install -Dm644 docs/doomlic.txt "$pkgdir/usr/share/licenses/$pkgname/doomlic.txt" + cd "${_srcsubdir}" + + install -D "${_name}.sh" "${pkgdir}/usr/bin/${_name}" + + mkdir -p "${pkgdir}/usr/lib/${_name}" + install "${_name}" "${pkgdir}/usr/lib/${_name}/" + install -m644 "${_name}.pk3" "${pkgdir}/usr/lib/${_name}/" + if [[ -n "${_fmodex}" ]]; then + install 'liboutput_sdl.so' "${pkgdir}/usr/lib/${_name}/" + fi + + mkdir -p "${pkgdir}/usr/share/${_name}" + install -m644 'brightmaps.pk3' "${pkgdir}/usr/share/${_name}/" + install -m644 'lights.pk3' "${pkgdir}/usr/share/${_name}/" + ln -s '/usr/share/doom/doom.wad' "${pkgdir}/usr/share/${_name}/freedoomu.wad" + ln -s '/usr/share/doom/doom2.wad' "${pkgdir}/usr/share/${_name}/freedoom.wad" + ln -s '/usr/share/doom/heretic.wad' "${pkgdir}/usr/share/${_name}/blasphemer.wad" + ln -s '/usr/share/doom/hexen.wad' "${pkgdir}/usr/share/${_name}/hexendemo.wad" + + mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}" + install -m644 'bsd.txt' "${pkgdir}/usr/share/licenses/${pkgname}/bsd.txt" + install -m644 'docs/BUILDLIC.TXT' "${pkgdir}/usr/share/licenses/${pkgname}/buildlic.txt" + install -m644 'docs/doomlic.txt' "${pkgdir}/usr/share/licenses/${pkgname}/doomlic.txt" + install -m644 'dumb/licence.txt' "${pkgdir}/usr/share/licenses/${pkgname}/dumb.txt" + + desktop-file-install --dir="${pkgdir}/usr/share/applications" "${_name}.desktop" + + mkdir -p "${pkgdir}/usr/share/icons/hicolor" + ( + cd 'icons' + export XDG_DATA_DIRS="${pkgdir}/usr/share" + + local _file + for _file in *.png; do + xdg-icon-resource install --noupdate \ + --novendor \ + --size "${_file%.png}" \ + "${_file}" \ + "${_name}" + done + ) } diff --git a/config-update-fix.patch b/config-update-fix.patch deleted file mode 100644 index fbf3906e5017..000000000000 --- a/config-update-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur a/src/m_specialpaths.cpp b/src/m_specialpaths.cpp ---- a/src/m_specialpaths.cpp 2014-09-10 15:35:08.217777234 +0200 -+++ b/src/m_specialpaths.cpp 2014-09-10 15:39:12.774441440 +0200 -@@ -497,7 +497,7 @@ - // This can be removed after a release or two - // Transfer the old zdoom directory to the new location - bool moved = false; -- FString oldpath = NicePath("~/.zdoom/"); -+ FString oldpath = NicePath("~/.gzdoom/"); - if (stat (oldpath, &extrainfo) != -1) - { - if (rename(oldpath, path) == -1) diff --git a/gzdoom.desktop b/desktop.template index 41c576528b02..172a5d7cae83 100644 --- a/gzdoom.desktop +++ b/desktop.template @@ -1,10 +1,6 @@ [Desktop Entry] -Encoding=UTF-8 -Version=1.0 Type=Application -Name=GZDoom -GenericName=Enhanced Doom Engine -Icon=gzdoom -Exec=gzdoom %F +Version=1.0 Terminal=false +MimeType=application/x-doom-wad; Categories=Game;ActionGame; diff --git a/doom-share-dir.patch b/doom-share-dir.patch deleted file mode 100644 index 3214e45b77d2..000000000000 --- a/doom-share-dir.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp ---- a/src/gameconfigfile.cpp 2014-09-10 15:49:16.484435366 +0200 -+++ b/src/gameconfigfile.cpp 2014-09-10 15:49:28.591101911 +0200 -@@ -139,6 +139,7 @@ - #else
- SetValueForKey ("Path", "~/" GAME_DIR, true);
- SetValueForKey ("Path", SHARE_DIR, true);
-+ SetValueForKey ("Path", "/usr/share/doom", true);
- #endif
- }
-
diff --git a/git-276ca5b7.patch b/git-276ca5b7.patch deleted file mode 100644 index 580dd8b2f127..000000000000 --- a/git-276ca5b7.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 276ca5b75bd9729ccc69795597dcc54c50a02e0d Mon Sep 17 00:00:00 2001 -From: Braden Obrzut <admin@maniacsvault.net> -Date: Wed, 26 Jun 2013 19:01:00 -0400 -Subject: [PATCH] - Fixed compilation on non-Windows systems by removing - dependency on src/Linux/platform.h - ---- - src/gl/models/gl_models_md2.cpp | 4 ++-- - src/gl/system/gl_interface.h | 5 +++++ - src/gl/system/gl_system.h | 1 - - src/gl/system/gl_wipe.cpp | 13 +++++++++++++ - src/gl/textures/gl_hirestex.cpp | 4 ++-- - 5 files changed, 22 insertions(+), 5 deletions(-) - -diff --git a/src/gl/models/gl_models_md2.cpp b/src/gl/models/gl_models_md2.cpp -index 95a344c..1ff9862 100644 ---- a/src/gl/models/gl_models_md2.cpp -+++ b/src/gl/models/gl_models_md2.cpp -@@ -176,7 +176,7 @@ bool FDMDModel::Load(const char * path, int, const char * buffer, int length) - // Translate each vertex. - for(k = 0, pVtx = pfr->vertices; k < info.numVertices; k++, pVtx++) - { -- UnpackVector(USHORT(pVtx->normal), frame->normals[k].xyz); -+ UnpackVector((unsigned short)(pVtx->normal), frame->normals[k].xyz); - for(c = 0; c < 3; c++) - { - frame->vertices[k].xyz[axis[c]] = -@@ -208,7 +208,7 @@ bool FDMDModel::Load(const char * path, int, const char * buffer, int length) - for(i = 0; i < info.numLODs; i++) - for(k = 0; k < lodInfo[i].numTriangles; k++) - for(c = 0; c < 3; c++) -- vertexUsage[SHORT(triangles[i][k].vertexIndices[c])] |= 1 << i; -+ vertexUsage[short(triangles[i][k].vertexIndices[c])] |= 1 << i; - - loaded=true; - return true; -diff --git a/src/gl/system/gl_interface.h b/src/gl/system/gl_interface.h -index 8766ebc..3d54bf8 100644 ---- a/src/gl/system/gl_interface.h -+++ b/src/gl/system/gl_interface.h -@@ -5,6 +5,11 @@ - #define APIENTRY - #endif // __APPLE__ - -+#include "basictypes.h" -+#ifndef _WIN32 -+typedef bool BOOL; -+#endif -+ - #ifndef PFNGLMULTITEXCOORD2FPROC - typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); - #endif -diff --git a/src/gl/system/gl_system.h b/src/gl/system/gl_system.h -index d48b559..5dc6cf5 100644 ---- a/src/gl/system/gl_system.h -+++ b/src/gl/system/gl_system.h -@@ -88,7 +88,6 @@ inline T max( T a, T b) { return (((a)>(b)) ? (a) : (b)); } - #define _access(a,b) access(a,b) - #endif - #ifndef _WIN32 --#include "platform.h" - #include <SDL.h> - #endif - #include "gl/system/gl_interface.h" -diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp -index f9f73a4..83f5abd 100644 ---- a/src/gl/system/gl_wipe.cpp -+++ b/src/gl/system/gl_wipe.cpp -@@ -56,6 +56,19 @@ - #include "gl/textures/gl_material.h" - #include "gl/utility/gl_templates.h" - -+#ifndef _WIN32 -+struct POINT { -+ SDWORD x; -+ SDWORD y; -+}; -+struct RECT { -+ SDWORD left; -+ SDWORD top; -+ SDWORD right; -+ SDWORD bottom; -+}; -+#endif -+ - EXTERN_CVAR(Bool, gl_vid_compatibility) - - //=========================================================================== -diff --git a/src/gl/textures/gl_hirestex.cpp b/src/gl/textures/gl_hirestex.cpp -index 423a783..b7824bf 100644 ---- a/src/gl/textures/gl_hirestex.cpp -+++ b/src/gl/textures/gl_hirestex.cpp -@@ -56,8 +56,8 @@ - #include "d_main.h" - #include "zstring.h" - --#ifdef __GNUC__ --#include "Linux/platform.h" /* Without this it would fail on _access on line 374 (378 now) */ -+#ifndef _WIN32 -+#define _access(a,b) access(a,b) - #endif - - static int Doom2Wad = -1; --- -1.8.3.2 - diff --git a/git-37321d1.patch b/git-37321d1.patch deleted file mode 100644 index f2f878f770b8..000000000000 --- a/git-37321d1.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 37321d1d483cee0c01285774921fb861bd6f9c1e Mon Sep 17 00:00:00 2001 -From: Edoardo Prezioso <edo88@email.it> -Date: Thu, 8 Jan 2015 00:23:14 +0100 -Subject: [PATCH] - Implement SDL2 into GZDoom (needs improvements). - -Make also minor fixes. -Now it compiles and runs fine for me, except for the invisible cursor in the menu (no idea why). ---- - src/posix/sdl/sdlglvideo.cpp | 67 ++++++++++++++++++++++++++------------------ - src/posix/sdl/sdlglvideo.h | 9 +++--- - 2 files changed, 44 insertions(+), 32 deletions(-) - -diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp -index 649989e..9331c0f 100644 ---- a/src/posix/sdl/sdlglvideo.cpp -+++ b/src/posix/sdl/sdlglvideo.cpp -@@ -1,8 +1,6 @@ - - // HEADER FILES ------------------------------------------------------------ - --#include <iostream> -- - #include "doomtype.h" - - #include "templates.h" -@@ -48,6 +46,7 @@ extern IVideo *Video; - // extern int vid_renderer; - - EXTERN_CVAR (Float, Gamma) -+EXTERN_CVAR (Int, vid_adapter) - EXTERN_CVAR (Int, vid_displaybits) - EXTERN_CVAR (Int, vid_renderer) - -@@ -156,14 +155,19 @@ bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox) - } - else - { -- SDL_Rect **modes = SDL_ListModes (NULL, SDL_FULLSCREEN|SDL_HWSURFACE); -- if (modes != NULL && modes[IteratorMode] != NULL) -+ SDL_DisplayMode mode = {}, oldmode = {}; -+ if(IteratorMode != 0) -+ SDL_GetDisplayMode(vid_adapter, IteratorMode-1, &oldmode); -+ do - { -- *width = modes[IteratorMode]->w; -- *height = modes[IteratorMode]->h; -+ if (SDL_GetDisplayMode(vid_adapter, IteratorMode, &mode) != 0) -+ return false; - ++IteratorMode; -- return true; -- } -+ } while(mode.w == oldmode.w && mode.h == oldmode.h); -+ -+ *width = mode.w; -+ *height = mode.h; -+ return true; - } - return false; - } -@@ -182,11 +186,11 @@ DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool fullscr - if (fb->Width == width && - fb->Height == height) - { -- bool fsnow = (fb->Screen->flags & SDL_FULLSCREEN) != 0; -+ bool fsnow = (SDL_GetWindowFlags (fb->Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; - - if (fsnow != fullscreen) - { -- SDL_WM_ToggleFullScreen (fb->Screen); -+ SDL_SetWindowFullscreen (fb->Screen, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); - } - return old; - } -@@ -336,30 +340,37 @@ SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen) - return; - } - -- -- Screen = SDL_SetVideoMode (width, height, -- 32, -- SDL_HWSURFACE|SDL_HWPALETTE|SDL_OPENGL | SDL_GL_DOUBLEBUFFER|SDL_ANYFORMAT| -- (fullscreen ? SDL_FULLSCREEN : 0)); -+ FString caption; -+ caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -+ Screen = SDL_CreateWindow (caption, -+ SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), -+ width, height, (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)|SDL_WINDOW_OPENGL); - - if (Screen == NULL) - return; - -- m_supportsGamma = -1 != SDL_GetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -- --#if defined(__APPLE__) -- // Need to set title here because a window is not created yet when calling the same function from main() -- char caption[100]; -- mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -- SDL_WM_SetCaption(caption, NULL); --#endif // __APPLE__ -+ GLContext = SDL_GL_CreateContext(Screen); -+ if (GLContext == NULL) -+ return; -+ -+ m_supportsGamma = -1 != SDL_GetWindowGammaRamp(Screen, m_origGamma[0], m_origGamma[1], m_origGamma[2]); - } - - SDLGLFB::~SDLGLFB () - { -- if (m_supportsGamma) -+ if (Screen) - { -- SDL_SetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ if (m_supportsGamma) -+ { -+ SDL_SetWindowGammaRamp(Screen, m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ } -+ -+ if (GLContext) -+ { -+ SDL_GL_DeleteContext(GLContext); -+ } -+ -+ SDL_DestroyWindow(Screen); - } - } - -@@ -386,7 +397,7 @@ bool SDLGLFB::CanUpdate () - - void SDLGLFB::SetGammaTable(WORD *tbl) - { -- SDL_SetGammaRamp(&tbl[0], &tbl[256], &tbl[512]); -+ SDL_SetWindowGammaRamp(Screen, &tbl[0], &tbl[256], &tbl[512]); - } - - bool SDLGLFB::Lock(bool buffered) -@@ -420,7 +431,7 @@ bool SDLGLFB::IsLocked () - - bool SDLGLFB::IsFullscreen () - { -- return (Screen->flags & SDL_FULLSCREEN) != 0; -+ return (SDL_GetWindowFlags (Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; - } - - -@@ -443,6 +454,6 @@ void SDLGLFB::NewRefreshRate () - - void SDLGLFB::SwapBuffers() - { -- SDL_GL_SwapBuffers (); -+ SDL_GL_SwapWindow (Screen); - } - -diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h -index 205e416..3867be6 100644 ---- a/src/posix/sdl/sdlglvideo.h -+++ b/src/posix/sdl/sdlglvideo.h -@@ -3,7 +3,6 @@ - - #include "hardware.h" - #include "v_video.h" --#include <SDL.h> - #include "gl/system/gl_system.h" - - EXTERN_CVAR (Float, dimamount) -@@ -70,9 +69,11 @@ protected: - SDLGLFB () {} - BYTE GammaTable[3][256]; - bool UpdatePending; -- -- SDL_Surface *Screen; -- -+ -+ SDL_Window *Screen; -+ -+ SDL_GLContext GLContext; -+ - void UpdateColors (); - - int m_Lock; --- -2.3.2 - diff --git a/git-3a477f69.patch b/git-3a477f69.patch deleted file mode 100644 index fa158271e69a..000000000000 --- a/git-3a477f69.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 3a477f6903c0f901fa3973c1d9b9979f9c3a0cfb Mon Sep 17 00:00:00 2001 -From: Christoph Oelckers <coelckers@zdoom.fake> -Date: Sun, 23 Jun 2013 20:54:21 +0200 -Subject: [PATCH] - DavidPH's patch for Linux compilation. - ---- - src/CMakeLists.txt | 1 + - src/sdl/i_main.cpp | 2 +- - src/sdl/i_system.cpp | 2 +- - 3 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index a77ee7c..6ba8070 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -682,6 +682,7 @@ add_executable( zdoom WIN32 - g_skill.cpp
- gameconfigfile.cpp
- gi.cpp
-+ gitinfo.cpp
- hu_scores.cpp
- i_net.cpp
- info.cpp
-diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp -index 48395ce..65b992f 100644 ---- a/src/sdl/i_main.cpp -+++ b/src/sdl/i_main.cpp -@@ -286,7 +286,7 @@ int main (int argc, char **argv) -
- char caption[100];
- mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime());
-- SDL_WM_SetCaption(caption);
-+ SDL_WM_SetCaption(caption, caption);
-
- #ifdef __APPLE__
-
-diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp -index cea3cb1..46e3898 100644 ---- a/src/sdl/i_system.cpp -+++ b/src/sdl/i_system.cpp -@@ -619,7 +619,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad) - FString cmd("kdialog --title \""GAMESIG" "); - cmd << GetVersionString() << ": Select an IWAD to use\"" - " --menu \"ZDoom found more than one IWAD\n" -- "Select from the list below to determine which one to use:\""); -+ "Select from the list below to determine which one to use:\""; - - for(i = 0; i < numwads; ++i) - { --- -1.8.3.2 - diff --git a/git-c915049.patch b/git-c915049.patch deleted file mode 100644 index 65140ffa1f3d..000000000000 --- a/git-c915049.patch +++ /dev/null @@ -1,1125 +0,0 @@ -From c9150497e3472e1057ed8286237fcf07106a075d Mon Sep 17 00:00:00 2001 -From: Edoardo Prezioso <edo88@email.it> -Date: Wed, 7 Jan 2015 21:07:40 +0100 -Subject: [PATCH] - Move sdlglvideo code from sdl to posix/sdl. - -Re-add sdlglvideo.cpp path in CMakeLists.txt . Warning: it won't compile yet. ---- - src/CMakeLists.txt | 6 +- - src/posix/sdl/sdlglvideo.cpp | 448 +++++++++++++++++++++++++++++++++++++++++++ - src/posix/sdl/sdlglvideo.h | 82 ++++++++ - src/sdl/sdlglvideo.cpp | 448 ------------------------------------------- - src/sdl/sdlglvideo.h | 82 -------- - 5 files changed, 532 insertions(+), 534 deletions(-) - create mode 100644 src/posix/sdl/sdlglvideo.cpp - create mode 100644 src/posix/sdl/sdlglvideo.h - delete mode 100644 src/sdl/sdlglvideo.cpp - delete mode 100644 src/sdl/sdlglvideo.h - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4803006..3edcbaf 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -584,13 +584,11 @@ set( PLAT_SDL_SOURCES - posix/sdl/i_joystick.cpp - posix/sdl/i_main.cpp - posix/sdl/i_timer.cpp -- posix/sdl/sdlvideo.cpp ) -+ posix/sdl/sdlvideo.cpp -+ posix/sdl/sdlglvideo.cpp ) - set( PLAT_OSX_SOURCES - posix/osx/iwadpicker_cocoa.mm - posix/osx/zdoom.icns ) -- --# Fixme: This must be adjusted to the new way of doing things: --# sdl/sdlglvideo.cpp - set( PLAT_COCOA_SOURCES - posix/cocoa/hid/HID_Config_Utilities.c - posix/cocoa/hid/HID_Error_Handler.c -diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp -new file mode 100644 -index 0000000..649989e ---- /dev/null -+++ b/src/posix/sdl/sdlglvideo.cpp -@@ -0,0 +1,448 @@ -+ -+// HEADER FILES ------------------------------------------------------------ -+ -+#include <iostream> -+ -+#include "doomtype.h" -+ -+#include "templates.h" -+#include "i_system.h" -+#include "i_video.h" -+#include "v_video.h" -+#include "v_pfx.h" -+#include "stats.h" -+#include "version.h" -+#include "c_console.h" -+ -+#include "sdlglvideo.h" -+#include "gl/system/gl_system.h" -+#include "r_defs.h" -+#include "gl/gl_functions.h" -+//#include "gl/gl_intern.h" -+ -+#include "gl/renderer/gl_renderer.h" -+#include "gl/system/gl_framebuffer.h" -+#include "gl/shaders/gl_shader.h" -+#include "gl/utility/gl_templates.h" -+#include "gl/textures/gl_material.h" -+#include "gl/system/gl_cvars.h" -+ -+// MACROS ------------------------------------------------------------------ -+ -+// TYPES ------------------------------------------------------------------- -+ -+IMPLEMENT_ABSTRACT_CLASS(SDLGLFB) -+ -+struct MiniModeInfo -+{ -+ WORD Width, Height; -+}; -+ -+// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- -+ -+// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- -+ -+// EXTERNAL DATA DECLARATIONS ---------------------------------------------- -+ -+extern IVideo *Video; -+// extern int vid_renderer; -+ -+EXTERN_CVAR (Float, Gamma) -+EXTERN_CVAR (Int, vid_displaybits) -+EXTERN_CVAR (Int, vid_renderer) -+ -+ -+// PUBLIC DATA DEFINITIONS ------------------------------------------------- -+ -+CUSTOM_CVAR(Int, gl_vid_multisample, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL ) -+{ -+ Printf("This won't take effect until " GAMENAME " is restarted.\n"); -+} -+ -+// PRIVATE DATA DEFINITIONS ------------------------------------------------ -+ -+// Dummy screen sizes to pass when windowed -+static MiniModeInfo WinModes[] = -+{ -+ { 320, 200 }, -+ { 320, 240 }, -+ { 400, 225 }, // 16:9 -+ { 400, 300 }, -+ { 480, 270 }, // 16:9 -+ { 480, 360 }, -+ { 512, 288 }, // 16:9 -+ { 512, 384 }, -+ { 640, 360 }, // 16:9 -+ { 640, 400 }, -+ { 640, 480 }, -+ { 720, 480 }, // 16:10 -+ { 720, 540 }, -+ { 800, 450 }, // 16:9 -+ { 800, 500 }, // 16:10 -+ { 800, 600 }, -+ { 848, 480 }, // 16:9 -+ { 960, 600 }, // 16:10 -+ { 960, 720 }, -+ { 1024, 576 }, // 16:9 -+ { 1024, 600 }, // 17:10 -+ { 1024, 640 }, // 16:10 -+ { 1024, 768 }, -+ { 1088, 612 }, // 16:9 -+ { 1152, 648 }, // 16:9 -+ { 1152, 720 }, // 16:10 -+ { 1152, 864 }, -+ { 1280, 720 }, // 16:9 -+ { 1280, 800 }, // 16:10 -+ { 1280, 960 }, -+ { 1344, 756 }, // 16:9 -+ { 1360, 768 }, // 16:9 -+ { 1400, 787 }, // 16:9 -+ { 1400, 875 }, // 16:10 -+ { 1440, 900 }, -+ { 1400, 1050 }, -+ { 1600, 900 }, // 16:9 -+ { 1600, 1000 }, // 16:10 -+ { 1600, 1200 }, -+ { 1680, 1050 }, // 16:10 -+ { 1920, 1080 }, // 16:9 -+ { 1920, 1200 }, // 16:10 -+ { 2054, 1536 }, -+ { 2560, 1440 }, // 16:9 -+ { 2880, 1800 } // 16:10 -+}; -+ -+// CODE -------------------------------------------------------------------- -+ -+SDLGLVideo::SDLGLVideo (int parm) -+{ -+ IteratorBits = 0; -+ IteratorFS = false; -+ if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { -+ fprintf( stderr, "Video initialization failed: %s\n", -+ SDL_GetError( ) ); -+ } -+#ifndef _WIN32 -+ // mouse cursor is visible by default on linux systems, we disable it by default -+ SDL_ShowCursor (0); -+#endif -+} -+ -+SDLGLVideo::~SDLGLVideo () -+{ -+ if (GLRenderer != NULL) GLRenderer->FlushTextures(); -+} -+ -+void SDLGLVideo::StartModeIterator (int bits, bool fs) -+{ -+ IteratorMode = 0; -+ IteratorBits = bits; -+ IteratorFS = fs; -+} -+ -+bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox) -+{ -+ if (IteratorBits != 8) -+ return false; -+ -+ if (!IteratorFS) -+ { -+ if ((unsigned)IteratorMode < sizeof(WinModes)/sizeof(WinModes[0])) -+ { -+ *width = WinModes[IteratorMode].Width; -+ *height = WinModes[IteratorMode].Height; -+ ++IteratorMode; -+ return true; -+ } -+ } -+ else -+ { -+ SDL_Rect **modes = SDL_ListModes (NULL, SDL_FULLSCREEN|SDL_HWSURFACE); -+ if (modes != NULL && modes[IteratorMode] != NULL) -+ { -+ *width = modes[IteratorMode]->w; -+ *height = modes[IteratorMode]->h; -+ ++IteratorMode; -+ return true; -+ } -+ } -+ return false; -+} -+ -+DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool fullscreen, DFrameBuffer *old) -+{ -+ static int retry = 0; -+ static int owidth, oheight; -+ -+ PalEntry flashColor; -+// int flashAmount; -+ -+ if (old != NULL) -+ { // Reuse the old framebuffer if its attributes are the same -+ SDLGLFB *fb = static_cast<SDLGLFB *> (old); -+ if (fb->Width == width && -+ fb->Height == height) -+ { -+ bool fsnow = (fb->Screen->flags & SDL_FULLSCREEN) != 0; -+ -+ if (fsnow != fullscreen) -+ { -+ SDL_WM_ToggleFullScreen (fb->Screen); -+ } -+ return old; -+ } -+// old->GetFlash (flashColor, flashAmount); -+ delete old; -+ } -+ else -+ { -+ flashColor = 0; -+// flashAmount = 0; -+ } -+ -+ SDLGLFB *fb = new OpenGLFrameBuffer (0, width, height, 32, 60, fullscreen); -+ retry = 0; -+ -+ // If we could not create the framebuffer, try again with slightly -+ // different parameters in this order: -+ // 1. Try with the closest size -+ // 2. Try in the opposite screen mode with the original size -+ // 3. Try in the opposite screen mode with the closest size -+ // This is a somewhat confusing mass of recursion here. -+ -+ while (fb == NULL || !fb->IsValid ()) -+ { -+ if (fb != NULL) -+ { -+ delete fb; -+ } -+ -+ switch (retry) -+ { -+ case 0: -+ owidth = width; -+ oheight = height; -+ case 2: -+ // Try a different resolution. Hopefully that will work. -+ I_ClosestResolution (&width, &height, 8); -+ break; -+ -+ case 1: -+ // Try changing fullscreen mode. Maybe that will work. -+ width = owidth; -+ height = oheight; -+ fullscreen = !fullscreen; -+ break; -+ -+ default: -+ // I give up! -+ I_FatalError ("Could not create new screen (%d x %d)", owidth, oheight); -+ -+ fprintf( stderr, "!!! [SDLGLVideo::CreateFrameBuffer] Got beyond I_FatalError !!!" ); -+ return NULL; //[C] actually this shouldn't be reached; probably should be replaced with an ASSERT -+ } -+ -+ ++retry; -+ fb = static_cast<SDLGLFB *>(CreateFrameBuffer (width, height, fullscreen, NULL)); -+ } -+ -+// fb->SetFlash (flashColor, flashAmount); -+ return fb; -+} -+ -+void SDLGLVideo::SetWindowedScale (float scale) -+{ -+} -+ -+bool SDLGLVideo::SetResolution (int width, int height, int bits) -+{ -+ // FIXME: Is it possible to do this without completely destroying the old -+ // interface? -+#ifndef NO_GL -+ -+ if (GLRenderer != NULL) GLRenderer->FlushTextures(); -+ I_ShutdownGraphics(); -+ -+ Video = new SDLGLVideo(0); -+ if (Video == NULL) I_FatalError ("Failed to initialize display"); -+ -+#if (defined(WINDOWS)) || defined(WIN32) -+ bits=32; -+#else -+ bits=24; -+#endif -+ -+ V_DoModeSetup(width, height, bits); -+#endif -+ return true; // We must return true because the old video context no longer exists. -+} -+ -+//========================================================================== -+// -+// -+// -+//========================================================================== -+ -+bool SDLGLVideo::SetupPixelFormat(bool allowsoftware, int multisample) -+{ -+ SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 ); -+ SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 ); -+ SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 ); -+ SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 ); -+ SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 ); -+ SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 8 ); -+// SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); -+ if (multisample > 0) { -+ SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 ); -+ SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisample ); -+ } -+ return true; -+} -+ -+//========================================================================== -+// -+// -+// -+//========================================================================== -+ -+bool SDLGLVideo::InitHardware (bool allowsoftware, int multisample) -+{ -+ if (!SetupPixelFormat(allowsoftware, multisample)) -+ { -+ Printf ("R_OPENGL: Reverting to software mode...\n"); -+ return false; -+ } -+ return true; -+} -+ -+ -+// FrameBuffer implementation ----------------------------------------------- -+ -+SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen) -+ : DFrameBuffer (width, height) -+{ -+ static int localmultisample=-1; -+ -+ if (localmultisample<0) localmultisample=gl_vid_multisample; -+ -+ int i; -+ -+ m_Lock=0; -+ -+ UpdatePending = false; -+ -+ if (!static_cast<SDLGLVideo*>(Video)->InitHardware(false, localmultisample)) -+ { -+ vid_renderer = 0; -+ return; -+ } -+ -+ -+ Screen = SDL_SetVideoMode (width, height, -+ 32, -+ SDL_HWSURFACE|SDL_HWPALETTE|SDL_OPENGL | SDL_GL_DOUBLEBUFFER|SDL_ANYFORMAT| -+ (fullscreen ? SDL_FULLSCREEN : 0)); -+ -+ if (Screen == NULL) -+ return; -+ -+ m_supportsGamma = -1 != SDL_GetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ -+#if defined(__APPLE__) -+ // Need to set title here because a window is not created yet when calling the same function from main() -+ char caption[100]; -+ mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -+ SDL_WM_SetCaption(caption, NULL); -+#endif // __APPLE__ -+} -+ -+SDLGLFB::~SDLGLFB () -+{ -+ if (m_supportsGamma) -+ { -+ SDL_SetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ } -+} -+ -+ -+ -+ -+void SDLGLFB::InitializeState() -+{ -+} -+ -+bool SDLGLFB::CanUpdate () -+{ -+ if (m_Lock != 1) -+ { -+ if (m_Lock > 0) -+ { -+ UpdatePending = true; -+ --m_Lock; -+ } -+ return false; -+ } -+ return true; -+} -+ -+void SDLGLFB::SetGammaTable(WORD *tbl) -+{ -+ SDL_SetGammaRamp(&tbl[0], &tbl[256], &tbl[512]); -+} -+ -+bool SDLGLFB::Lock(bool buffered) -+{ -+ m_Lock++; -+ Buffer = MemBuffer; -+ return true; -+} -+ -+bool SDLGLFB::Lock () -+{ -+ return Lock(false); -+} -+ -+void SDLGLFB::Unlock () -+{ -+ if (UpdatePending && m_Lock == 1) -+ { -+ Update (); -+ } -+ else if (--m_Lock <= 0) -+ { -+ m_Lock = 0; -+ } -+} -+ -+bool SDLGLFB::IsLocked () -+{ -+ return m_Lock>0;// true; -+} -+ -+bool SDLGLFB::IsFullscreen () -+{ -+ return (Screen->flags & SDL_FULLSCREEN) != 0; -+} -+ -+ -+bool SDLGLFB::IsValid () -+{ -+ return DFrameBuffer::IsValid() && Screen != NULL; -+} -+ -+void SDLGLFB::SetVSync( bool vsync ) -+{ -+#if defined (__APPLE__) -+ const GLint value = vsync ? 1 : 0; -+ CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, &value ); -+#endif -+} -+ -+void SDLGLFB::NewRefreshRate () -+{ -+} -+ -+void SDLGLFB::SwapBuffers() -+{ -+ SDL_GL_SwapBuffers (); -+} -+ -diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h -new file mode 100644 -index 0000000..205e416 ---- /dev/null -+++ b/src/posix/sdl/sdlglvideo.h -@@ -0,0 +1,82 @@ -+#ifndef __SDLGLVIDEO_H__ -+#define __SDLGLVIDEO_H__ -+ -+#include "hardware.h" -+#include "v_video.h" -+#include <SDL.h> -+#include "gl/system/gl_system.h" -+ -+EXTERN_CVAR (Float, dimamount) -+EXTERN_CVAR (Color, dimcolor) -+ -+struct FRenderer; -+FRenderer *gl_CreateInterface(); -+ -+class SDLGLVideo : public IVideo -+{ -+ public: -+ SDLGLVideo (int parm); -+ ~SDLGLVideo (); -+ -+ EDisplayType GetDisplayType () { return DISPLAY_Both; } -+ void SetWindowedScale (float scale); -+ -+ DFrameBuffer *CreateFrameBuffer (int width, int height, bool fs, DFrameBuffer *old); -+ -+ void StartModeIterator (int bits, bool fs); -+ bool NextMode (int *width, int *height, bool *letterbox); -+ bool SetResolution (int width, int height, int bits); -+ -+ bool SetupPixelFormat(bool allowsoftware, int multisample); -+ bool InitHardware (bool allowsoftware, int multisample); -+ -+private: -+ int IteratorMode; -+ int IteratorBits; -+ bool IteratorFS; -+}; -+class SDLGLFB : public DFrameBuffer -+{ -+ DECLARE_CLASS(SDLGLFB, DFrameBuffer) -+public: -+ // this must have the same parameters as the Windows version, even if they are not used! -+ SDLGLFB (void *hMonitor, int width, int height, int, int, bool fullscreen); -+ ~SDLGLFB (); -+ -+ void ForceBuffering (bool force); -+ bool Lock(bool buffered); -+ bool Lock (); -+ void Unlock(); -+ bool IsLocked (); -+ -+ bool IsValid (); -+ bool IsFullscreen (); -+ -+ virtual void SetVSync( bool vsync ); -+ void SwapBuffers(); -+ -+ void NewRefreshRate (); -+ -+ friend class SDLGLVideo; -+ -+//[C] -+ int GetTrueHeight() { return GetHeight();} -+ -+protected: -+ bool CanUpdate(); -+ void SetGammaTable(WORD *tbl); -+ void InitializeState(); -+ -+ SDLGLFB () {} -+ BYTE GammaTable[3][256]; -+ bool UpdatePending; -+ -+ SDL_Surface *Screen; -+ -+ void UpdateColors (); -+ -+ int m_Lock; -+ Uint16 m_origGamma[3][256]; -+ bool m_supportsGamma; -+}; -+#endif -diff --git a/src/sdl/sdlglvideo.cpp b/src/sdl/sdlglvideo.cpp -deleted file mode 100644 -index 649989e..0000000 ---- a/src/sdl/sdlglvideo.cpp -+++ /dev/null -@@ -1,448 +0,0 @@ -- --// HEADER FILES ------------------------------------------------------------ -- --#include <iostream> -- --#include "doomtype.h" -- --#include "templates.h" --#include "i_system.h" --#include "i_video.h" --#include "v_video.h" --#include "v_pfx.h" --#include "stats.h" --#include "version.h" --#include "c_console.h" -- --#include "sdlglvideo.h" --#include "gl/system/gl_system.h" --#include "r_defs.h" --#include "gl/gl_functions.h" --//#include "gl/gl_intern.h" -- --#include "gl/renderer/gl_renderer.h" --#include "gl/system/gl_framebuffer.h" --#include "gl/shaders/gl_shader.h" --#include "gl/utility/gl_templates.h" --#include "gl/textures/gl_material.h" --#include "gl/system/gl_cvars.h" -- --// MACROS ------------------------------------------------------------------ -- --// TYPES ------------------------------------------------------------------- -- --IMPLEMENT_ABSTRACT_CLASS(SDLGLFB) -- --struct MiniModeInfo --{ -- WORD Width, Height; --}; -- --// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- -- --// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- -- --// EXTERNAL DATA DECLARATIONS ---------------------------------------------- -- --extern IVideo *Video; --// extern int vid_renderer; -- --EXTERN_CVAR (Float, Gamma) --EXTERN_CVAR (Int, vid_displaybits) --EXTERN_CVAR (Int, vid_renderer) -- -- --// PUBLIC DATA DEFINITIONS ------------------------------------------------- -- --CUSTOM_CVAR(Int, gl_vid_multisample, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL ) --{ -- Printf("This won't take effect until " GAMENAME " is restarted.\n"); --} -- --// PRIVATE DATA DEFINITIONS ------------------------------------------------ -- --// Dummy screen sizes to pass when windowed --static MiniModeInfo WinModes[] = --{ -- { 320, 200 }, -- { 320, 240 }, -- { 400, 225 }, // 16:9 -- { 400, 300 }, -- { 480, 270 }, // 16:9 -- { 480, 360 }, -- { 512, 288 }, // 16:9 -- { 512, 384 }, -- { 640, 360 }, // 16:9 -- { 640, 400 }, -- { 640, 480 }, -- { 720, 480 }, // 16:10 -- { 720, 540 }, -- { 800, 450 }, // 16:9 -- { 800, 500 }, // 16:10 -- { 800, 600 }, -- { 848, 480 }, // 16:9 -- { 960, 600 }, // 16:10 -- { 960, 720 }, -- { 1024, 576 }, // 16:9 -- { 1024, 600 }, // 17:10 -- { 1024, 640 }, // 16:10 -- { 1024, 768 }, -- { 1088, 612 }, // 16:9 -- { 1152, 648 }, // 16:9 -- { 1152, 720 }, // 16:10 -- { 1152, 864 }, -- { 1280, 720 }, // 16:9 -- { 1280, 800 }, // 16:10 -- { 1280, 960 }, -- { 1344, 756 }, // 16:9 -- { 1360, 768 }, // 16:9 -- { 1400, 787 }, // 16:9 -- { 1400, 875 }, // 16:10 -- { 1440, 900 }, -- { 1400, 1050 }, -- { 1600, 900 }, // 16:9 -- { 1600, 1000 }, // 16:10 -- { 1600, 1200 }, -- { 1680, 1050 }, // 16:10 -- { 1920, 1080 }, // 16:9 -- { 1920, 1200 }, // 16:10 -- { 2054, 1536 }, -- { 2560, 1440 }, // 16:9 -- { 2880, 1800 } // 16:10 --}; -- --// CODE -------------------------------------------------------------------- -- --SDLGLVideo::SDLGLVideo (int parm) --{ -- IteratorBits = 0; -- IteratorFS = false; -- if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { -- fprintf( stderr, "Video initialization failed: %s\n", -- SDL_GetError( ) ); -- } --#ifndef _WIN32 -- // mouse cursor is visible by default on linux systems, we disable it by default -- SDL_ShowCursor (0); --#endif --} -- --SDLGLVideo::~SDLGLVideo () --{ -- if (GLRenderer != NULL) GLRenderer->FlushTextures(); --} -- --void SDLGLVideo::StartModeIterator (int bits, bool fs) --{ -- IteratorMode = 0; -- IteratorBits = bits; -- IteratorFS = fs; --} -- --bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox) --{ -- if (IteratorBits != 8) -- return false; -- -- if (!IteratorFS) -- { -- if ((unsigned)IteratorMode < sizeof(WinModes)/sizeof(WinModes[0])) -- { -- *width = WinModes[IteratorMode].Width; -- *height = WinModes[IteratorMode].Height; -- ++IteratorMode; -- return true; -- } -- } -- else -- { -- SDL_Rect **modes = SDL_ListModes (NULL, SDL_FULLSCREEN|SDL_HWSURFACE); -- if (modes != NULL && modes[IteratorMode] != NULL) -- { -- *width = modes[IteratorMode]->w; -- *height = modes[IteratorMode]->h; -- ++IteratorMode; -- return true; -- } -- } -- return false; --} -- --DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool fullscreen, DFrameBuffer *old) --{ -- static int retry = 0; -- static int owidth, oheight; -- -- PalEntry flashColor; --// int flashAmount; -- -- if (old != NULL) -- { // Reuse the old framebuffer if its attributes are the same -- SDLGLFB *fb = static_cast<SDLGLFB *> (old); -- if (fb->Width == width && -- fb->Height == height) -- { -- bool fsnow = (fb->Screen->flags & SDL_FULLSCREEN) != 0; -- -- if (fsnow != fullscreen) -- { -- SDL_WM_ToggleFullScreen (fb->Screen); -- } -- return old; -- } --// old->GetFlash (flashColor, flashAmount); -- delete old; -- } -- else -- { -- flashColor = 0; --// flashAmount = 0; -- } -- -- SDLGLFB *fb = new OpenGLFrameBuffer (0, width, height, 32, 60, fullscreen); -- retry = 0; -- -- // If we could not create the framebuffer, try again with slightly -- // different parameters in this order: -- // 1. Try with the closest size -- // 2. Try in the opposite screen mode with the original size -- // 3. Try in the opposite screen mode with the closest size -- // This is a somewhat confusing mass of recursion here. -- -- while (fb == NULL || !fb->IsValid ()) -- { -- if (fb != NULL) -- { -- delete fb; -- } -- -- switch (retry) -- { -- case 0: -- owidth = width; -- oheight = height; -- case 2: -- // Try a different resolution. Hopefully that will work. -- I_ClosestResolution (&width, &height, 8); -- break; -- -- case 1: -- // Try changing fullscreen mode. Maybe that will work. -- width = owidth; -- height = oheight; -- fullscreen = !fullscreen; -- break; -- -- default: -- // I give up! -- I_FatalError ("Could not create new screen (%d x %d)", owidth, oheight); -- -- fprintf( stderr, "!!! [SDLGLVideo::CreateFrameBuffer] Got beyond I_FatalError !!!" ); -- return NULL; //[C] actually this shouldn't be reached; probably should be replaced with an ASSERT -- } -- -- ++retry; -- fb = static_cast<SDLGLFB *>(CreateFrameBuffer (width, height, fullscreen, NULL)); -- } -- --// fb->SetFlash (flashColor, flashAmount); -- return fb; --} -- --void SDLGLVideo::SetWindowedScale (float scale) --{ --} -- --bool SDLGLVideo::SetResolution (int width, int height, int bits) --{ -- // FIXME: Is it possible to do this without completely destroying the old -- // interface? --#ifndef NO_GL -- -- if (GLRenderer != NULL) GLRenderer->FlushTextures(); -- I_ShutdownGraphics(); -- -- Video = new SDLGLVideo(0); -- if (Video == NULL) I_FatalError ("Failed to initialize display"); -- --#if (defined(WINDOWS)) || defined(WIN32) -- bits=32; --#else -- bits=24; --#endif -- -- V_DoModeSetup(width, height, bits); --#endif -- return true; // We must return true because the old video context no longer exists. --} -- --//========================================================================== --// --// --// --//========================================================================== -- --bool SDLGLVideo::SetupPixelFormat(bool allowsoftware, int multisample) --{ -- SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 ); -- SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 ); -- SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 ); -- SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 ); -- SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 ); -- SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 8 ); --// SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); -- if (multisample > 0) { -- SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 ); -- SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisample ); -- } -- return true; --} -- --//========================================================================== --// --// --// --//========================================================================== -- --bool SDLGLVideo::InitHardware (bool allowsoftware, int multisample) --{ -- if (!SetupPixelFormat(allowsoftware, multisample)) -- { -- Printf ("R_OPENGL: Reverting to software mode...\n"); -- return false; -- } -- return true; --} -- -- --// FrameBuffer implementation ----------------------------------------------- -- --SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen) -- : DFrameBuffer (width, height) --{ -- static int localmultisample=-1; -- -- if (localmultisample<0) localmultisample=gl_vid_multisample; -- -- int i; -- -- m_Lock=0; -- -- UpdatePending = false; -- -- if (!static_cast<SDLGLVideo*>(Video)->InitHardware(false, localmultisample)) -- { -- vid_renderer = 0; -- return; -- } -- -- -- Screen = SDL_SetVideoMode (width, height, -- 32, -- SDL_HWSURFACE|SDL_HWPALETTE|SDL_OPENGL | SDL_GL_DOUBLEBUFFER|SDL_ANYFORMAT| -- (fullscreen ? SDL_FULLSCREEN : 0)); -- -- if (Screen == NULL) -- return; -- -- m_supportsGamma = -1 != SDL_GetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -- --#if defined(__APPLE__) -- // Need to set title here because a window is not created yet when calling the same function from main() -- char caption[100]; -- mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -- SDL_WM_SetCaption(caption, NULL); --#endif // __APPLE__ --} -- --SDLGLFB::~SDLGLFB () --{ -- if (m_supportsGamma) -- { -- SDL_SetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -- } --} -- -- -- -- --void SDLGLFB::InitializeState() --{ --} -- --bool SDLGLFB::CanUpdate () --{ -- if (m_Lock != 1) -- { -- if (m_Lock > 0) -- { -- UpdatePending = true; -- --m_Lock; -- } -- return false; -- } -- return true; --} -- --void SDLGLFB::SetGammaTable(WORD *tbl) --{ -- SDL_SetGammaRamp(&tbl[0], &tbl[256], &tbl[512]); --} -- --bool SDLGLFB::Lock(bool buffered) --{ -- m_Lock++; -- Buffer = MemBuffer; -- return true; --} -- --bool SDLGLFB::Lock () --{ -- return Lock(false); --} -- --void SDLGLFB::Unlock () --{ -- if (UpdatePending && m_Lock == 1) -- { -- Update (); -- } -- else if (--m_Lock <= 0) -- { -- m_Lock = 0; -- } --} -- --bool SDLGLFB::IsLocked () --{ -- return m_Lock>0;// true; --} -- --bool SDLGLFB::IsFullscreen () --{ -- return (Screen->flags & SDL_FULLSCREEN) != 0; --} -- -- --bool SDLGLFB::IsValid () --{ -- return DFrameBuffer::IsValid() && Screen != NULL; --} -- --void SDLGLFB::SetVSync( bool vsync ) --{ --#if defined (__APPLE__) -- const GLint value = vsync ? 1 : 0; -- CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, &value ); --#endif --} -- --void SDLGLFB::NewRefreshRate () --{ --} -- --void SDLGLFB::SwapBuffers() --{ -- SDL_GL_SwapBuffers (); --} -- -diff --git a/src/sdl/sdlglvideo.h b/src/sdl/sdlglvideo.h -deleted file mode 100644 -index 205e416..0000000 ---- a/src/sdl/sdlglvideo.h -+++ /dev/null -@@ -1,82 +0,0 @@ --#ifndef __SDLGLVIDEO_H__ --#define __SDLGLVIDEO_H__ -- --#include "hardware.h" --#include "v_video.h" --#include <SDL.h> --#include "gl/system/gl_system.h" -- --EXTERN_CVAR (Float, dimamount) --EXTERN_CVAR (Color, dimcolor) -- --struct FRenderer; --FRenderer *gl_CreateInterface(); -- --class SDLGLVideo : public IVideo --{ -- public: -- SDLGLVideo (int parm); -- ~SDLGLVideo (); -- -- EDisplayType GetDisplayType () { return DISPLAY_Both; } -- void SetWindowedScale (float scale); -- -- DFrameBuffer *CreateFrameBuffer (int width, int height, bool fs, DFrameBuffer *old); -- -- void StartModeIterator (int bits, bool fs); -- bool NextMode (int *width, int *height, bool *letterbox); -- bool SetResolution (int width, int height, int bits); -- -- bool SetupPixelFormat(bool allowsoftware, int multisample); -- bool InitHardware (bool allowsoftware, int multisample); -- --private: -- int IteratorMode; -- int IteratorBits; -- bool IteratorFS; --}; --class SDLGLFB : public DFrameBuffer --{ -- DECLARE_CLASS(SDLGLFB, DFrameBuffer) --public: -- // this must have the same parameters as the Windows version, even if they are not used! -- SDLGLFB (void *hMonitor, int width, int height, int, int, bool fullscreen); -- ~SDLGLFB (); -- -- void ForceBuffering (bool force); -- bool Lock(bool buffered); -- bool Lock (); -- void Unlock(); -- bool IsLocked (); -- -- bool IsValid (); -- bool IsFullscreen (); -- -- virtual void SetVSync( bool vsync ); -- void SwapBuffers(); -- -- void NewRefreshRate (); -- -- friend class SDLGLVideo; -- --//[C] -- int GetTrueHeight() { return GetHeight();} -- --protected: -- bool CanUpdate(); -- void SetGammaTable(WORD *tbl); -- void InitializeState(); -- -- SDLGLFB () {} -- BYTE GammaTable[3][256]; -- bool UpdatePending; -- -- SDL_Surface *Screen; -- -- void UpdateColors (); -- -- int m_Lock; -- Uint16 m_origGamma[3][256]; -- bool m_supportsGamma; --}; --#endif --- -2.3.2 - diff --git a/git-cab509c.patch b/git-cab509c.patch deleted file mode 100644 index a48416598850..000000000000 --- a/git-cab509c.patch +++ /dev/null @@ -1,143 +0,0 @@ -From cab509c4d20f0e5e57099d24792a853a7adaa326 Mon Sep 17 00:00:00 2001 -From: Edoardo Prezioso <edo88@email.it> -Date: Thu, 8 Jan 2015 01:39:29 +0100 -Subject: [PATCH] Various improvements to SDL2 video code. - -- Ported the missing resolutions from zdoom. -- Remove unneeded code which was removed also from zdoom. -- Uncomment DOUBLEBUFFER GL attribute. It was present in the old SDL_SetVideoMode call code, so why not. ---- - src/posix/sdl/sdlglvideo.cpp | 60 ++++++++++++++++++-------------------------- - src/posix/sdl/sdlglvideo.h | 1 - - 2 files changed, 25 insertions(+), 36 deletions(-) - -diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp -index 9331c0f..54506b8 100644 ---- a/src/posix/sdl/sdlglvideo.cpp -+++ b/src/posix/sdl/sdlglvideo.cpp -@@ -77,6 +77,7 @@ static MiniModeInfo WinModes[] = - { 720, 480 }, // 16:10 - { 720, 540 }, - { 800, 450 }, // 16:9 -+ { 800, 480 }, - { 800, 500 }, // 16:10 - { 800, 600 }, - { 848, 480 }, // 16:9 -@@ -91,23 +92,33 @@ static MiniModeInfo WinModes[] = - { 1152, 720 }, // 16:10 - { 1152, 864 }, - { 1280, 720 }, // 16:9 -+ { 1280, 854 }, - { 1280, 800 }, // 16:10 - { 1280, 960 }, -- { 1344, 756 }, // 16:9 -+ { 1280, 1024 }, // 5:4 - { 1360, 768 }, // 16:9 -+ { 1366, 768 }, - { 1400, 787 }, // 16:9 - { 1400, 875 }, // 16:10 -- { 1440, 900 }, - { 1400, 1050 }, -+ { 1440, 900 }, -+ { 1440, 960 }, -+ { 1440, 1080 }, - { 1600, 900 }, // 16:9 - { 1600, 1000 }, // 16:10 - { 1600, 1200 }, -- { 1680, 1050 }, // 16:10 -- { 1920, 1080 }, // 16:9 -- { 1920, 1200 }, // 16:10 -- { 2054, 1536 }, -- { 2560, 1440 }, // 16:9 -- { 2880, 1800 } // 16:10 -+ { 1920, 1080 }, -+ { 1920, 1200 }, -+ { 2048, 1536 }, -+ { 2560, 1440 }, -+ { 2560, 1600 }, -+ { 2560, 2048 }, -+ { 2880, 1800 }, -+ { 3200, 1800 }, -+ { 3840, 2160 }, -+ { 3840, 2400 }, -+ { 4096, 2160 }, -+ { 5120, 2880 } - }; - - // CODE -------------------------------------------------------------------- -@@ -115,7 +126,6 @@ static MiniModeInfo WinModes[] = - SDLGLVideo::SDLGLVideo (int parm) - { - IteratorBits = 0; -- IteratorFS = false; - if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { - fprintf( stderr, "Video initialization failed: %s\n", - SDL_GetError( ) ); -@@ -135,38 +145,18 @@ void SDLGLVideo::StartModeIterator (int bits, bool fs) - { - IteratorMode = 0; - IteratorBits = bits; -- IteratorFS = fs; - } - - bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox) - { - if (IteratorBits != 8) - return false; -- -- if (!IteratorFS) -- { -- if ((unsigned)IteratorMode < sizeof(WinModes)/sizeof(WinModes[0])) -- { -- *width = WinModes[IteratorMode].Width; -- *height = WinModes[IteratorMode].Height; -- ++IteratorMode; -- return true; -- } -- } -- else -- { -- SDL_DisplayMode mode = {}, oldmode = {}; -- if(IteratorMode != 0) -- SDL_GetDisplayMode(vid_adapter, IteratorMode-1, &oldmode); -- do -- { -- if (SDL_GetDisplayMode(vid_adapter, IteratorMode, &mode) != 0) -- return false; -- ++IteratorMode; -- } while(mode.w == oldmode.w && mode.h == oldmode.h); - -- *width = mode.w; -- *height = mode.h; -+ if ((unsigned)IteratorMode < sizeof(WinModes)/sizeof(WinModes[0])) -+ { -+ *width = WinModes[IteratorMode].Width; -+ *height = WinModes[IteratorMode].Height; -+ ++IteratorMode; - return true; - } - return false; -@@ -294,7 +284,7 @@ bool SDLGLVideo::SetupPixelFormat(bool allowsoftware, int multisample) - SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 ); - SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 ); - SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 8 ); --// SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); -+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); - if (multisample > 0) { - SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 ); - SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisample ); -diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h -index 3867be6..c2be3ba 100644 ---- a/src/posix/sdl/sdlglvideo.h -+++ b/src/posix/sdl/sdlglvideo.h -@@ -32,7 +32,6 @@ class SDLGLVideo : public IVideo - private: - int IteratorMode; - int IteratorBits; -- bool IteratorFS; - }; - class SDLGLFB : public DFrameBuffer - { --- -2.3.2 - diff --git a/git-fb3bf0e.patch b/git-fb3bf0e.patch deleted file mode 100644 index 327126642bfe..000000000000 --- a/git-fb3bf0e.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fb3bf0eb5868742d1771834588a4bbf3c888ac7d Mon Sep 17 00:00:00 2001 -From: Edoardo Prezioso <edo88@email.it> -Date: Thu, 8 Jan 2015 13:18:00 +0100 -Subject: [PATCH] - Oops, forgot to reinclude missing SDL header. - -Strangely it compiled fine for me, though. ---- - src/posix/sdl/sdlglvideo.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h -index c2be3ba..19e6a5f 100644 ---- a/src/posix/sdl/sdlglvideo.h -+++ b/src/posix/sdl/sdlglvideo.h -@@ -3,6 +3,7 @@ - - #include "hardware.h" - #include "v_video.h" -+#include <SDL.h> - #include "gl/system/gl_system.h" - - EXTERN_CVAR (Float, dimamount) --- -2.3.2 - diff --git a/gitinfo.h b/gitinfo.h deleted file mode 100644 index c6eb7160379b..000000000000 --- a/gitinfo.h +++ /dev/null @@ -1,8 +0,0 @@ -// 0
-//
-// This file was automatically generated by the
-// updaterevision tool. Do not edit by hand.
-
-#define GIT_DESCRIPTION "g2.0.05"
-#define GIT_HASH "279fddf7c7e5efb1a2092ed35ba54ca9543ed9ba"
-#define GIT_TIME "2014-12-27 15:57:09 +0100"
diff --git a/install b/install new file mode 100644 index 000000000000..a3292a2070bc --- /dev/null +++ b/install @@ -0,0 +1,16 @@ +post_install() { + if [[ -x usr/bin/xdg-icon-resource ]]; then + usr/bin/xdg-icon-resource forceupdate + fi + if [[ -x usr/bin/update-desktop-database ]]; then + usr/bin/update-desktop-database -q + fi +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/stack-noexec.patch b/stack-noexec.patch deleted file mode 100644 index 55bb824115a4..000000000000 --- a/stack-noexec.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff -ur a/src/asm_ia32/a.asm b/src/asm_ia32/a.asm ---- a/src/asm_ia32/a.asm 2014-09-10 16:00:39.331095163 +0200 -+++ b/src/asm_ia32/a.asm 2014-09-10 16:00:50.571095050 +0200 -@@ -810,3 +810,13 @@ - GLOBAL _rtext_a_end
- _rtext_a_end:
- %endif
-+
-+%ifidn __OUTPUT_FORMAT__,elf
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf32
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf64
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-diff -ur a/src/asm_ia32/misc.asm b/src/asm_ia32/misc.asm ---- a/src/asm_ia32/misc.asm 2014-09-10 16:00:39.331095163 +0200 -+++ b/src/asm_ia32/misc.asm 2014-09-10 16:00:50.571095050 +0200 -@@ -198,3 +198,13 @@ - pop ebx
- emms
- ret
-+
-+%ifidn __OUTPUT_FORMAT__,elf
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf32
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf64
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-diff -ur a/src/asm_ia32/tmap.asm b/src/asm_ia32/tmap.asm ---- a/src/asm_ia32/tmap.asm 2014-09-10 16:00:39.334428497 +0200 -+++ b/src/asm_ia32/tmap.asm 2014-09-10 16:00:50.571095050 +0200 -@@ -1891,3 +1891,13 @@ - selfmod rtext_start, rtext_end
- call setpitch3
- jmp setvlinebpl_
-+
-+%ifidn __OUTPUT_FORMAT__,elf
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf32
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf64
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-diff -ur a/src/asm_ia32/tmap2.asm b/src/asm_ia32/tmap2.asm ---- a/src/asm_ia32/tmap2.asm 2014-09-10 16:00:39.334428497 +0200 -+++ b/src/asm_ia32/tmap2.asm 2014-09-10 16:00:50.571095050 +0200 -@@ -638,3 +638,13 @@ - GLOBAL _rtext_tmap2_end
- _rtext_tmap2_end:
- %endif
-+
-+%ifidn __OUTPUT_FORMAT__,elf
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf32
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf64
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-diff -ur a/src/asm_ia32/tmap3.asm b/src/asm_ia32/tmap3.asm ---- a/src/asm_ia32/tmap3.asm 2014-09-10 16:00:39.334428497 +0200 -+++ b/src/asm_ia32/tmap3.asm 2014-09-10 16:00:50.574428383 +0200 -@@ -342,3 +342,13 @@ - GLOBAL _rtext_tmap3_end
- _rtext_tmap3_end:
- %endif
-+
-+%ifidn __OUTPUT_FORMAT__,elf
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf32
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-+%ifidn __OUTPUT_FORMAT__,elf64
-+section .note.GNU-stack noalloc noexec nowrite progbits
-+%endif
-diff -ur a/src/asm_x86_64/tmap3.s b/src/asm_x86_64/tmap3.s ---- a/src/asm_x86_64/tmap3.s 2014-09-10 16:00:39.334428497 +0200 -+++ b/src/asm_x86_64/tmap3.s 2014-09-10 16:00:50.574428383 +0200 -@@ -139,3 +139,4 @@ - .align 16 - - -+ .section .note.GNU-stack,"",@progbits |