diff --git a/.gitignore b/.gitignore index 7505aec8..25268f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ source/src/ac_client source/src/ac_server source/src/cube.h.gch source/src/Makefile_local +clientlog*.txt diff --git a/bin_win32/LICENSE.jpeg.txt b/bin_win32/LICENSE.jpeg.txt new file mode 100644 index 00000000..78c93171 --- /dev/null +++ b/bin_win32/LICENSE.jpeg.txt @@ -0,0 +1,65 @@ +The source code to this library used with SDL_image can be found here: +http://www.libsdl.org/projects/SDL_image/libs/ +--- + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." diff --git a/bin_win32/LICENSE.png.txt b/bin_win32/LICENSE.png.txt new file mode 100644 index 00000000..5472ab25 --- /dev/null +++ b/bin_win32/LICENSE.png.txt @@ -0,0 +1,114 @@ +The source code to this library used with SDL_image can be found here: +http://www.libsdl.org/projects/SDL_image/libs/ +--- + +This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are +Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about" +boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a +certification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +December 15, 2011 diff --git a/bin_win32/LICENSE.zlib.txt b/bin_win32/LICENSE.zlib.txt new file mode 100644 index 00000000..a849723e --- /dev/null +++ b/bin_win32/LICENSE.zlib.txt @@ -0,0 +1,31 @@ +The source code to this library used with SDL_image can be found here: +http://www.libsdl.org/projects/SDL_image/libs/ +--- + +Copyright notice: + + (C) 1995-2010 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. diff --git a/bin_win32/SDL.dll b/bin_win32/SDL.dll old mode 100755 new mode 100644 index 628cdfcf..69fd61ec Binary files a/bin_win32/SDL.dll and b/bin_win32/SDL.dll differ diff --git a/bin_win32/SDL_image.dll b/bin_win32/SDL_image.dll old mode 100755 new mode 100644 index 19603531..e891b167 Binary files a/bin_win32/SDL_image.dll and b/bin_win32/SDL_image.dll differ diff --git a/bin_win32/jpeg.dll b/bin_win32/jpeg.dll deleted file mode 100755 index 12dfb0d2..00000000 Binary files a/bin_win32/jpeg.dll and /dev/null differ diff --git a/bin_win32/libjpeg-8.dll b/bin_win32/libjpeg-8.dll new file mode 100644 index 00000000..74285d25 Binary files /dev/null and b/bin_win32/libjpeg-8.dll differ diff --git a/bin_win32/libpng12-0.dll b/bin_win32/libpng12-0.dll deleted file mode 100644 index 060fca96..00000000 Binary files a/bin_win32/libpng12-0.dll and /dev/null differ diff --git a/bin_win32/libpng15-15.dll b/bin_win32/libpng15-15.dll new file mode 100644 index 00000000..a5854d5d Binary files /dev/null and b/bin_win32/libpng15-15.dll differ diff --git a/bin_win32/zlib1.dll b/bin_win32/zlib1.dll index 775aaf1f..0eeaa294 100644 Binary files a/bin_win32/zlib1.dll and b/bin_win32/zlib1.dll differ diff --git a/config/admin.cfg b/config/admin.cfg index abe992d3..f8e38018 100644 --- a/config/admin.cfg +++ b/config/admin.cfg @@ -1,7 +1,7 @@ persistidents 0 -const kick [ callvote 0 $arg1 $arg2 ] -const ban [ callvote 1 $arg1 $arg2 ] +const kick [if $numargs [if (> $numargs 1) [loop i (- $numargs 2) [alias arg2 (concat $arg2 (getalias (concatword arg (+ $i 3)))) ] ] [] ; callvote 0 $arg1 $arg2 ] ] +const ban [if $numargs [if (> $numargs 1) [loop i (- $numargs 2) [alias arg2 (concat $arg2 (getalias (concatword arg (+ $i 3)))) ] ] [] ; callvote 1 $arg1 $arg2 ] ] const removebans [ callvote 2 $arg1 ] const mastermode [ callvote 3 $arg1 ] const autoteam [ callvote 4 $arg1 ] diff --git a/config/convert_mapconfig.sh b/config/convert_mapconfig.sh index 7f611dab..f12f0747 100644 --- a/config/convert_mapconfig.sh +++ b/config/convert_mapconfig.sh @@ -35,7 +35,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "" ]; then exit # REVERT command: elif [ "$1" = "-r" ] || [ "$1" = "--revert" ]; then - for file in $*; do + for file in "$@"; do if [ "$file" = "-r" ] || [ "$file" = "--revert" ]; then continue elif [[ -w "$file" && "$file" = *.cfg && -r "$file".BAK ]]; then @@ -51,7 +51,7 @@ fi # Alias to define if anything failed (but the script continued). CONTFAILED="0" -for file in $*; do +for file in "$@"; do if [[ -r "$file" && -w "$file" && "$file" = *.cfg ]] || [ "$file" = "-s" ] || [ "$file" = "--strip" ] || [ "$file" = "-os" ] || [ "$file" = "-sp" ] || [ "$file" = "-osp" ]; then if [ "$file" = "-s" ] || [ "$file" = "--strip" ] || [ "$file" = "-os" ] || [ "$file" = "-sp" ] || [ "$file" = "-osp" ]; then continue diff --git a/config/favourites.cfg b/config/favourites.cfg index f6dd017f..acd1a92c 100644 --- a/config/favourites.cfg +++ b/config/favourites.cfg @@ -12,6 +12,7 @@ // red, green, blue, alpha: background color for servers of this category, use values from 0..100, use alpha = 0 to disable background color // keys: keywords to describe, which servers are in this category // ignore: 1: disable this category, 0: enable it +// image: path to image, which is displayed in serverbrowser instead of tag (for example: packages/misc/heart.png) // possible key types: // IP IP address of a server, partial addresses can be used @@ -93,4 +94,17 @@ sbfavourite_MODE_alpha = 0 sbfavourite_MODE_weight = 1 sbfavourite_MODE_keys = "#42" // automatically add servers playing towel mode +addfavcategory MATCH +sbfavourite_MATCH_desc = "Preferred match servers" +sbfavourite_MATCH_alpha = 0 +sbfavourite_MATCH_weight = 1 +sbfavourite_MATCH_ignore = 1 + +addfavcategory SEARCH +sbfavourite_SEARCH_desc = "Server search result" +sbfavourite_SEARCH_tag = "\f9Result:" +sbfavourite_SEARCH_alpha = 0 +sbfavourite_SEARCH_weight = 1 +sbfavourite_SEARCH_ignore = 1 + persistidents 1 diff --git a/config/maprot.cfg b/config/maprot.cfg index 7e6e9592..0476c2ce 100644 --- a/config/maprot.cfg +++ b/config/maprot.cfg @@ -46,7 +46,7 @@ ac_keller : 5:12: 1: 4:12: 1 // ctf, 12 minutes, 4..12 players ac_keller :13:12: 1:13: 0: 0 // htf, 12 minutes, 13.. players ac_arctic : 0:10: 1: 4: 7: 1 // tdm, 10 minutes, 4..7 players -ac_arctic :11:10: 1: 7: 0: 0 // tosok, 10 minutes, 8.. players +ac_arctic :11:10: 1: 8: 0: 0 // tosok, 10 minutes, 8.. players ac_shine : 5:12: 1: 4:13: 1 // ctf, 12 minutes, 4..13 players ac_shine :13:12: 1:14: 0: 0 // htf, 12 minutes, 14.. players @@ -69,7 +69,7 @@ ac_scaffold :11: 8: 1: 6: 9: 0 // tosok, 8 minutes, 6..9 players ac_urban : 0:10: 1: 5: 0: 0 // tdm, 10 minutes, 5.. players ac_desert3 : 5:12: 1: 4:10: 1 // ctf, 12 minutes, 4..10 players -ac_desert3 :14:10: 1:11: 0: 1 // tktf, 10 minutes, 11.. players +ac_desert3 :14:10: 1:11: 0: 0 // tktf, 10 minutes, 11.. players ac_depot : 5:12: 1: 4:12: 0 // ctf, 12 minutes, 4..12 players @@ -104,8 +104,8 @@ ac_edifice :13:10: 1:12:13: 0 // htf, 10 minutes, 12..13 players ac_iceroad : 5:10: 1: 5: 0: 0 // ctf, 10 minutes, 5.. players -ac_douze :10: 6: 1: 5: 5: 3 // osok, 6 minutes, 5 players -ac_douze : 2: 6: 1: 6: 6: 2 // dm, 6 minutes, 6 players +ac_douze :10: 6: 1: 5: 5: 1 // osok, 6 minutes, 5 players +ac_douze : 2: 6: 1: 6: 6: 0 // dm, 6 minutes, 6 players ac_gothic :15: 6: 1: 2: 3: 2 // ktf, 6 minutes, 2..3 players ac_gothic : 5:12: 1: 4:11: 1 // ctf, 12 minutes, 4..11 players @@ -147,18 +147,16 @@ ac_venison : 2: 8: 1: 0: 4: 2 // dm, 8 minutes, 0..4 players ac_venison :13:15: 1: 5:10: 1 // htf, 15 minutes, 5..10 players ac_venison : 5:15: 1:11:14: 0 // ctf, 15 minutes, 11..14 players -ac_terros : 2: 8: 1: 0: 4: 3 // dm, 8 minutes, 0..4 players -ac_terros :13:15: 1: 5:10: 2 // htf, 15 minutes, 5..10 players -ac_terros : 5:15: 1:11:14: 1 // ctf, 15 minutes, 11..14 players -ac_terros :10: 6: 1: 7: 7: 0 // osok, 6 minutes, 7 players +ac_terros : 2: 8: 1: 0: 4: 2 // dm, 8 minutes, 0..4 players +ac_terros :13:15: 1: 5:10: 1 // htf, 15 minutes, 5..10 players +ac_terros : 5:15: 1:11:14: 0 // ctf, 15 minutes, 11..14 players -ac_lainio : 2: 8: 1: 0: 4: 3 // dm, 8 minutes, 0..4 players -ac_lainio :13:15: 1: 5:10: 2 // htf, 15 minutes, 5..10 players -ac_lainio : 5:15: 1:11:14: 1 // ctf, 15 minutes, 11..14 players -ac_lainio :10: 6: 1: 7: 7: 0 // osok, 6 minutes, 7 players +ac_lainio : 2: 8: 1: 0: 4: 2 // dm, 8 minutes, 0..4 players +ac_lainio :13:15: 1: 5:10: 1 // htf, 15 minutes, 5..10 players +ac_lainio : 5:15: 1:11:14: 0 // ctf, 15 minutes, 11..14 players ac_cavern :15: 6: 1: 2: 3: 2 // ktf, 6 minutes, 2..3 players -ac_acvern :13:15: 1: 5:10: 1 // htf, 15 minutes, 5..10 players +ac_cavern :13:15: 1: 5:10: 1 // htf, 15 minutes, 5..10 players ac_cavern : 5:15: 1:11:14: 0 // ctf, 15 minutes, 11..14 players ac_wasteland : 2: 8: 1: 0: 4: 1 // dm, 8 minutes, 0..4 players diff --git a/config/menus.cfg b/config/menus.cfg index 36fd3573..4c11d485 100644 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -44,13 +44,7 @@ genmapitems $ctfmaps menuitem [] -1 menuitem (_ [Show all maps..]) [showmenu [all maps]] -newmenu Demo // If in-game (playing demos isn't needed) - -menuitem (_ [Start recording a demo]) recorddemo -menuitem (_ [Stop recording a demo]) stopdemo -menuitem (_ [Download demos from the server]) [ listdemos; showmenu [Download demo] ] // Lists the demos, then asks which would like to be downloaded. - -newmenu [Play demo] // If not in-game (recording/downloading demos isn't needed) +newmenu [Play demo] menuinit [ echo (_ [To stop demo playback, type:]) (red)/stopdemo ] menudirlist demos dmo "demo $arg1" @@ -59,6 +53,7 @@ newmenu [Watching demo] menuitem (_ [Stop watching demo]) stopdemo menuitem (_ [Restart demo]) [ demo $curdemofile ] menuitem (_ [Watch other demo]) [ stopdemo; closemenu [Watching demo]; showmenu [Play demo] ] +menuitemtextinput (_ [Custom description: ]) [ getalias (concatword "demodesc_" $curdemofile) ] [ alias (concatword "demodesc_" $curdemofile) $arg1 ] [] 50 menuitem [] -1 menuitem (concatword (c 4) (_ [Main menu...])) [ closemenu [Watching demo]; showmenu main ] menuitem (concatword (c 3) (_ [Quit AssaultCube])) savequit diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index 9ac7905c..c9a12ae7 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -60,7 +60,7 @@ menuitem [Change weapon...] [ showmenu Weapons ] [ __ingamemenu_showmodel [In-ga menuitem [Change to the enemy team] changeteam [ __ingamemenu_showmodel [In-game admin] 1 ] menuitemvar [result (concat [Change to] (if (> (player1 team) 1) [ result active ] [ result spectate ]) mode)] spectate [ __ingamemenu_showmodel [In-game admin] 1 ] menuitem [Change player skin...] [ showmenu (at [CLA RVSF] (player1 team)) ] [ __ingamemenu_showmodel [In-game admin] 1 ] -menuitem [Demos...] [ showmenu Demo ] [ __ingamemenu_showmodel "In-game admin" 0 ] +menuitem [Download a demo...] [ listdemos; showmenu [Download demo] ] menuitem [] -1 menuitem " 4Main menu..." [ closemenu [In-game admin]; showmenu main ] menuitem " 4Browse servers..." [ closemenu [In-game admin]; joinservermenu ] @@ -76,7 +76,7 @@ menuitem [Join a LAN server] [ searchlan 2; showallservers 0; showmenu server ] menuitem [Custom connect] [ showmenu [Custom connect] ] menuitem [Connect as Admin] [ showmenu [Admin connect] ] menuitem [] -1 -menuitem [Force serverlist update] [ updatefrommaster 1; showmenu server ] +menuitem [Force serverlist update] [ updatefrommaster 1; joinservermenu ] // Fancy custom connect menu. newmenu [Custom connect] @@ -156,9 +156,11 @@ newmenu [serverbrowser help] menuitem [F1: Display this help menu] -1 menuitem [F3: Search for players by nickname...] [ showmenu [search player] ] +menuitem [Search for servers...] [ showmenu [search server] ] menuitem [F4: Edit favourites...] [ showmenu [edit favourites] ] menuitem [F5: Update the serverlist from the masterserver] [ updatefrommaster 1; closemenu [serverbrowser help] ] menuitem [F9: Get additional server information] [ showmenu serverinfo ] +menuitem [Edit alternative views in serverbrowser...] [ showmenu [serverbrowser alternative views] ] menuitem [] -1 menuitem [Options:] -1 menuitemcheckbox [F6: Reverse the sort order:] "$serversortdir" [ serversortdir $arg1 ] @@ -191,11 +193,13 @@ const addfavcatmenu [ if (< $i 11) [ menuitemvar (concatword "concat " (mod $i 10) ": $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") (concatword "showmenu [favourites " $i "]") newmenu [serverbrowser help] - menuitemvar (concatword "concat " $i ": Toggle category $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") -1 + menuitemvar (concatword "concat " (mod $i 10) ": Toggle category $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") -1 ] [ menuitemvar (concatword "result $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") (concatword "showmenu [favourites " $i "]") ] newmenu (concat favourites $i) + menuitemvar ( concatword "concat " "Category name: " (c 2) (at (listfavcats) (- $i 1)) ) + menuitem [] -1 menuitemtextinput [Tag: ] (concatword "result $" sbfavourite_ $arg1 _tag) (concatword sbfavourite_ $arg1 _tag " = $arg1") [] 15 menuitemtextinput [Description: ] (concatword "result $" sbfavourite_ $arg1 _desc) (concatword sbfavourite_ $arg1 _desc " = $arg1") [] 45 menuitem [] -1 @@ -214,19 +218,31 @@ const addfavcatmenu [ ] const addallfavcatmenus [ - newmenu [serverbrowser help] - menuitem [] -1 - menuitem [Keys to add/remove servers from categories:] -1 - loop ii (listlen (listfavcats)) [ addfavcatmenu (at (listfavcats) $ii) ] + newmenu [serverbrowser help] + menuitem [] -1 + menuitem [Keys to add/remove servers from categories:] -1 + loop ii (listlen (listfavcats)) [ addfavcatmenu (at (listfavcats) $ii) ] ] lastsearchname = [] newmenu [search player] menuitemtextinput [Search servers for a player: ] "result $lastsearchname" [ lastsearchname = $arg1 ] -menuitem " 2 [ Search ]" [ closemenu [Search for a player]; searchnickname $lastsearchname] +menuitem " 2 [ Search ]" [ closemenu [search player]; searchnickname $lastsearchname] menuinitselection 1 +newmenu [search server] +menuitemtextinput [ Search for server: ] "result $sbfavourite_SEARCH_keys" [ sbfavourite_SEARCH_keys = $arg1 ] +menuitem " 2 [ Search ]" [ showonlyfavourites (addfavcategory SEARCH); showmenu server ] [ showonlyfavourites 0 ] +menuinitselection 1 + +newmenu [serverbrowser alternative views] +menuitem [Alt + Mouse wheel (Alt + Up/Down) toggles views in serverbrowser.] -1 +menuitem [] -1 +menuitemtextinput [Categories of favourites in alternative views: ] [getalias serverbrowseraltviews] [alias serverbrowseraltviews $arg1] [] 255 +menuitem [(type just names of categories, and not tags).] -1 +menuinitselection 2 + newmenu getmap menuitem [ This server is using a different version of this map...] -1 menuitem [] -1 diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index f81ad638..0d498db1 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -474,6 +474,7 @@ __screenshottype = 0 // Initial setting for status of screenshots so AC doesn't newmenu Misc menuitemcheckbox [Auto map download: ] "$autogetmap" [ autogetmap $arg1 ] +menuitemcheckbox [Auto media download: ] "$autodownload" [ autodownload $arg1 ] menuitemcheckbox [Show gamemodes as acronyms: ] "$modeacronyms" [ modeacronyms $arg1 ] menuitemcheckbox [Show quit dialog when quitting: ] "$askquit" [ askquit = $arg1 ] menuitemcheckbox [Auto-screenshot: ] "$autoscreenshot" [ autoscreenshot $arg1 ] diff --git a/config/scripts.cfg b/config/scripts.cfg index 12cf0604..afd05073 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -216,7 +216,7 @@ delta_edit_1 = [ if $flrceil [ vdelta $arg1 ] [ vdelta (- 0 $arg1) ] ] // Change delta_edit_2 = [ edittex $flrceil $arg1 ] // Change floor/ceiling textures... delta_edit_3 = [ edittex (+ $flrceil 1) $arg1 ] // Change wall/upper-wall textures... delta_edit_4 = [ equalize $flrceil ] // Equalize floor/ceiling... -delta_edit_5 = [ entproperty 0 $arg1 ] // Changes the first value on entities... +delta_edit_5 = [ entproperty 0 (* $arg1 (at "1 10" $editmetakeydown)) ] // Changes the first value on entities... delta_edit_6 = [ entproperty $editaxis $arg1 ] // Move map entity... delta_edit_7 = [ entproperty 1 $arg1 ] // Changes the second value on entities... delta_edit_8 = [ entproperty 2 $arg1 ] // Changes the third value on entities... @@ -249,7 +249,8 @@ const sbconnect [ if (= $arg4 1) [ sbmsg = [This server is password-protected.]; showmenu [password required] ] [ - echo connecting to $arg7; connect $arg1 $arg2; + if (> (strlen $arg7) 0) [ echo connecting to $arg7 ] + connect $arg1 $arg2 ] ] ] diff --git a/source/include/SDL.h b/source/include/SDL.h old mode 100755 new mode 100644 index 119ed7ff..6087b7cd --- a/source/include/SDL.h +++ b/source/include/SDL.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_active.h b/source/include/SDL_active.h old mode 100755 new mode 100644 index 0ae92f2d..cd854e89 --- a/source/include/SDL_active.h +++ b/source/include/SDL_active.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_audio.h b/source/include/SDL_audio.h old mode 100755 new mode 100644 index 3a8e7fa8..e879c989 --- a/source/include/SDL_audio.h +++ b/source/include/SDL_audio.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_byteorder.h b/source/include/SDL_byteorder.h old mode 100755 new mode 100644 index 9b93cd69..47332c3d --- a/source/include/SDL_byteorder.h +++ b/source/include/SDL_byteorder.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_cdrom.h b/source/include/SDL_cdrom.h old mode 100755 new mode 100644 index fff5cfa1..febb19dc --- a/source/include/SDL_cdrom.h +++ b/source/include/SDL_cdrom.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_config.h b/source/include/SDL_config.h index a5081016..09ba38a7 100644 --- a/source/include/SDL_config.h +++ b/source/include/SDL_config.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_config_macosx.h b/source/include/SDL_config_macosx.h index 295b8724..84be6177 100644 --- a/source/include/SDL_config_macosx.h +++ b/source/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_config_win32.h b/source/include/SDL_config_win32.h index 6d019a8d..da2c15dd 100644 --- a/source/include/SDL_config_win32.h +++ b/source/include/SDL_config_win32.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_copying.h b/source/include/SDL_copying.h old mode 100755 new mode 100644 index 1bd6b84c..b5b64f29 --- a/source/include/SDL_copying.h +++ b/source/include/SDL_copying.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_cpuinfo.h b/source/include/SDL_cpuinfo.h old mode 100755 new mode 100644 index f4be8e03..4200d6d1 --- a/source/include/SDL_cpuinfo.h +++ b/source/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_endian.h b/source/include/SDL_endian.h old mode 100755 new mode 100644 index f7a2e2f8..fd9fc867 --- a/source/include/SDL_endian.h +++ b/source/include/SDL_endian.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -39,6 +39,10 @@ /*@}*/ #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#else /* __linux __ */ #if defined(__hppa__) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \ @@ -48,6 +52,7 @@ #else #define SDL_BYTEORDER SDL_LIL_ENDIAN #endif +#endif /* __linux __ */ #endif /* !SDL_BYTEORDER */ @@ -86,7 +91,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); return result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint16 SDL_Swap16(Uint16 x) { __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); @@ -94,7 +99,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) } #else static __inline__ Uint16 SDL_Swap16(Uint16 x) { - return((x<<8)|(x>>8)); + return SDL_static_cast(Uint16, ((x<<8)|(x>>8))); } #endif @@ -121,7 +126,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); return result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint32 SDL_Swap32(Uint32 x) { __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); @@ -129,7 +134,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) } #else static __inline__ Uint32 SDL_Swap32(Uint32 x) { - return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); + return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); } #endif @@ -166,7 +171,7 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) x = SDL_Swap32(lo); x <<= 32; x |= SDL_Swap32(hi); - return(x); + return (x); } #endif #else diff --git a/source/include/SDL_error.h b/source/include/SDL_error.h old mode 100755 new mode 100644 index b103703a..4e1cce3b --- a/source/include/SDL_error.h +++ b/source/include/SDL_error.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_events.h b/source/include/SDL_events.h old mode 100755 new mode 100644 index c94a30c9..94b42025 --- a/source/include/SDL_events.h +++ b/source/include/SDL_events.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_getenv.h b/source/include/SDL_getenv.h old mode 100755 new mode 100644 index 253ad88c..bea63007 --- a/source/include/SDL_getenv.h +++ b/source/include/SDL_getenv.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_image.h b/source/include/SDL_image.h old mode 100755 new mode 100644 index de2ae18e..3f07d74a --- a/source/include/SDL_image.h +++ b/source/include/SDL_image.h @@ -1,23 +1,22 @@ /* - SDL_image: An example image loading library for use with SDL - Copyright (C) 1997-2009 Sam Lantinga + SDL_image: An example image loading library for use with SDL + Copyright (C) 1997-2012 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library 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 - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /* A simple library to load images of various formats as SDL surfaces */ @@ -38,7 +37,7 @@ extern "C" { */ #define SDL_IMAGE_MAJOR_VERSION 1 #define SDL_IMAGE_MINOR_VERSION 2 -#define SDL_IMAGE_PATCHLEVEL 10 +#define SDL_IMAGE_PATCHLEVEL 12 /* This macro can be used to fill a version structure with the compile-time * version of the SDL_image library. @@ -60,7 +59,8 @@ typedef enum { IMG_INIT_JPG = 0x00000001, IMG_INIT_PNG = 0x00000002, - IMG_INIT_TIF = 0x00000004 + IMG_INIT_TIF = 0x00000004, + IMG_INIT_WEBP = 0x00000008 } IMG_InitFlags; /* Loads dynamic libraries and prepares them for use. Flags should be @@ -104,6 +104,7 @@ extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src); /* Individual loading functions */ extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src); @@ -120,6 +121,7 @@ extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); diff --git a/source/include/SDL_joystick.h b/source/include/SDL_joystick.h old mode 100755 new mode 100644 index d5135c3d..708d1a9f --- a/source/include/SDL_joystick.h +++ b/source/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_keyboard.h b/source/include/SDL_keyboard.h old mode 100755 new mode 100644 index 7b59d24e..9d7129c5 --- a/source/include/SDL_keyboard.h +++ b/source/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_keysym.h b/source/include/SDL_keysym.h old mode 100755 new mode 100644 index 90101286..f2ad12b8 --- a/source/include/SDL_keysym.h +++ b/source/include/SDL_keysym.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_loadso.h b/source/include/SDL_loadso.h old mode 100755 new mode 100644 index 45a17f9f..0c5e5362 --- a/source/include/SDL_loadso.h +++ b/source/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_main.h b/source/include/SDL_main.h old mode 100755 new mode 100644 index b7f6b2c8..ab50ef1e --- a/source/include/SDL_main.h +++ b/source/include/SDL_main.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_mouse.h b/source/include/SDL_mouse.h old mode 100755 new mode 100644 index a573f04e..7c563b94 --- a/source/include/SDL_mouse.h +++ b/source/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_mutex.h b/source/include/SDL_mutex.h old mode 100755 new mode 100644 index 920971df..c8da9b1a --- a/source/include/SDL_mutex.h +++ b/source/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_name.h b/source/include/SDL_name.h old mode 100755 new mode 100644 diff --git a/source/include/SDL_opengl.h b/source/include/SDL_opengl.h old mode 100755 new mode 100644 index c479a3a4..3d791d69 --- a/source/include/SDL_opengl.h +++ b/source/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -3108,21 +3108,35 @@ typedef char GLchar; /* native character */ #ifndef GL_VERSION_1_5 /* GL types for handling large vertex buffer objects */ +#ifdef __APPLE__ +typedef long GLintptr; +typedef long GLsizeiptr; +#else typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; #endif +#endif #ifndef GL_ARB_vertex_buffer_object /* GL types for handling large vertex buffer objects */ +#ifdef __APPLE__ +typedef long GLintptrARB; +typedef long GLsizeiptrARB; +#else typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif +#endif #ifndef GL_ARB_shader_objects /* GL types for handling shader object handles and program/shader text */ typedef char GLcharARB; /* native character */ +#if defined(__APPLE__) +typedef void *GLhandleARB; /* shader object handle */ +#else typedef unsigned int GLhandleARB; /* shader object handle */ #endif +#endif /* GL types for "half" precision (s10e5) float data in host memory */ #ifndef GL_ARB_half_float_pixel diff --git a/source/include/SDL_platform.h b/source/include/SDL_platform.h index 11d86736..48540a85 100644 --- a/source/include/SDL_platform.h +++ b/source/include/SDL_platform.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_quit.h b/source/include/SDL_quit.h old mode 100755 new mode 100644 index 6d82e7e0..abd2ec6c --- a/source/include/SDL_quit.h +++ b/source/include/SDL_quit.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_rwops.h b/source/include/SDL_rwops.h old mode 100755 new mode 100644 index a450119f..98361d7e --- a/source/include/SDL_rwops.h +++ b/source/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_stdinc.h b/source/include/SDL_stdinc.h index e1f85fb7..35a4fdde 100644 --- a/source/include/SDL_stdinc.h +++ b/source/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_syswm.h b/source/include/SDL_syswm.h old mode 100755 new mode 100644 index 716dddcb..78433c6a --- a/source/include/SDL_syswm.h +++ b/source/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -203,12 +203,13 @@ typedef struct SDL_SysWMinfo { /** * This function gives you custom hooks into the window manager information. * It fills the structure pointed to by 'info' with custom information and - * returns 1 if the function is implemented. If it's not implemented, or - * the version member of the 'info' structure is invalid, it returns 0. + * returns 0 if the function is not implemented, 1 if the function is + * implemented and no error occurred, and -1 if the version member of + * the 'info' structure is not filled in or not supported. * * You typically use this function like this: * @code - * SDL_SysWMInfo info; + * SDL_SysWMinfo info; * SDL_VERSION(&info.version); * if ( SDL_GetWMInfo(&info) ) { ... } * @endcode diff --git a/source/include/SDL_thread.h b/source/include/SDL_thread.h old mode 100755 new mode 100644 index 1ca9a1bc..9ebe00ed --- a/source/include/SDL_thread.h +++ b/source/include/SDL_thread.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -68,11 +68,6 @@ typedef struct SDL_Thread SDL_Thread; #ifdef __OS2__ typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); typedef void (*pfnSDL_CurrentEndThread)(void); -#elif __GNUC__ -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); #else typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall *func)(void *), void *arg, diff --git a/source/include/SDL_timer.h b/source/include/SDL_timer.h old mode 100755 new mode 100644 index d7cd0246..d764d5f3 --- a/source/include/SDL_timer.h +++ b/source/include/SDL_timer.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_types.h b/source/include/SDL_types.h old mode 100755 new mode 100644 index cfa35236..79d8b28d --- a/source/include/SDL_types.h +++ b/source/include/SDL_types.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/SDL_version.h b/source/include/SDL_version.h old mode 100755 new mode 100644 index fa02c3f6..fdc17c64 --- a/source/include/SDL_version.h +++ b/source/include/SDL_version.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -41,7 +41,7 @@ extern "C" { /*@{*/ #define SDL_MAJOR_VERSION 1 #define SDL_MINOR_VERSION 2 -#define SDL_PATCHLEVEL 14 +#define SDL_PATCHLEVEL 15 /*@}*/ typedef struct SDL_version { diff --git a/source/include/SDL_video.h b/source/include/SDL_video.h old mode 100755 new mode 100644 index 8f7f3052..f9c4e070 --- a/source/include/SDL_video.h +++ b/source/include/SDL_video.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/include/begin_code.h b/source/include/begin_code.h old mode 100755 new mode 100644 index 22748090..27e2f7bc --- a/source/include/begin_code.h +++ b/source/include/begin_code.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -43,7 +43,7 @@ #ifndef DECLSPEC # if defined(__BEOS__) || defined(__HAIKU__) # if defined(__GNUC__) -# define DECLSPEC __declspec(dllexport) +# define DECLSPEC # else # define DECLSPEC __declspec(export) # endif @@ -132,7 +132,12 @@ #ifdef __BORLANDC__ #pragma nopackwarning #endif +#ifdef _M_X64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else #pragma pack(push,4) +#endif #elif (defined(__MWERKS__) && defined(__MACOS__)) #pragma options align=mac68k4byte #pragma enumsalwaysint on diff --git a/source/include/close_code.h b/source/include/close_code.h old mode 100755 new mode 100644 index 46a07208..19a00246 --- a/source/include/close_code.h +++ b/source/include/close_code.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/source/lib/SDL.lib b/source/lib/SDL.lib old mode 100755 new mode 100644 index 5b3f17c5..22d50ba1 Binary files a/source/lib/SDL.lib and b/source/lib/SDL.lib differ diff --git a/source/lib/SDL_image.lib b/source/lib/SDL_image.lib old mode 100755 new mode 100644 index 0fde136c..ac1b4b3a Binary files a/source/lib/SDL_image.lib and b/source/lib/SDL_image.lib differ diff --git a/source/lib/zdll.lib b/source/lib/zdll.lib index 01f4e10e..7a446565 100644 Binary files a/source/lib/zdll.lib and b/source/lib/zdll.lib differ diff --git a/source/src/CUBE_TODO.txt b/source/src/CUBE_TODO.txt deleted file mode 100644 index 5c1f83f8..00000000 --- a/source/src/CUBE_TODO.txt +++ /dev/null @@ -1,280 +0,0 @@ -- SLEEPY: only allow v121 and later -- win98 gf2 video init crash? -- better fist? -- chmod solution? -> release as tar.gz -- check with vtune for cpu bottlenecks on ksp1 -- put in scaling hack for sloppy ATI drivers -- integrate new dcp pistol model/start weapon -- monsters & jumppads -- hide monsters until triggered? -- trigger when monsters die? -- but back the idea of a overwritable config.cfg so settings are easier to change in game? -- improve particle engine / make all weapons have more satisfying effects / better sounds overal / lighting on rocket explosion -- demos play even from old protocol versions / scoreboards sometimes stick -- weapon keeps shooting if you switch to edit/talk while shooting / hide hud weapon in edit mode -- load demo when already playing a demo: see yourself -- load demo of map editing -> crash? -- larger ideas to revamp cube editing/rendering: - * can cube internal representation be replaced with typeless representation? - 2x floorceil, 8xvert offset, and 2x wall offset? (can we do it without floorceil even? byterange?) - * new lighting (diff floor ceiling like doom64?) can use lightmap the size of the world - to save on polys and make lighting more precise? - -> also other ways to reduce on polys by splitting - -> can merge polys better - most important however would be to allow walls to have different light than floor/ceil depending on light angle - and better/sharper shadows - * change texture list to be textures used rather than slots to allow >256 - * proper way of doing multilevel? - * a way of rendering that makes static vertex arrays and culling coexist? larger chunks? - -> speed is hardly the problem anymore with current cube maps, though may be nice once higher detail geometry editing methods are in - * remove LOD completely - * ways to reduce sparklies? - - render water only where needed... or with some sort of zbuffer trick? - * faster cube occlusion culling by checking distance from each cube rather than raytracing... do so using quad tree and in direction of viewer -- gluPerspective wrong fov? -- fake opengl light for models? (not for bridges) -- do something about people having wrong maps etc / map cheating / make auto map download -- super simple CTF using pickup - drop off idea pxtl ? no team spawns required! -- allow monster spawn on trigger? -- VWEP (slith has own weapons), muzzle flash? -- About 2 out of 3 times I start Cube (Linux Version), the fps counter displays -214748 -- make water render not everywhere to reduce sparklies -- vertex/fragment programs - global: millis, eye, eyeorient - vertex: normal, Svec?, Tvec? closest light / light dir vec ? - opengl: matrices etc. - or instead simple regcombine setup? - - shaders stuff - - allow texture rotation - - glow -- under some circumstances, players can not be hurt in multiplayer (wrong lifetime???) - (after any spawn, also in ffa, lasts until disconnect) -- out of memory bug (just on or after new player join). -- mapmodels above eachother gives incorrect physics -- fps reporting on demos.../ teleport to spawn? -- improve sounds -#1 Ability to get attributes of a single cube at $xsel, $ysel. -#3 Ability to get the current users position (or cursor position, X,Y & height) -#5 Provide Absolute mode in at least functions edittex,editheight,vdelta. - -check: -- no text when dead? / round over while dead? -> more lag than appearent -- can't spawn when 1 is lagging -- sendmap hang? -- specator mode for arena also -- avoid spawn next to eachother : most difficult in arena because spawns all at same time, meaning you can't check other people's position -- show last persons health? -- bigger monsters can get stuck on top of mapmodels -- disable hudgun when dead -- make disconnection faster (now can last up to 60 secs)... what features depend on this? - - -TODO: -===== -recent stuff: -- try and debug depth read? GL_DEPTH_SCALE/GL_DEPTH_BIAS -- detect if sw driver? glXIsDirect(dpy, ctx) (can't get context from SDL) / glGetString(GL_VENDOR/RENDERER) (many HW drivers use mesa as base) -- make server port configurable? -- not reproducable: When you pop out of edit mode where a bridge is right under a ceiling you get stuck. -- Also, when you stay over a vertical jumppad it pushes you up by decreasing amounts and then after a few rounds of that it pushes you really high. That's not necessarily bad, but it is weird. -- jumppads don't work for monsters -- try to go FMOD-only? -- new weapon models? -- profiling / replace gluBuild2DMipmaps, its too slow -- maxplayers? -- protocol: send map checksums so checking can happen? - -rendering: -- integrate fisheye mod? -- fix large overdraw on fog culling? -- particles look v bad in fog/water -- allow up to fov 135 or so (need to tweak various frustrum culling optis) -- experiment with alpha textures & shiny textures for second unit... -> generate normals only for surfs that use it -- try out VAR without copying? -> almost no speedup, too cpu bound -- use VAR on chunks of the world -- speed up md2 render -> put into array too... maybe can render multiple walking monsters from same array? (since same time moment) -- texture precache? -- try out also up/down occlusion culling? -- fix corner textures, and make all 4 walls L-R -- render sky polys more efficiently? can't be done with light. need to collect "sky space" and render seperately -- reassign mip 1 quads / mip n quads for big open maps -- skybox roll not working yet -- cull explosions/particles etc outside frustrum -- stripify walls? -- instead of having defer 0 or 1, have a range that rates its visible disruptiveness - -world structure / editing: -- make mip opti tags compliant? -- generic push/pull for vdeltas -- how to allow editing features as trigger scripts (since they reset triggers/monsters). - other triggers... certainly a NULL trigger that affects no tags - floor/ceil height, texture change, solid, - spawn stuff? - waterlevel raise/lower - could select tag areas and then do edit callback.. problem is how to generically restore them -- need more commands that influence the world in a gameplay way for trigger scripts -- ror by models? -- hom in custom arch? -- vdelta mipping often wrong -- improve selecting in void and selecting heightmaps / selecting areas with much height variation -- "platform" extra floors or something similarly simple? -- generate terrain as edit command (also for 2x2 and 4x4 mips!) -- arbitrary shapes a la archvertex -- flip/rotate commands -- off-vertex feature? -- coop copy & paste / other ops -- make showmip show acurate values (use real light values) -- make mapopt atleast also do 4x4 -- intermission cam entity? -- make "corner" equalize height automatically? -- "are you sure" when edits have been made -- wr: render too high wall if z is mip mapped (1 unit indent) -- wr: walls behind corners -- wr: SEMISOLID still causes faces in the floor -> extend issemi -- hom: normal walls next to huge mips (on DM2?) -- hom: a 2x2 solid next to only a partial HF [workaround: cut up wall] -- hom: a 2x2 solid next to concave 2x2 hf [workaround: cut up wall] -- hom: cap on a equal height floor/ceil [workaround: make height diff] -- allow 2 or more levels? -- multiple selections -- each client in editmode should be able to see the selection outline of other clients that are in editmode. -- expand random map gen ? -- texture language: each texture number becomes a little program for - texturing. [ warning: must be in both worldrender & mipmapping code - for correct results. ] possibilities: - * all the shader tricks - * random textures: select any from a set - * checkerboard tile 2 textures - * auto border tiling (when texture touches same height/texture - or not): textures specified (any amount): - 1. texture center - 2. texture border (replaces 1 when touching changing blocks) - 3. texture corner (replaces 2 on 2 touching) - 4. inner corner (replaces 2/3 when indented corner) - will work on both floors and walls, and will make nice - texturing with rims _extremely_ easy. - -script / console: -- make editing-only binds? -- delay "music" and "loadsky" commands, such that they do not load multiple times. -- make onrelease work everywhere? -- beep on "say" -- save config.cfg / move autoexec.cfg to last? -- international keyboards? - -multiplayer: -- insta arena -- accumulate accuracy / efficiency / rails in a row / frags in a row stats -- arena numplayers>1 & other recent addons / rename "arena" to "last man standing" -- allow servers to set port -- render CS_LAGGED differently? -- spectator mode -- make everyone spec for duel/team modes -- admin feature -- mode 2 duel? -- frags should be in c2s welcome packet -- simplify tp: only red/blue, otherwise spectate -- add time spend on server to scoreboard -- specify distance in some way for network ? distance / occlusion / standing still / dead -- compress some things about network stream? -- all physics pushes don't affect players across the network -- servers should send map checksums, small differences in map entities pos could potentially cause crashes, same for out of range ents on clients. -- implement http get for masterserver? -- vote: either explain it or make it easier.. generally make a multiplayer connect walkthru -- rethink map get? make it even easier??? -- locking of in-progress games -- when switching to map that player doesnt have... something better should happen than keep them in old map with floating players -- capture the chicken mode? other different DM modes? domination? holy wars? -- teamplay scores don't record frags of disconnected players -- teamplay binds -- ctf mode -- character selection... maybe also sounds... relatively easy, maybe share monster/player stuff more -- when failed to connect, not clear not connected on map reload? -- time remaining not clearly printed... -- interpolated demo playback? -- dont allow duplicate player names -- make carrots work correctly in mp, and various other things in mp -- maybe also make deaths instant -- console scores -- can jump thru players easily when both move.. make sure offset to correct side? -- add network interpolation as an option? -- different pain sounds for levels of damage applied, or level of health? - -SP/monsters -- less <10h -> scared -- monster weapons go thru mapmodels. -- lava/water hurt -- think about save game / copy stats for sp -- think about introducing rpg style elements: weapon/stat upgrades, inventory items -- wake up others nearby? -- secrets -- barrels -- gibs for health? -- other interesting monster behaviour... pacifist until first shot? -- make monsters flee -- spawn sound? -- maybe make 2 versions of each monster to make up for the lack of them (different skins?) -- player/monster on top of eachother -- coop (not easy, requires lots of sync & bw management). -- use tracing code also for player1? too many problems with it... -- new trigger types... floor raise/lower, secrets - -gameplay: -- sky hurt -- splash sound frequently when looking straight up from water -- increase amount of blood / better particle lifetimes -- think of how make kills etc more satisfying -- dynblight when player shoots -- make some of the gameplay code in script? problem, for multiplayer this will make cheating easy. -- overhead map: show open & closed doors -- fun: racing game easter egg -- use Mix_SetPosition() for positional sound -- anim frames for death -- - fix the shotgun behavior :) -- auto weapon change? -- traceline related: - * replace readpixels since its very problematic? - -> must solve by software, can't disable depth buffer for models - * RL stops behind chasing player - * RL path must be cut short on direct hit - * guns shots go thru players, and they can miss if model sticks in front - of bounding box - -physics -- optimise stair physics for 2x1 slopes -> interferes with stairs -- speed up monster-monster and monster-mapmodel collision -- for 1 cube wide obstackles, push player past it -- give player velocity coming out of teleport -> direction he's facing -- improve slant sliding -- improve heightfield physics? - -light stuffs: -- blend out dynlight longer? -- sun lighting? -- player shadows? -- quad damage player dynlight? -- switchable lights? lights that oscillate in strength? - -changes for bigger landscapes: -- hf: hom next to big mips / water height -- make correct collision for slopes -- push/pull vertex tools -- different scale: *2 in xy, and /2 in z, ratio is then 1:4 (so float hf can be removed) -- more tree/plant map models -- optimize certain code for 2k^2 maps.. lighting? -- cut&paste entities also? -- limit occlusion distance? - -non-code: -- improve default keybinds for editing -> docs / find better keys for modifiers? -- email all model authors -- check all dm spawns big enough for monsters -- sounds! monster see -- more sp maps? -- better tree skin / more models? -- add metl3? -- dgtex? -- q3 tree mapmodels? - - - diff --git a/source/src/audiomanager.cpp b/source/src/audiomanager.cpp index 55514884..e3860f4f 100644 --- a/source/src/audiomanager.cpp +++ b/source/src/audiomanager.cpp @@ -42,7 +42,7 @@ void audiomanager::initsound() copystring(d, "Audio devices: "); // null separated device string - for(const ALchar *c = devices; c[strlen(c)+1]; c += strlen(c)+1) + for(const ALchar *c = devices; *c; c += strlen(c)+1) { if(c!=devices) concatstring(d, ", "); concatstring(d, c); @@ -268,11 +268,12 @@ void audiomanager::soundcleanup() mapsounds.shrink(0); locations.deletecontents(); gamesounds.shrink(0); - bufferpool.clear(); // kill scheduler sourcescheduler::instance().reset(); + bufferpool.clear(); + // shutdown openal alcMakeContextCurrent(NULL); if(context) alcDestroyContext(context); @@ -559,7 +560,7 @@ void audiomanager::updateaudio() alcSuspendContext(context); // don't process sounds while we mess around - bool alive = player1->state!=CS_DEAD; + bool alive = player1->state==CS_ALIVE; bool firstperson = camera1==player1 || (player1->isspectating() && player1->spectatemode==SM_DEATHCAM); // footsteps diff --git a/source/src/bot/bot.h b/source/src/bot/bot.h index 57d7b162..317d6917 100644 --- a/source/src/bot/bot.h +++ b/source/src/bot/bot.h @@ -355,7 +355,6 @@ class CBotManager void LoadBotNamesFile(void); const char *GetBotName(void); void LoadBotTeamsFile(void); - const char *GetBotTeam(void); void CreateSkillData(void); void InitSkillData(void); void InitBotItems(void); @@ -398,6 +397,7 @@ public: void ViewBot(void); void CalculateMaxAStarCount(void); void PickNextTrigger(void); + const char *GetBotTeam(void); void MakeBotFileName(const char *szFileName, const char *szDir1, const char *szDir2, char *szOutput); diff --git a/source/src/client.cpp b/source/src/client.cpp index 5e025c59..708c2ed5 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -342,7 +342,11 @@ COMMAND(go_to, "ffs"); void current_version(char *text) { int version = atoi(text); - if (version && AC_VERSIONping > 0) conoutf("%d. %s (%d ms)", i+1, serv->addr, serv->ping); - else conoutf("%d. %s (did not reply)", i+1, serv->addr); + if(serv->ping > 0) clientlogf("%d. %s (%d ms)", i+1, serv->addr, serv->ping); + else clientlogf("%d. %s (did not reply)", i+1, serv->addr); } SDL_mutexV(pingpcksrvlock); @@ -987,16 +991,16 @@ void sortpckservers() } COMMAND(sortpckservers, ""); -static size_t write_callback(void *ptr, size_t size, size_t nmemb, FILE *stream) +size_t write_callback(void *ptr, size_t size, size_t nmemb, FILE *stream) { return fwrite(ptr, size, nmemb, stream); } -static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) +int progress_callback_dlpackage(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { package *pck = (package *)clientp; loadingscreen(_("downloading package %d out of %d...\n%s %.0f/%.0f KB (%.1f%%)\n(ESC to cancel)"), pck->number + 1, pck->number + pendingpackages.numelems, - pck->name, dlnow/double(1000.0), dltotal/double(1000.0), dltotal == 0 ? 0 : (dlnow/dltotal * double(100.0))); + pck->name, dlnow/double(1024.0), dltotal/double(1024.0), dltotal == 0 ? 0 : (dlnow/dltotal * double(100.0))); if(interceptkey(SDLK_ESCAPE)) { canceldownloads = true; @@ -1069,7 +1073,7 @@ double dlpackage(package *pck) curl_easy_setopt(pck->curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(pck->curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(pck->curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(pck->curl, CURLOPT_PROGRESSFUNCTION, progress_callback); + curl_easy_setopt(pck->curl, CURLOPT_PROGRESSFUNCTION, progress_callback_dlpackage); curl_easy_setopt(pck->curl, CURLOPT_PROGRESSDATA, pck); curl_easy_setopt(pck->curl, CURLOPT_CONNECTTIMEOUT, 10); // generous timeout for Bukz ;) result = curl_easy_perform(pck->curl); diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index bbba7a37..c6d7407f 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -718,6 +718,10 @@ void respawnself() if( m_mp(gamemode) ) addmsg(SV_TRYSPAWN, "r"); else { + if(team_isspect(player1->team)) + { + addmsg(SV_SWITCHTEAM, "ri", m_teammode ? teamatoi(BotManager.GetBotTeam()) : rnd(2)); + } showscores(false); setscope(false); setburst(false); @@ -959,20 +963,21 @@ void timeupdate(int milliscur, int millismax) conoutf(_("intermission:")); conoutf(_("game has ended!")); consolescores(); - ((sniperrifle *)player1->weaponsel)->scoped = false; showscores(true); exechook(HOOK_SP_MP, "start_intermission", ""); } else { extern int clockdisplay; // only output to console if no hud-clock is being shown + int sec = 60 - ( (gametimecurrent + ( lastmillis - lastgametimeupdate ) ) / 1000) % 60; if(minutesremaining==1) { audiomgr.musicsuggest(M_LASTMINUTE1 + rnd(2), 70*1000, true); - hudoutf("1 minute left!"); + hudoutf("%s1 minute left!", sec==60 ? "" : "less than "); exechook(HOOK_SP_MP, "onLastMin", ""); } - else if(clockdisplay==0) conoutf(_("time remaining: %d minutes"), minutesremaining); + else if(!clockdisplay) conoutf(_("time remaining: %d minutes"), minutesremaining); + else clientlogf(_("time remaining: %d minutes"), minutesremaining); } } @@ -1320,7 +1325,7 @@ char *votestring(int type, const char *arg1, const char *arg2, const char *arg3) if(arg3 && arg3[0]) { int time = atoi(arg3); - if(time > 0 && time != defaultgamelimit(n)) formatstring(timestr)(" for %d minutes", time); + if(time > 0 && time != defaultgamelimit(n)) formatstring(timestr)(" for %d minute%s", time, time == 1 ? "" : "s"); } if ( n >= GMODE_NUM ) @@ -1625,14 +1630,15 @@ void refreshsopmenu(void *menu, bool init) } extern bool watchingdemo; +VARP(spectatepersistent,0,1,1); // rotate through all spec-able players playerent *updatefollowplayer(int shiftdirection) { + playerent *f = players.inrange(player1->followplayercn) ? players[player1->followplayercn] : NULL; if(!shiftdirection) { - playerent *f = players.inrange(player1->followplayercn) ? players[player1->followplayercn] : NULL; - if(f && (watchingdemo || !f->isspectating())) return f; + if(f && (watchingdemo || !f->isspectating() || spectatepersistent || (!spectatepersistent && !m_arena) )) return f; } // collect spec-able players @@ -1643,7 +1649,7 @@ playerent *updatefollowplayer(int shiftdirection) if(players[i]->state==CS_DEAD || players[i]->isspectating()) continue; available.add(players[i]); } - if(!available.length()) return NULL; + if(!available.length()) return f; // rotate int oldidx = -1; @@ -1666,7 +1672,7 @@ void spectate() void setfollowplayer(int cn) { // silently ignores invalid player-cn value passed - if(players.inrange(cn) && players[cn]) + if(players.inrange(cn) && players[cn] && !m_botmode) { if(!(m_teammode && player1->team != TEAM_SPECT && !watchingdemo && team_base(players[cn]->team) != team_base(player1->team))) { @@ -1680,7 +1686,7 @@ void setfollowplayer(int cn) void spectatemode(int mode) { if((player1->state != CS_DEAD && player1->state != CS_SPECTATE && !team_isspect(player1->team)) || (!m_teammode && !team_isspect(player1->team) && servstate.mastermode == MM_MATCH)) return; // during ffa matches only SPECTATORS can spectate - if(mode == player1->spectatemode) return; + if(mode == player1->spectatemode || (m_botmode && mode != SM_FLY)) return; showscores(false); switch(mode) { @@ -1729,7 +1735,7 @@ void togglespect() // cycle through all spectating modes void changefollowplayer(int shift) { - updatefollowplayer(shift); + if(!m_botmode) updatefollowplayer(shift); } COMMAND(spectate, ""); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 5cd38e72..ba53cf20 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -47,7 +47,7 @@ bool changemapserv(char *name, int mode, int download, int revision) // f bool revmatch = hdr.maprevision == revision || revision == 0; if(watchingdemo) { - if(!revmatch) conoutf(_("%c3demo was recorded on map revision %d, you have map revision %d"), CC, revision, hdr.maprevision); + if(loaded && !revmatch) conoutf(_("%c3demo was recorded on map revision %d, you have map revision %d"), CC, revision, hdr.maprevision); } else { @@ -1067,7 +1067,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) playerent *alive = getclient(acn); conoutf(_("the round is over! next round in 5 seconds...")); if(m_botmode && acn==-2) hudoutf(_("the bots have won the round!")); - else if(!alive) hudoutf(_("everyone died!")); + else if(acn==-1) hudoutf(_("everyone died!")); else if(m_teammode) hudoutf(_("team %s has won the round!"), team_string(alive->team)); else if(alive==player1) hudoutf(_("you are the survivor!")); else hudoutf(_("%s is the survivor!"), colorname(alive)); @@ -1169,7 +1169,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) conoutf(_("player %s switched to team %s"), pls, nts); // new message break; case FTR_AUTOTEAM: - if(watchingdemo) conoutf(_("the server forced %s to team %s"), colorname(d), nts); + if(watchingdemo || team_isspect(player1->team)) conoutf(_("the server forced %s to team %s"), colorname(d), nts); else hudoutf(_("the server forced %s to %s team"), colorname(d), et ? _("the enemy") : _("your")); break; } diff --git a/source/src/command.cpp b/source/src/command.cpp index b2c7c1c9..c76a4478 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -1448,6 +1448,7 @@ COMMANDF(rnd, "i", (int *a) { intret(*a>0 ? rnd(*a) : 0); }); #ifndef STANDALONE void writecfg() { + filerotate("config/saved", "cfg", CONFIGROTATEMAX); // keep five old config sets stream *f = openfile(path("config/saved.cfg", true), "w"); if(!f) return; f->printf("// automatically written on exit, DO NOT MODIFY\n// delete this file to have defaults.cfg overwrite these settings\n// modify settings in game, or put settings in autoexec.cfg to override anything\n\n"); @@ -1495,7 +1496,14 @@ void writecfg() writebinds(f); f->printf("\n// aliases\n\n"); enumerate(*idents, ident, id, - if(id.type==ID_ALIAS && id.persist && id.action[0]) + if(id.type==ID_ALIAS && id.persist && id.action[0] && strncmp(id.name, "demodesc_", 9)) + { + f->printf("%s = [%s]\n", id.name, id.action); + } + ); + f->printf("\n// demo descriptions\n\n"); + enumerate(*idents, ident, id, + if(id.type==ID_ALIAS && id.persist && id.action[0] && !strncmp(id.name, "demodesc_", 9) && id.action) { f->printf("%s = [%s]\n", id.name, id.action); } diff --git a/source/src/console.cpp b/source/src/console.cpp index 6f4443b1..8093a61f 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -94,6 +94,10 @@ COMMANDN(toggleconsole, toggleconsole, ""); void renderconsole() { con.render(); } +stream *clientlogfile = NULL; +vector *bootclientlog = new vector; +int clientloglinesremaining = INT_MAX; + void clientlogf(const char *s, ...) { defvformatstring(sp, s, s); @@ -105,6 +109,12 @@ void clientlogf(const char *s, ...) { // break into single lines first if((p = strchr(l, '\n'))) *p = '\0'; printf("%s%s\n", ts, l); + if(clientlogfile) + { + clientlogfile->printf("%s%s\n", ts, l); + if(--clientloglinesremaining <= 0) DELETEP(clientlogfile); + } + else if(bootclientlog) cvecprintf(*bootclientlog, "%s%s\n", ts, l); l = p + 1; } while(p); diff --git a/source/src/cube.h b/source/src/cube.h index dcecccce..cd20b747 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -66,6 +66,7 @@ extern int verbose; #define AC_MASTER_HTTP 1 // default #define AC_MASTER_RAW 0 #define MAXCL 16 +#define CONFIGROTATEMAX 5 // keep 5 old versions of saved.cfg and init.cfg around #include "protos.h" // external function decls diff --git a/source/src/editing.cpp b/source/src/editing.cpp index f858ea8b..8d5e1ff9 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -26,8 +26,8 @@ sqr rtex; VAR(editing, 1, 0, 0); VAR(unsavededits, 1, 0, 0); -bool editmetakeydown = false; -COMMANDF(editmeta, "d", (bool on) { editmetakeydown = on; } ); +VAR(editmetakeydown, 1, 0, 0); +COMMANDF(editmeta, "d", (bool on) { editmetakeydown = on ? 1 : 0; } ); void toggleedit(bool force) { @@ -175,6 +175,12 @@ COMMANDF(showtagclipfocus, "d", (bool on) { showtagclipfocus = on; } ); VAR(showtagclips, 0, 1, 1); FVAR(tagcliplinewidth, 0.2, 1, 3); +inline void forceinsideborders(int &xy) +{ + if(xy < MINBORD) xy = MINBORD; + if(xy >= ssize - MINBORD) xy = ssize - MINBORD - 1; +} + void cursorupdate() // called every frame from hud { flrceil = ((int)(camera1->pitch>=0))*2; @@ -188,7 +194,13 @@ void cursorupdate() // called every frame fr cx = (int)x; cy = (int)y; - if(OUTBORD(cx, cy)) return; + if(OUTBORD(cx, cy)) + { + forceinsideborders(cx); + forceinsideborders(cy); + return; + } + sqr *s = S(cx,cy); if(fabs(sheight(s,s,z)-z)>1) // selected wall @@ -199,7 +211,12 @@ void cursorupdate() // called every frame fr cx = (int)x; cy = (int)y; - if(OUTBORD(cx, cy)) return; + if(OUTBORD(cx, cy)) + { + forceinsideborders(cx); + forceinsideborders(cy); + return; + } } if(dragging) makesel(false); diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 43125f3d..80c87a06 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -67,7 +67,7 @@ void rendermapmodels() { mapmodelinfo &mmi = getmminfo(e.attr2); if(!&mmi) continue; - rendermodel(mmi.name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3), (float)((e.attr1+7)-(e.attr1+7)%15), 0, 10.0f); + rendermodel(mmi.name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3), e.attr1 / 4.0f, 0, 10.0f); } } } @@ -218,7 +218,7 @@ void renderentities() if(e.type==CTF_FLAG) { defformatstring(path)("pickups/flags/%s", team_basestring(e.attr2)); - rendermodel(path, ANIM_FLAG|ANIM_LOOP, 0, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor), (float)((e.attr1+7)-(e.attr1+7)%15), 0, 120.0f); + rendermodel(path, ANIM_FLAG|ANIM_LOOP, 0, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor), e.attr1 / 4.0f, 0, 120.0f); } else if((e.type == CLIP || e.type == PLCLIP) && showclips && !stenciling) renderclip(e); else if(e.type == MAPMODEL && showclips && showmodelclipping && !stenciling) @@ -271,7 +271,7 @@ void renderentities() if(OUTBORD(f.pos.x, f.pos.y)) break; entity &e = *f.flagent; defformatstring(path)("pickups/flags/%s%s", m_ktf ? "" : team_basestring(i), m_htf ? "_htf" : m_ktf ? "ktf" : ""); - if(f.flagent->spawned) rendermodel(path, ANIM_FLAG|ANIM_LOOP, 0, 0, vec(f.pos.x, f.pos.y, f.state==CTFF_INBASE ? (float)S(int(f.pos.x), int(f.pos.y))->floor : f.pos.z), (float)((e.attr1+7)-(e.attr1+7)%15), 0, 120.0f); + if(f.flagent->spawned) rendermodel(path, ANIM_FLAG|ANIM_LOOP, 0, 0, vec(f.pos.x, f.pos.y, f.state==CTFF_INBASE ? (float)S(int(f.pos.x), int(f.pos.y))->floor : f.pos.z), e.attr1 / 4.0f, 0, 120.0f); break; } case CTFF_IDLE: diff --git a/source/src/entity.h b/source/src/entity.h index 286f644b..e2ad32d5 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -6,13 +6,13 @@ enum // static entity types I_CLIPS, I_AMMO, I_GRENADE, I_HEALTH, I_HELMET, I_ARMOUR, I_AKIMBO, // helmet : 2010may16 -> mapversion:8 - MAPMODEL, // attr1 = angle, attr2 = idx + MAPMODEL, // attr1 = angle, attr2 = idx, attr3 = elevation, attr4 = texture CARROT, // attr1 = tag, attr2 = type LADDER, CTF_FLAG, // attr1 = angle, attr2 = red/blue SOUND, - CLIP, - PLCLIP, + CLIP, // attr1 = elevation, attr2 = xradius, attr3 = yradius, attr4 = height + PLCLIP, // attr1 = elevation, attr2 = xradius, attr3 = yradius, attr4 = height MAXENTTYPES }; @@ -462,13 +462,13 @@ public: extern void zapplayerflags(playerent *owner); extern void cleanplayervotes(playerent *owner); extern physent *camera1; - extern void togglespect(); + extern void spectatemode(int mode); removebounceents(this); audiomgr.detachsounds(this); removedynlights(this); zapplayerflags(this); cleanplayervotes(this); - if(this==camera1) togglespect(); + if(this==camera1) spectatemode(SM_FOLLOW1ST); } void damageroll(float damage) diff --git a/source/src/main.cpp b/source/src/main.cpp index 1c2b39b8..2c89e778 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -29,7 +29,8 @@ VAR(resetcfg, 0, 0, 1); void quit() // normal exit { - const char *onquit = getalias("onQuit"); + const char *mapstartonce = getalias("mapstartonce"), *onquit = getalias("onQuit"); + if(mapstartonce && mapstartonce[0]) alias("mapstartonce", ""); if(onquit && onquit[0]) { execute(onquit); alias("onQuit", ""); } extern void writeinitcfg(); writeinitcfg(); @@ -41,6 +42,8 @@ void quit() // normal exit writeallxmaps(); cleanup(NULL); popscontext(); + extern stream *clientlogfile; + DELETEP(clientlogfile); exit(EXIT_SUCCESS); } @@ -121,6 +124,7 @@ VARF(fullscreen, 0, 1, 1, setfullscreen(fullscreen!=0)); void writeinitcfg() { if(!restoredinits) return; + filerotate("config/init", "cfg", CONFIGROTATEMAX); // keep five old init config sets stream *f = openfile(path("config/init.cfg", true), "w"); if(!f) return; f->printf("// automatically written on exit, DO NOT MODIFY\n// modify settings in game\n"); @@ -879,7 +883,7 @@ void checkinput() break; } } - mousemove(tdx, tdy); + if(tdx || tdy) mousemove(tdx, tdy); } VARF(gamespeed, 10, 100, 1000, if(multiplayer()) gamespeed = 100); @@ -1021,6 +1025,18 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) } #endif +void initclientlog() // rotate old logfiles and create new one +{ + filerotate("clientlog", "txt", 5); // keep five old logfiles + clientlogfile = openfile("clientlog.txt", "w"); + if(clientlogfile) + { + if(bootclientlog && bootclientlog->length()) clientlogfile->write(bootclientlog->getbuf(), bootclientlog->length()); + } + else conoutf("could not create logfile \"%s\"", findfile("clientlog.txt", "w")); + DELETEP(bootclientlog); +} + VARP(compatibilitymode, 0, 1, 1); // FIXME : find a better place to put this ? int main(int argc, char **argv) @@ -1043,6 +1059,8 @@ int main(int argc, char **argv) string servername, password; int serverport; + if(bootclientlog) cvecprintf(*bootclientlog, "######## start logging: %s\n", timestring(true)); + const char *initmap = rndmapname(); pushscontext(IEXC_CFG); @@ -1052,6 +1070,7 @@ int main(int argc, char **argv) initing = INIT_RESET; for(int i = 1; imajor, sdlver->minor, sdlver->patch)) + clientlogf("SDL: compiled version " SDLVERSIONSTRING ", linked version %u.%u.%u", sdlver->major, sdlver->minor, sdlver->patch); #if 0 if(highprocesspriority) setprocesspriority(true); #endif - if (!dedicated) initlog("net"); + if (!dedicated) initlog("net (" STRINGIFY(ENET_VERSION_MAJOR) "." STRINGIFY(ENET_VERSION_MINOR) "." STRINGIFY(ENET_VERSION_PATCH) ")"); if(enet_initialize()<0) fatal("Unable to initialise network module"); if (!dedicated) initclient(); //FIXME the server executed in this way does not catch the SIGTERM or ^C initserver(dedicated,argc,argv); // never returns if dedicated - initlog("world"); + initlog("world (" STRINGIFY(AC_VERSION) ")"); empty_world(7, true); initlog("video: sdl"); @@ -1170,9 +1196,6 @@ int main(int argc, char **argv) notexture = noworldtexture = textureload("packages/misc/notexture.jpg"); if(!notexture) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)"); - nomodel = loadmodel("misc/gib01", -1); //FIXME: need actual placeholder model - if(!notexture) fatal("could not find core models"); - initlog("console"); per_idents = false; // Main font file, all other font files execute from here. @@ -1291,6 +1314,11 @@ int main(int argc, char **argv) #ifdef _DEBUG int lastflush = 0; #endif + if(scl.logident[0]) + { // "-Nxxx" sets the number of client log lines to xxx (after init) + extern int clientloglinesremaining; + clientloglinesremaining = atoi(scl.logident); // dual-use for scl.logident + } for(;;) { static int frames = 0; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 4dde73ee..1dd46a5d 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -15,7 +15,7 @@ char *getfiledesc(const char *dir, const char *name, const char *ext) if(!browsefiledesc || !dir || !name || !ext) return NULL; defformatstring(fn)("%s/%s.%s", dir, name, ext); path(fn); - string text; + string text, demodescalias; if(!strcmp(ext, "dmo")) { stream *f = opengzfile(fn, "rb"); @@ -33,6 +33,15 @@ char *getfiledesc(const char *dir, const char *name, const char *ext) } formatstring(text)("%s%s", tag, hdr.desc); text[DHDR_DESCCHARS - 1] = '\0'; + formatstring(demodescalias)("demodesc_%s", name); + const char *customdesc = getalias(demodescalias); + if(customdesc) + { + int textlen = strlen(text); + concatformatstring(text, " \n\f4(Description: \f0%s\f4)", customdesc); + ASSERT(MAXSTRLEN > 2 * DHDR_DESCCHARS); + text[textlen + DHDR_DESCCHARS - 1] = '\0'; + } return newstring(text); } else if(!strcmp(ext, "cgz")) @@ -293,7 +302,7 @@ struct mitemimagemanual : mitemmanual if(image) { glBindTexture(GL_TEXTURE_2D, image->id); - glDisable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor3f(1, 1, 1); xs = (FONTH*image->xs)/image->ys; glBegin(GL_TRIANGLE_STRIP); @@ -303,7 +312,6 @@ struct mitemimagemanual : mitemmanual glTexCoord2f(1, 1); glVertex2f(x+xs, y+FONTH); glEnd(); xtraverts += 4; - glEnable(GL_BLEND); } draw_text(text, !image || *text == '\t' ? x : x+xs + FONTH/2, y); if(altfont && strchr(text, '\a')) @@ -326,8 +334,8 @@ struct mitemimagemanual : mitemmanual int xs = (2 * VIRTW - w) / 5, ys = (xs * image->ys) / image->xs; x = (6 * VIRTW + w - 2 * xs) / 4; y = VIRTH - ys / 2; blendbox(x - FONTH, y - FONTH, x + xs + FONTH, y + ys + FONTH, false); - glBindTexture(GL_TEXTURE_2D, image->id); // I just copy&pasted this... - glDisable(GL_BLEND); + glBindTexture(GL_TEXTURE_2D, image->id); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor3f(1, 1, 1); glBegin(GL_TRIANGLE_STRIP); glTexCoord2f(0, 0); glVertex2f(x, y); @@ -336,7 +344,6 @@ struct mitemimagemanual : mitemmanual glTexCoord2f(1, 1); glVertex2f(x+xs, y+ys); glEnd(); xtraverts += 4; - glEnable(GL_BLEND); } } else mitemmanual::render(x, y, w); @@ -1094,12 +1101,14 @@ bool menukey(int code, bool isdown, int unicode, SDLMod mod) case SDLK_UP: case SDL_AC_BUTTON_WHEELUP: if(iskeypressed(SDLK_LCTRL)) return menukey(SDLK_LEFT, isdown, 0); + if(iskeypressed(SDLK_LALT)) return menukey(SDLK_RIGHTBRACKET, isdown, 0); if(!curmenu->allowinput) return false; menusel--; break; case SDLK_DOWN: case SDL_AC_BUTTON_WHEELDOWN: if(iskeypressed(SDLK_LCTRL)) return menukey(SDLK_RIGHT, isdown, 0); + if(iskeypressed(SDLK_LALT)) return menukey(SDLK_LEFTBRACKET, isdown, 0); if(!curmenu->allowinput) return false; menusel++; break; diff --git a/source/src/physics.cpp b/source/src/physics.cpp index a28c6ebb..f5e0b695 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -484,7 +484,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) const float climbspeed = 1.0f; if(pl->type==ENT_BOT && pl->state == CS_ALIVE) pl->vel.z = climbspeed; // bots climb upwards only - else if(pl->type==ENT_PLAYER) + else if(pl->type==ENT_PLAYER && pl->state == CS_ALIVE) { if(((playerent *)pl)->k_up) pl->vel.z = climbspeed; else if(((playerent *)pl)->k_down) pl->vel.z = -climbspeed; @@ -694,7 +694,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) { if(!pl->lastsplash || lastmillis-pl->lastsplash>500) { - audiomgr.playsound(S_SPLASH2, pl); + audiomgr.playsound(S_SPLASH2, &pl->o); pl->lastsplash = lastmillis; } if(pl==player1) pl->vel.z = 0; @@ -832,12 +832,6 @@ void crouch(bool on) player1->trycrouch = on; } -int inWater(int *type) -{ - if(hdr.waterlevel > (*type ? player1->o.z : (player1->o.z - player1->eyeheight))) return 1; - else return 0; -} - COMMAND(backward, "d"); COMMAND(forward, "d"); COMMAND(left, "d"); @@ -845,7 +839,6 @@ COMMAND(right, "d"); COMMANDN(jump, jumpn, "d"); COMMAND(attack, "d"); COMMAND(crouch, "d"); -COMMAND(inWater, "i"); void fixcamerarange(physent *cam) { diff --git a/source/src/protocol.h b/source/src/protocol.h index 9e4863b9..b489304c 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -126,6 +126,7 @@ enum #define m_noprimary (m_pistol || m_lss) #define m_noguns (m_nopistol && m_noprimary) #define m_arena (m_lms || m_lss || m_osok) +#define m_autospawn (gamemode == 0 || gamemode == 2 || gamemode == 6 || gamemode == 13 || gamemode == 16) #define m_teammode (gamemode==0 || gamemode==4 || gamemode==5 || gamemode==7 || gamemode==11 || gamemode==13 || gamemode==14 || gamemode==16 || gamemode==17 || gamemode==20 || gamemode==21) #define m_tarena (m_arena && m_teammode) #define m_botmode (gamemode==7 || gamemode == 8 || gamemode==12 || (gamemode>=18 && gamemode<=21)) diff --git a/source/src/protos.h b/source/src/protos.h index b2682441..774c56c7 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -52,6 +52,9 @@ struct authkey // for AUTH }; // console +extern stream *clientlogfile; +extern vector *bootclientlog; + extern void keypress(int code, bool isdown, int cooked, SDLMod mod = KMOD_NONE); extern int rendercommand(int x, int y, int w); extern void renderconsole(); @@ -480,6 +483,7 @@ extern void teamflagscores(int &team1, int &team2); extern void setupworld(int factor); extern void sqrdefault(sqr *s); extern bool worldbordercheck(int x1, int x2, int y1, int y2, int z1, int z2); +extern void calcmapdims(); extern bool empty_world(int factor, bool force); extern void remip(const block &b, int level = 0); extern void remipmore(const block &b, int level = 0); @@ -676,7 +680,7 @@ extern bool addscorchmark(vec &o, float radius = 7); extern void render_particles(int time, int typemask = ~0); // worldio -extern int mapdims[8]; +extern mapdim mapdims; extern const char *setnames(const char *name); extern void save_world(char *mname, bool skipoptimise = false, bool addcomfort = false); extern bool load_world(char *mname); @@ -735,7 +739,6 @@ extern void clearmodelbatches(); extern mapmodelinfo &getmminfo(int i); extern int findanim(const char *name); extern void loadskin(const char *dir, const char *altdir, Texture *&skin); -extern model *nomodel; extern model *loadmodel(const char *name, int i = -1, bool trydl = false); extern void preload_playermodels(); extern void preload_entmodels(); diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 06b928fe..dd8b1c32 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -506,9 +506,9 @@ void recomputecamera() case SM_OVERVIEW: { // TODO : fix water rendering - camera1->o.x = mapdims[0] + mapdims[4]/2; - camera1->o.y = mapdims[1] + mapdims[5]/2; - camera1->o.z = mapdims[7] + 1; + camera1->o.x = mapdims.xm; + camera1->o.y = mapdims.ym; + camera1->o.z = mapdims.maxceil + 1; camera1->pitch = -90; camera1->yaw = 0; @@ -605,7 +605,7 @@ GLuint reflecttex = 0, refracttex = 0; int reflectlastsize = 0; VARP(reflectsize, 6, 8, 10); -VAR(reflectclip, 0, 3, 100); +VAR(reflectclip, 0, 1, 100); VARP(waterreflect, 0, 1, 1); VARP(waterrefract, 0, 0, 1); VAR(reflectscissor, 0, 1, 1); @@ -798,14 +798,14 @@ void drawminimap(int w, int h) physent minicam; camera1 = &minicam; camera1->type = ENT_CAMERA; - camera1->o.x = mapdims[0] + mapdims[4]/2.0f; - camera1->o.y = mapdims[1] + mapdims[5]/2.0f; + camera1->o.x = mapdims.xm; + camera1->o.y = mapdims.ym; - //float gdim = max(mapdims[4], mapdims[5])+2.0f; //make 1 cube smaller to give it a black edge - float gdim = max(mapdims[4], mapdims[5]); //no border + //float gdim = max(mapdims.xspan, mapdims.yspan)+2.0f; //make 1 cube smaller to give it a black edge + float gdim = max(mapdims.xspan, mapdims.yspan); //no border - if(!gdim) gdim = ssize/2.0f; - camera1->o.z = mapdims[7] + 1; + if(gdim < 1) gdim = ssize/2.0f; + camera1->o.z = mapdims.maxceil + 1; camera1->pitch = -90; camera1->yaw = 0; @@ -820,7 +820,7 @@ void drawminimap(int w, int h) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // stencil added 2010jul22 glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(-orthd, orthd, -orthd, orthd, 0, (mapdims[7]-mapdims[6])+2); // depth of map +2 covered + glOrtho(-orthd, orthd, -orthd, orthd, 0, (mapdims.maxceil - mapdims.minfloor) + 2); // depth of map +2 covered glScalef(1, -1, 1); glMatrixMode(GL_MODELVIEW); glCullFace(GL_BACK); @@ -836,7 +836,7 @@ void drawminimap(int w, int h) renderstrips(); glDepthFunc(GL_LESS); rendermapmodels(); - renderzones(mapdims[7]); + renderzones(mapdims.maxceil); //renderentities();// IMHO better done by radar itself, if at all resettmu(0); float hf = hdr.waterlevel-0.3f; @@ -849,10 +849,10 @@ void drawminimap(int w, int h) glColor3f(0, 0, 0); glLineWidth(2.0f); glBegin(GL_LINE_LOOP); - glVertex3f(mapdims[0]+0.02f, mapdims[1]+0.02f, mapdims[7]); - glVertex3f(mapdims[0]+mapdims[4]-0.02f, mapdims[1]+0.02f, mapdims[7]); - glVertex3f(mapdims[0]+mapdims[4]-0.02f, mapdims[1]+mapdims[5]-0.02f, mapdims[7]); - glVertex3f(mapdims[0]+0.02f, mapdims[1]+mapdims[5]-0.02f, mapdims[7]); + glVertex3f(mapdims.x1 + 0.02f, mapdims.y1 + 0.02f, mapdims.maxceil); + glVertex3f(mapdims.x1 + mapdims.xspan - 0.02f, mapdims.y1 + 0.02f, mapdims.maxceil); + glVertex3f(mapdims.x1 + mapdims.xspan - 0.02f, mapdims.y1 + mapdims.yspan - 0.02f, mapdims.maxceil); + glVertex3f(mapdims.x1 + 0.02f, mapdims.y1 + mapdims.yspan - 0.02f, mapdims.maxceil); glEnd(); glLineWidth(prevLineWidth); glEnable(GL_BLEND); @@ -904,10 +904,10 @@ void setperspective(float fovy, float aspect, float nearplane, float farplane) GLdouble ydist = nearplane * tan(fovy/2*RAD), xdist = ydist * aspect; if(player1->isspectating() && player1->spectatemode == SM_OVERVIEW) { - int gdim = max(mapdims[4], mapdims[5]); + int gdim = max(mapdims.xspan, mapdims.yspan); if(!gdim) gdim = ssize/2; int orthd = 2 + gdim/2; - glOrtho(-orthd, orthd, -orthd, orthd, 0, (mapdims[7]-mapdims[6])+2); // depth of map +2 covered + glOrtho(-orthd, orthd, -orthd, orthd, 0, (mapdims.maxceil - mapdims.minfloor) + 2); // depth of map +2 covered } else { diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 13e5957d..f5061582 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -534,15 +534,14 @@ void drawradar_showmap(playerent *p, int w, int h) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_BLEND); - float gdim = max(mapdims[4], mapdims[5]); //no border - float coordtrans = (minimapviewsize)/(gdim); - - float offd = fabs(float(mapdims[5])-float(mapdims[4])) /2.0f; + float gdim = max(mapdims.xspan, mapdims.yspan); //no border + float offd = fabs((mapdims.yspan - mapdims.xspan) / 2.0f); if(!gdim) { gdim = ssize/2.0f; offd = 0; } - float offx = gdim==mapdims[5] ? offd : 0; - float offy = gdim==mapdims[4] ? offd : 0; + float coordtrans = minimapviewsize / gdim; + float offx = gdim == mapdims.yspan ? offd : 0; + float offy = gdim == mapdims.xspan ? offd : 0; - vec mdd = vec(mapdims[0]-offx, mapdims[1]-offy, 0); + vec mdd = vec(mapdims.x1 - offx, mapdims.y1 - offy, 0); vec cod(offx, offy, 0); vec ppv = vec(p->o).sub(mdd).mul(coordtrans); @@ -600,18 +599,18 @@ void drawradar_showmap(playerent *p, int w, int h) void drawradar_vicinity(playerent *p, int w, int h) { extern GLuint minimaptex; - int gdim = max(mapdims[4], mapdims[5]); + int gdim = max(mapdims.xspan, mapdims.yspan); float radarviewsize = min(VIRTW,VIRTH)/5; float halfviewsize = radarviewsize/2.0f; float iconsize = radarentsize/0.4f; float scaleh = radarheight/(2.0f*gdim); float scaled = radarviewsize/float(radarheight); - float offd = fabs((mapdims[5]-mapdims[4]) /2.0f); - if(!gdim) { gdim = ssize/2; offd = 0; } - float offx = gdim==mapdims[5]?offd:0; - float offy = gdim==mapdims[4]?offd:0; - vec rtr = vec(mapdims[0]-offx, mapdims[1]-offy, 0); - vec rsd = vec(mapdims[0]+mapdims[4]/2, mapdims[1]+mapdims[5]/2, 0); + float offd = fabs((mapdims.yspan - mapdims.xspan) / 2.0f); + if(gdim < 1) { gdim = ssize/2; offd = 0; } + float offx = gdim == mapdims.yspan ? offd : 0; + float offy = gdim==mapdims.xspan ? offd : 0; + vec rtr = vec(mapdims.x1 - offx, mapdims.y1 - offy, 0); + vec rsd = vec(mapdims.xm, mapdims.ym, 0); float d2s = radarheight/2.0f; glColor3f(1.0f, 1.0f, 1.0f); glPushMatrix(); @@ -801,10 +800,12 @@ string enginestateinfo = ""; void CSgetEngineState() { result(enginestateinfo); } COMMANDN(getEngineState, CSgetEngineState, ""); -VARP(clockdisplay,0,0,2); +VARP(clockdisplay,0,1,1); +VARP(clockcount,0,0,1); VARP(dbgpos,0,0,1); VARP(showtargetname,0,1,1); VARP(showspeed, 0, 0, 1); +string gtime; void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater) { @@ -971,13 +972,12 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat if(unsavededits) draw_text("U", VIRTW*2 - text_width("U") - FONTH, VIRTH*2 - 5*FONTH/2); } } - if(!intermission && clockdisplay!=0 && lastgametimeupdate!=0) + if(!intermission && lastgametimeupdate!=0) { - string gtime; int cssec = (gametimecurrent+(lastmillis-lastgametimeupdate))/1000; int gtsec = cssec%60; int gtmin = cssec/60; - if(clockdisplay==1) + if(!clockcount) { int gtmax = gametimemaximum/60000; gtmin = gtmax - gtmin; @@ -988,7 +988,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat } } formatstring(gtime)("%02d:%02d", gtmin, gtsec); - draw_text(gtime, (VIRTW-225-10)*2 - (text_width(gtime)/2 + FONTH/2), 20); + if(clockdisplay) draw_text(gtime, (VIRTW-225-10)*2 - (text_width(gtime)/2 + FONTH/2), 20); } if(hidevote < 2 && multiplayer(false)) @@ -1025,16 +1025,13 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat if(menu) rendermenu(); else if(command) renderdoc(40, VIRTH, max(commandh*2 - VIRTH, 0)); - if(!hidehudmsgs) hudmsgs.render(); - - if(!hidespecthud && !menu && p->state==CS_DEAD && p->spectatemode<=SM_DEATHCAM) { glLoadIdentity(); glOrtho(0, VIRTW*3/2, VIRTH*3/2, 0, -1, 1); - const int left = (VIRTW*3/2)*8/11, top = (VIRTH*3/2)*3/4; - draw_textf("SPACE to change view", left, top); - draw_textf("SCROLL to change player", left, top+80); + const int left = (VIRTW)*3/2, top = (VIRTH*3/2)*3/4; + draw_textf("SPACE to change view", left - (text_width("SCROLL to change player") + FONTH/2), top); + if(!m_botmode) draw_textf("SCROLL to change player", left - (text_width("SCROLL to change player") + FONTH/2), top+80); } /* * / @@ -1072,6 +1069,8 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat } } + if(!hidehudmsgs) hudmsgs.render(); + if(p->state==CS_ALIVE) { glLoadIdentity(); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 53265f7c..a74f7004 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -109,34 +109,35 @@ COMMAND(mapmodel, "iiiss"); COMMAND(mapmodelreset, ""); hashtable mdllookup; -model *nomodel = NULL; +hashtable mdlnotfound; -model *loadmodel(const char *name, int i, bool trydl) +model *loadmodel(const char *name, int i, bool trydl) // load model by name (optional) or from mapmodels[i] { - if(!name) + if(!name) // name == NULL -> get index i from mapmodels[] { if(!mapmodels.inrange(i)) return NULL; mapmodelinfo &mmi = mapmodels[i]; - if(mmi.m) return mmi.m; + if(mmi.m) return mmi.m; // mapmodels[i] was already loaded name = mmi.name; } + if(mdlnotfound.access(name)) return NULL; // already tried to find that earlier -> not available model **mm = mdllookup.access(name); model *m; - if(mm) m = *mm; + if(mm) m = *mm; // a model of that name is already loaded else { pushscontext(IEXC_MDLCFG); - m = new md2(name); + m = new md2(name); // try md2 loadingmodel = m; - if(!m->load()) + if(!m->load()) // md2 didn't load { delete m; - m = new md3(name); + m = new md3(name); // try md3 loadingmodel = m; - if(!m->load()) + if(!m->load()) // md3 didn't load -> we don't have that model { delete m; - loadingmodel = NULL; + m = loadingmodel = NULL; if(trydl) { defformatstring(dl)("packages/models/%s", name); @@ -144,26 +145,15 @@ model *loadmodel(const char *name, int i, bool trydl) } else { - mdllookup.access(newstring(name), nomodel); conoutf("\f3failed to load model %s", name); + mdlnotfound.access(newstring(name), 0); // do not search for this name again } } } popscontext(); - if(!loadingmodel) - { - if(!trydl) - { - conoutf(_("failed to load model %s"), name); - if(!nomodel) nomodel = new md2("nomodel"); - m = nomodel; - mdllookup.access(newstring(name), m); - } - } - else mdllookup.access(m->name(), m); + if(loadingmodel && m) mdllookup.access(m->name(), m); loadingmodel = NULL; } - if(m == nomodel) return NULL; if(mapmodels.inrange(i) && !mapmodels[i].m) mapmodels[i].m = m; return m; } diff --git a/source/src/scoreboard.cpp b/source/src/scoreboard.cpp index e0cbd638..628f2c8f 100644 --- a/source/src/scoreboard.cpp +++ b/source/src/scoreboard.cpp @@ -355,7 +355,9 @@ void renderscores(void *menu, bool init) formatstring(modeline)("\"%s\" on map %s", modestr(gamemode, modeacronyms > 0), fldrprefix ? getclientmap()+strlen("maps/") : getclientmap()); } - extern int minutesremaining; + extern int minutesremaining, clockcount; + extern string gtime; + if((gamemode>1 || (gamemode==0 && (multiplayer(false) || watchingdemo))) && minutesremaining >= 0) { if(!minutesremaining) @@ -380,7 +382,12 @@ void renderscores(void *menu, bool init) else concatformatstring(modeline, ", \f1%s wins!", scores[0]->name); } } - else concatformatstring(modeline, ", %d %s remaining", minutesremaining, minutesremaining==1 ? "minute" : "minutes"); + else + { + concatformatstring(modeline, ", %s", gtime); + if(!clockcount) concatformatstring(modeline, " remaining"); + else concatformatstring(modeline, " / %d:00", gametimemaximum/60000); + } } if(multiplayer(false)) @@ -450,7 +457,7 @@ const char *asciiscores(bool destjpg) if(s) { string sdesc; - filtertext(sdesc, s->sdesc, FTXT__SERVDESC); + filtertext(sdesc, s->sdesc, FTXT__SERVDESC | FTXT_NOCOLOR); formatstring(text)(", %s:%d %s", s->name, s->port, sdesc); addstr(buf, text); } diff --git a/source/src/server.cpp b/source/src/server.cpp index 5359a766..d2650ea2 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1590,6 +1590,22 @@ int canspawn(client *c) // beware: canspawn() doesn't check m_arena! return SP_OK; } +void autospawncheck() +{ + if(mastermode != MM_MATCH || !m_autospawn || interm) return; + + loopv(clients) if(clients[i]->type!=ST_EMPTY && clients[i]->isauthed && team_isactive(clients[i]->team)) + { + client *cl = clients[i]; + if((cl->state.state == CS_DEAD || cl->state.state == CS_SPECTATE) + && canspawn(cl) == SP_OK && !cl->autospawn) + { + sendspawn(cl); + cl->autospawn = true; + } + } +} + /** FIXME: this function is unnecessarily complicated */ bool updateclientteam(int cln, int newteam, int ftr) { @@ -3025,10 +3041,10 @@ void process(ENetPacket *packet, int sender, int chan) if(namechanged) { // very simple spam detection (possible FIXME: centralize spam detection) - if(servmillis - cl->lastprofileupdate < 1000) + if(cl->type==ST_TCPIP && (servmillis - cl->lastprofileupdate < 1000)) { ++cl->fastprofileupdates; - if(cl->fastprofileupdates == 3) sendservmsg("\f3Please do not spam"); + if(cl->fastprofileupdates == 3) sendservmsg("\f3Please do not spam", sender); if(cl->fastprofileupdates >= 5) { disconnect_client(sender, DISC_ABUSE); break; } } else if(servmillis - cl->lastprofileupdate > 10000) cl->fastprofileupdates = 0; @@ -3069,10 +3085,10 @@ void process(ENetPacket *packet, int sender, int chan) loopi(2) cl->skin[i] = getint(p); QUEUE_MSG; - if(servmillis - cl->lastprofileupdate < 1000) + if(cl->type==ST_TCPIP && (servmillis - cl->lastprofileupdate < 1000)) { ++cl->fastprofileupdates; - if(cl->fastprofileupdates == 3) sendservmsg("\f3Please do not spam"); + if(cl->fastprofileupdates == 3) sendservmsg("\f3Please do not spam", sender); if(cl->fastprofileupdates >= 5) disconnect_client(sender, DISC_ABUSE); } else if(servmillis - cl->lastprofileupdate > 10000) cl->fastprofileupdates = 0; @@ -3099,6 +3115,7 @@ void process(ENetPacket *packet, int sender, int chan) ls!=cl->state.lifesequence || cl->state.lastspawn<0 || gunselect<0 || gunselect>=NUMGUNS || gunselect == GUN_CPISTOL) break; cl->state.lastspawn = -1; cl->state.spawn = gamemillis; + cl->autospawn = false; cl->upspawnp = false; cl->state.state = CS_ALIVE; cl->state.gunselect = gunselect; @@ -3458,12 +3475,13 @@ void process(ENetPacket *packet, int sender, int chan) time = min(time, 60); if (vi->gonext) { - int ccs = mode ? maprot.next(false,false) : maprot.get_next(); + int ccs = rnd(maprot.configsets.length()); configset *c = maprot.get(ccs); if(c) { strcpy(vi->text,c->mapname); mode = vi->num1 = c->mode; + time = vi->num2 = c->time; } else fatal("unable to get next map in maprot"); } @@ -3872,6 +3890,7 @@ void serverslice(uint timeout) // main server update, called from cube main lo } if(m_ktf && !ktfflagingame) flagaction(rnd(2), FA_RESET, -1); // ktf flag watchdog if(m_arena) arenacheck(); + else if(m_autospawn) autospawncheck(); // if(m_lms) lmscheck(); sendextras(); if ( scl.afk_limit && mastermode == MM_OPEN && next_afk_check < servmillis && gamemillis > 20 * 1000 ) check_afk(); diff --git a/source/src/server.h b/source/src/server.h index 69069ba5..be6de9de 100644 --- a/source/src/server.h +++ b/source/src/server.h @@ -256,6 +256,7 @@ struct client // server side version of "dynent" type bool at3_dontmove; int spawnindex; int spawnperm, spawnpermsent; + bool autospawn; int salt; string pwd; uint authreq; // for AUTH @@ -294,6 +295,7 @@ struct client // server side version of "dynent" type isonrightmap = m_coop; spawnperm = SP_WRONGMAP; spawnpermsent = servmillis; + autospawn = false; if(!getmap) { loggedwrongmap = false; diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index 7170591b..1132b100 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -834,7 +834,7 @@ bool favcatcheckkey(serverinfo &si, const char *key) case '$': if(key[1]) { - formatstring(text)("%s \"%s\" %d %d, %d %d %d \"%s\" %d %d", key + 1, si.map, si.mode, si.ping, si.minremain, si.numplayers, si.maxclients, si.name, si.port, si.pongflags); + formatstring(text)("%s \"%s\" %d %d %d %d %d \"%s\" %d %d", key + 1, si.map, si.mode, si.ping, si.minremain, si.numplayers, si.maxclients, si.name, si.port, si.pongflags); filtertext(text, text, FTXT_NOCOLOR|FTXT_NOWHITE|FTXT_ALLOWBLANKS); int cnt = 0; for(const char *p = text; (p = strchr(p, '\"')); p++) cnt++; @@ -842,8 +842,9 @@ bool favcatcheckkey(serverinfo &si, const char *key) } break; default: - filtertext(text, si.sdesc, FTXT_NOCOLOR|FTXT_NOWHITE|FTXT_ALLOWBLANKS); - return *key && strstr(text, key); + filtertext(text, si.sdesc, FTXT_NOCOLOR|FTXT_NOWHITE|FTXT_ALLOWBLANKS|(showonlyfavourites > 0 ? FTXT_TOUPPER : 0)); + strtoupper(keyuc, key); + return *key && strstr(text, showonlyfavourites > 0 ? keyuc : key); } return false; } @@ -876,6 +877,30 @@ const char *favcatcheck(serverinfo &si, const char *ckeys, char *autokeys = NULL return res ? nkeys : NULL; } +void serverbrowseralternativeviews(int shiftdirection) +{ + const char *ckeys = getalias("serverbrowseraltviews"); + if(!ckeys) return; + const char *sep = " \t\n\r"; + char *keys = newstring(ckeys), *k = strtok(keys, sep); + vector cats; + cats.add(0); + while(k) + { + loopv(favcats) if(!strcmp(favcats[i], k)) cats.add(i + 1); + k = strtok(NULL, sep); + } + delete[] keys; + if(cats.length()) + { + loopv(cats) + { + if(cats[i] == showonlyfavourites) { showonlyfavourites = cats[(i + shiftdirection + cats.length()) % cats.length()]; return; } + } + } + showonlyfavourites = 0; +} + vector favcattags; bool assignserverfavourites() @@ -909,6 +934,7 @@ bool assignserverfavourites() if(!si.bgcolor) si.bgcolor = new color; new (si.bgcolor) color(((float)alxn[FC_RED])/100, ((float)alxn[FC_GREEN])/100, ((float)alxn[FC_BLUE])/100, ((float)alxn[FC_ALPHA])/100); } + else DELETEP(si.bgcolor) } } } @@ -1047,7 +1073,7 @@ void refreshservers(void *menu, bool init) } else { - if(!hidefavicons && showfavtag && si.favcat > -1) favimage = getalias(favcatargname(favcats[si.favcat], FC_IMAGE)); + if(!hidefavicons && !showweights && showfavtag && si.favcat > -1) favimage = getalias(favcatargname(favcats[si.favcat], FC_IMAGE)); filterrichtext(text, si.favcat > -1 && !favimage ? favcattags[si.favcat] : ""); if(showweights) concatformatstring(text, "(%d)", si.weight); formatstring(si.full)(showfavtag ? (favimage ? "\t" : "\fs%s\fr\t") : "", text); @@ -1187,6 +1213,14 @@ bool serverskey(void *menu, int code, bool isdown, int unicode) serversort = (serversort+1) % NUMSERVSORT; return true; + case SDLK_LEFTBRACKET: + serverbrowseralternativeviews(-1); + return true; + + case SDLK_RIGHTBRACKET: + serverbrowseralternativeviews(1); + return true; + case SDLK_F5: updatefrommaster(1); return true; @@ -1267,6 +1301,7 @@ void clearservers() } #define RETRIEVELIMIT 5000 +extern size_t write_callback(void *ptr, size_t size, size_t nmemb, FILE *stream); extern char *global_name; bool cllock = false, clfail = false; @@ -1276,7 +1311,7 @@ struct resolver_data string text; }; -static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) +int progress_callback_retrieveservers(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { resolver_data *rd = (resolver_data *)clientp; rd->timeout = SDL_GetTicks() - rd->starttime; @@ -1289,11 +1324,6 @@ static int progress_callback(void *clientp, double dltotal, double dlnow, double return 0; } -static size_t write_callback(void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - return fwrite(ptr, size, nmemb, stream); -} - void retrieveservers(vector &data) { if(mastertype == AC_MASTER_HTTP) @@ -1327,7 +1357,7 @@ void retrieveservers(vector &data) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback_retrieveservers); curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, rd); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, RETRIEVELIMIT/1000); result = curl_easy_perform(curl); diff --git a/source/src/serverfiles.h b/source/src/serverfiles.h index 87a92a12..118739ab 100644 --- a/source/src/serverfiles.h +++ b/source/src/serverfiles.h @@ -398,18 +398,6 @@ struct servermaprot : serverconfigfile configset *current() { return configsets.inrange(curcfgset) ? &configsets[curcfgset] : NULL; } configset *get(int ccs) { return configsets.inrange(ccs) ? &configsets[ccs] : NULL; } - int get_next() - { - int ccs = curcfgset; - while(!strcmp(configsets[curcfgset].mapname,configsets[ccs].mapname)) - { - ccs++; - if(!configsets.inrange(ccs)) ccs=0; - if (ccs == curcfgset) break; - } - curcfgset = ccs; - return ccs; - } }; // serverblacklist.cfg @@ -946,12 +934,12 @@ struct killmessagesfile : serverconfigfile { if(fragmsg) { - copystring(killmessages[0][gun], message); + copystring(killmessages[0][gun], message, MAXKILLMSGLEN); logline(ACLOG_VERBOSE, " added msg '%s' for frags with weapon %i ", message, gun); } else { - copystring(killmessages[1][gun], message); + copystring(killmessages[1][gun], message, MAXKILLMSGLEN); logline(ACLOG_VERBOSE, " added msg '%s' for gibs with weapon %i ", message, gun); } } diff --git a/source/src/stream.cpp b/source/src/stream.cpp index 2e890a11..e28ac085 100644 --- a/source/src/stream.cpp +++ b/source/src/stream.cpp @@ -192,12 +192,11 @@ void sethomedir(const char *dir) } #endif -#ifndef STANDALONE - clientlogf("Using home directory: %s", tmpdir); -#endif - if(fixpackagedir(tmpdir) > 0) { +#ifndef STANDALONE + clientlogf("Using home directory: %s", tmpdir); +#endif copystring(homedir, tmpdir); createdir(homedir); } @@ -205,20 +204,22 @@ void sethomedir(const char *dir) void addpackagedir(const char *dir) { -#ifndef STANDALONE - clientlogf("Adding package directory: %s", dir); -#endif - string pdir; copystring(pdir, dir); - if(fixpackagedir(pdir) > 0) packagedirs.add(newstring(pdir)); + if(fixpackagedir(pdir) > 0) + { +#ifndef STANDALONE + clientlogf("Adding package directory: %s", pdir); +#endif + packagedirs.add(newstring(pdir)); + } } const char *findfile(const char *filename, const char *mode) { static string s; formatstring(s)("%s%s", homedir, filename); // homedir may be "" - if(fileexists(s, mode)) return s; + if(homedir[0] && fileexists(s, mode)) return s; if(mode[0]=='w' || mode[0]=='a') { // create missing directories, if necessary string dirs; @@ -786,3 +787,19 @@ char *loadfile(const char *fn, int *size, const char *mode) return buf; } +void filerotate(const char *basename, const char *ext, int keepold, const char *oldformat) // rotate old logfiles +{ + char fname1[MAXSTRLEN * 2], fname2[MAXSTRLEN] = ""; + copystring(fname1, findfile(basename, "w")); + int mid = strlen(fname1); + if(!oldformat) oldformat = "-old-%d"; + for(; keepold >= 0; keepold--) + { + formatstring(fname1 + mid)(keepold ? oldformat : "", keepold); + concatformatstring(fname1 + mid, ".%s", ext); + if(fname2[0]) rename(fname1, fname2); + else remove(fname1); + copystring(fname2, fname1); + } +} + diff --git a/source/src/tools.cpp b/source/src/tools.cpp index b5a03d9f..0dad0018 100644 --- a/source/src/tools.cpp +++ b/source/src/tools.cpp @@ -59,7 +59,7 @@ int fixmapheadersize(int version, int headersize) // we can't trust hdr.header return headersize; } -int mapdims[8]; // min/max X/Y and delta X/Y and min/max Z +mapdim mapdims; // min/max X/Y and delta X/Y and min/max Z extern char *maplayout, *testlayout; extern int maplayout_factor, testlayout_factor, Mvolume, Marea, Mopen, SHhits; @@ -189,19 +189,21 @@ mapstats *loadmapstats(const char *filename, bool getlayout) maplayout = new char[layoutsize + 256]; memcpy(maplayout, testlayout, layoutsize * sizeof(char)); - loopk(8) mapdims[k] = k < 2 ? maplayoutssize : 0; + memset(&mapdims, 0, sizeof(struct mapdim)); + mapdims.x1 = mapdims.y1 = maplayoutssize; loopk(layoutsize) if (testlayout[k] != 127) { int cwx = k%maplayoutssize, cwy = k/maplayoutssize; - if(cwx < mapdims[0]) mapdims[0] = cwx; - if(cwy < mapdims[1]) mapdims[1] = cwy; - if(cwx > mapdims[2]) mapdims[2] = cwx; - if(cwy > mapdims[3]) mapdims[3] = cwy; + if(cwx < mapdims.x1) mapdims.x1 = cwx; + if(cwy < mapdims.y1) mapdims.y1 = cwy; + if(cwx > mapdims.x2) mapdims.x2 = cwx; + if(cwy > mapdims.y2) mapdims.y2 = cwy; } - loopk(2) mapdims[k+4] = mapdims[k+2] - mapdims[k]; - mapdims[6] = minfloor; - mapdims[7] = maxceil; + mapdims.xspan = mapdims.x2 - mapdims.x1; + mapdims.yspan = mapdims.y2 - mapdims.y1; + mapdims.minfloor = minfloor; + mapdims.maxceil = maxceil; } } delete f; @@ -403,10 +405,12 @@ char *concatformatstring(char *d, const char *s, ...) return concatstring(d, temp); } -char *tempformatstring(const char *s, ...) +int cvecprintf(vector &v, const char *s, ...) { - static defvformatstring(temp, s, s); - return temp; + defvformatstring(temp, s, s); + int len = strlen(temp); + if(len) v.put(temp, len); + return len; } const char *hiddenpwd(const char *pwd, int showchars) diff --git a/source/src/tools.h b/source/src/tools.h index 343f82aa..92a447fc 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -112,7 +112,6 @@ inline void vformatstring(char *d, const char *fmt, va_list v, int len = MAXSTRL inline char *copystring(char *d, const char *s, size_t len = MAXSTRLEN) { strncpy(d, s, len); d[len-1] = 0; return d; } inline char *concatstring(char *d, const char *s, size_t len = MAXSTRLEN) { size_t used = strlen(d); return used < len ? copystring(d+used, s, len-used) : d; } extern char *concatformatstring(char *d, const char *s, ...); -extern char *tempformatstring(const char *s, ...); struct stringformatter { @@ -949,6 +948,7 @@ extern stream *openfile(const char *filename, const char *mode); extern stream *opentempfile(const char *filename, const char *mode); extern stream *opengzfile(const char *filename, const char *mode, stream *file = NULL, int level = Z_BEST_COMPRESSION); extern char *loadfile(const char *fn, int *size, const char *mode = NULL); +extern void filerotate(const char *basename, const char *ext, int keepold, const char *oldformat = NULL); extern bool listdir(const char *dir, const char *ext, vector &files); extern int listfiles(const char *dir, const char *ext, vector &files); extern int listzipfiles(const char *dir, const char *ext, vector &files); @@ -972,6 +972,7 @@ extern const char *iptoa(const enet_uint32 ip); extern const char *iprtoa(const struct iprange &ipr); extern int cmpiprange(const struct iprange *a, const struct iprange *b); extern int cmpipmatch(const struct iprange *a, const struct iprange *b); +extern int cvecprintf(vector &v, const char *s, ...); extern const char *hiddenpwd(const char *pwd, int showchars = 0); #if defined(WIN32) && !defined(_DEBUG) && !defined(__GNUC__) diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 5c6398d3..202d90aa 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1272,6 +1272,7 @@ void gun::attackfx(const vec &from, const vec &to, int millis) int gun::modelanim() { return modelattacking() ? ANIM_GUN_SHOOT|ANIM_LOOP : ANIM_GUN_IDLE; } void gun::checkautoreload() { if(autoreload && owner==player1 && !mag) reload(true); } +void gun::onownerdies() { shots = 0; } // shotgun @@ -1352,7 +1353,7 @@ float sniperrifle::dynrecoil() { return scoped && lastmillis - scoped_since > SC bool sniperrifle::selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; } void sniperrifle::onselecting() { weapon::onselecting(); scoped = false; player1->scoping = false; } void sniperrifle::ondeselecting() { scoped = false; player1->scoping = false; } -void sniperrifle::onownerdies() { scoped = false; player1->scoping = false; } +void sniperrifle::onownerdies() { scoped = false; player1->scoping = false; shots = 0; } void sniperrifle::renderhudmodel() { if(!scoped) weapon::renderhudmodel(); } void sniperrifle::renderaimhelp(bool teamwarning) diff --git a/source/src/weapon.h b/source/src/weapon.h index 192f5e22..ae9a5ad3 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -87,6 +87,7 @@ struct gun : weapon virtual void attackfx(const vec &from, const vec &to, int millis); int modelanim(); void checkautoreload(); + void onownerdies(); }; diff --git a/source/src/world.cpp b/source/src/world.cpp index eb3bbff9..2acd3f47 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -286,11 +286,11 @@ entity *newentity(int index, int x, int y, int z, char *what, int v1, int v2, in case MAPMODEL: e.attr4 = e.attr3; e.attr3 = e.attr2; - e.attr2 = (uchar)e.attr1; case PLAYERSTART: case CTF_FLAG: e.attr2 = v1; e.attr1 = (int)camera1->yaw; + if(type != PLAYERSTART) e.attr1 = (e.attr1 + 7 - (e.attr1 + 7) % 15) * 4; break; } syncentchanges(true); @@ -447,6 +447,41 @@ bool worldbordercheck(int x1, int x2, int y1, int y2, int z1, int z2) // check return true; } +void calcmapdims() +{ + mapdims.x1 = mapdims.y1 = ssize; + mapdims.x2 = mapdims.y2 = 0; + mapdims.minfloor = 127; mapdims.maxceil = -128; // flow initialised those two with "0", but i'd guess, that was by mistake + sqr *s = world; + for(int y = 0; y < ssize; y++) for(int x = 0; x < ssize; x++) + { + if(!SOLID(s)) + { + if(OUTBORD(x, y)) conoutf("non-solid cube in world border found: x %d, y %d", x, y); // will also go fatal() below + if(x < mapdims.x1) mapdims.x1 = x; + if(x > mapdims.x2) mapdims.x2 = x; + if(y < mapdims.y1) mapdims.y1 = y; + mapdims.y2 = y; + if(s->floor < mapdims.minfloor) mapdims.minfloor = s->floor; // for some reason, flow excluded cubes with floor == -128 here - let's try without that... + if(s->ceil > mapdims.maxceil) mapdims.maxceil = s->ceil; + } + s++; + } + if(mapdims.x2 < mapdims.x1 || mapdims.y2 < mapdims.y1) + { // map is completely solid -> default to empty map values + mapdims.x1 = mapdims.y1 = 2; + mapdims.x2 = mapdims.y2 = ssize - 3; + mapdims.minfloor = 0; + mapdims.maxceil = 16; + } + if(mapdims.x1 < MINBORD || mapdims.y1 < MINBORD || mapdims.x2 >= ssize - MINBORD || mapdims.y2 >= ssize - MINBORD) + fatal("calcmapdims(): world border violation (x:%d..%d, y:%d..%d)", mapdims.x1, mapdims.x2, mapdims.y1, mapdims.y2); + mapdims.xspan = mapdims.x2 - mapdims.x1 + 1; + mapdims.yspan = mapdims.y2 - mapdims.y1 + 1; + mapdims.xm = mapdims.x1 + mapdims.xspan / 2.0f; + mapdims.ym = mapdims.y1 + mapdims.yspan / 2.0f; +} + bool empty_world(int factor, bool force) // main empty world creation routine, if passed factor -1 will enlarge old world by 1, factor -2 will shrink old world by 1 { if(!force && noteditmode("empty world")) return false; @@ -509,6 +544,7 @@ bool empty_world(int factor, bool force) // main empty world creation routine hdr.headersize = sizeof(header); hdr.sfactor = sfactor; + calcmapdims(); calclight(); resetmap(!copy); if(clearmap) @@ -522,12 +558,6 @@ bool empty_world(int factor, bool force) // main empty world creation routine popscontext(); setvar("fullbright", 1); fullbrightlight(); - - mapdims[0] = mapdims[1] = 0; - mapdims[2] = mapdims[3] = ssize; - mapdims[4] = mapdims[5] = ssize; - mapdims[6] = 0; - mapdims[7] = 16; } if(!copy) { diff --git a/source/src/world.h b/source/src/world.h index edd6073f..bce742e7 100644 --- a/source/src/world.h +++ b/source/src/world.h @@ -75,6 +75,14 @@ struct mapstats bool hasflags; }; +struct mapdim +{ // 0 2 1 3 6 7 + int x1, x2, y1, y2, minfloor, maxceil; // outer borders (points to last used cube) + // 4 5 + int xspan, yspan; // size of area between x1|y1 and x2|y2 + float xm, ym; // middle of the map +}; + #define SWS(w,x,y,s) (&(w)[((y)<<(s))+(x)]) #define SW(w,x,y) SWS(w,x,y,sfactor) #define S(x,y) SW(world,x,y) // convenient lookup of a lowest mip cube diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index e765e06a..d1a18d44 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -486,6 +486,7 @@ void save_world(char *mname, bool skipoptimise, bool addcomfort) int writeextra = 0; if(hx.maxlen) tmp.headersize += writeextra = clamp(hx.maxlen, 0, MAXHEADEREXTRA); if(writeextra || skipoptimise) tmp.version = 10; // 9 and 10 are the same, but in 10 the headersize is reliable - if we don't need it, stick to 9 + bool oldmapmodelscaling = tmp.version < 10; tmp.maprevision += advancemaprevision; DEBUG("version " << tmp.version << " headersize " << tmp.headersize << " entities " << tmp.numents << " factor " << tmp.sfactor << " revision " << tmp.maprevision); lilswap(&tmp.version, 4); @@ -501,6 +502,7 @@ void save_world(char *mname, bool skipoptimise, bool addcomfort) { if(!ne--) break; persistent_entity tmp = ents[i]; + if(oldmapmodelscaling && tmp.type == MAPMODEL) tmp.attr1 = tmp.attr1 / 4; lilswap((short *)&tmp, 4); f->write(&tmp, sizeof(persistent_entity)); } @@ -517,12 +519,11 @@ VARP(preserveundosonsave, 0, 0, 1); COMMANDF(savemap, "s", (char *name) { save_world(name, preserveundosonsave && editmode, preserveundosonsave && editmode); } ); COMMANDF(savemapoptimised, "s", (char *name) { save_world(name, false, false); } ); -extern int mapdims[8]; // min/max X/Y and delta X/Y and min-floor/max-ceil void showmapdims() { - conoutf(" min X|Y|Z: %3d : %3d : %3d", mapdims[0], mapdims[1], mapdims[6]); - conoutf(" max X|Y|Z: %3d : %3d : %3d", mapdims[2], mapdims[3], mapdims[7]); - conoutf("delta X|Y|Z: %3d : %3d : %3d", mapdims[4], mapdims[5], mapdims[7]-mapdims[6]); + conoutf(" min X|Y|Z: %3d : %3d : %3d", mapdims.x1, mapdims.y1, mapdims.minfloor); + conoutf(" max X|Y|Z: %3d : %3d : %3d", mapdims.x2, mapdims.y2, mapdims.maxceil); + conoutf("delta X|Y|Z: %3d : %3d : %3d", mapdims.xspan, mapdims.yspan, mapdims.maxceil - mapdims.minfloor); } COMMAND(showmapdims, ""); @@ -638,6 +639,17 @@ bool load_world(char *mname) // still supports all map formats that have if(e.attr1>32) e.attr1 = 32; // 12_03 and below } transformoldentities(hdr.version, e.type); + if(hdr.version < 10) + { + switch(e.type) + { + case CTF_FLAG: + case MAPMODEL: + e.attr1 = e.attr1 + 7 - (e.attr1 + 7) % 15; // round the angle to the nearest 15-degree-step + e.attr1 = (e.attr1 % 360) * 4; // cut down to less that one rotation and set resolution to 0.25 degree + break; + } + } if(e.type == PLAYERSTART && (e.attr2 == 0 || e.attr2 == 1 || e.attr2 == 100)) { if(e.attr2 == 100) @@ -671,7 +683,6 @@ bool load_world(char *mname) // still supports all map formats that have Mv = Ma = Hhits = 0; char texuse[256]; loopi(256) texuse[i] = 0; - loopk(8) mapdims[k] = k < 2 ? ssize : 0; loopk(cubicsize) { sqr *s = &world[k]; @@ -687,21 +698,13 @@ bool load_world(char *mname) // still supports all map formats that have Mv += diff; } texuse[s->utex] = texuse[s->ftex] = texuse[s->ctex] = 1; - int cwx = k%ssize, - cwy = k/ssize; - if(cwx < mapdims[0]) mapdims[0] = cwx; - if(cwy < mapdims[1]) mapdims[1] = cwy; - if(cwx > mapdims[2]) mapdims[2] = cwx; - if(cwy > mapdims[3]) mapdims[3] = cwy; - if(s->floor != -128 && s->floor < mapdims[6]) mapdims[6] = s->floor; - if(s->ceil > mapdims[7]) mapdims[7] = s->ceil; } texuse[s->wtex] = 1; } Mh = Ma ? (float)Mv/Ma : 0; - loopk(2) mapdims[k+4] = mapdims[k+2] + 1 - mapdims[k]; // 8..15 ^= 8 cubes - minimal X/Y == 2 - != 0 !! - c2skeepalive(); + c2skeepalive(); + calcmapdims(); calclight(); conoutf("read map %s rev %d (%d milliseconds)", cgzname, hdr.maprevision, watch.stop()); conoutf("%s", hdr.maptitle); @@ -739,7 +742,7 @@ bool load_world(char *mname) // still supports all map formats that have watch.start(); int downloaded = downloadpackages(); - if(downloaded > 0) clientlogf("downloaded content (%d KB in %d seconds)", downloaded/1000, watch.stop()/1000); + if(downloaded > 0) clientlogf("downloaded content (%d KB in %d seconds)", downloaded/1024, watch.stop()/1000); c2skeepalive(); diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index c4be3e24..63143248 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -178,6 +178,7 @@ VARF(ambient, 0, 0, 0xFFFFFF, if(!noteditmode("ambient")) { hdr.ambient = ambien void calclight() { + if(editmode) calcmapdims(); uchar r = (hdr.ambient>>16) & 0xFF, g = (hdr.ambient>>8) & 0xFF, b = hdr.ambient & 0xFF; if(!r && !g) { @@ -205,7 +206,7 @@ void calclight() seedMT(keep); - block bb = { 1, 1, ssize-2, ssize-2 }; + block bb = { mapdims.x1 - 1, mapdims.y1 - 1, mapdims.xspan + 2, mapdims.yspan + 2 }; postlightarea(bb); setvar("fullbright", 0); lastcalclight = totalmillis; diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL.h index 119ed7ff..6087b7cd 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_active.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_active.h index 0ae92f2d..cd854e89 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_active.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_active.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_audio.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_audio.h index 3a8e7fa8..e879c989 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_audio.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_audio.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_byteorder.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_byteorder.h index 9b93cd69..47332c3d 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_byteorder.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_byteorder.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cdrom.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cdrom.h index fff5cfa1..febb19dc 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cdrom.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cdrom.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config.h index a5081016..09ba38a7 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h index 07c2f081..fb03098e 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_dreamcast.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macos.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macos.h index 4ba5c22c..4fe1715a 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macos.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macos.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macosx.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macosx.h index 295b8724..84be6177 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macosx.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_os2.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_os2.h index bb40df00..42edd20e 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_os2.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_os2.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_win32.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_win32.h index 6d019a8d..da2c15dd 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_win32.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_config_win32.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_copying.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_copying.h index 1bd6b84c..b5b64f29 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_copying.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_copying.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h index f4be8e03..4200d6d1 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_endian.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_endian.h index f7a2e2f8..fd9fc867 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_endian.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_endian.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -39,6 +39,10 @@ /*@}*/ #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#else /* __linux __ */ #if defined(__hppa__) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \ @@ -48,6 +52,7 @@ #else #define SDL_BYTEORDER SDL_LIL_ENDIAN #endif +#endif /* __linux __ */ #endif /* !SDL_BYTEORDER */ @@ -86,7 +91,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); return result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint16 SDL_Swap16(Uint16 x) { __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); @@ -94,7 +99,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) } #else static __inline__ Uint16 SDL_Swap16(Uint16 x) { - return((x<<8)|(x>>8)); + return SDL_static_cast(Uint16, ((x<<8)|(x>>8))); } #endif @@ -121,7 +126,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); return result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint32 SDL_Swap32(Uint32 x) { __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); @@ -129,7 +134,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) } #else static __inline__ Uint32 SDL_Swap32(Uint32 x) { - return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); + return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); } #endif @@ -166,7 +171,7 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) x = SDL_Swap32(lo); x <<= 32; x |= SDL_Swap32(hi); - return(x); + return (x); } #endif #else diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_error.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_error.h index b103703a..4e1cce3b 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_error.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_error.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_events.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_events.h index c94a30c9..94b42025 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_events.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_events.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_getenv.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_getenv.h index 253ad88c..bea63007 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_getenv.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_getenv.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_joystick.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_joystick.h index d5135c3d..708d1a9f 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_joystick.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_joystick.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keyboard.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keyboard.h index 7b59d24e..9d7129c5 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keyboard.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keyboard.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keysym.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keysym.h index 90101286..f2ad12b8 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keysym.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_keysym.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_loadso.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_loadso.h index 45a17f9f..0c5e5362 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_loadso.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_loadso.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_main.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_main.h index b7f6b2c8..ab50ef1e 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_main.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_main.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mouse.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mouse.h index a573f04e..7c563b94 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mouse.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mouse.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mutex.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mutex.h index 920971df..c8da9b1a 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mutex.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_mutex.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_opengl.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_opengl.h index c479a3a4..3d791d69 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_opengl.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_opengl.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -3108,21 +3108,35 @@ typedef char GLchar; /* native character */ #ifndef GL_VERSION_1_5 /* GL types for handling large vertex buffer objects */ +#ifdef __APPLE__ +typedef long GLintptr; +typedef long GLsizeiptr; +#else typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; #endif +#endif #ifndef GL_ARB_vertex_buffer_object /* GL types for handling large vertex buffer objects */ +#ifdef __APPLE__ +typedef long GLintptrARB; +typedef long GLsizeiptrARB; +#else typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif +#endif #ifndef GL_ARB_shader_objects /* GL types for handling shader object handles and program/shader text */ typedef char GLcharARB; /* native character */ +#if defined(__APPLE__) +typedef void *GLhandleARB; /* shader object handle */ +#else typedef unsigned int GLhandleARB; /* shader object handle */ #endif +#endif /* GL types for "half" precision (s10e5) float data in host memory */ #ifndef GL_ARB_half_float_pixel diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_platform.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_platform.h index 11d86736..48540a85 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_platform.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_platform.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_quit.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_quit.h index 6d82e7e0..abd2ec6c 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_quit.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_quit.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_rwops.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_rwops.h index a450119f..98361d7e 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_rwops.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_rwops.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_stdinc.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_stdinc.h index e1f85fb7..35a4fdde 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_stdinc.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_stdinc.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_syswm.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_syswm.h index 716dddcb..78433c6a 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_syswm.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_syswm.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -203,12 +203,13 @@ typedef struct SDL_SysWMinfo { /** * This function gives you custom hooks into the window manager information. * It fills the structure pointed to by 'info' with custom information and - * returns 1 if the function is implemented. If it's not implemented, or - * the version member of the 'info' structure is invalid, it returns 0. + * returns 0 if the function is not implemented, 1 if the function is + * implemented and no error occurred, and -1 if the version member of + * the 'info' structure is not filled in or not supported. * * You typically use this function like this: * @code - * SDL_SysWMInfo info; + * SDL_SysWMinfo info; * SDL_VERSION(&info.version); * if ( SDL_GetWMInfo(&info) ) { ... } * @endcode diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_thread.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_thread.h index 1ca9a1bc..9ebe00ed 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_thread.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_thread.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -68,11 +68,6 @@ typedef struct SDL_Thread SDL_Thread; #ifdef __OS2__ typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); typedef void (*pfnSDL_CurrentEndThread)(void); -#elif __GNUC__ -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); #else typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall *func)(void *), void *arg, diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_timer.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_timer.h index d7cd0246..d764d5f3 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_timer.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_timer.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_types.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_types.h index cfa35236..79d8b28d 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_types.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_types.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_version.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_version.h index fa02c3f6..fdc17c64 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_version.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_version.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -41,7 +41,7 @@ extern "C" { /*@{*/ #define SDL_MAJOR_VERSION 1 #define SDL_MINOR_VERSION 2 -#define SDL_PATCHLEVEL 14 +#define SDL_PATCHLEVEL 15 /*@}*/ typedef struct SDL_version { diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_video.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_video.h index 8f7f3052..f9c4e070 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_video.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/SDL_video.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/begin_code.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/begin_code.h index 22748090..27e2f7bc 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/begin_code.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/begin_code.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -43,7 +43,7 @@ #ifndef DECLSPEC # if defined(__BEOS__) || defined(__HAIKU__) # if defined(__GNUC__) -# define DECLSPEC __declspec(dllexport) +# define DECLSPEC # else # define DECLSPEC __declspec(export) # endif @@ -132,7 +132,12 @@ #ifdef __BORLANDC__ #pragma nopackwarning #endif +#ifdef _M_X64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else #pragma pack(push,4) +#endif #elif (defined(__MWERKS__) && defined(__MACOS__)) #pragma options align=mac68k4byte #pragma enumsalwaysint on diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/close_code.h b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/close_code.h index 46a07208..19a00246 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/close_code.h +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Headers/close_code.h @@ -1,6 +1,6 @@ /* SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/Resources/Info.plist b/source/xcode/Frameworks/SDL.framework/Versions/A/Resources/Info.plist index 2a169012..5158033d 100644 --- a/source/xcode/Frameworks/SDL.framework/Versions/A/Resources/Info.plist +++ b/source/xcode/Frameworks/SDL.framework/Versions/A/Resources/Info.plist @@ -2,6 +2,8 @@ + BuildMachineOSBuild + 11C74 CFBundleDevelopmentRegion English CFBundleExecutable @@ -22,5 +24,19 @@ SDLX CFBundleVersion 1.2.14 + DTCompiler + + DTPlatformBuild + 4D502 + DTPlatformVersion + GM + DTSDKBuild + 11C63 + DTSDKName + macosx10.7 + DTXcode + 0421 + DTXcodeBuild + 4D502 diff --git a/source/xcode/Frameworks/SDL.framework/Versions/A/SDL b/source/xcode/Frameworks/SDL.framework/Versions/A/SDL index 2ccf7d95..89db482e 100755 Binary files a/source/xcode/Frameworks/SDL.framework/Versions/A/SDL and b/source/xcode/Frameworks/SDL.framework/Versions/A/SDL differ diff --git a/source/xcode/Frameworks/SDL_image.framework/Frameworks b/source/xcode/Frameworks/SDL_image.framework/Frameworks new file mode 120000 index 00000000..78816f62 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Frameworks @@ -0,0 +1 @@ +Versions/Current/Frameworks \ No newline at end of file diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Headers b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/LICENSE.webp.txt b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/LICENSE.webp.txt new file mode 100644 index 00000000..15993f83 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/LICENSE.webp.txt @@ -0,0 +1,34 @@ +The source code to this library used with SDL_image can be found here: +http://www.libsdl.org/projects/SDL_image/libs/ +--- + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * 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. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +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 +HOLDER 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. + diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Resources b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode.h new file mode 100644 index 00000000..6646f6fe --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode.h @@ -0,0 +1,396 @@ +// Copyright 2010 Google Inc. +// +// This code is licensed under the same terms as WebM: +// Software License Agreement: http://www.webmproject.org/license/software/ +// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ +// ----------------------------------------------------------------------------- +// +// Main decoding functions for WEBP images. +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_H_ +#define WEBP_WEBP_DECODE_H_ + +#include "./types.h" + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#define WEBP_DECODER_ABI_VERSION 0x0002 + +// Return the decoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN(int) WebPGetDecoderVersion(void); + +// Retrieve basic header information: width, height. +// This function will also validate the header and return 0 in +// case of formatting error. +// Pointers *width/*height can be passed NULL if deemed irrelevant. +WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, uint32_t data_size, + int* width, int* height); + +// Decodes WEBP images pointed to by *data and returns RGB samples, along +// with the dimensions in *width and *height. +// The returned pointer should be deleted calling free(). +// Returns NULL in case of error. +WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, uint32_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGB, but returning RGBA data. +WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, uint32_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning ARGB data. +WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, uint32_t data_size, + int* width, int* height); + +// This variant decode to BGR instead of RGB. +WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, uint32_t data_size, + int* width, int* height); +// This variant decodes to BGRA instead of RGBA. +WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, uint32_t data_size, + int* width, int* height); + +// Decode WEBP images stored in *data in Y'UV format(*). The pointer returned is +// the Y samples buffer. Upon return, *u and *v will point to the U and V +// chroma data. These U and V buffers need NOT be free()'d, unlike the returned +// Y luma one. The dimension of the U and V planes are both (*width + 1) / 2 +// and (*height + 1)/ 2. +// Upon return, the Y buffer has a stride returned as '*stride', while U and V +// have a common stride returned as '*uv_stride'. +// Return NULL in case of error. +// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr +WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, uint32_t data_size, + int* width, int* height, + uint8_t** u, uint8_t** v, + int* stride, int* uv_stride); + +// These five functions are variants of the above ones, that decode the image +// directly into a pre-allocated buffer 'output_buffer'. The maximum storage +// available in this buffer is indicated by 'output_buffer_size'. If this +// storage is not sufficient (or an error occurred), NULL is returned. +// Otherwise, output_buffer is returned, for convenience. +// The parameter 'output_stride' specifies the distance (in bytes) +// between scanlines. Hence, output_buffer_size is expected to be at least +// output_stride x picture-height. +WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( + const uint8_t* data, uint32_t data_size, + uint8_t* output_buffer, int output_buffer_size, int output_stride); +WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( + const uint8_t* data, uint32_t data_size, + uint8_t* output_buffer, int output_buffer_size, int output_stride); +WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( + const uint8_t* data, uint32_t data_size, + uint8_t* output_buffer, int output_buffer_size, int output_stride); +// BGR variants +WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( + const uint8_t* data, uint32_t data_size, + uint8_t* output_buffer, int output_buffer_size, int output_stride); +WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( + const uint8_t* data, uint32_t data_size, + uint8_t* output_buffer, int output_buffer_size, int output_stride); + +// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly +// into pre-allocated luma/chroma plane buffers. This function requires the +// strides to be passed: one for the luma plane and one for each of the +// chroma ones. The size of each plane buffer is passed as 'luma_size', +// 'u_size' and 'v_size' respectively. +// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred +// during decoding (or because some buffers were found to be too small). +WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( + const uint8_t* data, uint32_t data_size, + uint8_t* luma, int luma_size, int luma_stride, + uint8_t* u, int u_size, int u_stride, + uint8_t* v, int v_size, int v_stride); + +//------------------------------------------------------------------------------ +// Output colorspaces and buffer + +// Colorspaces +typedef enum { MODE_RGB = 0, MODE_RGBA = 1, + MODE_BGR = 2, MODE_BGRA = 3, + MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB_565 = 6, + // YUV modes must come after RGB ones. + MODE_YUV = 7, MODE_YUVA = 8, // yuv 4:2:0 + MODE_LAST = 9 + } WEBP_CSP_MODE; + +// Generic structure for describing the sample buffer. +typedef struct { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + int size; // total size of the *rgba buffer. +} WebPRGBABuffer; + +typedef struct { // view as YUVA + uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + int y_size; // luma plane size + int u_size, v_size; // chroma planes size + int a_size; // alpha-plane size +} WebPYUVABuffer; + +// Output buffer +typedef struct { + WEBP_CSP_MODE colorspace; // Colorspace. + int width, height; // Dimensions. + int is_external_memory; // If true, 'internal_memory' pointer is not used. + union { + WebPRGBABuffer RGBA; + WebPYUVABuffer YUVA; + } u; // Nameless union of buffer parameters. + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is false). Should not be used + // externally, but accessed via the buffer union. +} WebPDecBuffer; + +// Internal, version-checked, entry point +WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer* const, int); + +// Initialize the structure as empty. Must be called before any other use. +// Returns false in case of version mismatch +static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* const buffer) { + return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); +} + +// Free any memory associated with the buffer. Must always be called last. +// Note: doesn't free the 'buffer' structure itself. +WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* const buffer); + +//------------------------------------------------------------------------------ +// Enumeration of the status codes + +typedef enum { + VP8_STATUS_OK = 0, + VP8_STATUS_OUT_OF_MEMORY, + VP8_STATUS_INVALID_PARAM, + VP8_STATUS_BITSTREAM_ERROR, + VP8_STATUS_UNSUPPORTED_FEATURE, + VP8_STATUS_SUSPENDED, + VP8_STATUS_USER_ABORT, + VP8_STATUS_NOT_ENOUGH_DATA +} VP8StatusCode; + +//------------------------------------------------------------------------------ +// Incremental decoding +// +// This API allows streamlined decoding of partial data. +// Picture can be incrementally decoded as data become available thanks to the +// WebPIDecoder object. This object can be left in a SUSPENDED state if the +// picture is only partially decoded, pending additional input. +// Code example: +// +// WebPIDecoder* const idec = WebPINew(mode); +// while (has_more_data) { +// // ... (get additional data) +// status = WebPIAppend(idec, new_data, new_data_size); +// if (status != VP8_STATUS_SUSPENDED || +// break; +// } +// +// // The above call decodes the current available buffer. +// // Part of the image can now be refreshed by calling to +// // WebPIDecGetRGB()/WebPIDecGetYUV() etc. +// } +// WebPIDelete(idec); + +typedef struct WebPIDecoder WebPIDecoder; + +// Creates a new incremental decoder with the supplied buffer parameter. +// This output_buffer can be passed NULL, in which case a default output buffer +// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' +// is kept, which means that the lifespan of 'output_buffer' must be larger than +// that of the returned WebPIDecoder object. +// Returns NULL if the allocation failed. +WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* const output_buffer); + +// Creates a WebPIDecoder object. Returns NULL in case of failure. +// TODO(skal): DEPRECATED. Prefer using WebPINewDecoder(). +WEBP_EXTERN(WebPIDecoder*) WebPINew(WEBP_CSP_MODE mode); + +// This function allocates and initializes an incremental-decoder object, which +// will output the r/g/b(/a) samples specified by 'mode' into a preallocated +// buffer 'output_buffer'. The size of this buffer is at least +// 'output_buffer_size' and the stride (distance in bytes between two scanlines) +// is specified by 'output_stride'. Returns NULL if the allocation failed. +WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( + WEBP_CSP_MODE mode, + uint8_t* output_buffer, int output_buffer_size, int output_stride); + +// This function allocates and initializes an incremental-decoder object, which +// will output the raw luma/chroma samples into a preallocated planes. The luma +// plane is specified by its pointer 'luma', its size 'luma_size' and its stride +// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u', +// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v', 'v_size' +// and 'v_size'. +// Returns NULL if the allocation failed. +WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( + uint8_t* luma, int luma_size, int luma_stride, + uint8_t* u, int u_size, int u_stride, + uint8_t* v, int v_size, int v_stride); + +// Deletes the WebPIDecoder object and associated memory. Must always be called +// if WebPINew, WebPINewRGB or WebPINewYUV succeeded. +WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* const idec); + +// Copies and decodes the next available data. Returns VP8_STATUS_OK when +// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more +// data is expected. Returns error in other cases. +WEBP_EXTERN(VP8StatusCode) WebPIAppend( + WebPIDecoder* const idec, const uint8_t* data, uint32_t data_size); + +// A variant of the above function to be used when data buffer contains +// partial data from the beginning. In this case data buffer is not copied +// to the internal memory. +// Note that the value of the 'data' pointer can change between calls to +// WebPIUpdate, for instance when the data buffer is resized to fit larger data. +WEBP_EXTERN(VP8StatusCode) WebPIUpdate( + WebPIDecoder* const idec, const uint8_t* data, uint32_t data_size); + +// Returns the r/g/b/(a) image decoded so far. Returns NULL if output params +// are not initialized yet. The r/g/b/(a) output type corresponds to the mode +// specified in WebPINew()/WebPINewRGB(). *last_y is the index of last decoded +// row in raster scan order. Some pointers (*last_y, *width etc.) can be NULL if +// corresponding information is not needed. +WEBP_EXTERN(uint8_t*) WebPIDecGetRGB( + const WebPIDecoder* const idec, int* last_y, + int* width, int* height, int* stride); + +// Same as above function to get YUV image. Returns pointer to the luma plane +// or NULL in case of error. +WEBP_EXTERN(uint8_t*) WebPIDecGetYUV( + const WebPIDecoder* const idec, int* last_y, + uint8_t** u, uint8_t** v, + int* width, int* height, int* stride, int* uv_stride); + +// Generic call to retrieve information about the displayable area. +// If non NULL, the left/right/width/height pointers are filled with the visible +// rectangular area so far. +// Returns NULL in case the incremental decoder object is in an invalid state. +// Otherwise returns the pointer to the internal representation. This structure +// is read-only, tied to WebPIDecoder's lifespan and should not be modified. +WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea( + const WebPIDecoder* const idec, + int* const left, int* const top, + int* const width, int* const height); + +//------------------------------------------------------------------------------ +// Advanced decoding parametrization +// +// Code sample for using the advanced decoding API +/* + // A) Init a configuration object + WebPDecoderConfig config; + CHECK(WebPInitDecoderConfig(&config)); + + // B) optional: retrieve the bitstream's features. + CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + + // C) Adjust 'config', if needed + config.no_fancy = 1; + config.output.colorspace = MODE_BGRA; + // etc. + + // Note that you can also make config.output point to an externally + // supplied memory buffer, provided it's big enough to store the decoded + // picture. Otherwise, config.output will just be used to allocate memory + // and store the decoded picture. + + // D) Decode! + CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + + // E) Decoded image is now in config.output (and config.output.u.RGBA) + + // F) Reclaim memory allocated in config's object. It's safe to call + // this function even if the memory is external and wasn't allocated + // by WebPDecode(). + WebPFreeDecBuffer(&config.output); +*/ + +// Features gathered from the bitstream +typedef struct { + int width; // the original width, as read from the bitstream + int height; // the original height, as read from the bitstream + int has_alpha; // true if bitstream contains an alpha channel + int no_incremental_decoding; // if true, using incremental decoding is not + // recommended. + int rotate; // TODO(later) + int uv_sampling; // should be 0 for now. TODO(later) + int bitstream_version; // should be 0 for now. TODO(later) +} WebPBitstreamFeatures; + +// Internal, version-checked, entry point +WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( + const uint8_t*, uint32_t, WebPBitstreamFeatures* const, int); + +// Retrieve features from the bitstream. The *features structure is filled +// with information gathered from the bitstream. +// Returns false in case of error or version mismatch. +// In case of error, features->bitstream_status will reflect the error code. +static WEBP_INLINE VP8StatusCode WebPGetFeatures( + const uint8_t* data, uint32_t data_size, + WebPBitstreamFeatures* const features) { + return WebPGetFeaturesInternal(data, data_size, features, + WEBP_DECODER_ABI_VERSION); +} + +// Decoding options +typedef struct { + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution + int force_rotation; // forced rotation (to be applied _last_) + int no_enhancement; // if true, discard enhancement layer + int use_threads; // if true, use multi-threaded decoding +} WebPDecoderOptions; + +// Main object storing the configuration for advanced decoding. +typedef struct { + WebPBitstreamFeatures input; // Immutable bitstream features (optional) + WebPDecBuffer output; // Output buffer (can point to external mem) + WebPDecoderOptions options; // Decoding options +} WebPDecoderConfig; + +// Internal, version-checked, entry point +WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig* const, int); + +// Initialize the configuration as empty. This function must always be +// called first, unless WebPGetFeatures() is to be called. +// Returns false in case of mismatched version. +static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* const config) { + return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); +} + +// Instantiate a new incremental decoder object with requested configuration. +// The bitstream can be passed using *data and data_size parameter, +// in which case the features will be parsed and stored into config->input. +// Otherwise, 'data' can be NULL and now parsing will occur. +// Note that 'config' can be NULL too, in which case a default configuration is +// used. +// The return WebPIDecoder object must always be deleted calling WebPIDelete(). +// Returns NULL in case of error (and config->status will then reflect +// the error condition). +WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, uint32_t data_size, + WebPDecoderConfig* const config); + +// Non-incremental version. This version decodes the full data at once, taking +// 'config' into account. Return decoding status (VP8_STATUS_OK if decoding +// was successful). +WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, uint32_t data_size, + WebPDecoderConfig* const config); + +#if defined(__cplusplus) || defined(c_plusplus) +} // extern "C" +#endif + +#endif /* WEBP_WEBP_DECODE_H_ */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode_vp8.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode_vp8.h new file mode 100644 index 00000000..d458b829 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/decode_vp8.h @@ -0,0 +1,157 @@ +// Copyright 2010 Google Inc. +// +// This code is licensed under the same terms as WebM: +// Software License Agreement: http://www.webmproject.org/license/software/ +// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ +// ----------------------------------------------------------------------------- +// +// Low-level API for VP8 decoder +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_VP8_H_ +#define WEBP_WEBP_DECODE_VP8_H_ + +#include "./decode.h" + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +//------------------------------------------------------------------------------ +// Lower-level API +// +// These functions provide fine-grained control of the decoding process. +// The call flow should resemble: +// +// VP8Io io; +// VP8InitIo(&io); +// io.data = data; +// io.data_size = size; +// /* customize io's functions (setup()/put()/teardown()) if needed. */ +// +// VP8Decoder* dec = VP8New(); +// bool ok = VP8Decode(dec); +// if (!ok) printf("Error: %s\n", VP8StatusMessage(dec)); +// VP8Delete(dec); +// return ok; + +// Input / Output +typedef struct VP8Io VP8Io; +typedef int (*VP8IoPutHook)(const VP8Io* io); +typedef int (*VP8IoSetupHook)(VP8Io* io); +typedef void (*VP8IoTeardownHook)(const VP8Io* io); + +struct VP8Io { + // set by VP8GetHeaders() + int width, height; // picture dimensions, in pixels (invariable). + // These are the original, uncropped dimensions. + // The actual area passed to put() is stored + // in mb_w / mb_h fields. + + // set before calling put() + int mb_y; // position of the current rows (in pixels) + int mb_w; // number of columns in the sample + int mb_h; // number of rows in the sample + const uint8_t* y, *u, *v; // rows to copy (in yuv420 format) + int y_stride; // row stride for luma + int uv_stride; // row stride for chroma + + void* opaque; // user data + + // called when fresh samples are available. Currently, samples are in + // YUV420 format, and can be up to width x 24 in size (depending on the + // in-loop filtering level, e.g.). Should return false in case of error + // or abort request. The actual size of the area to update is mb_w x mb_h + // in size, taking cropping into account. + VP8IoPutHook put; + + // called just before starting to decode the blocks. + // Must return false in case of setup error, true otherwise. If false is + // returned, teardown() will NOT be called. But if the setup succeeded + // and true is returned, then teardown() will always be called afterward. + VP8IoSetupHook setup; + + // Called just after block decoding is finished (or when an error occurred + // during put()). Is NOT called if setup() failed. + VP8IoTeardownHook teardown; + + // this is a recommendation for the user-side yuv->rgb converter. This flag + // is set when calling setup() hook and can be overwritten by it. It then + // can be taken into consideration during the put() method. + int fancy_upsampling; + + // Input buffer. + uint32_t data_size; + const uint8_t* data; + + // If true, in-loop filtering will not be performed even if present in the + // bitstream. Switching off filtering may speed up decoding at the expense + // of more visible blocking. Note that output will also be non-compliant + // with the VP8 specifications. + int bypass_filtering; + + // Cropping parameters. + int use_cropping; + int crop_left, crop_right, crop_top, crop_bottom; + + // Scaling parameters. + int use_scaling; + int scaled_width, scaled_height; + + // pointer to the alpha data (if present) corresponding to the rows + const uint8_t* a; +}; + +// Internal, version-checked, entry point +WEBP_EXTERN(int) VP8InitIoInternal(VP8Io* const, int); + +// Set the custom IO function pointers and user-data. The setter for IO hooks +// should be called before initiating incremental decoding. Returns true if +// WebPIDecoder object is successfully modified, false otherwise. +WEBP_EXTERN(int) WebPISetIOHooks(WebPIDecoder* const idec, + VP8IoPutHook put, + VP8IoSetupHook setup, + VP8IoTeardownHook teardown, + void* user_data); + +// Main decoding object. This is an opaque structure. +typedef struct VP8Decoder VP8Decoder; + +// Create a new decoder object. +WEBP_EXTERN(VP8Decoder*) VP8New(void); + +// Must be called to make sure 'io' is initialized properly. +// Returns false in case of version mismatch. Upon such failure, no other +// decoding function should be called (VP8Decode, VP8GetHeaders, ...) +static WEBP_INLINE int VP8InitIo(VP8Io* const io) { + return VP8InitIoInternal(io, WEBP_DECODER_ABI_VERSION); +} + +// Start decoding a new picture. Returns true if ok. +WEBP_EXTERN(int) VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io); + +// Decode a picture. Will call VP8GetHeaders() if it wasn't done already. +// Returns false in case of error. +WEBP_EXTERN(int) VP8Decode(VP8Decoder* const dec, VP8Io* const io); + +// Return current status of the decoder: +WEBP_EXTERN(VP8StatusCode) VP8Status(VP8Decoder* const dec); + +// return readable string corresponding to the last status. +WEBP_EXTERN(const char*) VP8StatusMessage(VP8Decoder* const dec); + +// Resets the decoder in its initial state, reclaiming memory. +// Not a mandatory call between calls to VP8Decode(). +WEBP_EXTERN(void) VP8Clear(VP8Decoder* const dec); + +// Destroy the decoder object. +WEBP_EXTERN(void) VP8Delete(VP8Decoder* const dec); + +//------------------------------------------------------------------------------ + +#if defined(__cplusplus) || defined(c_plusplus) +} // extern "C" +#endif + +#endif /* WEBP_WEBP_DECODE_VP8_H_ */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/encode.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/encode.h new file mode 100644 index 00000000..442e70a8 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/encode.h @@ -0,0 +1,294 @@ +// Copyright 2011 Google Inc. +// +// This code is licensed under the same terms as WebM: +// Software License Agreement: http://www.webmproject.org/license/software/ +// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ +// ----------------------------------------------------------------------------- +// +// WebP encoder: main interface +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_ENCODE_H_ +#define WEBP_WEBP_ENCODE_H_ + +#include + +#include "./types.h" + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#define WEBP_ENCODER_ABI_VERSION 0x0003 + +// Return the encoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN(int) WebPGetEncoderVersion(void); + +//------------------------------------------------------------------------------ +// One-stop-shop call! No questions asked: + +// Returns the size of the compressed data (pointed to by *output), or 0 if +// an error occurred. The compressed data must be released by the caller +// using the call 'free(*output)'. +WEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra, + int width, int height, int stride, + float quality_factor, uint8_t** output); + +//------------------------------------------------------------------------------ +// Coding parameters + +typedef struct { + float quality; // between 0 (smallest file) and 100 (biggest) + int target_size; // if non-zero, set the desired target size in bytes. + // Takes precedence over the 'compression' parameter. + float target_PSNR; // if non-zero, specifies the minimal distortion to + // try to achieve. Takes precedence over target_size. + int method; // quality/speed trade-off (0=fast, 6=slower-better) + int segments; // maximum number of segments to use, in [1..4] + int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. + int filter_strength; // range: [0 = off .. 100 = strongest] + int filter_sharpness; // range: [0 = off .. 7 = least sharp] + int filter_type; // filtering type: 0 = simple, 1 = strong + // (only used if filter_strength > 0 or autofilter > 0) + int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] + int pass; // number of entropy-analysis passes (in [1..10]). + + int show_compressed; // if true, export the compressed picture back. + // In-loop filtering is not applied. + int preprocessing; // preprocessing filter (0=none, 1=segment-smooth) + int partitions; // log2(number of token partitions) in [0..3] + // Default is set to 0 for easier progressive decoding. + int partition_limit; // quality degradation allowed to fit the 512k limit on + // prediction modes coding (0=no degradation, 100=full) + int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, + // 1 = backward reference counts encoded with + // arithmetic encoder). Default is 1. + int alpha_quality; // Between 0 (smallest size) and 100 (lossless). + // Default is 100. +} WebPConfig; + +// Enumerate some predefined settings for WebPConfig, depending on the type +// of source picture. These presets are used when calling WebPConfigPreset(). +typedef enum { + WEBP_PRESET_DEFAULT = 0, // default preset. + WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot + WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting + WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details + WEBP_PRESET_ICON, // small-sized colorful images + WEBP_PRESET_TEXT // text-like +} WebPPreset; + +// Internal, version-checked, entry point +WEBP_EXTERN(int) WebPConfigInitInternal( + WebPConfig* const, WebPPreset, float, int); + +// Should always be called, to initialize a fresh WebPConfig structure before +// modification. Returns 0 in case of version mismatch. WebPConfigInit() must +// have succeeded before using the 'config' object. +static WEBP_INLINE int WebPConfigInit(WebPConfig* const config) { + return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, + WEBP_ENCODER_ABI_VERSION); +} + +// This function will initialize the configuration according to a predefined +// set of parameters (referred to by 'preset') and a given quality factor. +// This function can be called as a replacement to WebPConfigInit(). Will +// return 0 in case of error. +static WEBP_INLINE int WebPConfigPreset(WebPConfig* const config, + WebPPreset preset, float quality) { + return WebPConfigInitInternal(config, preset, quality, + WEBP_ENCODER_ABI_VERSION); +} + +// Returns 1 if all parameters are in valid range and the configuration is OK. +WEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* const config); + +//------------------------------------------------------------------------------ +// Input / Output + +typedef struct WebPPicture WebPPicture; // main structure for I/O + +// non-essential structure for storing auxiliary statistics +typedef struct { + float PSNR[4]; // peak-signal-to-noise ratio for Y/U/V/All + int coded_size; // final size + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 + int residual_bytes[3][4]; // approximate number of bytes spent for + // DC/AC/uv coefficients for each (0..3) segments. + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] + + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data + + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). +} WebPAuxStats; + +// Signature for output function. Should return 1 if writing was successful. +// data/data_size is the segment of data to write, and 'picture' is for +// reference (and so one can make use of picture->custom_ptr). +typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, + const WebPPicture* const picture); + +// Progress hook, called from time to time to report progress. It can return 0 +// to request an abort of the encoding process, or 1 otherwise if all is OK. +typedef int (*WebPProgressHook)(int percent, const WebPPicture* const picture); + +typedef enum { + // chroma sampling + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV422 = 1, // 4:2:2 + WEBP_YUV444 = 2, // 4:4:4 + WEBP_YUV400 = 3, // grayscale + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + // alpha channel variants + WEBP_YUV420A = 4, + WEBP_YUV422A = 5, + WEBP_YUV444A = 6, + WEBP_YUV400A = 7, // grayscale + alpha + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present +} WebPEncCSP; + +// Encoding error conditions. +typedef enum { + VP8_ENC_OK = 0, + VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects + VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits + VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL + VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid + VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height + VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k + VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M + VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes + VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G + VP8_ENC_ERROR_USER_ABORT, // abort request by user + VP8_ENC_ERROR_LAST // list terminator. always last. +} WebPEncodingError; + +// maximum width/height allowed (inclusive), in pixels +#define WEBP_MAX_DIMENSION 16383 + +struct WebPPicture { + // input + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t *y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t *a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + + // output + WebPWriterFunction writer; // can be NULL + void* custom_ptr; // can be used by the writer. + + // map for extra information + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. + + // where to store statistics, if not NULL: + WebPAuxStats* stats; + + // original samples (for non-YUV420 modes) + uint8_t *u0, *v0; + int uv0_stride; + + WebPEncodingError error_code; // error code in case of problem. + + WebPProgressHook progress_hook; // if not NULL, called while encoding. +}; + +// Internal, version-checked, entry point +WEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture* const, int); + +// Should always be called, to initialize the structure. Returns 0 in case of +// version mismatch. WebPPictureInit() must have succeeded before using the +// 'picture' object. +static WEBP_INLINE int WebPPictureInit(WebPPicture* const picture) { + return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// WebPPicture utils + +// Convenience allocation / deallocation based on picture->width/height: +// Allocate y/u/v buffers as per colorspace/width/height specification. +// Note! This function will free the previous buffer if needed. +// Returns 0 in case of memory error. +WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* const picture); + +// Release memory allocated by WebPPictureAlloc() or WebPPictureImport*() +// Note that this function does _not_ free the memory pointed to by 'picture'. +WEBP_EXTERN(void) WebPPictureFree(WebPPicture* const picture); + +// Copy the pixels of *src into *dst, using WebPPictureAlloc. +// Returns 0 in case of memory allocation error. +WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* const src, + WebPPicture* const dst); + +// self-crops a picture to the rectangle defined by top/left/width/height. +// Returns 0 in case of memory allocation error, or if the rectangle is +// outside of the source picture. +WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* const picture, + int left, int top, int width, int height); + +// Rescale a picture to new dimension width x height. +// Now gamma correction is applied. +// Returns false in case of error (invalid parameter or insufficient memory). +WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* const pic, + int width, int height); + +// Colorspace conversion function to import RGB samples. +// Previous buffer will be free'd, if any. +// *rgb buffer should have a size of at least height * rgb_stride. +// Returns 0 in case of memory error. +WEBP_EXTERN(int) WebPPictureImportRGB( + WebPPicture* const picture, const uint8_t* const rgb, int rgb_stride); +// Same, but for RGBA buffer +WEBP_EXTERN(int) WebPPictureImportRGBA( + WebPPicture* const picture, const uint8_t* const rgba, int rgba_stride); + +// Variant of the above, but taking BGR(A) input: +WEBP_EXTERN(int) WebPPictureImportBGR( + WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); +WEBP_EXTERN(int) WebPPictureImportBGRA( + WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); + +//------------------------------------------------------------------------------ +// Main call + +// Main encoding call, after config and picture have been initialized. +// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), +// and the 'config' object must be a valid one. +// Returns false in case of error, true otherwise. +// In case of error, picture->error_code is updated accordingly. +WEBP_EXTERN(int) WebPEncode( + const WebPConfig* const config, WebPPicture* const picture); + +//------------------------------------------------------------------------------ + +#if defined(__cplusplus) || defined(c_plusplus) +} // extern "C" +#endif + +#endif /* WEBP_WEBP_ENCODE_H_ */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/mux.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/mux.h new file mode 100644 index 00000000..9ceb7185 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/mux.h @@ -0,0 +1,467 @@ +// Copyright 2011 Google Inc. +// +// This code is licensed under the same terms as WebM: +// Software License Agreement: http://www.webmproject.org/license/software/ +// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ +// ----------------------------------------------------------------------------- +// +// RIFF container manipulation for WEBP images. +// +// Authors: Urvang (urvang@google.com) +// Vikas (vikasa@google.com) + +// This API allows manipulation of WebP container images containing features +// like Color profile, XMP metadata, Animation & Tiling. +// +// Code Example#1: Creating a MUX with image data, color profile & XMP metadata. +// +// int copy_data = 0; +// WebPMux* mux = WebPMuxNew(); +// // ... (Prepare image data). +// WebPMuxSetImage(mux, image_data, image_data_size, alpha_data, alpha_size, +// copy_data); +// // ... (Prepare ICCP color profile data). +// WebPMuxSetColorProfile(mux, icc_data, icc_data_size, copy_data); +// // ... (Prepare XMP metadata). +// WebPMuxSetMetadata(mux, xmp_data, xmp_data_size, copy_data); +// // Get data from mux in WebP RIFF format. +// WebPMuxAssemble(mux, &output_data, &output_data_size); +// WebPMuxDelete(mux); +// // ... (Consume output_data; e.g. write output_data to file). +// free(output_data); +// +// Code Example#2: Get image & color profile data from a WebP file. +// +// int copy_data = 0; +// // ... (Read data from file). +// WebPMux* mux = WebPMuxCreate(data, data_size, copy_data); +// WebPMuxGetImage(mux, &image_data, &image_data_size, +// &alpha_data, &alpha_size); +// // ... (Consume image_data; e.g. call WebPDecode() to decode the data). +// WebPMuxGetColorProfile(mux, &icc_data, &icc_data_size); +// // ... (Consume icc_data). +// WebPMuxDelete(mux); +// free(data); + +#ifndef WEBP_WEBP_MUX_H_ +#define WEBP_WEBP_MUX_H_ + +#include "./types.h" + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +// Error codes +typedef enum { + WEBP_MUX_OK = 1, + WEBP_MUX_ERROR = 0, + WEBP_MUX_NOT_FOUND = -1, + WEBP_MUX_INVALID_ARGUMENT = -2, + WEBP_MUX_INVALID_PARAMETER = -3, + WEBP_MUX_BAD_DATA = -4, + WEBP_MUX_MEMORY_ERROR = -5 +} WebPMuxError; + +// Flag values for different features used in VP8X chunk. +typedef enum { + TILE_FLAG = 0x00000001, + ANIMATION_FLAG = 0x00000002, + ICCP_FLAG = 0x00000004, + META_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010 +} FeatureFlags; + +typedef struct WebPMux WebPMux; // main opaque object. + +//------------------------------------------------------------------------------ +// Life of a Mux object + +// Creates an empty mux object. +// Returns: +// A pointer to the newly created empty mux object. +WEBP_EXTERN(WebPMux*) WebPMuxNew(void); + +// Deletes the mux object. +// Parameters: +// mux - (in/out) object to be deleted +WEBP_EXTERN(void) WebPMuxDelete(WebPMux* const mux); + +//------------------------------------------------------------------------------ +// Mux creation. + +// Creates a mux object from raw data given in WebP RIFF format. +// Parameters: +// data - (in) the raw data in WebP RIFF format +// size - (in) size of raw data +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// A pointer to the mux object created from given data - on success. +// NULL - In case of invalid data or memory error. +WEBP_EXTERN(WebPMux*) WebPMuxCreate(const uint8_t* data, uint32_t size, + int copy_data); + +//------------------------------------------------------------------------------ +// Single Image. + +// Sets the image in the mux object. Any existing images (including frame/tile) +// will be removed. +// Parameters: +// mux - (in/out) object in which the image is to be set +// data - (in) the image data to be set. The data can be either a VP8 +// bitstream or a single-image WebP file (non-animated & non-tiled) +// size - (in) size of the image data +// alpha_data - (in) the alpha data corresponding to the image (if present) +// alpha_size - (in) size of alpha chunk data +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxSetImage(WebPMux* const mux, + const uint8_t* data, uint32_t size, + const uint8_t* alpha_data, + uint32_t alpha_size, int copy_data); + +// Gets a reference to the image in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the image is to be fetched +// data - (out) the returned image data +// size - (out) size of the returned image data +// alpha_data - (in) the returned alpha data of the image (if present) +// alpha_size - (in) size of alpha chunk data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either of mux, data or size is NULL +// OR if mux contains animation/tiling. +// WEBP_MUX_NOT_FOUND - if image is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetImage(const WebPMux* const mux, + const uint8_t** data, uint32_t* size, + const uint8_t** alpha_data, + uint32_t* alpha_size); + +// Deletes the image in the mux object. +// Parameters: +// mux - (in/out) object from which the image is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// OR if mux contains animation/tiling. +// WEBP_MUX_NOT_FOUND - if image is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxDeleteImage(WebPMux* const mux); + +//------------------------------------------------------------------------------ +// XMP Metadata. + +// Sets the XMP metadata in the mux object. Any existing metadata chunk(s) will +// be removed. +// Parameters: +// mux - (in/out) object to which the XMP metadata is to be added +// data - (in) the XMP metadata data to be added +// size - (in) size of the XMP metadata data +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxSetMetadata(WebPMux* const mux, + const uint8_t* data, + uint32_t size, int copy_data); + +// Gets a reference to the XMP metadata in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the XMP metadata is to be fetched +// data - (out) the returned XMP metadata +// size - (out) size of the returned XMP metadata +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either of mux, data or size is NULL +// WEBP_MUX_NOT_FOUND - if metadata is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetMetadata(const WebPMux* const mux, + const uint8_t** data, + uint32_t* size); + +// Deletes the XMP metadata in the mux object. +// Parameters: +// mux - (in/out) object from which XMP metadata is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// WEBP_MUX_NOT_FOUND - If mux does not contain metadata. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxDeleteMetadata(WebPMux* const mux); + +//------------------------------------------------------------------------------ +// ICC Color Profile. + +// Sets the color profile in the mux object. Any existing color profile chunk(s) +// will be removed. +// Parameters: +// mux - (in/out) object to which the color profile is to be added +// data - (in) the color profile data to be added +// size - (in) size of the color profile data +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or data is NULL +// WEBP_MUX_MEMORY_ERROR - on memory allocation error +// WEBP_MUX_OK - on success +WEBP_EXTERN(WebPMuxError) WebPMuxSetColorProfile(WebPMux* const mux, + const uint8_t* data, + uint32_t size, int copy_data); + +// Gets a reference to the color profile in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the color profile data is to be fetched +// data - (out) the returned color profile data +// size - (out) size of the returned color profile data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either of mux, data or size is NULL +// WEBP_MUX_NOT_FOUND - if color profile is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetColorProfile(const WebPMux* const mux, + const uint8_t** data, + uint32_t* size); + +// Deletes the color profile in the mux object. +// Parameters: +// mux - (in/out) object from which color profile is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// WEBP_MUX_NOT_FOUND - If mux does not contain color profile. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxDeleteColorProfile(WebPMux* const mux); + +//------------------------------------------------------------------------------ +// Animation. + +// Adds an animation frame to the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object to which an animation frame is to be added +// nth - (in) The position at which the frame is to be added. +// data - (in) the raw VP8 image data corresponding to frame image. The data +// can be either a VP8 bitstream or a single-image WebP file +// (non-animated & non-tiled) +// size - (in) size of frame chunk data +// alpha_data - (in) the alpha data corresponding to frame image (if present) +// alpha_size - (in) size of alpha chunk data +// x_offset - (in) x-offset of the frame to be added +// y_offset - (in) y-offset of the frame to be added +// duration - (in) duration of the frame to be added (in milliseconds) +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or data is NULL +// WEBP_MUX_NOT_FOUND - If we have less than (nth-1) frames before adding. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxAddFrame(WebPMux* const mux, uint32_t nth, + const uint8_t* data, uint32_t size, + const uint8_t* alpha_data, + uint32_t alpha_size, + uint32_t x_offset, uint32_t y_offset, + uint32_t duration, int copy_data); + +// TODO(urvang): Create a struct as follows to reduce argument list size: +// typedef struct { +// int nth; +// uint8_t* data; +// uint32_t data_size; +// uint8_t* alpha; +// uint32_t alpha_size; +// uint32_t x_offset, y_offset; +// uint32_t duration; +// } FrameInfo; + +// Gets a reference to the nth animation frame from the mux object. +// The caller should NOT free the returned data. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the frame in the mux object +// data - (out) the returned image data +// size - (out) size of the returned image data +// alpha_data - (in) the alpha data corresponding to frame image (if present) +// alpha_size - (in) size of alpha chunk data +// x_offset - (out) x-offset of the returned frame +// y_offset - (out) y-offset of the returned frame +// duration - (out) duration of the returned frame (in milliseconds) +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either mux, data, size, x_offset, +// y_offset, or duration is NULL +// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. +// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetFrame(const WebPMux* const mux, + uint32_t nth, + const uint8_t** data, uint32_t* size, + const uint8_t** alpha_data, + uint32_t* alpha_size, + uint32_t* x_offset, + uint32_t* y_offset, + uint32_t* duration); + +// Deletes an animation frame from the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object from which a frame is to be deleted +// nth - (in) The position from which the frame is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxDeleteFrame(WebPMux* const mux, uint32_t nth); + +// Sets the animation loop count in the mux object. Any existing loop count +// value(s) will be removed. +// Parameters: +// mux - (in/out) object in which loop chunk is to be set/added +// loop_count - (in) animation loop count value. +// Note that loop_count of zero denotes infinite loop. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxSetLoopCount(WebPMux* const mux, + uint32_t loop_count); + +// Gets the animation loop count from the mux object. +// Parameters: +// mux - (in) object from which the loop count is to be fetched +// loop_count - (out) the loop_count value present in the LOOP chunk +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either of mux or loop_count is NULL +// WEBP_MUX_NOT_FOUND - if loop chunk is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetLoopCount(const WebPMux* const mux, + uint32_t* loop_count); + +//------------------------------------------------------------------------------ +// Tiling. + +// Adds a tile to the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object to which a tile is to be added +// nth - (in) The position at which the tile is to be added. +// data - (in) the raw VP8 image data corresponding to tile image. The data +// can be either a VP8 bitstream or a single-image WebP file +// (non-animated & non-tiled) +// size - (in) size of tile chunk data +// alpha_data - (in) the alpha data corresponding to tile image (if present) +// alpha_size - (in) size of alpha chunk data +// x_offset - (in) x-offset of the tile to be added +// y_offset - (in) y-offset of the tile to be added +// copy_data - (in) value 1 indicates given data WILL copied to the mux, and +// value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or data is NULL +// WEBP_MUX_NOT_FOUND - If we have less than (nth-1) tiles before adding. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxAddTile(WebPMux* const mux, uint32_t nth, + const uint8_t* data, uint32_t size, + const uint8_t* alpha_data, + uint32_t alpha_size, + uint32_t x_offset, uint32_t y_offset, + int copy_data); + +// Gets a reference to the nth tile from the mux object. +// The caller should NOT free the returned data. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the tile in the mux object +// data - (out) the returned image data +// size - (out) size of the returned image data +// alpha_data - (in) the alpha data corresponding to tile image (if present) +// alpha_size - (in) size of alpha chunk data +// x_offset - (out) x-offset of the returned tile +// y_offset - (out) y-offset of the returned tile +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either mux, data, size, x_offset or +// y_offset is NULL +// WEBP_MUX_NOT_FOUND - if there are less than nth tiles in the mux object. +// WEBP_MUX_BAD_DATA - if nth tile chunk in mux is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetTile(const WebPMux* const mux, uint32_t nth, + const uint8_t** data, uint32_t* size, + const uint8_t** alpha_data, + uint32_t* alpha_size, + uint32_t* x_offset, + uint32_t* y_offset); + +// Deletes a tile from the mux object. +// nth=0 has a special meaning - last position +// Parameters: +// mux - (in/out) object from which a tile is to be deleted +// nth - (in) The position from which the tile is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL +// WEBP_MUX_NOT_FOUND - If there are less than nth tiles in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxDeleteTile(WebPMux* const mux, uint32_t nth); + +//------------------------------------------------------------------------------ +// Misc Utilities. + +// Gets the feature flags from the mux object. +// Parameters: +// mux - (in) object from which the features are to be fetched +// flags - (out) the flags specifying which features are present in the +// mux object. This will be an OR of various flag values. +// Enum 'FeatureFlags' can be used to test for individual flag values. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or flags is NULL +// WEBP_MUX_NOT_FOUND - if VP8X chunk is not present in mux object. +// WEBP_MUX_BAD_DATA - if VP8X chunk in mux is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxGetFeatures(const WebPMux* const mux, + uint32_t* flags); + +// Gets number of chunks having tag value tag in the mux object. +// Parameters: +// mux - (in) object from which the info is to be fetched +// tag - (in) tag name specifying the type of chunk +// num_elements - (out) number of chunks corresponding to the specified tag +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if either mux, tag or num_elements is NULL +// WEBP_MUX_OK - on success. +WEBP_EXTERN(WebPMuxError) WebPMuxNumNamedElements(const WebPMux* const mux, + const char* tag, + int* num_elements); + +// Assembles all chunks in WebP RIFF format and returns in output_data. +// This function also validates the mux object. +// The content of '*output_data' is allocated using malloc(), and NOT +// owned by the 'mux' object. +// It MUST be deallocated by the caller by calling free(). +// Parameters: +// mux - (in/out) object whose chunks are to be assembled +// output_data - (out) byte array where assembled WebP data is returned +// output_size - (out) size of returned data +// Returns: +// WEBP_MUX_BAD_DATA - if mux object is invalid. +// WEBP_MUX_INVALID_ARGUMENT - if either mux, output_data or output_size is +// NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success +WEBP_EXTERN(WebPMuxError) WebPMuxAssemble(WebPMux* const mux, + uint8_t** output_data, + uint32_t* output_size); + +//------------------------------------------------------------------------------ + +#if defined(__cplusplus) || defined(c_plusplus) +} // extern "C" +#endif + +#endif /* WEBP_WEBP_MUX_H_ */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/types.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/types.h new file mode 100644 index 00000000..e45dc6de --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers/webp/types.h @@ -0,0 +1,40 @@ +// Copyright 2010 Google Inc. +// +// This code is licensed under the same terms as WebM: +// Software License Agreement: http://www.webmproject.org/license/software/ +// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ +// ----------------------------------------------------------------------------- +// +// Common types +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_TYPES_H_ +#define WEBP_WEBP_TYPES_H_ + +#ifndef _MSC_VER +#include +#ifdef __STRICT_ANSI__ +#define WEBP_INLINE +#else /* __STRICT_ANSI__ */ +#define WEBP_INLINE inline +#endif +#else +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; +#define WEBP_INLINE __forceinline +#endif /* _MSC_VER */ + +#ifndef WEBP_EXTERN +// This explicitly marks library functions and allows for changing the +// signature for e.g., Windows DLL builds. +#define WEBP_EXTERN(type) extern type +#endif /* WEBP_EXTERN */ + +#endif /* WEBP_WEBP_TYPES_H_ */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/English.lproj/InfoPlist.strings b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 00000000..680c8e55 Binary files /dev/null and b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/English.lproj/InfoPlist.strings differ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/Info.plist b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..949ae696 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + FLAC + CFBundleGetInfoString + libwebp 0.1.3 + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + FLAC + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.3 + CFBundleSignature + ???? + CFBundleVersion + 0.1.3 + + diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/webp b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/webp new file mode 100755 index 00000000..ffda3107 Binary files /dev/null and b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/webp differ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/Current b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/webp b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/webp new file mode 120000 index 00000000..26e4ebdd --- /dev/null +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Frameworks/webp.framework/webp @@ -0,0 +1 @@ +Versions/Current/webp \ No newline at end of file diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Headers/SDL_image.h b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Headers/SDL_image.h index de2ae18e..156cb940 100644 --- a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Headers/SDL_image.h +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Headers/SDL_image.h @@ -1,23 +1,22 @@ /* - SDL_image: An example image loading library for use with SDL - Copyright (C) 1997-2009 Sam Lantinga + SDL_image: An example image loading library for use with SDL + Copyright (C) 1997-2012 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library 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 - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /* A simple library to load images of various formats as SDL surfaces */ @@ -25,9 +24,9 @@ #ifndef _SDL_IMAGE_H #define _SDL_IMAGE_H -#include "SDL.h" -#include "SDL_version.h" -#include "begin_code.h" +#include +#include +#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus @@ -38,7 +37,7 @@ extern "C" { */ #define SDL_IMAGE_MAJOR_VERSION 1 #define SDL_IMAGE_MINOR_VERSION 2 -#define SDL_IMAGE_PATCHLEVEL 10 +#define SDL_IMAGE_PATCHLEVEL 12 /* This macro can be used to fill a version structure with the compile-time * version of the SDL_image library. @@ -60,7 +59,8 @@ typedef enum { IMG_INIT_JPG = 0x00000001, IMG_INIT_PNG = 0x00000002, - IMG_INIT_TIF = 0x00000004 + IMG_INIT_TIF = 0x00000004, + IMG_INIT_WEBP = 0x00000008 } IMG_InitFlags; /* Loads dynamic libraries and prepares them for use. Flags should be @@ -104,6 +104,7 @@ extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src); extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src); /* Individual loading functions */ extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src); @@ -120,6 +121,7 @@ extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src); extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); @@ -131,6 +133,6 @@ extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); #ifdef __cplusplus } #endif -#include "close_code.h" +#include #endif /* _SDL_IMAGE_H */ diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Resources/Info.plist b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Resources/Info.plist index 8eee15d4..5b2ca4f7 100644 --- a/source/xcode/Frameworks/SDL_image.framework/Versions/A/Resources/Info.plist +++ b/source/xcode/Frameworks/SDL_image.framework/Versions/A/Resources/Info.plist @@ -2,25 +2,37 @@ + BuildMachineOSBuild + 11C74 CFBundleDevelopmentRegion English CFBundleExecutable SDL_image - CFBundleGetInfoString - http://www.libsdl.org CFBundleIdentifier - SDL_image + org.libsdl.SDL-image CFBundleInfoDictionaryVersion 6.0 CFBundleName - Simple DirectMedia Layer + SDL_image CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.10 - CFBundleSignature - SDL_imageX + 1.2.12 CFBundleVersion - 1.2.10 + 1.2.12 + DTCompiler + + DTPlatformBuild + 4D502 + DTPlatformVersion + GM + DTSDKBuild + 11C63 + DTSDKName + macosx10.7 + DTXcode + 0421 + DTXcodeBuild + 4D502 diff --git a/source/xcode/Frameworks/SDL_image.framework/Versions/A/SDL_image b/source/xcode/Frameworks/SDL_image.framework/Versions/A/SDL_image index 0144a96e..bfd6a038 100755 Binary files a/source/xcode/Frameworks/SDL_image.framework/Versions/A/SDL_image and b/source/xcode/Frameworks/SDL_image.framework/Versions/A/SDL_image differ diff --git a/source/xcode/assaultcube.plist b/source/xcode/assaultcube.plist index 4ee8a49b..85f52b5e 100644 --- a/source/xcode/assaultcube.plist +++ b/source/xcode/assaultcube.plist @@ -2,21 +2,14 @@ - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - CFBundleDevelopmentRegion English CFBundleExecutable assaultcube CFBundleIconFile assaultcube + CFBundleIdentifier + net.cubers CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -25,6 +18,15 @@ ???? CFBundleVersion 1.2.x.x + LSMinimumSystemVersionByArchitecture + + i386 + 10.4.0 + ppc + 10.4.0 + x86_64 + 10.6.0 + NSPrincipalClass NSApplication diff --git a/source/xcode/assaultcube.xcodeproj/project.pbxproj b/source/xcode/assaultcube.xcodeproj/project.pbxproj index ed30a3b9..e9a8f5d1 100644 --- a/source/xcode/assaultcube.xcodeproj/project.pbxproj +++ b/source/xcode/assaultcube.xcodeproj/project.pbxproj @@ -7,8 +7,12 @@ objects = { /* Begin PBXBuildFile section */ - 4FD7C9D3171F34D400D81258 /* libcurl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FD7C9D2171F34D300D81258 /* libcurl.framework */; }; - 4FD7C9D5171F355200D81258 /* libcurl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4FD7C9D4171F355200D81258 /* libcurl.framework */; }; + 4F93906E1A1598140049877C /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EB8171611ED9AEF00799589 /* SDL_image.framework */; }; + 4F9390711A15985A0049877C /* SDL_image.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171611ED9AEF00799589 /* SDL_image.framework */; }; + 4FEAF3331A14757700B42D47 /* libcurl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FEAF3321A14757700B42D47 /* libcurl.framework */; }; + 4FEAF3341A1475E600B42D47 /* libcurl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4FEAF3321A14757700B42D47 /* libcurl.framework */; }; + 4FEAF3381A147F9F00B42D47 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EB8171511ED9AEF00799589 /* SDL.framework */; }; + 4FEAF3391A147FAE00B42D47 /* SDL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171511ED9AEF00799589 /* SDL.framework */; }; 665CDCA60AFE7ECD0030D605 /* callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 665CDC6B0AFE7ECC0030D605 /* callbacks.c */; }; 665CDCB80AFE7ECD0030D605 /* host.c in Sources */ = {isa = PBXBuildFile; fileRef = 665CDC7E0AFE7ECD0030D605 /* host.c */; }; 665CDCCB0AFE7ECD0030D605 /* list.c in Sources */ = {isa = PBXBuildFile; fileRef = 665CDC930AFE7ECD0030D605 /* list.c */; }; @@ -33,8 +37,6 @@ 9EB8172111ED9AEF00799589 /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EB8171911ED9AEF00799589 /* Vorbis.framework */; }; 9EB8179311ED9EDF00799589 /* INTL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171211ED9AEF00799589 /* INTL.framework */; }; 9EB8179511ED9EDF00799589 /* Ogg.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171411ED9AEF00799589 /* Ogg.framework */; }; - 9EB8179611ED9EDF00799589 /* SDL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171511ED9AEF00799589 /* SDL.framework */; }; - 9EB8179711ED9EDF00799589 /* SDL_image.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171611ED9AEF00799589 /* SDL_image.framework */; }; 9EB8179A11ED9EDF00799589 /* Vorbis.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9EB8171911ED9AEF00799589 /* Vorbis.framework */; }; 9EB8181D11EDA56D00799589 /* assaultcube.icns in Resources */ = {isa = PBXBuildFile; fileRef = 9EB817DE11EDA3A300799589 /* assaultcube.icns */; }; 9EB8188511EDACDB00799589 /* assaultcube.icns in Resources */ = {isa = PBXBuildFile; fileRef = 9EB817DE11EDA3A300799589 /* assaultcube.icns */; }; @@ -97,8 +99,6 @@ B96D0D6D0920976E00B6C936 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B96D0D6C0920976E00B6C936 /* main.m */; }; B9EF952411CEE3D300B773C1 /* i18n.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B914CE5111CAC42F009BA307 /* i18n.cpp */; }; B9FA3B7D0DD9E6E400581F8D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9FA3B7C0DD9E6E400581F8D /* OpenAL.framework */; }; - D23715801690FCA500AB6EDD /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D237157E1690FCA500AB6EDD /* SDL_image.framework */; }; - D23715811690FCA500AB6EDD /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D237157F1690FCA500AB6EDD /* SDL.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -118,11 +118,11 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 4FD7C9D5171F355200D81258 /* libcurl.framework in CopyFiles */, + 4F9390711A15985A0049877C /* SDL_image.framework in CopyFiles */, + 4FEAF3391A147FAE00B42D47 /* SDL.framework in CopyFiles */, + 4FEAF3341A1475E600B42D47 /* libcurl.framework in CopyFiles */, 9EB8179311ED9EDF00799589 /* INTL.framework in CopyFiles */, 9EB8179511ED9EDF00799589 /* Ogg.framework in CopyFiles */, - 9EB8179611ED9EDF00799589 /* SDL.framework in CopyFiles */, - 9EB8179711ED9EDF00799589 /* SDL_image.framework in CopyFiles */, 9EB8179A11ED9EDF00799589 /* Vorbis.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -134,8 +134,7 @@ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 4FD7C9D2171F34D300D81258 /* libcurl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libcurl.framework; path = Frameworks/libcurl.framework; sourceTree = ""; }; - 4FD7C9D4171F355200D81258 /* libcurl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libcurl.framework; path = Frameworks/libcurl.framework; sourceTree = ""; }; + 4FEAF3321A14757700B42D47 /* libcurl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libcurl.framework; path = Frameworks/libcurl.framework; sourceTree = ""; }; 665CDC6B0AFE7ECC0030D605 /* callbacks.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = callbacks.c; sourceTree = ""; }; 665CDC7E0AFE7ECD0030D605 /* host.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = host.c; sourceTree = ""; }; 665CDC930AFE7ECD0030D605 /* list.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = list.c; sourceTree = ""; }; @@ -258,8 +257,6 @@ B96D0D6C0920976E00B6C936 /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; B975E7F30EBCC3A200880D5D /* map.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = map.icns; sourceTree = ""; }; B9FA3B7C0DD9E6E400581F8D /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = /System/Library/Frameworks/OpenAL.framework; sourceTree = ""; }; - D237157E1690FCA500AB6EDD /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = ../../../../../../../../../../Library/Frameworks/SDL_image.framework; sourceTree = ""; }; - D237157F1690FCA500AB6EDD /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = ../../../../../../../../../../Library/Frameworks/SDL.framework; sourceTree = ""; }; F5A47A9D01A0482F01D3D55B /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; F5A47A9E01A0483001D3D55B /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -269,10 +266,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4FD7C9D3171F34D400D81258 /* libcurl.framework in Frameworks */, - D23715801690FCA500AB6EDD /* SDL_image.framework in Frameworks */, - D23715811690FCA500AB6EDD /* SDL.framework in Frameworks */, + 4F93906E1A1598140049877C /* SDL_image.framework in Frameworks */, B94198C309207E810029DAD1 /* Cocoa.framework in Frameworks */, + 4FEAF3381A147F9F00B42D47 /* SDL.framework in Frameworks */, + 4FEAF3331A14757700B42D47 /* libcurl.framework in Frameworks */, B9FA3B7D0DD9E6E400581F8D /* OpenAL.framework in Frameworks */, B94198C409207E810029DAD1 /* OpenGL.framework in Frameworks */, 9EB8171A11ED9AEF00799589 /* INTL.framework in Frameworks */, @@ -342,10 +339,6 @@ 29B97314FDCFA39411CA2CEA /* sauerbraten */ = { isa = PBXGroup; children = ( - 4FD7C9D4171F355200D81258 /* libcurl.framework */, - 4FD7C9D2171F34D300D81258 /* libcurl.framework */, - D237157E1690FCA500AB6EDD /* SDL_image.framework */, - D237157F1690FCA500AB6EDD /* SDL.framework */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, @@ -385,6 +378,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 4FEAF3321A14757700B42D47 /* libcurl.framework */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -752,6 +746,8 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", "\"$(SRCROOT)/Frameworks\"", + "$(PROJECT_DIR)/Frameworks", + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/Frameworks\""; @@ -768,14 +764,16 @@ ../include/, ); INFOPLIST_FILE = assaultcube.plist; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../lib\"", ); - MACOSX_DEPLOYMENT_TARGET = 10.4; + MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET_i386 = 10.5; OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = assaultcube; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_STYLE = all; }; name = Debug; @@ -788,6 +786,8 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", "\"$(SRCROOT)/Frameworks\"", + "$(PROJECT_DIR)/Frameworks", + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/Frameworks\""; @@ -804,14 +804,16 @@ ../include/, ); INFOPLIST_FILE = assaultcube.plist; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../lib\"", ); - MACOSX_DEPLOYMENT_TARGET = 10.4; + MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET_i386 = 10.5; OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = assaultcube; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_STYLE = all; }; name = Release; @@ -826,6 +828,8 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", "\"$(SRCROOT)/Frameworks\"", + "$(PROJECT_DIR)/Frameworks", + "$(LOCAL_LIBRARY_DIR)/Frameworks", ); FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/Frameworks\""; @@ -846,15 +850,17 @@ ../include/, ); INFOPLIST_FILE = assaultcube.plist; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../lib\"", ); - MACOSX_DEPLOYMENT_TARGET = 10.4; + MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET_i386 = 10.5; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-lz"; PRODUCT_NAME = assaultcube; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_STYLE = all; }; name = "Release-Deployment"; @@ -867,11 +873,10 @@ DEPLOYMENT_POSTPROCESSING = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_OPTIMIZATION_LEVEL = 3; - GCC_VERSION = com.apple.compilers.llvmgcc42; - MACOSX_DEPLOYMENT_TARGET = ""; + GCC_VERSION = ""; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_INSTALLED_PRODUCT = NO; }; name = "Release-Deployment"; @@ -883,12 +888,11 @@ COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; GCC_OPTIMIZATION_LEVEL = 0; - GCC_VERSION = com.apple.compilers.llvmgcc42; - MACOSX_DEPLOYMENT_TARGET = ""; + GCC_VERSION = ""; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_INSTALLED_PRODUCT = NO; }; name = Debug; @@ -900,11 +904,10 @@ COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; GCC_OPTIMIZATION_LEVEL = 3; - GCC_VERSION = com.apple.compilers.llvmgcc42; - MACOSX_DEPLOYMENT_TARGET = ""; + GCC_VERSION = ""; MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; - SDKROOT = macosx; + SDKROOT = macosx10.8; STRIP_INSTALLED_PRODUCT = NO; }; name = Release;