Commit Graph
100 Commits
Author SHA1 Message Date
ac-stef 7f9e2b19c9 fix glext command hanging without argument 2016-08-08 19:04:18 +02:00
ac-stef c96a983b65 fix edit selection height while grid is disabled
also: hide cleanshot helper scripts

DOCREF disablehud enablehud
2016-08-07 22:49:08 +02:00
ac-stef 27ebcdfeac fix dbgpos during spectating 2016-08-07 00:47:15 +02:00
ac-stef 6392527cb6 fix ktf indicator during spectating
also, disable ktf indicator during editing and enable damageblend, -roll
and -indicator during spectating

DOCREF ktfindicatoralpha
2016-08-07 00:26:29 +02:00
ac-stef 37ce06cd1c fix score calculation during spectating 2016-08-06 23:39:13 +02:00
ac-stef be4855cdcc show ktf indicator during reload 2016-08-06 00:57:52 +02:00
ac-stef 6b95708718 simpler damage indicator calculation 2016-08-05 16:27:41 +02:00
ac-stef 639067a003 add new ktf flag direction indicator
enabled by default, disable with "hidektfindicator 1"

DOCREF hidektfindicator
2016-08-05 16:26:24 +02:00
ac-stef 192a918844 add settings menu for crosshair effects 2016-08-05 13:33:28 +02:00
ac-stef f36c1661d8 less ugly screenshot type slider code
also: persistent
2016-08-05 01:42:02 +02:00
ac-stef 25d09990c8 fix accidental map changes
thx BrutalSystem
2016-08-04 22:38:02 +02:00
ac-stef ca0a868acd improve damageindicator
* now eight instead of four directions
* ignore self-inflicted damage
2016-08-04 22:01:12 +02:00
ac-stef 2fbbb04b76 move menu background texture to packages/misc
so that altering the menu background does not change maps that use it
as texture

packages/textures/makke/menu.jpg is being kept, because maps use it
2016-08-04 20:59:03 +02:00
ac-stef e9099965c1 fix render bug on ac_outpost
(easier to fix the map than to fix the renderer)

thx BrutalSystem
2016-08-04 20:54:53 +02:00
ac-stef 59d4f4d847 add embedded license information to all official maps
also add script to generate a summary map license file

new (undocumented) debug commands:
  loadmap <mapname>
    loads a map directly, easy to use from scripts

  debugline <filename> <text>
    writes text to file (no path names allowed)
2016-07-30 01:47:30 +02:00
ac-stef 0083c51b3b add menus to assign licenses to maps 2016-07-28 00:35:43 +02:00
ac-stef 611303b890 fix crash on failed write in writemapmodelattributes 2016-07-27 12:24:58 +02:00
ac-stef 3c2cac6121 simplify curmap command
no argument: just return the filename

DOCREF curmap
2016-07-27 12:23:56 +02:00
ac-stef a860cc58b0 add a map license and comment string to the map header
Two new string variables, mapinfo_license and mapinfo_comment, are stored
withing the header of a map file.

The variables are automatically read and written during loading and
saving maps. Default values are empty strings. The comment string is
ignored, as long as no license string is set. The license string is meant
to hold an abbreviated name of the license, picked from a list of
known map licenses.

DOCREF mapinfo_license mapinfo_comment
2016-07-26 15:41:40 +02:00
ac-stef 13ec9d692f strip embedded config files and optimise clip entities
* strip unused mapmodel, texture and sound slots from config files
* clip stair mapmodels with sloped clip entities
* remove double clipping

dev_douze has been replaced by a version from the AC 1.0 era, including
flag bases - but with no team spawns. Corners now utilise higher mips
where possible.

dev_stellar has not been optimised.
2016-07-25 23:06:21 +02:00
ac-stef a807716ecf convert official maps to format 10
* renamed (temporarily) to dev_*
* embedded all config files
* changed as many clip entities to tagged clips as possible

On ac_toxic and ac_venison all other clip entities also have been
optimised. Some bugs and unnecessary quirks on venison have been removed.

* toxic now uses 135 clipped entities (instead of 221)
* venison now uses 115 clipped entities (instead of 393)
2016-07-23 19:13:38 +02:00
ac-stef 112e3ad399 add tagclipped corner extension
new physics for tagclipped corner cubes:

* corners between non-solids: tagclips extend the corner
	 (visualisation does not reflect that, yet)
* corners between solids: fully clipped (like before)
2016-07-23 18:42:15 +02:00
ac-stef 7016cc81c8 fix display bug for texture previews
thx Robtics
2016-07-21 14:04:41 +02:00
ac-stef 5fe69aa4b4 drop cube 1 media package support
Drop support for maps outside packages/maps and for package config files.
(never been used in AC anyway)

also: generate all map related filenames with proper path separators
2016-06-13 23:22:33 +02:00
ac-stef 32ffd3a4cd replace non-thread-safe functions
replace all uses of strtok, localtime, gmtime and readdir

on platforms without safe versions, use homebrew or unsafe...
2016-02-28 23:14:47 +01:00
ac-stef 98d01d1f34 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
2016-02-27 22:50:06 +01:00
ac-stef d107aa3cd6 added mapmodel menus sorted by author and distribution
all generated automatically from mapmodel attributes

also:
* fixed typo in model config
* concatuniq now works fine with spaces
2016-02-13 18:52:18 +01:00
ac-stef 535b9df746 define gamemode bitmasks 2016-02-07 18:34:32 +01:00
ac-stef 665c359907 add resetmenu
Short script to combine "delmenu" and "newmenu" as used in menuinit
scripts.
2016-02-07 18:34:32 +01:00
ac-stef 7f86ae8d9f new command getclosestent
getclosestent
  Returns the entity index number of the closest entity (or of the
  pinned entity, if one exists). Returns -1, if no entities are on the map.
  Returns always exactly the entity, that edit commands like delent
  will use next.

DOCREF getclosestent
2016-02-07 18:34:32 +01:00
ac-stef ecf178866e new command addentity
addentity <type>
  Adds an entity of the specified type at the current camera position
  and returns the index number of the new entity, so that the other
  attributes can be set by editentity.

DOCREF addentity
2016-02-07 18:34:32 +01:00
ac-stef 697197bd5b generalise sorting of lists of integer sets 2016-02-07 18:34:31 +01:00
ac-stef 4da510f51d fix http line recovery
this fixes the reconnect attempt after a http tcp connection was lost
2016-02-07 17:36:03 +01:00
ac-stefandaurhat 1917a07dfa fix flag visibility for htf on maps without bases
- fixes issue #140
- also removed some stale debug code
2015-12-12 22:22:01 +01:00
ac-stef 0e6476806a fix crouching, jumping and doublejumping
* fix the old check for different jump start heights as requirement
  for doublejumps
* better handle multiple binds for the "jump" command
* delay relaxed floorclamping for crouching
* remove some redundant code
2015-09-27 00:28:34 +02:00
ac-stef 196d47d34e limit max speed by consecutive doublejumps
Instead of applying 25% bonus speed with every executed doublejump (with
potentially unlimited top speed), limit the reachable max speed to 125%
of regular full speed.

This limits regular gameplay only marginally but removes a lot of cheat
potential.
2015-09-26 15:32:27 +02:00
ac-stef d75409a29c fix ladder physics
When both "forward" and "backward" keys are pressed, now the action
matches the last pressed one. Now the keys work on the ladder exactly
as with regular movement.
2015-09-26 11:34:47 +02:00
ac-stef 5006663d19 update VC project file
and add workaround for missing C99 type uint64_t in VC2008
2015-09-24 23:17:50 +02:00
ac-stef 917df65a51 remove all instances of round()
VS2008 doesn't have round() in math.h and the old inline function (removed
in 50d1413d, had problems in newer compilers). Now floor() or straight
casting to int is used. Let's see, which MS compiler will trip on that...
2015-09-24 19:51:50 +02:00
ac-stef 6571c8b012 new menu to configure package server priorities 2015-09-17 19:14:30 +02:00
ac-stef 16565a2e05 allow package servers to be disabled or deleted
This is coded into the priority of a server:
* a priority of -1000 or lower marks a server as disabled
* a priority of -10000 or lower excludes a server from being saved to
  pcksources.cfg at program end, so a game restart will delete the server
  from the list
2015-09-17 16:41:05 +02:00
ac-stef 12a05d41e9 add interface for timedwait on semaphores
According to SDL documentation, the SDL implementation of timedwait may
suck on some platforms, so it should only be used, where high CPU usage
during the wait is no issue.

getpckserver() will now only wait for one second for access to the
package server list and return an error instead of waiting indefinitely.
2015-09-17 16:40:59 +02:00
ac-stef cbd0e7b4bc add timeout and manual abort to connect() 2015-09-15 13:18:03 +02:00
ac-stef ecc63d7047 more thread wrapper functions
Add code to detach threads without losing any ressources.
(use POSIX libs when SDL is not available)
2015-09-15 13:18:03 +02:00
ac-stef f6c161bcc5 add map export to format 9
Export to the map format of AC 1.2. Use with caution. Experimental.
2015-09-14 16:32:56 +02:00
ac-stef f424c95a7f allow the package server ping thread to take ages
Don't have the main thread wait for the ping thread, because the ping
thread may take a long time to respond - when a server connection can't
be established. Sadly, there's no timeout for "connect()".
2015-09-14 16:03:09 +02:00
ac-stef 5a4b605b33 fix flag drop position under water
Just placing the flag on top of the water didn't work for fully flooded
map areas, as the flag went out of reach.
This fix tries to float the flag up to the surface and stops, if something
blocks the way.
2015-09-14 13:57:55 +02:00
ac-stef 532453b9f8 tweak command completion
If the fragment is also a full command, skip that command during the first
round of TAB completions.
2015-09-08 21:03:06 +02:00
ac-stef 396eae3ee0 fix #131
although I doubt, that anyone ever fell for that

(the fix prevents, that nickname completion can change the first char of
the console string to a slash, which would change the line from chat to
command)
2015-09-08 20:22:07 +02:00
ac-stef 91753026dc fix enet issue #31
easier to fix the library than every use of the functions
2015-09-08 11:51:02 +02:00
ac-stef d86f6cc6ff rename ERROR macro
seems to be defined otherwise on windows
2015-09-07 22:34:35 +02:00
ac-stef 8f06af0e59 travis update
don't install curl libs
2015-09-07 19:52:06 +02:00
ac-stef 6c97202aa3 retry mapmodel downloads
Mapmodels which were not found once are put on a list and not tried to
be loaded again. With this commit, the list is cleared during a map load
if autodownload is enabled. This causes all missing models to be
downloaded.

Fixes issues with manually aborted autodownloads.
2015-09-07 14:53:57 +02:00
ac-stef 68c3ea43b1 improved http error handling
* don't treat 404 as http error
* real errors return -1 and disconnect
* -1 is treated as real error
2015-09-07 14:53:57 +02:00
ac-stef 58e033a1e3 add debug info to autodownload
In debug binaries and/or when the variable autodownloaddebug is set to 1,
more debug output is produced.

DOCREF autodownloaddebug
2015-09-07 14:53:57 +02:00
ac-stef fd2109adc5 add support for port and path settings for autodownload servers
actually, addpckserver now supports a full url as "host" field - but only
domain, port and path are used
2015-09-07 14:53:57 +02:00
ac-stef 9965f53d28 fix filtertext
cropping space should work now
2015-09-07 14:53:57 +02:00
ac-stef 7bdd91bc9f improved timeout handling and progress bar for autodownloads
http get now uses two timeout values: one for the max time since last
server response, and one for total download time.

When AC is waiting for a server response (before a http header was
received), the progress bar will show the timeout "completion".
2015-09-07 14:53:57 +02:00
ac-stef 0f37595c30 alternative progress visualisation for map and mod downloads
no need to switch to the loadingscreen for those
2015-09-07 14:53:56 +02:00
ac-stef 491c8aa0fa curl be gone 2015-09-07 14:53:56 +02:00
ac-stef 50369fe920 use new http get to retrieve list from masterserver
curl ite domum
2015-09-07 14:53:56 +02:00
ac-stef 026dad73cd add support for downloadable zip mod packages
getmod modname
  Try to download mods/modname.zip from all configured package servers.
  Does not automatically activate the mod. The zip files are limited to
  one megabyte total.

DOCREF getmod
2015-09-07 14:53:56 +02:00
ac-stef f603031018 add zip mod package settings menu
Zipped mod package files should be placed in "mods/" and need to contain
directory trees starting with "packages/" (or "config/"). The files from
a zip mod replace files, that exist in the original game install or add
new files.

The zip file should contain three special files:

  desc.txt
    Contains one line with a descriptive title for the package and ten
    more optional lines with a detailed description.

  preview.jpg
    Preview picture for the mod. Must not exceed 128 kbytes. Aim for
    512x512 pixel.

  revision_n
    Empty file. The "n" in the filename should be a valid integer number
    instead, specifying the zip revision. Example "revision_123".

The settings menu shows the active mods in order of their priority - which
determines, which file to use, if several mod packages try to add or
substitute the same file. Zip files higher up in the list win.
2015-09-07 14:53:56 +02:00
ac-stef 04aba22e16 more commands to manage zipped mod packages
addzipmod zipname
  Add the zip package file "mods/zipname.zip" to the virtual file system.
  Only files below the path "packages/" are added (and also files below
  "config/", if zipname starts with "###"). If the size of the zip file
  is below zipcachemaxsize, the whole zip file is cached in memory.
  (Un-cached zip files are kept open at all time, so caching keeps the
  number of simultaneously opened files lower.)

zipmodremove zipname
  Removes one zip file from the virtual file system.

zipmodclear
  Removes all zip files from the virtual file system.

zipmodlist [what]
  Lists zip files in "mods/". By default, or if "what" is "all", all zips
  are listed. If "what" is "active", only those zips, that are already in
  use, are listed. If "what" is "inactive", only the unused zip files are
  listed.

zipmodgetdesc zipfile
  Reads and returns the first 11 lines from the file "desc.txt" in the
  named zip file. The first line is supposed to contain a descriptive
  title for the zip (for use in menus) and the next 10 lines should
  contain a more detailed description (also for use in menus).
  The command also unpacks "preview.jpg" from the zip and mounts it as a
  temporary file under the name "packages/modpreviews/zipname.jpg".

zipmodgetfiles zipfile
  Returns the list of files contained in a zip file.

zipmodgetrevision zipfile
  Returns the revision number of the zip file. The number is supposed to
  be part of a filename: "revision_n". If no such file is found in the zip
  file, the return value is zero. The content of the revision file is not
  relevant and a file size of zero is recommended.

DOCREF addzipmod zipmodremove zipmodclear zipcachemaxsize
DOCREF zipmodlist zipmodgetdesc zipmodgetfiles zipmodgetrevision
2015-09-07 14:53:56 +02:00
ac-stef 394ddd12f7 allow chmenutexture to display pictures as well
By specifying a title string in the second argument to chmenutexture,
a picture is rendered instead of a texture. The title string is
displayed instead of the texture resolution. The variable menupicturesize
holds a size modifier for pictures, similar to menutexturesize.

DOCREF chmenutexture menupicturesize
2015-09-07 14:53:56 +02:00
ac-stef 7988443b1d partial autodownload rewrite
* own source file for autodownload
* use cleaned up zip functions
* use new http get function (no more curl)
* enforce strict file naming rules and file size limits
* ping all package servers on every game start to determine ping times
* support media file update lists (also kept on package servers)
* allow users to manually prioritise package servers
* automatically select server with newest media file revision

new or changed commands:

addpckserver hostname [priority]
  Adds a host name to the list of package servers. If a priority is given,
  it influences the sorting of servers. Servers with higher priority are
  queried first. If servers have the same priority, they are sorted by
  ping. Default priority is zero.

getpackageserver
  Returns a table with four columns of all configured package servers. The
  columns are: host name, priority, ping and resolved.
  "resolved" is a flag, indicating, if the server answered the ping during
  game start.

removed cubescript idents: sortpckservers gamestarts
DOCREF addpckserver getpckserver
2015-09-07 14:53:56 +02:00
ac-stef c8313a946e add memfiles: temporary files held in ram
WARNING: intermediate commit - autodownload system defunct!
2015-09-07 14:53:56 +02:00
ac-stef 6c58c9f307 add easy to use functions to read from zip files
..without mounting the zip into the file system first

WARNING: intermediate commit - autodownload system defunct!
2015-09-07 14:53:56 +02:00
ac-stef 816aed4ba6 rewire zip packages inside the virtual filesystem
* change priority of zip packages from "highest" to "just below home dir"
* strict naming rules for zip packages
* require all zips to be below directory "mods/"
* only allow zips to intoduce files below "packages/" (or with a special
  zip package name also below "config/")
* make zip package config persistent (saved to init.cfg)

WARNING: intermediate commit - autodownload system defunct!

DOCREF (removed) addzip removezip
2015-09-07 14:53:56 +02:00
ac-stef 0dab3ade48 some zip changes
* use streams to read zip files
* include bugfixes from upstream
2015-09-07 14:53:56 +02:00
ac-stef 743bb7965c stream interface for memory buffers
* read-only access through regular stream functions
* automatic cleanup with reference counter
2015-09-07 14:53:55 +02:00
ac-stef da426c93cf stream interface for uchar vectors
* read- and write-access through regular stream functions
* automatic cleanup
2015-09-07 14:53:55 +02:00
ac-stef ff523df873 new http get function
* based on the enet socket layer
* supports redirects, range requests and gzip encoding
* automatically tries to re-use existing connections
* easy multithreading
* writes output to file or ram buffer
2015-09-07 14:53:55 +02:00
ac-stef 8f6b5d5802 fix skymap autodownload error handling
- suppress error messages during map config execution, just like all
  missing media errors are suppressed during the first attempt

- don't queue manual attempts to load nonexisting skymaps for download
  (this is now consistent with other manual media use)
2015-08-28 11:55:09 +02:00
ac-stef 06f59e0559 use safe strings
(cleanup)
2015-08-21 15:51:36 +02:00
ac-stef 50d1413d5c fix some warnings
Removed homebrew round() - now we just use the math library.
2015-08-03 20:57:50 +02:00
ac-stef 826499c12d enable gcc to check arguments of printf-like functions
Check printf-like functions like conoutf, if format strings and argument
lists match.

This commit also fixes a lot of code parts that actually had mismatching
argument lists - or did things, that this check does not like.

numtime() was rewritten in an ugly but very portable fashion (it's
recommended to stay away from "long long" format entries, because errors
usually only come up at runtime).

(some code was copied from sauer)
2015-08-02 19:40:41 +02:00
ac-stef 380b8a1ebf cleanup shotgun code
no functional changes, only cleanup
2015-07-12 20:22:49 +02:00
ac-stef a78d08d4ca cleanup additional ray shortening
(no longer necessary, since the actual shortening now works)
2015-07-12 18:51:14 +02:00
ac-stef 392880ec5c fix shot ray shortening 2015-07-12 18:17:22 +02:00
ac-stef fe686b603c fix updatefollowplayer
give "availability" priority over persistent spectating
2015-06-25 01:13:06 +02:00
ac-stef ffd7a64cdc fix tempfile path handling
A path can not pass findfile() twice.
(And "tmp" has no path delimiters to fix.)
2015-06-23 23:16:14 +02:00
ac-stef 0ed05a2036 string fix 2015-06-23 23:06:20 +02:00
ac-stef 38c563dfd6 add command getvarrange
getvarrange <what> <varname>
  Gets range attribute <what> for builtin variable <varname>.

  what
    one of "min", "max" or "default"

  varname
    name of any builtin variable (integer or float)

DOCREF getvarrange
2015-06-13 22:16:52 +02:00
ac-stef fe6f9e92a7 tab and formfeed cleanup 2015-06-10 14:28:50 +02:00
ac-stef d249f00e88 clean up gibsgore and poniesmode 2015-06-10 14:28:50 +02:00
ac-stef 4ba5b0545c keep keybind aliases out of saved.cfg 2015-06-10 14:28:50 +02:00
ac-stef d99d456a36 allow dyngamma for all maps 2015-06-10 14:28:50 +02:00
ac-stef f3e72b8fb7 remove gettext
DOCREF gettext
2015-06-10 14:28:50 +02:00
ac-stef 0b940be8a0 remove gettext from cubescript 2015-06-10 14:28:50 +02:00
ac-stef 78115b90b4 remove gettext from menus
also clean up some color codes
2015-06-10 14:28:50 +02:00
ac-stef cf2c37e3da add tab char to richtext filter
translate "\t" to a tab character
2015-06-10 14:28:42 +02:00
ac-stef cb9169ab0a remove double filtering of richtext
cubescript quotes ("") already filter richtext
2015-06-10 14:27:52 +02:00
ac-stef d3cdec0708 allow persistent menu selections
menuselectionpersistent
  Enables persistent selections for the currently displayed menu and also
  restores a previously saved selection. Probably most efficient inside
  "menuinit". The position is restored during execution of this command,
  so the menu entry has to already exist and the alias with the last
  position has to be read from saved.cfg. In autmatically created menus
  it may be necessary to execute the command with a short delay (see
  examples in this commit).

DOCREF menuselectionpersistent
2015-06-10 14:22:11 +02:00
ac-stef bdf53a5ab8 show preview of textures during editing
When textures of the map geometry are changed, five textures around the
current pick from the "last used" stack are shown. The texture assigned
to the "sky" slot is not shown. Instead, a plain blue rectangle is used.

hudtexttl
  Time to show texture preview (in milliseconds).

DOCREF hudtexttl
2015-06-10 14:22:11 +02:00
ac-stef 4e3c40c3be clean up texture boxes in menus
too many copies of the same few lines...
2015-06-10 14:22:11 +02:00
ac-stef 3bd73a8fa4 cleanup entity scaling 2015-06-10 14:22:11 +02:00
ac-stef 148719c0f7 add script command for menu items with alternate fonts
Also: add '\a' to the list of escaped characters and remove storage of
  unneeded "filename".

mitemaltfont <altfont> <text> <action> <hoveraction> <desc>
  Displays a menu line with a text which may contain chars from an
  alternate font.

  altfont
    Name of the alternate font.

  text
    Content of menu line. Chars from the alternate font have to be marked
    with "\a". Alternate font chars have no width and are just rendered
    above the following text. Use spaces to counter that.

  action, hoveraction, desc
    Same function as with other menu lines.

DOCREF menuitemaltfont
2015-06-10 14:12:43 +02:00
ac-stef cf2ae06de6 remove lightscale variable
DOCREF lightscale
2015-06-05 16:01:03 +02:00
ac-stef 11dc8202fa cleanup 2015-06-05 16:01:03 +02:00