Commit Graph
149 Commits
Author SHA1 Message Date
ac-stef 0f8dbf69aa introduce temporary aliases
An alias, that was at least once used with the new "tempalias" will not be
written to saved.cfg.

So, now there are four ways to create aliases:

1) alias (or "=")
  General alias, who's value gets saved at game exit in saved.cfg, and
  restored at the next restart - unless the alias was created at a time,
  where persistidents was zero (usually during execution of the game's own
  config files during startup).

2) const
  Creates an alias, that can not be changed. Makes it harder for users
  to destroy their config.

3) push
  Reassigns an alias with a new value. After "pop", the old value is
  restored. Allows the use of "local" aliases in scripts. Also avoids
  name conflicts.

4) tempalias
  Like "alias", but the value will not be written to saved.cfg.

The commit also changes aliases, written by the engine itself, to "temp":
gametimestart, __getmaprevisions

DOCREF tempalias
2015-03-06 14:17:08 +01:00
ac-stef e369f3e415 move backup() 2015-02-08 17:39:15 +01:00
ac-stef b76413ddc2 clean up stopwatch code
* SDL_GetTicks() returns uint
* there's no need to make a fuss about "starting" and "stopping" the clock
* instead of stopping the clock, we can now just get the elapsed time
2015-02-08 17:39:15 +01:00
aurhat 6e0e7bb333 Optimize and fix autodownload feature
The commit:
1. fixes value of download speed in KB;
2. introduces unique names of progress_callback() functions;
3. removes one unnecessary write_callback() function;
4. removes duplicated code/info in loadmodel().
2014-11-26 21:05:07 +01:00
ac-stef 4fdba4fa4a less ugly mapdims
replaced the mapdims array with a struct with properly identified members

also reduced the calclight postfilter to actually used map areas
2014-11-12 17:52:44 +01:00
ac-stef e2ac8efadd remove restrictions on mapmodel rotation
Until now, the angles of mapmodels (and ctf-flags) were rounded to the
nearest 15-degree-step during rendering. This patch moves the rounding
to the time of placement of the model. Now the angle can be changed freely
after the model has been placed.

This commit also changes the angle resolution to 0.25 degree.

When changing the angle (press "1" + scrollwheel), additionally pressing
editmeta (a.k.a. LCTRL) changes the increments of the wheel from 1 to 10.

During a savemap with format 9, the angle resolution is reduced again, to
keep compatibility. Therefore, this features is only for testing right now.
It won't be preserved during a save (at least, as long as format 9 is used)
2014-10-22 12:08:42 +02:00
ac-stef 556b1eb7f2 add map vantage points
The vantage point is supposed to be a distinctive view on a map - like the
angle from which the preview picture was taken.

This commit adds three commands: clearvantagepoint, setvantagepoint and
gotovantagepoint. None has any parameters, all are only allowed in edit
mode. A map can only have one vantage point.
2014-06-23 16:15:47 +02:00
ac-stef 493aefd34b fix: convert xmap path names for windows
* make sure, unsaved edits only count in editmode (otherwise "watercolour"
  in map configs would already be "edits")

* nicer filenames for backup-xmaps

* catch failed xmap file write access

* unsavededits is now flag (!= 0) and counter - to enable scripts to
  detect "new edits".

new commands:

xmap_delete_backup    deletes the backup xmap

xmap_keep_backup    moves the backup xmap to a regular named spot

xmap_rename    changes the nickname of an xmap
2014-05-19 12:31:26 +02:00
ac-stef b0649b5ea5 multiple map buffers for map editing: "xmaps"
An xmap holds everything related to map editing at a certain moment: it is
a map editing snapshot. It contains the name, the header, the geometry,
the entities, the extra headers, the undo/redo data and the cameraposition
from the moment, the snapshot was taken.

Xmaps are held in memory and, if persistentxmaps is set to "1", are saved
at game end and restored at game start.

xmap_list
  lists all xmaps currently in memory

xmap_store <nickname>
  create a snapshot and store it under the given nickname
  (nicknames have to qualify as valid filenames)

xmap_restore <nickname>
  restores the named snapshot. Also creates a backup snapshot of the
  current editing data.

xmap_restore
  restores the last automatic backup snapshot. Automatic snapshots are
  taken, a) before a snapshot is restored, b) before a new map is loaded
  (if there were unsaved edits on the map) and c) when the game ends (if
  there were unsaved edits).

xmap_delete <nickname>
  deletes the named snapshot.

Unsaved edits are flagged in the HUD with an "U" in the lower right
corner of the screen.

The files with the persistent xmaps are stored in mapediting/xmaps. After
they were restored at game start, the files are moved to
mapediting/xmaps/backups. Xmap files are cubescript files.
2014-05-15 17:34:25 +02:00
ac-stef d3bda71212 map file addons: embedded config file; persistent undo/redo data
This commit establishes an extensible way of storing additional data in
map file headers. Those header extras can be permanent, like the embedded
config file or be used only once after map load like the undo/redo data.

Additional extra data can be easily added and will not break backward
compatibility, so this map format should hold up for quite some time.

To make things easier for mappers, maps can now be saved without invoking
the various optimisations. That, in combination with the stored undo data,
means, that editing a map can be picked up at exactly the same state, as
the map was saved in.

Maps will automatically be written in the appropriate fashion, depending
on the situation:
 1) for sendmap: no optimisation, no undo data
 2) savemap during editing: no optimisation, with undo data
 3) savemap when not editing: optimised, no undo data
 4) savemapoptimised: optimised, no undo data
(For savemap to save different maps during editing, the variable
 preserveundosonsave has to be "1". It is "0" by default.)

All of the above map files can be played without problems - they only
differ in file size. (However, maps with undo data may be too big to send)

The new command "embedconfigfile" will load the config file, include it in
the map header and rename the original text file.

"extractconfigfile" will write an embedded config file to a separate file
and remove it from the map header.

Embedded config files take precedence over regular config files and
therefore make it harder for cheaters to play with modified config files.

further changes: cleaned up some debugging code; more ASSERTs
2014-05-15 16:07:52 +02:00
ac-stef 859df26089 refactored load_world and save_world
* separated "loading the map" from "collecting map statistics"
* replaced the buggy toptimize with mapmrproper as default
  pre-save optimiser
* add timestamps to loadmap-stats
2014-05-15 13:48:30 +02:00
ac-stef 2a9d4a98c5 check texlists at map load
if by some freak accident the list gets corrupted, the textures are no
longer accessible from the map editor

this check makes sure, that nothing is missing
2014-05-15 13:48:30 +02:00
ac-stef 2c2395d97a have the waterlevel variable reflect the actual value of the map 2014-05-15 11:43:37 +02:00
ac-stef eb60302e67 cleanup
- fix possible crash in conc (but it's still an ugly hack)
- fix noob usage of strcmp
- flag some memory leaks (it would be nice, if the author(s) would clean
   up the mess himself)
- fix crash in substr
- whitespace cleanup

there are plenty more memory leaks in command.cpp - for example, every
goto in cubescript does not clean up anything
2014-05-14 22:54:37 +02:00
ac-stef c3d4713904 clean up map header handling
Older versions of ac did not obey the map header field "headersize".
When a map was written, only the "version" field was updated, even if
the new written header had a different size. Thanks to bigger headers
in map versions 7 & 8 (and now smaller headers again in 9), the headersize
of basically all official maps is bogus. This fix makes sure, only proper
headersizes are written. It also makes the game tolerate different (bigger)
headers - and keeps their content untouched. Future map format extensions
can use this to add header information without breaking existing map parsers.

This patch establishes a new map format 10, which is identical to format 9,
with the exception that the headersize field is guaranteed to be correct.
Format 10 also allows any amount of additional header data.

This patch also cleans up the transformation routines for old map entities.
2014-01-27 23:01:23 +01:00
Ronald Reagan fc24e0fac3 Error message grammar fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7538 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-08-22 11:02:42 +00:00
Lucas GAUTHERON 71754e0cf1 allow maps with a sane name only
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7537 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-08-12 11:56:53 +00:00
Lucas GAUTHERON ebcbbbc933 autodownload update
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7389 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-23 08:05:58 +00:00
Lucas GAUTHERON a7a1e46bcc merged branch
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-22 19:49:21 +00:00
Lucas GAUTHERON d4b1793621 stupid redundancies :|
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7343 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-10 19:49:33 +00:00
Bukz 7480f036d3 persistidents fixes (plz review/test)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7213 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-16 01:43:47 +00:00
sireus b33116712c sane(r) command signatures (warning: huge commit)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6908 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-10-06 22:49:49 +00:00
Bukz 83fa555239 Texture bug on map saves fix (Thanks to Felix-The-Ghost --- please test) and updated win bins.
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6800 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-05-20 17:06:02 +00:00
sireus 1b19d500df fixed typo (reported by arand)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6763 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-02-27 21:59:36 +00:00
sireus 77c2dd3944 fixed some issues found by cppcheck
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6740 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-12-19 21:02:57 +00:00
RandumKiwi e0b45cccfb minor changes to releasefiles.txt
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6605 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-08-20 22:44:02 +00:00
Bukz dff42f8ee9 gametimestart & mapbackupsonsave
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6565 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-08-08 21:47:50 +00:00
sireus b5c863a900 persistidents - control whether newly defined idents are persistent (suggested by Bukz)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6526 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-09 13:28:52 +00:00
Rafael Barreto f891f1dff3 ty tempest! changing diff from char to int
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6496 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-04 15:06:42 +00:00
Rafael Barreto 32712318da doing it better... (still testing the exploit, tbh)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6494 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-04 14:14:37 +00:00
Rafael Barreto a8401fd1e3 fixing that obvious map requirements exploit... (no more exploits for the next 6 months...)
@ other devs: check my fix... I expect to not block any good map

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6490 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-03 21:19:44 +00:00
flowtron 457b0617c9 centralized MediaPack-retrieval system
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6222 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-04-06 18:06:36 +00:00
flowtron 2d9edb6dc4 rewrite of radar-code
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6110 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-02-27 22:16:28 +00:00
flowtron 0aa9a9c1d9 ensure map-header shows map was saved with AC, even if imported from Cube - found by JMM
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6103 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-02-14 18:04:40 +00:00
RandumKiwi 315cedf65c packaging cleanup
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5812 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-11-08 00:55:11 +00:00
Rafael Barreto 9c8ee2b555 fixing the absence of message for official maps with different version, include a tolerant system to disrupt the players who reconnect on purpose (to avoid death or to go back to base faster), and removing some tabs/comments (please, flowtron... do not use tabs! use spaces to indent! four spaces please!)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5761 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-10-16 19:30:36 +00:00
Rafael Barreto d8a3695deb mapdim in server side
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5660 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-19 23:50:08 +00:00
Alejandro V. Garcia af601adcc0 moved mapdims location
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5596 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-10 09:12:27 +00:00
flowtron 36bffcde2a user-friendly URL display for missing mediapacks
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5562 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-08 00:31:40 +00:00
flowtron a8f80df36c mediapack updates : file-list update & URL output on "checkmapdependencies"
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5561 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-08 00:11:41 +00:00
flowtron cd2c4bc85b showmapdims - maybe useful for mappers
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5481 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-30 18:31:39 +00:00
flowtron 94dc526837 lots of whitespace
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5265 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 16:49:20 +00:00
flowtron fd3742ce79 removed testing parts of mapdims-code
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5264 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 16:17:05 +00:00
flowtron bcc32046e8 and finally I see what I missed before
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5260 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-01 20:56:42 +00:00
flowtron 13734e6961 some comment-replies to Brahma :)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5259 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-01 20:55:09 +00:00
Rafael Barreto da3f17217c fix mapdim/showmap, removing the SCOPED message and some extras
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5254 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-30 19:10:20 +00:00
Rafael Barreto ec9df808b2 maxdim comments, fix the Marea value, shotgun frag fix (i thought it was already committed)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5251 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-29 15:47:32 +00:00
flowtron 80a762b1a3 fix ISO-C++ compliance - kudos to BCFH|Ärkefiende
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5248 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-27 18:54:53 +00:00
flowtron 54a9870223 improved showmap and checkarea replacment candidate
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5244 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-27 17:18:53 +00:00
Rafael Barreto 8ffc66b034 clean up
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5080 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-27 03:37:45 +00:00