Compare commits

...
Author SHA1 Message Date
Alug 8d3435291b fix windows compile 2025-10-03 22:41:02 +01:00
Alug 8f007155cd update libbacktrace (win x64) 2025-10-03 21:36:49 +01:00
Alug 58a38ac6c4 add "SATURN_TESTING" define
currently to hide the commit string from titlescreen on release builds
could be used for other crap
wish could use comptime to autogenerate this, but it runs after compile & linking
2025-10-03 16:40:31 +02:00
Alug 1e1dbfc450 oops all include guards 2025-10-03 16:39:51 +02:00
Alug 2eac9fc295 tiny cleanup p_map
also save a little division and abs
2025-10-03 16:39:48 +02:00
indev 4416be2ddc Merge pull request #203 from Indev450/curl-cli-args
CURL cli args
2025-10-02 19:00:29 +03:00
indev 10b52c11ac Add -curl-proxy and -curl-header CLI arguments
-curl-proxy will set proxy used by curl for masterserver requests and
http downloads

-curl-header can receive multiple arguments (like -file), and can either
edit, replace or remove headers from http requests
(srb2kart -curl-header "New-Header: Some Value" "Accept: */*" "User-Agent:"
In this example, New-Header will be added, Accept header will be edited
and User-Agent header will be removed)
2025-10-02 18:57:33 +03:00
Alug db732bd1bd fix non polyvertex path for horizonlines
this was a typo all along, i somehow assumed its just like that, but its not kek
2025-10-02 17:34:51 +02:00
Alug 146d4da72c use floats for calculating ticratescaled
this does not need to be double lel
actually improves performance in some cases
2025-10-02 17:34:51 +02:00
indev 20c570c97c Fix sector sound origin not working (mobj_t wasn't consistent with degenmobj_t) 2025-10-02 16:48:58 +03:00
Alug e550edb93e smol micro optimizations hw_main
- dont check for polyflags (rendersides) inside HWR_Addline, move to HWR_AddPolyObjectSegs
- save some sector checks by assigning pointer HWR_RenderPlane
- check for numpolys instead of numPolyObjects in HWR_Subsector (will only be "true" if theres polyobjs in currently traversed subsector instead of when polyobjs are generally on the map)
2025-10-02 15:10:46 +02:00
Alug fac4d3c2c0 add toggle for frameskip
just in case someone wants to toggle that off for some reason
2025-10-01 14:20:37 +02:00
Alug 7d2bcbd1ee cleanup some stuff w_wad & filesrch
mostly delet some "dead" code
use pathisdirectory for filebrowser to declutter code
properly declare FUNCNORETURN and ATTRNORETURN for some quit functions
2025-10-01 14:20:34 +02:00
Alug f3bbb5af56 ensure ALL savebuffers use Zone memory
fixes a crash when sending an uncompressed save to clients
2025-09-30 22:07:34 +02:00
Alug 8e8ef04860 delet BUGTRAP
psure this never worked anyways
2025-09-30 19:40:24 +02:00
Alug 98b105c02a delet CLIENT_LOADINGSCREEN 2025-09-30 19:35:29 +02:00
Alug ccdb73f861 delet VANILLAJOINNEXTROUND 2025-09-30 19:35:26 +02:00
Alug 9cb150b8eb delet NONET 2025-09-30 19:35:23 +02:00
Alug e6af82f450 delet JOININGAME 2025-09-30 19:35:21 +02:00
Alug 7400eeac2a fix dedicated build compile 2025-09-30 17:27:42 +02:00
Alug 2656a87e46 Signal handler improvements
- Move the backtrace and signal stuff into one "block" in both i_system files
- print the current platform into the crashlog
- dedupe code a little
- make crash messages slightly more understandable
- handle more signals (if they exist)

mostly taken from https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2732
2025-09-30 17:27:33 +02:00
Alug 202e24c69c fix precip not propely accounting for moving fofs (again)
was fixed a while ago, then i broke it again due to performance concerns
now we only update this twice a seconds, and its only for the currently rendered precipmobjs
lets see how it performs
2025-09-29 20:14:36 +02:00
Alug c7d78fe948 only recalc precipfloor twice a second 2025-09-29 20:13:48 +02:00
Alug f381239825 smol changes R_ProjectSprite
- remove oldthing (idk what that was even for)
- properly account for localskins
- save a few FixedMuls during clipping
2025-09-29 13:43:33 +02:00
Alug 394beb7533 rename this 2025-09-29 13:43:30 +02:00
Alug 2ea1ac9331 qs22j: handle cases with (0 or 1) elements to sort
avoid undefined behaviour and return early
if we only have 1 element we can skip all the crap since we dont need to sort anyways
2025-09-28 22:51:35 +02:00
Alug 34f8181e56 dont draw the leveltitle card for each splitscreen player
they just overlap since they draw in the very same place
2025-09-28 21:40:07 +02:00
GenericHeroGuy ab13b28106 Fix ghost hitlist causing zone errors (closes #118)
Beware the wrath of PU_LEVEL
2025-09-28 16:36:55 +02:00
Alug 7e5019bd36 handle D_AutoloadFile better
only malloc stuff if we need it mallocd
2025-09-28 16:29:04 +02:00
Alug 423ca0eca0 redo native keyboard handling
instead of like, constantly checking stuff each frame
Now we check whenever we change the menu entry or open/close the chat or console instead and set sdl textinput mode directly and accordingly no more weird hacking around
this is similar to how srb2classic handles it, just a bit simplified (i dont wanna touch anything menu related if it can be avoided lmao)
this hopefully should resolve any weird remaining issues (lets hope i didnt miss some wonky edge case ugghhh)
TODO: update sdl2 lib on windows to fix issues on sdl side with certain layouts
2025-09-28 16:15:16 +02:00
Alug 939354f483 port over most fixes from srb2classics clang-tidy pr
mostly taken from https://codeberg.org/srb2classic/srb2classic/pulls/156
manually done to ensure we only port things that are guaranteed to not cause any potential desynchs
we should probably run this ourselves sometimes aswell
2025-09-28 16:14:56 +02:00
Alug 418ee2ce5f remove localfile from wadfile struct
this was a leftover from localskins
we check for the "important" flag instead
2025-09-28 09:09:53 +02:00
Alug 934184a006 revert localfile check hack in CL_CheckFiles
this was added ages ago and broke server joining with actual modifieng addons that were not added locally
W_InitFile should already handle this and mark local addons not as important, which would skip those checks eitherway
atleast thats what im hoping
2025-09-28 09:09:50 +02:00
Alug e94ef8d9c3 handle W_VerifyNMUSlumps error in W_InitFile 2025-09-28 09:09:48 +02:00
Alug ba985248ea fix crash when theres no minimap patch
fall back to the "inaccurate" calc from before, so automap may still work
2025-09-27 20:30:34 +02:00
Alug 65bd06aae5 fix some potential leaks 2025-09-27 18:16:23 +02:00
Alug 2434acf825 change comment for PU_PATCH_ROTATED 2025-09-27 16:35:19 +02:00
Alug b85a718500 merge vid dupx and dupy
they always contained the same value, so just remove it
2025-09-27 16:32:40 +02:00
Alug a0e023527c move the "video" stuff in i_video
so its mostly together in the file
2025-09-27 16:32:16 +02:00
Alug a6dce95eca delet vid.buffer
unused memory allocation
2025-09-27 16:30:33 +02:00
Alug f05ac73df6 cache this stuff
slight sprites optimization
2025-09-27 16:30:30 +02:00
Alug c90fe4627b handle rotated patch img buffer allocations better
just always initally allocate it with 1mb size, this is enough for just about everything including gigantamax eevee
if thats not enough, just double our capacity until it fits what we need
this way we save effectively reallocating 99% of the time
this prob can be used for out imgbuf in r_patch, but that needs it allocation size be handled a little differently
2025-09-27 01:44:52 +02:00
Alug 0efedae2c3 remove vid.rowbytes
it was just vid.width lel
2025-09-27 00:30:33 +02:00
Alug a6d6c03a58 fix compiler warning 2025-09-27 00:30:22 +02:00
GenericHeroGuy 2d5664b54a Fix VID_BlitLinearScreen's SSE version ignoring width (closes #128) 2025-09-27 00:30:19 +02:00
Alug a25b3f6e59 oops lmfao this got lost by accident
fixes models kek
2025-09-26 21:41:04 +02:00
Alug 9edcbe22f4 delet apng support
this never really worked so get rid of it
2025-09-26 20:13:51 +02:00
Alug 8f4385c39b fix windoze compile 2025-09-26 17:46:59 +01:00
Alug e383b0885d use uintptr_t to fix compiler warning (srb2classic change) 2025-09-26 15:53:29 +02:00
Alug adcd62ed59 merge GL_ReadScreenTexture and GL_ReadScreenFinalTexture 2025-09-26 15:53:26 +02:00
Gustaf Alhäll 7cdf69c6a1 Fix compiler warning 2025-09-26 15:53:23 +02:00
GenericHeroGuy ee12d25a8f Fix GIF recording at 1x resolution, and stop recording on resolution change
Simplifies the framebuffer management and eliminates the memcpy per frame
2025-09-26 15:53:20 +02:00
GenericHeroGuy 881c9f8e43 Remove GetTexImage stuff 2025-09-26 15:53:17 +02:00
GenericHeroGuy b1ac9f94cd (WIP) Rewrite screen capture code for GIFs
Downscaling is now performed during screen capture instead of GIF writing
This may or may not make GIF recording faster?
Maybe it would be faster if I knew how OpenGL worked...
Regardless, the m*th in the GIF code is gone, fixing the high/odd res issues

Also includes a little deduped hardware code, and GL 4.3 debugging code
2025-09-26 15:53:13 +02:00
Alug 9ab4d01b8c Update README.md
mention dlls just in case
2025-09-25 23:02:26 +02:00
Alug 7378ca8479 Update README.md 2025-09-25 22:39:36 +02:00
Alug a87a7ccbda delet circleci too
non functional psure
2025-09-25 22:00:03 +02:00
Alug 4a5449905b cleanup broken/old stuff
TODO: fix cmake
2025-09-25 21:35:22 +02:00
Alam Ed Arias 3c8bdd7862 SDL2: use SDL_GetSystemRAM() to get total RAM 2025-09-25 16:09:41 +02:00
Alug 9b26f1fdcb make the game fail loud if some critical gl function cant be loaded
also add safety to the portal stencil stuff, if that fails.
everything gl2.0 and newer is not critical and will just prevent some effects from working so that does not need to error loudly
TODO: perhaps actually port renderer switching so this instead will fallback to software if smth fails this late during gl initalization
2025-09-25 16:09:41 +02:00
Alug 76560f4179 enable fbo prints for ogllog file 2025-09-25 16:06:42 +02:00
Alug f48fdda3f3 fixup STATIC_OPENGL
probably should handle the fbo stuff a bit differently
not sure tho in which context STATIC_OPENGL may be ever used though
2025-09-25 16:06:39 +02:00
Alug 2c73593fcd ensure "rawconv" is nulled before reuse
otherwise there might be some leftovers from earlier calls
2025-09-25 03:44:24 +02:00
Alam Ed Arias 4613ec48b3 curl: add code to check the output of curl_multi_*() 2025-09-25 03:14:39 +02:00
Alam Ed Arias 3269b62225 curl: add code to check the output of curl_easy_*() 2025-09-25 03:14:36 +02:00
Alug 7e8f6d759c add missing dummy makefile
dont think this compiles though
2025-09-25 00:29:32 +01:00
Alug 75cfd382f6 fix compile without HAVE_THREADS
we dont have gammacorrectedpalette
2025-09-25 00:29:05 +01:00
Alug e524d3edab remove erronous win_main.h include
this doesent exist since ages anymore lel
2025-09-25 00:25:25 +01:00
Alug 8c9fb9f146 kill off MSVC support completely
delet michealsoft
psure this was broken since quite a long time, now since we use quite a bunch of GNU extensions (and actually rely on the cleanup attribute), supporting this in any way is just too much, so remove everything to declutter the codebase
2025-09-24 21:23:58 +02:00
Alug ff2fc6170d avoid constant reallocations for patch rotation
instead keep our buffers, resize em on need
improves perf a bit
maybe will be changed to free on levelload not sure, depends on how much memory this will allocate
2025-09-24 15:39:21 +01:00
Alug f27cb0ba8f allocate imgbuf for "to patch" conversions only if needed
should save around 64 megs on dedis
2025-09-24 15:39:21 +01:00
Alug 58705fb184 cleanup w_wad again
- add pfree for CLEANUP macro
- use CLEANUP everywhere applicable
- delet duped code
- make directory signatures static and const at file scope
2025-09-24 17:22:09 +02:00
Alug 487b71f82c ensure Addfile filehandle will always be properly closed
TODO: probs could reuse this function in more places where filehandles are used
2025-09-24 00:00:54 +02:00
GenericHeroGuy 2b1b4544f9 Introducing: __attribute__((__cleanup__))
I don't wanna hear about MSVC... or C++...
This fixes NUMEROUS memory leaks introduced by G_ReadDemoHeader,
which I was utterly oblivious to up until an hour ago
2025-09-23 23:57:54 +02:00
Alug af1507b530 fix md5checks breaking for pk3s 2025-09-23 20:23:00 +02:00
Alug a193604d0f revert minimap bounds calculation back to vanilla karts (fixes https://github.com/Indev450/SRB2Kart-Saturn/issues/201) 2025-09-23 20:22:58 +02:00
Alug e359c8dcd0 port blankarts GLDEBUGMESSAGE stuff
credits GenericHeroGuy
switched to use CON_LogMessage for now, since console print functions may die during startup
2025-09-23 00:13:03 +02:00
Alug f0d2685a60 keep some stuff for screentextures
prevent reinit, stack allocations and such
most of these never change and are readonly
this might slightly speedup rendering, though prob negligble
2025-09-22 23:59:55 +02:00
Alug f3de6c15eb force disable fbo if it fails to create 2025-09-22 23:47:44 +02:00
Alug 53cea0a835 move fbo stuff to a better place in r_opengl 2025-09-22 23:44:44 +02:00
Alug 4b4d038ac8 cleanup fbo stuff a bit 2025-09-22 23:38:11 +02:00
Alug 9ba305eb77 add backwards compat support for ogl 2.1 fbo extensions
this should allow older gpus to use the feature aswell, not super clean but seems to work
TODO: refactor this whole crap, switch to seperate read and draw to use blitting and make this multisampling compatible so we can get rid of the messy "downsample" code and have this active by default
2025-09-22 23:37:30 +02:00
176 changed files with 3625 additions and 16640 deletions

No files matched your search

-73
View File
@@ -1,73 +0,0 @@
version: 2
jobs:
build:
working_directory: /root/SRB2
docker:
- image: debian:stretch
environment:
CC: ccache gcc -m32
PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
LIBGME_CFLAGS: -I/usr/include
LIBGME_LDFLAGS: -lgme
CCACHE_COMPRESS: true
WFLAGS: -Wno-unsuffixed-float-constants
GCC49: true
#- image: ubuntu:trusty
# environment:
# CC: ccache gcc -m32
# PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig
# LIBGME_CFLAGS: -I/usr/include
# LIBGME_LDFLAGS: -lgme
# CCACHE_COMPRESS: true
# WFLAGS: -Wno-unsuffixed-float-constants
# GCC48: true
steps:
- run:
name: Add i386 arch
command: dpkg --add-architecture i386
- run:
name: Add STJr PPA
command: |
apt-get -qq update
apt-get -qq -y install dirmngr
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0B1702D71499D9C25F986507F240F4449D3B0EC6
echo "deb http://ppa.launchpad.net/stjr/srb2/ubuntu trusty main" >> /etc/apt/sources.list
- run:
name: Update APT listing
command: apt-get -qq update
- run:
name: Support S3 upload
command: apt-get -qq -y install ca-certificates
- restore_cache:
keys:
- v1-SRB2-APT
- run:
name: Install SDK
command: apt-get -qq -y --no-install-recommends install git build-essential libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
- save_cache:
key: v1-SRB2-APT
paths:
- /var/cache/apt/archives
- checkout
#- run:
# name: Compile without network support and BLUA
# command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1
#- run:
# name: wipe build
# command: make -C src LINUX=1 cleandep
- run:
name: rebuild depend
command: make -C src LINUX=1 clean
- restore_cache:
keys:
- v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
- run:
name: Compile
command: make -C src LINUX=1 ERRORMODE=1 -k
- store_artifacts:
path: /root/SRB2/bin/Linux/Release/
destination: bin
- save_cache:
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
paths:
- /root/.ccache
-436
View File
@@ -1,436 +0,0 @@
default:
image: debian:stable-slim
stages: # List of stages for jobs, and their order of execution
- build
variables:
GIT_STRATEGY: clone
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_PATH
.job_template: &job_build # This job runs in the build stage, which runs first.
stage: build
cache:
- key: ccache-$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME_SLUG
fallback_keys:
- cache-$CI_PROJECT_PATH_SLUG-$CI_DEFAULT_BRANCH
- cache-$CI_PROJECT_PATH_SLUG-default
paths:
- ccache
- ccache_statslog
- key: apt-$CI_JOB_IMAGE
paths:
- apt-cache
unprotect: true
before_script:
- - |
# debconf
echo -e "\e[0Ksection_start:`date +%s`:debconf[collapsed=true]\r\e[0KSetup debconf's environment"
- export DEBIAN_FRONTEND="noninteractive"
- export DEBIAN_PRIORITY="low"
- export DEBCONF_NONINTERACTIVE_SEEN="true"
- |
# debconf
echo -e "\e[0Ksection_end:`date +%s`:debconf\r\e[0K"
- - |
# dpkg_aa
echo -e "\e[0Ksection_start:`date +%s`:dpkg_aa[collapsed=true]\r\e[0KAdding architectures to dpkg"
- dpkg --add-architecture i386
- dpkg --add-architecture amd64
- dpkg --add-architecture arm64
- |
# dpkg_aa
echo -e "\e[0Ksection_end:`date +%s`:dpkg_aa\r\e[0K"
- - |
# apt_conf
echo -e "\e[0Ksection_start:`date +%s`:apt_conf[collapsed=true]\r\e[0KSetting up APT conf"
- export APT_CACHE_DIR=`pwd`/apt-cache
- mkdir --parents --verbose $APT_CACHE_DIR/partial/
- touch /etc/apt/apt.conf.d/99build
- |
# apt.conf
echo Adding options to apt.conf':'
- |
# APT::Install-Recommends
echo APT::Install-Recommends "false"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# quit
echo quiet "1"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# APT::Get::Assume-Yes
echo APT::Get::Assume-Yes "true"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# Dir::Cache::Archives
echo Dir::Cache::Archives "$APT_CACHE_DIR"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# apt_conf
echo -e "\e[0Ksection_end:`date +%s`:apt_conf\r\e[0K"
- - |
# apt_update
echo -e "\e[0Ksection_start:`date +%s`:apt_update[collapsed=true]\r\e[0KUpdating APT listing"
- apt-get update
- |
# apt_update
echo -e "\e[0Ksection_end:`date +%s`:apt_update\r\e[0K"
- - |
# apt_pre
echo -e "\e[0Ksection_start:`date +%s`:apt_pre[collapsed=true]\r\e[0KInstalling pre packages"
- apt-get install apt-utils
- |
# apt_pre
echo -e "\e[0Ksection_end:`date +%s`:apt_pre\r\e[0K"
- - |
# apt_upgrade
echo -e "\e[0Ksection_start:`date +%s`:apt_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
- apt-get upgrade
- |
# apt_update
echo -e "\e[0Ksection_end:`date +%s`:apt_upgrade\r\e[0K"
- - |
# apt_common
echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages"
- apt-get install make git ccache
- |
# apt_common
echo -e "\e[0Ksection_end:`date +%s`:apt_common\r\e[0K"
- - |
# ccache_config
echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
- mkdir --parents --verbose ~/.ccache/
- touch ~/.ccache/ccache.conf
- |
# cache.conf
echo Adding ccache configution option
- |
# base_dir
echo base_dir = $PWD | tee --append ~/.ccache/ccache.conf
- |
# cache_dir
echo cache_dir = $PWD/ccache | tee --append ~/.ccache/ccache.conf
- |
# compiler_check
echo compiler_check = content | tee --append ~/.ccache/ccache.conf
- |
# stats_log
echo stats_log = $PWD/ccache_statslog | tee --append ~/.ccache/ccache.conf
- |
# max_size
echo max_size = 50M | tee --append ~/.ccache/ccache.conf
- |
# ccache_config
echo -e "\e[0Ksection_end:`date +%s`:ccache_config\r\e[0K"
- - |
# cache_reset
echo -e "\e[0Ksection_start:`date +%s`:ccache_reset[collapsed=true]\r\e[0KResetting ccache statistics"
- ccache --zero-stats
- ccache --show-stats
- |
# ccache_reset
echo -e "\e[0Ksection_end:`date +%s`:ccache_reset\r\e[0K"
after_script:
- - |
# apt_clean
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
- apt-get autoclean
- |
# apt_clean
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats --verbose
- ccache --show-log-stats --verbose
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
Debian testing GCC:
<<: *job_build
image: debian:testing-slim
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian GCC testing"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
variables:
CC: gcc
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Windows x86:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32"
variables:
PREFIX: i686-w64-mingw32
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-mingw-w64-i686-win32
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:amd64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian amd64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86-64"
variables:
CC: x86_64-linux-gnu-gcc
OBJCOPY: x86_64-linux-gnu-objcopy
OBJDUMP: x86_64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-x86-64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libgme-dev:amd64 libopenmpt-dev:amd64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:i386:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian i386"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-i686"
variables:
CC: i686-linux-gnu-gcc
OBJCOPY: i686-linux-gnu-objcopy
OBJDUMP: i686-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-i686-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libgme-dev:i386 libopenmpt-dev:i386
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:arm64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-aarch64"
variables:
CC: aarch64-linux-gnu-gcc
OBJCOPY: aarch64-linux-gnu-objcopy
OBJDUMP: aarch64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-aarch64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libgme-dev:arm64 libopenmpt-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Windows x64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Win64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64"
variables:
PREFIX: x86_64-w64-mingw32
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-mingw-w64-x86-64-win32
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable Clang:
<<: *job_build
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian Clang"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
variables:
CC: clang
WFLAGS: -Wno-cast-align
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install clang
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian testing Clang:
extends: Debian stable Clang
image: debian:testing-slim
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debina Clang testing"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
variables:
CC: clang
WFLAGS: -Wno-cast-align -Wno-deprecated-non-prototype
-712
View File
@@ -1,712 +0,0 @@
# Travis-CI Config
#
# You may use the Deployer to upload packages and builds to external servers.
# See deployer/travis/deployer_defaults.sh for environment variables to configure.
language: c
sudo: required
dist: trusty
matrix:
include:
################################
# Test Buildbots
# Deployer does not operate on these. See Deployer Buildbots, below.
# These bots are disabled when a deployment is triggered by 'deployer' branch name AND DPL_TERMINATE_TESTS=1.
# These bots remain enabled when a deployment is triggered by release tag.
################################
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.4
compiler: gcc-4.4
env: GCC44=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.6
compiler: gcc-4.6
env: GCC46=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.7
compiler: gcc-4.7
env: GCC47=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-4.7
- os: linux
compiler: gcc
env: GCC48=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
env: GCC48=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-7
compiler: gcc-7
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" GCC72=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-8
compiler: gcc-8
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow -Wno-error=format-truncation" GCC81=1
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0
- os: linux
compiler: clang
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#clang version 3.5.0 (tags/RELEASE_350/final)
- os: linux
addons:
apt:
sources:
- llvm-toolchain-precise-3.5
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- clang-3.5
compiler: clang-3.5
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
- os: linux
addons:
apt:
sources:
- llvm-toolchain-precise-3.6
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- clang-3.6
compiler: clang-3.6
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#Ubuntu clang version 3.6.2-svn240577-1~exp1 (branches/release_36) (based on LLVM 3.6.2)
- os: linux
addons:
apt:
sources:
- llvm-toolchain-precise-3.7
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- clang-3.7
compiler: clang-3.7
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#Ubuntu clang version 3.7.1-svn253571-1~exp1 (branches/release_37) (based on LLVM 3.7.1)
- os: linux
addons:
apt:
sources:
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- clang-3.8
compiler: clang-3.8
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#clang version 3.8.1-svn271127-1~exp1 (branches/release_38)
- os: linux
addons:
apt:
sources:
- llvm-toolchain-precise-3.9
- ubuntu-toolchain-r-test
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- clang-3.9
compiler: clang-3.9
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#clang version 3.9.X
# - os: linux
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-4.0
# - ubuntu-toolchain-r-test
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - clang-4.0
# compiler: clang-4.0
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #clang version 4.0.X
# - os: linux
# addons:
# apt:
# sources:
# - llvm-toolchain-precise-5.0
# - ubuntu-toolchain-r-test
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - clang-5.0
# compiler: clang-5.0
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #clang version 5.0.X
# - os: osx
# osx_image: beta-xcode6.1
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
# - os: osx
# osx_image: beta-xcode6.2
# compiler: gcc
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
## - os: osx
## osx_image: beta-xcode6.3
## if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
## #I think xcode.6.3 VM is broken, it does not boot
# - os: osx
# osx_image: xcode6.4
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
# - os: osx
# osx_image: xcode7
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 7.0.0 (clang-700.0.72)
# - os: osx
# osx_image: xcode7.1
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 7.0.0 (clang-700.1.76)
# - os: osx
# osx_image: xcode7.2
# if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
# #Apple LLVM version 7.0.2 (clang-700.1.81)
# - os: osx
# osx_image: xcode7.3
# #Apple LLVM version 7.3.0 (clang-703.0.31)
# - os: osx
# osx_image: xcode7.3
# #Apple LLVM version 7.3.0 (clang-703.0.31)
- os: osx
if: env(DPL_ENABLED) != "1" OR env(DPL_TERMINATE_TESTS) != "1" OR NOT branch =~ /^.*deployer.*$/
#Default: macOS 10.13 and Xcode 9.4.1
################################
# Deployer Buildbots - OSX
################################
- os: osx
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=osx
- _DPL_FTP_TARGET=1
- _DPL_PACKAGE_BINARY=1
#Apple LLVM version 7.3.0 (clang-703.0.31)
################################
# Deployer Buildbots - Linux assets
# Set DPL_TERMINATE_ASSETS to disable all of these
# List Ubuntu LTS next, newest to oldest
# Then list non-LTS, newest to oldest
################################
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_ASSETS) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=bionic-asset
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- _DPL_PACKAGE_MAIN=0
- _DPL_PACKAGE_ASSET=1
- PACKAGE_DISTRO=bionic
#- PACKAGE_SUBVERSION=~18.04bionic
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
################################
# The below asset bots produce packages that occupy too much space.
# It would be nice if the asset files were not included in the source package itself,
# so these can deploy to each Ubuntu target without manual intervention.
#
# Currently, to get around Launchpad's space limitation,
# copy the packages from *one* bot and the space usage is not increased.
################################
# - os: linux
# addons:
# apt:
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - gcc-4.8
# compiler: gcc-4.8
# dist: trusty
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
# AND env(DPL_TERMINATE_ASSETS) != "1"
# env:
# - _DPL_JOB_ENABLED=1
# - _DPL_JOB_NAME=trusty-asset
# - _DPL_DPUT_TARGET=1
# - _DPL_PACKAGE_SOURCE=1
# - _DPL_PACKAGE_MAIN=0
# - _DPL_PACKAGE_ASSET=1
# - PACKAGE_DISTRO=trusty
# #- PACKAGE_SUBVERSION=~14.04trusty
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
# - os: linux
# addons:
# apt:
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - gcc-4.8
# compiler: gcc-4.8
# dist: xenial
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
# AND env(DPL_TERMINATE_ASSETS) != "1"
# env:
# - _DPL_JOB_ENABLED=1
# - _DPL_JOB_NAME=disco-asset
# - _DPL_DPUT_TARGET=1
# - _DPL_PACKAGE_SOURCE=1
# - _DPL_PACKAGE_MAIN=0
# - _DPL_PACKAGE_ASSET=1
# - PACKAGE_DISTRO=disco
# #- PACKAGE_SUBVERSION=~19.04disco
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
# - os: linux
# addons:
# apt:
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - gcc-4.8
# compiler: gcc-4.8
# dist: xenial
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
# AND env(DPL_TERMINATE_ASSETS) != "1"
# env:
# - _DPL_JOB_ENABLED=1
# - _DPL_JOB_NAME=cosmic-asset
# - _DPL_DPUT_TARGET=1
# - _DPL_PACKAGE_SOURCE=1
# - _DPL_PACKAGE_MAIN=0
# - _DPL_PACKAGE_ASSET=1
# - PACKAGE_DISTRO=cosmic
# #- PACKAGE_SUBVERSION=~18.10cosmic
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
# - os: linux
# addons:
# apt:
# packages:
# - libsdl2-mixer-dev
# - libpng-dev
# - libgl1-mesa-dev
# - libgme-dev
# - p7zip-full
# - gcc-4.8
# compiler: gcc-4.8
# dist: xenial
# if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
# AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
# AND env(DPL_TERMINATE_ASSETS) != "1"
# env:
# - _DPL_JOB_ENABLED=1
# - _DPL_JOB_NAME=xenial-asset
# - _DPL_DPUT_TARGET=1
# - _DPL_PACKAGE_SOURCE=1
# - _DPL_PACKAGE_MAIN=0
# - _DPL_PACKAGE_ASSET=1
# - PACKAGE_DISTRO=xenial
# #- PACKAGE_SUBVERSION=~16.04xenial
# #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
################################
# Deployer Buildbots - Linux binaries
# List Ubuntu LTS, newest to oldest
# Then list non-LTS, newest to oldest
################################
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=focal
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=focal
- PACKAGE_SUBVERSION=~20.04focal
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=bionic
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=bionic
- PACKAGE_SUBVERSION=~18.04bionic
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=xenial
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=xenial
- PACKAGE_SUBVERSION=~16.04xenial
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: trusty
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=trusty
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=trusty
- PACKAGE_SUBVERSION=~14.04trusty
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
- os: linux
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- libcurl4-openssl-dev
- p7zip-full
- gcc-4.8
compiler: gcc-4.8
dist: xenial
if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1")
AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1"))
AND env(DPL_TERMINATE_MAIN) != "1"
env:
- _DPL_JOB_ENABLED=1
- _DPL_JOB_NAME=eoan
- _DPL_DPUT_TARGET=1
- _DPL_PACKAGE_SOURCE=1
- PACKAGE_DISTRO=eoan
- PACKAGE_SUBVERSION=~19.10eoan
#gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
allow_failures:
- compiler: clang-3.5
- compiler: clang-3.6
- compiler: clang-3.7
- compiler: clang-3.8
- compiler: clang-3.9
- compiler: clang-4.0
- compiler: clang-5.0
cache:
apt: true
ccache: true
directories:
- $HOME/srb2_cache
addons:
apt:
packages:
- libsdl2-mixer-dev
- libpng-dev
- libgl1-mesa-dev
- libgme-dev
- zlib1g-dev
- libcurl4-openssl-dev
- p7zip-full
homebrew:
taps:
- mazmazz/srb2
packages:
- sdl2_mixer
- game-music-emu
- p7zip
- cmake
- curl
update: true
before_install:
# Initialize Deployer defaults
- . ./deployer/travis/deployer_defaults.sh
# Initialize Deployer; check if Deployer is enabled
# This needs to be run in the current shell so that $__DPL_ACTIVE is set for this session
- . ./deployer/travis/deployer.sh
# Also check if we should now terminate -- see `deployer.sh` for conditions.
# This should never happen on non-release buildbots when Deployer is not triggered.
- if [[ "$__DPL_TRY_TERMINATE_EARLY" == "1" ]]; then
if [[ "$__DPL_ACTIVE" != "1" ]]; then
echo "Exiting early because this job is not deploying.";
exit;
fi;
fi
# If we're triggered by release tag, force ASSET_FILES_OPTIONAL_GET=1
- if [[ "$__DPL_TAG_ELIGIBLE" = "1" ]]; then
ASSET_FILES_OPTIONAL_GET=1;
fi;
install:
# Install OS X library dependencies via Homebrew
# Do this differently for release buildbots:
# * `brew install --build-bottle` builds libraries for x86_64's lowest common denominator CPU, core2
# * `sdl2_mixer` requires options from the formula tap https://github.com/mazmazz/homebrew-srb2
# * `brew postinstall` runs post-install scripts after building a bottle
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$__DPL_ACTIVE" == "1" ]]; then
brew install --build-bottle sdl2 game-music-emu;
brew install --build-bottle mazmazz/srb2/sdl2_mixer --with-flac --with-mpg123;
brew postinstall sdl2 game-music-emu mazmazz/srb2/sdl2_mixer;
fi;
fi
- mkdir -p $HOME/srb2_cache
before_script:
# OLDPWD is root repo folder
- OLDPWD=$PWD
- __ASSET_DIRECTORY="$OLDPWD/assets/installer"
- mkdir -p "$__ASSET_DIRECTORY"
- cd "$HOME/srb2_cache"
# Get stat command so we know what the cached archive date is.
# stat is different for OSX
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
STATCMD="stat -f %m";
else
STATCMD="stat -c %y";
fi
# Get asset files (required for MD5)
# See `deployer_defaults.sh` for asset download path
- if [[ "$ASSET_ARCHIVE_PATH" != "" ]]; then
if [ -f "$(basename $ASSET_ARCHIVE_PATH)" ]; then
echo "$(basename $ASSET_ARCHIVE_PATH) cache date -- $($STATCMD $(basename $ASSET_ARCHIVE_PATH))";
fi;
wget --verbose --server-response -N "$ASSET_ARCHIVE_PATH";
7z x "$(basename $ASSET_ARCHIVE_PATH)" -o"$__ASSET_DIRECTORY" -aos;
fi;
# Get optional files too
- if [[ "$__DPL_ACTIVE" == "1" ]] && [[ "$ASSET_FILES_OPTIONAL_GET" == "1" ]] && [[ "$ASSET_ARCHIVE_OPTIONAL_PATH" != "" ]]; then
if [ -f "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH)" ]; then
echo "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH) cache date -- $($STATCMD $(basename $ASSET_ARCHIVE_OPTIONAL_PATH))";
fi;
wget --verbose --server-response -N "$ASSET_ARCHIVE_OPTIONAL_PATH";
7z x "$(basename $ASSET_ARCHIVE_OPTIONAL_PATH)" -o"$__ASSET_DIRECTORY" -aos;
fi;
# Go back to root repo folder
- cd "$OLDPWD"
# Prepare CMake asset lists
- SRB2_ASSET_HASHED=$(echo ${ASSET_FILES_HASHED// /\;})
- SRB2_ASSET_DOCS=$(echo ${ASSET_FILES_DOCS// /\;})
- SRB2_ASSET_DIRECTORY="$__ASSET_DIRECTORY"
# Prepare CMake
- mkdir build
- cd build
- mkdir package
- export CFLAGS="-Wall -W -Werror $WFLAGS"
- export CCACHE_COMPRESS=true
# If OS X, set -march=core2 to build compatible binaries with old Macs
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CFLAGS="${CFLAGS} -march=core2";
fi;
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/bin -DCPACK_PACKAGE_DIRECTORY=$PWD/package
-DSRB2_ASSET_HASHED="${SRB2_ASSET_HASHED}" -DSRB2_ASSET_DOCS="${SRB2_ASSET_DOCS}"
-DSRB2_ASSET_DIRECTORY="${SRB2_ASSET_DIRECTORY}"
-DCPACK_PACKAGE_DESCRIPTION_SUMMARY="${PROGRAM_NAME}"
-DCPACK_PACKAGE_VENDOR="${PROGRAM_VENDOR}"
-DSRB2_SDL2_EXE_NAME="${PROGRAM_FILENAME}"
script:
# Build our Makefile from Cmake!
- if [[ "$__DPL_ACTIVE" == "1" ]]; then
. ../deployer/travis/deployer_build.sh;
else
make -k;
fi;
after_success:
# Run the upload scripts
# These do nothing if Deployer is not triggered
- . ../deployer/travis/deployer_ftp.sh
- . ../deployer/travis/deployer_dput.sh
-269
View File
@@ -1,269 +0,0 @@
# Doxyfile 1.4.3
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = SRB2
PROJECT_NUMBER = 1.09
OUTPUT_DIRECTORY = ./doc/SRB2
CREATE_SUBDIRS = YES
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./src
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox
RECURSIVE = YES
EXCLUDE = ./src/sdl/IMG_xpm.c \
./src/sdl/SRB2DC/scramble.c
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */src/hardware/*/* \
*/src/sdl/SDL_main/* \
*/src/*/*_private.h \
*/src/sdl/*/*help.? \
*/src/md5.? \
*/src/sdl/filter/*
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
#USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = YES
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN \
HWRENDER \
DIRECTFULLSCREEN \
HW3SOUND \
LOGMESSAGES \
WALLSPLATS \
FLOORSPLATS
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
+17 -85
View File
@@ -1,103 +1,35 @@
# SRB2Kart: Saturn
# SRB2Kart-Saturn
SRB2Kart-Saturn is a modification of SRB2Kart with a focus on new Features, Fixes, Optimizations and general Improvements, all while retaining 100% compatibility with vanilla SRB2Kart.
[SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
## Saturn Features (Take a look at the "Saturn Options" menu c;)
For more information on Saturn´s features check out the changelogs on the [Releases](https://github.com/Indev450/SRB2Kart-Saturn/releases) page and the ingame "Saturn Options" menu.
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
- `addfilelocal` Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
- Palette rendering, make the OpenGL renderer (almost) look like software mode!
- OpenMPT for Tracker module playback instead of GME
- Fixes looping and sounds better
- Allows filter configuration
- Colourize your Kart HUD, to either your player color or whichever colour you like! (optional / requieres extra2.kart file)
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
- Lua HUD hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
- Lua HUD hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
- Saltyhop! do a funny hop
- Smaller Speedometer (optional / requieres extra.kart file)
- Record Attack input display can now be used everywhere
- Smaller minimap icons and also show player names on the minimap (toggable)
- Support for animated votescreens!
- `showmusiccredit` command, shows you the current music track again
- `listskins` show a list of all skins currently loaded
- Visual Portals from Haya's HEP Client
- Horizonline effect in OpenGL (watch the endless bricks on SNES Bowsers Castle!)
- Localskins! use whatever skin you like!
- Toggable lowercase menu's also from Haya's HEP client
- Everything that Galaxy has
Also be sure to check the LUASTUFF file for more information on all the extra lua features Saturn has.
## Improvements / Bug fixes
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen
- can be set to 100MiB max with `maxdemosize` command in console
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music)
- The mapper still has to provide a MusicDEF for this to work.
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
- Characters now spin in skin selection menu (configurable)
- HTTP Addon download speed has been raised dramatically
- configurable with `downloadspeed` command
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
- The Position Number in the corner is alot smaller now (half the size!)
- Toggable Lap animation
- Main menu shows the current renderer being used
- MSAA and A2C Antialiasing support (Configurable in renderer.txt file)
- A simple button to rejoin your last visited server
- Ability to show ALL maps in the mapselect screen, this includes hidden or hellmaps "showallmaps yes/no"
- Ability to toggle the Stagetitlecard "maptitles on/off"
## Performance / Debugging
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
- Lua shows Tracebacks whenever an error occurs
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss
- Intermission backgrounds, heat wave effects and etc are broken with this
- `ffloorclip`, exclusive to Software, which boosts performance on maps with many Floor over Floor sectors
## Technical fixes
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
- FOFs intersecting with slopes have less issues and now render correctly in Opengl
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
- The annoying depraction messages for `P_TeleportMove` and `P_AproxDistance` have been silenced
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
- Added a small cooldown on `map` command due to spamming causing a SIGSEGV
- Many bugfixes to the Software renderer, so its much less prone to crashing
- Many bugfixes to the OpenGL renderer (too many too list all of them here; check the changelogs for more information)
- Bugfixes to the soundsystem, mainly regarding Sound muting
- Refactored Zone Memory Allocations (helps a bit with large maps)
- Many many more crash fixes and other bugfixes to the basegame (too many too list all of them here; check the changelogs for more information)
- Crash Backtraces have been replaced by libbacktrace (except for 32bit Windows builds)
Crashlogs now contain alot more informations. and even more if your build has debug symbols
Also allows 64bit Windows builds to produce Crashlogs!
## MISC
- Bird's Camera Tilting feature is no longer turned on by default
- Bird's warning on the title screen has been removed
## Bugs
- On maps which change the song multiple times on map start (exp: Wandering Falls) may show multiple music credits appearing
- A2C antialiasing makes transparent surfaces even more transparent
- You tell us! c:
## Note
Check the LUASTUFF file for more information on all the lua things Saturn has.
We also have a Flatpak available on [Flathub](https://flathub.org/en/apps/org.srb2.SRB2Kart-Saturn)! (many thanks to riomccloud!)
## Dependencies
- SDL2 (Linux/OS X only)
- SDL2-Mixer (Linux/OS X only)
- libupnp (Linux/OS X only)
- libgme (Linux/OS X only)
- libopenmpt (Linux/OS X only)
- libbacktrace (Linux/OS X only)
- libbacktrace (Linux/OS X only, optional, disable support with NOLIBBACKTRACE)
- libupnp (Linux/OS X only, optional, enable support with HAVE_MINIUPNPC)
## Compiling
See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling). The compiling process for SRB2Kart is largely identical to SRB2.
Currently only the Makefile build system with GCC or Clang compiler is supported.
Visual C++ (MSVC) is unsupported.
64-bit Windows builds are supported and recommended over 32-bit builds, they will build automatically when using the MSYS2 MinGW 64-bit executable (requires the mingw-w64-x86_64-gcc package), no extra flags needed!
The specific DLLs can be found under /libs/dll-binaries/(i686 for 32bit/x86_64 for 64-bit)/ or in the Release packages
Alternatively the [srb2bld](https://github.com/Bijman/srb2bld) script by Bijman can be used aswell!
## Disclaimer
Kart Krew is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.
-2136
View File
File diff suppressed because it is too large. Load diff
-3033
View File
File diff suppressed because it is too large. Load diff
-133
View File
@@ -1,133 +0,0 @@
version: 1.3.{branch}-{build}
os: MinGW
environment:
CC: ccache
CCACHE_CC: i686-w64-mingw32-gcc
CCACHE_CC_64: x86_64-w64-mingw32-gcc
WINDRES: windres
# c:\mingw-w64 i686 has gcc 6.3.0, so use c:\msys64 7.3.0 instead
MINGW_SDK: c:\msys64\mingw32
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
MINGW_SDK_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
UPX_ZIP: upx391w
UPX_URL: http://upx.sourceforge.net/download/upx391w.zip
CCACHE_EXE: ccache.exe
CCACHE_URL: http://alam.srb2.org/ccache.exe
CCACHE_COMPRESS: true
CCACHE_DIR: C:\Users\appveyor\.ccache
# Disable UPX by default. The user can override this in their Appveyor project settings
NOUPX: 1
##############################
# DEPLOYER VARIABLES
# DPL_ENABLED=1 builds installers for branch names starting with `deployer`.
# DPL_TAG_ENABLED=1 will also build installers for release tags. DPL_ENABLED=1 must also be set.
# Set these in the Appveyor project settings
##############################
DPL_ENABLED: 0
DPL_TAG_ENABLED: 0
DPL_INSTALLER_NAME: srb2kart-v13
# Asset handling is barebones vs. Travis Deployer. We operate on 7z only.
# Include the README files and the OpenGL batch in the main and patch archives.
# The x86/x64 archives contain the DLL binaries.
ASSET_ARCHIVE_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-assets.7z
ASSET_ARCHIVE_PATCH_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-patch-assets.7z
ASSET_ARCHIVE_X86_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-x86-assets.7z
ASSET_ARCHIVE_X64_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-x64-assets.7z
ASSET_ARCHIVE_OPTIONAL_PATH: https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-optional-assets.7z
# This is overridden to 1 for release tag builds
ASSET_FILES_OPTIONAL_GET: 0
# For patches, also include the X86/X64 DLLs.
PACKAGE_PATCH_DLL_GET: 0
# Delete all asset downloads so they can be redownloaded
ASSET_CLEAN: 0
cache:
- upx391w.zip
- ccache.exe
- C:\Users\appveyor\.ccache
- C:\Users\appveyor\srb2_cache
install:
- if [%CONFIGURATION%] == [SDL64] ( set "X86_64=1" )
- if [%CONFIGURATION%] == [SDL64] ( set "CONFIGURATION=SDL" )
- if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
- if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" )
- if not exist "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip"
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0
- if not exist "%CCACHE_EXE%" appveyor DownloadFile "%CCACHE_URL%" -FileName "%CCACHE_EXE%"
- ccache -M 99M
- xcopy /Y /V /I ccache.exe "%MINGW_SDK%\bin"
configuration:
- SDL
#- SDL64
before_build:
- set "Path=%MINGW_SDK%\bin;%Path%"
- if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version )
- mingw32-make --version
- if not [%NOUPX%] == [1] ( upx -V )
- ccache -V
- ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
- if defined [%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%] ( set "COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%" ) else ( set "COMMIT=%APPVEYOR_REPO_COMMIT%" )
- cmd: git rev-parse --short %COMMIT%>%TMP%/gitshort.txt
- cmd: set /P GITSHORT=<%TMP%/gitshort.txt
# for pull requests, take the owner's name only, if this isn't the same repo of course
- set "REPO=%APPVEYOR_REPO_BRANCH%"
- if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [] ( if not [%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%] == [%APPVEYOR_REPO_NAME%] ( for /f "delims=/" %%a in ("%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%") do set "REPO=%%a-%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%" ) )
- set "EXENAME=EXENAME=srb2win-%REPO%-%GITSHORT%.exe"
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 NOOBJDUMP=1 %NOUPX% %EXENAME%"
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1 GCC81=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
build_script:
- cmd: mingw32-make.exe %SRB2_MFLAGS% clean
- cmd: mingw32-make.exe %SRB2_MFLAGS% ERRORMODE=1 -k
after_build:
- if [%X86_64%] == [1] (
set "BUILD_PATH=bin\Mingw64\Release"
) else (
set "BUILD_PATH=bin\Mingw\Release"
)
- if [%X86_64%] == [1] ( set "CONFIGURATION=%CONFIGURATION%64" )
- ccache -s
- set BUILD_ARCHIVE=%REPO%-%GITSHORT%-%CONFIGURATION%.7z
- set BUILDSARCHIVE=%REPO%-%CONFIGURATION%.7z
- cmd: 7z a %BUILD_ARCHIVE% %BUILD_PATH% -xr!.gitignore
- appveyor PushArtifact %BUILD_ARCHIVE%
- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE%
- appveyor PushArtifact %BUILDSARCHIVE%
##############################
# DEPLOYER SCRIPT
##############################
- if [%DPL_ENABLED%] == [1] ( call "deployer\appveyor\deployer.bat" )
test: off
#deploy:
# - provider: FTP
# protocol: ftps
# host:
# secure: NsLJEPIBvmwCOj8Tg8RoRQ==
# username:
# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA=
# password:
# secure: Hbn6Uy3lT0YZ88yFJ3aW4w==
# folder: appveyor
# application:
# active_mode: false
# on:
# branch: master
# appveyor_repo_tag: true
on_finish:
#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:<ip>:<port>
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-70
View File
@@ -1,70 +0,0 @@
srb2 for Debian
---------------
SRB2 Debian package!
Hi there, to rebuild these packages just use debuild in the root source directory (not /src!).
You can build these with or without a key if you want, but if you want to put these on a repo,
generate your own GnuPG key as per the https://help.ubuntu.com/community/GnuPrivacyGuardHowto
instructions and pass the -k<keyid> command to debuild. Make sure you export the key footprint
and give them to your users to install with apt-key add. Thanks!
-- Callum Dickinson <gcfreak_ag20@hotmail.com> Fri, 26 Nov 2010 18:25:31 +1300
---------------
Templating
Note that you MUST run [repo-root]/debian_template.sh before running debuild
on these scripts! debian_template.sh fills these template files with working values.
You should also set PACKAGE_NAME_EMAIL="John Doe <jdoe@example.com>" to match
the identity of the key you will use to sign the package.
Building for Launchpad PPA
Use these steps to prepare building a source package for Launchpad:
1. cd [repo-root]
2. git reset --hard; git clean -fd; git clean -fx;
* Resets your repo folder to a committed state and removes untracked files
* If you built srb2-data in the assets/ folder, MAKE SURE THAT FOLDER DOES NOT HAVE ASSETS,
OR THEY MAY BE INCLUDED IN THE MAIN SOURCE PACKAGE!
Build the source package:
1. source [repo-root]/debian_template.sh
* Initializes defaults for the package variables and fills in templates.
2. debuild -S (builds the source package for Launchpad)
Signing for Launchpad PPA
First, follow Callum's instructions to generate a GnuPG key with your identity. You will need
to publish the fingerprint of that key to Ubuntu's key server.
https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver
Next, you will have to add that key fingerprint to your Launchpad account. Go to your Launchpad
profile and click the yellow Edit button next to "OpenPGP keys". Once you add the key, you can
upload signed source packages and publish them onto your PPA.
IF YOU UPLOAD A PACKAGE and Launchpad does NOT send you a confirmation or rejection email, that
means your key is not set up correctly with your Launchpad account.
Finally, if your packages have not already been signed, follow these steps:
1. cd ..
* Packages are located in the parent folder of where debuild was called
2. debsign "srb2_[version]_source.changes"
* You may need to specify -k [key-fingerprint]
Uploading for Launchpad PPA
Follow the instructions at <https://help.launchpad.net/Packaging/PPA/Uploading> to upload
to your PPA and have Launchpad build your binary deb packages.
-- Marco Zafra <marco.a.zafra@gmail.com> Mon, 26 Nov 2018 21:13:00 -0500
-46
View File
@@ -1,46 +0,0 @@
srb2 for Debian
---------------
Here it is! SRB2 v2.1.2 source code!
GNU/Linux
~~~
Dependencies:
SDL 1.2.7 or better (from libsdl.org)
SDL_Mixer 1.2.2(.7 for file-less music playback) (from libsdl.org)
Nasm (use NOASM=1 if you don't have it or have an non-i386 system, I think)
libPNG 1.2.7
Zlib 1.2.3
The Xiph.org libogg and libvorbis libraries
The OpenGL headers (from Mesa, usually shipped with your X.org or XFree
installation, so you needn't worry, most likely)
GCC 3.x toolchain and binutils
GNU Make
Build instructions:
make -C src LINUX=1
Build instructions for non-X86 devices (such as X64):
make -C src LINUX=1 NONX86=1
Build instructions to build for Wii Linux/SRB2Wii on a PowerPC system,
follow cross-compiling instructions for cross-compiling on a x86 system:
make -C src LINUX=1 WIILINUX=1
Build instructions to build for Pandora (Linux) on a ARM system,
follow cross-compiling instructions for cross-compiling on a x86 system:
make -C src PANDORA=1
-------------------------------------------------------------------------------
binaries will turn in up in bin/
note: read the src/makefile for more options
- Sonic Team Junior
http://www.srb2.org
-5
View File
@@ -1,5 +0,0 @@
${PACKAGE_NAME} (${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION}) ${PACKAGE_DISTRO}; urgency=${PACKAGE_URGENCY}
* ${PROGRAM_NAME} v${PROGRAM_VERSION} program build
-- ${PACKAGE_NAME_EMAIL} ${__PACKAGE_DATETIME}
-1
View File
@@ -1 +0,0 @@
7
-51
View File
@@ -1,51 +0,0 @@
# SRB2 Debian package control file.
Source: ${PACKAGE_NAME}
Section: games
Priority: extra
Maintainer: ${PACKAGE_GROUP_NAME_EMAIL}
Build-Depends: debhelper (>= 7.0.50~),
libsdl2-dev,
libsdl2-mixer-dev,
libpng-dev | libpng16-dev | libpng12-dev (>= 1.2.7),
zlib1g-dev,
libgme-dev,
libcurl4-openssl-dev,
libglu1-dev | libglu-dev,
libosmesa6-dev | libgl-dev,
nasm [i386]
Standards-Version: 3.8.4
Homepage: ${PACKAGE_WEBSITE}
Package: ${PACKAGE_NAME}
Architecture: any
Depends: ${SHLIBS_DEPENDS}, ${MISC_DEPENDS},
${PACKAGE_NAME}-data (>> ${PACKAGE_ASSET_MINVERSION}), ${PACKAGE_NAME}-data (<< ${PACKAGE_ASSET_MAXVERSION}),
libsdl2-2.0-0,
libsdl2-mixer-2.0-0,
zlib1g,
libgme0,
libcurl4,
libpng | libpng16-16 | libpng12-0
Description: A cross-platform 3D Sonic fangame
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
fangame built using a modified version of the Doom Legacy
port of Doom. SRB2 is closely inspired by the original
Sonic games from the Sega Genesis, and attempts to recreate
the design in 3D. It features tons of levels, enemies, speed,
and quite a lot of the fun that the original Sonic games provided.
Package: ${PACKAGE_NAME}-dbg
Architecture: any
# FIXME: should be Depends: ${SHLIBS_DEPENDS}, ${MISC_DEPENDS}, srb2-data (= 2.1.14), srb2 but dh_shlibdeps is being an asshat
Depends: libc6, ${MISC_DEPENDS}, ${PACKAGE_NAME}-data (>> ${PACKAGE_ASSET_MINVERSION}), ${PACKAGE_NAME}-data (<< ${PACKAGE_ASSET_MAXVERSION}), ${PACKAGE_NAME}
Description: A cross-platform 3D Sonic fangame
Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog
fangame built using a modified version of the Doom Legacy
port of Doom. SRB2 is closely inspired by the original
Sonic games from the Sega Genesis, and attempts to recreate
the design in 3D. It features tons of levels, enemies, speed,
and quite a lot of the fun that the original Sonic games provided.
This is a debug binary; its symbols will be loaded by gdb
when the user starts the game with gdb for debugging.
-27
View File
@@ -1,27 +0,0 @@
This work was packaged for Debian by:
${PACKAGE_NAME_EMAIL} ${__PACKAGE_DATETIME}
It was downloaded from:
${PACKAGE_WEBSITE}
Upstream Author(s):
${PACKAGE_GROUP_NAME_EMAIL}
Copyright:
Copyright (C) 1998-2018 by Sonic Team Junior
License:
GNU General Public License, version 2
The Debian packaging is:
Copyright (C) 2010 Callum Dickinson <gcfreak_ag20@hotmail.com>
Copyright (C) 2010-2018 by Sonic Team Junior <stjr@srb2.org>
and is licensed under the GPL version 2,
see "/usr/share/common-licenses/GPL-2".
-4
View File
@@ -1,4 +0,0 @@
README.md
assets/README.txt
assets/LICENSE.txt
assets/LICENSE-3RD-PARTY.txt
-172
View File
@@ -1,172 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
#############################################################################
#
# GNU Make Debian package makefile for SRB2
#
# Copyright (C) 1998-2010 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.
#
# This file most likely will not need to be modified to make
# branches of SRB2 capable of making their own Debian packages,
# instead look at the /debian/control file for configuration.
#
#############################################################################
#############################################################################
#
# !!!!!!!!!! DEPLOYER NOTE !!!!!!!!!!
#
# Variables to be templated are curly-braced ${PACKAGE_INSTALL_PATH}
# Variables used by the rules script are parenthese'd $(PKGDIR)
# See [repo-root]/debian_template.sh
#
#############################################################################
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# user/group of to-be-installed files
ROOT_USER := 0
ROOT_GROUP := 0
# determine cross-compile (may need some work)
CROSS_COMPILE_BUILD := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CROSS_COMPILE_HOST := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CROSS_COMPILE := $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "$(CROSS_COMPILE_HOST)")
MKDIR = mkdir -p
MAKE = make
INSTALL = install -o $(ROOT_USER) -g $(ROOT_GROUP) -m 644
MV = mv
RM = rm -rf
STRIPARGS = --strip-unneeded
ifdef CROSS_COMPILE
STRIP = $(CROSS_COMPILE_HOST)-strip $(STRIPARGS)
else
STRIP = strip $(STRIPARGS)
endif
DIR := $(shell pwd)
# FIXME: hate hate hate head/tail hack :(
CONTROLF = $(DIR)/debian/control
PACKAGE = ${PACKAGE_NAME}
DBGPKG = ${PACKAGE}-dbg
TITLE = ${PROGRAM_NAME}
SECTION = Games/Action
EXENAME = ${PROGRAM_FILENAME}
DBGNAME = debug/$(EXENAME)
PKGDIR = $(shell echo "${PACKAGE_INSTALL_PATH}" | sed -e 's/^\///')
DBGDIR = usr/lib/debug/$(PKGDIR)
LINKDIR = $(shell echo "${PACKAGE_LINK_PATH}" | sed -e 's/^\///')
PIXMAPS_DIR = usr/share/pixmaps
DESKTOP_DIR = usr/share/applications
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
OS = LINUX=1
NONX86 = $(shell test "`echo $(CROSS_COMPILE_HOST) | grep 'i[3-6]86'`" || echo "NONX86=1")
MAKEARGS = $(OS) $(NONX86) $(PREFIX) EXENAME=$(EXENAME) DBGNAME=$(DBGNAME) NOOBJDUMP=1 # SDL_PKGCONFIG=sdl2 PNG_PKGCONFIG=libpng
MENUFILE1 = ?package($(PACKAGE)):needs="X11" section="$(SECTION)"
MENUFILE2 = title="$(TITLE)" command="/$(PKGDIR)/$(PACKAGE)"
BINDIR := $(DIR)/bin/Linux/Release
# FIXME pkg-config dir hacks
# Launchpad doesn't need this; it actually makes i386 builds fail due to cross-compile
# export PKG_CONFIG_LIBDIR = /usr/lib/$(CROSS_COMPILE_HOST)/pkgconfig
LDFLAGS += "-Wl,-rpath=/usr/lib/$(CROSS_COMPILE_HOST)"
# Some libgme-dev packages don't use pkg-config yet, so include the linker flag ourselves
PKG_CONFIG?=pkg-config
LIBGME_PKGCONFIG?=libgme
LIBGME_LDFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --libs)
ifeq ($(LIBGME_LDFLAGS),)
MAKEARGS += LIBGME_LDFLAGS=-lgme
endif
build:
$(MKDIR) $(BINDIR)/debug
$(MAKE) -C $(DIR)/src $(MAKEARGS)
$(STRIP) $(BINDIR)/$(EXENAME)
binary-indep:
# only here to kill Lintian warning
echo "no need to do any arch-independent stuff"
binary-arch:
# create ddirs
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DBGDIR)
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(DESKTOP_DIR)
$(MKDIR) $(DIR)/debian/tmp/$(PKGDIR) $(DIR)/debian/tmp/$(PIXMAPS_DIR)
# install main binaries
$(INSTALL) $(BINDIR)/$(EXENAME) $(DIR)/debian/tmp/$(PKGDIR)/$(PACKAGE)
$(INSTALL) $(BINDIR)/$(DBGNAME) $(DIR)/debian/tmp/$(DBGDIR)/$(PACKAGE)
# Install desktop file and banner image
$(INSTALL) $(DIR)/srb2.png $(DIR)/debian/tmp/usr/share/pixmaps/${PROGRAM_FILENAME}.png
$(INSTALL) $(DIR)/debian/srb2.desktop $(DIR)/debian/tmp/usr/share/applications/${PROGRAM_FILENAME}.desktop
# add compiled binaries to include-binaries
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
echo $(BINDIR)/$(EXENAME) >> $(DIR)/debian/source/include-binaries
# Generate install folder files
echo $(PKGDIR) > $(DIR)/debian/$(PACKAGE).install
echo $(DESKTOP_DIR) >> $(DIR)/debian/$(PACKAGE).install
echo $(PIXMAPS_DIR) >> $(DIR)/debian/$(PACKAGE).install
echo $(DBGDIR) > $(DIR)/debian/$(DBGPKG).install
# Launchpad only calls binary-arch, so just move everything up
#binary: binary-arch
# Generate .desktop specifications
echo "`echo '$(MENUFILE1)\\'`" > $(DIR)/debian/menu
echo " `echo '$(MENUFILE2)'`" >> $(DIR)/debian/menu
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install --sourcedir=$(DIR)/debian/tmp
dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
dh_link $(PKGDIR)/$(EXENAME) $(LINKDIR)/$(EXENAME)
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
-dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-arch
clean:
$(MAKE) -C $(DIR)/src $(MAKEARGS) clean cleandep
$(RM) $(BINDIR)/*
$(RM) $(DIR)/debian/$(PACKAGE)/*
$(RM) $(DIR)/debian/$(DBGPKG)/*
$(RM) $(DIR)/debian/tmp/*
$(RM) $(DIR)/debian/$(PACKAGE).install
$(RM) $(DIR)/debian/$(DBGPKG).install
$(RM) $(DIR)/debian/menu
$(RM) $(DIR)/debian/files
$(RM) $(DIR)/debian/source/include-binaries
.PHONY: all clean binary binary-indep build
-1
View File
@@ -1 +0,0 @@
3.0 (native)
-11
View File
@@ -1,11 +0,0 @@
tar-ignore = "assets/*.srb"
tar-ignore = "assets/*.pk3"
tar-ignore = "assets/*.dta"
tar-ignore = "assets/*.wad"
tar-ignore = "assets/*.kart"
tar-ignore = "assets/debian/${PACKAGE_NAME}-data/*"
tar-ignore = "assets/debian/tmp/*"
tar-ignore = "*.obj"
tar-ignore = "*.dep"
tar-ignore = ".git/*"
tar-ignore = ".git*"
-10
View File
@@ -1,10 +0,0 @@
[Desktop Entry]
Name=${PROGRAM_NAME}
Comment=${PROGRAM_DESCRIPTION}
Encoding=UTF-8
Exec=${PACKAGE_INSTALL_PATH}/${PROGRAM_FILENAME}
Icon=/usr/share/pixmaps/${PROGRAM_FILENAME}.png
Terminal=false
Type=Application
StartupNotify=false
Categories=Application;Game;
-166
View File
@@ -1,166 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# Debian package templating
#
# Call this script BEFORE running debuild!
# source ./debian_template.sh [clean] [main/asset]
#
# Before running this script,
# you should also set PACKAGE_NAME_EMAIL="John Doe <jdoe@example.com>" to match
# the identity of the key you will use to sign the package.
#
# Get script's actual path
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Recursive function for directory crawling
# $1 = Directory root to crawl
# $2 = Code to eval on file
# $3 = Code to eval on directory
# Exposes $dirtails, $dirlevel, and $dirtailname
dirlevel=0 # initialize
dirtails=()
# Utility function to make dira/dirb/dirc string
makedirtailname () {
dirtailname=""
for tail in $dirtails; do
if [[ "$dirtailname" == "" ]]; then
dirtailname="/$tail";
else
dirtailname="$dirtailname/$tail";
fi;
done;
}
evaldirectory () {
if [ -d "$1" ]; then
# Set contextual variables
# dirtails is an array of directory basenames after the crawl root
if (( $dirlevel > 0 )); then
dirtails+=( "$(basename $1)" );
else
dirtails=();
fi;
dirlevel=$((dirlevel+1));
# Generate directory path after the crawl root
makedirtailname;
# Eval our directory with the latest contextual info
# Don't eval on root
if (( $dirlevel > 1 )) && [[ "$3" != "" ]]; then
eval "$3";
fi;
# Iterate entries
for name in $1/*; do
if [ -d "$name" ]; then
# Name is a directory, but don't eval yet
# Recurse so our vars are updated
evaldirectory "$name" "$2" "$3";
# Decrement our directory level and remove a dirtail
unset 'dirtails[ ${#dirtails[@]}-1 ]';
dirlevel=$((dirlevel-1));
makedirtailname;
else
# Name is a file
if [ -f "$name" ] && [[ "$2" != "" ]]; then
eval "$2";
fi;
fi;
done;
# Reset our variables; we're done iterating
if (( $dirlevel == 1 )); then
dirlevel=0;
fi;
fi;
}
#
# Initialize package parameter defaults
#
if [[ "$__DEBIAN_PARAMETERS_INITIALIZED" != "1" ]]; then
. ${DIR}/deployer/travis/deployer_defaults.sh;
fi;
# Clean up after ourselves; we only expect to run this script once
# during buildboting
__DEBIAN_PARAMETERS_INITIALIZED=0
# for envsubst
export __PACKAGE_DATETIME="$(date '+%a, %d %b %Y %H:%M:%S %z')"
export __PACKAGE_DATETIME_DIGIT="$(date -u '+%Y%m%d%H%M%S')"
if [[ "$PACKAGE_REVISION" == "" ]]; then
PACKAGE_REVISION="-$__PACKAGE_DATETIME_DIGIT";
__PACKAGE_REVISION_BY_DATE=1;
export PACKAGE_REVISION=${PACKAGE_REVISION}; # for envsubst
fi;
#
# Clean the old debian/ directories
#
if [[ "$1" == "clean" ]]; then
toclean=$2;
else
toclean=$1;
fi;
if [[ "$toclean" == "" ]] || [[ "$toclean" == "main" ]]; then
echo "Cleaning main package scripts";
if [[ ! -f ${DIR}/debian ]]; then
rm -rf ${DIR}/debian;
fi;
fi;
if [[ "$toclean" == "" ]] || [[ "$toclean" == "asset" ]]; then
echo "Cleaning asset package scripts";
if [[ ! -f ${DIR}/assets/debian ]]; then
rm -rf ${DIR}/assets/debian;
fi;
fi;
#
# Make new templates
#
if [[ "$1" != "clean" ]]; then
totemplate=$1;
# HACK: ${shlibs:Depends} in the templates make the templating fail
# So just define replacemment variables
export SHLIBS_DEPENDS=${SHLIBS_DEPENDS};
export MISC_DEPENDS=${MISC_DEPENDS};
export DEBFILEVAR='$$file'; # used in assets/debian/rules
# Package parameters are exported for envsubst in deployer_defaults.sh
if [[ "$totemplate" == "" ]] || [[ "$totemplate" == "main" ]]; then
echo "Generating main package scripts";
fromroot=${DIR}/debian-template;
toroot=${DIR}/debian;
mkdir ${toroot};
evaldirectory ${fromroot} \
"cat \$name | envsubst > ${toroot}\${dirtailname}/\$( basename \$name )" \
"mkdir \"${toroot}\${dirtailname}\"";
fi;
if [[ "$totemplate" == "" ]] || [[ "$totemplate" == "asset" ]]; then
echo "Generating asset package scripts";
fromroot=${DIR}/assets/debian-template;
toroot=${DIR}/assets/debian;
mkdir ${toroot};
# Root dir to crawl; file eval; directory eval
evaldirectory ${fromroot} \
"cat \$name | envsubst > ${toroot}\${dirtailname}/\$( basename \$name )" \
"mkdir \"${toroot}\${dirtailname}\"";
fi;
fi;
if [[ "$__DPL_ACTIVE" != "1" ]] && [[ "$__PACKAGE_REVISION_BY_DATE" == "1" ]]; then
unset PACKAGE_REVISION; # so we can reset the date on subsequent runs
fi;
-195
View File
@@ -1,195 +0,0 @@
@setlocal enableextensions enabledelayedexpansion
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Appveyor Deployer
: See appveyor.yml for default variables
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Evaluate whether we should be deploying
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if not [%DPL_ENABLED%] == [1] (
echo Deployer is not enabled...
exit /b
)
: Don't do DD installs because fmodex DLL handling is not implemented.
if [%CONFIGURATION%] == [DD] (
echo Deployer does not support DD builds...
exit /b
)
if [%CONFIGURATION%] == [DD64] (
echo Deployer does not support DD builds...
exit /b
)
: Substring match from https://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file
: The below line says "if deployer is NOT in string"
: Note that APPVEYOR_REPO_BRANCH for pull request builds is the BASE branch that PR is merging INTO
if x%APPVEYOR_REPO_BRANCH:deployer=%==x%APPVEYOR_REPO_BRANCH% (
if not [%APPVEYOR_REPO_TAG%] == [true] (
echo Deployer is enabled but we are not in a release tag or a 'deployer' branch...
exit /b
) else (
if not [%DPL_TAG_ENABLED%] == [1] (
echo Deployer is not enabled for release tags...
exit /b
)
)
)
: Release tags always get optional assets (music.dta)
if [%APPVEYOR_REPO_TAG%] == [true] (
set "ASSET_FILES_OPTIONAL_GET=1"
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Get asset archives
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if exist "C:\Users\appveyor\srb2_cache\archives\" (
if [%ASSET_CLEAN%] == [1] (
echo Cleaning asset archives...
rmdir /s /q "C:\Users\appveyor\srb2_cache\archives"
)
)
if not exist "C:\Users\appveyor\srb2_cache\archives\" mkdir "C:\Users\appveyor\srb2_cache\archives"
goto EXTRACT_ARCHIVES
::::::::::::::::::::::::::::::::
: ARCHIVE_NAME_PARTS
: Call this like a function. %archivepath% is the path to extract parts from.
::::::::::::::::::::::::::::::::
for %%a in (%archivepath%) do (
set "file=%%~fa"
set "filepath=%%~dpa"
set "filename=%%~nxa"
)
set "localarchivepath=C:\Users\appveyor\srb2_cache\archives\%filename%"
goto EOF
::::::::::::::::::::::::::::::::
: EXTRACT_ARCHIVES
::::::::::::::::::::::::::::::::
set "archivepath=%ASSET_ARCHIVE_PATH%"
call :ARCHIVE_NAME_PARTS
set "ASSET_ARCHIVE_PATH_LOCAL=%localarchivepath%"
if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATH%" -FileName "%localarchivepath%"
set "archivepath=%ASSET_ARCHIVE_PATCH_PATH%"
call :ARCHIVE_NAME_PARTS
set "ASSET_ARCHIVE_PATCH_PATH_LOCAL=%localarchivepath%"
if not exist "%localarchivepath%" appveyor DownloadFile "%ASSET_ARCHIVE_PATCH_PATH%" -FileName "%localarchivepath%"
if not [%X86_64%] == [1] (
set "archivepath=%ASSET_ARCHIVE_X86_PATH%"
call :ARCHIVE_NAME_PARTS
set "ASSET_ARCHIVE_X86_PATH_LOCAL=!localarchivepath!"
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X86_PATH%" -FileName "!localarchivepath!"
)
if [%X86_64%] == [1] (
set "archivepath=%ASSET_ARCHIVE_X64_PATH%"
call :ARCHIVE_NAME_PARTS
set "ASSET_ARCHIVE_X64_PATH_LOCAL=!localarchivepath!"
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_X64_PATH%" -FileName "!localarchivepath!"
)
if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
set "archivepath=%ASSET_ARCHIVE_OPTIONAL_PATH%"
call :ARCHIVE_NAME_PARTS
set "ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL=!localarchivepath!"
if not exist "!localarchivepath!" appveyor DownloadFile "%ASSET_ARCHIVE_OPTIONAL_PATH%" -FileName "!localarchivepath!"
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Build the installers
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
mkdir "assets\installer"
mkdir "assets\patch"
7z x -y "%ASSET_ARCHIVE_PATH_LOCAL%" -o"assets\installer" >null
7z x -y "%ASSET_ARCHIVE_PATCH_PATH_LOCAL%" -o"assets\patch" >null
: Copy optional files to full installer (music.dta)
if [%ASSET_FILES_OPTIONAL_GET%] == [1] (
7z x -y "%ASSET_ARCHIVE_OPTIONAL_PATH_LOCAL%" -o"assets\installer" >null
)
: Copy EXE -- BUILD_PATH is from appveyor.yml
robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\installer" /XF "*.debug" ".gitignore"
robocopy /S /ns /nc /nfl /ndl /np /njh /njs "%BUILD_PATH%" "assets\patch" /XF "*.debug" ".gitignore"
: Are we building DD? (we were supposed to exit earlier!)
if [%CONFIGURATION%] == [DD] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
if [%CONFIGURATION%] == [DD64] ( set "DPL_INSTALLER_NAME=%DPL_INSTALLER_NAME%-DD" )
: If we are not a release tag, suffix the filename
if not [%APPVEYOR_REPO_TAG%] == [true] (
set "INSTALLER_SUFFIX=-%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%"
) else (
set "INSTALLER_SUFFIX="
)
if not [%X86_64%] == [1] ( goto X86_INSTALL )
::::::::::::::::::::::::::::::::
: X64_INSTALL
::::::::::::::::::::::::::::::::
: Extract DLL binaries
7z x -y "%ASSET_ARCHIVE_X64_PATH_LOCAL%" -o"assets\installer" >null
if [%PACKAGE_PATCH_DLL_GET%] == [1] (
7z x -y "!ASSET_ARCHIVE_X64_PATH_LOCAL!" -o"assets\patch" >null
)
: Build the installer
7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
: Build the patch
7z a "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
: Upload artifacts
appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Installer%INSTALLER_SUFFIX%.exe"
appveyor PushArtifact "%DPL_INSTALLER_NAME%-x64-Patch%INSTALLER_SUFFIX%.zip"
: We only do x86 OR x64, one at a time, so exit now.
goto EOF
::::::::::::::::::::::::::::::::
: X86_INSTALL
::::::::::::::::::::::::::::::::
: Extract DLL binaries
7z x -y "%ASSET_ARCHIVE_X86_PATH_LOCAL%" -o"assets\installer" >null
if [%PACKAGE_PATCH_DLL_GET%] == [1] (
7z x -y "!ASSET_ARCHIVE_X86_PATH_LOCAL!" -o"assets\patch" >null
)
: Build the installer
7z a -sfx7z.sfx "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe" .\assets\installer\*
: Build the patch
7z a "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip" .\assets\patch\*
: Upload artifacts
appveyor PushArtifact "%DPL_INSTALLER_NAME%-Installer%INSTALLER_SUFFIX%.exe"
appveyor PushArtifact "%DPL_INSTALLER_NAME%-Patch%INSTALLER_SUFFIX%.zip"
: We only do x86 OR x64, one at a time, so exit now
goto EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
endlocal
-157
View File
@@ -1,157 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# Initialization
#
# Performs validity checks to ensure that Deployer is allowed to run
# e.g., is an FTP hostname specified? Are we whitelisted by OSNAMES and BRANCHES?
#
# Set these environment variables in your Travis-CI settings, where they are stored securely.
# See other shell scripts for more options.
#
# DPL_ENABLED = 1 (leave blank to disable)
# DPL_TAG_ENABLED = 1 (run Deployer on all tags)
# DPL_JOB_ENABLE_ALL = 1 (run Deployer on all jobs; leave blank to act on specific jobs, see below)
# DPL_JOBNAMES = name1,name2 (whitelist of job names to allow uploading; leave blank to upload from all jobs)
# DPL_OSNAMES = osx (whitelist of OS names to allow uploading; leave blank to upload from all OSes)
# DPL_BRANCHES = master,branch1,branch2 (whitelist of branches to upload; leave blank to upload all branches)
#
# To enable Deployer on specific jobs, set _DPL_JOB_ENABLED=1 for that job. Example:
# - matrix:
# - os: osx
# env:
# - _DPL_JOB_ENABLED=1
#
# DO NOT set __DPL_ACTIVE, because that would bypass these validity checks.
# Validate Deployer state
if [[ "$DPL_ENABLED" == "1" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
# Test for base eligibility:
# Are we in a deployer branch? Or
# Are we in a release tag AND DPL_TAG_ENABLED=1?
if [[ $TRAVIS_BRANCH == *"deployer"* ]]; then
__DPL_BASE_ELIGIBLE=1;
__DPL_TERMINATE_EARLY_ELIGIBLE=1;
fi;
if [[ "$TRAVIS_TAG" != "" ]] && [[ "$DPL_TAG_ENABLED" == "1" ]]; then
__DPL_BASE_ELIGIBLE=1;
__DPL_TAG_ELIGIBLE=1;
__DPL_TERMINATE_EARLY_ELIGIBLE=1;
fi;
# Logging message for trigger word
if [[ "$__DPL_TAG_ELIGIBLE" != "1" ]] && [[ "$DPL_TRIGGER" != "" ]]; then
echo "Testing for trigger $DPL_TRIGGER, commit message: $TRAVIS_COMMIT_MESSAGE";
echo "[${DPL_TRIGGER}]";
echo "[${DPL_TRIGGER}-${_DPL_JOB_NAME}]";
echo "[${DPL_TRIGGER}-${TRAVIS_OS_NAME}]";
fi;
#
# Search for the trigger word
# Force enable if release tags are eligible
#
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_TRIGGER" == "" ]] \
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[$DPL_TRIGGER]"* ]] \
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[${DPL_TRIGGER}-${_DPL_JOB_NAME}]"* ]] \
|| [[ $TRAVIS_COMMIT_MESSAGE == *"[${DPL_TRIGGER}-${TRAVIS_OS_NAME}]"* ]]; then
#
# Whitelist by branch name
# Force enable if release tags are eligible
#
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_BRANCHES" == "" ]] || [[ $DPL_BRANCHES == *"$TRAVIS_BRANCH"* ]]; then
# Set this so we only early-terminate builds when we are specifically deploying
# Trigger string and branch are encompassing conditions; the rest are job-specific
# This check only matters for deployer branches and when DPL_TERMINATE_TESTS=1,
# because we're filtering non-deployer jobs.
#
# __DPL_TRY_TERMINATE_EARLY is invalidated in .travis.yml if __DPL_ACTIVE=1
if [[ "$__DPL_TERMINATE_EARLY_ELIGIBLE" == "1" ]] && [[ "$DPL_TERMINATE_TESTS" == "1" ]]; then
__DPL_TRY_TERMINATE_EARLY=1;
fi;
#
# Is the job enabled for deployment?
#
if [[ "$DPL_JOB_ENABLE_ALL" == "1" ]] || [[ "$_DPL_JOB_ENABLED" == "1" ]]; then
#
# Whitelist by job names
#
if [[ "$DPL_JOBNAMES" == "" ]] || [[ "$_DPL_JOB_NAME" == "" ]] || [[ $DPL_JOBNAMES == *"$_DPL_JOB_NAME"* ]]; then
#
# Whitelist by OS names
#
if [[ "$DPL_OSNAMES" == "" ]] || [[ $DPL_OSNAMES == *"$TRAVIS_OS_NAME"* ]]; then
# Base Deployer is eligible for becoming active
# Are we building for Linux?
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]] || [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]] || [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
__DPL_DEBIAN_ACTIVE=1;
fi;
fi;
fi;
# Now check for deployment targets
if [[ "$_DPL_FTP_TARGET" == "1" ]] && [[ "$DPL_FTP_HOSTNAME" != "" ]]; then
if [[ "$TRAVIS_OS_HOST" == "linux" ]] && [[ "$DPL_FTP_PROTOCOL" == "ftp" ]]; then
echo "Non-secure FTP will not work on Linux Travis-CI jobs!";
echo "Try SFTP or another target. Details:";
echo "https://blog.travis-ci.com/2018-07-23-the-tale-of-ftp-at-travis-ci";
else
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]] || [[ "$_DPL_PACKAGE_BINARY" == "1" ]] || [[ "$_DPL_BINARY" == "1" ]]; then
echo "Deployer FTP target is enabled";
__DPL_FTP_ACTIVE=1;
else
echo "Deployer FTP target cannot be enabled: You must specify _DPL_PACKAGE_BINARY=1,";
echo "and/or _DPL_BINARY=1 in your job's environment variables.";
fi;
fi;
fi;
if [[ "$_DPL_DPUT_TARGET" == "1" ]] && [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]] \
&& [[ "$DPL_DPUT_INCOMING" != "" ]]; then
if [[ "$DPL_DPUT_METHOD" == "ftp" ]]; then
echo "DPUT will not work with non-secure FTP on Linux Travis-CI jobs!";
echo "Try SFTP or another method for DPUT. Details:";
echo "https://blog.travis-ci.com/2018-07-23-the-tale-of-ftp-at-travis-ci";
else
echo "Deployer DPUT target is enabled";
__DPL_DPUT_ACTIVE=1;
fi;
fi;
# If any deployment targets are active, then so is the Deployer at large
if [[ "$__DPL_FTP_ACTIVE" == "1" ]] || [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
__DPL_ACTIVE=1;
fi;
fi;
fi;
fi;
fi;
else
if [[ "$DPL_TRIGGER" != "" ]]; then
echo "Testing for global trigger [$DPL_TRIGGER, commit message: $TRAVIS_COMMIT_MESSAGE";
fi;
if [[ "$DPL_TRIGGER" != "" ]] && [[ $TRAVIS_COMMIT_MESSAGE == *"[$DPL_TRIGGER"* ]]; then
if [[ "$__DPL_TAG_ELIGIBLE" == "1" ]] || [[ "$DPL_BRANCHES" == "" ]] || [[ $DPL_BRANCHES == *"$TRAVIS_BRANCH"* ]]; then
# This check only matters for deployer branches and when DPL_TERMINATE_TESTS=1,
# because we're filtering non-deployer jobs.
if [[ "$__DPL_TERMINATE_EARLY_ELIGIBLE" == "1" ]] && [[ "$DPL_TERMINATE_TESTS" == "1" ]]; then
# Assume that some job received the trigger, so mark this for early termination
__DPL_TRY_TERMINATE_EARLY=1;
fi;
fi;
fi;
fi;
fi;
if [[ "$__DPL_TRY_TERMINATE_EARLY" == "1" ]] && [[ "$__DPL_ACTIVE" != "1" ]]; then
echo "Deployer is active in another job";
fi;
if [[ "$__DPL_TRY_TERMINATE_EARLY" != "1" ]] && [[ "$__DPL_ACTIVE" != "1" ]]; then
echo "Deployer is not active";
fi;
-190
View File
@@ -1,190 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# Build Script
#
# Builds the required targets depending on which sub-modules are enabled
if [[ "$__DPL_FTP_ACTIVE" == "1" ]] || [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]]; then
echo "Building Debian package(s)"
sudo apt-get install devscripts debhelper fakeroot secure-delete expect;
# Build source packages first, since they zip up the entire source folder,
# binaries and all
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
. ../debian_template.sh main;
OLDPWD=$PWD; # [repo]/build
cd ..; # repo root
if [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
echo "Building main source Debian package";
expect <(cat <<EOD
spawn debuild -S -us -uc;
expect "continue anyway? (y/n)"
send "y\r"
interact
EOD
);
fi;
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
echo "Building main binary Debian package";
expect <(cat <<EOD
spawn debuild -us -uc;
expect "continue anyway? (y/n)"
send "y\r"
interact
EOD
);
fi;
cd $OLDPWD;
fi;
# Also an asset package
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
. ../debian_template.sh asset;
OLDPWD=$PWD; # [repo]/build
cd ../assets;
# make sure the asset files exist, download them if they don't
#echo "Checking asset files for asset Debian package";
#debuild -T build;
if [[ "$_DPL_PACKAGE_SOURCE" == "1" ]]; then
echo "Building asset source Debian package";
expect <(cat <<EOD
spawn debuild -S -us -uc;
expect "continue anyway? (y/n)"
send "y\r"
interact
EOD
);
fi;
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
echo "Building asset binary Debian package";
expect <(cat <<EOD
spawn debuild -us -uc;
expect "continue anyway? (y/n)"
send "y\r"
interact
EOD
);
fi;
cd $OLDPWD;
fi;
# Now sign our packages
if [[ "$DPL_PGP_KEY_PRIVATE" != "" ]] && [[ "$DPL_PGP_KEY_PASSPHRASE" != "" ]]; then
# Get the key to sign
# Do this AFTER debuild so that we can specify the passphrase in command line
echo "$DPL_PGP_KEY_PRIVATE" | base64 --decode > key.asc;
echo "$DPL_PGP_KEY_PASSPHRASE" > phrase.txt;
gpg --import key.asc;
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
echo "Signing main package(s)";
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
$PACKAGEDBGFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGENIGHTLYDBGFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHDBGFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
#$PACKAGEPATCHNIGHTLYDBGFILENAME
);
# Main packages are in parent of root repo folder
OLDPWD=$PWD; # [repo]/build
cd ../..; # parent of repo root
for n in ${PACKAGEFILENAMES}; do
for f in ./$n*.changes; do
debsign --no-re-sign -p"gpg --passphrase-file $OLDPWD/phrase.txt --batch" "$f";
done;
done;
cd $OLDPWD;
fi;
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
echo "Signing asset package(s)";
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
)
# Asset packages are in root repo folder
OLDPWD=$PWD; # [repo]/build
cd ..; # repo root
for n in ${PACKAGEFILENAMES}; do
for f in ./$n*.changes; do
debsign --no-re-sign -p"gpg --passphrase-file $OLDPWD/phrase.txt --batch" "$f";
done;
done;
cd $OLDPWD;
fi;
# Delete the keys :eyes:
srm key.asc;
srm phrase.txt;
fi;
fi;
# all other OSes
if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then
#
# Check for binary building
#
if [[ "$_DPL_BINARY" == "1" ]]; then
echo "Building a Binary";
make -k;
fi;
#
# Check for package building
#
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
echo "Building a Package";
# Make an OSX package; superuser is required for library bundling
#
# HACK: OSX packaging can't write libraries to .app package unless we're superuser
# because the original library files don't have WRITE permission
# Bug may be sidestepped by using CHMOD_BUNDLE_ITEMS=TRUE
# But I don't know where this is set. Not `cmake -D...` because this var is ignored.
# https://cmake.org/Bug/view.php?id=9284
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
sudo make -k package;
else
# Some day, when Windows is supported, we'll just make a standard package
make -k package;
fi;
fi;
fi;
fi;
-105
View File
@@ -1,105 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# Default Variables
#
# Here are all of the user-set variables used by Deployer.
# See the "Cross-platform deployment" page on SRB2 Wiki for documentation.
# Core Parameters
: ${DPL_ENABLED} # Enable Deployer behavior; must be set for any deployment activity
: ${DPL_TAG_ENABLED} # Trigger Deployer for all tag releases
: ${DPL_JOB_ENABLE_ALL} # Enable all jobs for deployment
: ${DPL_TERMINATE_TESTS} # Terminate all build test jobs (used in .travis.yml)
: ${DPL_TRIGGER} # Use a [word] in the commit message to trigger Deployer
: ${DPL_JOBNAMES} # Trigger Deployer by job name
: ${DPL_OSNAMES} # Trigger Deployer by OS name (osx,linux)
: ${DPL_BRANCHES} # Trigger Deployer by git branch name
# Job Parameters
: ${_DPL_JOB_ENABLED} # Enable Deployer for this specific job. DPL_ENABLED must be set too.
: ${_DPL_JOB_NAME} # Identifier for the job, used for logging and trigger word matching
: ${_DPL_FTP_TARGET} # Deploy to FTP
: ${_DPL_DPUT_TARGET} # Deploy to DPUT
: ${_DPL_PACKAGE_SOURCE} # Build packages into a Source distribution. Linux only.
: ${_DPL_PACKAGE_BINARY} # Build packages into a Binary distribution.
: ${_DPL_PACKAGE_MAIN:=1} # Build main installation package. Linux only; OS X assumes this.
: ${_DPL_PACKAGE_ASSET} # Build asset installation package. Linux only.
# Asset File Parameters
: ${ASSET_ARCHIVE_PATH:=https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-assets.7z}
: ${ASSET_ARCHIVE_OPTIONAL_PATH:=https://github.com/mazmazz/Kart-Public/releases/download/kart_assets/srb2kart-v102-optional-assets.7z}
: ${ASSET_FILES_HASHED:=srb2.srb patch.kart gfx.kart textures.kart chars.kart maps.kart}
: ${ASSET_FILES_DOCS:=README.txt HISTORY.txt LICENSE.txt LICENSE-3RD-PARTY.txt}
: ${ASSET_FILES_OPTIONAL_GET:=0}
# FTP Parameters
: ${DPL_FTP_PROTOCOL}
: ${DPL_FTP_USER}
: ${DPL_FTP_PASS}
: ${DPL_FTP_HOSTNAME}
: ${DPL_FTP_PORT}
: ${DPL_FTP_PATH}
# DPUT Parameters
: ${DPL_DPUT_DOMAIN:=ppa.launchpad.net}
: ${DPL_DPUT_METHOD:=sftp}
: ${DPL_DPUT_INCOMING}
: ${DPL_DPUT_LOGIN:=anonymous}
: ${DPL_SSH_KEY_PRIVATE} # Base64-encoded private key file. Used to sign repository uploads
: ${DPL_SSH_KEY_PASSPHRASE} # Decodes the private key file.
# Package Parameters
: ${PACKAGE_NAME:=srb2kart}
: ${PACKAGE_VERSION:=1.0.2}
: ${PACKAGE_SUBVERSION} # Highly recommended to set this to reflect the distro series target (e.g., ~18.04bionic)
: ${PACKAGE_REVISION} # Defaults to UTC timestamp
: ${PACKAGE_INSTALL_PATH:=/usr/games/SRB2Kart}
: ${PACKAGE_LINK_PATH:=/usr/games}
: ${PACKAGE_DISTRO:=trusty}
: ${PACKAGE_URGENCY:=high}
: ${PACKAGE_NAME_EMAIL:=Kart Krew <stjr@srb2.org>}
: ${PACKAGE_GROUP_NAME_EMAIL:=Kart Krew <stjr@srb2.org>}
: ${PACKAGE_WEBSITE:=<https://mb.srb2.org/showthread.php?p=802695>}
: ${PACKAGE_ASSET_MINVERSION:=1.0.1} # Number this the version BEFORE the actual required version, because we do a > check
: ${PACKAGE_ASSET_MAXVERSION:=1.0.3} # Number this the version AFTER the actual required version, because we do a < check
: ${PROGRAM_NAME:=Sonic Robo Blast 2 Kart}
: ${PROGRAM_VENDOR:=Kart Krew}
: ${PROGRAM_VERSION:=1.0.2}
: ${PROGRAM_DESCRIPTION:=A kart racing mod based on the 3D Sonic the Hedgehog fangame Sonic Robo Blast 2.}
: ${PROGRAM_FILENAME:=srb2kart}
: ${DPL_PGP_KEY_PRIVATE} # Base64-encoded private key file. Used to sign Debian packages
: ${DPL_PGP_KEY_PASSPHRASE} # Decodes the private key file.
# Export Asset and Package Parameters for envsubst templating
export ASSET_ARCHIVE_PATH="${ASSET_ARCHIVE_PATH}"
export ASSET_ARCHIVE_OPTIONAL_PATH="${ASSET_ARCHIVE_OPTIONAL_PATH}"
export ASSET_FILES_HASHED="${ASSET_FILES_HASHED}"
export ASSET_FILES_DOCS="${ASSET_FILES_DOCS}"
export ASSET_FILES_OPTIONAL_GET="${ASSET_FILES_OPTIONAL_GET}"
export PACKAGE_NAME="${PACKAGE_NAME}"
export PACKAGE_VERSION="${PACKAGE_VERSION}"
export PACKAGE_SUBVERSION="${PACKAGE_SUBVERSION}" # in case we have this
export PACKAGE_REVISION="${PACKAGE_REVISION}"
export PACKAGE_ASSET_MINVERSION="${PACKAGE_ASSET_MINVERSION}"
export PACKAGE_ASSET_MAXVERSION="${PACKAGE_ASSET_MAXVERSION}"
export PACKAGE_INSTALL_PATH="${PACKAGE_INSTALL_PATH}"
export PACKAGE_LINK_PATH="${PACKAGE_LINK_PATH}"
export PACKAGE_DISTRO="${PACKAGE_DISTRO}"
export PACKAGE_URGENCY="${PACKAGE_URGENCY}"
export PACKAGE_NAME_EMAIL="${PACKAGE_NAME_EMAIL}"
export PACKAGE_GROUP_NAME_EMAIL="${PACKAGE_GROUP_NAME_EMAIL}"
export PACKAGE_WEBSITE="${PACKAGE_WEBSITE}"
export PROGRAM_NAME="${PROGRAM_NAME}"
export PROGRAM_VERSION="${PROGRAM_VERSION}"
export PROGRAM_DESCRIPTION="${PROGRAM_DESCRIPTION}"
export PROGRAM_FILENAME="${PROGRAM_FILENAME}"
# This file is called in debian_template.sh, so mark our completion so we don't run it again
__DEBIAN_PARAMETERS_INITIALIZED=1
-133
View File
@@ -1,133 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# DPUT uploader (e.g., Launchpad PPA)
#
if [[ "$__DPL_DPUT_ACTIVE" == "1" ]]; then
# Install APT dependencies
# paramiko required for ssh
sudo apt-get install python-paramiko expect dput; # python-pip
#pip install paramiko;
# Output the DPUT config
# Dput only works if you're using secure FTP, so that's what we default to.
cat > "./dput.cf" << EOM
[deployer]
fqdn = ${DPL_DPUT_DOMAIN}
method = ${DPL_DPUT_METHOD}
incoming = ${DPL_DPUT_INCOMING}
login = ${DPL_DPUT_LOGIN}
allow_unsigned_uploads = 0
EOM
# Output SSH config
# Don't let SSH prompt us for untrusted hosts
cat >> "./ssh_config" << EOM
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
PubKeyAuthentication yes
IdentityFile ${PWD}/key.private
IdentitiesOnly yes
EOM
sudo sh -c "cat < ${PWD}/ssh_config >> /etc/ssh/ssh_config";
# Get the private key
echo "$DPL_SSH_KEY_PRIVATE" | base64 --decode > key.private;
chmod 700 ./key.private;
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
$PACKAGEDBGFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGENIGHTLYDBGFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHDBGFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
#$PACKAGEPATCHNIGHTLYDBGFILENAME
);
# Main packages are in parent of root repo folder
OLDPWD=$PWD; # [repo]/build
cd ../..;
# Enter passphrase if required
for n in ${PACKAGEFILENAMES}; do
for f in $n*.changes; do
# Binary builds also generate source builds, so exclude the source
# builds if desired
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
continue;
fi;
fi;
expect <(cat <<EOD
spawn dput -c "${OLDPWD}/dput.cf" deployer "$f";
expect "Enter passphrase for key"
send "${DPL_SSH_KEY_PASSPHRASE}\r"
interact
EOD
);
done;
done;
# Go back to [repo]/build folder
cd $OLDPWD;
fi;
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
)
# Asset packages are in root repo folder
OLDPWD=$PWD; # [repo]/build
cd ..;
# Enter passphrase if required
for n in ${PACKAGEFILENAMES}; do
for f in $n*.changes; do
# Binary builds also generate source builds, so exclude the source
# builds if desired
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
continue;
fi;
fi;
expect <(cat <<EOD
spawn dput -c "${OLDPWD}/dput.cf" deployer "$f";
expect "Enter passphrase for key"
send "${DPL_SSH_KEY_PASSPHRASE}\r"
interact
EOD
);
done;
done;
# Go back to [repo]/build folder
cd $OLDPWD;
fi;
srm ./key.private;
fi;
-137
View File
@@ -1,137 +0,0 @@
#!/bin/bash
# Deployer for Travis-CI
# FTP Uploader
#
# Package files are uploaded to, e.g., ftp://username:password@example.com:21/path/to/upload/STJr/SRB2/master/460873812-151.1
# With file `commit.txt` and folder(s) `bin` and `package`
#
# Set these environment variables in your Travis-CI settings, where they are stored securely.
# See other shell scripts for more options.
#
# DPL_FTP_PROTOCOL = ftp (ftp or sftp or ftps or however your FTP URI begins)
# DPL_FTP_USER = username
# DPL_FTP_PASS = password
# DPL_FTP_HOSTNAME = example.com
# DPL_FTP_PORT = 21
# DPL_FTP_PATH = path/to/upload (do not add trailing slash)
if [[ "$__DPL_FTP_ACTIVE" == "1" ]]; then
if [[ "$TRAVIS_JOB_NAME" != "" ]]; then
JOBNAME=$TRAVIS_JOB_NAME;
else
if [[ "$_DPL_JOB_NAME" != "" ]]; then
JOBNAME=$_DPL_JOB_NAME;
else
JOBNAME=$TRAVIS_OS_NAME;
fi;
fi;
# Generate commit.txt file
echo "Travis-CI Build $TRAVIS_OS_NAME - $TRAVIS_REPO_SLUG/$TRAVIS_BRANCH - $TRAVIS_JOB_NUMBER - $JOBNAME" > "commit.txt";
echo "Job ID $TRAVIS_JOB_ID" >> "commit.txt";
echo "" >> "commit.txt";
echo "Commit $TRAVIS_COMMIT" >> "commit.txt";
echo "$TRAVIS_COMMIT_MESSAGE" >> "commit.txt";
echo "" >> "commit.txt";
# Initialize FTP parameters
if [[ "$DPL_FTP_PORT" == "" ]]; then
DPL_FTP_PORT=21;
fi;
if [[ "$DPL_FTP_PROTOCOL" == "" ]]; then
DPL_FTP_PROTOCOL=ftp;
fi;
__DPL_FTP_LOCATION=$DPL_FTP_PROTOCOL://$DPL_FTP_HOSTNAME:$DPL_FTP_PORT/$DPL_FTP_PATH/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/$TRAVIS_JOB_ID-$TRAVIS_JOB_NUMBER-$JOBNAME;
# Upload to FTP!
echo "Uploading to FTP...";
curl --ftp-create-dirs -T "commit.txt" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/commit.txt";
if [[ "$__DPL_DEBIAN_ACTIVE" == "1" ]]; then
if [[ "$_DPL_PACKAGE_MAIN" == "1" ]]; then
PACKAGEFILENAME=${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEDBGFILENAME=${PACKAGE_NAME}-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYDBGFILENAME=${PACKAGE_NAME}-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHDBGFILENAME=${PACKAGE_NAME}-patch-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYDBGFILENAME=${PACKAGE_NAME}-patch-nightly-dbg_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
$PACKAGEDBGFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGENIGHTLYDBGFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHDBGFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
#$PACKAGEPATCHNIGHTLYDBGFILENAME
);
# Main packages are in parent of root repo folder
OLDPWD=$PWD; # [repo]/build
cd ../..;
for n in ${PACKAGEFILENAMES}; do
for f in ./$n*; do
# Binary builds also generate source builds, so exclude the source
# builds if desired
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
continue;
fi;
fi;
curl --ftp-create-dirs -T "$f" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/package/main/$f";
done;
done;
# Go back to [repo]/build folder
cd $OLDPWD;
fi;
if [[ "$_DPL_PACKAGE_ASSET" == "1" ]]; then
PACKAGEFILENAME=${PACKAGE_NAME}-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGENIGHTLYFILENAME=${PACKAGE_NAME}-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHFILENAME=${PACKAGE_NAME}-patch-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
#PACKAGEPATCHNIGHTLYFILENAME=${PACKAGE_NAME}-patch-nightly-data_${PACKAGE_VERSION}${PACKAGE_SUBVERSION}${PACKAGE_REVISION};
PACKAGEFILENAMES=(
$PACKAGEFILENAME
#$PACKAGENIGHTLYFILENAME
#$PACKAGEPATCHFILENAME
#$PACKAGEPATCHNIGHTLYFILENAME
)
# Asset packages are in root repo folder
OLDPWD=$PWD; # [repo]/build
cd ..;
for n in ${PACKAGEFILENAMES}; do
for f in ./$n*; do
# Binary builds also generate source builds, so exclude the source
# builds if desired
if [[ "$_DPL_PACKAGE_SOURCE" != "1" ]]; then
if [[ "$f" == *"_source"* ]] || [[ "$f" == *".tar.xz"* ]]; then
continue;
fi;
fi;
curl --ftp-create-dirs -T "$f" -u $DPL_FTP_USER:$DPL_FTP_PASS "$__DPL_FTP_LOCATION/package/asset/$f";
done;
done;
# Go back to [repo]/build folder
cd $OLDPWD;
fi;
else
if [[ "$_DPL_BINARY" == "1" ]]; then
find bin -type f -exec curl -u $DPL_FTP_USER:$DPL_FTP_PASS --ftp-create-dirs -T {} $__DPL_FTP_LOCATION/{} \;;
fi;
if [[ "$_DPL_PACKAGE_BINARY" == "1" ]]; then
sudo rm -r package/_CPack_Packages
find package -type f -exec curl -u $DPL_FTP_USER:$DPL_FTP_PASS --ftp-create-dirs -T {} $__DPL_FTP_LOCATION/{} \;;
fi;
fi;
fi
-93
View File
@@ -1,93 +0,0 @@
================================================================
How to add Low-res modes to your XF86Config under Linux MANUALLY
================================================================
I TAKE NO RESPONSIBILITY FOR ANY DAMAGE DONE TO YOUR EQUIPMENT!!!
This document explains how to add low-res modes like 320x200 to your
X-Server configuration, because some new setup tools for the X-Server
do not support this. ONLY RECOMMENDED FOR USERS WHO KNOW WHAT THEY DO!
I do not take any responsibility for damage done to your monitor, your
videocard, your harddisk, your cat, your dog or anything else!!!
IMPORTANT IS, THAT YOUR "HorizSync" AND "VertRefresh" VALUES REALLY
MATCH YOUR MONITOR! OTHERWISE YOUR MONITOR CAN BLOW UP!!!
OK, if you have read up to here, you either know what you do or really
die-hard want those low-res modes. Here is what to do:
Look up your XF86Config. Is is either in /etc or in /etc/X11. Here is
what you have to add to the definition of your modeslines:
# Low-res Doublescan modes
# If your chipset does not support doublescan, you get a 'squashed'
# resolution like 320x400.
# 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio
Modeline "320x200" 12.588 320 336 384 400 200 204 205 225 Doublescan
# 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio
Modeline "320x240" 12.588 320 336 384 400 240 245 246 262 Doublescan
# 320x240 @ 72 Hz, 36.5 kHz hsync
Modeline "320x240" 15.750 320 336 384 400 240 244 246 262 Doublescan
# 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio
ModeLine "400x300" 18 400 416 448 512 300 301 302 312 Doublescan
# 400x300 @ 60 Hz, 37.8 kHz hsync
Modeline "400x300" 20 400 416 480 528 300 301 303 314 Doublescan
# 400x300 @ 72 Hz, 48.0 kHz hsync
Modeline "400x300" 25 400 424 488 520 300 319 322 333 Doublescan
If your video card only supports a specific set of discrete dotclocks
(RAMDAC) you may have to replace the dotclocks given here by one of the
specified (e.g in the first modeline the dotclock is 12.588 MHz). I believe
that nowadays all cards and monitors should work with these settings, but
if you have outdated hardware you better check the frequencies yourself. If
there is any uncertainty, please check the "XFree86 Video Timings HOWTO".
Then have a look at the section "Screen" with the appropriate driver
(usually either "svga" or "accel"). Under Subsection "Display" there
are modes for the given color depth. Add the desired modes. As an
example I give you my screens definition here with low-res modes in
16 bit color depth:
Section "Screen"
Driver "accel"
Device "3D Charger"
Monitor "Iiyama Pro 450"
DefaultColorDepth 16
Subsection "Display"
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
Virtual 1280 1024
EndSubsection
Subsection "Display"
Depth 16
Modes "1152x864" "1024x768" "800x600" "640x480" "400x300" "320x200" <- THIS IS ACTUALLY WHAT YOU WANT!!!
ViewPort 0 0 ^^^^^^^^^^^^^^^^^^^
Virtual 1152 864
EndSubsection
Subsection "Display"
Depth 24
Modes "800x600" "640x480"
ViewPort 0 0
Virtual 800 600
EndSubsection
Subsection "Display"
Depth 32
Modes "800x600" "640x480"
ViewPort 0 0
Virtual 800 600
EndSubsection
EndSection
Once again: important is, that you edit the correct Screen section.
If you use the SVGA Server and edit the ACCEL Server, you might
wonder where your new modes have gone.
If everything went fine and you want to say thank you, just write
to "metzgermeister@users.sourceforge.net". If your monitor blew
up and you want to kill me, find me playing Legacy or Q3A on the net
and frag me (with your second monitor, hehe).
- metzgermeister
-212
View File
@@ -1,212 +0,0 @@
1-99 : Player Starts
1 - Player 1 Start 1
2 - Player 2 Start 2
3 - Player 3 Start 3
4 - Player 4 Start 4
5 - Player 5 Start 4001
6 - Player 6 Start 4002
7 - Player 7 Start 4003
8 - Player 8 Start 4004
9 - Player 9 Start 4005
10 - Player 10 Start 4006
11 - Player 11 Start 4007
12 - Player 12 Start 4008
13 - Player 13 Start 4009
14 - Player 14 Start 4010
15 - Player 15 Start 4011
16 - Player 16 Start 4012
17 - Player 17 Start 4013
18 - Player 18 Start 4014
19 - Player 19 Start 4015
20 - Player 20 Start 4016
21 - Player 21 Start 4017
22 - Player 22 Start 4018
23 - Player 23 Start 4019
24 - Player 24 Start 4020
25 - Player 25 Start 4021
26 - Player 26 Start 4022
27 - Player 27 Start 4023
28 - Player 28 Start 4024
29 - Player 29 Start 4025
30 - Player 30 Start 4026
31 - Player 31 Start 4027
32 - Player 32 Start 4028
33 - Player Match Start 11
34 - Red Team Start 87
35 - Blue Team Start 89
36 - Tag start New
100 - 199 : Enemies
100 - Blue Crawla 3004
101 - Red Crawla 9
102 - GFZ Fish 58
103 - Gold Buzz 5005
104 - Red Buzz 5006
105 - Jetty-Syn Bomber 3005
106 - Jetty-Syn Gunner 22
107 - Crawla Commander 21
108 - Deton 71
109 - Skim 56
110 - THZ Turret 2004
111 - Pop-up Turret 42
200 - 299 : Bosses and their associated items (if any)
200 - Boss 1 16
201 - Boss 2 2008
290 - Boss Fly Point 17
291 - EggTrap Center 2049
300 - 399 : Collectibles
300 - Ring 2014
301 - Homing Ring 69
302 - Rail Ring 3003
303 - Infinity Ring 80
304 - Automatic Ring 26
305 - Explosion Ring 54
306 - Red CTF Flag 31
307 - Blue CTF Flag 34
308 - Special Stage Token 2013
309 - Emerald 1 420
310 - Emerald 2 421
311 - Emerald 3 422
312 - Emerald 4 423
313 - Emerald 5 424
314 - Emerald 6 425
315 - Emerald 7 426
316 - Hunting Emerald 1 64
317 - Hunting Emerald 2 3002
318 - Hunting Emerald 3 3001
400 - 499 : Boxes
400 - Super Ring Box 2011
401 - Grey Ring Box 2012
402 - Ring Shield Box 48
403 - Fire Shield Box 2002
404 - Bomb Shield Box 2018
405 - Jump Shield Box 35
406 - Water Shield Box 2028
407 - Sneaker Box 25
408 - Invincibility Box 2022
409 - 1-Up Box 41
410 - Eggman Box 2005
411 - Mixup Box 78
412 - Question Box 3000
500 - 599 : Interactive Objects (friendly or otherwise - includes springs)
500 - Bubble Patch 33
501 - Level End Sign 86
502 - Starpost 3006
520 - Spike Ball -1
521 - Special Stage Spike Ball 23
522 - Ceiling Spike 67
523 - Floor Spike 68
540 - Fan 32
541 - Steam Riser 30
550 - Yellow Spring 28
551 - Red Spring 79
552 - Blue Spring 5004
553 - Yellow Spring Down 65
554 - Red Spring Down 66
555 - Yellow Diagonal Spring 2015
556 - Red Diagonal Spring 38
557 - Yellow Diag Spring Down 20
558 - Red Diag Spring Down 39
600 - 699 : Special placement patterns
600 - Vertical Rigns - Stack of 5 (suitable for Yellow Spring) 84
601 - Vertical Rings - Stack of 5 (suitable for Red Spring) 44
602 - Diagonal rings (5) 76
603 - Diagonal rings (10) 77
604 - A ring of rings 47
605 - A BIGGER ring of rings 2007
606 - A ring of wing items 2048
607 - A BIGGER ring of wing items 2010
608 - A ring of rings and wings (alternating) 2046
609 - A BIGGER ring of rings and wings (alternating) 2047
700 - 799 : Powerup indicators/environmental effects/miscellany
700 - Ambient Water 1a (S) 2026
701 - Ambient Water 1b (S) 2024
702 - Ambient Water 2a (M) 2023
703 - Ambient Water 2b (M) 2045
704 - Ambient Water 3a (L) 83
705 - Ambient Water 3b (L) 2019
706 - Ambient Water 4a (XL) 2025
707 - Ambient Water 4b (XL) 27
708 - Random Ambient 1 14
709 - Random Ambient 2 43
750 - Chaos Spawner 8
751 - Teleport Point 5003
752 - Alternate View Point 5007
753 - Zoom Tube Waypoint 18
754 - Pusher 5001
755 - Puller 5002
756 - Street Light 2003
800 - 899 : Greenflower Scenery
800 - Flower 1 36
801 - Flower 2 70
802 - Flower 3 73
804 - Berry Bush 74
805 - Bush 75
900 - 999 : Techno Hill Scenery
900 - THZ Plant 2035
901 - Alarm 2006
1000 - 1099 : Deep Sea Scenery
1000 - Gargoyle 81
1100 - 1199 : Castle Eggman Scenery
1100 - Ceiling Chain 49
1101 - Torch Flame 24
1102 - Eggman Statue 52
1103 - CEZ Flower 2001
1200 - 1299 : Arid Canyon Scenery
1300 - 1399 : Red Volcano Scenery
1400 - 1499 : Dark City Scenery
1500 - 1599 : Doom Ship Scenery
1600 - 1699 : Egg Rock/Final Fight Scenery
1700 - 1799 : NiGHTS Items
1700 - Axis 72
1701 - Axis Transfer (Normal) 61
1702 - Axis Transfer (Line) 46
1703 - Nights Drone 60
1704 - Nights Bumper 82
1705 - Hoop 57
1706 - Nights Wing 37
1707 - Super Loop Powerup 3007
1708 - Drill Refill Powerup 3008
1709 - Helper Powerup 3009
1710 - Egg Capsule 40
1800 - 1849 : Mario Items
1800 - Coin 10005
1801 - Goomba 10000
1802 - Blue Goomba 10001
1803 - FireFlower 50
1804 - Shell 10
1805 - Puma 29
1806 - Koopa 19
1807 - Axe 12
1808 - Mario Bush 1 10002
1809 - Mario Bush 2 10003
1810 - Toad 10004
1850 - 1899 : Christmas Items
1850 - Xmas Pole 5
1851 - Candy Cane 13
1852 - Snowman 6
1900 - 1999 : Misc Scenery
1900 - Stalagmite 0
1901 - Stalagmite 1
1902 - Stalagmite 2
1903 - Stalagmite 3
1904 - Stalagmite 4
1905 - Stalagmite 5
1906 - Stalagmite 6
1907 - Stalagmite 7
1908 - Stalagmite 8
1909 - Stalagmite 9
-223
View File
@@ -1,223 +0,0 @@
Description OldNum NewNum Description
Old Water 14 Removed
Level Parameters/Misc:
Per-Sector Gravity 64 1
Custom Exit 71 2
Zoom Tube Parameters 18 3
Speed Pad 65 4
Camera Scanner 63 5
Disable Linedef 73 6
Flat Alignment 66 7
Sector Special Parameters New 8
Mace Parameters New 9
Sprite Cull Height New 10
Rope Hang Parameters New 11
Rock Spawner Parameters New 12
PolyObjects
Marks first line in PolyObject New 20
Explicitly includes a PolyObject line New 21
PolyObject: Parameters New 22
PolyObject: Waving Flag New 31
Level-Load Effects:
Instant Floor Lower 26 50
Instant Ceiling Raise 24 51
Continuously Falling Sector 88 52
Continuous Floor/Ceiling Mover 2 53
Continuous Floor Mover 3 54
Continuous Ceiling Mover 4 55
Continuous Two-Speed Floor/Ceiling Mover 6 56
Continuous Two-Speed Floor Mover 7 57
Continuous Two-Speed Ceiling Mover 8 58
Activate Floating Platform 232 59
Activate Floating Platform (Adjustable Speed) 233 60
Crusher 1 (Ceiling to Floor) 43 61
Crusher 2 (Floor to Ceiling) 50 62
Fake Floor/Ceiling 242 63
Appearing/Disappearing FOF New 64
Bridge Thinker New 65
Floor Over Floors:
"Floor Over Floor: Solid, Opaque, Shadowcasting " 25 100
"Floor Over Floor: Solid, Opaque, Non-Shadowcasting " 33 101
"Floor Over Floor: Solid, Translucent " 44 102
"Floor Over Floor: Solid, Sides Only " 69 103
"Floor Over Floor: Solid, No Sides " 51 104
"Floor Over Floor: Solid, Invisible " 57 105
"Floor Over Floor: Water, Opaque " 48 120
"Floor Over Floor: Water, Translucent " 45 121
"Floor Over Floor: Water, Opaque, No Sides " 75 122
"Floor Over Floor: Water, Translucent, No Sides " 74 123
"Floor Over Floor: Platform, Opaque " 59 140
"Floor Over Floor: Platform, Translucent " 81 141
"Floor Over Floor: Platform, Translucent, No Sides " 77 142
Floor Over Floor: Bobbing (Air) 38 150
Floor Over Floor: Adjustable Bobbing (Air) 68 151
Floor Over Floor: Reverse Adjustable Bobbing (Air) 72 152
"Floor Over Floor: Floating, Bobbing " 34 160
Floor Over Floor: Crumbling (Respawn) 36 170
Floor Over Floor: Crumbling (No Respawn) 35 171
"Floor Over Floor: Crumbling (Respawn), Platform " 79 172
"Floor Over Floor: Crumbling (No Respawn), Platform " 80 173
"Floor Over Floor: Crumbling (Respawn), Platform, Translucent " 82 174
"Floor Over Floor: Crumbling (No Respawn), Platform, Translucent " 83 175
"Floor Over Floor: Crumbling (Respawn), Floating, Bobbing " 39 176
"Floor Over Floor: Crumbling (No Respawn), Floating, Bobbing " 1 177
"Floor Over Floor: Crumbling (Respawn), Floating " 37 178
"Floor Over Floor: Crumbling (No Respawn), Floating " 42 179
"Floor Over Floor: Crumbling (Respawn), Bobbing (Air) " 40 180
"Floor Over Floor: Rising Platform, Solid, Opaque, Shadowcasting " 89 190
"Floor Over Floor: Rising Platform, Solid, Opaque, Non-Shadowcasting " 90 191
"Floor Over Floor: Rising Platform, Solid, Translucent " 91 192
"Floor Over Floor: Rising Platform, Solid, Invisible " 94 193
"Floor Over Floor: Rising Platform, Platform, Opaque " 92 194
"Floor Over Floor: Rising Platform, Platform, Translucent " 93 195
Floor Over Floor: Light Block 49 200
Floor Over Floor: Half Light Block 47 201
Floor Over Floor: Fog Block 46 202
"Floor Over Floor: Intangible, Opaque " 62 220
"Floor Over Floor: Intangible, Translucent " 52 221
"Floor Over Floor: Intangible, Sides Only " 67 222
"Floor Over Floor: Intangible, Invisible " 58 223
Floor Over Floor: Mario Block 41 250
Floor Over Floor: Thwomp Block 54 251
Floor Over Floor: Shatter Block 76 252
"Floor Over Floor: Shatter Block, Translucent " 86 253
Floor Over Floor: Bustable Block 55 254
Floor Over Floor: Spin Bust Block 78 255
"Floor Over Floor: Spin Bust Block, Translucent " 84 256
Floor Over Floor: Quicksand Block 56 257
Floor Over Floor: Laser Block 53 258
Floor Over Floor: Custom 87 259
Linedef Executor Triggers:
Trigger Linedef Executor (Continuous) 96 300
Trigger Linedef Executor (Each Time) 97 301
Trigger Linedef Executor (Once) 98 302
Trigger Linedef Executor (Ring Count - Continuous) 95 303
Trigger Linedef Executor (Ring Count - Once) 99 304
Trigger Linedef Executor (Character Ability - Continuous) 19 305
Trigger Linedef Executor (Character Ability - Each Time) 20 306
Trigger Linedef Executor (Character Ability - Once) 21 307
"Trigger Linedef Executor (Race Only, Once) " 9 308
Trigger Linedef Executor (CTF Red Team - Continuous) 10 309
Trigger Linedef Executor (CTF Red Team - Each Time) 11 310
Trigger Linedef Executor (CTF Blue Team - Continuous) 12 311
Trigger Linedef Executor (CTF Blue Team - Each Time) 13 312
Trigger Linedef Executor (No More Enemies - Once) 15 313
Trigger Linedef Executor (# of Pushables - Continuous) New 314
Trigger Linedef Executor (# of Pushables - Once) New 315
Trigger Linedef Executors (PolyObject - Land On) New 316
Trigger Linedef Executor (Level Load) New 399
Linedef Executor Options:
Linedef Executor: Set Tagged Sector's Floor Height/Pic 101 400
Linedef Executor: Set Tagged Sector's Ceiling Height/Pic 102 401
Linedef Executor: Set Tagged Sector's Light Level 103 402
Linedef Executor: Move Tagged Sector's Floor 106 403
Linedef Executor: Move Tagged Sector's Ceiling 107 404
Linedef Executor: Lower Floor by Line 108 405
Linedef Executor: Raise Floor by Line 109 406
Linedef Executor: Lower Ceiling by Line 110 407
Linedef Executor: Raise Ceiling by Line 111 408
Linedef Executor: Change Calling Sector's Tag 112 409
Linedef Executor: Change Front Sector's Tag 114 410
Linedef Executor: Stop Plane Movement 116 411
Linedef Executor: Teleport Player to Tagged Sector 104 412
Linedef Executor: Change Music 105 413
Linedef Executor: Play SFX 115 414
Linedef Executor: Run Script 113 415
Linedef Executor: Start Adjustable Fire Flicker 119 416
Linedef Executor: Start Adjustable Glowing Light 120 417
Linedef Executor: Start Adjustable Strobe Flash (unsynchronized) New 418
Linedef Executor: Start Adjustable Strobe Flash (synchronized) New 419
Linedef Executor: Fade Light Level 117 420
Linedef Executor: Stop Lighting Effect 118 421
Linedef Executor: Cut-Away View 121 422
Linedef Executor: Change Sky 123 423
Linedef Executor: Change Weather 124 424
Linedef Executor: Change Object State 125 425
Linedef Executor: Stop Object 122 426
Linedef Executor: Award Score 126 427
Linedef Executor: Start Platform Movement 127 428
Linedef Executor: Crush Ceiling Once New 429
Linedef Executor: Crush Floor Once New 430
Linedef Executor: Crush Floor & Ceiling Once New 431
Linedef Executor: Enable 2D Mode New 432
Linedef Executor: Disable 2D Mode New 433
Linedef Executor: Award Custom Power New 434
Linedef Executor: Stop Conveyor New 435
Linedef Executor: Start Conveyor New 436
Linedef Executor: Disable Player Movement New 437
Linedef Executor: Execute Linedef Executor New 450
Linedef Executor: PolyObject: Door Slide New 480
Linedef Executor: PolyObject: Door Swing New 481
Linedef Executor: PolyObject: Move XY New 482
Linedef Executor: PolyObject: Move XY w/ override New 483
Linedef Executor: PolyObject: Rotate Right New 484
Linedef Executor: PolyObject: Rotate Right w/ override New 485
Linedef Executor: PolyObject: Rotate Left New 486
Linedef Executor: PolyObject: Rotate Left w/ override New 487
Linedef Executor: PolyObject: Start waypoint movement New 488
Linedef Executor: PolyObject: Make Invisible New 489
Linedef Executor: PolyObject: Make Visible New 490
Scrollers/Pushers:
Scroll Wall First Side Left 100 500
Scroll Wall First Side Opposite Direction 85 501
Scroll Wall According to Linedef 254 502
Acc Scroll Wall According to Linedef 218 503
Disp Scroll Wall According to Linedef 249 504
Scroll Texture by Offsets 255 505
Scroll Floor Texture 251 510
Acc Scroll Floor Texture 215 511
Disp Scroll Floor Texture 246 512
Scroll Ceiling Texture 250 513
Acc Scroll Ceiling Texture 214 514
Disp Scroll Ceiling Texture 245 515
Carry Objects on Floor (no scroll) 252 520
Acc Carry Objects on Floor 216 521
Disp Carry Objects on Floor 247 522
Carry Objects on Ceiling 203 523
Acc Carry Objects on Ceiling 205 524
Disp Carry Objects on Ceiling 201 525
Scroll Floor Texture and Carry Objects 253 530
Acc Scroll Floor Texture and Carry Objects 217 531
Disp Scroll Floor Texture and Carry Objects 248 532
Scroll Ceiling Texture and Carry Objects 202 533
Acc Scroll Ceiling Texture and Carry Objects 204 534
Disp Scroll Ceiling Texture and Carry Objects 200 535
Friction 223 540
Horizontal Wind 224 541
Upwards Wind 229 542
Downwards Wind 230 543
Horizontal Current 225 544
Upwards Current 227 545
Downwards Current 228 546
Boom Push/Pull Thing 226 547
Lighting:
Floor Lighting 213 600
Ceiling Lighting 5 601
Adjustable Pulsating Light 60 602
Adjustable Flickering Light 61 603
Adjustable Blinking Light (unsynchronized) New 604
Adjustable Blinking Light (synchronized) New 605
Colormap 16 606
BIN
View File
Binary file not shown.
-78
View File
@@ -1,78 +0,0 @@
Removed:
- Buttons 1-20 690-709
- Button 21 (THZ2 A/740 B/741 D/742 E/745 710
- Close Door Blazing (Tag 743) 711
- Raise Ceiling to Highest (Tag 744) 981
- THZ2 Slime Raise (B/712 W713 P714 D715 S716) 986
Stuff to Remove/Change:
- Light Blinks On Every 0.5 Seconds 2 Add Linedef Combine
- Light Blinks On Every 1 Second 3 Add Linedef Combine
- Light Pulses Smoothly 8 Remove
- Light Blinks On Every 0.5 Seconds (Sync) 12 Add Linedef Combine
- Lights Blinks On Every 1 Second (Sync) 13 Add Linedef Combine
- Light Flickers Like Fire 17 Remove
? - Damage (Fire) and Current 519 Remove (convert to combination)
? - Damage (Water) and Current 984 Remove (convert to combination)
Section 1:
1 - Damage (Generic) 11
2 - Damage (Water) 983
3 - Damage (Fire) 7
4 - Damage (Electrical) 18
5 - Spikes 4
6 - Death Pit (Camera Mod) 16
7 - Death Pit (No Camera Mod) 5
8 - Instant Kill 10
9 - Ring Drainer (Floor Touch) 978
10 - Ring Drainer (No Floor Touch) 980
11 - Special Stage Damage 9
12 - Space Countdown 6
13 - Ramp Sector (Increase step-up) 992
14 - Non-Ramp Sector (Don't step-down) 996
15 - Bouncy Sector (FOF Control Only) 14
Section 2: << 4
1 - Trigger Linedef Exec (Pushable Objects) 971
2 - Trigger LD Exec (Anywhere in Sec/All Pls) 972
3 - Trigger Linedef Exec (Floor Touch/All Pls) 973
4 - Trigger Linedef Exec (Anywhere in Sec) 974
5 - Trigger Linedef Exec (Floor Touch) 975
6 - Trigger Linedef Exec (Emerald Check) 967
7 - Trigger Linedef Exec (NiGHTS Mare) 968
8 - Check for linedef executor on FOFs (ANY) 970
9 - Egg Trap Capsule 666
10 - Special Stage Time/Rings, Par 990
11 - Custom Global Gravity 991
Section 3: << 8
1 - Ice/Sludge (required?!) 256
2 - Wind/Current (required?!) 512
3 - Ice/Sludge and Wind/Current 768
4 - Conveyor Belt 985
5 - Speed Pad (No Spin) 976
6 - Speed Pad (Spin) 977
7 - Bustable Block Sprite Parameter 1500-1515
8 - "
9 - "
10 - "
11 - "
12 - "
13 - "
14 - "
15 - "
Section 4: << 12
1 - Starpost Activator 993
2 - Special Stage Goal Combine 33
2 - Exit Sector Combine 982
2 - No Tag Zone Combine 987
2 - CTF: Flag Return Combine 995
3 - CTF: Red Team Base 988
4 - CTF: Blue Team Base 989
5 - Fan Sector 997
6 - Super Sonic Transform 969
7 - Spinner 979
8 - Zoom Tube Start 998
9 - Zoom Tube End 999
10 - Finish Line 994
-307
View File
@@ -1,307 +0,0 @@
SRB2
Release v1.09, ? 2005.
Last Updated: June 2005
Original game & sources by: Id Software.
Additions: (c)1998 by: Fabrice Denis & Boris Pereira
(c)1999 by: Fabrice Denis, Boris Pereira & Thierry Van Elsuwe
(c)2000 by: Boris Pereira & Thierry Van Elsuwe
(c)2004 By: AJ, Graue, Alam Arias, Logan Arias & Andrew Clunis
Special thanks to Steven McGranahan, Lee Killough, Robert Bäuml and Bell Kin for
their large contribution and to other DooM LEGACY & SRB2 Team members.
Web site: http://www.SRB2.org/
e-mail: none@none.com
OpenGL specific:
Web site: http://legacy.newdoom.com/gl
-----------------------------------------------------------------------
F.A.Q.
-----------------------------------------------------------------------
If you have any trouble with SRB2, you might find a solution
here.
If you find a solution to a problem that was not listed here,
please tell us so that we can update the FAQ and help other people!
Mail your hardware/software problems to:
None@none.com subject: FAQ
--------
CONTENTS
--------
[0] Miscellaneous
[1] Mouse/Joystick/Keyboard
[2] Video
[3] Sound
[4] Network
[5] Troubleshooting
-----------------
[0] MISCELLANEOUS
-----------------
* under win95 or OS/2, I don't have enough memory. How can i handle with ?
Tell win95 to put more dpmi memory for your dos box.
Or use the -mb option.
---------------------------
[1] MOUSE/JOYSTICK/KEYBOARD
---------------------------
* My mouse/joystick does not work in SRB2.
First, check that the mouse/joystick is activated : go at the
console and type either 'use_mouse' (or use the respective
menuitem) or 'use_joystick'.
If it tells '0' or off than the mouse/joystick is not used,
set the variable to 1. eg: 'use_mouse 1'.
For the joystick, different values will support different
types of joystick, check the console documentation for the
command 'use_joystick' for more.
Even if the mouse or joystick is activated, you have to
set up the contols into the Setup Controls menu. That is:
tell what use you will make of the mouse/joystick buttons.
---------
[2] VIDEO
---------
* Where are the other video modes ? I have only '320x200' in the
Video Modes menu.
DOS
---
SRB2 adds new video modes only if a VESA2 (or better) driver
is present. The VESA2 driver is a standard of 'talking' between a
program and the huge amount of different graphics cards
available today.
If you don't have a VESA2 driver, you can download UNIVBE, or
SMART DISPLAY DOCTOR from
http://www.scitechsoft.com/products/ent/free_titles.html
or if you have an S3 based card, you can download the free
software called 'S3VBE'.
ftp://ftp.externet.hu/pub/mirror/sac/graph/s3vbe318.zip
ftp://ftp.digsys.bg/pub/simtelnet/msdos/graphics/s3vbe318.zip
http://www.filesearching.com/cgi-bin/s?q=s3vbe318.zip
http://www.google.com/search?q=s3vbe318.zip
* The game doesn't restore the video mode I have chosen the last time
I played SRB2.
The current video mode has to be made the 'default' so that it is
saved to the config : press the key 'D' on the Video Options menu
to set the current video mode the default.
* I have some problems with OpenGL mode
Have a look at the FAQ for OpenGL on the glLegacy web site:
http://www.doomnation.com/gllegacy/faqe.htm
# Linux: I only have a 1024x768 (or 800x600, 1280x1024, ...) resolution
in fullscreen mode under X and SRB2 is really really slow. Can I
have lower resolutions like 320x200 in fullscreen mode as well?
Probably yes. SRB2 can only use the resolutions offered by the
X-Server. So if all fullscreen modes have a very high resolution you
have to modify /etc/XF86Config (or /etc/X11/XF86Config). Use XF86Setup
(or the appropriate tool coming with your distribution - sax,
xf86config, ...) to do this.
If you do not succeed there, you can enter them manually into your
XF86Config file. ONLY RECOMMENDED FOR USERS WHO KNOW WHAT THEY DO!
For a short guide on how to do this, have a look at the file
"Doublescan.txt".
In case of doubt consult the XFree86-HOWTO (or ask your system
administrator :).
# Linux: I cannot have any fullscreen modes at all!
You have only modes above 1024x768 in your XF86Config. Proceed as
described above.
# Linux: After a certain idle time my screensaver jams the display of
SRB2. I can still operate SRB2, but I do not see what's happening
and the screensaver won't go away.
You probably have KDE. The KDE screensaver does not obey the screensaver
rules (at least mine, version 1.1). The solution is to deactivate the
KDE screensaver and use another screensaver (like the xscreensaver,
e.g.). But the hell, when you started SRB2 you should have played it
as well and not left it alone!!!
---------
[3] SOUND
---------
+ DOS:I can't have CD audio music, why ?
Make sure that the MSCDEX driver version 2.0 or later is loaded.
If it says 'MSCDEX version xxx' at game startup, and you still
don't hear the cd music, then probably your card doesn't respond
when SRB2 tries to set the cd volume. If so, make sure your sound
card's mixer have the cd volume set up so that you can hear something.
+ When the CD plays, the game is very 'jerky'. It doesn't do that when
I type 'cd off' in the console.
You have an old/bad cd driver, that can take up to a second to
respond to cd driver commands. Either get the latest version of
your driver, or turn cd update off. Check 'cd_udpate' in the
console documentation for more.
* DOS:How can I *ALWAYS* disable the sounds or music of the game ?
Edit the allegro.cfg file and set digicard/midicard to 0 (none)
* DOS:My sterero sound is reversed, how can I set it the right way ?
Change the console variable 'stereoreverse' to either 1 or 0.
Or, you can edit the allegro.cfg file, and set the 'flip_pan' variable.
* DOS:The sounds are too 'slow', or 'low-pitched'
It seems to be a problem of the auto-detection of some 8bit sound
cards. You will have to set manually the 'sb_freq' value in the
allegro.cfg file to a lower value : 11906, 16129.
* DOS:SRB2 doesn't play any sound/music, but I have a sound
blaster genuine/compatible card.
If you have a genuine or compatible SoundBlaster card, it is very
important that you set the BLASTER environment variable.
If you are playing under DOS, and never installed your sound card
under DOS, run the setup of your sound card for DOS.
Check if the BLASTER variable was set: type 'SET' under dos
(or DOSbox)
Do you see something like 'BLASTER=A220 I5 D1 ...' ?
Yes? If you don't hear sounds/music, then tweak the settings in the
allegro.cfg file until you get something, first try changing the
type of the sound card, it is not always properly detected.
No? You have to set this variable in order that your sound card is
detected. Run the setup that was shipped with your sound card, and
make sure you run the setup for DOS too, it will usually add a
line of the type 'SET BLASTER=... ...' in the autoexec.bat file.
* DOS:How can I have better midi music on my 8bit sound card ?
Use the DIGMID driver, it is supported in SRB2.
What the hell is this? Well, the Gravis Ultrasound uses digital
samples to play midi music. On a simple 8bit card, you can use digital
samples too, which will sound usually better than what is output
by the poor fm synthesis chip of 8bit cards.
You will need to get a Gravis Ultrasound patch set, you can find
several ones for free on internet, it consists of a bunch of '.pat'
files which are the digital samples to play the midi instruments
(eg: piano, conga, guitar, ect.).
Check the Allegro homepage for some links to GUS patches:
http://alleg.sourceforge.net/digmid.html
http://alleg.sourceforge.net/
http://www.talula.demon.co.uk/allegro/digmid.html
http://www.talula.demon.co.uk/allegro/
Now to activate the DIGMID driver:
Set the 'midi_card' value to 8 (DIGMID) in the allegro.cfg file.
Make sure you leave the 'digi_voices' blank, or set it to a low
value, because the midi music will use digital voices.
At the end of the allegro.cfg file, set the 'patches' value
to the path, where you have installed a Gravis Ultrasound midi
patch set. eg: patches = d:\music\midipat\
# Linux: CD music does not work or only works when run as root.
We do not encourage you to run SRB2 as root (you never know
what SRB2 can do to your system - it's a mighty piece of code :).
There is a common problem with ATAPI CD-rom drives, which are
treated as harddisks. Usually there is a link /dev/cdrom pointing to
device hd[b,c,d]. As harddisks are not supposed to be read directly
via this device (especially not by a common user), there are no read
permissions for "all". For CD-roms you can savely set read permissions
unless you are very paranoid. Assuming your CD-rom drive is /dev/hdc,
set permissions with "chmod +r /dev/hdc" (as root). SCSI CD-rom drives
should not have this problem. But if they do, proceed as described
with ATAPI drives.
# Linux: The CD music volume is not set properly.
Go to the console and type "jigglecdvolume 1".
-----------
[4] NETWORK
-----------
* Where can I find Internet servers ?
For the moment there is one public server.
http://srb2.servegame.org/ Master server web page
srb2.servegame.org:28910 current Master Server
* When I start SRB2 with -server or -connect it say :
"BinToPort: Address already in use (EADDRINUSE)"
It appears only when SRB2 crashes or when you leave with ctrl-break.
use -udpport 12345 (or any other free slot) on both sides (client and
server).
This can also happens when there is already a SRB2 running on your
computer if you whant to try two SRB2 running on the same computer
use -clientport 12345 (or any other free slot). Then the second will
connect to the first one.
* Do you use the tcp protocol ?
No, we use the udp protocol which is faster, but don't worry udp is a
part of the internet protocol.
-------------------
[5] Troubleshooting
-------------------
# Linux: SRB2 is hung in fullscreen mode and won´t let me leave.
What shall I do?
Some people press the reset button, but hey, we are not in the
stoneage of operating systems! There are two "proper" ways to
get out: kill your X-Server. You can usually do this by pressing
"CTRL-ALT-BACKSPACE". But if you have other open applications with
important data (probably hacked away on your diploma thesis for 3
weeks without saving once) you can also kill SRB2 directly. Press
"CTRL-ALT-F2" and you will get to a console. Log in, type
"killall llxSRB2" and switch back to the X-Server with "CTRL-ALT-F7".
Some X-Server crash on this procedure - blame the X-Server for the
loss of 3 weeks work on your diploma thesis :)
-68
View File
@@ -1,68 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
Sonic Robo Blast 2 Manual
</title>
<link rel="stylesheet" type="text/css" href="srb2manstyle.css">
<!-- Borrowed some javascript code so the height of the iframe is equal to the size of the document - Sonict -->
<script type="text/javascript">
/* free code from dyn-web.com */
function getDocHeight(doc) {
doc = doc || document;
// from http://stackoverflow.com/questions/1145850/get-height-of-entire-document-with-javascript
var body = doc.body, html = doc.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
return height;
}
function setIframeHeight(id) {
var ifrm = document.getElementById(id);
var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;
ifrm.style.visibility = 'hidden';
ifrm.style.height = "10px"; // reset to minimal height in case going from longer to shorter doc
ifrm.style.height = getDocHeight( doc ) + "px";
ifrm.style.visibility = 'visible';
}
</script>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p class="c1">
<img src="manual_img/sonicname2.png" alt="SONIC" width="136" height="36">
<br>
<img src="manual_img/srb2banner.png" alt="ROBO BLAST 2" width="224" height="43">
</p>
<p class="c1">
<big><big><strong>Manual</strong></big></big>
</p>
<table class="cf" align="center">
<tr><td class="c">
<ul class="hmenu">
<li class="hmenu"><a class="hmenu" href="intro.htm" target="ifrm">Main</a></li>
<li class="hmenu"><a class="hmenu" href="items.htm" target="ifrm">Items</a></li>
<li class="hmenu"><a class="hmenu" href="playerabilities.htm" target="ifrm">Player Abilities</a></li>
<li class="hmenu"><a class="hmenu" href="basicplay.htm" target="ifrm">Gameplay</a></li>
<li class="hmenu"><a class="hmenu" href="surroundings.htm" target="ifrm">Surroundings</a></li>
</ul>
</td></tr>
<tr><td class="c">
<ul class="hmenu">
<li class="hmenu"><a class="hmenu" href="multiplayer.htm" target="ifrm">Multiplayer</a></li>
<li class="hmenu"><a class="hmenu" href="zones.htm" target="ifrm">Zones</a></li>
<li class="hmenu"><a class="hmenu" href="controls.htm" target="ifrm">Controls</a></li>
<li class="hmenu"><a class="hmenu" href="consolecommands.htm" target="ifrm">Console Commands</a></li>
<li class="hmenu"><a class="hmenu" href="misc.htm" target="ifrm">Misc</a></li>
</ul>
</td></tr>
</table>
<hr>
<p class="c1">
<!-- The "onload" property of the iframe makes an error when validated through the W3C validation checker. -->
<!-- This will not be fixed as it isn't worth the time to fix it up properly. - Sonict -->
<iframe id="ifrm" name="ifrm" src="intro.htm" onload="setIframeHeight(this.id)"> </iframe>
</p>
</body>
</html>
-39
View File
@@ -1,39 +0,0 @@
SVN-RULES
- As you can see, there is sub-directory in the repository, one for eatch
platform (djgpp (dos),win32,SDL) the root directory is for all platform,
so take care of the order we have put in.
- do not commit/upload tests of bugged code, try to fix a maximum of know
bugs and update know bugs list in source.txt. If you must commit your source
make your code in #ifdef so we can disable it
- SRB2 is a modification of doom/Doom Legacy source. We allow additionnal feature
and visual addition.
- Maximize communications between members, do not impose your changes, if your
are not sure about a feature/change, talk about it in irc://irc.esper.net/srb2 chat room.
CODE-RULES
- We use no tab, 4 space indent, and tab size 8 (in case some tab have filtred
and for makefile)
- Self documented code, variable and function must have a name that help
understand the code, so do not call variable and function a,b, a2, ...
- the usage of extern in a c file is prohibited, except for declaration of a
function with body (so it is like public keyword in c++)
Also function protos haren't allowed for external function, put it un the
corresponding h file.
- Try to minimize #ifdef usage for :
- code readability
- the main code is for all port so if something is good for a platform all
platform can benefit by this feature
- Take care of platform dependent code, we would like to have code that work
on Dos, Win32, SDL, ... little and big endian, software/Glide/OpenGl.
GOOD PRACTICE
- Try to put as mush static variable and function on module so it help to
understand the role of the varaible/function in the module also this
help the compiler to optimize
- minimise global variable
- make a log of your work, so you don't need to put a lot of comment in
the code, this will also help us to update the what's new section of doc
when doing final release
-240
View File
@@ -1,240 +0,0 @@
1. Compile SRB2
2. Explanation of the code
2.1 The memory model
2.2 Hardware Texture model
1. Compile SRB2
=================
DOS
---
need:
- djgpp 2.03 (http://www.delorie.com/djgpp/)
- allegro 3.12 (http://alleg.sourceforge.net/index.html)
(
- libsocket 0.7.4 (beta 4) or better
for use with Winsock 1.1 (example Windows 3.1)
(http://www.phekda.freeserve.co.uk/richdawe/lsck/lsck.htm)
OR
- Wattcp-32 v2.2 dev.rel 6 or better
For use with a packet driver
(http://www.bgnett.no/~giva/)
(http://groups.yahoo.com/group/watt-32/)
(http://groups.yahoo.com/group/watt-32/files/v2.2/)
)
- bcd 1.03 (inlcude in this package)
- gcc 2.95.2 is recommended
- nasm 0.98 (or better) (http://nasm.sourceforge.net/)
compile:
make
make WATTCP=1 (to make a Wattcp-32 version)
debug:
when craching SRB2 will return eip
type make asm, then you will have a 8 megs srb2.s (a assembler file)
the you can find the faulting instruction and function
------------------------------------------------------------------------
Linux/SDL
-----
need:
- tested with gcc 2.95 and 3.X.
- SDL 1.2
- SDL_mixer 1.2
- ibogg and libvorbis (http://Xiph.org/)
- nasm 0.98 (or better)(http://nasm.sourceforge.net/) only with 2.95, else add CC30=1
compile
make LINUX=1
debug:
gdb ?
------------------------------------------------------------------------
Win32
-----
need :
- glide 3.x sdk (optional) (http://www.3dfx.com)
- directx6 sdk (or higher) (http://www.micosoft.com/directx)
- nasm 0.98 (or better) (http://nasm.sourceforge.net/)
- use src\win32\wLegacy.dsp
- VC6 should also work with VC5, and VS.NET 200X
debug:
press on "step over" with the release version (there is some debug info
on it). Then change the eip in the regster window when you will type
enter the edi will go to the faulting instruction. don't forget that
you can follow the stack for calls.
You can also use trace with the debug version but add -win and -nomouse.
------------------------------------------------------------------------
Win32/minGW/SDL
-----
need:
- tested with gcc 2.95 and 3.X.
- can also use Dev-C++ 5.0 beta 9 (4.9.9.0) from http://www.bloodshed.net/dev/devcpp.html
- SDL 1.2
- SDL_mixer 1.2
compile
make minGW=1 SDL=1
or use src\SDL\Win32SDL.dev with Dev-C++ 4.9.9.0 or later
debug:
gdb ?
------------------------------------------------------------------------
WinCE/SDL WIP
-----
need:
- ActiveSync 3.8
http://www.microsoft.com/windowsmobile/downloads/activesync38.mspx
- ActiveSync 3.7.1, if 3.8 isn't available for your language
http://www.microsoft.com/windowsmobile/downloads/activesync37.mspx
- eMbedded Visual Tools 3.0 - 2002 Edition
http://www.microsoft.com/downloads/details.aspx?FamilyID=f663bf48-31ee-4cbe-aac5-0affd5fb27dd
- Pocket PC 2000 SDK
http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3f4d7b-de2a-4e1a-a175-26a68c301ac4
- Pocket PC 2002 SDK (eMVT 3.0 2002 Ed. comes with this)
http://www.microsoft.com/downloads/details.aspx?FamilyID=2dbee84a-bd94-4167-b817-2b2e548b2e92
- Pocket PC 2002 SDK Emulator Images (eMVT 3.0 2002 Ed. comes with this)
http://www.microsoft.com/downloads/details.aspx?FamilyID=25f4de97-ae80-477a-9df1-496b85b3d3e3
- eMbedded Visual C++ 4.0
http://www.microsoft.com/downloads/details.aspx?familyid=1DACDB3D-50D1-41B2-A107-FA75AE960856
- eMbedded Visual C++ 4.0 SP3 (Win CE 4.0-4.2)
http://www.microsoft.com/downloads/details.aspx?FamilyID=5bb36f3e-5b3d-419a-9610-2fe53815ae3b
OR
- eMbedded Visual C++ 4.0 SP4 (No SH3 support,Win CE 4.0-5.0 support)
http://www.microsoft.com/downloads/details.aspx?FamilyID=4a4ed1f4-91d3-4dbe-986e-a812984318e5
- eMbedded Visual C++ 4.0 Update 5625 (SP4 only)
http://www.microsoft.com/downloads/details.aspx?FamilyID=aa282a6d-6f57-436d-8c10-0ec02d94f5b1
- Windows CE: Standard Software Development Kit
http://www.microsoft.com/downloads/details.aspx?familyid=a08f6991-16b0-4019-a174-0c40e6d25fe7
- SDK for Windows Mobile 2003-based Pocket PCs
http://www.microsoft.com/downloads/details.aspx?FamilyId=9996B314-0364-4623-9EDE-0B5FBB133652
- Emulator Images for Windows Mobile 2003 Second Edition software for Pocket PC
http://www.microsoft.com/downloads/details.aspx?familyid=5C53E3B5-F2A2-47D7-A41D-825FD68EBB6C
- Microsoft Device Emulator 1.0 Community Preview
http://beta.microsoft.com Use Guest ID "MSDEVICE" to access the Community Preview website
- Windows CE Utilities for Visual Studio .NET 2003 Add-on Pack 1.1
(if you also have VS 2003 installed, you need this to install Win CE 5.0 SDK, else no need)
http://www.microsoft.com/downloads/details.aspx?FamilyId=7EC99CA6-2095-4086-B0CC-7C6C39B28762
- Windows CE 5.0: Standard Software Development Kit (eMC++ 4 SP4 only)
http://www.microsoft.com/downloads/details.aspx?FamilyID=fa1a3d66-3f61-4ddc-9510-ae450e2318c3
- SDL 1.27 (use patch and zip in tools\SDL1.2.7_CE)
compile
use src\SDL\WinCE\SRB2CE.vcw
debug:
?
2. Explanation of the code
==========================
2.1 The memory model (original) (z_zone.c) (by BP)
--------------------
SRB2 allocate a heap of 6/32/48 megs at begining and provide a Z_Malloc function
to allocate in this heap.
Z_Malloc( int size,int tag,void* user )
size is the size in byte
tag can be : PU_STATIC allocated static (like malloc do)
call Z_Free to free it
PU_LEVEL same as static but the zone is "tagged" with the
tag PU_LEVEL, when calling
Z_FreeTag (PU_LEVEL, PU_LEVEL) all zone tagged
with PU_LEVEL are freed (at the end of the level)
PU_CACHE this one _can_ be freed automatiquely by one other
call to Z_Malloc. the *user point to a pointer
to this zone so when freed automatiquely the
pointer is set to NULL so eatch time you use it
you must check if the pointer is not NULL and
reload it.
(...)
2.2 Hardware Texture model (by BP)
--------------------------
Eatch texture/patch/flats/pic in SRB2 are converted to hardware texture at
runtime (the GlideMipmap_s structure (hw_data.h)). I will call hardware
texture a gr_texture so there is no confusion.
To remind you :
- Texture are set of patch and are associate to linedefs (walls) can be
upper, lower or middle texture. It can have hole on it.
- patch are sprites (the doom patch are run of vertical lines)
- flats are used for floors and ceiling of sectors and have size of 64x64
it can't have hole on it
- pic are new legacy format for picture, it can only handle plain texture
like flats it is now used for hud in full screen for the main picture
of legacy and for coronas (the format was extended to handle 32 bit color
or intensity + alpha, not all are implemented at this time)
Since patch, flat and pic are basic structure represented by only one lump in
the wad, the wad loader allocate for eatch lump a GlideMipmap_s (cache3Dfx)
and init data field to NULL. Since the data structure is allocated in
PU_3DFXCACHE (like PU_CACHE) the data will be initilised when needed
(hw_cache.c).
The GlideMipmap_s structures for textures are initialized on
HWR_PrepLevelCache (hw_cache.c) it is called in P_SetupLevel (load level)
the number of textures is computed with TEXTURE1, TEXTURE2 lumps since this
can be changed in runtime in SRB2 (load a wad while runing) it must be
reallocated. Well, at this time it is realloceted at eatch level start. We
can do better, since numtextures change only when a wad is loaded.
The 3dfx driver use glide3, it load gr_texture in gr_texture memory of the
card in fifo order when there is no more place it remove the first gr_texture,
the downloaded field of GlideMipmap_s go to false and when needed it is
reloaded in gr_texture memory. In OpenGl, since OpenGl keep texture in there
own memory and handle gr_texture memory of the card we no more need to
redownload it but if we not free time to time gr_texture memory in opengl,
it will get alot of memory, so the gr_texture memory is cleared at eatch
new level (same time of texture reallocation). Opengl and 3dfx link the
loaded gr_texture with the nextmipmap field of GlideMipmap_s so before clear
textures of the heap we MUST free gr_texture memory of OpenGl or 3dfx !
SRB2 can also draw patch with a differant colormap (thanks to Hurdler).
When needed it create the same gr_texture but just with a differant colormap.
This one is linked with the original in the GlideMipmap_s with the
nextcolormap field.
So when a polygone with a gr_texture must be drawn, first we check if the
gr_textures is not allready loaded in hadware memory (downloaded field) if
not then we check if gr_texture data is there (not grabbed by z_malloc
function) if not we must recompute it eatch type of gr_texture (texture,
patch, flat, pic have there own methode) the we can send the gr_texture
to 3dfx or OpenGl.
-1992
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -5,13 +5,13 @@
# met:
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# notice, this list of conditions and the following disclaimer.
# (2) Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# distribution.
# (3) The name of the author may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.
@@ -26,4 +26,4 @@
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# POSSIBILITY OF SUCH DAMAGE.
+11 -1
View File
@@ -10,8 +10,18 @@ The libbacktrace library may be linked into a program or library and
used to produce symbolic backtraces.
Sample uses would be to print a detailed backtrace when an error
occurs or to gather detailed profiling information.
In general the functions provided by this library are async-signal-safe,
meaning that they may be safely called from a signal handler.
That said, on systems that use `dl_iterate_phdr`, such as GNU/Linux,
the first call to a libbacktrace function will call `dl_iterate_phdr`,
which is not in general async-signal-safe. Therefore, programs
that call libbacktrace from a signal handler should ensure that they
make an initial call from outside of a signal handler.
Similar considerations apply when arranging to call libbacktrace
from within malloc; `dl_iterate_phdr` can also call malloc,
so make an initial call to a libbacktrace function outside of
malloc before trying to call libbacktrace functions within malloc.
The libbacktrace library is provided under a BSD license.
See the source files for the exact license text.
@@ -25,7 +35,7 @@ will work.
See the source file backtrace-supported.h.in for the macros that it
defines.
As of October 2020, libbacktrace supports ELF, PE/COFF, Mach-O, and
As of July 2024, libbacktrace supports ELF, PE/COFF, Mach-O, and
XCOFF executables with DWARF debugging information.
In other words, it supports GNU/Linux, *BSD, macOS, Windows, and AIX.
The library is written to make it straightforward to add support for
Binary file not shown.
@@ -0,0 +1,41 @@
# libbacktrace.la - a libtool library file
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libbacktrace.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=''
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libbacktrace.
current=0
age=0
revision=0
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/mingw64/lib'
@@ -0,0 +1,41 @@
# libbacktrace.la - a libtool library file
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libbacktrace.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=''
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libbacktrace.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/mingw64/lib'
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

+1 -6
View File
@@ -442,12 +442,7 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
set(SRB2_HAVE_PNG ON)
add_definitions(-DHAVE_PNG)
add_definitions(-D_LARGEFILE64_SOURCE)
set(SRB2_PNG_SOURCES apng.c)
set(SRB2_PNG_HEADERS apng.h)
prepend_sources(SRB2_PNG_SOURCES)
prepend_sources(SRB2_PNG_HEADERS)
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS}
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS})
else()
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
endif()
+5
View File
@@ -0,0 +1,5 @@
makedir:=$(makedir)/Dummy
sources+=$(call List,dummy/Sourcefile)
NOHW=1
+2 -3
View File
@@ -18,8 +18,10 @@ ifndef NOHW
opts+=-DHWRENDER
ifndef NOSCREENFBO
ifndef STATIC_OPENGL
opts+=-DUSE_FBO_OGL
endif
endif
sources+=$(call List,hardware/Sourcefile)
endif
@@ -28,14 +30,12 @@ ifndef NOMD5
sources+=md5.c
endif
ifndef NONET
ifndef NOSATURNJOIN
opts+=-DDOSATURNJOIN
endif
ifndef NOSATURNPAK
opts+=-DDOSATURNPAK
endif
endif
ifndef NOZLIB
ifndef NOPNG
@@ -50,7 +50,6 @@ ifdef LINUX
opts+=-D_LARGEFILE64_SOURCE
endif
opts+=-DHAVE_PNG
sources+=apng.c
endif
endif
-2
View File
@@ -19,9 +19,7 @@ else ifeq (${DEDICATED},1)
EXENAME?=srb2haikud
endif
ifndef NONET
libs+=-lnetwork
endif
define _set =
$(1)_CFLAGS?=$($(1)_opts)
+1
View File
@@ -34,6 +34,7 @@ m_misc.c
m_perfstats.c
m_queue.c
m_random.c
m_curl.c
mserv.c
http-mserv.c
qs22j.c
+8 -1
View File
@@ -265,6 +265,11 @@ static void AM_findMinMaxBoundaries(void)
max_w = minimapinfo.map_w << MAPBITS;
max_h = minimapinfo.map_h << MAPBITS;
if (max_w == 0)
max_w = 1;
if (max_h == 0)
max_h = 1;
a = FixedDiv(f_w<<FRACBITS, max_w);
b = FixedDiv(f_h<<FRACBITS, max_h);
@@ -354,7 +359,9 @@ static void AM_LevelInit(void)
AM_findMinMaxBoundaries();
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
if (scale_mtof > max_scale_mtof)
scale_mtof = min_scale_mtof;
scale_mtof = max_scale_mtof;
if (scale_mtof == 0)
scale_mtof = 1;
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
}
+1 -2
View File
@@ -42,7 +42,6 @@ INT32 VID_SetMode(INT32 modenum)
vid.modenum = 0;
vid.width = 320;
vid.height = 240;
vid.buffer = android_surface;
return 0;
}
@@ -65,7 +64,7 @@ void I_WaitVBL(INT32 count)
(void)count;
}
void I_ReadScreen(UINT8 *scr)
void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
{
(void)scr;
}
-289
View File
@@ -1,289 +0,0 @@
/*
Copyright 2019, James R.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string.h>
#include "apng.h"
#define APNG_INFO_acTL 0x20000U
#define APNG_WROTE_acTL 0x10000U
struct apng_info_def
{
png_uint_32 mode;
png_uint_32 valid;
png_uint_32 num_frames;
png_uint_32 num_plays;
long start_acTL;/* acTL is written here */
png_flush_ptr output_flush_fn;
apng_seek_ptr output_seek_fn;
apng_tell_ptr output_tell_fn;
apng_set_acTL_ptr set_acTL_fn;
};
/* PROTOS (FUCK COMPILER) */
void apng_seek (png_structp, apng_const_infop, size_t);
size_t apng_tell (png_structp, apng_const_infop);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
void apng_flush (png_structp, apng_infop);
#ifdef PNG_STDIO_SUPPORTED
void apng_default_flush (png_structp);
#endif/* PNG_STDIO_SUPPORTED */
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
#ifdef PNG_STDIO_SUPPORTED
void apng_default_seek (png_structp, size_t);
size_t apng_default_tell (png_structp);
#endif/* PNG_STDIO_SUPPORTED */
void apng_write_IEND (png_structp);
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
#ifndef PNG_WRITE_APNG_SUPPORTED
png_uint_32 apng_set_acTL_dummy (png_structp, png_infop,
png_uint_32, png_uint_32);
#endif/* PNG_WRITE_APNG_SUPPORTED */
apng_infop
apng_create_info_struct (png_structp pngp)
{
apng_infop ainfop;
(void)pngp;
if (( ainfop = calloc(1, sizeof (apng_info)) ))
{
apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0);
apng_set_set_acTL_fn(pngp, ainfop, 0);
}
return ainfop;
}
void
apng_destroy_info_struct (png_structp pngp, apng_infopp ainfopp)
{
(void)pngp;
if (!( pngp && ainfopp ))
return;
free((*ainfopp));
}
void
apng_seek (png_structp pngp, apng_const_infop ainfop, size_t l)
{
(*(ainfop->output_seek_fn))(pngp, l);
}
size_t
apng_tell (png_structp pngp, apng_const_infop ainfop)
{
return (*(ainfop->output_tell_fn))(pngp);
}
#ifdef PNG_WRITE_FLUSH_SUPPORTED
void
apng_flush (png_structp pngp, apng_infop ainfop)
{
if (ainfop->output_flush_fn)
(*(ainfop->output_flush_fn))(pngp);
}
#ifdef PNG_STDIO_SUPPORTED
void
apng_default_flush (png_structp pngp)
{
if (!( pngp ))
return;
fflush((png_FILE_p)png_get_io_ptr);
}
#endif/* PNG_STDIO_SUPPORTED */
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
#ifdef PNG_STDIO_SUPPORTED
void
apng_default_seek (png_structp pngp, size_t l)
{
if (!( pngp ))
return;
if (fseek((png_FILE_p)png_get_io_ptr(pngp), (long)l, SEEK_SET) == -1)
png_error(pngp, "Seek Error");
}
size_t
apng_default_tell (png_structp pngp)
{
long l;
if (!( pngp ))
{
png_error(pngp, "Call to apng_default_tell with NULL pngp failed");
}
if (( l = ftell((png_FILE_p)png_get_io_ptr(pngp)) ) == -1)
png_error(pngp, "Tell Error");
return (size_t)l;
}
#endif/* PNG_STDIO_SUPPORTED */
void
apng_set_write_fn (png_structp pngp, apng_infop ainfop, png_voidp iop,
png_rw_ptr write_f, png_flush_ptr flush_f,
apng_seek_ptr seek_f, apng_tell_ptr tell_f)
{
if (!( pngp && ainfop ))
return;
png_set_write_fn(pngp, iop, write_f, flush_f);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
#ifdef PNG_STDIO_SUPPORTED
if (!flush_f)
ainfop->output_flush_fn = &apng_default_flush;
else
#endif/* PNG_STDIO_SUPPORTED */
ainfop->output_flush_fn = flush_f;
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
#ifdef PNG_STDIO_SUPPORTED
if (!seek_f)
ainfop->output_seek_fn = &apng_default_seek;
else
#endif/* PNG_STDIO_SUPPORTED */
ainfop->output_seek_fn = seek_f;
#ifdef PNG_STDIO_SUPPORTED
if (!seek_f)
ainfop->output_tell_fn = apng_default_tell;
else
#endif/* PNG_STDIO_SUPPORTED */
ainfop->output_tell_fn = tell_f;
}
void
apng_write_IEND (png_structp pngp)
{
png_byte chunkc[] = "IEND";
png_write_chunk(pngp, chunkc, 0, 0);
}
void
apng_write_acTL (png_structp pngp, png_uint_32 frames, png_uint_32 plays)
{
png_byte chunkc[] = "acTL";
png_byte buf[8];
png_save_uint_32(buf, frames);
png_save_uint_32(buf + 4, plays);
png_write_chunk(pngp, chunkc, buf, 8);
}
png_uint_32
apng_set_acTL (png_structp pngp, png_infop infop, apng_infop ainfop,
png_uint_32 frames, png_uint_32 plays)
{
(void)pngp;
(void)infop;
if (!( pngp && infop && ainfop ))
return 0;
ainfop->num_frames = frames;
ainfop->num_plays = plays;
ainfop->valid |= APNG_INFO_acTL;
return 1;
}
void
apng_write_info_before_PLTE (png_structp pngp, png_infop infop,
apng_infop ainfop)
{
if (!( pngp && infop && ainfop ))
return;
png_write_info_before_PLTE(pngp, infop);
if (( ainfop->valid & APNG_INFO_acTL )&&!( ainfop->mode & APNG_WROTE_acTL ))
{
ainfop->start_acTL = apng_tell(pngp, ainfop);
apng_write_acTL(pngp, 0, 0);
/* modified for runtime dynamic linking */
(*(ainfop->set_acTL_fn))(pngp, infop, PNG_UINT_31_MAX, 0);
ainfop->mode |= APNG_WROTE_acTL;
}
}
void
apng_write_info (png_structp pngp, png_infop infop,
apng_infop ainfop)
{
apng_write_info_before_PLTE(pngp, infop, ainfop);
png_write_info(pngp, infop);
}
void
apng_write_end (png_structp pngp, png_infop infop, apng_infop ainfop)
{
(void)infop;
apng_write_IEND(pngp);
apng_seek(pngp, ainfop, ainfop->start_acTL);
apng_write_acTL(pngp, ainfop->num_frames, ainfop->num_plays);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
#ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED
apng_flush(pngp, infop);
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
}
#ifndef PNG_WRITE_APNG_SUPPORTED
png_uint_32
apng_set_acTL_dummy (png_structp pngp, png_infop infop,
png_uint_32 frames, png_uint_32 plays)
{
(void)pngp;
(void)infop;
(void)frames;
(void)plays;
return 0;
}
#endif/* PNG_WRITE_APNG_SUPPORTED */
/* Dynamic runtime linking capable! (Hopefully.) */
void
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
apng_set_acTL_ptr set_acTL_f)
{
(void)pngp;
if (!ainfop->set_acTL_fn)
#ifndef PNG_WRITE_APNG_SUPPORTED
ainfop->set_acTL_fn = &apng_set_acTL_dummy;
#else
ainfop->set_acTL_fn = &png_set_acTL;
#endif/* PNG_WRITE_APNG_SUPPORTED */
else
ainfop->set_acTL_fn = set_acTL_f;
}
-80
View File
@@ -1,80 +0,0 @@
/*
Copyright 2019, James R.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef APNG_H
#define APNG_H
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 0
#endif
#include <png.h>
typedef struct apng_info_def apng_info;
typedef apng_info * apng_infop;
typedef const apng_info * apng_const_infop;
typedef apng_info * * apng_infopp;
typedef void (*apng_seek_ptr)(png_structp, size_t);
typedef size_t (*apng_tell_ptr)(png_structp);
typedef png_uint_32 (*apng_set_acTL_ptr)(png_structp, png_infop,
png_uint_32, png_uint_32);
apng_infop apng_create_info_struct (png_structp png_ptr);
void apng_destroy_info_struct (png_structp png_ptr,
apng_infopp info_ptr_ptr);
/* Call the following functions in place of the libpng counterparts. */
png_uint_32 apng_set_acTL (png_structp png_ptr, png_infop info_ptr,
apng_infop ainfo_ptr,
png_uint_32 num_frames, png_uint_32 num_plays);
void apng_write_info_before_PLTE (png_structp png_ptr, png_infop info_ptr,
apng_infop ainfo_ptr);
void apng_write_info (png_structp png_ptr, png_infop info_ptr,
apng_infop ainfo_ptr);
void apng_write_end (png_structp png_ptr, png_infop info_ptr,
apng_infop ainfo_ptr);
void apng_set_write_fn (png_structp png_ptr, apng_infop ainfo_ptr,
png_voidp io_ptr,
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn,
apng_seek_ptr output_seek_fn, apng_tell_ptr output_tell_fn);
void apng_set_set_acTL_fn (png_structp png_ptr, apng_infop ainfo_ptr,
apng_set_acTL_ptr set_acTL_fn);
#endif/* APNG_H */
+5
View File
@@ -10,8 +10,13 @@
/// \file b_bot.h
/// \brief Basic bot handling
#ifndef __B_BOT__
#define __B_BOT__
void B_BuildTiccmd(player_t *player, ticcmd_t *cmd);
void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin);
boolean B_CheckRespawn(player_t *player);
void B_MoveBlocked(player_t *player);
void B_RespawnBot(INT32 playernum);
#endif
-8
View File
@@ -46,10 +46,6 @@
** =======================================================
*/
#ifdef _MSC_VER
#pragma warning(disable : 4324)
#endif
/* chain list of long jump buffers */
struct lua_longjmp {
struct lua_longjmp *previous;
@@ -57,10 +53,6 @@ struct lua_longjmp {
volatile int status; /* error code */
};
#ifdef _MSC_VER
#pragma warning(default : 4324)
#endif
void luaD_seterrorobj (lua_State *L, int lerrcode, StkId oldtop) {
switch (lerrcode) {
case LUA_ERRMEM: {
-6
View File
@@ -48,12 +48,6 @@ LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
#ifdef _MSC_VER
#ifndef ATTRNORETURN
#define ATTRNORETURN __declspec(noreturn)
#endif
#endif
#ifndef ATTRNORETURN
#define ATTRNORETURN
#endif
-20
View File
@@ -11,12 +11,8 @@
#include <limits.h>
#include <stddef.h>
#ifdef _MSC_VER
#define INT32 __int32
#else
#include <stdint.h>
#define INT32 int32_t
#endif
#ifndef __cplusplus
#ifndef min // Double-Check with WATTCP-32's cdefs.h
@@ -570,9 +566,6 @@
#define luai_numshl(a,b) ((unsigned)(a)<<(unsigned)(b))
#define luai_numshr(a,b) ((unsigned)(a)>>(unsigned)(b))
#define luai_numnot(a) (~((unsigned)(a)))
#ifdef _MSC_VER
#pragma warning(disable : 4244)
#endif
#endif
@@ -589,24 +582,11 @@
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
/* On a Microsoft compiler, use assembler */
#if defined(_MSC_VER)
#define lua_number2int(i,d) __asm fld d __asm fistp i
#define lua_number2integer(i,n) lua_number2int(i, n)
/* the next trick should work on any Pentium, but sometimes clashes
with a DirectX idiosyncrasy */
#else
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
#define lua_number2integer(i,n) lua_number2int(i, n)
#endif
/* this option always works, but may be slow */
#else
#define lua_number2int(i,d) ((i)=(int)(d))
+2 -4
View File
@@ -712,12 +712,10 @@ static void COM_CEcho_f(void)
for (i = 1; i < COM_Argc(); i++)
{
strncat(cechotext, COM_Argv(i), sizeof(cechotext)-1);
strncat(cechotext, " ", sizeof(cechotext)-1);
strlcpy(cechotext, COM_Argv(i), sizeof(cechotext)-1);
strlcat(cechotext, " ", sizeof(cechotext)-1);
}
cechotext[sizeof(cechotext) - 1] = '\0';
HU_DoCEcho(cechotext);
}
+23 -13
View File
@@ -479,18 +479,18 @@ static void CON_RecalcSize(void)
switch (cv_constextsize.value)
{
case V_NOSCALEPATCH:
con_scalefactor = 1;
break;
case V_SMALLSCALEPATCH:
con_scalefactor = vid.smalldupx;
break;
case V_MEDSCALEPATCH:
con_scalefactor = vid.meddupx;
break;
default: // Full scaling
con_scalefactor = vid.dupx;
break;
case V_NOSCALEPATCH:
con_scalefactor = 1;
break;
case V_SMALLSCALEPATCH:
con_scalefactor = vid.smalldup;
break;
case V_MEDSCALEPATCH:
con_scalefactor = vid.meddup;
break;
default: // Full scaling
con_scalefactor = vid.dup;
break;
}
con_recalc = false;
@@ -607,7 +607,7 @@ static void CON_MoveConsole(void)
}
// Not instant - Increment fracmovement fractionally
fracmovement += FixedMul(cons_speed.value*vid.fdupy, (cv_uncappedhud.value ? renderdeltatics : FRACUNIT));
fracmovement += FixedMul(cons_speed.value*vid.fdup, (cv_uncappedhud.value ? renderdeltatics : FRACUNIT));
if (con_curlines < con_destlines) // Move the console downwards
{
@@ -729,6 +729,8 @@ void CON_ToggleOff(void)
con_forcepic = 0;
con_clipviewtop = -1; // remove console clipping of view
I_SetTextInput(false);
Unlock_state();
}
@@ -768,9 +770,13 @@ void CON_Ticker(void)
{
con_destlines = 0;
CON_ClearHUD();
I_SetTextInput(false);
}
else
{
CON_ChangeHeight();
I_SetTextInput(true);
}
}
// clip the view, so that the part under the console is not drawn
@@ -787,9 +793,13 @@ void CON_Ticker(void)
// check if console ready for prompt
if (con_destlines >= minheight)
{
consoleready = true;
}
else
{
consoleready = false;
}
// make overlay messages disappear after a while
for (i = 0; i < con_hudlines; i++)
+1 -1
View File
@@ -1,4 +1,4 @@
// BLANKART
// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
// Copyright (C) 2024 by Kart Krew
+1 -1
View File
@@ -1,4 +1,4 @@
// BLANKART
// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
// Copyright (C) 2024 by Kart Krew
+1 -1
View File
@@ -1,4 +1,4 @@
// BLANKART
// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2024 by Ronald "Eidolon" Kinard
// Copyright (C) 2024 by Kart Krew
+44 -137
View File
@@ -54,11 +54,9 @@
#include "d_main.h"
#include "r_fps.h"
#ifdef CLIENT_LOADINGSCREEN
// cl loading screen
#include "v_video.h"
#include "f_finale.h"
#endif
#ifdef HAVE_DISCORDRPC
#include "discord.h"
@@ -340,7 +338,7 @@ static void WriteNetXCmd(UINT8 *cmd, netxcmd_t id, const void *param, size_t npa
void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_t nparam)
{
if (localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD)
if (textcmdbuf[playerid] != NULL || localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD)
{
textcmdbuf_t *buf = textcmdbuf[playerid];
@@ -375,17 +373,13 @@ void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_
{
WriteNetXCmd(buf->cmd, id, param, nparam);
}
return;
}
WriteNetXCmd(localtextcmd[playerid], id, param, nparam);
}
/*UINT8 GetFreeXCmdSize(UINT8 playerid)
{
// -1 for the size and another -1 for the ID.
return (UINT8)(localtextcmd[playerid][0] - 2);
}*/
// Frees all textcmd memory for the specified tic
static void D_FreeTextcmd(tic_t tic)
{
@@ -424,7 +418,8 @@ static UINT8* D_GetExistingTextcmd(tic_t tic, INT32 playernum)
if (textcmdtic)
{
UINT8 *cmd = textcmdtic->playercmds[playernum];
if (cmd) return cmd;
if (cmd)
return cmd;
}
return NULL;
@@ -462,6 +457,7 @@ static void ExtraDataTicker(void)
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] || i == 0)
{
UINT8 *bufferstart = D_GetExistingTextcmd(gametic, i);
@@ -476,8 +472,7 @@ static void ExtraDataTicker(void)
{
if (*curpos < MAXNETXCMD && listnetxcmd[*curpos])
{
const UINT8 id = *curpos;
curpos++;
const UINT8 id = *curpos++;
DEBFILE(va("executing x_cmd %s ply %u ", netxcmdnames[id - 1], i));
(listnetxcmd[id])(&curpos, i);
DEBFILE("done\n");
@@ -489,12 +484,14 @@ static void ExtraDataTicker(void)
SendKick(i, KICK_MSG_CON_FAIL);
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
}
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
break;
}
}
}
}
}
// If you are a client, you can safely forget the net commands for this tic
// If you are the server, you need to remember them until every client has been aknowledged,
@@ -1104,10 +1101,6 @@ static void SV_AcknowledgeResynchAck(INT32 node, UINT8 rsg)
static INT16 Consistancy(void);
#ifndef NONET
#define JOININGAME
#endif
typedef enum
{
CL_SEARCHING,
@@ -1117,9 +1110,7 @@ typedef enum
CL_LOADFILES,
CL_SETUPFILES,
CL_WAITJOINRESPONSE,
#ifdef JOININGAME
CL_DOWNLOADSAVEGAME,
#endif
CL_CONNECTED,
CL_ABORTED,
CL_VIEWSERVER,
@@ -1171,8 +1162,6 @@ static void CV_LoadPlayerNames(UINT8 **p)
}
}
#ifdef CLIENT_LOADINGSCREEN
//
// CL_DrawConnectionStatus
//
@@ -1210,7 +1199,6 @@ static inline void CL_DrawConnectionStatus(void)
switch (cl_mode)
{
#ifdef JOININGAME
case CL_DOWNLOADSAVEGAME:
if (filedownload.current != -1)
{
@@ -1236,7 +1224,6 @@ static inline void CL_DrawConnectionStatus(void)
else
cltext = M_GetText("Waiting to download game state...");
break;
#endif
case CL_ASKFULLFILELIST:
case CL_CONFIRMCONNECT:
case CL_LEGACYREQUESTFAILED:
@@ -1509,7 +1496,6 @@ static inline void CL_DrawConnectionStatus(void)
}
}
}
#endif
static boolean CL_AskFileList(INT32 firstfile)
{
@@ -1517,7 +1503,7 @@ static boolean CL_AskFileList(INT32 firstfile)
netbuffer->packettype = PT_TELLFILESNEEDED;
netbuffer->u.filesneedednum = firstfile;
return HSendPacket(servernode, false, 0, sizeof (INT32));
return HSendPacket(servernode, false, 0, sizeof(INT32));
}
/** Sends a special packet to declare how many players in local
@@ -1877,7 +1863,6 @@ static boolean SV_SendServerConfig(INT32 node)
return waspacketsent;
}
#ifdef JOININGAME
#define SAVEGAMESIZE (768*1024)
#ifdef SATURNPAK
@@ -1900,7 +1885,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
UINT8 *buffertosend;
// first save it in a malloced buffer
save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
if (!save.buffer)
{
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
@@ -1915,7 +1900,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
length = save.p - save.buffer;
if (length > SAVEGAMESIZE)
{
free(save.buffer);
Z_Free(save.buffer);
save.p = NULL;
I_Error("Savegame buffer overrun");
}
@@ -1933,8 +1918,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending)
if ((compressedlen = lzf_compress(save.buffer + sizeof(UINT32), length - sizeof(UINT32), compressedsave + sizeof(UINT32), length - sizeof(UINT32) - 1)))
{
// Compressing succeeded; send compressed data
free(save.buffer);
Z_Free(save.buffer);
// State that we're compressed.
buffertosend = compressedsave;
@@ -1975,7 +1959,7 @@ static void SV_SavedGame(void)
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
// first save it in a malloced buffer
save.p = save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
save.p = save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
if (!save.p)
{
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
@@ -1987,7 +1971,7 @@ static void SV_SavedGame(void)
length = save.p - save.buffer;
if (length > SAVEGAMESIZE)
{
free(save.buffer);
Z_Free(save.buffer);
save.p = NULL;
I_Error("Savegame buffer overrun");
}
@@ -1996,7 +1980,7 @@ static void SV_SavedGame(void)
if (!FIL_WriteFile(tmpsave, save.buffer, length))
CONS_Printf(M_GetText("Didn't save %s for netgame"), tmpsave);
free(save.buffer);
Z_Free(save.buffer);
save.p = NULL;
}
@@ -2111,9 +2095,7 @@ static void CL_ReloadReceivedSavegame(void)
CONS_Printf(M_GetText("Game state reloaded\n"));
}
#endif
#endif
#ifndef NONET
static void SendAskInfo(INT32 node)
{
tic_t asktime;
@@ -2287,7 +2269,6 @@ void CL_TimeoutServerList(void)
}
}
}
#endif // ifndef NONET
static void CL_ConfirmConnect(void)
{
@@ -2318,7 +2299,6 @@ static void CL_ConfirmConnect(void)
static void M_ConfirmConnect(event_t *ev)
{
#ifndef NONET
if (ev->type == ev_keydown)
{
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[0][gc_accelerate][0] || ev->data1 == gamecontrol[0][gc_accelerate][1])
@@ -2333,9 +2313,6 @@ static void M_ConfirmConnect(event_t *ev)
M_ClearMenus(true);
}
}
#else
(void)ev;
#endif
}
void CL_AbortConnection(void)
@@ -2430,29 +2407,25 @@ static boolean CL_FinishedFileList(void)
if (!filedownload.http_failed)
#endif
{
#ifndef NONET
filedownload.completednum = 0;
filedownload.completedsize = 0;
filedownload.totalnum = 0;
filedownload.totalsize = 0;
#endif
for (i = 0; i < fileneedednum; i++)
{
if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD)
{
#ifndef NONET
filedownload.totalnum++;
filedownload.totalsize += fileneeded[i].totalsize;
#endif
}
}
#ifndef NONET
if (filedownload.totalsize>>20 >= 10)
downloadsize = Z_StrDup(va("%uM",filedownload.totalsize>>20));
else
downloadsize = Z_StrDup(va("%uK",filedownload.totalsize>>10));
#endif
if (cv_showdownloadprompt.value)
{
@@ -2506,7 +2479,6 @@ static boolean CL_FinishedFileList(void)
*/
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
{
#ifndef NONET
INT32 i;
// serverlist is updated by GetPacket function
@@ -2525,6 +2497,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
if (i < 0)
return true;
}
joinnode = i;
// Quit here rather than downloading files and being refused later.
@@ -2545,6 +2518,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", serverlist[i].info.httpsource);
#endif
D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0);
if (serverlist[i].info.kartvars & SV_LOTSOFADDONS)
{
cl_mode = CL_ASKFULLFILELIST;
@@ -2569,11 +2543,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
SendAskInfo(servernode);
*asksent = I_GetTime() + NEWTICRATE;
}
#else
(void)asksent;
// No netgames, so we skip this state.
cl_mode = CL_ASKJOIN;
#endif // ifndef NONET/else
return true;
}
@@ -2593,10 +2562,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
boolean waitmore;
INT32 i;
#ifdef NONET
(void)tmpsave;
#endif
switch (cl_mode)
{
case CL_SEARCHING:
@@ -2715,12 +2680,12 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
), NULL, MM_NOTHING);
return false;
}
#ifdef JOININGAME
// prepare structures to save the file
// WARNING: this can be useless in case of server not in GS_LEVEL
// but since the network layer doesn't provide ordered packets...
CL_PrepareDownloadSaveGame(tmpsave);
#endif
if (I_GetTime() >= *asksent && CL_SendJoin())
{
*asksent = I_GetTime() + NEWTICRATE*3;
@@ -2733,7 +2698,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
cl_mode = CL_ASKJOIN;
}
break;
#ifdef JOININGAME
case CL_DOWNLOADSAVEGAME:
// At this state, the first (and only) needed file is the gamestate
if (fileneeded[0].status == FS_FOUND)
@@ -2745,7 +2709,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
} // don't break case continue to CL_CONNECTED
else
break;
#endif
case CL_CONNECTED:
case CL_CONFIRMCONNECT: //logic is handled by M_ConfirmConnect
default:
@@ -2808,7 +2771,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
}
*oldtic = I_GetTime();
#ifdef CLIENT_LOADINGSCREEN
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
{
F_TitleScreenTicker(true);
@@ -2825,10 +2787,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
if (moviemode)
M_SaveFrame();
}
#else
CON_Drawer();
I_UpdateNoVsync();
#endif
}
else
{
@@ -2848,26 +2806,17 @@ static void CL_ConnectToServer(void)
{
INT32 pnumnodes, nodewaited = doomcom->numnodes, i;
tic_t oldtic;
#ifndef NONET
tic_t asksent;
#endif
#ifdef JOININGAME
char tmpsave[264];
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
#endif
#ifdef CLIENT_LOADINGSCREEN
filedownload.current = -1;
#endif
cl_mode = CL_SEARCHING;
#ifdef JOININGAME
// Don't get a corrupt savegame error because tmpsave already exists
if (FIL_FileExists(tmpsave) && unlink(tmpsave) == -1)
I_Error("Can't delete %s\n", tmpsave);
#endif
if (netgame)
{
@@ -2889,7 +2838,6 @@ static void CL_ConnectToServer(void)
ClearAdminPlayers();
pnumnodes = 1;
oldtic = 0;
#ifndef NONET
asksent = 0;
firstconnectattempttime = I_GetTime();
@@ -2922,16 +2870,11 @@ static void CL_ConnectToServer(void)
map_icon_read = 0;
map_icon_missing = 0xffffffff;
map_icon_last_request = I_GetTime();
#endif
do
{
// If the connection was aborted for some reason, leave
#ifndef NONET
if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent))
#else
if (!CL_ServerConnectionTicker((char*)NULL, &oldtic, (tic_t *)NULL))
#endif
{
if (P_PartialAddGetStage() >= 0)
P_MultiSetupWadFiles(true); // in case any partial adds were done
@@ -2948,16 +2891,14 @@ static void CL_ConnectToServer(void)
}
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
#ifndef NONET
if (netgame)
F_StartWaitingPlayers();
#endif
DEBFILE(va("Synchronisation Finished\n"));
displayplayers[0] = consoleplayer;
}
#ifndef NONET
static void Command_ShowBan(void) //Print out ban list
{
size_t i;
@@ -3343,8 +3284,6 @@ static void Command_Packetstat(void)
}
}
#endif
static void ResetNode(INT32 node);
//
@@ -3476,10 +3415,8 @@ void CL_Reset(void)
memset(fileneeded, 0, sizeof(fileneeded));
memset(packetstat, 0, sizeof(packetstat));
#ifndef NONET
filedownload.totalnum = 0;
filedownload.totalsize = 0;
#endif
firstconnectattempttime = 0;
serverisfull = false;
connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack
@@ -3497,7 +3434,6 @@ void CL_Reset(void)
// D_StartTitle should get done now, but the calling function will handle it
}
#ifndef NONET
static void Command_GetPlayerNum(void)
{
INT32 i;
@@ -3824,7 +3760,6 @@ static void Command_Kick(void)
else
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
}
#endif
static void Got_KickCmd(UINT8 **p, INT32 playernum)
{
@@ -4182,10 +4117,6 @@ consvar_t cv_allownewplayer = {"allowjoin", "On", CV_SAVE|CV_CALL, CV_OnOff, Joi
consvar_t cv_allownewsaturnplayer = {"allowsaturnjoin", "On", CV_HIDEN, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
#ifdef VANILLAJOINNEXTROUND
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
#endif
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE|CV_CALL, maxplayers_cons_t, Joinable_OnChange, 0, NULL, NULL, 0, 0, NULL};
@@ -4252,7 +4183,6 @@ void D_ClientServerInit(void)
DEBFILE(va("- - -== SRB2Kart v%d.%d "VERSIONSTRING" debugfile ==- - -\n",
VERSION, SUBVERSION));
#ifndef NONET
COM_AddCommand("getplayernum", Command_GetPlayerNum);
COM_AddCommand("kick", Command_Kick);
COM_AddCommand("ban", Command_Ban);
@@ -4278,17 +4208,13 @@ void D_ClientServerInit(void)
#ifdef _DEBUG
COM_AddCommand("numnodes", Command_Numnodes);
#endif
#endif
RegisterNetXCmd(XD_KICK, Got_KickCmd);
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
RegisterNetXCmd(XD_REMOVEPLAYER, Got_RemovePlayer);
#ifndef NONET
#ifdef DUMPCONSISTENCY
CV_RegisterVar(&cv_dumpconsistency);
#endif
D_LoadBan(false);
#endif
gametic = 0;
localgametic = 0;
@@ -4883,18 +4809,17 @@ static void HandleConnect(SINT8 node)
}
else
{
#ifndef NONET
boolean newnode = false;
#endif
// client authorised to join
nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]);
if (!nodeingame[node])
{
gamestate_t backupstate = gamestate;
#ifndef NONET
newnode = true;
#endif
SV_AddNode(node);
/// \note Wait what???
@@ -4903,10 +4828,6 @@ static void HandleConnect(SINT8 node)
// you get a free second before desynch checks. use it wisely.
SV_InitResynchVars(node);
#ifdef VANILLAJOINNEXTROUND
if (cv_joinnextround.value && gameaction == ga_nothing)
G_SetGamestate(GS_WAITINGPLAYERS);
#endif
if (!SV_SendServerConfig(node))
{
G_SetGamestate(backupstate);
@@ -4924,7 +4845,6 @@ static void HandleConnect(SINT8 node)
DEBFILE("new node joined\n");
}
#ifdef JOININGAME
if (nodewaiting[node])
{
if (node && newnode)
@@ -4935,12 +4855,6 @@ static void HandleConnect(SINT8 node)
SV_AddWaitingPlayers();
}
#else
#ifndef NONET
// I guess we have no use for this if we aren't doing mid-level joins?
(void)newnode;
#endif
#endif
}
}
@@ -4972,7 +4886,6 @@ static void HandleTimeout(SINT8 node)
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
}
#ifndef NONET
/** Called when a PT_SERVERINFO packet is received
*
* \param node The packet sender
@@ -5281,11 +5194,8 @@ static void PT_ServerCFG(SINT8 node)
playernode[(UINT8)serverplayer] = servernode;
if (netgame)
#ifdef JOININGAME
CONS_Printf(M_GetText("Join accepted, waiting for complete game state...\n"));
#else
CONS_Printf(M_GetText("Join accepted, waiting for next level change...\n"));
#endif
DEBFILE(va("Server accept join gametic=%u mynode=%d\n", gametic, mynode));
#ifdef SATURNPAK
@@ -5308,16 +5218,13 @@ static void PT_ServerCFG(SINT8 node)
scp = netbuffer->u.servercfg.varlengthinputs;
CV_LoadPlayerNames(&scp);
CV_LoadNetVars(&scp);
#ifdef JOININGAME
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
/// Shouldn't them be downloaded even at intermission time?
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
/// Sryder 2018-07-05: If we don't want to send the player config another way we need to send the gamestate
/// At almost any gamestate there could be joiners... So just always send gamestate?
cl_mode = ((server) ? CL_CONNECTED : CL_DOWNLOADSAVEGAME);
#else
cl_mode = CL_CONNECTED;
#endif
}
static void PT_FileFragmentFromAwayNode(SINT8 node)
@@ -5345,8 +5252,6 @@ static void PT_RequestFile(SINT8 node)
Net_CloseConnection(node); // nope
}
#endif
#ifdef SATURNPAK
static void PT_WillResendGamestate(void)
{
@@ -5484,11 +5389,8 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
{
tic_t realend, realstart;
if (client)
return;
// Ignore tics from those not synched
if (resynch_inprogress[node])
if (client || resynch_inprogress[node])
return;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
@@ -5644,7 +5546,8 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
--resynch_score[node];
#else
// Check player consistancy during the level
if (realstart <= gametic && realstart > gametic - BACKUPTICS+1 && gamestate == GS_LEVEL
if (gamestate == GS_LEVEL
&& (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic)
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy))
{
SV_RequireResynch(node);
@@ -5652,10 +5555,13 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
if (cv_resynchattempts.value && resynch_score[node] <= (unsigned)cv_resynchattempts.value*250)
{
if (cv_blamecfail.value)
{
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
netconsole+1, player_names[netconsole],
consistancy[realstart%BACKUPTICS],
SHORT(netbuffer->u.clientpak.consistancy));
}
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
netconsole, realstart, consistancy[realstart%BACKUPTICS],
SHORT(netbuffer->u.clientpak.consistancy)));
@@ -6052,16 +5958,17 @@ static void GetPackets(void)
{
node = (SINT8)doomcom->remotenode;
if (netbuffer->packettype == PT_CLIENTJOIN && server)
if (server && netbuffer->packettype == PT_CLIENTJOIN)
{
if (!levelloading) // Otherwise just ignore
{
HandleConnect(node);
}
continue;
}
if (node == servernode && client && cl_mode != CL_SEARCHING)
if (client && node == servernode && cl_mode != CL_SEARCHING)
{
if (netbuffer->packettype == PT_SERVERSHUTDOWN)
{
@@ -6075,13 +5982,11 @@ static void GetPackets(void)
}
}
#ifndef NONET
if (netbuffer->packettype == PT_SERVERINFO)
{
HandleServerInfo(node);
continue;
}
#endif
/*if (netbuffer->packettype == PT_PLAYERINFO)
continue; // We do nothing with PLAYERINFO, that's for the MS browser. Not quite true anymore :p*/
@@ -6122,7 +6027,8 @@ static INT16 Consistancy(void)
{
if (!playeringame[i])
ret ^= 0xCCCC;
else if (!players[i].mo || gamestate != GS_LEVEL);
else if (!players[i].mo || gamestate != GS_LEVEL)
;
else
{
ret += players[i].mo->x;
@@ -6131,6 +6037,7 @@ static INT16 Consistancy(void)
ret *= i+1;
}
}
// I give up
// Coop desynching enemies is painful
if (gamestate == GS_LEVEL)
@@ -6971,7 +6878,7 @@ void NetKeepAlive(void)
UpdatePingTable();
// Sryder: What is FILESTAMP??? << lmao
// Sryder: What is FILESTAMP??? << lmao
GetPackets();
@@ -7241,7 +7148,7 @@ void CL_ClearRewinds(void)
while ((head = rewindhead))
{
rewindhead = rewindhead->next;
free(head);
Z_Free(head);
}
}
@@ -7253,7 +7160,7 @@ rewind_t *CL_SaveRewindPoint(size_t demopos)
if (rewindhead && rewindhead->leveltime + REWIND_POINT_INTERVAL > leveltime)
return NULL;
rewind = (rewind_t *)malloc(sizeof (rewind_t));
rewind = (rewind_t *)Z_Malloc(sizeof(rewind_t), PU_STATIC, NULL);
if (!rewind)
return NULL;
@@ -7276,7 +7183,7 @@ rewind_t *CL_RewindToTime(tic_t time)
while (rewindhead && rewindhead->leveltime > time)
{
rewind = rewindhead->next;
free(rewindhead);
Z_Free(rewindhead);
rewindhead = rewind;
}
+2 -28
View File
@@ -133,10 +133,6 @@ void Command_Droprate(void);
void Command_Numnodes(void);
#endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// Client to server packet
typedef struct
{
@@ -176,10 +172,6 @@ typedef struct
ticcmd_t cmd, cmd2, cmd3, cmd4;
} ATTRPACK client4cmd_pak;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// Server to client packet
// this packet is too large
typedef struct
@@ -372,10 +364,6 @@ typedef struct {
UINT8 data[0]; // Size is variable using hardware_MAXPACKETLENGTH
} ATTRPACK filetx_pak;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
#define MAXAPPLICATION 16
typedef struct
@@ -519,10 +507,6 @@ typedef struct
} u; // This is needed to pack diff packet types data together
} ATTRPACK doomdata_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
#define MAXSERVERLIST (MAXNETNODES-1)
typedef struct
{
@@ -599,9 +583,6 @@ extern tic_t lowest_lag;
extern consvar_t cv_mindelay, cv_gentlemens;
extern consvar_t
#ifdef VANILLAJOINNEXTROUND
cv_joinnextround,
#endif
cv_netticbuffer, cv_allownewplayer,
#ifdef SATURNJOIN
cv_allownewsaturnplayer,
@@ -658,16 +639,9 @@ void D_QuitNetGame(void);
//? How many ticks to run?
boolean TryRunTics(tic_t realtic);
// extra data for lmps
// these functions scare me. they contain magic.
/*boolean AddLmpExtradata(UINT8 **demo_p, INT32 playernum);
void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum);*/
#ifndef NONET
// translate a playername in a player number return -1 if not found and
// print a error message in the console
SINT8 nametonum(const char *name);
#endif
extern char motd[254], server_context[8];
extern UINT8 playernode[MAXPLAYERS];
@@ -679,7 +653,6 @@ INT32 D_NumPlayers(void);
void D_ResetTiccmds(void);
tic_t GetLag(INT32 node);
//UINT8 GetFreeXCmdSize(UINT8 playerid);
extern UINT8 hu_resynching;
#ifdef SATURNPAK
@@ -687,7 +660,8 @@ extern UINT8 hu_redownloadinggamestate;
#endif
extern boolean hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
typedef struct rewind_s {
typedef struct rewind_s
{
UINT8 savebuffer[(768*1024)];
tic_t leveltime;
size_t demopos;
+24 -16
View File
@@ -352,8 +352,7 @@ static void D_Renderview(void)
{
// V_DrawPatchFill, but for the fourth screen only
patch_t *pat = W_CachePatchName("SRB2BACK", PU_CACHE);
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
INT32 x, y, pw = SHORT(pat->width) * dupz, ph = SHORT(pat->height) * dupz;
INT32 x, y, pw = SHORT(pat->width) * vid.dup, ph = SHORT(pat->height) * vid.dup;
for (x = vid.width>>1; x < vid.width; x += pw)
{
@@ -610,7 +609,7 @@ static boolean D_Display(void)
{
if (rendermode == render_soft)
{
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.rowbytes);
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.width);
}
lastdraw = false;
@@ -774,7 +773,6 @@ void D_SRB2Loop(void)
// capbudget is the minimum precise_t duration of a single loop iteration
precise_t capbudget;
precise_t enterprecise = I_GetPreciseTime();
precise_t finishprecise = enterprecise;
Z_Frame_Reset();
@@ -918,7 +916,7 @@ void D_SRB2Loop(void)
}
#endif
// Fully completed frame made.
finishprecise = I_GetPreciseTime();
precise_t finishprecise = I_GetPreciseTime();
// Use the time before sleep for frameskip calculations:
// post-sleep time is literally being intentionally wasted
@@ -933,9 +931,16 @@ void D_SRB2Loop(void)
//
// Wipes run an inner loop and artificially increase
// the measured time.
if (!ranwipe && (frameskip < 3) && (deltatics > 1.0))
if (cv_frameskip.value)
{
frameskip++;
if (!ranwipe && (frameskip < 3) && (deltatics > 1.0))
{
frameskip++;
}
else
{
frameskip = 0;
}
}
else
{
@@ -1105,25 +1110,28 @@ static void D_AutoloadFile(const char *file, char **filearray)
char *newfile;
INT32 fileType = D_DetectFileType(file);
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
;
newfile = malloc(strlen(file) + 1);
if (!newfile)
I_Error("No more free memory to AutoloadFile %s",file);
if (!fileType)
{
CONS_Printf("D_AutoloadFile: File %s is unknown or invalid\n", file);
return;
}
strcpy(newfile, file);
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
;
if (fileType <= 6)
{
newfile = malloc(strlen(file) + 1);
if (!newfile)
I_Error("No more free memory to AutoloadFile %s",file);
strcpy(newfile, file);
filearray[pnumwadfiles] = newfile;
}
else
COM_BufAddText(va("exec %s\n", newfile));
{
COM_BufAddText(va("exec %s\n", file));
}
}
static char *strremove(char *str, const char *sub)
+1 -50
View File
@@ -145,7 +145,6 @@ boolean Net_GetNetStat(void)
#define URGENTFREESLOTNUM 10
#define ACKTOSENDTIMEOUT (TICRATE/11)
#ifndef NONET
typedef struct
{
UINT8 acknum;
@@ -159,7 +158,6 @@ typedef struct
doomdata_t data;
} pak;
} ackpak_t;
#endif
typedef enum
{
@@ -167,10 +165,8 @@ typedef enum
NF_TIMEOUT = 2, // Flag is set when the node got a timeout
} node_flags_t;
#ifndef NONET
// Table of packets that were not acknowleged can be resent (the sender window)
static ackpak_t ackpak[MAXACKPACKETS];
#endif
typedef struct
{
@@ -198,7 +194,6 @@ typedef struct
static node_t nodes[MAXNETNODES];
#define NODETIMEOUT 14
#ifndef NONET
// return <0 if a < b (mod 256)
// 0 if a = n (mod 256)
// >0 if a > b (mod 256)
@@ -411,22 +406,16 @@ static boolean Processackpak(void)
}
return goodpacket;
}
#endif
// send special packet with only ack on it
void Net_SendAcks(INT32 node)
{
#ifdef NONET
(void)node;
#else
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
netbuffer->packettype = PT_NOTHING;
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
HSendPacket(node, false, 0, MAXACKTOSEND);
#endif
}
#ifndef NONET
static void GotAcks(void)
{
INT32 i, j;
@@ -457,7 +446,6 @@ static void GotAcks(void)
}
}
}
#endif
void Net_ConnectionTimeout(INT32 node)
{
@@ -484,7 +472,6 @@ void Net_ConnectionTimeout(INT32 node)
// Resend the data if needed
void Net_AckTicker(void)
{
#ifndef NONET
INT32 i;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
@@ -534,16 +521,12 @@ void Net_AckTicker(void)
}
}
}
#endif
}
// Remove last packet received ack before resending the ackreturn
// (the higher layer doesn't have room, or something else ....)
void Net_UnAcknowledgePacket(INT32 node)
{
#ifdef NONET
(void)node;
#else
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
DEBFILE(va("UnAcknowledge node %d\n", node));
@@ -580,10 +563,8 @@ void Net_UnAcknowledgePacket(INT32 node)
if (!nodes[node].firstacktosend)
nodes[node].firstacktosend = 1;
}
#endif
}
#ifndef NONET
/** Checks if all acks have been received
*
* \return True if all acks have been received
@@ -601,7 +582,6 @@ static boolean Net_AllAcksReceived(void)
return true;
}
#endif
/** Waits for all ackreturns
*
@@ -610,9 +590,6 @@ static boolean Net_AllAcksReceived(void)
*/
void Net_WaitAllAckReceived(UINT32 timeout)
{
#ifdef NONET
(void)timeout;
#else
tic_t tictac = I_GetTime();
timeout = tictac + timeout*NEWTICRATE;
@@ -630,7 +607,6 @@ void Net_WaitAllAckReceived(UINT32 timeout)
HGetPacket();
Net_AckTicker();
}
#endif
}
static void InitNode(node_t *node)
@@ -647,10 +623,8 @@ static void InitAck(void)
{
INT32 i;
#ifndef NONET
for (i = 0; i < MAXACKPACKETS; i++)
ackpak[i].acknum = 0;
#endif
for (i = 0; i < MAXNETNODES; i++)
InitNode(&nodes[i]);
@@ -663,9 +637,6 @@ static void InitAck(void)
*/
void Net_AbortPacketType(UINT8 packettype)
{
#ifdef NONET
(void)packettype;
#else
for (INT32 i = 0; i < MAXACKPACKETS; i++)
{
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
@@ -674,7 +645,6 @@ void Net_AbortPacketType(UINT8 packettype)
ackpak[i].acknum = 0;
}
}
#endif
}
// -----------------------------------------------------------------
@@ -684,9 +654,6 @@ void Net_AbortPacketType(UINT8 packettype)
// remove a node, clear all ack from this node and reset askret
void Net_CloseConnection(INT32 node)
{
#ifdef NONET
(void)node;
#else
INT32 i;
if (node == -1)
@@ -738,10 +705,8 @@ void Net_CloseConnection(INT32 node)
InitNode(&nodes[node]);
SV_AbortSendFiles(node);
I_NetFreeNodenum(node);
#endif
}
#ifndef NONET
//
// Checksum
//
@@ -757,10 +722,8 @@ static UINT32 NetbufferChecksum(void)
return LONG(c);
}
#endif
#ifdef DEBUGFILE
static void fprintfstring(char *s, size_t len)
{
INT32 mode = 0;
@@ -1032,7 +995,6 @@ void Command_Droprate(void)
packetdroprate = droprate;
}
#ifndef NONET
static boolean ShouldDropPacket(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
@@ -1040,7 +1002,6 @@ static boolean ShouldDropPacket(void)
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
}
#endif
#endif
//
// HSendPacket
@@ -1077,11 +1038,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
if (!netgame)
I_Error("Tried to transmit to another node");
#ifdef NONET
(void)node;
(void)reliable;
(void)acknum;
#else
// do this before GetFreeAcknum because this function backups
// the current packet
doomcom->remotenode = (INT16)node;
@@ -1136,8 +1092,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
}
#endif
#endif // ndef NONET
return true;
}
@@ -1171,9 +1125,7 @@ boolean HGetPacket(void)
if (!netgame)
return false;
#ifndef NONET
while(true)
while (true)
{
I_NetGet();
@@ -1216,7 +1168,6 @@ boolean HGetPacket(void)
doomcom->datalength -= BASEPACKETSIZE;
break;
}
#endif // ifndef NONET
return true;
}
-2
View File
@@ -53,10 +53,8 @@ void Net_AckTicker(void);
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength);
boolean HGetPacket(void);
void D_SetDoomcom(void);
#ifndef NONET
void D_SaveBan(void);
void D_LoadBan(boolean warning);
#endif
boolean D_CheckNetGame(void);
void D_CloseConnection(void);
void Net_UnAcknowledgePacket(INT32 node);
+27 -47
View File
@@ -721,10 +721,8 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_killingdead);
// d_clisrv
#ifndef NONET
#ifdef SATURNJOIN
CV_RegisterVar(&cv_allownewsaturnplayer); // need to register it before cv_maxplayers && cv_allownewplayer
#endif
#endif
CV_RegisterVar(&cv_maxplayers);
CV_RegisterVar(&cv_resynchattempts);
@@ -737,18 +735,15 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_downloadspeed);
CV_RegisterVar(&cv_connectawaittime);
CV_RegisterVar(&cv_httpsource);
#ifndef NONET
CV_RegisterVar(&cv_allownewplayer);
CV_RegisterVar(&cv_joinrefusemessage);
CV_RegisterVar(&cv_chatlogsize);
#ifdef VANILLAJOINNEXTROUND
CV_RegisterVar(&cv_joinnextround);
#endif
CV_RegisterVar(&cv_showjoinaddress);
CV_RegisterVar(&cv_shownodeip);
CV_RegisterVar(&cv_blamecfail);
#endif
COM_AddCommand("ping", Command_Ping_f);
CV_RegisterVar(&cv_nettimeout);
@@ -850,12 +845,6 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_zlib_memory);
CV_RegisterVar(&cv_zlib_strategy);
CV_RegisterVar(&cv_zlib_window_bits);
// APNG variables
CV_RegisterVar(&cv_zlib_levela);
CV_RegisterVar(&cv_zlib_memorya);
CV_RegisterVar(&cv_zlib_strategya);
CV_RegisterVar(&cv_zlib_window_bitsa);
CV_RegisterVar(&cv_apng_delay);
// GIF variables
CV_RegisterVar(&cv_gif_optimize);
CV_RegisterVar(&cv_gif_downscale);
@@ -1027,6 +1016,7 @@ void D_RegisterClientCommands(void)
// screen.c
CV_RegisterVar(&cv_fullscreen);
CV_RegisterVar(&cv_renderview);
CV_RegisterVar(&cv_frameskip);
CV_RegisterVar(&cv_vhseffect);
CV_RegisterVar(&cv_shittyscreen);
CV_RegisterVar(&cv_scr_width);
@@ -4386,6 +4376,14 @@ static void Command_Addfilelocal(void)
P_AddWadFile(fn, true);
}
static void CloseFileHandle(FILE **fhandle)
{
if (*fhandle)
{
fclose(*fhandle);
*fhandle = NULL;
}
}
/** Adds a pwad at runtime.
* Searches for sounds, maps, music, new images.
@@ -4398,7 +4396,7 @@ static void Command_Addfile(void)
INT32 i;
int musiconly = -1; // W_VerifyNMUSlumps isn't boolean
FILE *fhandle = NULL;
CLEANUP(CloseFileHandle) FILE *fhandle = NULL;
if (COM_Argc() != 2)
{
@@ -4413,18 +4411,15 @@ static void Command_Addfile(void)
if (!isprint(fn[i]) || fn[i] == ';')
return;
if (fhandle)
{
fclose(fhandle);
fhandle = NULL;
}
if ((fhandle = W_OpenWadFile(&fn, true)) != NULL)
{
musiconly = W_VerifyNMUSlumps(fn, fhandle, false);
}
if (musiconly == -1)
if (fhandle == NULL || musiconly == -1)
return; // file not found
if (!musiconly)
{
// ... But only so long as they contain nothing more then music and sprites.
if (netgame && !(server || IsPlayerAdmin(consoleplayer)))
@@ -4452,7 +4447,7 @@ static void Command_Addfile(void)
{
UINT8 md5sum[16];
#ifdef NOMD5
memset(md5sum,0,16);
memset(md5sum, 0, 16);
#else
{
@@ -4464,26 +4459,22 @@ static void Command_Addfile(void)
for (i = 0; i < numwadfiles; i++)
{
if (memcmp(wadfiles[i]->md5sum, md5sum, 16))
continue;
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
goto addfile_finally;
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
{
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
return;
}
}
#endif
// Finally okay to write this important data
WRITESTRINGN(buf_p,p,240);
WRITESTRINGN(buf_p, p, 240);
WRITEMEM(buf_p, md5sum, 16);
}
if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
else
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
addfile_finally:
if (fhandle)
fclose(fhandle);
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);;
}
/** Adds something at runtime.
@@ -4674,7 +4665,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
return;
}
ncs = findfile(filename,md5sum,true);
ncs = findfile(filename, md5sum, true);
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
{
@@ -4887,18 +4878,7 @@ static void Command_Version_f(void)
#endif
// OS
// Would be nice to use SDL_GetPlatform for this
#if defined (_WIN32) || defined (_WIN64)
CONS_Printf("Windows ");
#elif defined(__linux__)
CONS_Printf("Linux ");
#elif defined(MACOSX)
CONS_Printf("macOS ");
#elif defined(UNIXCOMMON)
CONS_Printf("Unix (Common) ");
#else
CONS_Printf("Other OS ");
#endif
CONS_Printf("%s ", I_GetSysName());
// Bitness
if (sizeof(void*) == 4)
@@ -5286,7 +5266,7 @@ retryscramble:
memset(&scrambleplayers, 0, sizeof(scrambleplayers));
memset(&scrambleteams, 0, sizeof(scrambleplayers));
scrambletotal = scramblecount = 0;
blue = red = maxcomposition = newteam = playercount = 0;
blue = red = newteam = playercount = 0;
repick = true;
// Put each player's node in the array.
-16
View File
@@ -266,14 +266,6 @@ typedef enum
extern const char *netxcmdnames[MAXNETXCMD - 1];
#if defined(_MSC_VER)
#pragma pack(1)
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4214)
#endif
//Packet composition for Command_TeamChange_f() ServerTeamChange, etc.
//bitwise structs make packing bits a little easier, but byte alignment harder?
//todo: decide whether to make the other netcommands conform, or just get rid of this experiment.
@@ -285,10 +277,6 @@ typedef struct {
UINT32 scrambled : 1; // value 0 to 1
} ATTRPACK changeteam_packet_t;
#ifdef _MSC_VER
#pragma warning(default : 4214)
#endif
typedef struct {
UINT16 l; // liitle endian
UINT16 b; // big enian
@@ -302,10 +290,6 @@ typedef union {
changeteam_value_t value;
} ATTRPACK changeteam_union;
#if defined(_MSC_VER)
#pragma pack()
#endif
// add game commands, needs cleanup
void D_RegisterServerCommands(void);
void D_RegisterClientCommands(void);
+77 -52
View File
@@ -35,7 +35,8 @@
#endif
#ifdef HAVE_CURL
#include "curl/curl.h"
#include <curl/curl.h>
#include "m_curl.h"
#endif
#include "doomdef.h"
@@ -120,6 +121,7 @@ file_download_t filedownload;
#ifdef HAVE_CURL
static CURL *http_handle;
static char curl_errbuf[CURL_ERROR_SIZE];
static CURLM *multi_handle;
static UINT32 curl_dlnow;
static UINT32 curl_dltotal;
@@ -229,9 +231,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
void CL_PrepareDownloadSaveGame(const char *tmpsave)
{
#ifdef CLIENT_LOADINGSCREEN
filedownload.current = -1;
#endif
fileneedednum = 1;
fileneeded[0].status = FS_REQUESTED;
fileneeded[0].justdownloaded = false;
@@ -493,9 +493,6 @@ INT32 CL_CheckFiles(void)
size_t filestoload = 0;
boolean downloadrequired = false;
// if (M_CheckParm("-nofiles"))
// return 1;
// the first is the iwad (the main wad file)
// we don't care if it's called srb2.srb or srb2.wad.
// Never download the IWAD, just assume it's there and identical
@@ -509,11 +506,9 @@ INT32 CL_CheckFiles(void)
{
CONS_Debug(DBG_NETPLAY, "game is modified; only doing basic checks\n");
boolean have_important = false;
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
{
if (j < numwadfiles && (!wadfiles[j]->important || wadfiles[j]->localfile))
if (j < numwadfiles && !wadfiles[j]->important) // TODO: add checks for localfiles that dont contain anything "allowed" (maps and stuff like that)
{
// Unimportant on our side. still don't care.
++j;
@@ -522,15 +517,7 @@ INT32 CL_CheckFiles(void)
// If this test is true, we've reached the end of one file list.
if (i >= fileneedednum || j >= numwadfiles)
{
// We are missing some of important files, or have too much
// important files.
if (have_important)
return 2;
// All checked files weren't important, don't care about them.
break;
}
return 2;
// For the sake of speed, only bother with a md5 check
if (memcmp(wadfiles[j]->md5sum, fileneeded[i].md5sum, 16))
@@ -538,14 +525,12 @@ INT32 CL_CheckFiles(void)
// It's accounted for! let's keep going.
CONS_Debug(DBG_NETPLAY, "'%s' accounted for\n", fileneeded[i].filename);
have_important = true;
fileneeded[i].status = FS_OPEN;
++i;
++j;
}
if (have_important)
return 1;
return 1;
}
for (i = 0; i < fileneedednum; i++)
@@ -593,9 +578,6 @@ boolean CL_LoadServerFiles(void)
{
INT32 i;
// if (M_CheckParm("-nofiles"))
// return;
for (i = 0; i < fileneedednum; i++)
{
if (fileneeded[i].status == FS_OPEN)
@@ -631,6 +613,7 @@ boolean CL_LoadServerFiles(void)
fileneeded[i].status, s);
}
}
return true;
}
@@ -1022,17 +1005,16 @@ void Got_Filetxpak(void)
file->file = NULL;
file->status = FS_FOUND;
file->justdownloaded = true;
CONS_Printf(M_GetText("Downloading %s...(done)\n"),
filename);
#ifndef NONET
CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename);
filedownload.completednum++;
filedownload.completedsize += file->totalsize;
#endif
}
}
else if (!file->justdownloaded)
{
const char *s;
switch(file->status)
{
case FS_NOTFOUND:
@@ -1051,6 +1033,7 @@ void Got_Filetxpak(void)
s = "unknown";
break;
}
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
}
@@ -1061,9 +1044,7 @@ void Got_Filetxpak(void)
filetime = 0;
}
#ifdef CLIENT_LOADINGSCREEN
filedownload.current = filenum;
#endif
}
/** \brief Checks if a node is downloading a file
@@ -1309,6 +1290,7 @@ static int curlprogress_callback(void *clientp, double dltotal, double dlnow, do
void CURLPrepareFile(const char* url, int dfilenum)
{
HTTP_login *login;
CURLcode cc;
#ifdef PARANOIA
if (M_CheckParm("-nodownload"))
@@ -1317,14 +1299,33 @@ void CURLPrepareFile(const char* url, int dfilenum)
if (!multi_handle)
{
curl_global_init(CURL_GLOBAL_ALL);
multi_handle = curl_multi_init();
cc = curl_global_init(CURL_GLOBAL_ALL);
if (cc < 0)
{
I_OutputMsg("libcurl: curl_global_init() returned %d\n", cc);
}
else
{
multi_handle = curl_multi_init();
}
if (!multi_handle)
{
I_OutputMsg("libcurl: curl_multi_init() failed\n");
curl_global_cleanup();
return;
}
}
http_handle = curl_easy_init();
if (http_handle && multi_handle)
if (http_handle)
{
CURLMcode mc;
cc = curl_easy_setopt(http_handle, CURLOPT_ERRORBUFFER, curl_errbuf);
if (cc != CURLE_OK) I_OutputMsg("libcurl: CURLOPT_ERRORBUFFER failed\n");
curl_errbuf[0] = 0x00;
I_mkdir(downloaddir, 0755);
curl_curfile = &fileneeded[dfilenum];
@@ -1334,31 +1335,38 @@ void CURLPrepareFile(const char* url, int dfilenum)
curl_origfilesize = curl_curfile->currentsize;
curl_origtotalfilesize = curl_curfile->totalsize;
curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
cc = curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
// Only allow HTTP and HTTPS
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 85)
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
cc = curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
#else
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
cc = curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
#endif
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION)); // Set user agent as some servers won't accept invalid user agents.
// Set user agent, as some servers won't accept invalid user agents.
cc = curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION));
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
// Authenticate if the user so wishes
login = CURLGetLogin(url, NULL);
if (login)
{
curl_easy_setopt(http_handle, CURLOPT_USERPWD, login->auth);
cc = curl_easy_setopt(http_handle, CURLOPT_USERPWD, login->auth);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
}
// Follow a redirect request, if sent by the server.
curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L);
cc = curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
curl_easy_setopt(http_handle, CURLOPT_FAILONERROR, 1L);
cc = curl_easy_setopt(http_handle, CURLOPT_FAILONERROR, 1L);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
CONS_Printf("Downloading %s from %s\n", curl_realname, url);
CONS_Printf("Downloading addon \"%s\" from %s\n", curl_realname, url);
strcatbf(curl_curfile->filename, downloaddir, "/");
curl_curfile->file = fopen(curl_curfile->filename, "wb");
@@ -1377,19 +1385,33 @@ void CURLPrepareFile(const char* url, int dfilenum)
return;
}
curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
cc = curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
cc = curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
cc = curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
#ifdef XFERINFOFUNCTION
curl_easy_setopt(http_handle, CURLOPT_XFERINFOFUNCTION, curlprogress_callbackx);
cc = curl_easy_setopt(http_handle, CURLOPT_XFERINFOFUNCTION, curlprogress_callbackx);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
#else
curl_easy_setopt(http_handle, CURLOPT_PROGRESSFUNCTION, curlprogress_callback);
cc = curl_easy_setopt(http_handle, CURLOPT_PROGRESSFUNCTION, curlprogress_callback);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
#endif
M_SetCURLArgs(http_handle, curl_errbuf);
curl_curfile->status = FS_DOWNLOADING;
curl_multi_add_handle(multi_handle, http_handle);
mc = curl_multi_add_handle(multi_handle, http_handle);
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
mc = curl_multi_perform(multi_handle, &curl_runninghandles);
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
curl_multi_perform(multi_handle, &curl_runninghandles);
curl_starttime = time(NULL);
filedownload.current = dfilenum;
@@ -1431,14 +1453,15 @@ void CURLGetFile(void)
{
if (curl_runninghandles)
{
curl_multi_perform(multi_handle, &curl_runninghandles);
mc = curl_multi_perform(multi_handle, &curl_runninghandles);
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
/* wait for activity, timeout or "nothing" */
mc = curl_multi_wait(multi_handle, NULL, 0, 1000, NULL);
if (mc != CURLM_OK)
{
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed: %s.\n", curl_multi_strerror(mc));
continue;
}
@@ -1496,7 +1519,8 @@ void CURLGetFile(void)
Z_Free(filename);
curl_curfile->file = NULL;
filedownload.remaining--;
curl_multi_remove_handle(multi_handle, e);
mc = curl_multi_remove_handle(multi_handle, e);
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
curl_easy_cleanup(e);
if (!filedownload.remaining)
@@ -1507,7 +1531,8 @@ void CURLGetFile(void)
if (!filedownload.remaining || !filedownload.http_running)
{
curl_multi_cleanup(multi_handle);
mc = curl_multi_cleanup(multi_handle);
if (mc != CURLM_OK) I_OutputMsg("libcurl: %s\n", curl_multi_strerror(mc));
curl_global_cleanup();
multi_handle = NULL;
}
-5
View File
@@ -59,19 +59,15 @@ extern char downloaddir[512];
typedef struct
{
#ifdef CLIENT_LOADINGSCREEN
INT32 current;
INT32 completednum;
UINT32 completedsize;
INT32 totalnum;
UINT32 totalsize;
#endif
#ifdef HAVE_CURL
INT32 remaining;
boolean http_failed;
boolean http_running;
char http_source[MAX_MIRROR_LENGTH+1];
#endif
} file_download_t;
@@ -79,7 +75,6 @@ typedef struct
extern file_download_t filedownload;
#ifdef HAVE_CURL
typedef struct HTTP_login HTTP_login;
extern struct HTTP_login
+28 -11
View File
@@ -22,6 +22,7 @@
#ifdef HAVE_CURL
#include <curl/curl.h>
#include "m_curl.h"
#endif
#include "doomdef.h"
@@ -207,13 +208,14 @@ void D_SetupProtocol(void)
fp = fopen(protocolfile, "a+");
result = fgets(buffer, PATH_MAX, fp);
if (result)
{
if (strcmp(buffer, "no") == 0)
{
fclose(fp);
return;
}
{
fclose(fp);
return;
}
else if (strcmp(buffer, exe_path) != 0)
{
// overwrite
@@ -232,6 +234,7 @@ void D_SetupProtocol(void)
else
fprintf(fp, "no");
}
fclose(fp);
}
@@ -255,8 +258,10 @@ void D_CreateProtocol(void)
}
#ifdef HAVE_CURL
static char curl_errbuf[CURL_ERROR_SIZE];
void D_DownloadReplay(const char *url, const char *path)
{
FILE *fp = NULL;
CURL *curl;
CURLcode cc;
@@ -264,17 +269,29 @@ void D_DownloadReplay(const char *url, const char *path)
if (!curl)
I_Error("Unable to download replay. Error initializing CURL.");
cc = curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
if (cc != CURLE_OK) I_OutputMsg("libcurl: CURLOPT_ERRORBUFFER failed\n");
curl_errbuf[0] = 0x00;
fp = fopen(path, "wb");
CONS_Printf("REPLAY: URL: %s\n", url);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlwrite_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
cc = curl_easy_perform(curl);
cc = curl_easy_setopt(curl, CURLOPT_URL, url);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
cc = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlwrite_data);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
cc = curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", curl_errbuf);
M_SetCURLArgs(curl, curl_errbuf);
cc = curl_easy_perform(curl);
if (cc != CURLE_OK)
I_Error("Unable to download replay. URL gave response code %u.", cc);
I_Error("Unable to download replay. libcurl: %s.", curl_errbuf);
curl_easy_cleanup(curl);
fclose(fp);
curl_easy_cleanup(curl);
fclose(fp);
}
#endif
+5
View File
@@ -9,6 +9,9 @@
/// \file d_protocol.h
/// \brief srb2kart:// protocol stuff
#ifndef __D_PROTOCOL__
#define __D_PROTOCOL__
void D_SetupProtocol(void);
void D_CreateProtocol(void);
@@ -16,3 +19,5 @@ void D_DeleteProtocol(void);
#ifdef HAVE_CURL
void D_DownloadReplay(const char *url, const char *path);
#endif
#endif //__D_PROTOCOL__
-8
View File
@@ -50,10 +50,6 @@ typedef enum
#define TICCMD_RECEIVED 1
#define TICCMD_XY 2
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
@@ -65,8 +61,4 @@ typedef struct
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
} ATTRPACK ticcmd_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
#endif
+6 -18
View File
@@ -138,8 +138,7 @@ static void InitLogging(void)
if (M_IsPathAbsolute(reldir))
{
left = snprintf(logfilename, sizeof logfilename,
"%s"PATHSEP, reldir);
left = snprintf(logfilename, sizeof logfilename, "%s"PATHSEP, reldir);
}
else
#ifdef DEFAULTDIR
@@ -155,13 +154,10 @@ static void InitLogging(void)
"."PATHSEP"%s"PATHSEP, reldir);
}
strftime(&logfilename[left], sizeof logfilename - left,
format, timeinfo);
strftime(&logfilename[left], sizeof logfilename - left, format, timeinfo);
}
M_MkdirEachUntil(logfilename,
M_PathParts(logdir) - 1,
M_PathParts(logfilename) - 1, 0755);
M_MkdirEachUntil(logfilename, M_PathParts(logdir) - 1, M_PathParts(logfilename) - 1, 0755);
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
logstream = fopen(logfilename, "w");
@@ -213,12 +209,9 @@ int main(int argc, char **argv)
//I_OutputMsg("I_StartupSystem() ...\n");
I_StartupSystem();
#if defined (_WIN32)
{
#ifdef DRMINGW
ExcHndlInit();
#endif
}
#ifdef HAVE_DRMINGW
InitDrMingw();
#endif
// startup SRB2
@@ -228,11 +221,6 @@ int main(int argc, char **argv)
// never return
D_SRB2Loop();
#ifdef BUGTRAP
// This is safe even if BT didn't start.
ShutdownBugTrap();
#endif
// return to OS
return 0;
}
+358 -358
View File
@@ -54,8 +54,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <string.h>
#ifdef __GNUC__
#include <unistd.h>
#elif defined (_MSC_VER)
#include <direct.h>
#endif
#if defined (__unix__) || defined (UNIXCOMMON)
#include <fcntl.h>
@@ -66,10 +64,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <conio.h>
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#include <time.h>
#if defined (__linux__)
@@ -180,293 +174,10 @@ static char returnWadPath[256];
#include "../byteptr.h"
#endif
#ifdef HAVE_LIBBACKTRACE
#include <backtrace.h>
// TODO - move this to some header file instead
extern struct backtrace_state *bt_state;
typedef struct bt_crash_reason_s {
enum {
BTCRASH_SIGNAL,
BTCRASH_ERRORMSG,
} type;
union {
INT32 signal;
const char *errormsg;
} value;
} bt_crash_reason_t;
#define BT_CRASH_REASON_SIGNAL(num) (bt_crash_reason_t){ .type = BTCRASH_SIGNAL, .value = { .signal = num } }
#define BT_CRASH_REASON_ERRORMSG(msg) (bt_crash_reason_t){ .type = BTCRASH_ERRORMSG, .value = { .errormsg = msg } }
static void printsignal(FILE *fp, INT32 num)
{
switch (num)
{
case SIGILL:
fprintf(fp, "SIGILL - illegal instruction - invalid function image");
break;
case SIGFPE:
fprintf(fp, "SIGFPE - mathematical exception");
break;
case SIGSEGV:
fprintf(fp, "SIGSEGV - segment violation");
break;
case SIGABRT:
fprintf(fp, "SIGABRT - abnormal termination triggered by abort call");
break;
default:
fprintf(fp, "Signal number %d", num);
}
}
typedef struct bt_out_buf_s {
boolean error;
char *pos;
size_t size;
} bt_out_buf_t;
static void bt_syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize)
{
(void)symval;
(void)symsize;
bt_out_buf_t *buf = (bt_out_buf_t*)data;
if (!symname)
symname = "???";
int n = snprintf(buf->pos, buf->size, "%p %s\n", (void*)pc, symname);
if (n <= 0)
{
buf->size = 0;
return;
}
buf->pos += n;
buf->size -= n;
}
static int bt_simple_cb(void *data, uintptr_t pc)
{
bt_out_buf_t *buf = (bt_out_buf_t*)data;
backtrace_syminfo(bt_state, pc, bt_syminfo_cb, NULL, data);
if (!buf->size) return 1;
return 0;
}
static int bt_full_cb(void *data, uintptr_t pc, const char *filename, int lineno, const char *function)
{
bt_out_buf_t *buf = (bt_out_buf_t*)data;
if (!filename) filename = "???";
if (!function) function = "???";
int n = snprintf(buf->pos, buf->size, "%p %s\n\t%s:%d\n", (void*)pc, function, filename, lineno);
if (n <= 0) return 1;
buf->pos += n;
buf->size -= n;
if (!buf->size) return 1;
return 0;
}
static void bt_error_cb(void *data, const char *msg, int errnum)
{
(void)msg; // We don't need this
bt_out_buf_t *buf = (bt_out_buf_t*)data;
// No debug info
if (errnum == -1)
buf->error = true;
}
static void write_backtrace(bt_crash_reason_t reason)
{
FILE *out = fopen(va("%s" PATHSEP "%s", srb2home, "srb2kart-crash-log.txt"), "a");
time_t rawtime;
struct tm *timeinfo;
const size_t BUFSIZE = 8192;
char backtrace[BUFSIZE];
bt_out_buf_t buf;
buf.error = false;
buf.pos = backtrace;
buf.size = BUFSIZE;
if (!out)
{
fprintf(stderr, "\nWARNING: Couldn't open crash log for writing! Make sure your permissions are correct. Please save the below report!\n");
out = stderr;
}
// Get the current time as a string.
time(&rawtime);
timeinfo = localtime(&rawtime);
fprintf(out, "------------------------\n\n");
fprintf(out, "Program name: %s %s\n", SRB2APPLICATION, VERSIONSTRING);
if (compdate && comptime && comprevision && compbranch)
fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch);
if (gamestate == GS_LEVEL)
{
char *title = G_BuildMapTitle(gamemap);
if (title)
{
fprintf(out, "Game map: %s (%s)\n", title, G_BuildMapName(gamemap));
Z_Free(title);
}
else
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
}
fprintf(out, "Time of crash: %s\n", asctime(timeinfo));
fprintf(out, "Caused by: ");
switch (reason.type)
{
case BTCRASH_SIGNAL:
printsignal(out, reason.value.signal);
break;
case BTCRASH_ERRORMSG:
fprintf(out, "%s", reason.value.errormsg);
break;
}
fprintf(out, "\nBacktrace:\n");
// Try to get full backtrace, it will print files and line numbers
backtrace_full(bt_state, 2, bt_full_cb, bt_error_cb, (void*)&buf);
if (buf.error)
{
// Fall back to simple backtrace, only prints function names
backtrace_simple(bt_state, 2, bt_simple_cb, NULL, (void*)&buf);
}
fputs(backtrace, out);
if (out != stderr)
{
fclose(out);
fprintf(stderr, "Crash report created, find srb2kart-crash-log.txt in your SRB2Kart directory\n");
}
}
#endif
boolean consolevent = false;
boolean framebuffer = false;
boolean g_in_exiting_signal_handler = false;
UINT8 keyboard_started = false;
static void I_ReportSignal(int num, int coredumped)
{
//static char msg[] = "oh no! back to reality!\r\n";
const char * sigmsg;
char msg[256];
switch (num)
{
// case SIGINT:
// sigmsg = "SIGINT - interrupted";
// break;
case SIGILL:
sigmsg = "SIGILL - illegal instruction - invalid function image";
break;
case SIGFPE:
sigmsg = "SIGFPE - mathematical exception";
break;
case SIGSEGV:
sigmsg = "SIGSEGV - segment violation";
break;
// case SIGTERM:
// sigmsg = "SIGTERM - Software termination signal from kill";
// break;
// case SIGBREAK:
// sigmsg = "SIGBREAK - Ctrl-Break sequence";
// break;
case SIGABRT:
sigmsg = "SIGABRT - abnormal termination triggered by abort call";
break;
default:
sprintf(msg,"signal number %d", num);
if (coredumped)
sigmsg = 0;
else
sigmsg = msg;
}
if (coredumped)
{
if (sigmsg)
sprintf(msg, "%s (core dumped)", sigmsg);
else
strcat(msg, " (core dumped)");
}
else
{
sprintf(msg, "%s", sigmsg);
}
#ifdef HAVE_LIBBACKTRACE
strncat(msg, "\n\nCrash report has been saved into srb2kart-crash-log.txt", 255);
#elif defined(_WIN32) && !defined(__MINGW64__)
strncat(msg, "\n\nCrash report has been saved into srb2kart.rpt", 255);
#endif
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
}
#ifndef NEWSIGNALHANDLER
FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
{
g_in_exiting_signal_handler = true;
D_QuitNetGame(); // Fix server freezes
#ifdef HAVE_LIBBACKTRACE
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
#endif
if (demo.recording)
G_SaveDemo();
I_ReportSignal(num, 0);
I_ShutdownSystem();
signal(num, SIG_DFL); //default signal action
raise(num);
I_Quit();
}
#endif
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
{
signal(num, SIG_DFL); //default signal action
raise(num);
I_Quit();
}
#ifdef HAVE_TERMIOS
// TERMIOS console code from Quake3: thank you!
boolean stdin_active = true;
@@ -495,16 +206,6 @@ static struct termios tty_tc;
// 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 ..
@@ -799,55 +500,6 @@ static inline void I_StartupConsole(void)
static inline void I_ShutdownConsole(void){}
#endif
//
// StartupKeyboard
//
static void I_RegisterSignals (void)
{
#ifdef SIGINT
signal(SIGINT , quit_handler);
#endif
#ifdef SIGBREAK
signal(SIGBREAK , quit_handler);
#endif
#ifdef SIGTERM
signal(SIGTERM , quit_handler);
#endif
// If these defines don't exist,
// then compilation would have failed above us...
#ifndef NEWSIGNALHANDLER
signal(SIGILL , signal_handler);
signal(SIGSEGV , signal_handler);
signal(SIGABRT , signal_handler);
signal(SIGFPE , signal_handler);
#endif
}
#ifdef NEWSIGNALHANDLER
static void signal_handler_child(INT32 num)
{
#ifdef HAVE_LIBBACKTRACE
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
#endif
if (demo.recording)
G_SaveDemo();
signal(num, SIG_DFL); //default signal action
raise(num);
}
static void I_RegisterChildSignals(void)
{
// If these defines don't exist,
// then compilation would have failed above us...
signal(SIGILL , signal_handler_child);
signal(SIGSEGV , signal_handler_child);
signal(SIGABRT , signal_handler_child);
signal(SIGFPE , signal_handler_child);
}
#endif
//
//I_OutputMsg
@@ -874,10 +526,6 @@ void I_OutputMsg(const char *fmt, ...)
DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt);
#endif
#if defined (_WIN32) && defined (_MSC_VER)
OutputDebugStringA(txt);
#endif
len = strlen(txt);
#ifdef LOGMESSAGES
@@ -1322,6 +970,317 @@ void I_SleepDuration(precise_t duration)
#endif
}
boolean g_in_exiting_signal_handler = false;
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg)
{
const char *sigmsg;
switch (signal_num)
{
#ifdef SIGINT
case SIGINT:
sigmsg = ("SIGINT - SRB2Kart-Saturn was interrupted prematurely by the user.");
break;
#endif
case SIGILL: // illegal instruction - invalid function image
sigmsg = ("SIGILL - SRB2Kart-Saturn has attempted to execute an illegal instruction and needs to close.");
break;
case SIGFPE: // mathematical exception
sigmsg = ("SIGFPE - SRB2Kart-Saturn has encountered a mathematical exception and needs to close.");
break;
case SIGSEGV: // segment violation
sigmsg = ("SIGSEGV - SRB2Kart-Saturn has attempted to access a memory location that it shouldn't and needs to close.");
break;
#ifdef SIGTERM
case SIGTERM: // Software termination signal from kill
sigmsg = ("SIGTERM - SRB2Kart-Saturn was terminated by a kill signal.");
break;
#endif
#ifdef SIGBREAK
case SIGBREAK: // Ctrl-Break sequence
sigmsg =("SIGBREAK - SRB2Kart-Saturn was terminated by a Ctrl-Break sequence.")
break;
#endif
case SIGABRT: // abnormal termination triggered by abort call
sigmsg = ("SIGABRT - SRB2Kart-Saturn was terminated by an abort signal.");
break;
default:
sprintf(signal_msg, "Signal number %d", signal_num);
sigmsg = (core_dumped ? "Unknown signal" : signal_msg);
break;
}
if (core_dumped)
{
if (sigmsg)
sprintf(signal_msg, "%s (core dumped)", sigmsg);
else
strcat(signal_msg, " (core dumped)");
}
else
{
sprintf(signal_msg, "%s", sigmsg);
}
}
static void I_ReportSignal(int num, int coredumped)
{
char sigmsg[512];
I_PrintSignal(num, coredumped, sigmsg);
size_t len = strlen(sigmsg);
snprintf(sigmsg + len, sizeof(sigmsg) - len, "\n\nCrash report has been saved into %s", CRASH_LOGFILE_NAME);
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
}
#ifndef NEWSIGNALHANDLER
FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
{
g_in_exiting_signal_handler = true;
D_QuitNetGame(); // Fix server freezes
#ifdef HAVE_LIBBACKTRACE
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
#endif
I_ReportSignal(num, 0);
I_ShutdownSystem();
signal(num, SIG_DFL); //default signal action
raise(num);
I_Quit();
}
#endif
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
{
signal(num, SIG_DFL); //default signal action
raise(num);
I_Quit();
}
#ifdef HAVE_LIBBACKTRACE
#include <backtrace.h>
// TODO - move this to some header file instead
extern struct backtrace_state *bt_state;
typedef struct bt_crash_reason_s {
enum {
BTCRASH_SIGNAL,
BTCRASH_ERRORMSG,
} type;
union {
INT32 signal;
const char *errormsg;
} value;
} bt_crash_reason_t;
#define BT_CRASH_REASON_SIGNAL(num) (bt_crash_reason_t){ .type = BTCRASH_SIGNAL, .value = { .signal = num } }
#define BT_CRASH_REASON_ERRORMSG(msg) (bt_crash_reason_t){ .type = BTCRASH_ERRORMSG, .value = { .errormsg = msg } }
typedef struct bt_out_buf_s {
boolean error;
char *pos;
size_t size;
} bt_out_buf_t;
static void bt_syminfo_cb(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize)
{
(void)symval;
(void)symsize;
bt_out_buf_t *buf = (bt_out_buf_t*)data;
if (!symname)
symname = "???";
int n = snprintf(buf->pos, buf->size, "%p %s\n", (void*)pc, symname);
if (n <= 0)
{
buf->size = 0;
return;
}
buf->pos += n;
buf->size -= n;
}
static int bt_simple_cb(void *data, uintptr_t pc)
{
bt_out_buf_t *buf = (bt_out_buf_t*)data;
backtrace_syminfo(bt_state, pc, bt_syminfo_cb, NULL, data);
if (!buf->size) return 1;
return 0;
}
static int bt_full_cb(void *data, uintptr_t pc, const char *filename, int lineno, const char *function)
{
bt_out_buf_t *buf = (bt_out_buf_t*)data;
if (!filename) filename = "???";
if (!function) function = "???";
int n = snprintf(buf->pos, buf->size, "%p %s\n\t%s:%d\n", (void*)pc, function, filename, lineno);
if (n <= 0) return 1;
buf->pos += n;
buf->size -= n;
if (!buf->size) return 1;
return 0;
}
static void bt_error_cb(void *data, const char *msg, int errnum)
{
(void)msg; // We don't need this
bt_out_buf_t *buf = (bt_out_buf_t*)data;
// No debug info
if (errnum == -1)
buf->error = true;
}
static void write_backtrace(bt_crash_reason_t reason)
{
char sig_msg[512];
const char *filename = va("%s" PATHSEP CRASH_LOGFILE_NAME, srb2home);
FILE *out = fopen(filename, "a+");
time_t rawtime;
struct tm *timeinfo;
const size_t BUFSIZE = 8192;
char backtrace[BUFSIZE];
bt_out_buf_t buf;
buf.error = false;
buf.pos = backtrace;
buf.size = BUFSIZE;
if (!out)
{
fprintf(stderr, "\nWARNING: Couldn't open crash log for writing! Make sure your permissions are correct. Please save the below report!\n");
out = stderr;
}
// Get the current time as a string.
time(&rawtime);
timeinfo = localtime(&rawtime);
fprintf(out, "------------------------\n\n");
fprintf(out, "Program name: %s %s\n", SRB2APPLICATION, VERSIONSTRING);
fprintf(out, "Dedicated build\n");
fprintf(out, "Platform: %s\n", I_GetSysName());
if (compdate && comptime && comprevision && compbranch)
fprintf(out, "Compiled: %s %s, commit %s, branch %s\n", compdate, comptime, comprevision, compbranch);
if (gamestate == GS_LEVEL && gamemap)
{
char *title = G_BuildMapTitle(gamemap);
if (title)
{
fprintf(out, "Game map: %s (%s)\n", title, G_BuildMapName(gamemap));
Z_Free(title);
}
else
fprintf(out, "Game map: %s\n", G_BuildMapName(gamemap));
}
fprintf(out, "Time of crash: %s\n", asctime(timeinfo));
fprintf(out, "Caused by: ");
switch (reason.type)
{
case BTCRASH_SIGNAL:
I_PrintSignal(reason.value.signal, false, sig_msg);
fprintf(out, "%s", sig_msg);
break;
case BTCRASH_ERRORMSG:
fprintf(out, "%s", reason.value.errormsg);
break;
}
fprintf(out, "\nBacktrace:\n");
// Try to get full backtrace, it will print files and line numbers
backtrace_full(bt_state, 2, bt_full_cb, bt_error_cb, (void*)&buf);
if (buf.error)
{
// Fall back to simple backtrace, only prints function names
backtrace_simple(bt_state, 2, bt_simple_cb, NULL, (void*)&buf);
}
fputs(backtrace, out);
if (out != stderr)
{
fclose(out);
fprintf(stderr, "Crash report created, find %s in your SRB2Kart directory\n", CRASH_LOGFILE_NAME);
}
}
#endif
static void I_RegisterSignals(void)
{
#ifdef SIGINT
signal(SIGINT, quit_handler);
#endif
#ifdef SIGBREAK
signal(SIGBREAK, quit_handler);
#endif
#ifdef SIGTERM
signal(SIGTERM, quit_handler);
#endif
#ifndef NEWSIGNALHANDLER
// If these defines don't exist,
// then compilation would have failed above us...
signal(SIGILL, signal_handler);
signal(SIGSEGV, signal_handler);
signal(SIGABRT, signal_handler);
signal(SIGFPE, signal_handler);
#endif
}
#ifdef NEWSIGNALHANDLER
static void signal_handler_child(INT32 num)
{
g_in_exiting_signal_handler = true;
#ifdef HAVE_LIBBACKTRACE
write_backtrace(BT_CRASH_REASON_SIGNAL(num));
#endif
signal(num, SIG_DFL); // default signal action
raise(num);
}
static void I_RegisterChildSignals(void)
{
// If these defines don't exist,
// then compilation would have failed above us...
signal(SIGILL, signal_handler_child);
signal(SIGSEGV, signal_handler_child);
signal(SIGABRT, signal_handler_child);
signal(SIGFPE, signal_handler_child);
}
#endif
#ifdef NEWSIGNALHANDLER
FUNCNORETURN static ATTRNORETURN void newsignalhandler_Warn(const char *pr)
{
@@ -1426,13 +1385,12 @@ void I_Quit(void)
static boolean quiting = false;
/* prevent recursive I_Quit() */
if (quiting) goto death;
if (quiting)
goto death;
quiting = false;
I_ShutdownConsole();
M_SaveConfig(NULL); //save game config, cvars..
#ifndef NONET
D_SaveBan(); // save the ban list
#endif
G_SaveGameData(false); // 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.
@@ -1536,9 +1494,7 @@ void I_Error(const char *error, ...)
I_ShutdownConsole();
M_SaveConfig(NULL); // save game config, cvars..
#ifndef NONET
D_SaveBan(); // save the ban list
#endif
G_SaveGameData(false); // Tails 12-08-2002
// Shutdown. Here might be other errors.
@@ -2027,7 +1983,7 @@ const char *I_LocateWad(void)
#if defined (_WIN32)
SetCurrentDirectoryA(waddir);
#else
if (chdir(waddir) == -1)
if (waddir == NULL || chdir(waddir) == -1)
I_OutputMsg("Couldn't change working directory\n");
#endif
}
@@ -2175,6 +2131,50 @@ size_t I_GetFreeMem(size_t *total)
// note CPUAFFINITY code used to reside here
void I_RegisterSysCommands(void) {}
const char *I_GetSysName(void)
{
// reference: https://sourceforge.net/p/predef/wiki/OperatingSystems/
#if defined(_WIN32) || defined(__CYGWIN__)
return "Windows";
#elif defined(__APPLE__)
return "Mac OS";
#elif defined(__linux__)
return "Linux";
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(__NetBSD__)
return "NetBSD";
#elif defined(__DragonFly__)
return "DragonFly BSD";
#elif defined(__gnu_hurd__)
return "GNU Hurd"; // for anyone mental enough to set up an SRB2 server on GNU Hurd
#elif defined(__hpux)
return "HP-UX";
#elif defined(EPLAN9)
return "Plan 9";
#elif defined(__HAIKU__)
return "Haiku";
#elif defined(__BEOS__)
return "BeOS";
#elif defined(__minix)
return "Minix";
#elif defined(__sun)
#if defined(__SVR4) || defined(__srv4__)
return "Solaris"; // this would be so cursed...
#else
return "SunOS";
#endif
#elif defined(_AIX)
return "AIX";
#elif defined(__SYLLABLE__)
return "SyllableOS"; // RIP SyllableOS, i still miss you ;-;
#else
return "Unknown";
#endif
}
boolean I_InitNetwork(void)
{
// this must exist, but this is actually handled in i_tcp.c
+4 -2
View File
@@ -89,9 +89,10 @@ void I_UpdateNoVsync(void)
//
// I_ReadScreen
//
void I_ReadScreen(UINT8 *scr)
void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
{
(void)scr;
(void)scale;
}
//
@@ -144,8 +145,9 @@ UINT32 I_GetRefreshRate(void)
return 0;
}
void I_SetTextInput(void)
void I_SetTextInput(boolean enable)
{
(void)enable;
}
boolean I_UseNativeKeyboard(void)
+9 -9
View File
@@ -754,7 +754,7 @@ static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
i = atoi(word2); // used for numerical settings
// CHEAP HACK: move this over here for lowercase subtitles
@@ -1393,7 +1393,7 @@ static void readhuditem(MYFILE *f, INT32 num)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
strupr(word2);
i = atoi(word2); // used for numerical settings
@@ -1862,7 +1862,7 @@ static void reademblemdata(MYFILE *f, INT32 num)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
value = atoi(word2); // used for numerical settings
// Up here to allow lowercase in hints
@@ -1989,7 +1989,7 @@ static void readextraemblemdata(MYFILE *f, INT32 num)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
strupr(word2);
value = atoi(word2); // used for numerical settings
@@ -2067,7 +2067,7 @@ static void readunlockable(MYFILE *f, INT32 num)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
strupr(word2);
i = atoi(word2); // used for numerical settings
@@ -2336,7 +2336,7 @@ static void readconditionset(MYFILE *f, UINT8 setnum)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
strupr(word2);
if (fastncmp(word, "CONDITION", 9))
@@ -2470,7 +2470,7 @@ static void readmaincfg(MYFILE *f)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
strupr(word2);
value = atoi(word2); // used for numerical settings
@@ -2649,7 +2649,7 @@ static void readwipes(MYFILE *f)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word = s;
char *pword = word;
char *pword;
char *word2;
char *tmp;
INT32 value;
@@ -2682,7 +2682,7 @@ static void readwipes(MYFILE *f)
strupr(word);
// Now get the part after
word2 = tmp += 2;
word2 = tmp + 2;
value = atoi(word2); // used for numerical settings
if (value < -1 || value > 99)
-8
View File
@@ -57,10 +57,6 @@ enum
// Do not use bit five or after, as they are used for object z-offsets.
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// A single Vertex.
typedef struct
{
@@ -188,10 +184,6 @@ typedef struct
UINT16 children[2];
} ATTRPACK mapnode_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// Thing definition, position, orientation and type,
// plus visibility flags and attributes.
typedef struct
+26 -22
View File
@@ -47,17 +47,6 @@
#define ASMCALL
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4127 4152 4213 4514)
#ifdef _WIN64
#pragma warning(disable : 4306)
#endif
#endif
// warning level 4
// warning C4127: conditional expression is constant
// warning C4152: nonstandard extension, function/data pointer conversion in expression
// warning C4213: nonstandard extension used : cast on l-value
#ifdef __cplusplus
extern "C" {
#endif
@@ -101,6 +90,20 @@ extern FILE *logstream;
extern char logfilename[1024];
#endif
// not sure if this belongs here lul
// TODO: figure out whats preventing 32bit windows from working with libbacktrace
#if defined(_WIN32) && !defined(__MINGW64__)
#define HAVE_DRMINGW
#endif
#if defined (HAVE_LIBBACKTRACE)
#define CRASH_LOGFILE_NAME "srb2kart-crash-log.txt"
#elif defined (HAVE_DRMINGW)
#define CRASH_LOGFILE_NAME "srb2kart-crash-log.RPT"
#else
#define CRASH_LOGFILE_NAME "(unknown crash log)"
#endif
/* A mod name to further distinguish versions. */
#define SRB2APPLICATION "SRB2Kart"
@@ -117,9 +120,11 @@ extern char logfilename[1024];
#define SUBVERSION 6 // more precise version number
#define VERSIONSTRING "Saturn v9"
#define VERSIONSTRINGW L"Saturn v9"
#define SATURN_TESTING // comment out for saturn release builds!
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
// And change CMakeLists.txt (not src/, but in root), for CMake users!
// AND appveyor.yml, for the build bots!
#endif
// Maintain compatibility with 1.0.x record attack replays?
@@ -416,7 +421,7 @@ enum {
*/
void I_Error(const char *error, ...) FUNCIERROR;
FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...);
/** \brief write a message to stderr (use before I_Quit) for when you need to quit with a msg, but need
the return code 0 of I_Quit();
@@ -560,13 +565,19 @@ UINT32 quickncasehash (const char *p, size_t n)
#endif
#ifdef __cplusplus
#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
#if defined(__GNUC__) || defined(__clang__)
#define restrict __restrict
#else
#define restrict
#endif
#endif
// the GNU cleanup attribute: plugging memory leaks since 2003!
// on scope exit, the cleanup function is called with a pointer to the declared variable,
// essentially behaving like a C++ destructor
// NOTE: you WILL have nasal troubles if the variable is not initialized
#define CLEANUP(f) __attribute__((__cleanup__(f)))
// An assert-type mechanism.
#ifdef PARANOIA
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
@@ -589,7 +600,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
// None of these that are disabled in the normal build are guaranteed to work perfectly
// Compile them at your own risk!
#ifndef NONET
//-- SATURN __
/// Detect if a client is on Saturn in the clientconfig.
/// To seperately allow them to join or block joining from vanilla clients.
@@ -604,7 +614,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
#define SATURNPAK
#endif
//-- <( ̄︶ ̄)> __
#endif
/// Undefine to use the new method of Gamma correction see colour cube in v_video.c
#define BACKWARDSCOMPATCORRECTION
@@ -626,11 +635,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// Most modifications should probably enable this.
//#define SAVEGAME_OTHERVERSIONS
#ifndef NONET
/// Display a connection screen on join attempts.
#define CLIENT_LOADINGSCREEN
#endif
/// Backwards compatibility with musicslots.
/// \note You should leave this enabled unless you're working with a future SRB2 version.
#define MUSICSLOT_COMPATIBILITY
@@ -651,7 +655,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
#define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
#define ROTANGDIFF (360 / ROTANGLES)
#if defined (HAVE_CURL) && ! defined (NONET)
#if defined (HAVE_CURL)
#define MASTERSERVER
#define HOLEPUNCH
#else
+2 -44
View File
@@ -28,31 +28,6 @@ extern "C" {
#endif
/* 7.18.1.1 Exact-width integer types */
#ifdef _MSC_VER
#define UINT8 unsigned __int8
#define SINT8 signed __int8
#define UINT16 unsigned __int16
#define INT16 __int16
#define INT32 __int32
#define UINT32 unsigned __int32
#define INT64 __int64
#define UINT64 unsigned __int64
typedef long ssize_t;
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if (_MSC_VER <= 1200)
#ifndef DWORD_PTR
#define DWORD_PTR DWORD
#endif
#ifndef PDWORD_PTR
#define PDWORD_PTR PDWORD
#endif
#endif
#else
#define __STDC_LIMIT_MACROS
#include <stdint.h>
@@ -66,7 +41,6 @@ typedef long ssize_t;
#define UINT32 uint32_t
#define INT64 int64_t
#define UINT64 uint64_t
#endif
#ifdef __APPLE_CC__
#define DIRECTFULLSCREEN 1
@@ -76,16 +50,7 @@ typedef long ssize_t;
/* Strings and some misc platform specific stuff */
#if defined (_MSC_VER) || defined (__OS2__)
// Microsoft VisualC++
#ifdef _MSC_VER
#if (_MSC_VER <= 1800) // MSVC 2013 and back
#define snprintf _snprintf
#if (_MSC_VER <= 1200) // MSVC 6.0 and back
#define vsnprintf _vsnprintf
#endif
#endif
#endif
#if defined (__OS2__)
#define strncasecmp strnicmp
#define strcasecmp stricmp
#define inline __inline
@@ -270,13 +235,6 @@ typedef int32_t boolean;
#endif
#define ATTRUNUSED __attribute__((unused))
#elif defined (_MSC_VER)
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200 // >= MSVC 6.0
#define ATTRNOINLINE __declspec(noinline)
#endif
#endif
#ifndef FUNCPRINTF
@@ -368,7 +326,7 @@ typedef UINT8 bitarray_t;
static inline int
in_bit_array (const bitarray_t * const array, const int value)
{
return (array[value >> 3] & (1<<(value & 7)));
return(array[value >> 3] & (1<<(value & 7)));
}
static inline void
+6 -12
View File
@@ -169,7 +169,7 @@ static void F_SkyScroll(INT32 scrollspeed)
pat = W_CachePatchName("TITLEBG1", PU_PATCH_LOWPRIORITY);
pat2 = W_CachePatchName("TITLEBG2", PU_PATCH_LOWPRIORITY);
w = (vid.width / vid.dupx)<<FRACBITS;
w = (vid.scaledwidth << FRACBITS);
// The scroll offset MUST be clamped before shifting by FRACBITS, or else it'll overflow in about 3 minutes
animtimer = ((((finalecount * scrollspeed) % (pat->width*16))<<FRACBITS) + (R_GetTimeFrac(RTF_MENU) * scrollspeed))/16;
@@ -677,7 +677,7 @@ void F_CreditDrawer(void)
y += 12<<FRACBITS;
break;
}
if (((y>>FRACBITS) * vid.dupy) > vid.height)
if (((y>>FRACBITS) * vid.dup) > vid.height)
break;
}
@@ -685,8 +685,8 @@ void F_CreditDrawer(void)
if (finalecount)
{
const char *goodbyefornow = "See you in ""\x82""Dr. Robotnik's Ring Racers""\x80""!";
fixed_t lpad = ((vid.width/vid.dupx) - BASEVIDWIDTH)<<FRACBITS;
fixed_t w = V_StringWidth(goodbyefornow, V_ALLOWLOWERCASE)<<FRACBITS;
fixed_t lpad = (vid.scaledwidth - BASEVIDWIDTH) << FRACBITS;
fixed_t w = V_StringWidth(goodbyefornow, V_ALLOWLOWERCASE) << FRACBITS;
fixed_t x = FixedMul(((BASEVIDWIDTH<<FRACBITS)+w+lpad), ((finalecount-1)<<FRACBITS)/(5*TICRATE)) - w - (lpad/2);
V_DrawString(x>>FRACBITS, y>>FRACBITS, V_ALLOWLOWERCASE, goodbyefornow); // for some reason DrawStringAtFixed can't tolerate colour codes
}
@@ -707,7 +707,8 @@ void F_CreditTicker(void)
case 1: y += 30<<FRACBITS; break;
default: y += 12<<FRACBITS; break;
}
if (FixedMul(y,vid.dupy) > vid.height)
if (FixedMul(y, vid.dup) > vid.height)
break;
}
@@ -1149,13 +1150,6 @@ void F_TitleScreenTicker(boolean run)
// Setup demo name
snprintf(dname, 9, "%sS%02u", mapname, numstaff);
/*if ((l = W_CheckNumForName(dname)) == LUMPERROR) -- we KNOW it exists now
{
CONS_Alert(CONS_ERROR, M_GetText("Demo lump \"%s\" doesn't exist\n"), dname);
F_StartIntro();
return;
}*/
loadreplay:
demo.title = demo.fromtitle = true;
demo.ignorefiles = true;
+2 -2
View File
@@ -314,7 +314,7 @@ void F_WipeStartScreen(void)
}
#endif
wipe_scr_start = vid.screens[3];
I_ReadScreen(wipe_scr_start);
I_ReadScreen(wipe_scr_start, 1);
#endif
}
@@ -331,7 +331,7 @@ void F_WipeEndScreen(void)
}
#endif
wipe_scr_end = vid.screens[4];
I_ReadScreen(wipe_scr_end);
I_ReadScreen(wipe_scr_end, 1);
V_DrawBlock(0, 0, 0, vid.width, vid.height, wipe_scr_start);
#endif
}
+17 -310
View File
@@ -30,286 +30,7 @@
#include "z_zone.h"
#include "m_menu.h" // Addons_option_Onchange
#if defined (_WIN32) && defined (_MSC_VER)
#include <errno.h>
#include <io.h>
#include <tchar.h>
#define SUFFIX "*"
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
struct dirent
{
long d_ino; /* Always zero. */
unsigned short d_reclen; /* Always zero. */
unsigned short d_namlen; /* Length of name in d_name. */
char d_name[FILENAME_MAX]; /* File name. */
};
/*
* This is an internal data structure. Good programmers will not use it
* except as an argument to one of the functions below.
* dd_stat field is now int (was short in older versions).
*/
typedef struct
{
/* disk transfer area for this dir */
struct _finddata_t dd_dta;
/* dirent struct to return from dir (NOTE: this makes this thread
* safe as long as only one thread uses a particular DIR struct at
* a time) */
struct dirent dd_dir;
/* _findnext handle */
#if _MSC_VER > 1200
intptr_t dd_handle;
#else
long dd_handle;
#endif
/*
* Status of search:
* 0 = not started yet (next entry to read is first entry)
* -1 = off the end
* positive = 0 based index of next entry
*/
int dd_stat;
/* given path for dir with search pattern (struct is extended) */
CHAR dd_name[1];
} DIR;
/*
* opendir
*
* Returns a pointer to a DIR structure appropriately filled in to begin
* searching a directory.
*/
DIR *
opendir (const CHAR *szPath)
{
DIR *nd;
DWORD rc;
CHAR szFullPath[MAX_PATH];
errno = 0;
if (!szPath)
{
errno = EFAULT;
return (DIR *) 0;
}
if (szPath[0] == '\0')
{
errno = ENOTDIR;
return (DIR *) 0;
}
/* Attempt to determine if the given path really is a directory. */
rc = GetFileAttributesA(szPath);
if (rc == INVALID_FILE_ATTRIBUTES)
{
/* call GetLastError for more error info */
errno = ENOENT;
return (DIR *) 0;
}
if (!(rc & FILE_ATTRIBUTE_DIRECTORY))
{
/* Error, entry exists but not a directory. */
errno = ENOTDIR;
return (DIR *) 0;
}
/* Make an absolute pathname. */
_fullpath (szFullPath, szPath, MAX_PATH);
/* Allocate enough space to store DIR structure and the complete
* directory path given. */
nd = (DIR *) malloc (sizeof (DIR) + (strlen(szFullPath) + strlen (SLASH) +
strlen(PATHSEP) + 1) * sizeof (CHAR));
if (!nd)
{
/* Error, out of memory. */
errno = ENOMEM;
return (DIR *) 0;
}
/* Create the search expression. */
strcpy (nd->dd_name, szFullPath);
/* Add on a slash if the path does not end with one. */
if (nd->dd_name[0] != '\0' &&
nd->dd_name[strlen (nd->dd_name) - 1] != PATHSEP[0])
{
strcat (nd->dd_name, PATHSEP);
}
/* Add on the search pattern */
strcat (nd->dd_name, SUFFIX);
/* Initialize handle to -1 so that a premature closedir doesn't try
* to call _findclose on it. */
nd->dd_handle = -1;
/* Initialize the status. */
nd->dd_stat = 0;
/* Initialize the dirent structure. ino and reclen are invalid under
* Win32, and name simply points at the appropriate part of the
* findfirst_t structure. */
nd->dd_dir.d_ino = 0;
nd->dd_dir.d_reclen = 0;
nd->dd_dir.d_namlen = 0;
ZeroMemory(nd->dd_dir.d_name, FILENAME_MAX);
return nd;
}
/*
* readdir
*
* Return a pointer to a dirent structure filled with the information on the
* next entry in the directory.
*/
struct dirent *
readdir (DIR * dirp)
{
errno = 0;
/* Check for valid DIR struct. */
if (!dirp)
{
errno = EFAULT;
return (struct dirent *) 0;
}
if (dirp->dd_stat < 0)
{
/* We have already returned all files in the directory
* (or the structure has an invalid dd_stat). */
return (struct dirent *) 0;
}
else if (dirp->dd_stat == 0)
{
/* We haven't started the search yet. */
/* Start the search */
dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta));
if (dirp->dd_handle == -1)
{
/* Whoops! Seems there are no files in that
* directory. */
dirp->dd_stat = -1;
}
else
{
dirp->dd_stat = 1;
}
}
else
{
/* Get the next search entry. */
if (_findnext (dirp->dd_handle, &(dirp->dd_dta)))
{
/* We are off the end or otherwise error.
_findnext sets errno to ENOENT if no more file
Undo this. */
DWORD winerr = GetLastError();
if (winerr == ERROR_NO_MORE_FILES)
errno = 0;
_findclose (dirp->dd_handle);
dirp->dd_handle = -1;
dirp->dd_stat = -1;
}
else
{
/* Update the status to indicate the correct
* number. */
dirp->dd_stat++;
}
}
if (dirp->dd_stat > 0)
{
/* Successfully got an entry. Everything about the file is
* already appropriately filled in except the length of the
* file name. */
dirp->dd_dir.d_namlen = (unsigned short)strlen (dirp->dd_dta.name);
strcpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
return &dirp->dd_dir;
}
return (struct dirent *) 0;
}
/*
* rewinddir
*
* Makes the next readdir start from the beginning.
*/
int
rewinddir (DIR * dirp)
{
errno = 0;
/* Check for valid DIR struct. */
if (!dirp)
{
errno = EFAULT;
return -1;
}
dirp->dd_stat = 0;
return 0;
}
/*
* closedir
*
* Frees up resources allocated by opendir.
*/
int
closedir (DIR * dirp)
{
int rc;
errno = 0;
rc = 0;
if (!dirp)
{
errno = EFAULT;
return -1;
}
if (dirp->dd_handle != -1)
{
rc = _findclose (dirp->dd_handle);
}
/* Delete the dir structure. */
free (dirp);
return rc;
}
#endif
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
#if 1
{1, "HOME"}, {2, "SRB2"},
#endif
{3, "CUSTOM"}, {0, NULL}};
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"}, {1, "HOME"}, {2, "SRB2"}, {3, "CUSTOM"}, {0, NULL}};
consvar_t cv_addons_option = {"addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_addons_folder = {"addons_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -484,6 +205,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
}
}
// This folder is excluded
if (skipfolder)
{
continue;
@@ -699,9 +421,6 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
{
DIR *dirhandle;
struct dirent *dent;
#ifndef _WIN32
struct stat fsstat;
#endif
size_t pos = 0, folderpos = 0, numfolders = 0;
char *tempname = NULL;
@@ -723,10 +442,13 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
Z_Free(dirmenu);
dirmenu = NULL;
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
if (coredirmenu != NULL)
{
Z_Free(coredirmenu[sizecoredirmenu-1]);
coredirmenu[sizecoredirmenu-1] = NULL;
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
{
Z_Free(coredirmenu[sizecoredirmenu-1]);
coredirmenu[sizecoredirmenu-1] = NULL;
}
}
while (true)
@@ -744,23 +466,16 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
#ifndef _WIN32
if (stat(menupath, &fsstat) < 0)
#else
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
DWORD fileattr = GetFileAttributes(menupath);
if (fileattr == INVALID_FILE_ATTRIBUTES)
#endif
INT32 isdir = pathisdirectory(menupath);
if (isdir == -1)
; // was the file (re)moved? can't stat it
else // is a file or directory
{
#ifndef _WIN32
if (!S_ISDIR(fsstat.st_mode)) // file
#else
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
#endif
if (isdir == 0) // file
{
size_t len = strlen(dent->d_name)+1;
if (replayhut)
{
if (strcasecmp(".lmp", dent->d_name+len-5))
@@ -826,13 +541,9 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
#ifndef _WIN32
if (stat(menupath, &fsstat) < 0)
#else
// if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT
DWORD fileattr = GetFileAttributes(menupath);
if (fileattr == INVALID_FILE_ATTRIBUTES)
#endif
INT32 isdir = pathisdirectory(menupath);
if (isdir == -1)
; // was the file (re)moved? can't stat it
else // is a file or directory
{
@@ -841,11 +552,7 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
UINT8 ext = EXT_FOLDER;
UINT8 folder;
#ifndef _WIN32
if (!S_ISDIR(fsstat.st_mode)) // file
#else
if (!(fileattr & FILE_ATTRIBUTE_DIRECTORY))
#endif
if (isdir == 0) // file
{
if (!((numfolders+pos) < sizecoredirmenu))
continue; // crash prevention
+1 -1
View File
@@ -630,7 +630,7 @@ void G_GhostAddHit(INT32 playernum, mobj_t *victim)
ghostext[playernum].flags |= EZT_HIT;
ghostext[playernum].hits++;
ghostext[playernum].hitlist = Z_Realloc(ghostext[playernum].hitlist, ghostext[playernum].hits * sizeof(mobj_t *), PU_LEVEL, &ghostext[playernum].hitlist);
Z_Realloc(ghostext[playernum].hitlist, ghostext[playernum].hits * sizeof(mobj_t *), PU_STATIC, &ghostext[playernum].hitlist);
P_SetTarget(ghostext[playernum].hitlist + (ghostext[playernum].hits-1), victim);
}
+7 -6
View File
@@ -3564,7 +3564,7 @@ void G_SaveGameData(boolean force)
if (!gamedataloaded)
return; // If never loaded (-nodata), don't save
save.p = save.buffer = (UINT8 *)malloc(GAMEDATASIZE);
save.p = save.buffer = (UINT8 *)Z_Malloc(GAMEDATASIZE, PU_STATIC, NULL);
if (!save.p)
{
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
@@ -3584,6 +3584,8 @@ void G_SaveGameData(boolean force)
if (!FIL_CopyFile(gamedatafilename, backupfile))
{
CONS_Alert(CONS_WARNING,"Failed to create a backup of save data. Will not attempt to write to save data\n");
Z_Free(save.buffer);
save.p = save.buffer = NULL;
return;
}
}
@@ -3655,7 +3657,7 @@ void G_SaveGameData(boolean force)
length = save.p - save.buffer;
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), save.buffer, length);
free(save.buffer);
Z_Free(save.buffer);
save.p = save.buffer = NULL;
}
@@ -3825,7 +3827,7 @@ void G_SaveGame(UINT32 savegameslot)
char name[VERSIONSIZE];
size_t length;
save.p = save.buffer = (UINT8 *)malloc(SAVEGAMESIZE);
save.p = save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
if (!save.p)
{
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
@@ -3840,7 +3842,7 @@ void G_SaveGame(UINT32 savegameslot)
length = save.p - save.buffer;
saved = FIL_WriteFile(backup, save.buffer, length);
free(save.buffer);
Z_Free(save.buffer);
save.p = save.buffer = NULL;
}
@@ -4141,8 +4143,6 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
if (!( realmapname = G_BuildMapTitle(mapnum) ))
continue;
aprop = realmapname;
/* Now that we found a perfect match no need to fucking guess. */
if (strnicmp(realmapname, mapname, mapnamelen) == 0)
{
@@ -4170,6 +4170,7 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
writesimplefreq(freq, &freqc,
mapnum, aprop - realmapname, mapnamelen);
}
if (apromapnum == 0)
{
apromapnum = mapnum;
-2
View File
@@ -129,9 +129,7 @@ extern consvar_t cv_playerblendeffects;
extern consvar_t cv_cechotoggle;
#ifndef NONET
extern consvar_t cv_chatlogsize;
#endif
typedef enum
{
-4
View File
@@ -455,7 +455,6 @@ void HWR_RenderBatches(void)
{
GL_SetShader(nextShader);
currentShader = nextShader;
changeShader = false;
ps_hw_numshaders.value.i++;
}
@@ -465,7 +464,6 @@ void HWR_RenderBatches(void)
// texture should be already ready for use from calls to GL_SetTexture during batch collection
GL_SetTexture(nextTexture);
currentTexture = nextTexture;
changeTexture = false;
ps_hw_numtextures.value.i++;
}
@@ -473,7 +471,6 @@ void HWR_RenderBatches(void)
if (changePolyFlags)
{
currentPolyFlags = nextPolyFlags;
changePolyFlags = false;
ps_hw_numpolyflags.value.i++;
}
@@ -481,7 +478,6 @@ void HWR_RenderBatches(void)
if (changeSurfaceInfo)
{
currentSurfaceInfo = nextSurfaceInfo;
changeSurfaceInfo = false;
ps_hw_numcolors.value.i++;
}
+7 -5
View File
@@ -974,7 +974,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
#endif
M_ClearBox(rootbbox);
for (i = 0;i < numvertexes; i++)
for (i = 0; i < numvertexes; i++)
M_AddToBox(rootbbox, vertexes[i].x, vertexes[i].y);
#ifdef DEBUG_HWBSP
@@ -985,8 +985,8 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
// allocate extra data for each subsector present in map
totsubsectors = numsubsectors + NEWSUBSECTORS;
extrasubsectors = calloc(totsubsectors, sizeof (*extrasubsectors));
if (UNLIKELY(extrasubsectors == NULL))
extrasubsectors = calloc(totsubsectors, sizeof(*extrasubsectors));
if (UNLIKELY(!extrasubsectors))
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
// number of the first new subsector that might be added
@@ -1009,11 +1009,13 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
rootpv->y = FIXED_TO_FLOAT(rootbbox[BOXBOTTOM]); //ll
rootpv++;
WalkBSPNode(bspnum, rootp, NULL,rootbbox);
WalkBSPNode(bspnum, rootp, NULL, rootbbox);
i = SolveTProblem();
#ifdef DEBUG_HWBSP
i = SolveTProblem();
CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
#else
SolveTProblem();
#endif
AdjustSegs();
+3 -1
View File
@@ -1190,7 +1190,9 @@ static void HWR_CacheFadeMask(GLMipmap_t *glMipmap, lumpnum_t fademasklumpnum)
break;
default: // Bad lump
CONS_Alert(CONS_WARNING, "Fade mask lump of incorrect size, ignored\n"); // I should avoid this by checking the lumpnum in HWR_RunWipe
break;
glMipmap->width = 0;
glMipmap->height = 0;
return;
}
// Thankfully, this will still work for this scenario
-8
View File
@@ -99,10 +99,6 @@ typedef struct
fixed_t x2, y2, z2;
} polyvertex_t;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// a convex 'plane' polygon, clockwise order
typedef struct
{
@@ -110,10 +106,6 @@ typedef struct
polyvertex_t pts[0];
} poly_t;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
// holds extra info for 3D render, for each subsector in subsectors[]
typedef struct
{
+102 -144
View File
@@ -23,7 +23,6 @@
#include "hw_glob.h"
#include "hw_gl.h"
#include "../m_misc.h" //FIL_WriteFile()
#include "../r_draw.h" //viewborderlump
#include "../r_main.h"
#include "../w_wad.h"
@@ -38,9 +37,6 @@
#define O_BINARY 0
#endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
UINT8 id_field_length ; // 1
@@ -54,9 +50,6 @@ typedef struct
UINT8 image_pix_size ; //17
UINT8 image_descriptor; //18
} ATTRPACK TGAHeader; // sizeof is 18
#if defined(_MSC_VER)
#pragma pack()
#endif
static UINT8 softwaretranstogl[11] = { 0, 25, 51, 76,102,127,153,178,204,229,255};
static UINT8 softwaretranstogl_hi[11] = { 0, 51,102,153,204,255,255,255,255,255,255};
@@ -81,10 +74,8 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
// | /|
// |/ |
// 0--1
float sdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
float sdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
float sdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
float pdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
// make patch ready in hardware cache
HWR_GetPatch(gpatch);
@@ -93,25 +84,23 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
switch (option & V_SCALEPATCHMASK)
{
case V_NOSCALEPATCH:
pdupx = pdupy = 2.0f;
pdup = 2.0f;
break;
case V_SMALLSCALEPATCH:
pdupx = 2.0f * FIXED_TO_FLOAT(vid.smalldupx*FRACUNIT);
pdupy = 2.0f * FIXED_TO_FLOAT(vid.smalldupy*FRACUNIT);
pdup = 2.0f * FIXED_TO_FLOAT(vid.smalldup*FRACUNIT);
break;
case V_MEDSCALEPATCH:
pdupx = 2.0f * FIXED_TO_FLOAT(vid.meddupx*FRACUNIT);
pdupy = 2.0f * FIXED_TO_FLOAT(vid.meddupx*FRACUNIT);
pdup = 2.0f * FIXED_TO_FLOAT(vid.meddup*FRACUNIT);
break;
}
if (option & V_NOSCALESTART)
sdupx = sdupy = 2.0f;
sdup = 2.0f;
v[0].x = v[3].x = (x*sdupx-gpatch->leftoffset*pdupx)/vid.width - 1;
v[2].x = v[1].x = (x*sdupx+(gpatch->width - gpatch->leftoffset)*pdupx)/vid.width - 1;
v[0].y = v[1].y = 1-(y*sdupy-gpatch->topoffset*pdupy)/vid.height;
v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height - gpatch->topoffset)*pdupy)/vid.height;
v[0].x = v[3].x = (x*sdup-gpatch->leftoffset*pdup)/vid.width - 1;
v[2].x = v[1].x = (x*sdup+(gpatch->width - gpatch->leftoffset)*pdup)/vid.width - 1;
v[0].y = v[1].y = 1-(y*sdup-gpatch->topoffset*pdup)/vid.height;
v[2].y = v[3].y = 1-(y*sdup+(gpatch->height - gpatch->topoffset)*pdup)/vid.height;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
@@ -145,7 +134,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
// | /|
// |/ |
// 0--1
float dupx, dupy, fscalew, fscaleh, fwidth, fheight;
float dup, fscalew, fscaleh, fwidth, fheight;
if (alphalevel >= 10 && alphalevel < 13)
return;
@@ -161,25 +150,21 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
hwrPatch = ((GLPatch_t *)gpatch->hardware);
dupx = (float)vid.dupx;
dupy = (float)vid.dupy;
dup = (float)vid.dup;
switch (option & V_SCALEPATCHMASK)
{
case V_NOSCALEPATCH:
dupx = dupy = 1.0f;
dup = 1.0f;
break;
case V_SMALLSCALEPATCH:
dupx = (float)vid.smalldupx;
dupy = (float)vid.smalldupy;
dup = (float)vid.smalldup;
break;
case V_MEDSCALEPATCH:
dupx = (float)vid.meddupx;
dupy = (float)vid.meddupy;
dup = (float)vid.meddup;
break;
}
dupx = dupy = (dupx < dupy ? dupx : dupy);
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
if (vscale != pscale)
fscaleh = FIXED_TO_FLOAT(vscale);
@@ -199,10 +184,10 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
offsety = (float)(gpatch->topoffset) * fscaleh;
if ((option & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs
if ((option & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dup for crosshairs
{
offsetx *= dupx;
offsety *= dupy;
offsetx *= dup;
offsety *= dup;
}
cx -= offsetx;
@@ -217,8 +202,8 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
if (!(option & V_NOSCALESTART))
{
cx = cx * dupx;
cy = cy * dupy;
cx = cx * dup;
cy = cy * dup;
if (!(option & V_SCALEPATCHMASK))
{
@@ -235,28 +220,30 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}
}
// centre screen
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
if (fabsf(fvw - FLOATBASEVIDWIDTH * dup) > 1.0E-36f)
{
if (option & V_SNAPTORIGHT)
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
cx += (fvw - (FLOATBASEVIDWIDTH * dup));
else if (!(option & V_SNAPTOLEFT))
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2.0f;
cx += (fvw - (FLOATBASEVIDWIDTH * dup))/2.0f;
}
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dup) > 1.0E-36f)
{
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dupy));
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dup));
else if (option & V_SNAPTOBOTTOM)
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
cy += (fvh - (FLOATBASEVIDHEIGHT * dup));
else if (!(option & V_SNAPTOTOP))
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2.0f;
cy += (fvh - (FLOATBASEVIDHEIGHT * dup))/2.0f;
}
}
}
fwidth = (float)(gpatch->width) * fscalew * dupx;
fheight = (float)(gpatch->height) * fscaleh * dupy;
fwidth = (float)(gpatch->width) * fscalew * dup;
fheight = (float)(gpatch->height) * fscaleh * dup;
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
cx = -1.0f + (cx / (fvw / 2.0f));
@@ -333,7 +320,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
// | /|
// |/ |
// 0--1
float dupx, dupy, fscale, fwidth, fheight;
float dup, fscale, fwidth, fheight;
if (alphalevel >= 10 && alphalevel < 13)
return;
@@ -345,25 +332,21 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
HWR_GetPatch(gpatch);
hwrPatch = ((GLPatch_t *)gpatch->hardware);
dupx = (float)vid.dupx;
dupy = (float)vid.dupy;
dup = (float)vid.dup;
switch (option & V_SCALEPATCHMASK)
{
case V_NOSCALEPATCH:
dupx = dupy = 1.0f;
dup = 1.0f;
break;
case V_SMALLSCALEPATCH:
dupx = (float)vid.smalldupx;
dupy = (float)vid.smalldupy;
dup = (float)vid.smalldup;
break;
case V_MEDSCALEPATCH:
dupx = (float)vid.meddupx;
dupy = (float)vid.meddupy;
dup = (float)vid.meddup;
break;
}
dupx = dupy = (dupx < dupy ? dupx : dupy);
fscale = FIXED_TO_FLOAT(pscale);
cy -= (float)(gpatch->topoffset) * fscale;
@@ -371,8 +354,8 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
if (!(option & V_NOSCALESTART))
{
cx = cx * dupx;
cy = cy * dupy;
cx = cx * dup;
cy = cy * dup;
if (!(option & V_SCALEPATCHMASK))
{
@@ -389,22 +372,24 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}
}
// centre screen
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
if (fabsf(fvw - FLOATBASEVIDWIDTH * dup) > 1.0E-36f)
{
if (option & V_SNAPTORIGHT)
cx += (fvw - (FLOATBASEVIDWIDTH * dupx));
cx += (fvw - (FLOATBASEVIDWIDTH * dup));
else if (!(option & V_SNAPTOLEFT))
cx += (fvw - (FLOATBASEVIDWIDTH * dupx))/2.0f;
cx += (fvw - (FLOATBASEVIDWIDTH * dup))/2.0f;
}
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dup) > 1.0E-36f)
{
if ((option & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dupy));
cy += (fvh/2.0f - (FLOATBASEVIDHEIGHT/2.0f * dup));
else if (option & V_SNAPTOBOTTOM)
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
cy += (fvh - (FLOATBASEVIDHEIGHT * dup));
else if (!(option & V_SNAPTOTOP))
cy += (fvh - (FLOATBASEVIDHEIGHT * dupy))/2.0f;
cy += (fvh - (FLOATBASEVIDHEIGHT * dup))/2.0f;
}
}
}
@@ -426,13 +411,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
if (pscale != FRACUNIT)
{
fwidth *= fscale * dupx;
fheight *= fscale * dupy;
fwidth *= fscale * dup;
fheight *= fscale * dup;
}
else
{
fwidth *= dupx;
fheight *= dupy;
fwidth *= dup;
fheight *= dup;
}
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
@@ -495,7 +480,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
// --------------------------------------------------------------------------
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum)
{
FOutVector v[4];
FOutVector v[4];
float dflatsize;
INT32 flatflag;
const size_t len = W_LumpLength(flatlumpnum);
@@ -598,7 +583,6 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
GL_SetShader(HWR_GetShaderFromTarget(SHADER_UI_COLORMAP_FADE));
GL_DrawScreenTexture(scr_tex, &Surf, PF_ColorMapped|PF_NoDepthTest);
GL_UnSetShader();
return;
}
else
@@ -671,17 +655,14 @@ void HWR_DrawViewBorder(INT32 clearlines)
INT32 basewindowx, basewindowy;
patch_t *patch;
// if (gl_viewwidth == vid.width)
// return;
if (!clearlines)
clearlines = BASEVIDHEIGHT; // refresh all
// calc view size based on original game resolution
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowx), vid.fdupx));
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdup)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdup));
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdup));
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowx), vid.fdup));
// top
HWR_DrawFlatFill(0, 0,
@@ -834,27 +815,28 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
if (!(color & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
const float dup = (float)vid.dup;
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
fx *= dup;
fy *= dup;
fw *= dup;
fh *= dup;
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dupx)) > 1.0E-36f)
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dup)) > 1.0E-36f)
{
if (color & V_SNAPTORIGHT)
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
fx += (fvw - (FLOATBASEVIDWIDTH * dup));
else if (!(color & V_SNAPTOLEFT))
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2.0f;
fx += (fvw - (FLOATBASEVIDWIDTH * dup)) / 2.0f;
}
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dupy)) > 1.0E-36f)
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dup)) > 1.0E-36f)
{
// same thing here
if (color & V_SNAPTOBOTTOM)
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
fy += (fvh - (FLOATBASEVIDHEIGHT * dup));
else if (!(color & V_SNAPTOTOP))
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2.0f;
fy += (fvh - (FLOATBASEVIDHEIGHT * dup)) / 2.0f;
}
}
@@ -907,8 +889,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
Surf.PolyColor = palette[color&0xFF];
GL_DrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
GL_DrawPolygon(&Surf, v, 4, PF_Modulated|PF_NoTexture|PF_NoDepthTest);
}
// -------------------+
@@ -938,7 +919,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
if (!(options & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
const float dup = (float)vid.dup;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{
@@ -953,32 +934,32 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
return;
}
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
fx *= dup;
fy *= dup;
fw *= dup;
fh *= dup;
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dupx)) > 1.0E-36f)
if (fabsf(fvw - (FLOATBASEVIDWIDTH * dup)) > 1.0E-36f)
{
if (options & V_SNAPTORIGHT)
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
fx += (fvw - (FLOATBASEVIDWIDTH * dup));
else if (!(options & V_SNAPTOLEFT))
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
fx += (fvw - (FLOATBASEVIDWIDTH * dup)) / 2;
}
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dupy)) > 1.0E-36f)
if (fabsf(fvh - (FLOATBASEVIDHEIGHT * dup)) > 1.0E-36f)
{
// same thing here
if (options & V_SNAPTOBOTTOM)
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
fy += (fvh - (FLOATBASEVIDHEIGHT * dup));
else if (!(options & V_SNAPTOTOP))
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
fy += (fvh - (FLOATBASEVIDHEIGHT * dup)) / 2;
}
if (options & V_SPLITSCREEN)
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
fy += (FLOATBASEVIDHEIGHT * dup)/2;
if (options & V_HORZSCREEN)
fx += (FLOATBASEVIDWIDTH * dupx)/2;
fx += (FLOATBASEVIDWIDTH * dup)/2;
}
if (fx >= vid.width || fy >= vid.height)
@@ -1059,7 +1040,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
if (!(color & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
const float dup = (float)vid.dup;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{
@@ -1073,30 +1054,32 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
return;
}
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
fx *= dup;
fy *= dup;
fw *= dup;
fh *= dup;
if (fabsf(fvw - FLOATBASEVIDWIDTH * dupx) > 1.0E-36f)
if (fabsf(fvw - FLOATBASEVIDWIDTH * dup) > 1.0E-36f)
{
if (color & V_SNAPTORIGHT)
fx += (fvw - (FLOATBASEVIDWIDTH * dupx));
fx += (fvw - (FLOATBASEVIDWIDTH * dup));
else if (!(color & V_SNAPTOLEFT))
fx += (fvw - (FLOATBASEVIDWIDTH * dupx)) / 2;
fx += (fvw - (FLOATBASEVIDWIDTH * dup)) / 2;
}
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dupy) > 1.0E-36f)
if (fabsf(fvh - FLOATBASEVIDHEIGHT * dup) > 1.0E-36f)
{
// same thing here
if (color & V_SNAPTOBOTTOM)
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy));
fy += (fvh - (FLOATBASEVIDHEIGHT * dup));
else if (!(color & V_SNAPTOTOP))
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
fy += (fvh - (FLOATBASEVIDHEIGHT * dup)) / 2;
}
if (color & V_SPLITSCREEN)
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
fy += (FLOATBASEVIDHEIGHT * dup)/2;
if (color & V_HORZSCREEN)
fx += (FLOATBASEVIDWIDTH * dupx)/2;
fx += (FLOATBASEVIDWIDTH * dup)/2;
}
if (fx >= vid.width || fy >= vid.height)
@@ -1114,6 +1097,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
fw = fvw - fx;
if (fy + fh > vid.height)
@@ -1154,11 +1138,9 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
#ifdef HAVE_PNG
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
@@ -1222,42 +1204,18 @@ static inline boolean saveTGA(const char *file_name, void *buffer,
// --------------------------------------------------------------------------
// screen shot
// --------------------------------------------------------------------------
UINT8 *HWR_GetScreenshot(void)
UINT8 *HWR_GetScreenshot(INT32 scale)
{
static UINT8 *buf = NULL;
buf = realloc(buf, vid.width * vid.height * 3);
buf = realloc(buf, (vid.width/scale)*(vid.height/scale)*3);
if (!buf)
return NULL;
// returns 24bit 888 RGB
GL_ReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
GL_ReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf, scale);
return buf;
}
boolean HWR_Screenshot(const char *pathname)
{
boolean ret;
UINT8 *buf = malloc(vid.width * vid.height * 3 * sizeof (*buf));
if (!buf)
{
CONS_Debug(DBG_RENDER, "HWR_Screenshot: Failed to allocate memory\n");
return false;
}
// returns 24bit 888 RGB
GL_ReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
#ifdef USE_PNG
ret = M_SavePNG(pathname, buf, vid.width, vid.height, NULL);
#else
ret = saveTGA(pathname, buf, vid.width, vid.height);
#endif
free(buf);
return ret;
}
#endif //HWRENDER
+1 -1
View File
@@ -54,7 +54,7 @@ INT32 GL_GetTextureUsed(void);
void GL_CreateModelVBOs(model_t *model);
void GL_ReadScreenTexture(int tex, UINT16 *dst_data);
void GL_ReadScreenTexture(int tex, UINT8 *dst_data, INT32 scale);
void GL_GClipRect(INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip);
void GL_MakeScreenTexture(int tex);
+91 -109
View File
@@ -575,21 +575,13 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
if (nrPlaneVerts < 3) //not even a triangle ?
return;
const sector_t *sec = FOFsector ? FOFsector : gl_frontsector;
// Get the slope pointer to simplify future code
if (FOFsector)
{
if (FOFsector->f_slope && !isceiling)
slope = FOFsector->f_slope;
else if (FOFsector->c_slope && isceiling)
slope = FOFsector->c_slope;
}
else
{
if (gl_frontsector->f_slope && !isceiling)
slope = gl_frontsector->f_slope;
else if (gl_frontsector->c_slope && isceiling)
slope = gl_frontsector->c_slope;
}
if (sec->f_slope && !isceiling)
slope = sec->f_slope;
else if (sec->c_slope && isceiling)
slope = sec->c_slope;
// Set fixedheight to the slope's height from our viewpoint, if we have a slope
if (slope)
@@ -645,42 +637,24 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
flatxref = (float)(((fixed_t)pv->x & (~flatflag)) / fflatsize);
flatyref = (float)(((fixed_t)pv->y & (~flatflag)) / fflatsize);
if (FOFsector != NULL)
if (!isceiling) // it's a floor
{
if (!isceiling) // it's a floor
{
scrollx = FixedToFloat(FOFsector->floor_xoffs)/fflatsize;
scrolly = FixedToFloat(FOFsector->floor_yoffs)/fflatsize;
angle = FOFsector->floorpic_angle;
}
else // it's a ceiling
{
scrollx = FixedToFloat(FOFsector->ceiling_xoffs)/fflatsize;
scrolly = FixedToFloat(FOFsector->ceiling_yoffs)/fflatsize;
angle = FOFsector->ceilingpic_angle;
}
scrollx = FixedToFloat(sec->floor_xoffs)/fflatsize;
scrolly = FixedToFloat(sec->floor_yoffs)/fflatsize;
angle = sec->floorpic_angle;
}
else if (gl_frontsector)
else // it's a ceiling
{
if (!isceiling) // it's a floor
{
scrollx = FixedToFloat(gl_frontsector->floor_xoffs)/fflatsize;
scrolly = FixedToFloat(gl_frontsector->floor_yoffs)/fflatsize;
angle = gl_frontsector->floorpic_angle;
}
else // it's a ceiling
{
scrollx = FixedToFloat(gl_frontsector->ceiling_xoffs)/fflatsize;
scrolly = FixedToFloat(gl_frontsector->ceiling_yoffs)/fflatsize;
angle = gl_frontsector->ceilingpic_angle;
}
scrollx = FixedToFloat(sec->ceiling_xoffs)/fflatsize;
scrolly = FixedToFloat(sec->ceiling_yoffs)/fflatsize;
angle = sec->ceilingpic_angle;
}
if (angle) // Only needs to be done if there's an altered angle
{
tempxsow = flatxref;
tempytow = flatyref;
anglef = ANG2RAD(InvAngle(angle));
anglef = ANG2RAD(InvAngle(angle));
flatxref = (tempxsow * cosf(anglef)) - (tempytow * sinf(anglef));
flatyref = (tempxsow * sinf(anglef)) + (tempytow * cosf(anglef));
}
@@ -755,14 +729,16 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
for (i = 0; i < subsector->numlines; i++, line++)
{
line_t* ld = line->linedef;
// this check sucks and is a hotspot lel
if (LIKELY(line->linedef->special != HORIZONSPECIAL))
if (LIKELY(ld->special != HORIZONSPECIAL))
continue;
if (R_PointOnSegSide(viewx, viewy, line) != 0)
continue;
P_ClosestPointOnLine(viewx, viewy, line->linedef, &v);
P_ClosestPointOnLine(viewx, viewy, ld, &v);
dist = FixedToFloat(R_PointToDist(v.x, v.y));
if (line->pv1)
@@ -772,7 +748,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
}
else
{
x1 = y1 = FixedToFloat(line->v1->x);
x1 = FixedToFloat(line->v1->x);
y1 = FixedToFloat(line->v1->y);
}
if (line->pv2)
@@ -2203,7 +2180,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
static inline boolean HWR_UsePortals(void)
{
return cv_glportals.value && gl_maphasportals;
return supportstencil && cv_glportals.value && gl_maphasportals;
}
// From PrBoom:
@@ -2449,9 +2426,6 @@ static void HWR_AddLine(seg_t *line)
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
return;
gl_curline = line;
if (LIKELY(gl_curline->pv1))
@@ -2614,7 +2588,12 @@ static inline void HWR_AddPolyObjectSegs(void)
// Render the polyobject's lines
for (j = 0; j < po_ptrs[i]->segCount; ++j)
{
HWR_AddLine(po_ptrs[i]->segs[j]);
seg_t *seg = po_ptrs[i]->segs[j];
if (!(seg->polyseg->flags & POF_RENDERSIDES))
continue;
HWR_AddLine(seg);
}
}
}
@@ -2983,7 +2962,7 @@ static void HWR_Subsector(size_t num)
const sector_t *controlSec = &sectors[rover->secnum];
if (!controlSec->moved)
if (controlSec->moved != true)
continue;
anyMoved = true;
@@ -3215,7 +3194,7 @@ doaddline:
// without talking about the overdraw of course.
sub->sector->validcount = validcount;/// \todo fix that in a better way
if (UNLIKELY(numPolyObjects))
if (UNLIKELY(numpolys))
{
while (count--)
{
@@ -3645,7 +3624,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
float towtop, towbot, towmult;
float bheight;
float realheight, heightmult;
const sector_t *sector = spr->mobj->subsector->sector;
mobj_t *sprmo = spr->mobj;
const sector_t *sector = sprmo->subsector->sector;
const lightlist_t *list = sector->lightlist;
float endrealtop, endrealbot, endtop, endbot;
float endbheight;
@@ -3665,9 +3645,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
// Draw shadow BEFORE sprite
if (UNLIKELY(cv_shadow.value // Shadows enabled
&& (spr->mobj->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow.
&& !(spr->mobj->flags2 & MF2_DEBRIS) // Debris have no corona or shadow.
&& (spr->mobj->z >= spr->mobj->floorz))) // Without this, your shadow shows on the floor, even after you die and fall through the ground.
&& (sprmo->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow.
&& !(sprmo->flags2 & MF2_DEBRIS) // Debris have no corona or shadow.
&& (sprmo->z >= sprmo->floorz))) // Without this, your shadow shows on the floor, even after you die and fall through the ground.
{
////////////////////
// SHADOW SPRITE! //
@@ -3721,7 +3701,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
towmult = (towbot - towtop) / (top - bot);
endrealtop = endtop = baseWallVerts[2].y;
endrealbot = endbot = baseWallVerts[1].y;
endrealbot = baseWallVerts[1].y;
// copy the contents of baseWallVerts into the drawn wallVerts array
// baseWallVerts is used to know the final shape to easily get the vertex
@@ -3729,24 +3709,24 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
memcpy(wallVerts, baseWallVerts, sizeof(baseWallVerts));
INT32 blendmode;
if (spr->mobj->frame & FF_BLENDMASK)
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
if (sprmo->frame & FF_BLENDMASK)
blendmode = ((sprmo->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
else
blendmode = spr->mobj->blendmode;
blendmode = sprmo->blendmode;
if (UNLIKELY(!cv_translucency.value)) // translucency disabled
{
Surf.PolyColor.s.alpha = 0xFF;
blend = PF_Translucent|PF_Occlude;
}
else if (spr->mobj->flags2 & MF2_SHADOW)
else if (sprmo->flags2 & MF2_SHADOW)
{
Surf.PolyColor.s.alpha = 0x40;
blend = HWR_GetBlendModeFlag(blendmode);
}
else if (spr->mobj->frame & FF_TRANSMASK)
else if (sprmo->frame & FF_TRANSMASK)
{
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
INT32 trans = (sprmo->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
}
else
@@ -3759,8 +3739,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
}
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
if (cv_playerfade.value && sprmo->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(sprmo), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
@@ -3774,14 +3754,13 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
lightlevel = *list[sector->numlights - 1].lightlevel;
colormap = list[sector->numlights - 1].extra_colormap;
i = 0;
temp = FloatToFixed(realtop);
lightset = HWR_OverrideObjectLightLevel(spr->mobj, &lightlevel);
lightset = HWR_OverrideObjectLightLevel(sprmo, &lightlevel);
for (i = 1; i < sector->numlights; i++)
{
const fixed_t h = P_GetLightZAt(&sector->lightlist[i], spr->mobj->x, spr->mobj->y);
const fixed_t h = P_GetLightZAt(&sector->lightlist[i], sprmo->x, sprmo->y);
if (!(h <= temp))
continue;
@@ -3845,7 +3824,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
wallVerts[1].y = endbot;
// The x and y only need to be adjusted in the case that it's not a papersprite
if (cv_glspritebillboarding.value && spr->mobj && !papersprite)
if (cv_glspritebillboarding.value && sprmo && !papersprite)
{
// Get the x and z of the vertices so billboarding draws correctly
realheight = realbot - realtop;
@@ -3867,7 +3846,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
}
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !(spr->mobj->frame & FF_FULLBRIGHT));
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !(sprmo->frame & FF_FULLBRIGHT));
Surf.PolyColor.s.alpha = alpha;
@@ -3916,9 +3895,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
INT32 shader = SHADER_NONE;
const mobj_t *sprmo = spr->mobj;
mobj_t *sprmo = spr->mobj;
if (UNLIKELY(!sprmo || !sprmo->subsector))
if (UNLIKELY(!sprmo->subsector))
return;
const boolean papersprite = (sprmo->frame & FF_PAPERSPRITE);
@@ -4007,9 +3986,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
// colormap test
INT32 lightlevel = 255;
const boolean lightset = HWR_OverrideObjectLightLevel(spr->mobj, &lightlevel);
const boolean lightset = HWR_OverrideObjectLightLevel(sprmo, &lightlevel);
extracolormap_t *colormap = sector->extra_colormap;
const boolean fullbright = R_ThingIsFullBright(spr->mobj);
const boolean fullbright = R_ThingIsFullBright(sprmo);
if (!lightset)
{
@@ -4051,7 +4030,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
}
if (cv_playerfade.value && sprmo->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(sprmo), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
@@ -4189,9 +4168,9 @@ static int CompareVisSprites(const void *p1, const void *p2)
idiff = transparency1 - transparency2;
if (idiff != 0) return idiff;
fdiff = spr2->tz - spr1->tz;// this order seems correct when checking with apitrace. Back to front.
fdiff = spr2->tz - spr1->tz; // this order seems correct when checking with apitrace. Back to front.
if (fabsf(fdiff) < 1.0E-36f)
return spr1->dispoffset - spr2->dispoffset;// smallest dispoffset first if sprites are at (almost) same location.
return spr1->dispoffset - spr2->dispoffset; // smallest dispoffset first if sprites are at (almost) same location.
else if (fdiff > 0)
return 1;
else
@@ -4509,42 +4488,44 @@ static void HWR_DrawSprites(void)
HWR_DrawPrecipitationSprite(spr);
continue;
}
if constexpr (Type == DrawSpritesType::kModels)
else if (spr->mobj)
{
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
if constexpr (Type == DrawSpritesType::kModels)
{
md2_t *md2;
if (spr->mobj->localskin)
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{
if (spr->mobj->skinlocal)
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
md2_t *md2;
if (spr->mobj->localskin)
{
if (spr->mobj->skinlocal)
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
else
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
}
else
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
}
else
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
{
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
}
}
else
if constexpr (Type == DrawSpritesType::kSprites)
{
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
HWR_DrawSprite(spr);
else
HWR_DrawMD2(spr);
HWR_DrawSprite(spr);
}
}
if constexpr (Type == DrawSpritesType::kSprites)
{
HWR_DrawSprite(spr);
}
}
}
}
@@ -4675,6 +4656,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
#ifdef ROTSPRITE
spriteinfo_t *sprinfo;
#endif
skin_t *sprskin = NULL;
size_t lumpoff;
unsigned rot;
UINT8 flip;
@@ -4747,12 +4729,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
rot = (thing->frame & FF_FRAMEMASK);
sprskin = K_GetMobjSkin(thing);
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
if ((thing->skin || thing->localskin) && thing->sprite == SPR_PLAY)
if (sprskin && thing->sprite == SPR_PLAY)
{
sprdef = &K_GetMobjSkin(thing)->spritedef;
sprdef = &sprskin->spritedef;
#ifdef ROTSPRITE
sprinfo = &K_GetMobjSkin(thing)->sprinfo;
sprinfo = &sprskin->sprinfo;
#endif
}
else
@@ -4837,8 +4821,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
flip ^= (1<<rot);
}
if ((thing->skin || thing->localskin) && K_GetMobjSkin(thing)->flags & SF_HIRES)
this_scale *= FixedToFloat(K_GetMobjSkin(thing)->highresscale);
if (sprskin && (sprskin->flags & SF_HIRES))
this_scale *= FixedToFloat(sprskin->highresscale);
spr_width = spritecachedinfo[lumpoff].width;
spr_height = spritecachedinfo[lumpoff].height;
@@ -5260,8 +5244,6 @@ void HWR_BuildSkyDome(void)
sky->loops[sky->loopcount].use_texture = false;
sky->loopcount++;
delta = 0.0f;
for (c = 0; c < col_count; c++)
{
HWR_SkyDomeVertex(sky, vertex_p, 1, c, yflip, 0.0f, true);
+1 -2
View File
@@ -101,8 +101,7 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height);
void HWR_DrawViewBorder(INT32 clearlines);
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);
UINT8 *HWR_GetScreenshot(void);
boolean HWR_Screenshot(const char *lbmname);
UINT8 *HWR_GetScreenshot(INT32 scale);
// hw_main.c
void HWR_SetViewSize(void);
+2 -26
View File
@@ -47,11 +47,9 @@
#include "../v_video.h"
#ifdef HAVE_PNG
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
@@ -703,7 +701,6 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
UINT8 colorbrightnesses[17];
UINT8 color_match_lookup[256]; // optimization attempt
blendcolor = palette[0]; // initialize
memset(translation, 0, sizeof(translation));
memset(cutoff, 0, sizeof(cutoff));
@@ -904,25 +901,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
continue;
}
firsti = 0;
mul = 0;
mulmax = 1;
/*for (i = 0; i < translen; i++)
{
if (brightness > colorbrightnesses[i]) // don't allow greater matches (because calculating a makeshift gradient for this is already a huge mess as is)
continue;
compare = abs((INT16)(colorbrightnesses[i]) - (INT16)(brightness));
if (compare < brightdif)
{
brightdif = (UINT16)compare;
firsti = i; // best matching color that's equal brightness or darker
}
}*/
firsti = color_match_lookup[brightness];
secondi = firsti+1; // next color in line
m = (INT16)brightness - (INT16)colorbrightnesses[secondi];
@@ -987,7 +966,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
UINT32 tempcolor;
UINT16 colorbright;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
SETBRIGHTNESS(colorbright, blendcolor.s.red, blendcolor.s.green, blendcolor.s.blue);
if (colorbright == 0)
colorbright = 1; // no dividing by 0 please
@@ -1128,10 +1107,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
FTransform p;
FSurfaceInfo Surf;
if (!cv_glmdls.value)
return;
if (spr->precip)
if (!cv_glmdls.value || spr->precip)
return;
memset(&p, 0x00, sizeof(FTransform));
-4
View File
@@ -22,10 +22,6 @@ extern "C" {
#include "hw_glob.h"
#include "hw_model.h"
#if defined(_MSC_VER)
#pragma pack()
#endif
typedef struct
{
char filename[32];
File diff suppressed because it is too large. Load diff
+3 -12
View File
@@ -27,16 +27,8 @@ extern "C" {
#ifdef HAVE_SDL
#define _MATH_DEFINES_DEFINED
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#include "SDL_opengl.h" //Alam_GBC: Simple, yes?
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#else
#include <GL/gl.h>
@@ -72,6 +64,8 @@ extern FILE *gllogstream;
FUNCPRINTF void GL_DBG_Printf(const char *format, ...);
extern boolean supportstencil;
void *GetGLFunc(const char *proc);
boolean SetupGLfunc(void);
void SetupGLFunc4(void);
@@ -110,10 +104,7 @@ extern PFNglGetString pglGetString;
void GL_Framebuffer_Unbind(void);
void GL_Framebuffer_Enable(void);
void GL_Framebuffer_Disable(void);
extern GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
extern GLboolean FrameBufferEnabled, RenderToFramebuffer;
extern boolean supportFBO;
extern int supportFBO;
#endif
// ==========================================================================
+39 -18
View File
@@ -16,6 +16,7 @@ Documentation available here.
#ifdef HAVE_CURL
#include <curl/curl.h>
#include "m_curl.h"
#endif
#include "doomdef.h"
@@ -71,7 +72,8 @@ struct HMS_buffer
CURL *curl;
char *buffer;
int needle;
int end;
int end;
char *errbuf;
};
static void
@@ -143,6 +145,7 @@ HMS_connect (const char *format, ...)
size_t seek;
size_t token_length;
struct HMS_buffer *buffer;
CURLcode cc;
if (! hms_started)
{
@@ -186,9 +189,7 @@ HMS_connect (const char *format, ...)
seek = strlen(hms_api) + 1;/* + '/' */
va_start (ap, format);
url = malloc(seek + vsnprintf(0, 0, format, ap) +
sizeof HMS_QUERY_VERSION - 1 +
token_length + 1);
url = malloc(seek + vsnprintf(0, 0, format, ap) + sizeof HMS_QUERY_VERSION - 1 + token_length + 1);
va_end (ap);
sprintf(url, "%s/", hms_api);
@@ -214,29 +215,51 @@ HMS_connect (const char *format, ...)
buffer->end = DEFAULT_BUFFER_SIZE;
buffer->buffer = malloc(buffer->end);
buffer->needle = 0;
buffer->errbuf = malloc(CURL_ERROR_SIZE);
buffer->errbuf[0] = 0x00;
cc = curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer->errbuf);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
if (cv_masterserver_debug.value == 2)
{
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_STDERR, logstream);
cc = curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
cc = curl_easy_setopt(curl, CURLOPT_STDERR, logstream);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
}
if (M_CheckParm("-bindaddr") && M_IsNextParm())
{
curl_easy_setopt(curl, CURLOPT_INTERFACE, M_GetNextParm());
cc = curl_easy_setopt(curl, CURLOPT_INTERFACE, M_GetNextParm());
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
}
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
cc = curl_easy_setopt(curl, CURLOPT_URL, url);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
cc = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
#ifdef HAVE_IPV6
if (!M_CheckParm("-ipv6"))
#endif
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
{
cc = curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
}
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
cc = curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
cc = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
cc = curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
M_SetCURLArgs(curl, buffer->errbuf);
curl_free(quack_token);
free(url);
@@ -257,16 +280,14 @@ HMS_do (struct HMS_buffer *buffer)
if (cc != CURLE_OK)
{
Contact_error();
Blame(
"From curl_easy_perform: %s\n",
curl_easy_strerror(cc)
);
Blame("From curl_easy_perform: %s\n", buffer->errbuf);
return 0;
}
buffer->buffer[buffer->needle] = '\0';
curl_easy_getinfo(buffer->curl, CURLINFO_RESPONSE_CODE, &status);
cc = curl_easy_getinfo(buffer->curl, CURLINFO_RESPONSE_CODE, &status);
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
if (status != 200)
{
+20 -47
View File
@@ -275,14 +275,12 @@ static INT32 cechoflags = 0;
static tic_t resynch_ticker = 0;
#ifndef NONET
// just after
static void Command_Say_f(void);
static void Command_Sayto_f(void);
static void Command_Sayteam_f(void);
static void Command_CSay_f(void);
static void Got_Saycmd(UINT8 **p, INT32 playernum);
#endif
void HU_LoadGraphics(void)
{
@@ -399,13 +397,11 @@ void HU_LoadGraphics(void)
//
void HU_Init(void)
{
#ifndef NONET
COM_AddCommand("say", Command_Say_f);
COM_AddCommand("sayto", Command_Sayto_f);
COM_AddCommand("sayteam", Command_Sayteam_f);
COM_AddCommand("csay", Command_CSay_f);
RegisterNetXCmd(XD_SAY, Got_Saycmd);
#endif
// set shift translation table
shiftxform = english_shiftxform;
@@ -442,8 +438,6 @@ void HU_Shiftform(void)
// EXECUTION
//======================================================================
#ifndef NONET
// EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM
static void Chatlogsize_OnChange(void);
@@ -522,11 +516,9 @@ static void Chatlogsize_OnChange(void)
#undef reallocarray
chat_nummsg_log = min(chat_nummsg_log, (UINT32)cv_chatlogsize.value);
}
#endif
void HU_AddChatText(const char *text, boolean playsound)
{
#ifndef NONET
if (playsound && cv_consolechat.value != 2) // Don't play the sound if we're using hidden chat.
S_StartSound(NULL, sfx_radio);
// reguardless of our preferences, put all of this in the chat buffer in case we decide to change from oldchat mid-game.
@@ -559,14 +551,8 @@ void HU_AddChatText(const char *text, boolean playsound)
CON_LogMessage(text);
CON_LogMessage("\n"); // Add newline. Don't use va for that, since `text` might be refering to va's buffer itself
}
#else
(void)playsound;
CONS_Printf("%s\n", text);
#endif
}
#ifndef NONET
/** Runs a say command, sending an ::XD_SAY message.
* A say command consists of a signed 8-bit integer for the target, an
* unsigned 8-bit flag variable, and then the message itself.
@@ -1002,7 +988,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|| target == 0 // To everyone
|| consoleplayer == target-1) // To you
{
const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
const char *prefix, *cstart, *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
char *tempchar = NULL;
// player is a spectator?
@@ -1026,9 +1012,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
}
else
{
const UINT8 color = players[playernum].skincolor;
cstart = HU_SkinColorToConsoleColor(color);
cstart = HU_SkinColorToConsoleColor(players[playernum].skincolor);
}
prefix = cstart;
@@ -1054,13 +1038,13 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// name, color end, and the message itself.
// '\4' makes the message yellow and beeps; '\3' just beeps.
if (action)
fmt2 = "* %s%s%s%s \x82%s%s";
fmt2 = "* %s%s%s %s%s";
else if (target-1 == consoleplayer) // To you
{
prefix = "\x82[PM]";
cstart = "\x82";
textcolor = "\x82";
fmt2 = "%s<%s%s>%s\x80 %s%s";
fmt2 = "%s<%s%s> %s%s";
}
else if (target > 0) // By you, to another player
{
@@ -1068,13 +1052,13 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
dispname = player_names[target-1];
prefix = "\x82[TO]";
cstart = "\x82";
fmt2 = "%s<%s%s>%s\x80 %s%s";
fmt2 = "%s<%s%s> %s%s";
}
else // To everyone or sayteam, it doesn't change anything.
fmt2 = "%s<%s%s%s>\x80 %s%s";
fmt2 = "%s<%s%s> %s%s";
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg), cv_chatnotifications.value); // add to chat
HU_AddChatText(va(fmt2, prefix, cstart, dispname, textcolor, msg), cv_chatnotifications.value); // add to chat
if (tempchar)
Z_Free(tempchar);
@@ -1089,8 +1073,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
#endif
}
#endif
//
//
void HU_Ticker(void)
@@ -1148,8 +1130,6 @@ void HU_Ticker(void)
HU_TickSongCredits();
}
#ifndef NONET
static boolean teamtalk = false;
/*static char chatchars[QUEUESIZE];
static INT32 head = 0, tail = 0;*/
@@ -1234,8 +1214,8 @@ static void HU_SendChatMessage(void)
if (len > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
{
INT32 spc = 1; // used if nodenum[1] is a space.
char *nodenum = (char*) malloc(3);
const char *newmsg;
CLEANUP(pfree) char *nodenum = (char*) malloc(3);
// what we're gonna do now is check if the node exists
// with that logic, characters 4 and 5 are our numbers:
@@ -1260,7 +1240,6 @@ static void HU_SendChatMessage(void)
else
{
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
free(nodenum);
return;
}
}
@@ -1270,13 +1249,11 @@ static void HU_SendChatMessage(void)
if (msg[5] != ' ')
{
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
free(nodenum);
return;
}
}
target = atoi((const char*) nodenum); // turn that into a number
free(nodenum);
//CONS_Printf("%d\n", target);
// check for target player, if it doesn't exist then we can't send the message!
@@ -1292,6 +1269,7 @@ static void HU_SendChatMessage(void)
newmsg = msg+5+spc;
strlcpy(msg, newmsg, HU_MAXMSGLEN + 1);
}
if (ci > 3) // don't send target+flags+empty message.
{
if (teamtalk)
@@ -1303,20 +1281,18 @@ static void HU_SendChatMessage(void)
SendNetXCmd(XD_SAY, buf, 2 + strlen(&buf[2]) + 1);
}
}
#endif
void HU_clearChatChars(void)
{
M_TextInputClear(&w_chat);
chat_on = false;
I_SetTextInput(false);
}
#ifndef NONET
static boolean justscrolleddown;
static boolean justscrolledup;
static INT16 typelines = 1; // number of drawfill lines we need when drawing the chat. it's some weird hack and might be one frame off but I'm lazy to make another loop.
// It's up here since it has to be reset when we open the chat.
#endif
//
// Returns true if key eaten
@@ -1348,7 +1324,6 @@ boolean HU_Responder(event_t *ev)
return false;
}
#ifndef NONET
if (!chat_on)
{
// enter chat mode
@@ -1361,6 +1336,7 @@ boolean HU_Responder(event_t *ev)
teamtalk = false;
chat_scrollmedown = true;
typelines = 1;
I_SetTextInput(true);
return true;
}
if ((ev->data1 == gamecontrol[0][gc_teamkey][0] || ev->data1 == gamecontrol[0][gc_teamkey][1])
@@ -1372,6 +1348,7 @@ boolean HU_Responder(event_t *ev)
teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams.
chat_scrollmedown = true;
typelines = 1;
I_SetTextInput(true);
return true;
}
}
@@ -1399,6 +1376,7 @@ boolean HU_Responder(event_t *ev)
{
chat_on = false;
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
I_SetTextInput(false);
HU_SendChatMessage();
}
else if (c == KEY_ESCAPE
@@ -1407,6 +1385,7 @@ boolean HU_Responder(event_t *ev)
&& c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle.
{
chat_on = false;
I_SetTextInput(false);
}
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
{
@@ -1422,7 +1401,6 @@ boolean HU_Responder(event_t *ev)
}
return true;
}
#endif
return false;
}
@@ -1431,8 +1409,6 @@ boolean HU_Responder(event_t *ev)
// HEADS UP DRAWING
//======================================================================
#ifndef NONET
#define HU_DrawEmote(x, y, emote, flags) M_DrawEmote((x), (y), (emote), hu_emoteanim, (flags))
// Precompile a wordwrapped string to any given width.
@@ -2114,7 +2090,6 @@ static void HU_DrawChat_Old(void)
}
}
}
#endif
static void HU_DrawCEcho(void)
{
@@ -2278,10 +2253,10 @@ static void HU_DrawSongCreditsBox(void)
INT32 strwidth = V_SmallStringWidth(str, V_ALLOWLOWERCASE) + 4;
// dup dup dup dup
INT32 dup = min(vid.dupx, vid.dupy);
INT32 dup = vid.dup;
// Center it
INT32 x = (BASEVIDWIDTH/2 - strwidth/2)*dup + ((vid.width - (BASEVIDWIDTH * vid.dupx)) / 2);
INT32 x = (BASEVIDWIDTH/2 - strwidth/2)*dup + ((vid.width - (BASEVIDWIDTH * dup)) / 2);
INT32 y = 0;
INT32 flags = V_SNAPTOTOP|V_NOSCALESTART;
@@ -2341,7 +2316,6 @@ void HU_Drawer(void)
if (cv_vhseffect.value && ((paused && !camera[R_GetViewNumber()].freecam) || (demo.playback && cv_playbackspeed.value > 1)))
V_DrawVhsEffect(demo.rewinding);
#ifndef NONET
// draw chat string plus cursor
if (chat_on)
{
@@ -2358,7 +2332,6 @@ void HU_Drawer(void)
if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
HU_drawMiniChat(); // draw messages in a cool fashion.
}
#endif
if (cechotimer)
HU_DrawCEcho();
@@ -2667,14 +2640,14 @@ static inline void HU_DrawSpectatorTicker(void)
INT32 i;
INT32 length = 0, height = 174;
INT32 totallength = 0, templength = -8;
INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2;
INT32 duptweak = (vid.scaledwidth - BASEVIDWIDTH)/2;
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].spectator)
totallength += (signed)strlen(player_names[i]) * 8 + 16;
length -= (leveltime % (totallength + dupadjust+8));
length += dupadjust;
length -= (leveltime % (totallength + vid.scaledwidth+8));
length += vid.scaledwidth;
for (i = 0; i < MAXPLAYERS; i++)
{
@@ -2742,7 +2715,7 @@ static inline void HU_DrawSpectatorTicker(void)
}
}
if ((length += len) >= dupadjust+8)
if ((length += len) >= vid.scaledwidth+8)
break;
}
}
-4
View File
@@ -43,11 +43,7 @@
#ifndef I_getaddrinfo
#if !defined (_MSC_VER) || (_MSC_VER >= 1800) // MSVC 2013 and forward
#include <stdbool.h>
#else
typedef char bool;
#endif
#ifdef _WIN32
// it seems windows doesn't define that... maybe some other OS? OS/2
Loaded 100 of 176 files, more files were not shown because too many files have changed in this diff. Show more