[arch-commits] Commit in assaultcube/repos/community-x86_64 (12 files)
Sven-Hendrik Haase
svenstaro at archlinux.org
Sat Jan 25 04:34:56 UTC 2020
Date: Saturday, January 25, 2020 @ 04:34:55
Author: svenstaro
Revision: 555391
archrelease: copy trunk to community-x86_64
Added:
assaultcube/repos/community-x86_64/PKGBUILD
(from rev 555390, assaultcube/trunk/PKGBUILD)
assaultcube/repos/community-x86_64/assaultcube
(from rev 555390, assaultcube/trunk/assaultcube)
assaultcube/repos/community-x86_64/assaultcube-gcc6.patch
(from rev 555390, assaultcube/trunk/assaultcube-gcc6.patch)
assaultcube/repos/community-x86_64/assaultcube-server
(from rev 555390, assaultcube/trunk/assaultcube-server)
assaultcube/repos/community-x86_64/assaultcube.desktop
(from rev 555390, assaultcube/trunk/assaultcube.desktop)
assaultcube/repos/community-x86_64/assaultcube.png
(from rev 555390, assaultcube/trunk/assaultcube.png)
Deleted:
assaultcube/repos/community-x86_64/PKGBUILD
assaultcube/repos/community-x86_64/assaultcube
assaultcube/repos/community-x86_64/assaultcube-gcc6.patch
assaultcube/repos/community-x86_64/assaultcube-server
assaultcube/repos/community-x86_64/assaultcube.desktop
assaultcube/repos/community-x86_64/assaultcube.png
------------------------+
PKGBUILD | 114 ++++----
assaultcube | 8
assaultcube-gcc6.patch | 602 +++++++++++++++++++++++------------------------
assaultcube-server | 8
assaultcube.desktop | 24 -
5 files changed, 378 insertions(+), 378 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2020-01-25 04:34:46 UTC (rev 555390)
+++ PKGBUILD 2020-01-25 04:34:55 UTC (rev 555391)
@@ -1,57 +0,0 @@
-# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
-# Contributor: Jaroslaw Swierczynski <swiergot at aur.archlinux.org>
-# Contributor: Roman Kyrylych <Roman.Kyrylych at gmail.com>
-# Contributor: Rabyte <rabyte [at] gmail (dot) com>
-
-pkgname=assaultcube
-pkgver=1.2.0.2
-pkgrel=4
-pkgdesc='A realistic team oriented multiplayer FPS based on the Cube engine'
-arch=('x86_64')
-url='http://assault.cubers.net/'
-license=('ZLIB' 'custom')
-depends=('sdl' 'sdl_mixer' 'sdl_image' 'openal' 'zlib' 'gcc-libs' 'libgl' 'glu' 'curl')
-makedepends=('mesa' 'clang')
-source=("https://downloads.sourceforge.net/actiongame/AssaultCube_v${pkgver}.tar.bz2"
- "https://downloads.sourceforge.net/actiongame/AssaultCube_v${pkgver}.source.tar.bz2"
- assaultcube-gcc6.patch
- 'assaultcube'
- 'assaultcube-server'
- 'assaultcube.desktop'
- 'assaultcube.png')
-md5sums=('a052fc79dca4ecae0f15d9a953f1e2ad'
- '7ec6c6a5f8fc0c2e3bec886c08f3b8c8'
- 'c34e35b8b80e557ab09850cc084e8a54'
- 'd658ad3ee476bfe92afa5b5a04a7b4f5'
- '553e2c3b38c4d13e5d77c23efd51a6a6'
- 'a37dfbe8263f4ef8fe41120196194eae'
- 'f688c59ecee2ebc5c589720aa1480765')
-
-prepare() {
- cd AssaultCube_v${pkgver}.source
- # Fix build with GCC 6
- patch -p1 -i ../assaultcube-gcc6.patch
-}
-
-build() {
- cd AssaultCube_v${pkgver}.source/source/src
-
- make
-}
-
-package() {
- cd AssaultCube_v${pkgver}.source/source/src
- install -Dm755 ac_client ${pkgdir}/usr/bin/ac_client
- install -Dm755 ac_server ${pkgdir}/usr/bin/ac_server
-
- cd ${srcdir}/AssaultCube_v${pkgver}
- mkdir -p ${pkgdir}/usr/share/assaultcube
- cp -rf config packages docs mods ${pkgdir}/usr/share/assaultcube
- install -Dm644 ${srcdir}/assaultcube.png ${pkgdir}/usr/share/pixmaps/assaultcube.png
- install -Dm644 ${srcdir}/assaultcube.desktop ${pkgdir}/usr/share/applications/assaultcube.desktop
- install -Dm644 docs/package_copyrights.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
- install -Dm755 ${srcdir}/assaultcube ${pkgdir}/usr/bin/assaultcube
- install -Dm755 ${srcdir}/assaultcube-server ${pkgdir}/usr/bin/assaultcube-server
-}
-
-# vim: sw=2:ts=2 et:
Copied: assaultcube/repos/community-x86_64/PKGBUILD (from rev 555390, assaultcube/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2020-01-25 04:34:55 UTC (rev 555391)
@@ -0,0 +1,57 @@
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Jaroslaw Swierczynski <swiergot at aur.archlinux.org>
+# Contributor: Roman Kyrylych <Roman.Kyrylych at gmail.com>
+# Contributor: Rabyte <rabyte [at] gmail (dot) com>
+
+pkgname=assaultcube
+pkgver=1.2.0.2
+pkgrel=5
+pkgdesc='A realistic team oriented multiplayer FPS based on the Cube engine'
+arch=('x86_64')
+url='http://assault.cubers.net/'
+license=('ZLIB' 'custom')
+depends=('sdl' 'sdl_mixer' 'sdl_image' 'openal' 'zlib' 'gcc-libs' 'libgl' 'glu' 'curl')
+makedepends=('mesa' 'clang')
+source=("https://downloads.sourceforge.net/actiongame/AssaultCube_v${pkgver}.tar.bz2"
+ "https://downloads.sourceforge.net/actiongame/AssaultCube_v${pkgver}.source.tar.bz2"
+ assaultcube-gcc6.patch
+ 'assaultcube'
+ 'assaultcube-server'
+ 'assaultcube.desktop'
+ 'assaultcube.png')
+sha512sums=('9563970403578c946ce03561621e2ea203604e3c3d9d1d784b62122a7f65eaa2e238ac4b88052336a0f18171da0e94342bf3d73f732bceb86eb58a6111e70d7b'
+ '4f7748e9d4c2496de6f82552af3e1a9fe764a3fcb045e0b92653dc359e070bf78349a7763c3293ee9aea4afb112a0f303768e85ed6346262366030dedd2a64ed'
+ '94cf3a73340dbdaefceaeefe83f2ca39635b80eb11cd01c48581c258e5b1dc55f0736ddc9cde4c1a3856bf5649a9fbaa5da417e15fc8f83ec1d65771fc71bf5d'
+ '0f2e8d21b54132e8bd37dc45be9aa4660b25185fbde9b4cc6ea21b1ac75dfefb5e6667a8169e252df473f86a5bd8246f08b32a64f022d5c4c5d9f2aa6fbc0d74'
+ '20e712142f89f4c57f4e1424410d941ed6196c2904f68f04a86c7c4cdd425d541e44b216fd9dff20a6d4738fab0a2c7ed67fd59e63280cd7a007c3873d58086c'
+ '208a62d7c2cf0522920a7982b1513a4b0c786b24a7693ca1d924b8ce60aa505c1d48ddb81325a4e64530170a268c6161e71c40476b6385453a952b6fe8b0a84c'
+ '08f27ad80380eda0e83746c0a5689a792bafd2d215213b7486bb52a43612c41d2f3ab0d84a8bb0c37247ff9a6739663a7f485a7f47026d3bbf47bd50b90225b3')
+
+prepare() {
+ cd AssaultCube_v${pkgver}.source
+ # Fix build with GCC 6
+ patch -p1 -i ../assaultcube-gcc6.patch
+}
+
+build() {
+ cd AssaultCube_v${pkgver}.source/source/src
+
+ make
+}
+
+package() {
+ cd AssaultCube_v${pkgver}.source/source/src
+ install -Dm755 ac_client "${pkgdir}"/usr/bin/ac_client
+ install -Dm755 ac_server "${pkgdir}"/usr/bin/ac_server
+
+ cd "${srcdir}"/AssaultCube_v${pkgver}
+ mkdir -p "${pkgdir}"/usr/share/assaultcube
+ cp -rf config packages docs mods "${pkgdir}"/usr/share/assaultcube
+ install -Dm644 "${srcdir}"/assaultcube.png "${pkgdir}"/usr/share/pixmaps/assaultcube.png
+ install -Dm644 "${srcdir}"/assaultcube.desktop "${pkgdir}"/usr/share/applications/assaultcube.desktop
+ install -Dm644 docs/package_copyrights.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+ install -Dm755 "${srcdir}"/assaultcube "${pkgdir}"/usr/bin/assaultcube
+ install -Dm755 "${srcdir}"/assaultcube-server "${pkgdir}"/usr/bin/assaultcube-server
+}
+
+# vim: sw=2:ts=2 et:
Deleted: assaultcube
===================================================================
--- assaultcube 2020-01-25 04:34:46 UTC (rev 555390)
+++ assaultcube 2020-01-25 04:34:55 UTC (rev 555391)
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-cd /usr/share/assaultcube
-ac_client "--home=${HOME}/.assaultcube" "--init=${HOME}/.assaultcube/config/init.cfg" "$@"
Copied: assaultcube/repos/community-x86_64/assaultcube (from rev 555390, assaultcube/trunk/assaultcube)
===================================================================
--- assaultcube (rev 0)
+++ assaultcube 2020-01-25 04:34:55 UTC (rev 555391)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd /usr/share/assaultcube
+ac_client "--home=${HOME}/.assaultcube" "--init=${HOME}/.assaultcube/config/init.cfg" "$@"
Deleted: assaultcube-gcc6.patch
===================================================================
--- assaultcube-gcc6.patch 2020-01-25 04:34:46 UTC (rev 555390)
+++ assaultcube-gcc6.patch 2020-01-25 04:34:55 UTC (rev 555391)
@@ -1,301 +0,0 @@
-From 752950989b4e286459ca9aee3d61a868d7b20fa4 Mon Sep 17 00:00:00 2001
-From: ac-stef <ac_stef at users.sf.net>
-Date: Sat, 27 Feb 2016 21:28:23 +0100
-Subject: [PATCH] fix some errors and warnings for GCC 6
-
-* do not use std::abs() because math.h includes one, that converts ints
- to double. Use own iabs(), which directly uses labs() instead.
-* don't use the word "gamma" as name for variables
-* don't use a homebrew round() function
----
- source/src/bot/bot_waypoint.cpp | 12 ++++++------
- source/src/command.cpp | 2 +-
- source/src/command.h | 1 +
- source/src/crypto.cpp | 2 +-
- source/src/editing.cpp | 6 +++---
- source/src/entity.h | 2 +-
- source/src/main.cpp | 8 ++++----
- source/src/platform.h | 9 +--------
- source/src/protos.h | 3 ++-
- source/src/rendercubes.cpp | 8 ++++----
- source/src/rendertext.cpp | 4 ++--
- source/src/tools.h | 3 +--
- source/src/world.cpp | 6 +++---
- source/src/worldocull.cpp | 2 +-
- source/src/worldrender.cpp | 4 ++--
- 15 files changed, 33 insertions(+), 39 deletions(-)
-
-diff --git a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp
-index 520c686..7b265ef 100644
---- a/source/src/bot/bot_waypoint.cpp
-+++ b/source/src/bot/bot_waypoint.cpp
-@@ -1221,7 +1221,7 @@ void CWaypointClass::CalcCost(node_s *pNode)
- flCost += (1.0f-flFraction)*0.5f;
- }
-
-- if ((abs(a) > 4) || (abs(b) > 4)) continue;
-+ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
-
- vec from = to;
- to.z -= (JUMP_HEIGHT - 1.0f);
-@@ -1249,7 +1249,7 @@ void CWaypointClass::CalcCost(node_s *pNode)
- flCost += (1.0f-flFraction)*0.5f;
- }
-
-- if ((abs(a) > 4) || (abs(b) > 4)) continue;
-+ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
-
- vec from = to;
- to.z -= (JUMP_HEIGHT - 1.0f);
-@@ -1671,12 +1671,12 @@ node_s *CWaypointClass::GetNearestTriggerFloodWP(vec v_origin, float flRange)
- void CWaypointClass::GetNodeIndexes(const vec &v_origin, short *i, short *j)
- {
- // Function code by cheesy and PMB
-- //*i = abs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
-- //*j = abs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
-+ //*i = iabs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
-+ //*j = iabs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
- //*i = (int)((v_origin.x) / ssize * MAX_MAP_GRIDS);
- //*j = (int)((v_origin.y) / ssize * MAX_MAP_GRIDS);
-- *i = abs((int)((v_origin.x) / MAX_MAP_GRIDS));
-- *j = abs((int)((v_origin.y) / MAX_MAP_GRIDS));
-+ *i = iabs((int)((v_origin.x) / MAX_MAP_GRIDS));
-+ *j = iabs((int)((v_origin.y) / MAX_MAP_GRIDS));
-
- if (*i > MAX_MAP_GRIDS - 1)
- *i = MAX_MAP_GRIDS - 1;
-diff --git a/source/src/command.cpp b/source/src/command.cpp
-index 668f3bf..2a5c90d 100644
---- a/source/src/command.cpp
-+++ b/source/src/command.cpp
-@@ -499,7 +499,7 @@ char *executeret(const char *p) // all evaluation hap
- if(lc<=seer_t1.length())
- {
- int dt = seer_t1[seer_index] - seer_t1[lc];
-- if(abs(dt)<2)
-+ if(iabs(dt)<2)
- {
- conoutf("SCRIPT EXECUTION warning [%d:%s]", &p, p);
- seer_t2.add(seer_t1[seer_index]);
-diff --git a/source/src/command.h b/source/src/command.h
-index a3ca68a..2a3de0c 100644
---- a/source/src/command.h
-+++ b/source/src/command.h
-@@ -86,6 +86,7 @@ enum { IEXC_CORE = 0, IEXC_CFG, IEXC_PROMPT, IEXC_MAPCFG, IEXC_MDLCFG, IEXC_NUM
- #define VARNP(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, true)
- #define VARF(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, false)
- #define VARFP(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, true)
-+#define VARNFP(name, global, min, cur, max, body) extern int global; void var_##name() { body; } int global = variable(#name, min, cur, max, &global, var_##name, true)
-
- #define FVARP(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, true)
- #define FVAR(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, false)
-diff --git a/source/src/crypto.cpp b/source/src/crypto.cpp
-index 44041be..0684750 100644
---- a/source/src/crypto.cpp
-+++ b/source/src/crypto.cpp
-@@ -778,7 +778,7 @@ static const char *hashchunktoa(tiger::chunk h) // portable solution instead o
- const char *genpwdhash(const char *name, const char *pwd, int salt)
- {
- static string temp;
-- formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, abs(PROTOCOL_VERSION));
-+ formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, iabs(PROTOCOL_VERSION));
- tiger::hashval hash;
- tiger::hash((uchar *)temp, (int)strlen(temp), hash);
- formatstring(temp)("%s %s %s", hashchunktoa(hash.chunks[0]), hashchunktoa(hash.chunks[1]), hashchunktoa(hash.chunks[2]));
-diff --git a/source/src/editing.cpp b/source/src/editing.cpp
-index 8d5e1ff..745aa98 100644
---- a/source/src/editing.cpp
-+++ b/source/src/editing.cpp
-@@ -137,11 +137,11 @@ void checkselections()
- void makesel(bool isnew)
- {
- block &cursel = sels.last(); //RR 10/12/12 - FIXEME, error checking should happen with "isnew", not here checking if it really is new.
-- if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), abs(lastx-cx)+1, abs(lasty-cy)+1, max(lasth, ch));
-+ if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), iabs(lastx-cx)+1, iabs(lasty-cy)+1, max(lasth, ch));
- else
- {
- cursel.x = min(lastx, cx); cursel.y = min(lasty, cy);
-- cursel.xs = abs(lastx-cx)+1; cursel.ys = abs(lasty-cy)+1;
-+ cursel.xs = iabs(lastx-cx)+1; cursel.ys = iabs(lasty-cy)+1;
- cursel.h = max(lasth, ch);
- correctsel(cursel);
- }
-@@ -849,7 +849,7 @@ void movemap(int xo, int yo, int zo) // move whole map
- }
- if(xo || yo)
- {
-- block b = { max(-xo, 0), max(-yo, 0), ssize - abs(xo), ssize - abs(yo) }, *cp = blockcopy(b);
-+ block b = { max(-xo, 0), max(-yo, 0), ssize - iabs(xo), ssize - iabs(yo) }, *cp = blockcopy(b);
- cp->x = max(xo, 0);
- cp->y = max(yo, 0);
- blockpaste(*cp);
-diff --git a/source/src/entity.h b/source/src/entity.h
-index e2ad32d..84ac385 100644
---- a/source/src/entity.h
-+++ b/source/src/entity.h
-@@ -538,7 +538,7 @@ class playerent : public dynent, public playerstate
- {
- const int maxskin[2] = { 4, 6 };
- t = team_base(t < 0 ? team : t);
-- nextskin[t] = abs(s) % maxskin[t];
-+ nextskin[t] = iabs(s) % maxskin[t];
- }
- };
-
-diff --git a/source/src/main.cpp b/source/src/main.cpp
-index 0d57c0c..c51cd74 100644
---- a/source/src/main.cpp
-+++ b/source/src/main.cpp
-@@ -519,11 +519,11 @@ void setresdata(char *s, enet_uint32 c)
- COMMANDF(screenres, "ii", (int *w, int *h) { screenres(*w, *h); });
-
- static int curgamma = 100;
--VARFP(gamma, 30, 100, 300,
-+VARNFP(gamma, vgamma, 30, 100, 300,
- {
-- if(gamma == curgamma) return;
-- curgamma = gamma;
-- float f = gamma/100.0f;
-+ if(vgamma == curgamma) return;
-+ curgamma = vgamma;
-+ float f = vgamma/100.0f;
- if(SDL_SetGamma(f,f,f)==-1) conoutf("Could not set gamma: %s", SDL_GetError());
- });
-
-diff --git a/source/src/platform.h b/source/src/platform.h
-index aece7e2..fd2eef1 100644
---- a/source/src/platform.h
-+++ b/source/src/platform.h
-@@ -2,14 +2,6 @@
- #ifdef _FORTIFY_SOURCE
- #undef _FORTIFY_SOURCE
- #endif
--
-- #define gamma __gamma
--#endif
--
--#include <math.h>
--
--#ifdef __GNUC__
-- #undef gamma
- #endif
-
- #include <string.h>
-@@ -19,6 +11,7 @@
- #include <ctype.h>
- #include <time.h>
- #include <limits.h>
-+#include <math.h>
- #ifdef __GNUC__
- #include <new>
- #include <signal.h>
-diff --git a/source/src/protos.h b/source/src/protos.h
-index 1c07fad..97b0ee0 100644
---- a/source/src/protos.h
-+++ b/source/src/protos.h
-@@ -1053,7 +1053,8 @@ struct servercommandline
- {
- demo_interm = true;
- }
-- else if(ai > 0) maxdemos = ai; break;
-+ else if(ai > 0) maxdemos = ai;
-+ break;
- }
- case 'W': demopath = a; break;
- case 'r': maprot = a; break;
-diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp
-index 1940da8..2be7fb0 100644
---- a/source/src/rendercubes.cpp
-+++ b/source/src/rendercubes.cpp
-@@ -216,9 +216,9 @@ void render_flat(int wtex, int x, int y, int size, int h, sqr *l1, sqr *l4, sqr
- else // continue strip
- {
- int lighterr = lighterror*2;
-- if((abs(ol1r-l3->r)<lighterr && abs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
-- && abs(ol1g-l3->g)<lighterr && abs(ol2g-l4->g)<lighterr
-- && abs(ol1b-l3->b)<lighterr && abs(ol2b-l4->b)<lighterr) || !wtex)
-+ if((iabs(ol1r-l3->r)<lighterr && iabs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
-+ && iabs(ol1g-l3->g)<lighterr && iabs(ol2g-l4->g)<lighterr
-+ && iabs(ol1b-l3->b)<lighterr && iabs(ol2b-l4->b)<lighterr) || !wtex)
- {
- verts.setsize(verts.length()-2);
- nquads--;
-@@ -375,7 +375,7 @@ void render_square(int wtex, float floor1, float floor2, float ceil1, float ceil
- {
- int lighterr = lighterror*2;
- if((!hf && !ohf)
-- && ((abs(ol1r-l2->r)<lighterr && abs(ol1g-l2->g)<lighterr && abs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
-+ && ((iabs(ol1r-l2->r)<lighterr && iabs(ol1g-l2->g)<lighterr && iabs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
- {
- verts.setsize(verts.length()-2);
- nquads--;
-diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp
-index 0ed23af..b55da4f 100644
---- a/source/src/rendertext.cpp
-+++ b/source/src/rendertext.cpp
-@@ -330,7 +330,7 @@ static void text_color(char c, char *stack, int size, int &sp, bvec color, int a
- if(c=='r') c = stack[(sp > 0) ? --sp : sp]; // restore color
- else if(c == 'b') { if(allowblinkingtext && !ignoreblinkingbit) stack[sp] *= -1; } // blinking text - only if allowed
- else stack[sp] = c;
-- switch(abs(stack[sp]))
-+ switch(iabs(stack[sp]))
- {
- case '0': color = bvec( 2, 255, 128 ); break; // green: player talk
- case '1': color = bvec( 96, 160, 255 ); break; // blue: team chat
-@@ -380,7 +380,7 @@ static void text_color(char c, char *stack, int size, int &sp, bvec color, int a
- //default: color = bvec( 255, 255, 255 ); break;
- }
- int b = (int) (sinf(lastmillis / 200.0f) * 115.0f);
-- b = stack[sp] > 0 ? 100 : min(abs(b), 100);
-+ b = stack[sp] > 0 ? 100 : min(iabs(b), 100);
- glColor4ub(color.x, color.y, color.z, (a * b) / 100);
- }
- }
-diff --git a/source/src/tools.h b/source/src/tools.h
-index 0aeacff..9eb5a38 100644
---- a/source/src/tools.h
-+++ b/source/src/tools.h
-@@ -54,8 +54,7 @@ static inline T min(T a, T b)
- {
- return a < b ? a : b;
- }
--
--static inline float round(float x) { return floor(x + 0.5f); }
-+inline int iabs(int n) { return labs(n); }
-
- #define clamp(a,b,c) (max(b, min(a, c)))
- #define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
-diff --git a/source/src/world.cpp b/source/src/world.cpp
-index 6a1c7bb..99a70eb 100644
---- a/source/src/world.cpp
-+++ b/source/src/world.cpp
-@@ -79,9 +79,9 @@ void remip(const block &b, int level)
- || o[i]->ceil!=o[3]->ceil
- || o[i]->ftex!=o[3]->ftex
- || o[i]->ctex!=o[3]->ctex
-- || abs(o[i+1]->r-o[0]->r)>lighterr // perfect mip even if light is not exactly equal
-- || abs(o[i+1]->g-o[0]->g)>lighterr
-- || abs(o[i+1]->b-o[0]->b)>lighterr
-+ || iabs(o[i+1]->r-o[0]->r)>lighterr // perfect mip even if light is not exactly equal
-+ || iabs(o[i+1]->g-o[0]->g)>lighterr
-+ || iabs(o[i+1]->b-o[0]->b)>lighterr
- || o[i]->utex!=o[3]->utex
- || o[i]->wtex!=o[3]->wtex) goto c;
- }
-diff --git a/source/src/worldrender.cpp b/source/src/worldrender.cpp
-index 8fd3104..45aa606 100644
---- a/source/src/worldrender.cpp
-+++ b/source/src/worldrender.cpp
-@@ -297,10 +297,10 @@ void distlod(int &low, int &high, int angle, float widef)
- void render_world(float vx, float vy, float vh, float changelod, int yaw, int pitch, float fov, float fovy, int w, int h)
- {
- loopi(LARGEST_FACTOR) stats[i] = 0;
-- min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+abs(pitch)/12;
-+ min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+iabs(pitch)/12;
- yaw = 360-yaw;
- float widef = fov/75.0f;
-- int cdist = abs(yaw%90-45);
-+ int cdist = iabs(yaw%90-45);
- if(cdist<7) // hack to avoid popup at high fovs at 45 yaw
- {
- min_lod = max(min_lod, (int)(MIN_LOD+(10-cdist)/1.0f*widef)); // less if lod worked better
Copied: assaultcube/repos/community-x86_64/assaultcube-gcc6.patch (from rev 555390, assaultcube/trunk/assaultcube-gcc6.patch)
===================================================================
--- assaultcube-gcc6.patch (rev 0)
+++ assaultcube-gcc6.patch 2020-01-25 04:34:55 UTC (rev 555391)
@@ -0,0 +1,301 @@
+From 752950989b4e286459ca9aee3d61a868d7b20fa4 Mon Sep 17 00:00:00 2001
+From: ac-stef <ac_stef at users.sf.net>
+Date: Sat, 27 Feb 2016 21:28:23 +0100
+Subject: [PATCH] fix some errors and warnings for GCC 6
+
+* do not use std::abs() because math.h includes one, that converts ints
+ to double. Use own iabs(), which directly uses labs() instead.
+* don't use the word "gamma" as name for variables
+* don't use a homebrew round() function
+---
+ source/src/bot/bot_waypoint.cpp | 12 ++++++------
+ source/src/command.cpp | 2 +-
+ source/src/command.h | 1 +
+ source/src/crypto.cpp | 2 +-
+ source/src/editing.cpp | 6 +++---
+ source/src/entity.h | 2 +-
+ source/src/main.cpp | 8 ++++----
+ source/src/platform.h | 9 +--------
+ source/src/protos.h | 3 ++-
+ source/src/rendercubes.cpp | 8 ++++----
+ source/src/rendertext.cpp | 4 ++--
+ source/src/tools.h | 3 +--
+ source/src/world.cpp | 6 +++---
+ source/src/worldocull.cpp | 2 +-
+ source/src/worldrender.cpp | 4 ++--
+ 15 files changed, 33 insertions(+), 39 deletions(-)
+
+diff --git a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp
+index 520c686..7b265ef 100644
+--- a/source/src/bot/bot_waypoint.cpp
++++ b/source/src/bot/bot_waypoint.cpp
+@@ -1221,7 +1221,7 @@ void CWaypointClass::CalcCost(node_s *pNode)
+ flCost += (1.0f-flFraction)*0.5f;
+ }
+
+- if ((abs(a) > 4) || (abs(b) > 4)) continue;
++ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
+
+ vec from = to;
+ to.z -= (JUMP_HEIGHT - 1.0f);
+@@ -1249,7 +1249,7 @@ void CWaypointClass::CalcCost(node_s *pNode)
+ flCost += (1.0f-flFraction)*0.5f;
+ }
+
+- if ((abs(a) > 4) || (abs(b) > 4)) continue;
++ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
+
+ vec from = to;
+ to.z -= (JUMP_HEIGHT - 1.0f);
+@@ -1671,12 +1671,12 @@ node_s *CWaypointClass::GetNearestTriggerFloodWP(vec v_origin, float flRange)
+ void CWaypointClass::GetNodeIndexes(const vec &v_origin, short *i, short *j)
+ {
+ // Function code by cheesy and PMB
+- //*i = abs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
+- //*j = abs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
++ //*i = iabs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
++ //*j = iabs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
+ //*i = (int)((v_origin.x) / ssize * MAX_MAP_GRIDS);
+ //*j = (int)((v_origin.y) / ssize * MAX_MAP_GRIDS);
+- *i = abs((int)((v_origin.x) / MAX_MAP_GRIDS));
+- *j = abs((int)((v_origin.y) / MAX_MAP_GRIDS));
++ *i = iabs((int)((v_origin.x) / MAX_MAP_GRIDS));
++ *j = iabs((int)((v_origin.y) / MAX_MAP_GRIDS));
+
+ if (*i > MAX_MAP_GRIDS - 1)
+ *i = MAX_MAP_GRIDS - 1;
+diff --git a/source/src/command.cpp b/source/src/command.cpp
+index 668f3bf..2a5c90d 100644
+--- a/source/src/command.cpp
++++ b/source/src/command.cpp
+@@ -499,7 +499,7 @@ char *executeret(const char *p) // all evaluation hap
+ if(lc<=seer_t1.length())
+ {
+ int dt = seer_t1[seer_index] - seer_t1[lc];
+- if(abs(dt)<2)
++ if(iabs(dt)<2)
+ {
+ conoutf("SCRIPT EXECUTION warning [%d:%s]", &p, p);
+ seer_t2.add(seer_t1[seer_index]);
+diff --git a/source/src/command.h b/source/src/command.h
+index a3ca68a..2a3de0c 100644
+--- a/source/src/command.h
++++ b/source/src/command.h
+@@ -86,6 +86,7 @@ enum { IEXC_CORE = 0, IEXC_CFG, IEXC_PROMPT, IEXC_MAPCFG, IEXC_MDLCFG, IEXC_NUM
+ #define VARNP(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, true)
+ #define VARF(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, false)
+ #define VARFP(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, true)
++#define VARNFP(name, global, min, cur, max, body) extern int global; void var_##name() { body; } int global = variable(#name, min, cur, max, &global, var_##name, true)
+
+ #define FVARP(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, true)
+ #define FVAR(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, false)
+diff --git a/source/src/crypto.cpp b/source/src/crypto.cpp
+index 44041be..0684750 100644
+--- a/source/src/crypto.cpp
++++ b/source/src/crypto.cpp
+@@ -778,7 +778,7 @@ static const char *hashchunktoa(tiger::chunk h) // portable solution instead o
+ const char *genpwdhash(const char *name, const char *pwd, int salt)
+ {
+ static string temp;
+- formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, abs(PROTOCOL_VERSION));
++ formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, iabs(PROTOCOL_VERSION));
+ tiger::hashval hash;
+ tiger::hash((uchar *)temp, (int)strlen(temp), hash);
+ formatstring(temp)("%s %s %s", hashchunktoa(hash.chunks[0]), hashchunktoa(hash.chunks[1]), hashchunktoa(hash.chunks[2]));
+diff --git a/source/src/editing.cpp b/source/src/editing.cpp
+index 8d5e1ff..745aa98 100644
+--- a/source/src/editing.cpp
++++ b/source/src/editing.cpp
+@@ -137,11 +137,11 @@ void checkselections()
+ void makesel(bool isnew)
+ {
+ block &cursel = sels.last(); //RR 10/12/12 - FIXEME, error checking should happen with "isnew", not here checking if it really is new.
+- if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), abs(lastx-cx)+1, abs(lasty-cy)+1, max(lasth, ch));
++ if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), iabs(lastx-cx)+1, iabs(lasty-cy)+1, max(lasth, ch));
+ else
+ {
+ cursel.x = min(lastx, cx); cursel.y = min(lasty, cy);
+- cursel.xs = abs(lastx-cx)+1; cursel.ys = abs(lasty-cy)+1;
++ cursel.xs = iabs(lastx-cx)+1; cursel.ys = iabs(lasty-cy)+1;
+ cursel.h = max(lasth, ch);
+ correctsel(cursel);
+ }
+@@ -849,7 +849,7 @@ void movemap(int xo, int yo, int zo) // move whole map
+ }
+ if(xo || yo)
+ {
+- block b = { max(-xo, 0), max(-yo, 0), ssize - abs(xo), ssize - abs(yo) }, *cp = blockcopy(b);
++ block b = { max(-xo, 0), max(-yo, 0), ssize - iabs(xo), ssize - iabs(yo) }, *cp = blockcopy(b);
+ cp->x = max(xo, 0);
+ cp->y = max(yo, 0);
+ blockpaste(*cp);
+diff --git a/source/src/entity.h b/source/src/entity.h
+index e2ad32d..84ac385 100644
+--- a/source/src/entity.h
++++ b/source/src/entity.h
+@@ -538,7 +538,7 @@ class playerent : public dynent, public playerstate
+ {
+ const int maxskin[2] = { 4, 6 };
+ t = team_base(t < 0 ? team : t);
+- nextskin[t] = abs(s) % maxskin[t];
++ nextskin[t] = iabs(s) % maxskin[t];
+ }
+ };
+
+diff --git a/source/src/main.cpp b/source/src/main.cpp
+index 0d57c0c..c51cd74 100644
+--- a/source/src/main.cpp
++++ b/source/src/main.cpp
+@@ -519,11 +519,11 @@ void setresdata(char *s, enet_uint32 c)
+ COMMANDF(screenres, "ii", (int *w, int *h) { screenres(*w, *h); });
+
+ static int curgamma = 100;
+-VARFP(gamma, 30, 100, 300,
++VARNFP(gamma, vgamma, 30, 100, 300,
+ {
+- if(gamma == curgamma) return;
+- curgamma = gamma;
+- float f = gamma/100.0f;
++ if(vgamma == curgamma) return;
++ curgamma = vgamma;
++ float f = vgamma/100.0f;
+ if(SDL_SetGamma(f,f,f)==-1) conoutf("Could not set gamma: %s", SDL_GetError());
+ });
+
+diff --git a/source/src/platform.h b/source/src/platform.h
+index aece7e2..fd2eef1 100644
+--- a/source/src/platform.h
++++ b/source/src/platform.h
+@@ -2,14 +2,6 @@
+ #ifdef _FORTIFY_SOURCE
+ #undef _FORTIFY_SOURCE
+ #endif
+-
+- #define gamma __gamma
+-#endif
+-
+-#include <math.h>
+-
+-#ifdef __GNUC__
+- #undef gamma
+ #endif
+
+ #include <string.h>
+@@ -19,6 +11,7 @@
+ #include <ctype.h>
+ #include <time.h>
+ #include <limits.h>
++#include <math.h>
+ #ifdef __GNUC__
+ #include <new>
+ #include <signal.h>
+diff --git a/source/src/protos.h b/source/src/protos.h
+index 1c07fad..97b0ee0 100644
+--- a/source/src/protos.h
++++ b/source/src/protos.h
+@@ -1053,7 +1053,8 @@ struct servercommandline
+ {
+ demo_interm = true;
+ }
+- else if(ai > 0) maxdemos = ai; break;
++ else if(ai > 0) maxdemos = ai;
++ break;
+ }
+ case 'W': demopath = a; break;
+ case 'r': maprot = a; break;
+diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp
+index 1940da8..2be7fb0 100644
+--- a/source/src/rendercubes.cpp
++++ b/source/src/rendercubes.cpp
+@@ -216,9 +216,9 @@ void render_flat(int wtex, int x, int y, int size, int h, sqr *l1, sqr *l4, sqr
+ else // continue strip
+ {
+ int lighterr = lighterror*2;
+- if((abs(ol1r-l3->r)<lighterr && abs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
+- && abs(ol1g-l3->g)<lighterr && abs(ol2g-l4->g)<lighterr
+- && abs(ol1b-l3->b)<lighterr && abs(ol2b-l4->b)<lighterr) || !wtex)
++ if((iabs(ol1r-l3->r)<lighterr && iabs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
++ && iabs(ol1g-l3->g)<lighterr && iabs(ol2g-l4->g)<lighterr
++ && iabs(ol1b-l3->b)<lighterr && iabs(ol2b-l4->b)<lighterr) || !wtex)
+ {
+ verts.setsize(verts.length()-2);
+ nquads--;
+@@ -375,7 +375,7 @@ void render_square(int wtex, float floor1, float floor2, float ceil1, float ceil
+ {
+ int lighterr = lighterror*2;
+ if((!hf && !ohf)
+- && ((abs(ol1r-l2->r)<lighterr && abs(ol1g-l2->g)<lighterr && abs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
++ && ((iabs(ol1r-l2->r)<lighterr && iabs(ol1g-l2->g)<lighterr && iabs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
+ {
+ verts.setsize(verts.length()-2);
+ nquads--;
+diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp
+index 0ed23af..b55da4f 100644
+--- a/source/src/rendertext.cpp
++++ b/source/src/rendertext.cpp
+@@ -330,7 +330,7 @@ static void text_color(char c, char *stack, int size, int &sp, bvec color, int a
+ if(c=='r') c = stack[(sp > 0) ? --sp : sp]; // restore color
+ else if(c == 'b') { if(allowblinkingtext && !ignoreblinkingbit) stack[sp] *= -1; } // blinking text - only if allowed
+ else stack[sp] = c;
+- switch(abs(stack[sp]))
++ switch(iabs(stack[sp]))
+ {
+ case '0': color = bvec( 2, 255, 128 ); break; // green: player talk
+ case '1': color = bvec( 96, 160, 255 ); break; // blue: team chat
+@@ -380,7 +380,7 @@ static void text_color(char c, char *stack, int size, int &sp, bvec color, int a
+ //default: color = bvec( 255, 255, 255 ); break;
+ }
+ int b = (int) (sinf(lastmillis / 200.0f) * 115.0f);
+- b = stack[sp] > 0 ? 100 : min(abs(b), 100);
++ b = stack[sp] > 0 ? 100 : min(iabs(b), 100);
+ glColor4ub(color.x, color.y, color.z, (a * b) / 100);
+ }
+ }
+diff --git a/source/src/tools.h b/source/src/tools.h
+index 0aeacff..9eb5a38 100644
+--- a/source/src/tools.h
++++ b/source/src/tools.h
+@@ -54,8 +54,7 @@ static inline T min(T a, T b)
+ {
+ return a < b ? a : b;
+ }
+-
+-static inline float round(float x) { return floor(x + 0.5f); }
++inline int iabs(int n) { return labs(n); }
+
+ #define clamp(a,b,c) (max(b, min(a, c)))
+ #define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
+diff --git a/source/src/world.cpp b/source/src/world.cpp
+index 6a1c7bb..99a70eb 100644
+--- a/source/src/world.cpp
++++ b/source/src/world.cpp
+@@ -79,9 +79,9 @@ void remip(const block &b, int level)
+ || o[i]->ceil!=o[3]->ceil
+ || o[i]->ftex!=o[3]->ftex
+ || o[i]->ctex!=o[3]->ctex
+- || abs(o[i+1]->r-o[0]->r)>lighterr // perfect mip even if light is not exactly equal
+- || abs(o[i+1]->g-o[0]->g)>lighterr
+- || abs(o[i+1]->b-o[0]->b)>lighterr
++ || iabs(o[i+1]->r-o[0]->r)>lighterr // perfect mip even if light is not exactly equal
++ || iabs(o[i+1]->g-o[0]->g)>lighterr
++ || iabs(o[i+1]->b-o[0]->b)>lighterr
+ || o[i]->utex!=o[3]->utex
+ || o[i]->wtex!=o[3]->wtex) goto c;
+ }
+diff --git a/source/src/worldrender.cpp b/source/src/worldrender.cpp
+index 8fd3104..45aa606 100644
+--- a/source/src/worldrender.cpp
++++ b/source/src/worldrender.cpp
+@@ -297,10 +297,10 @@ void distlod(int &low, int &high, int angle, float widef)
+ void render_world(float vx, float vy, float vh, float changelod, int yaw, int pitch, float fov, float fovy, int w, int h)
+ {
+ loopi(LARGEST_FACTOR) stats[i] = 0;
+- min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+abs(pitch)/12;
++ min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+iabs(pitch)/12;
+ yaw = 360-yaw;
+ float widef = fov/75.0f;
+- int cdist = abs(yaw%90-45);
++ int cdist = iabs(yaw%90-45);
+ if(cdist<7) // hack to avoid popup at high fovs at 45 yaw
+ {
+ min_lod = max(min_lod, (int)(MIN_LOD+(10-cdist)/1.0f*widef)); // less if lod worked better
Deleted: assaultcube-server
===================================================================
--- assaultcube-server 2020-01-25 04:34:46 UTC (rev 555390)
+++ assaultcube-server 2020-01-25 04:34:55 UTC (rev 555391)
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-cd /usr/share/assaultcube
-ac_server "$@"
Copied: assaultcube/repos/community-x86_64/assaultcube-server (from rev 555390, assaultcube/trunk/assaultcube-server)
===================================================================
--- assaultcube-server (rev 0)
+++ assaultcube-server 2020-01-25 04:34:55 UTC (rev 555391)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd /usr/share/assaultcube
+ac_server "$@"
Deleted: assaultcube.desktop
===================================================================
--- assaultcube.desktop 2020-01-25 04:34:46 UTC (rev 555390)
+++ assaultcube.desktop 2020-01-25 04:34:55 UTC (rev 555391)
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Exec=assaultcube
-Icon=assaultcube
-Type=Application
-Terminal=false
-MultipleArgs=false
-Name=AssaultCube
-GenericName=Realistic Multiplayer FPS
-MimeType=text/html
-StartupNotify=false
-Categories=Game;ActionGame;
Copied: assaultcube/repos/community-x86_64/assaultcube.desktop (from rev 555390, assaultcube/trunk/assaultcube.desktop)
===================================================================
--- assaultcube.desktop (rev 0)
+++ assaultcube.desktop 2020-01-25 04:34:55 UTC (rev 555391)
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Encoding=UTF-8
+Exec=assaultcube
+Icon=assaultcube
+Type=Application
+Terminal=false
+MultipleArgs=false
+Name=AssaultCube
+GenericName=Realistic Multiplayer FPS
+MimeType=text/html
+StartupNotify=false
+Categories=Game;ActionGame;
Deleted: assaultcube.png
===================================================================
(Binary files differ)
Copied: assaultcube/repos/community-x86_64/assaultcube.png (from rev 555390, assaultcube/trunk/assaultcube.png)
===================================================================
(Binary files differ)
More information about the arch-commits
mailing list