mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2025-01-18 15:42:14 +00:00
ioquake3 resync to revision 3331 from 3306.
OpenGL2: Use an OpenGL 3.2 core context if available OpenGL2: Remove GLSL_ValidateProgram() OpenGL2: Don't do MSAA resolve/shadow mask/SSAO on shadow views OpenGL2: "Fix" cg_shadows 4 Fix score bonus for defending the flag carrier in CTF Restore not giving defense score bonus to flag carrier Add score bonus for defending the flag carrier in 1 Flag CTF Move CON_Init ahead of Com_Init to avoid Windows dedicated server crash Make 'globalservers 0' fetch all masters OpenGL2: Don't use initialized arrays in glsl shaders Echo server say/tell/sayto message to console Don't try to remove non-existant command 'shaderstate' Update internal curl to 7.54.0 Silence g_util.c warning about set but not read variable Remove unused imgFlag_t value IMGFLAG_SRGB Make warmup in Team Deathmatch wait for players to join both teams Remove CVAR_PROTECTED from cl_renderer Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Fix friction in AAS_ClientMovementPrediction Fix floating point precision loss in renderer Reject OpenGL contexts w/ software renderer when core context requested
This commit is contained in:
parent
5620be89ed
commit
e7405e98df
72 changed files with 32278 additions and 5202 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -44,7 +44,7 @@ ifndef BUILD_DEFINES
|
|||
endif
|
||||
|
||||
# ioquake3 svn version that this is based on
|
||||
IOQ3_REVISION = 3306
|
||||
IOQ3_REVISION = 3331
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
|
@ -641,9 +641,9 @@ ifdef MINGW
|
|||
ifeq ($(USE_LOCAL_HEADERS),1)
|
||||
CLIENT_CFLAGS += -DCURL_STATICLIB
|
||||
ifeq ($(ARCH),x86_64)
|
||||
CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a
|
||||
CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a -lcrypt32
|
||||
else
|
||||
CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a
|
||||
CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a -lcrypt32
|
||||
endif
|
||||
else
|
||||
CLIENT_LIBS += $(CURL_LIBS)
|
||||
|
|
|
@ -553,7 +553,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
|
|||
//if on the ground or swimming
|
||||
if (onground || swimming)
|
||||
{
|
||||
friction = swimming ? phys_friction : phys_waterfriction;
|
||||
friction = swimming ? phys_waterfriction : phys_friction;
|
||||
//apply friction
|
||||
VectorScale(frame_test_vel, 1/frametime, frame_test_vel);
|
||||
AAS_ApplyFriction(frame_test_vel, friction, phys_stopspeed, frametime);
|
||||
|
|
|
@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "../qcommon/qcommon.h"
|
||||
|
||||
#ifdef USE_LOCAL_HEADERS
|
||||
#include "../libcurl-7.35.0/curl/curl.h"
|
||||
#include "../curl-7.54.0/include/curl/curl.h"
|
||||
#else
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
|
|
@ -2471,7 +2471,7 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend
|
|||
byte* buffptr;
|
||||
byte* buffend;
|
||||
|
||||
Com_Printf("CL_ServersResponsePacket\n");
|
||||
Com_Printf("CL_ServersResponsePacket from %s\n", NET_AdrToStringwPort(*from));
|
||||
|
||||
if (cls.numglobalservers == -1) {
|
||||
// state to detect lack of servers or lack of response
|
||||
|
@ -3207,7 +3207,7 @@ void CL_InitRef( void ) {
|
|||
Com_Printf( "----- Initializing Renderer ----\n" );
|
||||
|
||||
#ifdef USE_RENDERER_DLOPEN
|
||||
cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTECTED);
|
||||
cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH);
|
||||
|
||||
Com_sprintf(dllName, sizeof(dllName), "renderer_%s_" ARCH_STRING DLL_EXT, cl_renderer->string);
|
||||
|
||||
|
@ -4165,6 +4165,10 @@ void CL_LocalServers_f( void ) {
|
|||
/*
|
||||
==================
|
||||
CL_GlobalServers_f
|
||||
|
||||
Originally master 0 was Internet and master 1 was MPlayer.
|
||||
ioquake3 2008; added support for requesting five separate master servers using 0-4.
|
||||
ioquake3 2017; made master 0 fetch all master servers and 1-5 request a single master server.
|
||||
==================
|
||||
*/
|
||||
void CL_GlobalServers_f( void ) {
|
||||
|
@ -4172,13 +4176,36 @@ void CL_GlobalServers_f( void ) {
|
|||
int count, i, masterNum;
|
||||
char command[1024], *masteraddress;
|
||||
|
||||
if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS - 1)
|
||||
if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS)
|
||||
{
|
||||
Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS - 1);
|
||||
Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS);
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(command, "sv_master%d", masterNum + 1);
|
||||
// request from all master servers
|
||||
if ( masterNum == 0 ) {
|
||||
int numAddress = 0;
|
||||
|
||||
for ( i = 1; i <= MAX_MASTER_SERVERS; i++ ) {
|
||||
sprintf(command, "sv_master%d", i);
|
||||
masteraddress = Cvar_VariableString(command);
|
||||
|
||||
if(!*masteraddress)
|
||||
continue;
|
||||
|
||||
numAddress++;
|
||||
|
||||
Com_sprintf(command, sizeof(command), "globalservers %d %s %s\n", i, Cmd_Argv(2), Cmd_ArgsFrom(3));
|
||||
Cbuf_AddText(command);
|
||||
}
|
||||
|
||||
if ( !numAddress ) {
|
||||
Com_Printf( "CL_GlobalServers_f: Error: No master server addresses.\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(command, "sv_master%d", masterNum);
|
||||
masteraddress = Cvar_VariableString(command);
|
||||
|
||||
if(!*masteraddress)
|
||||
|
@ -4200,7 +4227,7 @@ void CL_GlobalServers_f( void ) {
|
|||
else if(i == 2)
|
||||
to.port = BigShort(PORT_MASTER);
|
||||
|
||||
Com_Printf("Requesting servers from master %s...\n", masteraddress);
|
||||
Com_Printf("Requesting servers from %s (%s)...\n", masteraddress, NET_AdrToStringwPort(to));
|
||||
|
||||
cls.numglobalservers = -1;
|
||||
cls.pingUpdateSource = AS_GLOBAL;
|
||||
|
|
330
engine/code/curl-7.54.0/include/README
Normal file
330
engine/code/curl-7.54.0/include/README
Normal file
|
@ -0,0 +1,330 @@
|
|||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the curl project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
15312
engine/code/curl-7.54.0/include/curl/curl.h
Normal file
15312
engine/code/curl-7.54.0/include/curl/curl.h
Normal file
File diff suppressed because it is too large
Load diff
3516
engine/code/curl-7.54.0/include/curl/curlbuild.h
Normal file
3516
engine/code/curl-7.54.0/include/curl/curlbuild.h
Normal file
File diff suppressed because it is too large
Load diff
1434
engine/code/curl-7.54.0/include/curl/curlrules.h
Normal file
1434
engine/code/curl-7.54.0/include/curl/curlrules.h
Normal file
File diff suppressed because it is too large
Load diff
462
engine/code/curl-7.54.0/include/curl/curlver.h
Normal file
462
engine/code/curl-7.54.0/include/curl/curlver.h
Normal file
|
@ -0,0 +1,462 @@
|
|||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.54.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 54
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073600
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 19 05:43:55 UTC 2017"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
612
engine/code/curl-7.54.0/include/curl/easy.h
Normal file
612
engine/code/curl-7.54.0/include/curl/easy.h
Normal file
|
@ -0,0 +1,612 @@
|
|||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
300
engine/code/curl-7.54.0/include/curl/mprintf.h
Normal file
300
engine/code/curl-7.54.0/include/curl/mprintf.h
Normal file
|
@ -0,0 +1,300 @@
|
|||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
2634
engine/code/curl-7.54.0/include/curl/multi.h
Normal file
2634
engine/code/curl-7.54.0/include/curl/multi.h
Normal file
File diff suppressed because it is too large
Load diff
198
engine/code/curl-7.54.0/include/curl/stdcheaders.h
Normal file
198
engine/code/curl-7.54.0/include/curl/stdcheaders.h
Normal file
|
@ -0,0 +1,198 @@
|
|||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
2904
engine/code/curl-7.54.0/include/curl/system.h
Normal file
2904
engine/code/curl-7.54.0/include/curl/system.h
Normal file
File diff suppressed because it is too large
Load diff
3744
engine/code/curl-7.54.0/include/curl/typecheck-gcc.h
Normal file
3744
engine/code/curl-7.54.0/include/curl/typecheck-gcc.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1881,7 +1881,7 @@ void CheckTournament( void ) {
|
|||
int counts[TEAM_NUM_TEAMS];
|
||||
qboolean notEnough = qfalse;
|
||||
|
||||
if ( g_gametype.integer > GT_TEAM ) {
|
||||
if ( g_gametype.integer >= GT_TEAM ) {
|
||||
counts[TEAM_BLUE] = TeamCount( -1, TEAM_BLUE );
|
||||
counts[TEAM_RED] = TeamCount( -1, TEAM_RED );
|
||||
|
||||
|
|
|
@ -314,6 +314,7 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_gametype.integer == GT_1FCTF) {
|
||||
flag_pw = PW_NEUTRALFLAG;
|
||||
enemy_flag_pw = PW_NEUTRALFLAG;
|
||||
}
|
||||
#endif
|
||||
|
@ -379,23 +380,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
return;
|
||||
}
|
||||
|
||||
if (targ->client->pers.teamState.lasthurtcarrier &&
|
||||
level.time - targ->client->pers.teamState.lasthurtcarrier < CTF_CARRIER_DANGER_PROTECT_TIMEOUT) {
|
||||
// attacker is on the same team as the skull carrier and
|
||||
AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_DANGER_PROTECT_BONUS);
|
||||
|
||||
attacker->client->pers.teamState.carrierdefense++;
|
||||
targ->client->pers.teamState.lasthurtcarrier = 0;
|
||||
|
||||
attacker->client->ps.persistant[PERS_DEFEND_COUNT]++;
|
||||
// add the sprite over the player's head
|
||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||
attacker->client->ps.eFlags |= EF_AWARD_DEFEND;
|
||||
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// flag and flag carrier area defense bonuses
|
||||
|
||||
// we have to find the flag and carrier entities
|
||||
|
@ -476,7 +460,7 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
|
||||
if (carrier && carrier != attacker) {
|
||||
VectorSubtract(targ->r.currentOrigin, carrier->r.currentOrigin, v1);
|
||||
VectorSubtract(attacker->r.currentOrigin, carrier->r.currentOrigin, v1);
|
||||
VectorSubtract(attacker->r.currentOrigin, carrier->r.currentOrigin, v2);
|
||||
|
||||
if ( ( ( VectorLength(v1) < CTF_ATTACKER_PROTECT_RADIUS &&
|
||||
trap_InPVS(carrier->r.currentOrigin, targ->r.currentOrigin ) ) ||
|
||||
|
@ -517,6 +501,12 @@ void Team_CheckHurtCarrier(gentity_t *targ, gentity_t *attacker)
|
|||
else
|
||||
flag_pw = PW_REDFLAG;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_gametype.integer == GT_1FCTF) {
|
||||
flag_pw = PW_NEUTRALFLAG;
|
||||
}
|
||||
#endif
|
||||
|
||||
// flags
|
||||
if (targ->client->ps.powerups[flag_pw] &&
|
||||
targ->client->sess.sessionTeam != attacker->client->sess.sessionTeam)
|
||||
|
|
|
@ -404,7 +404,6 @@ gentity_t *G_Spawn( void ) {
|
|||
gentity_t *e;
|
||||
|
||||
e = NULL; // shut up warning
|
||||
i = 0; // shut up warning
|
||||
for ( force = 0 ; force < 2 ; force++ ) {
|
||||
// if we go through all entities and can't find one to free,
|
||||
// override the normal minimum times before use
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,587 +0,0 @@
|
|||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* See file include/curl/curlbuild.h.in, run configure, and forget
|
||||
* that this file exists it is only used for non-configure systems.
|
||||
* But you can keep reading if you want ;-)
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* Try to keep one section per platform, compiler and architecture,
|
||||
* otherwise, if an existing section is reused for a different one and
|
||||
* later on the original is adjusted, probably the piggybacking one can
|
||||
* be adversely changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures
|
||||
* use only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a
|
||||
* 64-bit wide signed integral data type. The width of this data type
|
||||
* must remain constant and independent of any possible large file
|
||||
* support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a
|
||||
* 32-bit wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This
|
||||
* rule shall only be violated if off_t is the only 64-bit data type
|
||||
* available and the size of off_t is independent of large file support
|
||||
* settings. Keep your build on the safe side avoiding an off_t gating.
|
||||
* If you have a 64-bit off_t then take for sure that another 64-bit
|
||||
* data type exists, dig deeper and you will find it.
|
||||
*
|
||||
* NOTE 3:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.dist or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
* file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h
|
||||
* when the libcurl source code distribution archive file is created.
|
||||
*
|
||||
* File include/curl/curlbuild.h.dist is not included in the distribution
|
||||
* archive. File include/curl/curlbuild.h is not present in the git tree.
|
||||
*
|
||||
* The distributed include/curl/curlbuild.h file is only intended to be used
|
||||
* on systems which can not run the also distributed configure script.
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
* appropriate buildconf* script to set up curlbuild.h and other local files.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x520)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__386__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# if (__POCC__ < 280)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# elif defined(_MSC_VER)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__CW32__)
|
||||
# pragma longlong on
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__VC32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__VMS)
|
||||
# if defined(__VAX)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# if defined(__ILEC400__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__MVS__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(__ILP32__) || \
|
||||
defined(__i386__) || defined(__ppc__) || defined(__powerpc__) || \
|
||||
defined(__arm__) || defined(__sparc__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64__) || \
|
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__powerpc64__) || \
|
||||
defined(__sparc64__)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
# error "Unknown non-configure build target!"
|
||||
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
|
@ -1,262 +0,0 @@
|
|||
#ifndef __CURL_CURLRULES_H
|
||||
#define __CURL_CURLRULES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by curl/curl.h when an application is
|
||||
* being built using an already built libcurl library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the curlbuild.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the libcurl development mailing list:
|
||||
* http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built libcurl library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_01__
|
||||
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_off_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_02__
|
||||
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_off_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for long
|
||||
* for the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_03__
|
||||
[CurlchkszGE(curl_off_t, long)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_04__
|
||||
[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_05__
|
||||
[CurlchkszGE(curl_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
|
||||
# define __CURL_OFF_T_C_HLPR2(x) x
|
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
|
||||
#else
|
||||
# ifdef CURL_ISOCPP
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
|
||||
# else
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
|
||||
# endif
|
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CurlchkszEQ
|
||||
#undef CurlchkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
#ifdef CURL_NO_OLDIES
|
||||
#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLRULES_H */
|
|
@ -1,69 +0,0 @@
|
|||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2014 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.35.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 35
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x072300
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Jan 29 07:09:27 UTC 2014"
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
|
@ -1,102 +0,0 @@
|
|||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,81 +0,0 @@
|
|||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef _MPRINTF_REPLACE
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef sprintf
|
||||
# undef vsprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
# define printf curl_mprintf
|
||||
# define fprintf curl_mfprintf
|
||||
#ifdef CURLDEBUG
|
||||
/* When built with CURLDEBUG we define away the sprintf functions since we
|
||||
don't want internal code to be using them */
|
||||
# define sprintf sprintf_was_used
|
||||
# define vsprintf vsprintf_was_used
|
||||
#else
|
||||
# define sprintf curl_msprintf
|
||||
# define vsprintf curl_mvsprintf
|
||||
#endif
|
||||
# define snprintf curl_msnprintf
|
||||
# define vprintf curl_mvprintf
|
||||
# define vfprintf curl_mvfprintf
|
||||
# define vsnprintf curl_mvsnprintf
|
||||
# define aprintf curl_maprintf
|
||||
# define vaprintf curl_mvaprintf
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
|
@ -1,399 +0,0 @@
|
|||
#ifndef __CURL_MULTI_H
|
||||
#define __CURL_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here!
|
||||
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h
|
||||
* itself includes this file and we expect user applications to do #include
|
||||
* <curl/curl.h> without the need for especially including multi.h.
|
||||
*
|
||||
* For some reason we added this include here at one point, and rather than to
|
||||
* break existing (wrongly written) libcurl applications, we leave it as-is
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */
|
||||
CURLM_OK,
|
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
|
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
|
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
|
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
|
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */
|
||||
CURLMSG_LAST /* last, not used */
|
||||
} CURLMSG;
|
||||
|
||||
struct CURLMsg {
|
||||
CURLMSG msg; /* what this message means */
|
||||
CURL *easy_handle; /* the handle it concerns */
|
||||
union {
|
||||
void *whatever; /* message-specific data */
|
||||
CURLcode result; /* return code for transfer */
|
||||
} data;
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We don't use pollfd and POLL* constants explicitly
|
||||
* to cover platforms without poll(). */
|
||||
#define CURL_WAIT_POLLIN 0x0001
|
||||
#define CURL_WAIT_POLLPRI 0x0002
|
||||
#define CURL_WAIT_POLLOUT 0x0004
|
||||
|
||||
struct curl_waitfd {
|
||||
curl_socket_t fd;
|
||||
short events;
|
||||
short revents; /* not supported yet */
|
||||
};
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: inititalize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset()
|
||||
*
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_wait()
|
||||
*
|
||||
* Desc: Poll on all fds within a CURLM set as well as any
|
||||
* additional fds passed to the function.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
* Desc: When the app thinks there's data available for curl it calls this
|
||||
* function to read/write whatever there is right now. This returns
|
||||
* as soon as the reads and writes are done. This function does not
|
||||
* require that there actually is data available for reading or that
|
||||
* data can be written, it can be called just in case. It returns
|
||||
* the number of handles that still transfer data in the second
|
||||
* argument's integer-pointer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on invidual transfers even when this
|
||||
* returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup()
|
||||
*
|
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read()
|
||||
*
|
||||
* Desc: Ask the multi handle if there's any messages/informationals from
|
||||
* the individual transfers. Messages include informationals such as
|
||||
* error code from the transfer or just the fact that a transfer is
|
||||
* completed. More details on these should be written down as well.
|
||||
*
|
||||
* Repeated calls to this function will return a new struct each
|
||||
* time, until a special "end of msgs" struct is returned as a signal
|
||||
* that there is no more to get at this point.
|
||||
*
|
||||
* The data the returned pointer points to will not survive calling
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic informations. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
* must never expose complex structs to applications, as then we'll
|
||||
* undoubtably get backwards compatibility problems in the future.
|
||||
*
|
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
|
||||
* of structs. It also writes the number of messages left in the
|
||||
* queue (after this read) in the integer the second argument points
|
||||
* to.
|
||||
*/
|
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* Returns: A pointer to a zero-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform.
|
||||
* See man page for details.
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
#define CURL_CSELECT_IN 0x01
|
||||
#define CURL_CSELECT_OUT 0x02
|
||||
#define CURL_CSELECT_ERR 0x04
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp, /* private callback
|
||||
pointer */
|
||||
void *socketp); /* private socket
|
||||
pointer */
|
||||
/*
|
||||
* Name: curl_multi_timer_callback
|
||||
*
|
||||
* Desc: Called by libcurl whenever the library detects a change in the
|
||||
* maximum number of milliseconds the app is allowed to wait before
|
||||
* curl_multi_socket() or curl_multi_perform() must be called
|
||||
* (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: The callback should return zero.
|
||||
*/
|
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
|
||||
long timeout_ms, /* see above */
|
||||
void *userp); /* private callback
|
||||
pointer */
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
int ev_bitmask,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
|
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket()
|
||||
*/
|
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
long *milliseconds);
|
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
#define LONG CURLOPTTYPE_LONG
|
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
|
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
|
||||
#define OFF_T CURLOPTTYPE_OFF_T
|
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* This is the socket callback function pointer */
|
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
|
||||
|
||||
/* This is the argument passed to the socket callback */
|
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2),
|
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */
|
||||
CINIT(PIPELINING, LONG, 3),
|
||||
|
||||
/* This is the timer callback function pointer */
|
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
|
||||
|
||||
/* This is the argument passed to the timer callback */
|
||||
CINIT(TIMERDATA, OBJECTPOINT, 5),
|
||||
|
||||
/* maximum number of entries in the connection cache */
|
||||
CINIT(MAXCONNECTS, LONG, 6),
|
||||
|
||||
/* maximum number of (pipelining) connections to one host */
|
||||
CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
|
||||
|
||||
/* maximum number of requests in a pipeline */
|
||||
CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
|
||||
|
||||
/* a connection with a content-length longer than this
|
||||
will not be considered for pipelining */
|
||||
CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
|
||||
|
||||
/* a connection with a chunk length longer than this
|
||||
will not be considered for pipelining */
|
||||
CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
|
||||
|
||||
/* a list of site names(+port) that are blacklisted from
|
||||
pipelining */
|
||||
CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
|
||||
|
||||
/* a list of server types that are blacklisted from
|
||||
pipelining */
|
||||
CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
|
||||
|
||||
/* maximum number of open connections in total */
|
||||
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt()
|
||||
*
|
||||
* Desc: Sets options for the multi handle.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMoption option, ...);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign()
|
||||
*
|
||||
* Desc: This function sets an association in the multi handle between the
|
||||
* given socket and a private pointer of the application. This is
|
||||
* (only) useful for curl_multi_socket uses.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread (void *, size_t, size_t, FILE *);
|
||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
|
@ -1,610 +0,0 @@
|
|||
#ifndef __CURL_TYPECHECK_GCC_H
|
||||
#define __CURL_TYPECHECK_GCC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */
|
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(_curl_is_sometype_option(_curl_opt))
|
||||
* if(!_curl_is_sometype(value))
|
||||
* _curl_easy_setopt_err_sometype();
|
||||
* block and define _curl_is_sometype_option, _curl_is_sometype and
|
||||
* _curl_easy_setopt_err_sometype below
|
||||
*
|
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
||||
* when compiling with -Wlogical-op.
|
||||
*
|
||||
* To add an option that uses the same type as an existing option, you'll just
|
||||
* need to extend the appropriate _curl_*_option macro
|
||||
*/
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (option) _curl_opt = option; \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
if(_curl_is_long_option(_curl_opt)) \
|
||||
if(!_curl_is_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if(_curl_is_off_t_option(_curl_opt)) \
|
||||
if(!_curl_is_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if(_curl_is_string_option(_curl_opt)) \
|
||||
if(!_curl_is_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if(_curl_is_write_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!_curl_is_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!_curl_is_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!_curl_is_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!_curl_is_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!_curl_is_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!_curl_is_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(_curl_is_conv_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!_curl_is_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if(_curl_is_cb_data_option(_curl_opt)) \
|
||||
if(!_curl_is_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if(!_curl_is_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if((_curl_opt) == CURLOPT_STDERR) \
|
||||
if(!_curl_is_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if(_curl_is_postfields_option(_curl_opt)) \
|
||||
if(!_curl_is_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if(_curl_is_slist_option(_curl_opt)) \
|
||||
if(!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if((_curl_opt) == CURLOPT_SHARE) \
|
||||
if(!_curl_is_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
})
|
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */
|
||||
/* FIXME: don't allow const pointers */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (info) _curl_info = info; \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
if(_curl_is_string_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if(_curl_is_long_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if(_curl_is_double_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if(_curl_is_slist_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
})
|
||||
|
||||
/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
|
||||
* for now just make sure that the functions are called with three
|
||||
* arguments
|
||||
*/
|
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
|
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
|
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */
|
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
|
||||
#define _CURL_WARNING(id, message) \
|
||||
static void __attribute__((__warning__(message))) \
|
||||
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
||||
id(void) { __asm__(""); }
|
||||
|
||||
_CURL_WARNING(_curl_easy_setopt_err_long,
|
||||
"curl_easy_setopt expects a long argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
|
||||
"curl_easy_setopt expects a curl_off_t argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_string,
|
||||
"curl_easy_setopt expects a "
|
||||
"string (char* or char[]) argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
|
||||
"curl_easy_setopt expects a curl_write_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
|
||||
"curl_easy_setopt expects a curl_read_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
|
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
|
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
|
||||
"curl_easy_setopt expects a "
|
||||
"curl_opensocket_callback argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
|
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
|
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
|
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
|
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
|
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
|
||||
"curl_easy_setopt expects a "
|
||||
"private data pointer as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a "
|
||||
"char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE,
|
||||
"curl_easy_setopt expects a FILE* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields,
|
||||
"curl_easy_setopt expects a void* or char* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
"curl_easy_setopt expects a struct curl_httppost* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
|
||||
"curl_easy_setopt expects a struct curl_slist* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
|
||||
"curl_easy_setopt expects a CURLSH* argument for this option")
|
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string,
|
||||
"curl_easy_getinfo expects a pointer to char * for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_long,
|
||||
"curl_easy_getinfo expects a pointer to long for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_double,
|
||||
"curl_easy_getinfo expects a pointer to double for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
|
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */
|
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING
|
||||
* to the or-expression. If the option takes a long or curl_off_t, you don't
|
||||
* have to do anything
|
||||
*/
|
||||
|
||||
/* evaluates to true if option takes a long argument */
|
||||
#define _curl_is_long_option(option) \
|
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
|
||||
|
||||
#define _curl_is_off_t_option(option) \
|
||||
((option) > CURLOPTTYPE_OFF_T)
|
||||
|
||||
/* evaluates to true if option takes a char* argument */
|
||||
#define _curl_is_string_option(option) \
|
||||
((option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
#define _curl_is_write_cb_option(option) \
|
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */
|
||||
#define _curl_is_conv_cb_option(option) \
|
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define _curl_is_cb_data_option(option) \
|
||||
((option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_WRITEHEADER || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
#define _curl_is_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define _curl_is_slist_option(option) \
|
||||
((option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */
|
||||
#define _curl_is_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
|
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */
|
||||
#define _curl_is_long_info(info) \
|
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */
|
||||
#define _curl_is_double_info(info) \
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define _curl_is_slist_info(info) \
|
||||
(CURLINFO_SLIST < (info))
|
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/
|
||||
|
||||
/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p
|
||||
* in the GCC manual.
|
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
|
||||
* the actual expression passed to the curl_easy_setopt macro. This
|
||||
* means that you can only apply the sizeof and __typeof__ operators, no
|
||||
* == or whatsoever.
|
||||
*/
|
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */
|
||||
#define _curl_is_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void*))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
#define _curl_is_NULL(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
|
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */
|
||||
#define _curl_is_ptr(expr, type) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *))
|
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
|
||||
#define _curl_is_arr(expr, type) \
|
||||
(_curl_is_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type []))
|
||||
|
||||
/* evaluates to true if expr is a string */
|
||||
#define _curl_is_string(expr) \
|
||||
(_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), signed char) || \
|
||||
_curl_is_arr((expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which
|
||||
* are promoted to int when passed to a variadic function) */
|
||||
#define _curl_is_long(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */
|
||||
#define _curl_is_off_t(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
||||
/* XXX: also check size of an char[] array? */
|
||||
#define _curl_is_error_buffer(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[]))
|
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
|
||||
#if 0
|
||||
#define _curl_is_cb_data(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_ptr((expr), FILE))
|
||||
#else /* be less strict */
|
||||
#define _curl_is_cb_data(expr) \
|
||||
_curl_is_any_ptr(expr)
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type FILE* */
|
||||
#define _curl_is_FILE(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))
|
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
||||
#define _curl_is_postfields(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char))
|
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const
|
||||
* pointers in arguments at least
|
||||
*/
|
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */
|
||||
#define _curl_callback_compatible(func, type) \
|
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func), type*))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
#define _curl_is_read_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define _curl_is_write_cb(expr) \
|
||||
(_curl_is_read_cb(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define _curl_is_ioctl_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define _curl_is_sockopt_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2))
|
||||
typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */
|
||||
#define _curl_is_opensocket_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4))
|
||||
typedef curl_socket_t (_curl_opensocket_callback1)
|
||||
(void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback2)
|
||||
(void *, curlsocktype, const struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback3)
|
||||
(const void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback4)
|
||||
(const void *, curlsocktype, const struct curl_sockaddr *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
||||
#define _curl_is_progress_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2))
|
||||
typedef int (_curl_progress_callback1)(void *,
|
||||
double, double, double, double);
|
||||
typedef int (_curl_progress_callback2)(const void *,
|
||||
double, double, double, double);
|
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
||||
#define _curl_is_debug_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback8))
|
||||
typedef int (_curl_debug_callback1) (CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback2) (CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback3) (CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback4) (CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback5) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback6) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback7) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback8) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
||||
/* this is getting even messier... */
|
||||
#define _curl_is_ssl_ctx_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
|
||||
typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
|
||||
#ifdef HEADER_SSL_H
|
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers...
|
||||
*/
|
||||
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
|
||||
const void *);
|
||||
#else
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
||||
#define _curl_is_conv_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback4))
|
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
||||
#define _curl_is_seek_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2))
|
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
|
||||
|
||||
|
||||
#endif /* __CURL_TYPECHECK_GCC_H */
|
Binary file not shown.
Binary file not shown.
|
@ -97,12 +97,15 @@ MULTIPLAYER MENU (SERVER BROWSER)
|
|||
#define GR_LETTERS 31
|
||||
|
||||
#define UIAS_LOCAL 0
|
||||
#define UIAS_GLOBAL1 1
|
||||
#define UIAS_GLOBAL2 2
|
||||
#define UIAS_GLOBAL3 3
|
||||
#define UIAS_GLOBAL4 4
|
||||
#define UIAS_GLOBAL5 5
|
||||
#define UIAS_FAVORITES 6
|
||||
#define UIAS_GLOBAL0 1
|
||||
#define UIAS_GLOBAL1 2
|
||||
#define UIAS_GLOBAL2 3
|
||||
#define UIAS_GLOBAL3 4
|
||||
#define UIAS_GLOBAL4 5
|
||||
#define UIAS_GLOBAL5 6
|
||||
#define UIAS_FAVORITES 7
|
||||
|
||||
#define UI_MAX_MASTER_SERVERS 6
|
||||
|
||||
#define SORT_HOST 0
|
||||
#define SORT_MAP 1
|
||||
|
@ -130,11 +133,12 @@ MULTIPLAYER MENU (SERVER BROWSER)
|
|||
|
||||
static const char *master_items[] = {
|
||||
"Local",
|
||||
"Internet1",
|
||||
"Internet2",
|
||||
"Internet3",
|
||||
"Internet4",
|
||||
"Internet5",
|
||||
"Internet",
|
||||
"Master1",
|
||||
"Master2",
|
||||
"Master3",
|
||||
"Master4",
|
||||
"Master5",
|
||||
"Favorites",
|
||||
NULL
|
||||
};
|
||||
|
@ -306,8 +310,8 @@ typedef struct {
|
|||
static arenaservers_t g_arenaservers;
|
||||
|
||||
|
||||
static servernode_t g_globalserverlist[MAX_GLOBALSERVERS];
|
||||
static int g_numglobalservers;
|
||||
static servernode_t g_globalserverlist[UI_MAX_MASTER_SERVERS][MAX_GLOBALSERVERS];
|
||||
static int g_numglobalservers[UI_MAX_MASTER_SERVERS];
|
||||
static servernode_t g_localserverlist[MAX_LOCALSERVERS];
|
||||
static int g_numlocalservers;
|
||||
static servernode_t g_favoriteserverlist[MAX_FAVORITESERVERS];
|
||||
|
@ -445,6 +449,7 @@ int ArenaServers_SourceForLAN(void) {
|
|||
default:
|
||||
case UIAS_LOCAL:
|
||||
return AS_LOCAL;
|
||||
case UIAS_GLOBAL0:
|
||||
case UIAS_GLOBAL1:
|
||||
case UIAS_GLOBAL2:
|
||||
case UIAS_GLOBAL3:
|
||||
|
@ -597,7 +602,7 @@ static void ArenaServers_UpdateMenu( void ) {
|
|||
g_arenaservers.go.generic.flags &= ~QMF_GRAYED;
|
||||
|
||||
// update status bar
|
||||
if( g_servertype >= UIAS_GLOBAL1 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
if( g_servertype >= UIAS_GLOBAL0 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
g_arenaservers.statusbar.string = quake3worldMessage;
|
||||
}
|
||||
else {
|
||||
|
@ -639,7 +644,7 @@ static void ArenaServers_UpdateMenu( void ) {
|
|||
}
|
||||
|
||||
// update status bar
|
||||
if( g_servertype >= UIAS_GLOBAL1 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
if( g_servertype >= UIAS_GLOBAL0 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
g_arenaservers.statusbar.string = quake3worldMessage;
|
||||
}
|
||||
else {
|
||||
|
@ -1223,7 +1228,7 @@ static void ArenaServers_StartRefresh( void )
|
|||
return;
|
||||
}
|
||||
|
||||
if( g_servertype >= UIAS_GLOBAL1 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
if( g_servertype >= UIAS_GLOBAL0 && g_servertype <= UIAS_GLOBAL5 ) {
|
||||
gametype = ArenaServers_GametypeForGames(g_arenaservers.gametype.curvalue);
|
||||
|
||||
// Add requested gametype to args for dpmaster
|
||||
|
@ -1244,10 +1249,10 @@ static void ArenaServers_StartRefresh( void )
|
|||
protocol[0] = '\0';
|
||||
trap_Cvar_VariableStringBuffer( "debug_protocol", protocol, sizeof(protocol) );
|
||||
if (strlen(protocol)) {
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %s%s\n", g_servertype - 1, protocol, myargs ));
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %s%s\n", g_servertype - UIAS_GLOBAL0, protocol, myargs ));
|
||||
}
|
||||
else {
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %d%s\n", g_servertype - 1, (int)trap_Cvar_VariableValue( "protocol" ), myargs ) );
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %d%s\n", g_servertype - UIAS_GLOBAL0, (int)trap_Cvar_VariableValue( "protocol" ), myargs ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1299,7 +1304,7 @@ int ArenaServers_SetType( int type )
|
|||
|
||||
while(type <= UIAS_GLOBAL5)
|
||||
{
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", type);
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", type - UIAS_GLOBAL0);
|
||||
trap_Cvar_VariableStringBuffer(cvarname, masterstr, sizeof(masterstr));
|
||||
if(*masterstr)
|
||||
break;
|
||||
|
@ -1320,6 +1325,7 @@ int ArenaServers_SetType( int type )
|
|||
g_arenaservers.maxservers = MAX_LOCALSERVERS;
|
||||
break;
|
||||
|
||||
case UIAS_GLOBAL0:
|
||||
case UIAS_GLOBAL1:
|
||||
case UIAS_GLOBAL2:
|
||||
case UIAS_GLOBAL3:
|
||||
|
@ -1327,8 +1333,8 @@ int ArenaServers_SetType( int type )
|
|||
case UIAS_GLOBAL5:
|
||||
g_arenaservers.save.generic.flags &= ~(QMF_INACTIVE|QMF_HIDDEN);
|
||||
g_arenaservers.remove.generic.flags |= (QMF_INACTIVE|QMF_HIDDEN);
|
||||
g_arenaservers.serverlist = g_globalserverlist;
|
||||
g_arenaservers.numservers = &g_numglobalservers;
|
||||
g_arenaservers.serverlist = g_globalserverlist[type-UIAS_GLOBAL0];
|
||||
g_arenaservers.numservers = &g_numglobalservers[type-UIAS_GLOBAL0];
|
||||
g_arenaservers.maxservers = MAX_GLOBALSERVERS;
|
||||
break;
|
||||
|
||||
|
|
|
@ -279,9 +279,14 @@ int Huff_Receive (node_t *node, int *ch, byte *fin) {
|
|||
}
|
||||
|
||||
/* Get a symbol */
|
||||
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset) {
|
||||
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset, int maxoffset) {
|
||||
bloc = *offset;
|
||||
while (node && node->symbol == INTERNAL_NODE) {
|
||||
if (bloc >= maxoffset) {
|
||||
*ch = 0;
|
||||
*offset = maxoffset + 1;
|
||||
return;
|
||||
}
|
||||
if (get_bit(fin)) {
|
||||
node = node->right;
|
||||
} else {
|
||||
|
@ -298,11 +303,15 @@ void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset) {
|
|||
}
|
||||
|
||||
/* Send the prefix code for this node */
|
||||
static void send(node_t *node, node_t *child, byte *fout) {
|
||||
static void send(node_t *node, node_t *child, byte *fout, int maxoffset) {
|
||||
if (node->parent) {
|
||||
send(node->parent, node, fout);
|
||||
send(node->parent, node, fout, maxoffset);
|
||||
}
|
||||
if (child) {
|
||||
if (bloc >= maxoffset) {
|
||||
bloc = maxoffset + 1;
|
||||
return;
|
||||
}
|
||||
if (node->right == child) {
|
||||
add_bit(1, fout);
|
||||
} else {
|
||||
|
@ -312,22 +321,22 @@ static void send(node_t *node, node_t *child, byte *fout) {
|
|||
}
|
||||
|
||||
/* Send a symbol */
|
||||
void Huff_transmit (huff_t *huff, int ch, byte *fout) {
|
||||
void Huff_transmit (huff_t *huff, int ch, byte *fout, int maxoffset) {
|
||||
int i;
|
||||
if (huff->loc[ch] == NULL) {
|
||||
/* node_t hasn't been transmitted, send a NYT, then the symbol */
|
||||
Huff_transmit(huff, NYT, fout);
|
||||
Huff_transmit(huff, NYT, fout, maxoffset);
|
||||
for (i = 7; i >= 0; i--) {
|
||||
add_bit((char)((ch >> i) & 0x1), fout);
|
||||
}
|
||||
} else {
|
||||
send(huff->loc[ch], NULL, fout);
|
||||
send(huff->loc[ch], NULL, fout, maxoffset);
|
||||
}
|
||||
}
|
||||
|
||||
void Huff_offsetTransmit (huff_t *huff, int ch, byte *fout, int *offset) {
|
||||
void Huff_offsetTransmit (huff_t *huff, int ch, byte *fout, int *offset, int maxoffset) {
|
||||
bloc = *offset;
|
||||
send(huff->loc[ch], NULL, fout);
|
||||
send(huff->loc[ch], NULL, fout, maxoffset);
|
||||
*offset = bloc;
|
||||
}
|
||||
|
||||
|
@ -413,7 +422,7 @@ void Huff_Compress(msg_t *mbuf, int offset) {
|
|||
|
||||
for (i=0; i<size; i++ ) {
|
||||
ch = buffer[i];
|
||||
Huff_transmit(&huff, ch, seq); /* Transmit symbol */
|
||||
Huff_transmit(&huff, ch, seq, size<<3); /* Transmit symbol */
|
||||
Huff_addRef(&huff, (byte)ch); /* Do update */
|
||||
}
|
||||
|
||||
|
|
|
@ -107,9 +107,7 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
|||
|
||||
oldsize += bits;
|
||||
|
||||
// this isn't an exact overflow check, but close enough
|
||||
if ( msg->maxsize - msg->cursize < 4 ) {
|
||||
msg->overflowed = qtrue;
|
||||
if ( msg->overflowed ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,6 +120,11 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
|||
}
|
||||
|
||||
if ( msg->oob ) {
|
||||
if ( msg->cursize + ( bits >> 3 ) > msg->maxsize ) {
|
||||
msg->overflowed = qtrue;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( bits == 8 ) {
|
||||
msg->data[msg->cursize] = value;
|
||||
msg->cursize += 1;
|
||||
|
@ -144,6 +147,10 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
|||
if ( bits&7 ) {
|
||||
int nbits;
|
||||
nbits = bits&7;
|
||||
if ( msg->bit + nbits > msg->maxsize << 3 ) {
|
||||
msg->overflowed = qtrue;
|
||||
return;
|
||||
}
|
||||
for( i = 0; i < nbits; i++ ) {
|
||||
Huff_putBit( (value & 1), msg->data, &msg->bit );
|
||||
value = (value >> 1);
|
||||
|
@ -152,8 +159,13 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
|||
}
|
||||
if ( bits ) {
|
||||
for( i = 0; i < bits; i += 8 ) {
|
||||
Huff_offsetTransmit( &msgHuff.compressor, (value & 0xff), msg->data, &msg->bit );
|
||||
Huff_offsetTransmit( &msgHuff.compressor, (value & 0xff), msg->data, &msg->bit, msg->maxsize << 3 );
|
||||
value = (value >> 8);
|
||||
|
||||
if ( msg->bit > msg->maxsize << 3 ) {
|
||||
msg->overflowed = qtrue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
msg->cursize = (msg->bit >> 3) + 1;
|
||||
|
@ -167,6 +179,10 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
|
|||
int i, nbits;
|
||||
// FILE* fp;
|
||||
|
||||
if ( msg->readcount > msg->cursize ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
value = 0;
|
||||
|
||||
if ( bits < 0 ) {
|
||||
|
@ -177,6 +193,11 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
|
|||
}
|
||||
|
||||
if (msg->oob) {
|
||||
if (msg->readcount + (bits>>3) > msg->cursize) {
|
||||
msg->readcount = msg->cursize + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(bits==8)
|
||||
{
|
||||
value = msg->data[msg->readcount];
|
||||
|
@ -204,6 +225,10 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
|
|||
nbits = 0;
|
||||
if (bits&7) {
|
||||
nbits = bits&7;
|
||||
if (msg->bit + nbits > msg->cursize << 3) {
|
||||
msg->readcount = msg->cursize + 1;
|
||||
return 0;
|
||||
}
|
||||
for(i=0;i<nbits;i++) {
|
||||
value |= (Huff_getBit(msg->data, &msg->bit)<<i);
|
||||
}
|
||||
|
@ -212,9 +237,14 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
|
|||
if (bits) {
|
||||
// fp = fopen("c:\\netchan.bin", "a");
|
||||
for(i=0;i<bits;i+=8) {
|
||||
Huff_offsetReceive (msgHuff.decompressor.tree, &get, msg->data, &msg->bit);
|
||||
Huff_offsetReceive (msgHuff.decompressor.tree, &get, msg->data, &msg->bit, msg->cursize<<3);
|
||||
// fwrite(&get, 1, 1, fp);
|
||||
value |= (get<<(i+nbits));
|
||||
|
||||
if (msg->bit > msg->cursize<<3) {
|
||||
msg->readcount = msg->cursize + 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// fclose(fp);
|
||||
}
|
||||
|
|
|
@ -1202,9 +1202,9 @@ void Huff_Decompress(msg_t *buf, int offset);
|
|||
void Huff_Init(huffman_t *huff);
|
||||
void Huff_addRef(huff_t* huff, byte ch);
|
||||
int Huff_Receive (node_t *node, int *ch, byte *fin);
|
||||
void Huff_transmit (huff_t *huff, int ch, byte *fout);
|
||||
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset);
|
||||
void Huff_offsetTransmit (huff_t *huff, int ch, byte *fout, int *offset);
|
||||
void Huff_transmit (huff_t *huff, int ch, byte *fout, int maxoffset);
|
||||
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset, int maxoffset);
|
||||
void Huff_offsetTransmit (huff_t *huff, int ch, byte *fout, int *offset, int maxoffset);
|
||||
void Huff_putBit( int bit, byte *fout, int *offset);
|
||||
int Huff_getBit( byte *fout, int *offset);
|
||||
|
||||
|
|
|
@ -381,6 +381,7 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
|
||||
// OpenGL 1.3, was GL_ARB_texture_compression
|
||||
#define QGL_1_3_PROCS \
|
||||
GLE(void, ActiveTexture, GLenum texture) \
|
||||
GLE(void, CompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) \
|
||||
GLE(void, CompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) \
|
||||
|
||||
|
@ -478,97 +479,25 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
#define GL_HALF_FLOAT_ARB 0x140B
|
||||
#endif
|
||||
|
||||
// GL_EXT_framebuffer_object
|
||||
#define QGL_EXT_framebuffer_object_PROCS \
|
||||
GLE(void, BindRenderbufferEXT, GLenum target, GLuint renderbuffer) \
|
||||
GLE(void, DeleteRenderbuffersEXT, GLsizei n, const GLuint *renderbuffers) \
|
||||
GLE(void, GenRenderbuffersEXT, GLsizei n, GLuint *renderbuffers) \
|
||||
GLE(void, RenderbufferStorageEXT, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) \
|
||||
GLE(void, BindFramebufferEXT, GLenum target, GLuint framebuffer) \
|
||||
GLE(void, DeleteFramebuffersEXT, GLsizei n, const GLuint *framebuffers) \
|
||||
GLE(void, GenFramebuffersEXT, GLsizei n, GLuint *framebuffers) \
|
||||
GLE(GLenum, CheckFramebufferStatusEXT, GLenum target) \
|
||||
GLE(void, FramebufferTexture2DEXT, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) \
|
||||
GLE(void, FramebufferRenderbufferEXT, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) \
|
||||
GLE(void, GenerateMipmapEXT, GLenum target) \
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
#endif
|
||||
|
||||
// GL_EXT_framebuffer_blit
|
||||
#define QGL_EXT_framebuffer_blit_PROCS \
|
||||
GLE(void, BlitFramebufferEXT, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) \
|
||||
|
||||
#ifndef GL_EXT_framebuffer_blit
|
||||
#define GL_EXT_framebuffer_blit
|
||||
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
|
||||
#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
|
||||
#endif
|
||||
|
||||
// GL_EXT_framebuffer_multisample
|
||||
#define QGL_EXT_framebuffer_multisample_PROCS \
|
||||
GLE(void, RenderbufferStorageMultisampleEXT, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) \
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample
|
||||
#define GL_EXT_framebuffer_multisample
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
||||
#define GL_MAX_SAMPLES_EXT 0x8D57
|
||||
#endif
|
||||
// OpenGL 3.0, was GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, and GL_ARB_vertex_array_object
|
||||
#define QGL_3_0_PROCS \
|
||||
GLE(const GLubyte *, GetStringi, GLenum name, GLuint index) \
|
||||
GLE(void, BindRenderbuffer, GLenum target, GLuint renderbuffer) \
|
||||
GLE(void, DeleteRenderbuffers, GLsizei n, const GLuint *renderbuffers) \
|
||||
GLE(void, GenRenderbuffers, GLsizei n, GLuint *renderbuffers) \
|
||||
GLE(void, RenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) \
|
||||
GLE(void, BindFramebuffer, GLenum target, GLuint framebuffer) \
|
||||
GLE(void, DeleteFramebuffers, GLsizei n, const GLuint *framebuffers) \
|
||||
GLE(void, GenFramebuffers, GLsizei n, GLuint *framebuffers) \
|
||||
GLE(GLenum, CheckFramebufferStatus, GLenum target) \
|
||||
GLE(void, FramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) \
|
||||
GLE(void, FramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) \
|
||||
GLE(void, GenerateMipmap, GLenum target) \
|
||||
GLE(void, BlitFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) \
|
||||
GLE(void, RenderbufferStorageMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) \
|
||||
GLE(void, BindVertexArray, GLuint array) \
|
||||
GLE(void, DeleteVertexArrays, GLsizei n, const GLuint *arrays) \
|
||||
GLE(void, GenVertexArrays, GLsizei n, GLuint *arrays) \
|
||||
|
||||
#ifndef GL_ARB_texture_compression_rgtc
|
||||
#define GL_ARB_texture_compression_rgtc
|
||||
|
@ -596,17 +525,6 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
|
||||
#endif
|
||||
|
||||
// GL_ARB_vertex_array_object
|
||||
#define QGL_ARB_vertex_array_object_PROCS \
|
||||
GLE(void, BindVertexArray, GLuint array) \
|
||||
GLE(void, DeleteVertexArrays, GLsizei n, const GLuint *arrays) \
|
||||
GLE(void, GenVertexArrays, GLsizei n, GLuint *arrays) \
|
||||
|
||||
#ifndef GL_ARB_vertex_array_object
|
||||
#define GL_ARB_vertex_array_object
|
||||
#define GL_VERTEX_ARRAY_BINDING_ARB 0x85B5
|
||||
#endif
|
||||
|
||||
// GL_EXT_direct_state_access
|
||||
#define QGL_EXT_direct_state_access_PROCS \
|
||||
GLE(GLvoid, BindMultiTextureEXT, GLenum texunit, GLenum target, GLuint texture) \
|
||||
|
@ -635,10 +553,7 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
QGL_1_3_PROCS;
|
||||
QGL_1_5_PROCS;
|
||||
QGL_2_0_PROCS;
|
||||
QGL_EXT_framebuffer_object_PROCS;
|
||||
QGL_EXT_framebuffer_blit_PROCS;
|
||||
QGL_EXT_framebuffer_multisample_PROCS;
|
||||
QGL_ARB_vertex_array_object_PROCS;
|
||||
QGL_3_0_PROCS;
|
||||
QGL_EXT_direct_state_access_PROCS;
|
||||
#undef GLE
|
||||
|
||||
|
|
|
@ -43,8 +43,7 @@ typedef enum
|
|||
IMGFLAG_NO_COMPRESSION = 0x0010,
|
||||
IMGFLAG_NOLIGHTSCALE = 0x0020,
|
||||
IMGFLAG_CLAMPTOEDGE = 0x0040,
|
||||
IMGFLAG_SRGB = 0x0080,
|
||||
IMGFLAG_GENNORMALMAP = 0x0100,
|
||||
IMGFLAG_GENNORMALMAP = 0x0080,
|
||||
} imgFlags_t;
|
||||
|
||||
typedef struct image_s {
|
||||
|
@ -117,7 +116,7 @@ extern cvar_t *r_saveFontData;
|
|||
|
||||
qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode );
|
||||
|
||||
float R_NoiseGet4f( float x, float y, float z, float t );
|
||||
float R_NoiseGet4f( float x, float y, float z, double t );
|
||||
void R_NoiseInit( void );
|
||||
|
||||
image_t *R_FindImageFile( const char *name, imgType_t type, imgFlags_t flags );
|
||||
|
@ -156,7 +155,7 @@ IMPLEMENTATION SPECIFIC FUNCTIONS
|
|||
====================================================================
|
||||
*/
|
||||
|
||||
void GLimp_Init( void );
|
||||
void GLimp_Init( qboolean );
|
||||
void GLimp_Shutdown( void );
|
||||
void GLimp_EndFrame( void );
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ void R_NoiseInit( void )
|
|||
}
|
||||
}
|
||||
|
||||
float R_NoiseGet4f( float x, float y, float z, float t )
|
||||
float R_NoiseGet4f( float x, float y, float z, double t )
|
||||
{
|
||||
int i;
|
||||
int ix, iy, iz, it;
|
||||
|
|
|
@ -509,7 +509,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
int i;
|
||||
drawSurf_t *drawSurf;
|
||||
int oldSort;
|
||||
float originalTime;
|
||||
double originalTime;
|
||||
|
||||
// save original time for entity shader offsets
|
||||
originalTime = backEnd.refdef.floatTime;
|
||||
|
@ -562,7 +562,10 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
|
||||
if ( entityNum != REFENTITYNUM_WORLD ) {
|
||||
backEnd.currentEntity = &backEnd.refdef.entities[entityNum];
|
||||
backEnd.refdef.floatTime = originalTime - backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// FIXME: e.shaderTime must be passed as int to avoid fp-precision loss issues
|
||||
backEnd.refdef.floatTime = originalTime - (double)backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// we have to reset the shaderTime as well otherwise image animations start
|
||||
// from the wrong frame
|
||||
tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset;
|
||||
|
@ -713,7 +716,7 @@ void RB_SetGL2D (void) {
|
|||
|
||||
// set time for 2D shaders
|
||||
backEnd.refdef.time = ri.Milliseconds();
|
||||
backEnd.refdef.floatTime = backEnd.refdef.time * 0.001f;
|
||||
backEnd.refdef.floatTime = backEnd.refdef.time * 0.001;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ static void InitOpenGL( void )
|
|||
{
|
||||
GLint temp;
|
||||
|
||||
GLimp_Init();
|
||||
GLimp_Init( qfalse );
|
||||
|
||||
strcpy( renderer_buffer, glConfig.renderer_string );
|
||||
Q_strlwr( renderer_buffer );
|
||||
|
@ -1259,16 +1259,15 @@ void RE_Shutdown( qboolean destroyWindow ) {
|
|||
|
||||
ri.Printf( PRINT_ALL, "RE_Shutdown( %i )\n", destroyWindow );
|
||||
|
||||
ri.Cmd_RemoveCommand ("modellist");
|
||||
ri.Cmd_RemoveCommand ("screenshotJPEG");
|
||||
ri.Cmd_RemoveCommand ("screenshot");
|
||||
ri.Cmd_RemoveCommand ("imagelist");
|
||||
ri.Cmd_RemoveCommand ("shaderlist");
|
||||
ri.Cmd_RemoveCommand ("skinlist");
|
||||
ri.Cmd_RemoveCommand ("gfxinfo");
|
||||
ri.Cmd_RemoveCommand("minimize");
|
||||
ri.Cmd_RemoveCommand( "imagelist" );
|
||||
ri.Cmd_RemoveCommand( "shaderlist" );
|
||||
ri.Cmd_RemoveCommand( "skinlist" );
|
||||
ri.Cmd_RemoveCommand( "modellist" );
|
||||
ri.Cmd_RemoveCommand( "modelist" );
|
||||
ri.Cmd_RemoveCommand( "shaderstate" );
|
||||
ri.Cmd_RemoveCommand( "screenshot" );
|
||||
ri.Cmd_RemoveCommand( "screenshotJPEG" );
|
||||
ri.Cmd_RemoveCommand( "gfxinfo" );
|
||||
ri.Cmd_RemoveCommand( "minimize" );
|
||||
|
||||
|
||||
if ( tr.registered ) {
|
||||
|
|
|
@ -362,8 +362,8 @@ typedef struct shader_s {
|
|||
|
||||
void (*optimalStageIteratorFunc)( void );
|
||||
|
||||
float clampTime; // time this shader is clamped to
|
||||
float timeOffset; // current time offset for this shader
|
||||
double clampTime; // time this shader is clamped to
|
||||
double timeOffset; // current time offset for this shader
|
||||
|
||||
struct shader_s *remappedShader; // current shader this one is remapped too
|
||||
|
||||
|
@ -388,7 +388,7 @@ typedef struct {
|
|||
byte areamask[MAX_MAP_AREA_BYTES];
|
||||
qboolean areamaskModified; // qtrue if areamask changed since last scene
|
||||
|
||||
float floatTime; // tr.refdef.time / 1000.0
|
||||
double floatTime; // tr.refdef.time / 1000.0
|
||||
|
||||
// text messages for deform text shaders
|
||||
char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH];
|
||||
|
@ -1217,7 +1217,7 @@ typedef struct shaderCommands_s
|
|||
color4ub_t constantColor255[SHADER_MAX_VERTEXES] QALIGN(16);
|
||||
|
||||
shader_t *shader;
|
||||
float shaderTime;
|
||||
double shaderTime;
|
||||
int fogNum;
|
||||
|
||||
int dlightBits; // or together of all vertexDlightBits
|
||||
|
|
|
@ -344,7 +344,7 @@ void RE_RenderScene( const refdef_t *fd ) {
|
|||
|
||||
// derived info
|
||||
|
||||
tr.refdef.floatTime = tr.refdef.time * 0.001f;
|
||||
tr.refdef.floatTime = tr.refdef.time * 0.001;
|
||||
|
||||
tr.refdef.numDrawSurfs = r_firstSceneDrawSurf;
|
||||
tr.refdef.drawSurfs = backEndData->drawSurfs;
|
||||
|
|
|
@ -218,7 +218,7 @@ R_BindAnimatedImage
|
|||
=================
|
||||
*/
|
||||
static void R_BindAnimatedImage( textureBundle_t *bundle ) {
|
||||
int index;
|
||||
int64_t index;
|
||||
|
||||
if ( bundle->isVideoMap ) {
|
||||
ri.CIN_RunCinematic(bundle->videoMapHandle);
|
||||
|
@ -233,7 +233,7 @@ static void R_BindAnimatedImage( textureBundle_t *bundle ) {
|
|||
|
||||
// it is necessary to do this messy calc to make sure animations line up
|
||||
// exactly with waveforms of the same frequency
|
||||
index = ri.ftol(tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE);
|
||||
index = tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE;
|
||||
index >>= FUNCTABLE_SIZE2;
|
||||
|
||||
if ( index < 0 ) {
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#endif
|
||||
|
||||
|
||||
#define WAVEVALUE( table, base, amplitude, phase, freq ) ((base) + table[ ri.ftol( ( ( (phase) + tess.shaderTime * (freq) ) * FUNCTABLE_SIZE ) ) & FUNCTABLE_MASK ] * (amplitude))
|
||||
#define WAVEVALUE( table, base, amplitude, phase, freq ) ((base) + table[ ( (int64_t) ( ( (phase) + tess.shaderTime * (freq) ) * FUNCTABLE_SIZE ) ) & FUNCTABLE_MASK ] * (amplitude))
|
||||
|
||||
static float *TableForFunc( genFunc_t func )
|
||||
{
|
||||
|
@ -206,12 +206,12 @@ void RB_CalcBulgeVertexes( deformStage_t *ds ) {
|
|||
const float *st = ( const float * ) tess.texCoords[0];
|
||||
float *xyz = ( float * ) tess.xyz;
|
||||
float *normal = ( float * ) tess.normal;
|
||||
float now;
|
||||
double now;
|
||||
|
||||
now = backEnd.refdef.time * ds->bulgeSpeed * 0.001f;
|
||||
now = backEnd.refdef.time * 0.001 * ds->bulgeSpeed;
|
||||
|
||||
for ( i = 0; i < tess.numVertexes; i++, xyz += 4, st += 4, normal += 4 ) {
|
||||
int off;
|
||||
int64_t off;
|
||||
float scale;
|
||||
|
||||
off = (float)( FUNCTABLE_SIZE / (M_PI*2) ) * ( st[0] * ds->bulgeWidth + now );
|
||||
|
@ -920,7 +920,7 @@ void RB_CalcEnvironmentTexCoords( float *st )
|
|||
void RB_CalcTurbulentTexCoords( const waveForm_t *wf, float *st )
|
||||
{
|
||||
int i;
|
||||
float now;
|
||||
double now;
|
||||
|
||||
now = ( wf->phase + tess.shaderTime * wf->frequency );
|
||||
|
||||
|
@ -929,8 +929,8 @@ void RB_CalcTurbulentTexCoords( const waveForm_t *wf, float *st )
|
|||
float s = st[0];
|
||||
float t = st[1];
|
||||
|
||||
st[0] = s + tr.sinTable[ ( ( int ) ( ( ( tess.xyz[i][0] + tess.xyz[i][2] )* 1.0/128 * 0.125 + now ) * FUNCTABLE_SIZE ) ) & ( FUNCTABLE_MASK ) ] * wf->amplitude;
|
||||
st[1] = t + tr.sinTable[ ( ( int ) ( ( tess.xyz[i][1] * 1.0/128 * 0.125 + now ) * FUNCTABLE_SIZE ) ) & ( FUNCTABLE_MASK ) ] * wf->amplitude;
|
||||
st[0] = s + tr.sinTable[ ( ( int64_t ) ( ( ( tess.xyz[i][0] + tess.xyz[i][2] )* 1.0/128 * 0.125 + now ) * FUNCTABLE_SIZE ) ) & ( FUNCTABLE_MASK ) ] * wf->amplitude;
|
||||
st[1] = t + tr.sinTable[ ( ( int64_t ) ( ( tess.xyz[i][1] * 1.0/128 * 0.125 + now ) * FUNCTABLE_SIZE ) ) & ( FUNCTABLE_MASK ) ] * wf->amplitude;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -954,8 +954,8 @@ void RB_CalcScaleTexCoords( const float scale[2], float *st )
|
|||
void RB_CalcScrollTexCoords( const float scrollSpeed[2], float *st )
|
||||
{
|
||||
int i;
|
||||
float timeScale = tess.shaderTime;
|
||||
float adjustedScrollS, adjustedScrollT;
|
||||
double timeScale = tess.shaderTime;
|
||||
double adjustedScrollS, adjustedScrollT;
|
||||
|
||||
adjustedScrollS = scrollSpeed[0] * timeScale;
|
||||
adjustedScrollT = scrollSpeed[1] * timeScale;
|
||||
|
@ -994,9 +994,9 @@ void RB_CalcTransformTexCoords( const texModInfo_t *tmi, float *st )
|
|||
*/
|
||||
void RB_CalcRotateTexCoords( float degsPerSecond, float *st )
|
||||
{
|
||||
float timeScale = tess.shaderTime;
|
||||
float degs;
|
||||
int index;
|
||||
double timeScale = tess.shaderTime;
|
||||
double degs;
|
||||
int64_t index;
|
||||
float sinValue, cosValue;
|
||||
texModInfo_t tmi;
|
||||
|
||||
|
|
|
@ -11,7 +11,15 @@ void main()
|
|||
vec2 tc;
|
||||
|
||||
#if 0
|
||||
float c[7] = float[7](1.0, 0.9659258263, 0.8660254038, 0.7071067812, 0.5, 0.2588190451, 0.0);
|
||||
float c[7];
|
||||
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.9659258263;
|
||||
c[2] = 0.8660254038;
|
||||
c[3] = 0.7071067812;
|
||||
c[4] = 0.5;
|
||||
c[5] = 0.2588190451;
|
||||
c[6] = 0.0;
|
||||
|
||||
tc = var_TexCoords + u_InvTexRes * vec2( c[0], c[6]); color = texture2D(u_TextureMap, tc);
|
||||
tc = var_TexCoords + u_InvTexRes * vec2( c[1], c[5]); color += texture2D(u_TextureMap, tc);
|
||||
|
@ -44,7 +52,13 @@ void main()
|
|||
gl_FragColor = color * 0.04166667 * u_Color;
|
||||
#endif
|
||||
|
||||
float c[5] = float[5](1.0, 0.9238795325, 0.7071067812, 0.3826834324, 0.0);
|
||||
float c[5];
|
||||
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.9238795325;
|
||||
c[2] = 0.7071067812;
|
||||
c[3] = 0.3826834324;
|
||||
c[4] = 0.0;
|
||||
|
||||
tc = var_TexCoords + u_InvTexRes * vec2( c[0], c[4]); color = texture2D(u_TextureMap, tc);
|
||||
tc = var_TexCoords + u_InvTexRes * vec2( c[1], c[3]); color += texture2D(u_TextureMap, tc);
|
||||
|
|
|
@ -6,7 +6,7 @@ varying vec2 var_ScreenTex;
|
|||
|
||||
//float gauss[8] = float[8](0.17, 0.17, 0.16, 0.14, 0.12, 0.1, 0.08, 0.06);
|
||||
//float gauss[5] = float[5](0.30, 0.23, 0.097, 0.024, 0.0033);
|
||||
float gauss[4] = float[4](0.40, 0.24, 0.054, 0.0044);
|
||||
//float gauss[4] = float[4](0.40, 0.24, 0.054, 0.0044);
|
||||
//float gauss[3] = float[3](0.60, 0.19, 0.0066);
|
||||
#define BLUR_SIZE 4
|
||||
|
||||
|
@ -22,6 +22,12 @@ float getLinearDepth(sampler2D depthMap, const vec2 tex, const float zFarDivZNea
|
|||
|
||||
vec4 depthGaussian1D(sampler2D imageMap, sampler2D depthMap, vec2 tex, float zFarDivZNear, float zFar, vec2 scale)
|
||||
{
|
||||
float gauss[4];
|
||||
|
||||
gauss[0] = 0.40;
|
||||
gauss[1] = 0.24;
|
||||
gauss[2] = 0.054;
|
||||
gauss[3] = 0.0044;
|
||||
|
||||
#if defined(USE_DEPTH)
|
||||
float depthCenter = getLinearDepth(depthMap, tex, zFarDivZNear);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
uniform sampler2D u_DiffuseMap;
|
||||
|
||||
uniform int u_AlphaTest;
|
||||
|
||||
varying vec2 var_Tex1;
|
||||
varying vec4 var_Color;
|
||||
|
||||
|
@ -8,5 +10,23 @@ void main()
|
|||
{
|
||||
vec4 color = texture2D(u_DiffuseMap, var_Tex1);
|
||||
|
||||
gl_FragColor = color * var_Color;
|
||||
float alpha = color.a * var_Color.a;
|
||||
if (u_AlphaTest == 1)
|
||||
{
|
||||
if (alpha == 0.0)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 2)
|
||||
{
|
||||
if (alpha >= 0.5)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 3)
|
||||
{
|
||||
if (alpha < 0.5)
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragColor.rgb = color.rgb * var_Color.rgb;
|
||||
gl_FragColor.a = alpha;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
uniform sampler2D u_DiffuseMap;
|
||||
|
||||
uniform int u_AlphaTest;
|
||||
|
||||
varying vec2 var_DiffuseTex;
|
||||
|
||||
varying vec4 var_Color;
|
||||
|
@ -8,5 +10,24 @@ varying vec4 var_Color;
|
|||
void main()
|
||||
{
|
||||
vec4 color = texture2D(u_DiffuseMap, var_DiffuseTex);
|
||||
gl_FragColor = color * var_Color;
|
||||
|
||||
float alpha = color.a * var_Color.a;
|
||||
if (u_AlphaTest == 1)
|
||||
{
|
||||
if (alpha == 0.0)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 2)
|
||||
{
|
||||
if (alpha >= 0.5)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 3)
|
||||
{
|
||||
if (alpha < 0.5)
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragColor.rgb = color.rgb * var_Color.rgb;
|
||||
gl_FragColor.a = alpha;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ uniform vec4 u_CubeMapInfo;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
uniform int u_AlphaTest;
|
||||
|
||||
varying vec4 var_TexCoords;
|
||||
|
||||
varying vec4 var_Color;
|
||||
|
@ -228,6 +230,23 @@ void main()
|
|||
#endif
|
||||
|
||||
vec4 diffuse = texture2D(u_DiffuseMap, texCoords);
|
||||
|
||||
float alpha = diffuse.a * var_Color.a;
|
||||
if (u_AlphaTest == 1)
|
||||
{
|
||||
if (alpha == 0.0)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 2)
|
||||
{
|
||||
if (alpha >= 0.5)
|
||||
discard;
|
||||
}
|
||||
else if (u_AlphaTest == 3)
|
||||
{
|
||||
if (alpha < 0.5)
|
||||
discard;
|
||||
}
|
||||
|
||||
#if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
|
||||
L = var_LightDir.xyz;
|
||||
|
@ -406,5 +425,5 @@ void main()
|
|||
|
||||
#endif
|
||||
|
||||
gl_FragColor.a = diffuse.a * var_Color.a;
|
||||
gl_FragColor.a = alpha;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,6 @@ uniform float u_LightRadius;
|
|||
varying vec3 var_Position;
|
||||
varying vec3 var_Normal;
|
||||
|
||||
float sampleDistMap(sampler2D texMap, vec2 uv, float scale)
|
||||
{
|
||||
vec3 distv = texture2D(texMap, uv).xyz;
|
||||
return dot(distv, vec3(1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) * scale;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 lightToPos = var_Position - u_LightOrigin.xyz;
|
||||
|
@ -57,42 +51,28 @@ void main()
|
|||
#endif
|
||||
|
||||
intensity *= fade;
|
||||
#if defined(USE_PCF)
|
||||
|
||||
float part;
|
||||
|
||||
dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0), u_LightRadius);
|
||||
part = max(sign(lightDist - dist), 0.0);
|
||||
#if defined(USE_PCF)
|
||||
part = float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0, -1.0/512.0)).r != 1.0);
|
||||
part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0)).r != 1.0);
|
||||
part += float(texture2D(u_ShadowMap, st + vec2(-1.0/512.0, 1.0/512.0)).r != 1.0);
|
||||
part += float(texture2D(u_ShadowMap, st + vec2( 1.0/512.0, 1.0/512.0)).r != 1.0);
|
||||
#else
|
||||
part = float(texture2D(u_ShadowMap, st).r != 1.0);
|
||||
#endif
|
||||
|
||||
dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0, -1.0/512.0), u_LightRadius);
|
||||
part += max(sign(lightDist - dist), 0.0);
|
||||
|
||||
dist = sampleDistMap(u_ShadowMap, st + vec2(-1.0/512.0, 1.0/512.0), u_LightRadius);
|
||||
part += max(sign(lightDist - dist), 0.0);
|
||||
|
||||
dist = sampleDistMap(u_ShadowMap, st + vec2( 1.0/512.0, 1.0/512.0), u_LightRadius);
|
||||
part += max(sign(lightDist - dist), 0.0);
|
||||
|
||||
#if defined(USE_DISCARD)
|
||||
if (part <= 0.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_PCF)
|
||||
intensity *= part * 0.25;
|
||||
#else
|
||||
dist = sampleDistMap(u_ShadowMap, st, u_LightRadius);
|
||||
|
||||
#if defined(USE_DISCARD)
|
||||
if (lightDist - dist <= 0.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
|
||||
intensity *= max(sign(lightDist - dist), 0.0);
|
||||
intensity *= part;
|
||||
#endif
|
||||
|
||||
|
||||
gl_FragColor.rgb = vec3(0);
|
||||
gl_FragColor.a = clamp(intensity, 0.0, 0.75);
|
||||
}
|
||||
|
|
|
@ -52,10 +52,10 @@ float PCF(const sampler2DShadow shadowmap, const vec2 st, const float dist)
|
|||
offset.y += offset.x;
|
||||
if (offset.y > 1.1) offset.y = 0.0;
|
||||
|
||||
mult = shadow2D(shadowmap, vec3(st + (offset + vec2(-1.5, 0.5)) * scale, dist)).r
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2( 0.5, 0.5)) * scale, dist)).r
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2(-1.5, -1.5)) * scale, dist)).r
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2( 0.5, -1.5)) * scale, dist)).r;
|
||||
mult = shadow2D(shadowmap, vec3(st + (offset + vec2(-1.5, 0.5)) * scale, dist))
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2( 0.5, 0.5)) * scale, dist))
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2(-1.5, -1.5)) * scale, dist))
|
||||
+ shadow2D(shadowmap, vec3(st + (offset + vec2( 0.5, -1.5)) * scale, dist));
|
||||
|
||||
mult *= 0.25;
|
||||
#endif
|
||||
|
@ -66,23 +66,23 @@ float PCF(const sampler2DShadow shadowmap, const vec2 st, const float dist)
|
|||
float cosr = cos(r) * scale;
|
||||
mat2 rmat = mat2(cosr, sinr, -sinr, cosr);
|
||||
|
||||
mult = shadow2D(shadowmap, vec3(st + rmat * vec2(-0.7055767, 0.196515), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.3524343, -0.7791386), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.2391056, 0.9189604), dist)).r;
|
||||
mult = shadow2D(shadowmap, vec3(st + rmat * vec2(-0.7055767, 0.196515), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.3524343, -0.7791386), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.2391056, 0.9189604), dist));
|
||||
#if defined(USE_SHADOW_FILTER2)
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.07580382, -0.09224417), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.5784913, -0.002528916), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.192888, 0.4064181), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.6335801, -0.5247476), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.5579782, 0.7491854), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.7320465, 0.6317794), dist)).r;
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.07580382, -0.09224417), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.5784913, -0.002528916), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.192888, 0.4064181), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.6335801, -0.5247476), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(-0.5579782, 0.7491854), dist));
|
||||
mult += shadow2D(shadowmap, vec3(st + rmat * vec2(0.7320465, 0.6317794), dist));
|
||||
|
||||
mult *= 0.11111;
|
||||
#else
|
||||
mult *= 0.33333;
|
||||
#endif
|
||||
#else
|
||||
mult = shadow2D(shadowmap, vec3(st, dist)).r;
|
||||
mult = shadow2D(shadowmap, vec3(st, dist));
|
||||
#endif
|
||||
|
||||
return mult;
|
||||
|
|
|
@ -4,6 +4,7 @@ uniform vec4 u_ViewInfo; // zfar / znear, zfar, 1/width, 1/height
|
|||
|
||||
varying vec2 var_ScreenTex;
|
||||
|
||||
#if 0
|
||||
vec2 poissonDisc[9] = vec2[9](
|
||||
vec2(-0.7055767, 0.196515), vec2(0.3524343, -0.7791386),
|
||||
vec2(0.2391056, 0.9189604), vec2(-0.07580382, -0.09224417),
|
||||
|
@ -11,6 +12,8 @@ vec2(0.5784913, -0.002528916), vec2(0.192888, 0.4064181),
|
|||
vec2(-0.6335801, -0.5247476), vec2(-0.5579782, 0.7491854),
|
||||
vec2(0.7320465, 0.6317794)
|
||||
);
|
||||
#endif
|
||||
|
||||
#define NUM_SAMPLES 3
|
||||
|
||||
// Input: It uses texture coords as the random number seed.
|
||||
|
@ -46,6 +49,18 @@ float getLinearDepth(sampler2D depthMap, const vec2 tex, const float zFarDivZNea
|
|||
|
||||
float ambientOcclusion(sampler2D depthMap, const vec2 tex, const float zFarDivZNear, const float zFar, const vec2 scale)
|
||||
{
|
||||
vec2 poissonDisc[9];
|
||||
|
||||
poissonDisc[0] = vec2(-0.7055767, 0.196515);
|
||||
poissonDisc[1] = vec2(0.3524343, -0.7791386);
|
||||
poissonDisc[2] = vec2(0.2391056, 0.9189604);
|
||||
poissonDisc[3] = vec2(-0.07580382, -0.09224417);
|
||||
poissonDisc[4] = vec2(0.5784913, -0.002528916);
|
||||
poissonDisc[5] = vec2(0.192888, 0.4064181);
|
||||
poissonDisc[6] = vec2(-0.6335801, -0.5247476);
|
||||
poissonDisc[7] = vec2(-0.5579782, 0.7491854);
|
||||
poissonDisc[8] = vec2(0.7320465, 0.6317794);
|
||||
|
||||
float result = 0;
|
||||
|
||||
float sampleZ = getLinearDepth(depthMap, tex, zFarDivZNear);
|
||||
|
|
|
@ -263,44 +263,6 @@ void GL_State( unsigned long stateBits )
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// alpha test
|
||||
//
|
||||
if ( diff & GLS_ATEST_BITS )
|
||||
{
|
||||
uint32_t oldState = glState.glStateBits & GLS_ATEST_BITS;
|
||||
uint32_t newState = stateBits & GLS_ATEST_BITS;
|
||||
uint32_t storedState = glState.storedGlState & GLS_ATEST_BITS;
|
||||
|
||||
if (oldState == 0)
|
||||
{
|
||||
qglEnable(GL_ALPHA_TEST);
|
||||
}
|
||||
else if (newState == 0)
|
||||
{
|
||||
qglDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
if (newState != 0 && storedState != newState)
|
||||
{
|
||||
glState.storedGlState &= ~GLS_ATEST_BITS;
|
||||
glState.storedGlState |= newState;
|
||||
|
||||
switch ( newState )
|
||||
{
|
||||
case GLS_ATEST_GT_0:
|
||||
qglAlphaFunc( GL_GREATER, 0.0f );
|
||||
break;
|
||||
case GLS_ATEST_LT_80:
|
||||
qglAlphaFunc( GL_LESS, 0.5f );
|
||||
break;
|
||||
case GLS_ATEST_GE_80:
|
||||
qglAlphaFunc( GL_GEQUAL, 0.5f );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glState.glStateBits = stateBits;
|
||||
}
|
||||
|
||||
|
@ -471,7 +433,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
int i;
|
||||
drawSurf_t *drawSurf;
|
||||
int oldSort;
|
||||
float originalTime;
|
||||
double originalTime;
|
||||
FBO_t* fbo = NULL;
|
||||
qboolean inQuery = qfalse;
|
||||
|
||||
|
@ -536,7 +498,10 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
|
||||
if ( entityNum != REFENTITYNUM_WORLD ) {
|
||||
backEnd.currentEntity = &backEnd.refdef.entities[entityNum];
|
||||
backEnd.refdef.floatTime = originalTime - backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// FIXME: e.shaderTime must be passed as int to avoid fp-precision loss issues
|
||||
backEnd.refdef.floatTime = originalTime - (double)backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// we have to reset the shaderTime as well otherwise image animations start
|
||||
// from the wrong frame
|
||||
tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset;
|
||||
|
@ -696,7 +661,7 @@ void RB_SetGL2D (void) {
|
|||
|
||||
// set time for 2D shaders
|
||||
backEnd.refdef.time = ri.Milliseconds();
|
||||
backEnd.refdef.floatTime = backEnd.refdef.time * 0.001f;
|
||||
backEnd.refdef.floatTime = backEnd.refdef.time * 0.001;
|
||||
}
|
||||
|
||||
|
||||
|
@ -916,6 +881,7 @@ RB_DrawSurfs
|
|||
*/
|
||||
const void *RB_DrawSurfs( const void *data ) {
|
||||
const drawSurfsCommand_t *cmd;
|
||||
qboolean isShadowView;
|
||||
|
||||
// finish any 2D drawing if needed
|
||||
if ( tess.numIndexes ) {
|
||||
|
@ -927,6 +893,8 @@ const void *RB_DrawSurfs( const void *data ) {
|
|||
backEnd.refdef = cmd->refdef;
|
||||
backEnd.viewParms = cmd->viewParms;
|
||||
|
||||
isShadowView = !!(backEnd.viewParms.flags & VPF_DEPTHSHADOW);
|
||||
|
||||
// clear the z buffer, set the modelview, etc
|
||||
RB_BeginDrawingView ();
|
||||
|
||||
|
@ -935,7 +903,7 @@ const void *RB_DrawSurfs( const void *data ) {
|
|||
qglEnable(GL_DEPTH_CLAMP);
|
||||
}
|
||||
|
||||
if (glRefConfig.framebufferObject && !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL) && (r_depthPrepass->integer || (backEnd.viewParms.flags & VPF_DEPTHSHADOW)))
|
||||
if (glRefConfig.framebufferObject && !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL) && (r_depthPrepass->integer || isShadowView))
|
||||
{
|
||||
FBO_t *oldFbo = glState.currentFBO;
|
||||
vec4_t viewInfo;
|
||||
|
@ -948,207 +916,210 @@ const void *RB_DrawSurfs( const void *data ) {
|
|||
qglColorMask(!backEnd.colorMask[0], !backEnd.colorMask[1], !backEnd.colorMask[2], !backEnd.colorMask[3]);
|
||||
backEnd.depthFill = qfalse;
|
||||
|
||||
if (tr.msaaResolveFbo)
|
||||
if (!isShadowView)
|
||||
{
|
||||
// If we're using multisampling, resolve the depth first
|
||||
FBO_FastBlit(tr.renderFbo, NULL, tr.msaaResolveFbo, NULL, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
else if (tr.renderFbo == NULL && tr.renderDepthImage)
|
||||
{
|
||||
// If we're rendering directly to the screen, copy the depth to a texture
|
||||
// This is incredibly slow on Intel Graphics, so just skip it on there
|
||||
if (!glRefConfig.intelGraphics)
|
||||
qglCopyTextureSubImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, 0, 0, 0, 0, glConfig.vidWidth, glConfig.vidHeight);
|
||||
}
|
||||
|
||||
if (tr.hdrDepthFbo)
|
||||
{
|
||||
// need the depth in a texture we can do GL_LINEAR sampling on, so copy it to an HDR image
|
||||
vec4_t srcTexCoords;
|
||||
|
||||
VectorSet4(srcTexCoords, 0.0f, 0.0f, 1.0f, 1.0f);
|
||||
|
||||
FBO_BlitFromTexture(tr.renderDepthImage, srcTexCoords, NULL, tr.hdrDepthFbo, NULL, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
if (r_sunlightMode->integer && backEnd.viewParms.flags & VPF_USESUNLIGHT)
|
||||
{
|
||||
vec4_t quadVerts[4];
|
||||
vec2_t texCoords[4];
|
||||
vec4_t box;
|
||||
|
||||
FBO_Bind(tr.screenShadowFbo);
|
||||
|
||||
box[0] = backEnd.viewParms.viewportX * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
|
||||
box[1] = backEnd.viewParms.viewportY * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
|
||||
box[2] = backEnd.viewParms.viewportWidth * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
|
||||
box[3] = backEnd.viewParms.viewportHeight * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
|
||||
|
||||
qglViewport(box[0], box[1], box[2], box[3]);
|
||||
qglScissor(box[0], box[1], box[2], box[3]);
|
||||
|
||||
box[0] = backEnd.viewParms.viewportX / (float)glConfig.vidWidth;
|
||||
box[1] = backEnd.viewParms.viewportY / (float)glConfig.vidHeight;
|
||||
box[2] = box[0] + backEnd.viewParms.viewportWidth / (float)glConfig.vidWidth;
|
||||
box[3] = box[1] + backEnd.viewParms.viewportHeight / (float)glConfig.vidHeight;
|
||||
|
||||
texCoords[0][0] = box[0]; texCoords[0][1] = box[3];
|
||||
texCoords[1][0] = box[2]; texCoords[1][1] = box[3];
|
||||
texCoords[2][0] = box[2]; texCoords[2][1] = box[1];
|
||||
texCoords[3][0] = box[0]; texCoords[3][1] = box[1];
|
||||
|
||||
box[0] = -1.0f;
|
||||
box[1] = -1.0f;
|
||||
box[2] = 1.0f;
|
||||
box[3] = 1.0f;
|
||||
|
||||
VectorSet4(quadVerts[0], box[0], box[3], 0, 1);
|
||||
VectorSet4(quadVerts[1], box[2], box[3], 0, 1);
|
||||
VectorSet4(quadVerts[2], box[2], box[1], 0, 1);
|
||||
VectorSet4(quadVerts[3], box[0], box[1], 0, 1);
|
||||
|
||||
GL_State( GLS_DEPTHTEST_DISABLE );
|
||||
|
||||
GLSL_BindProgram(&tr.shadowmaskShader);
|
||||
|
||||
GL_BindToTMU(tr.renderDepthImage, TB_COLORMAP);
|
||||
|
||||
if (r_shadowCascadeZFar->integer != 0)
|
||||
if (tr.msaaResolveFbo)
|
||||
{
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[0], TB_SHADOWMAP);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[1], TB_SHADOWMAP2);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[2], TB_SHADOWMAP3);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[3], TB_SHADOWMAP4);
|
||||
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP, backEnd.refdef.sunShadowMvp[0]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP2, backEnd.refdef.sunShadowMvp[1]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP3, backEnd.refdef.sunShadowMvp[2]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP4, backEnd.refdef.sunShadowMvp[3]);
|
||||
// If we're using multisampling, resolve the depth first
|
||||
FBO_FastBlit(tr.renderFbo, NULL, tr.msaaResolveFbo, NULL, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
else
|
||||
else if (tr.renderFbo == NULL && tr.renderDepthImage)
|
||||
{
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[3], TB_SHADOWMAP);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP, backEnd.refdef.sunShadowMvp[3]);
|
||||
}
|
||||
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWORIGIN, backEnd.refdef.vieworg);
|
||||
{
|
||||
vec3_t viewVector;
|
||||
|
||||
float zmax = backEnd.viewParms.zFar;
|
||||
float ymax = zmax * tan(backEnd.viewParms.fovY * M_PI / 360.0f);
|
||||
float xmax = zmax * tan(backEnd.viewParms.fovX * M_PI / 360.0f);
|
||||
|
||||
VectorScale(backEnd.refdef.viewaxis[0], zmax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWFORWARD, viewVector);
|
||||
VectorScale(backEnd.refdef.viewaxis[1], xmax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWLEFT, viewVector);
|
||||
VectorScale(backEnd.refdef.viewaxis[2], ymax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWUP, viewVector);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.shadowmaskShader, UNIFORM_VIEWINFO, viewInfo);
|
||||
// If we're rendering directly to the screen, copy the depth to a texture
|
||||
// This is incredibly slow on Intel Graphics, so just skip it on there
|
||||
if (!glRefConfig.intelGraphics)
|
||||
qglCopyTextureSubImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, 0, 0, 0, 0, glConfig.vidWidth, glConfig.vidHeight);
|
||||
}
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
if (r_shadowBlur->integer)
|
||||
if (tr.hdrDepthFbo)
|
||||
{
|
||||
viewInfo[2] = 1.0f / (float)(tr.screenScratchFbo->width);
|
||||
viewInfo[3] = 1.0f / (float)(tr.screenScratchFbo->height);
|
||||
// need the depth in a texture we can do GL_LINEAR sampling on, so copy it to an HDR image
|
||||
vec4_t srcTexCoords;
|
||||
|
||||
FBO_Bind(tr.screenScratchFbo);
|
||||
VectorSet4(srcTexCoords, 0.0f, 0.0f, 1.0f, 1.0f);
|
||||
|
||||
FBO_BlitFromTexture(tr.renderDepthImage, srcTexCoords, NULL, tr.hdrDepthFbo, NULL, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
if (r_sunlightMode->integer && backEnd.viewParms.flags & VPF_USESUNLIGHT)
|
||||
{
|
||||
vec4_t quadVerts[4];
|
||||
vec2_t texCoords[4];
|
||||
vec4_t box;
|
||||
|
||||
FBO_Bind(tr.screenShadowFbo);
|
||||
|
||||
box[0] = backEnd.viewParms.viewportX * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
|
||||
box[1] = backEnd.viewParms.viewportY * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
|
||||
box[2] = backEnd.viewParms.viewportWidth * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
|
||||
box[3] = backEnd.viewParms.viewportHeight * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
|
||||
|
||||
qglViewport(box[0], box[1], box[2], box[3]);
|
||||
qglScissor(box[0], box[1], box[2], box[3]);
|
||||
|
||||
box[0] = backEnd.viewParms.viewportX / (float)glConfig.vidWidth;
|
||||
box[1] = backEnd.viewParms.viewportY / (float)glConfig.vidHeight;
|
||||
box[2] = box[0] + backEnd.viewParms.viewportWidth / (float)glConfig.vidWidth;
|
||||
box[3] = box[1] + backEnd.viewParms.viewportHeight / (float)glConfig.vidHeight;
|
||||
|
||||
texCoords[0][0] = box[0]; texCoords[0][1] = box[3];
|
||||
texCoords[1][0] = box[2]; texCoords[1][1] = box[3];
|
||||
texCoords[2][0] = box[2]; texCoords[2][1] = box[1];
|
||||
texCoords[3][0] = box[0]; texCoords[3][1] = box[1];
|
||||
|
||||
box[0] = -1.0f;
|
||||
box[1] = -1.0f;
|
||||
box[2] = 1.0f;
|
||||
box[3] = 1.0f;
|
||||
|
||||
VectorSet4(quadVerts[0], box[0], box[3], 0, 1);
|
||||
VectorSet4(quadVerts[1], box[2], box[3], 0, 1);
|
||||
VectorSet4(quadVerts[2], box[2], box[1], 0, 1);
|
||||
VectorSet4(quadVerts[3], box[0], box[1], 0, 1);
|
||||
|
||||
GL_State(GLS_DEPTHTEST_DISABLE);
|
||||
|
||||
GLSL_BindProgram(&tr.shadowmaskShader);
|
||||
|
||||
GL_BindToTMU(tr.renderDepthImage, TB_COLORMAP);
|
||||
|
||||
if (r_shadowCascadeZFar->integer != 0)
|
||||
{
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[0], TB_SHADOWMAP);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[1], TB_SHADOWMAP2);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[2], TB_SHADOWMAP3);
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[3], TB_SHADOWMAP4);
|
||||
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP, backEnd.refdef.sunShadowMvp[0]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP2, backEnd.refdef.sunShadowMvp[1]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP3, backEnd.refdef.sunShadowMvp[2]);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP4, backEnd.refdef.sunShadowMvp[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_BindToTMU(tr.sunShadowDepthImage[3], TB_SHADOWMAP);
|
||||
GLSL_SetUniformMat4(&tr.shadowmaskShader, UNIFORM_SHADOWMVP, backEnd.refdef.sunShadowMvp[3]);
|
||||
}
|
||||
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWORIGIN, backEnd.refdef.vieworg);
|
||||
{
|
||||
vec3_t viewVector;
|
||||
|
||||
float zmax = backEnd.viewParms.zFar;
|
||||
float ymax = zmax * tan(backEnd.viewParms.fovY * M_PI / 360.0f);
|
||||
float xmax = zmax * tan(backEnd.viewParms.fovX * M_PI / 360.0f);
|
||||
|
||||
VectorScale(backEnd.refdef.viewaxis[0], zmax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWFORWARD, viewVector);
|
||||
VectorScale(backEnd.refdef.viewaxis[1], xmax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWLEFT, viewVector);
|
||||
VectorScale(backEnd.refdef.viewaxis[2], ymax, viewVector);
|
||||
GLSL_SetUniformVec3(&tr.shadowmaskShader, UNIFORM_VIEWUP, viewVector);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.shadowmaskShader, UNIFORM_VIEWINFO, viewInfo);
|
||||
}
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
if (r_shadowBlur->integer)
|
||||
{
|
||||
viewInfo[2] = 1.0f / (float)(tr.screenScratchFbo->width);
|
||||
viewInfo[3] = 1.0f / (float)(tr.screenScratchFbo->height);
|
||||
|
||||
FBO_Bind(tr.screenScratchFbo);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[0]);
|
||||
|
||||
GL_BindToTMU(tr.screenShadowImage, TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[0], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords);
|
||||
|
||||
FBO_Bind(tr.screenShadowFbo);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[1]);
|
||||
|
||||
GL_BindToTMU(tr.screenScratchImage, TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[1], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords);
|
||||
}
|
||||
}
|
||||
|
||||
if (r_ssao->integer)
|
||||
{
|
||||
vec4_t quadVerts[4];
|
||||
vec2_t texCoords[4];
|
||||
|
||||
viewInfo[2] = 1.0f / ((float)(tr.quarterImage[0]->width) * tan(backEnd.viewParms.fovX * M_PI / 360.0f) * 2.0f);
|
||||
viewInfo[3] = 1.0f / ((float)(tr.quarterImage[0]->height) * tan(backEnd.viewParms.fovY * M_PI / 360.0f) * 2.0f);
|
||||
viewInfo[3] *= (float)backEnd.viewParms.viewportHeight / (float)backEnd.viewParms.viewportWidth;
|
||||
|
||||
FBO_Bind(tr.quarterFbo[0]);
|
||||
|
||||
qglViewport(0, 0, tr.quarterFbo[0]->width, tr.quarterFbo[0]->height);
|
||||
qglScissor(0, 0, tr.quarterFbo[0]->width, tr.quarterFbo[0]->height);
|
||||
|
||||
VectorSet4(quadVerts[0], -1, 1, 0, 1);
|
||||
VectorSet4(quadVerts[1], 1, 1, 0, 1);
|
||||
VectorSet4(quadVerts[2], 1, -1, 0, 1);
|
||||
VectorSet4(quadVerts[3], -1, -1, 0, 1);
|
||||
|
||||
texCoords[0][0] = 0; texCoords[0][1] = 1;
|
||||
texCoords[1][0] = 1; texCoords[1][1] = 1;
|
||||
texCoords[2][0] = 1; texCoords[2][1] = 0;
|
||||
texCoords[3][0] = 0; texCoords[3][1] = 0;
|
||||
|
||||
GL_State( GLS_DEPTHTEST_DISABLE );
|
||||
|
||||
GLSL_BindProgram(&tr.ssaoShader);
|
||||
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_COLORMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.ssaoShader, UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
|
||||
viewInfo[2] = 1.0f / (float)(tr.quarterImage[0]->width);
|
||||
viewInfo[3] = 1.0f / (float)(tr.quarterImage[0]->height);
|
||||
|
||||
FBO_Bind(tr.quarterFbo[1]);
|
||||
|
||||
qglViewport(0, 0, tr.quarterFbo[1]->width, tr.quarterFbo[1]->height);
|
||||
qglScissor(0, 0, tr.quarterFbo[1]->width, tr.quarterFbo[1]->height);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[0]);
|
||||
|
||||
GL_BindToTMU(tr.screenShadowImage, TB_COLORMAP);
|
||||
GL_BindToTMU(tr.quarterImage[0], TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[0], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords);
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
FBO_Bind(tr.screenShadowFbo);
|
||||
|
||||
FBO_Bind(tr.screenSsaoFbo);
|
||||
|
||||
qglViewport(0, 0, tr.screenSsaoFbo->width, tr.screenSsaoFbo->height);
|
||||
qglScissor(0, 0, tr.screenSsaoFbo->width, tr.screenSsaoFbo->height);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[1]);
|
||||
|
||||
GL_BindToTMU(tr.screenScratchImage, TB_COLORMAP);
|
||||
GL_BindToTMU(tr.quarterImage[1], TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[1], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
}
|
||||
}
|
||||
|
||||
if (r_ssao->integer)
|
||||
{
|
||||
vec4_t quadVerts[4];
|
||||
vec2_t texCoords[4];
|
||||
|
||||
viewInfo[2] = 1.0f / ((float)(tr.quarterImage[0]->width) * tan(backEnd.viewParms.fovX * M_PI / 360.0f) * 2.0f);
|
||||
viewInfo[3] = 1.0f / ((float)(tr.quarterImage[0]->height) * tan(backEnd.viewParms.fovY * M_PI / 360.0f) * 2.0f);
|
||||
viewInfo[3] *= (float)backEnd.viewParms.viewportHeight / (float)backEnd.viewParms.viewportWidth;
|
||||
|
||||
FBO_Bind(tr.quarterFbo[0]);
|
||||
|
||||
qglViewport(0, 0, tr.quarterFbo[0]->width, tr.quarterFbo[0]->height);
|
||||
qglScissor(0, 0, tr.quarterFbo[0]->width, tr.quarterFbo[0]->height);
|
||||
|
||||
VectorSet4(quadVerts[0], -1, 1, 0, 1);
|
||||
VectorSet4(quadVerts[1], 1, 1, 0, 1);
|
||||
VectorSet4(quadVerts[2], 1, -1, 0, 1);
|
||||
VectorSet4(quadVerts[3], -1, -1, 0, 1);
|
||||
|
||||
texCoords[0][0] = 0; texCoords[0][1] = 1;
|
||||
texCoords[1][0] = 1; texCoords[1][1] = 1;
|
||||
texCoords[2][0] = 1; texCoords[2][1] = 0;
|
||||
texCoords[3][0] = 0; texCoords[3][1] = 0;
|
||||
|
||||
GL_State( GLS_DEPTHTEST_DISABLE );
|
||||
|
||||
GLSL_BindProgram(&tr.ssaoShader);
|
||||
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_COLORMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.ssaoShader, UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
|
||||
viewInfo[2] = 1.0f / (float)(tr.quarterImage[0]->width);
|
||||
viewInfo[3] = 1.0f / (float)(tr.quarterImage[0]->height);
|
||||
|
||||
FBO_Bind(tr.quarterFbo[1]);
|
||||
|
||||
qglViewport(0, 0, tr.quarterFbo[1]->width, tr.quarterFbo[1]->height);
|
||||
qglScissor(0, 0, tr.quarterFbo[1]->width, tr.quarterFbo[1]->height);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[0]);
|
||||
|
||||
GL_BindToTMU(tr.quarterImage[0], TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[0], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
|
||||
|
||||
FBO_Bind(tr.screenSsaoFbo);
|
||||
|
||||
qglViewport(0, 0, tr.screenSsaoFbo->width, tr.screenSsaoFbo->height);
|
||||
qglScissor(0, 0, tr.screenSsaoFbo->width, tr.screenSsaoFbo->height);
|
||||
|
||||
GLSL_BindProgram(&tr.depthBlurShader[1]);
|
||||
|
||||
GL_BindToTMU(tr.quarterImage[1], TB_COLORMAP);
|
||||
GL_BindToTMU(tr.hdrDepthImage, TB_LIGHTMAP);
|
||||
|
||||
GLSL_SetUniformVec4(&tr.depthBlurShader[1], UNIFORM_VIEWINFO, viewInfo);
|
||||
|
||||
|
||||
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
|
||||
}
|
||||
|
||||
// reset viewport and scissor
|
||||
FBO_Bind(oldFbo);
|
||||
SetViewportAndScissor();
|
||||
|
@ -1159,7 +1130,7 @@ const void *RB_DrawSurfs( const void *data ) {
|
|||
qglDisable(GL_DEPTH_CLAMP);
|
||||
}
|
||||
|
||||
if (!(backEnd.viewParms.flags & VPF_DEPTHSHADOW))
|
||||
if (!isShadowView)
|
||||
{
|
||||
RB_RenderDrawSurfList( cmd->drawSurfs, cmd->numDrawSurfs );
|
||||
|
||||
|
@ -1636,16 +1607,29 @@ const void *RB_PostProcess(const void *data)
|
|||
if (0 && r_sunlightMode->integer)
|
||||
{
|
||||
ivec4_t dstBox;
|
||||
VectorSet4(dstBox, 0, 0, 128, 128);
|
||||
VectorSet4(dstBox, 0, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.sunShadowDepthImage[0], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 128, 0, 128, 128);
|
||||
VectorSet4(dstBox, 128, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.sunShadowDepthImage[1], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 256, 0, 128, 128);
|
||||
VectorSet4(dstBox, 256, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.sunShadowDepthImage[2], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 384, 0, 128, 128);
|
||||
VectorSet4(dstBox, 384, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.sunShadowDepthImage[3], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
if (0 && r_shadows->integer == 4)
|
||||
{
|
||||
ivec4_t dstBox;
|
||||
VectorSet4(dstBox, 512 + 0, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.pshadowMaps[0], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 512 + 128, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.pshadowMaps[1], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 512 + 256, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.pshadowMaps[2], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
VectorSet4(dstBox, 512 + 384, glConfig.vidHeight - 128, 128, 128);
|
||||
FBO_BlitFromTexture(tr.pshadowMaps[3], NULL, NULL, NULL, dstBox, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
if (0)
|
||||
{
|
||||
ivec4_t dstBox;
|
||||
|
|
|
@ -43,7 +43,7 @@ void GL_BindNullTextures()
|
|||
{
|
||||
for (i = 0; i < NUM_TEXTURE_BUNDLES; i++)
|
||||
{
|
||||
qglBindMultiTextureEXT(GL_TEXTURE0_ARB + i, GL_TEXTURE_2D, 0);
|
||||
qglBindMultiTextureEXT(GL_TEXTURE0 + i, GL_TEXTURE_2D, 0);
|
||||
glDsaState.textures[i] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -51,19 +51,19 @@ void GL_BindNullTextures()
|
|||
{
|
||||
for (i = 0; i < NUM_TEXTURE_BUNDLES; i++)
|
||||
{
|
||||
qglActiveTextureARB(GL_TEXTURE0_ARB + i);
|
||||
qglActiveTexture(GL_TEXTURE0 + i);
|
||||
qglBindTexture(GL_TEXTURE_2D, 0);
|
||||
glDsaState.textures[i] = 0;
|
||||
}
|
||||
|
||||
qglActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glDsaState.texunit = GL_TEXTURE0_ARB;
|
||||
qglActiveTexture(GL_TEXTURE0);
|
||||
glDsaState.texunit = GL_TEXTURE0;
|
||||
}
|
||||
}
|
||||
|
||||
int GL_BindMultiTexture(GLenum texunit, GLenum target, GLuint texture)
|
||||
{
|
||||
GLuint tmu = texunit - GL_TEXTURE0_ARB;
|
||||
GLuint tmu = texunit - GL_TEXTURE0;
|
||||
|
||||
if (glDsaState.textures[tmu] == texture)
|
||||
return 0;
|
||||
|
@ -80,7 +80,7 @@ GLvoid APIENTRY GLDSA_BindMultiTextureEXT(GLenum texunit, GLenum target, GLuint
|
|||
{
|
||||
if (glDsaState.texunit != texunit)
|
||||
{
|
||||
qglActiveTextureARB(texunit);
|
||||
qglActiveTexture(texunit);
|
||||
glDsaState.texunit = texunit;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ GLvoid APIENTRY GLDSA_CompressedTextureSubImage2DEXT(GLuint texture, GLenum targ
|
|||
GLvoid APIENTRY GLDSA_GenerateTextureMipmapEXT(GLuint texture, GLenum target)
|
||||
{
|
||||
GL_BindMultiTexture(glDsaState.texunit, target, texture);
|
||||
qglGenerateMipmapEXT(target);
|
||||
qglGenerateMipmap(target);
|
||||
}
|
||||
|
||||
void GL_BindNullProgram()
|
||||
|
@ -207,9 +207,9 @@ GLvoid APIENTRY GLDSA_ProgramUniformMatrix4fvEXT(GLuint program, GLint location,
|
|||
|
||||
void GL_BindNullFramebuffers()
|
||||
{
|
||||
qglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
qglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glDsaState.drawFramebuffer = glDsaState.readFramebuffer = 0;
|
||||
qglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
|
||||
qglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
glDsaState.renderbuffer = 0;
|
||||
}
|
||||
|
||||
|
@ -217,26 +217,26 @@ void GL_BindFramebuffer(GLenum target, GLuint framebuffer)
|
|||
{
|
||||
switch (target)
|
||||
{
|
||||
case GL_FRAMEBUFFER_EXT:
|
||||
case GL_FRAMEBUFFER:
|
||||
if (framebuffer != glDsaState.drawFramebuffer || framebuffer != glDsaState.readFramebuffer)
|
||||
{
|
||||
qglBindFramebufferEXT(target, framebuffer);
|
||||
qglBindFramebuffer(target, framebuffer);
|
||||
glDsaState.drawFramebuffer = glDsaState.readFramebuffer = framebuffer;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_DRAW_FRAMEBUFFER_EXT:
|
||||
case GL_DRAW_FRAMEBUFFER:
|
||||
if (framebuffer != glDsaState.drawFramebuffer)
|
||||
{
|
||||
qglBindFramebufferEXT(target, framebuffer);
|
||||
qglBindFramebuffer(target, framebuffer);
|
||||
glDsaState.drawFramebuffer = framebuffer;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_READ_FRAMEBUFFER_EXT:
|
||||
case GL_READ_FRAMEBUFFER:
|
||||
if (framebuffer != glDsaState.readFramebuffer)
|
||||
{
|
||||
qglBindFramebufferEXT(target, framebuffer);
|
||||
qglBindFramebuffer(target, framebuffer);
|
||||
glDsaState.readFramebuffer = framebuffer;
|
||||
}
|
||||
break;
|
||||
|
@ -247,7 +247,7 @@ void GL_BindRenderbuffer(GLuint renderbuffer)
|
|||
{
|
||||
if (renderbuffer != glDsaState.renderbuffer)
|
||||
{
|
||||
qglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffer);
|
||||
qglBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
|
||||
glDsaState.renderbuffer = renderbuffer;
|
||||
}
|
||||
}
|
||||
|
@ -256,32 +256,32 @@ GLvoid APIENTRY GLDSA_NamedRenderbufferStorageEXT(GLuint renderbuffer,
|
|||
GLenum internalformat, GLsizei width, GLsizei height)
|
||||
{
|
||||
GL_BindRenderbuffer(renderbuffer);
|
||||
qglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalformat, width, height);
|
||||
qglRenderbufferStorage(GL_RENDERBUFFER, internalformat, width, height);
|
||||
}
|
||||
|
||||
GLvoid APIENTRY GLDSA_NamedRenderbufferStorageMultisampleEXT(GLuint renderbuffer,
|
||||
GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
|
||||
{
|
||||
GL_BindRenderbuffer(renderbuffer);
|
||||
qglRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, internalformat, width, height);
|
||||
qglRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, internalformat, width, height);
|
||||
}
|
||||
|
||||
GLenum APIENTRY GLDSA_CheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target)
|
||||
{
|
||||
GL_BindFramebuffer(target, framebuffer);
|
||||
return qglCheckFramebufferStatusEXT(target);
|
||||
return qglCheckFramebufferStatus(target);
|
||||
}
|
||||
|
||||
GLvoid APIENTRY GLDSA_NamedFramebufferTexture2DEXT(GLuint framebuffer,
|
||||
GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
||||
{
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment, textarget, texture, level);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, framebuffer);
|
||||
qglFramebufferTexture2D(GL_FRAMEBUFFER, attachment, textarget, texture, level);
|
||||
}
|
||||
|
||||
GLvoid APIENTRY GLDSA_NamedFramebufferRenderbufferEXT(GLuint framebuffer,
|
||||
GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
|
||||
{
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
qglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attachment, renderbuffertarget, renderbuffer);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, framebuffer);
|
||||
qglFramebufferRenderbuffer(GL_FRAMEBUFFER, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
|
|
|
@ -34,10 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
QGL_1_3_PROCS;
|
||||
QGL_1_5_PROCS;
|
||||
QGL_2_0_PROCS;
|
||||
QGL_EXT_framebuffer_object_PROCS;
|
||||
QGL_EXT_framebuffer_blit_PROCS;
|
||||
QGL_EXT_framebuffer_multisample_PROCS;
|
||||
QGL_ARB_vertex_array_object_PROCS;
|
||||
QGL_3_0_PROCS;
|
||||
QGL_EXT_direct_state_access_PROCS;
|
||||
#undef GLE
|
||||
|
||||
|
@ -75,6 +72,33 @@ void GLimp_InitExtraExtensions()
|
|||
// OpenGL 2.0, was GL_ARB_shading_language_100, GL_ARB_vertex_program, GL_ARB_shader_objects, and GL_ARB_vertex_shader
|
||||
QGL_2_0_PROCS;
|
||||
|
||||
// OpenGL 3.0, was GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, and GL_ARB_vertex_array_object
|
||||
// QGL_*_PROCS becomes several functions, do not remove {}
|
||||
if (glRefConfig.openglMajorVersion >= 3)
|
||||
{
|
||||
QGL_3_0_PROCS;
|
||||
|
||||
glRefConfig.framebufferObject = !!r_ext_framebuffer_object->integer;
|
||||
glRefConfig.framebufferBlit = qtrue;
|
||||
glRefConfig.framebufferMultisample = qtrue;
|
||||
|
||||
qglGetIntegerv(GL_MAX_RENDERBUFFER_SIZE_EXT, &glRefConfig.maxRenderbufferSize);
|
||||
qglGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &glRefConfig.maxColorAttachments);
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferObject], "OpenGL 3.0+ framebuffer procs");
|
||||
|
||||
// Don't let this be disabled, core context requires it
|
||||
glRefConfig.vertexArrayObject = qtrue;
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.vertexArrayObject], "OpenGL 3.0+ vertex array object procs");
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], "OpenGL 3.0+ framebuffer procs");
|
||||
ri.Printf(PRINT_ALL, result[2], "OpenGL 3.0+ vertex array object procs");
|
||||
|
||||
}
|
||||
|
||||
// Determine GLSL version
|
||||
if (1)
|
||||
{
|
||||
|
@ -136,57 +160,6 @@ void GLimp_InitExtraExtensions()
|
|||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_EXT_framebuffer_object
|
||||
extension = "GL_EXT_framebuffer_object";
|
||||
glRefConfig.framebufferObject = qfalse;
|
||||
if( SDL_GL_ExtensionSupported( extension ) )
|
||||
{
|
||||
glRefConfig.framebufferObject = !!r_ext_framebuffer_object->integer;
|
||||
|
||||
qglGetIntegerv(GL_MAX_RENDERBUFFER_SIZE_EXT, &glRefConfig.maxRenderbufferSize);
|
||||
qglGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &glRefConfig.maxColorAttachments);
|
||||
|
||||
QGL_EXT_framebuffer_object_PROCS;
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferObject], extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_EXT_framebuffer_blit
|
||||
extension = "GL_EXT_framebuffer_blit";
|
||||
glRefConfig.framebufferBlit = qfalse;
|
||||
if (SDL_GL_ExtensionSupported(extension))
|
||||
{
|
||||
glRefConfig.framebufferBlit = qtrue;
|
||||
|
||||
QGL_EXT_framebuffer_blit_PROCS;
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferBlit], extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_EXT_framebuffer_multisample
|
||||
extension = "GL_EXT_framebuffer_multisample";
|
||||
glRefConfig.framebufferMultisample = qfalse;
|
||||
if (SDL_GL_ExtensionSupported(extension))
|
||||
{
|
||||
glRefConfig.framebufferMultisample = qtrue;
|
||||
|
||||
QGL_EXT_framebuffer_multisample_PROCS;
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.framebufferMultisample], extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
glRefConfig.textureCompression = TCR_NONE;
|
||||
|
||||
// GL_ARB_texture_compression_rgtc
|
||||
|
@ -251,22 +224,6 @@ void GLimp_InitExtraExtensions()
|
|||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_ARB_vertex_array_object
|
||||
extension = "GL_ARB_vertex_array_object";
|
||||
glRefConfig.vertexArrayObject = qfalse;
|
||||
if( SDL_GL_ExtensionSupported( extension ) )
|
||||
{
|
||||
glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
|
||||
|
||||
QGL_ARB_vertex_array_object_PROCS;
|
||||
|
||||
ri.Printf(PRINT_ALL, result[glRefConfig.vertexArrayObject], extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_EXT_direct_state_access
|
||||
extension = "GL_EXT_direct_state_access";
|
||||
glRefConfig.directStateAccess = qfalse;
|
||||
|
|
|
@ -32,48 +32,38 @@ R_CheckFBO
|
|||
*/
|
||||
qboolean R_CheckFBO(const FBO_t * fbo)
|
||||
{
|
||||
GLenum code = qglCheckNamedFramebufferStatusEXT(fbo->frameBuffer, GL_FRAMEBUFFER_EXT);
|
||||
GLenum code = qglCheckNamedFramebufferStatusEXT(fbo->frameBuffer, GL_FRAMEBUFFER);
|
||||
|
||||
if(code == GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
if(code == GL_FRAMEBUFFER_COMPLETE)
|
||||
return qtrue;
|
||||
|
||||
// an error occured
|
||||
switch (code)
|
||||
{
|
||||
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
||||
case GL_FRAMEBUFFER_UNSUPPORTED:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Unsupported framebuffer format\n", fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete attachment\n", fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, missing attachment\n", fbo->name);
|
||||
break;
|
||||
|
||||
//case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
|
||||
// ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, duplicate attachment\n", fbo->name);
|
||||
// break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, attached images must have same dimensions\n",
|
||||
fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, attached images must have same format\n",
|
||||
fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, missing draw buffer\n", fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete, missing read buffer\n", fbo->name);
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Framebuffer incomplete multisample\n", fbo->name);
|
||||
break;
|
||||
|
||||
default:
|
||||
ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) unknown error 0x%X\n", fbo->name, code);
|
||||
break;
|
||||
|
@ -117,7 +107,7 @@ FBO_t *FBO_Create(const char *name, int width, int height)
|
|||
fbo->width = width;
|
||||
fbo->height = height;
|
||||
|
||||
qglGenFramebuffersEXT(1, &fbo->frameBuffer);
|
||||
qglGenFramebuffers(1, &fbo->frameBuffer);
|
||||
|
||||
return fbo;
|
||||
}
|
||||
|
@ -145,7 +135,7 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
|
|||
case GL_RGBA32F_ARB:
|
||||
fbo->colorFormat = format;
|
||||
pRenderBuffer = &fbo->colorBuffers[index];
|
||||
attachment = GL_COLOR_ATTACHMENT0_EXT + index;
|
||||
attachment = GL_COLOR_ATTACHMENT0 + index;
|
||||
break;
|
||||
|
||||
case GL_DEPTH_COMPONENT:
|
||||
|
@ -154,21 +144,21 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
|
|||
case GL_DEPTH_COMPONENT32_ARB:
|
||||
fbo->depthFormat = format;
|
||||
pRenderBuffer = &fbo->depthBuffer;
|
||||
attachment = GL_DEPTH_ATTACHMENT_EXT;
|
||||
attachment = GL_DEPTH_ATTACHMENT;
|
||||
break;
|
||||
|
||||
case GL_STENCIL_INDEX:
|
||||
case GL_STENCIL_INDEX1_EXT:
|
||||
case GL_STENCIL_INDEX4_EXT:
|
||||
case GL_STENCIL_INDEX8_EXT:
|
||||
case GL_STENCIL_INDEX16_EXT:
|
||||
case GL_STENCIL_INDEX1:
|
||||
case GL_STENCIL_INDEX4:
|
||||
case GL_STENCIL_INDEX8:
|
||||
case GL_STENCIL_INDEX16:
|
||||
fbo->stencilFormat = format;
|
||||
pRenderBuffer = &fbo->stencilBuffer;
|
||||
attachment = GL_STENCIL_ATTACHMENT_EXT;
|
||||
attachment = GL_STENCIL_ATTACHMENT;
|
||||
break;
|
||||
|
||||
case GL_DEPTH_STENCIL_EXT:
|
||||
case GL_DEPTH24_STENCIL8_EXT:
|
||||
case GL_DEPTH_STENCIL:
|
||||
case GL_DEPTH24_STENCIL8:
|
||||
fbo->packedDepthStencilFormat = format;
|
||||
pRenderBuffer = &fbo->packedDepthStencilBuffer;
|
||||
attachment = 0; // special for stencil and depth
|
||||
|
@ -181,7 +171,7 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
|
|||
|
||||
absent = *pRenderBuffer == 0;
|
||||
if (absent)
|
||||
qglGenRenderbuffersEXT(1, pRenderBuffer);
|
||||
qglGenRenderbuffers(1, pRenderBuffer);
|
||||
|
||||
if (multisample && glRefConfig.framebufferMultisample)
|
||||
qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height);
|
||||
|
@ -192,12 +182,12 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
|
|||
{
|
||||
if (attachment == 0)
|
||||
{
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, *pRenderBuffer);
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, *pRenderBuffer);
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, *pRenderBuffer);
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, *pRenderBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, attachment, GL_RENDERBUFFER_EXT, *pRenderBuffer);
|
||||
qglNamedFramebufferRenderbufferEXT(fbo->frameBuffer, attachment, GL_RENDERBUFFER, *pRenderBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +207,7 @@ void FBO_AttachImage(FBO_t *fbo, image_t *image, GLenum attachment, GLuint cubem
|
|||
target = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + cubemapside;
|
||||
|
||||
qglNamedFramebufferTexture2DEXT(fbo->frameBuffer, attachment, target, image->texnum, 0);
|
||||
index = attachment - GL_COLOR_ATTACHMENT0_EXT;
|
||||
index = attachment - GL_COLOR_ATTACHMENT0;
|
||||
if (index >= 0 && index <= 15)
|
||||
fbo->colorImage[index] = image;
|
||||
}
|
||||
|
@ -245,7 +235,7 @@ void FBO_Bind(FBO_t * fbo)
|
|||
GLimp_LogComment(va("--- FBO_Bind( %s ) ---\n", fbo ? fbo->name : "NULL"));
|
||||
}
|
||||
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, fbo ? fbo->frameBuffer : 0);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, fbo ? fbo->frameBuffer : 0);
|
||||
glState.currentFBO = fbo;
|
||||
}
|
||||
|
||||
|
@ -275,7 +265,7 @@ void FBO_Init(void)
|
|||
hdrFormat = GL_RGBA16F_ARB;
|
||||
|
||||
if (glRefConfig.framebufferMultisample)
|
||||
qglGetIntegerv(GL_MAX_SAMPLES_EXT, &multisample);
|
||||
qglGetIntegerv(GL_MAX_SAMPLES, &multisample);
|
||||
|
||||
if (r_ext_framebuffer_multisample->integer < multisample)
|
||||
multisample = r_ext_framebuffer_multisample->integer;
|
||||
|
@ -292,19 +282,19 @@ void FBO_Init(void)
|
|||
{
|
||||
tr.renderFbo = FBO_Create("_render", tr.renderDepthImage->width, tr.renderDepthImage->height);
|
||||
FBO_CreateBuffer(tr.renderFbo, hdrFormat, 0, multisample);
|
||||
FBO_CreateBuffer(tr.renderFbo, GL_DEPTH_COMPONENT24_ARB, 0, multisample);
|
||||
FBO_CreateBuffer(tr.renderFbo, GL_DEPTH_COMPONENT24, 0, multisample);
|
||||
R_CheckFBO(tr.renderFbo);
|
||||
|
||||
tr.msaaResolveFbo = FBO_Create("_msaaResolve", tr.renderDepthImage->width, tr.renderDepthImage->height);
|
||||
FBO_AttachImage(tr.msaaResolveFbo, tr.renderImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.msaaResolveFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT_EXT, 0);
|
||||
FBO_AttachImage(tr.msaaResolveFbo, tr.renderImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
FBO_AttachImage(tr.msaaResolveFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.msaaResolveFbo);
|
||||
}
|
||||
else if (r_hdr->integer)
|
||||
{
|
||||
tr.renderFbo = FBO_Create("_render", tr.renderDepthImage->width, tr.renderDepthImage->height);
|
||||
FBO_AttachImage(tr.renderFbo, tr.renderImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.renderFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT_EXT, 0);
|
||||
FBO_AttachImage(tr.renderFbo, tr.renderImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
FBO_AttachImage(tr.renderFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.renderFbo);
|
||||
}
|
||||
|
||||
|
@ -312,34 +302,34 @@ void FBO_Init(void)
|
|||
// this fixes the corrupt screen bug with r_hdr 1 on older hardware
|
||||
if (tr.renderFbo)
|
||||
{
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, tr.renderFbo->frameBuffer);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, tr.renderFbo->frameBuffer);
|
||||
qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
}
|
||||
|
||||
if (tr.screenScratchImage)
|
||||
{
|
||||
tr.screenScratchFbo = FBO_Create("screenScratch", tr.screenScratchImage->width, tr.screenScratchImage->height);
|
||||
FBO_AttachImage(tr.screenScratchFbo, tr.screenScratchImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.screenScratchFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT_EXT, 0);
|
||||
FBO_AttachImage(tr.screenScratchFbo, tr.screenScratchImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
FBO_AttachImage(tr.screenScratchFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.screenScratchFbo);
|
||||
}
|
||||
|
||||
if (tr.sunRaysImage)
|
||||
{
|
||||
tr.sunRaysFbo = FBO_Create("_sunRays", tr.renderDepthImage->width, tr.renderDepthImage->height);
|
||||
FBO_AttachImage(tr.sunRaysFbo, tr.sunRaysImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.sunRaysFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT_EXT, 0);
|
||||
FBO_AttachImage(tr.sunRaysFbo, tr.sunRaysImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
FBO_AttachImage(tr.sunRaysFbo, tr.renderDepthImage, GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.sunRaysFbo);
|
||||
}
|
||||
|
||||
// FIXME: Don't use separate color/depth buffers for a shadow buffer
|
||||
if (MAX_DRAWN_PSHADOWS && tr.pshadowMaps[0])
|
||||
{
|
||||
for( i = 0; i < MAX_DRAWN_PSHADOWS; i++)
|
||||
{
|
||||
tr.pshadowFbos[i] = FBO_Create(va("_shadowmap%d", i), tr.pshadowMaps[i]->width, tr.pshadowMaps[i]->height);
|
||||
FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_CreateBuffer(tr.pshadowFbos[i], GL_DEPTH_COMPONENT24_ARB, 0, 0);
|
||||
// FIXME: this next line wastes 16mb with 16x512x512 sun shadow maps, skip if OpenGL 4.3+ or ARB_framebuffer_no_attachments
|
||||
FBO_CreateBuffer(tr.pshadowFbos[i], GL_RGBA8, 0, 0);
|
||||
FBO_AttachImage(tr.pshadowFbos[i], tr.pshadowMaps[i], GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.pshadowFbos[i]);
|
||||
}
|
||||
}
|
||||
|
@ -352,7 +342,7 @@ void FBO_Init(void)
|
|||
// FIXME: this next line wastes 16mb with 4x1024x1024 sun shadow maps, skip if OpenGL 4.3+ or ARB_framebuffer_no_attachments
|
||||
// This at least gets sun shadows working on older GPUs (Intel)
|
||||
FBO_CreateBuffer(tr.sunShadowFbo[i], GL_RGBA8, 0, 0);
|
||||
FBO_AttachImage(tr.sunShadowFbo[i], tr.sunShadowDepthImage[i], GL_DEPTH_ATTACHMENT_EXT, 0);
|
||||
FBO_AttachImage(tr.sunShadowFbo[i], tr.sunShadowDepthImage[i], GL_DEPTH_ATTACHMENT, 0);
|
||||
R_CheckFBO(tr.sunShadowFbo[i]);
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +350,7 @@ void FBO_Init(void)
|
|||
if (tr.screenShadowImage)
|
||||
{
|
||||
tr.screenShadowFbo = FBO_Create("_screenshadow", tr.screenShadowImage->width, tr.screenShadowImage->height);
|
||||
FBO_AttachImage(tr.screenShadowFbo, tr.screenShadowImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.screenShadowFbo, tr.screenShadowImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.screenShadowFbo);
|
||||
}
|
||||
|
||||
|
@ -369,7 +359,7 @@ void FBO_Init(void)
|
|||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
tr.textureScratchFbo[i] = FBO_Create(va("_texturescratch%d", i), tr.textureScratchImage[i]->width, tr.textureScratchImage[i]->height);
|
||||
FBO_AttachImage(tr.textureScratchFbo[i], tr.textureScratchImage[i], GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.textureScratchFbo[i], tr.textureScratchImage[i], GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.textureScratchFbo[i]);
|
||||
}
|
||||
}
|
||||
|
@ -377,14 +367,14 @@ void FBO_Init(void)
|
|||
if (tr.calcLevelsImage)
|
||||
{
|
||||
tr.calcLevelsFbo = FBO_Create("_calclevels", tr.calcLevelsImage->width, tr.calcLevelsImage->height);
|
||||
FBO_AttachImage(tr.calcLevelsFbo, tr.calcLevelsImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.calcLevelsFbo, tr.calcLevelsImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.calcLevelsFbo);
|
||||
}
|
||||
|
||||
if (tr.targetLevelsImage)
|
||||
{
|
||||
tr.targetLevelsFbo = FBO_Create("_targetlevels", tr.targetLevelsImage->width, tr.targetLevelsImage->height);
|
||||
FBO_AttachImage(tr.targetLevelsFbo, tr.targetLevelsImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.targetLevelsFbo, tr.targetLevelsImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.targetLevelsFbo);
|
||||
}
|
||||
|
||||
|
@ -393,7 +383,7 @@ void FBO_Init(void)
|
|||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
tr.quarterFbo[i] = FBO_Create(va("_quarter%d", i), tr.quarterImage[i]->width, tr.quarterImage[i]->height);
|
||||
FBO_AttachImage(tr.quarterFbo[i], tr.quarterImage[i], GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.quarterFbo[i], tr.quarterImage[i], GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.quarterFbo[i]);
|
||||
}
|
||||
}
|
||||
|
@ -401,28 +391,28 @@ void FBO_Init(void)
|
|||
if (tr.hdrDepthImage)
|
||||
{
|
||||
tr.hdrDepthFbo = FBO_Create("_hdrDepth", tr.hdrDepthImage->width, tr.hdrDepthImage->height);
|
||||
FBO_AttachImage(tr.hdrDepthFbo, tr.hdrDepthImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.hdrDepthFbo, tr.hdrDepthImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.hdrDepthFbo);
|
||||
}
|
||||
|
||||
if (tr.screenSsaoImage)
|
||||
{
|
||||
tr.screenSsaoFbo = FBO_Create("_screenssao", tr.screenSsaoImage->width, tr.screenSsaoImage->height);
|
||||
FBO_AttachImage(tr.screenSsaoFbo, tr.screenSsaoImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.screenSsaoFbo, tr.screenSsaoImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
R_CheckFBO(tr.screenSsaoFbo);
|
||||
}
|
||||
|
||||
if (tr.renderCubeImage)
|
||||
{
|
||||
tr.renderCubeFbo = FBO_Create("_renderCubeFbo", tr.renderCubeImage->width, tr.renderCubeImage->height);
|
||||
FBO_AttachImage(tr.renderCubeFbo, tr.renderCubeImage, GL_COLOR_ATTACHMENT0_EXT, 0);
|
||||
FBO_AttachImage(tr.renderCubeFbo, tr.renderCubeImage, GL_COLOR_ATTACHMENT0, 0);
|
||||
FBO_CreateBuffer(tr.renderCubeFbo, GL_DEPTH_COMPONENT24_ARB, 0, 0);
|
||||
R_CheckFBO(tr.renderCubeFbo);
|
||||
}
|
||||
|
||||
GL_CheckErrors();
|
||||
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glState.currentFBO = NULL;
|
||||
}
|
||||
|
||||
|
@ -450,17 +440,17 @@ void FBO_Shutdown(void)
|
|||
for(j = 0; j < glRefConfig.maxColorAttachments; j++)
|
||||
{
|
||||
if(fbo->colorBuffers[j])
|
||||
qglDeleteRenderbuffersEXT(1, &fbo->colorBuffers[j]);
|
||||
qglDeleteRenderbuffers(1, &fbo->colorBuffers[j]);
|
||||
}
|
||||
|
||||
if(fbo->depthBuffer)
|
||||
qglDeleteRenderbuffersEXT(1, &fbo->depthBuffer);
|
||||
qglDeleteRenderbuffers(1, &fbo->depthBuffer);
|
||||
|
||||
if(fbo->stencilBuffer)
|
||||
qglDeleteRenderbuffersEXT(1, &fbo->stencilBuffer);
|
||||
qglDeleteRenderbuffers(1, &fbo->stencilBuffer);
|
||||
|
||||
if(fbo->frameBuffer)
|
||||
qglDeleteFramebuffersEXT(1, &fbo->frameBuffer);
|
||||
qglDeleteFramebuffers(1, &fbo->frameBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -661,12 +651,12 @@ void FBO_FastBlit(FBO_t *src, ivec4_t srcBox, FBO_t *dst, ivec4_t dstBox, int bu
|
|||
VectorSet4(dstBoxFinal, dstBox[0], dstBox[1], dstBox[0] + dstBox[2], dstBox[1] + dstBox[3]);
|
||||
}
|
||||
|
||||
GL_BindFramebuffer(GL_READ_FRAMEBUFFER_EXT, srcFb);
|
||||
GL_BindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, dstFb);
|
||||
qglBlitFramebufferEXT(srcBoxFinal[0], srcBoxFinal[1], srcBoxFinal[2], srcBoxFinal[3],
|
||||
GL_BindFramebuffer(GL_READ_FRAMEBUFFER, srcFb);
|
||||
GL_BindFramebuffer(GL_DRAW_FRAMEBUFFER, dstFb);
|
||||
qglBlitFramebuffer(srcBoxFinal[0], srcBoxFinal[1], srcBoxFinal[2], srcBoxFinal[3],
|
||||
dstBoxFinal[0], dstBoxFinal[1], dstBoxFinal[2], dstBoxFinal[3],
|
||||
buffers, filter);
|
||||
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
|
||||
GL_BindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glState.currentFBO = NULL;
|
||||
}
|
||||
|
|
|
@ -146,6 +146,8 @@ static uniformInfo_t uniformsInfo[] =
|
|||
{ "u_PrimaryLightRadius", GLSL_FLOAT },
|
||||
|
||||
{ "u_CubeMapInfo", GLSL_VEC4 },
|
||||
|
||||
{ "u_AlphaTest", GLSL_INT },
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
@ -239,7 +241,10 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLchar *extra, char *
|
|||
// HACK: abuse the GLSL preprocessor to turn GLSL 1.20 shaders into 1.30 ones
|
||||
if(glRefConfig.glslMajorVersion > 1 || (glRefConfig.glslMajorVersion == 1 && glRefConfig.glslMinorVersion >= 30))
|
||||
{
|
||||
Q_strcat(dest, size, "#version 130\n");
|
||||
if (glRefConfig.glslMajorVersion > 1 || (glRefConfig.glslMajorVersion == 1 && glRefConfig.glslMinorVersion >= 50))
|
||||
Q_strcat(dest, size, "#version 150\n");
|
||||
else
|
||||
Q_strcat(dest, size, "#version 130\n");
|
||||
|
||||
if(shaderType == GL_VERTEX_SHADER)
|
||||
{
|
||||
|
@ -252,11 +257,15 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLchar *extra, char *
|
|||
|
||||
Q_strcat(dest, size, "out vec4 out_Color;\n");
|
||||
Q_strcat(dest, size, "#define gl_FragColor out_Color\n");
|
||||
Q_strcat(dest, size, "#define texture2D texture\n");
|
||||
Q_strcat(dest, size, "#define textureCubeLod textureLod\n");
|
||||
Q_strcat(dest, size, "#define shadow2D texture\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_strcat(dest, size, "#version 120\n");
|
||||
Q_strcat(dest, size, "#define shadow2D(a,b) shadow2D(a,b).r \n");
|
||||
}
|
||||
|
||||
// HACK: add some macros to avoid extra uniforms and save speed and code maintenance
|
||||
|
@ -478,20 +487,6 @@ static void GLSL_LinkProgram(GLuint program)
|
|||
}
|
||||
}
|
||||
|
||||
static void GLSL_ValidateProgram(GLuint program)
|
||||
{
|
||||
GLint validated;
|
||||
|
||||
qglValidateProgram(program);
|
||||
|
||||
qglGetProgramiv(program, GL_VALIDATE_STATUS, &validated);
|
||||
if(!validated)
|
||||
{
|
||||
GLSL_PrintLog(program, GLSL_PRINTLOG_PROGRAM_INFO, qfalse);
|
||||
ri.Error(ERR_DROP, "shaders failed to validate");
|
||||
}
|
||||
}
|
||||
|
||||
static void GLSL_ShowProgramUniforms(GLuint program)
|
||||
{
|
||||
int i, count, size;
|
||||
|
@ -686,7 +681,6 @@ void GLSL_InitUniforms(shaderProgram_t *program)
|
|||
|
||||
void GLSL_FinishGPUShader(shaderProgram_t *program)
|
||||
{
|
||||
GLSL_ValidateProgram(program->program);
|
||||
GLSL_ShowProgramUniforms(program->program);
|
||||
GL_CheckErrors();
|
||||
}
|
||||
|
@ -945,7 +939,7 @@ void GLSL_InitGPUShaders(void)
|
|||
|
||||
attribs = ATTR_POSITION | ATTR_TEXCOORD;
|
||||
|
||||
if (!GLSL_InitGPUShader(&tr.textureColorShader, "texturecolor", attribs, qtrue, NULL, qfalse, fallbackShader_texturecolor_vp, fallbackShader_texturecolor_fp))
|
||||
if (!GLSL_InitGPUShader(&tr.textureColorShader, "texturecolor", attribs, qtrue, extradefines, qtrue, fallbackShader_texturecolor_vp, fallbackShader_texturecolor_fp))
|
||||
{
|
||||
ri.Error(ERR_FATAL, "Could not load texturecolor shader!");
|
||||
}
|
||||
|
|
|
@ -2126,7 +2126,7 @@ image_t *R_CreateImage2( const char *name, byte *pic, int width, int height, GLe
|
|||
}
|
||||
|
||||
image = tr.images[tr.numImages] = ri.Hunk_Alloc( sizeof( image_t ), h_low );
|
||||
image->texnum = 1024 + tr.numImages;
|
||||
qglGenTextures(1, &image->texnum);
|
||||
tr.numImages++;
|
||||
|
||||
image->type = type;
|
||||
|
@ -2772,13 +2772,13 @@ void R_CreateBuiltinImages( void ) {
|
|||
tr.screenScratchImage = R_CreateImage("screenScratch", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, rgbFormat);
|
||||
|
||||
if (r_shadowBlur->integer || r_ssao->integer)
|
||||
tr.hdrDepthImage = R_CreateImage("*hdrDepth", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_INTENSITY32F_ARB);
|
||||
tr.hdrDepthImage = R_CreateImage("*hdrDepth", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_R32F);
|
||||
|
||||
if (r_drawSunRays->integer)
|
||||
tr.sunRaysImage = R_CreateImage("*sunRays", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, rgbFormat);
|
||||
|
||||
tr.renderDepthImage = R_CreateImage("*renderdepth", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24_ARB);
|
||||
tr.textureDepthImage = R_CreateImage("*texturedepth", NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24_ARB);
|
||||
tr.renderDepthImage = R_CreateImage("*renderdepth", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
|
||||
tr.textureDepthImage = R_CreateImage("*texturedepth", NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
|
||||
|
||||
{
|
||||
void *p;
|
||||
|
@ -2808,19 +2808,18 @@ void R_CreateBuiltinImages( void ) {
|
|||
tr.screenSsaoImage = R_CreateImage("*screenSsao", NULL, width / 2, height / 2, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
|
||||
}
|
||||
|
||||
if (r_shadows->integer == 4)
|
||||
for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
|
||||
{
|
||||
for( x = 0; x < MAX_DRAWN_PSHADOWS; x++)
|
||||
{
|
||||
tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_RGBA8);
|
||||
}
|
||||
tr.pshadowMaps[x] = R_CreateImage(va("*shadowmap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
|
||||
//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
|
||||
//qglTextureParameterfEXT(tr.pshadowMaps[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
}
|
||||
|
||||
if (r_sunlightMode->integer)
|
||||
{
|
||||
for ( x = 0; x < 4; x++)
|
||||
{
|
||||
tr.sunShadowDepthImage[x] = R_CreateImage(va("*sunshadowdepth%i", x), NULL, r_shadowMapSize->integer, r_shadowMapSize->integer, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24_ARB);
|
||||
tr.sunShadowDepthImage[x] = R_CreateImage(va("*sunshadowdepth%i", x), NULL, r_shadowMapSize->integer, r_shadowMapSize->integer, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, GL_DEPTH_COMPONENT24);
|
||||
qglTextureParameterfEXT(tr.sunShadowDepthImage[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
|
||||
qglTextureParameterfEXT(tr.sunShadowDepthImage[x]->texnum, GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ static void InitOpenGL( void )
|
|||
{
|
||||
GLint temp;
|
||||
|
||||
GLimp_Init();
|
||||
GLimp_Init( qtrue );
|
||||
GLimp_InitExtraExtensions();
|
||||
|
||||
strcpy( renderer_buffer, glConfig.renderer_string );
|
||||
|
@ -943,14 +943,11 @@ void GL_SetDefaultState( void )
|
|||
|
||||
qglCullFace(GL_FRONT);
|
||||
|
||||
qglColor4f (1,1,1,1);
|
||||
|
||||
GL_BindNullTextures();
|
||||
|
||||
if (glRefConfig.framebufferObject)
|
||||
GL_BindNullFramebuffers();
|
||||
|
||||
qglEnable(GL_TEXTURE_2D);
|
||||
GL_TextureMode( r_textureMode->string );
|
||||
|
||||
//qglShadeModel( GL_SMOOTH );
|
||||
|
@ -1034,7 +1031,21 @@ void GfxInfo_f( void )
|
|||
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
|
||||
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
|
||||
ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
|
||||
R_PrintLongString( glConfig.extensions_string );
|
||||
if (glRefConfig.openglMajorVersion >= 3)
|
||||
{
|
||||
GLint numExtensions;
|
||||
int i;
|
||||
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
|
||||
for (i = 0; i < numExtensions; i++)
|
||||
{
|
||||
ri.Printf(PRINT_ALL, "%s ", qglGetStringi(GL_EXTENSIONS, i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
R_PrintLongString( glConfig.extensions_string );
|
||||
}
|
||||
ri.Printf( PRINT_ALL, "\n" );
|
||||
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
|
||||
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );
|
||||
|
@ -1060,7 +1071,6 @@ void GfxInfo_f( void )
|
|||
ri.Printf( PRINT_ALL, "texturemode: %s\n", r_textureMode->string );
|
||||
ri.Printf( PRINT_ALL, "picmip: %d\n", r_picmip->integer );
|
||||
ri.Printf( PRINT_ALL, "texture bits: %d\n", r_texturebits->integer );
|
||||
ri.Printf( PRINT_ALL, "multitexture: %s\n", enablestrings[qglActiveTextureARB != 0] );
|
||||
ri.Printf( PRINT_ALL, "compiled vertex arrays: %s\n", enablestrings[qglLockArraysEXT != 0 ] );
|
||||
ri.Printf( PRINT_ALL, "texenv add: %s\n", enablestrings[glConfig.textureEnvAddAvailable != 0] );
|
||||
ri.Printf( PRINT_ALL, "compressed textures: %s\n", enablestrings[glConfig.textureCompression!=TC_NONE] );
|
||||
|
@ -1491,16 +1501,15 @@ void RE_Shutdown( qboolean destroyWindow ) {
|
|||
|
||||
ri.Printf( PRINT_ALL, "RE_Shutdown( %i )\n", destroyWindow );
|
||||
|
||||
ri.Cmd_RemoveCommand ("modellist");
|
||||
ri.Cmd_RemoveCommand ("screenshotJPEG");
|
||||
ri.Cmd_RemoveCommand ("screenshot");
|
||||
ri.Cmd_RemoveCommand ("imagelist");
|
||||
ri.Cmd_RemoveCommand ("shaderlist");
|
||||
ri.Cmd_RemoveCommand ("skinlist");
|
||||
ri.Cmd_RemoveCommand ("gfxinfo");
|
||||
ri.Cmd_RemoveCommand("minimize");
|
||||
ri.Cmd_RemoveCommand( "imagelist" );
|
||||
ri.Cmd_RemoveCommand( "shaderlist" );
|
||||
ri.Cmd_RemoveCommand( "skinlist" );
|
||||
ri.Cmd_RemoveCommand( "modellist" );
|
||||
ri.Cmd_RemoveCommand( "modelist" );
|
||||
ri.Cmd_RemoveCommand( "shaderstate" );
|
||||
ri.Cmd_RemoveCommand( "screenshot" );
|
||||
ri.Cmd_RemoveCommand( "screenshotJPEG" );
|
||||
ri.Cmd_RemoveCommand( "gfxinfo" );
|
||||
ri.Cmd_RemoveCommand( "minimize" );
|
||||
ri.Cmd_RemoveCommand( "gfxmeminfo" );
|
||||
ri.Cmd_RemoveCommand( "exportCubemaps" );
|
||||
|
||||
|
|
|
@ -471,37 +471,14 @@ typedef struct shader_s {
|
|||
|
||||
void (*optimalStageIteratorFunc)( void );
|
||||
|
||||
float clampTime; // time this shader is clamped to
|
||||
float timeOffset; // current time offset for this shader
|
||||
double clampTime; // time this shader is clamped to
|
||||
double timeOffset; // current time offset for this shader
|
||||
|
||||
struct shader_s *remappedShader; // current shader this one is remapped too
|
||||
|
||||
struct shader_s *next;
|
||||
} shader_t;
|
||||
|
||||
static ID_INLINE qboolean ShaderRequiresCPUDeforms(const shader_t * shader)
|
||||
{
|
||||
if(shader->numDeforms)
|
||||
{
|
||||
const deformStage_t *ds = &shader->deforms[0];
|
||||
|
||||
if (shader->numDeforms > 1)
|
||||
return qtrue;
|
||||
|
||||
switch (ds->deformation)
|
||||
{
|
||||
case DEFORM_WAVE:
|
||||
case DEFORM_BULGE:
|
||||
return qfalse;
|
||||
|
||||
default:
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
ATTR_INDEX_POSITION = 0,
|
||||
|
@ -694,6 +671,8 @@ typedef enum
|
|||
|
||||
UNIFORM_CUBEMAPINFO,
|
||||
|
||||
UNIFORM_ALPHATEST,
|
||||
|
||||
UNIFORM_COUNT
|
||||
} uniform_t;
|
||||
|
||||
|
@ -731,7 +710,7 @@ typedef struct {
|
|||
byte areamask[MAX_MAP_AREA_BYTES];
|
||||
qboolean areamaskModified; // qtrue if areamask changed since last scene
|
||||
|
||||
float floatTime; // tr.refdef.time / 1000.0
|
||||
double floatTime; // tr.refdef.time / 1000.0
|
||||
|
||||
float blurFactor;
|
||||
|
||||
|
@ -1789,6 +1768,32 @@ extern cvar_t *r_marksOnTriangleMeshes;
|
|||
|
||||
//====================================================================
|
||||
|
||||
static ID_INLINE qboolean ShaderRequiresCPUDeforms(const shader_t * shader)
|
||||
{
|
||||
if(shader->numDeforms)
|
||||
{
|
||||
const deformStage_t *ds = &shader->deforms[0];
|
||||
|
||||
if (shader->numDeforms > 1)
|
||||
return qtrue;
|
||||
|
||||
switch (ds->deformation)
|
||||
{
|
||||
case DEFORM_WAVE:
|
||||
case DEFORM_BULGE:
|
||||
// need CPU deforms at high level-times to avoid floating point percision loss
|
||||
return ( backEnd.refdef.floatTime != (float)backEnd.refdef.floatTime );
|
||||
|
||||
default:
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
//====================================================================
|
||||
|
||||
void R_SwapBuffers( int );
|
||||
|
||||
void R_RenderView( viewParms_t *parms );
|
||||
|
@ -1976,7 +1981,7 @@ typedef struct shaderCommands_s
|
|||
//color4ub_t constantColor255[SHADER_MAX_VERTEXES] QALIGN(16);
|
||||
|
||||
shader_t *shader;
|
||||
float shaderTime;
|
||||
double shaderTime;
|
||||
int fogNum;
|
||||
int cubemapIndex;
|
||||
|
||||
|
|
|
@ -2098,7 +2098,7 @@ void R_RenderPshadowMaps(const refdef_t *fd)
|
|||
if (glRefConfig.framebufferObject)
|
||||
shadowParms.targetFbo = tr.pshadowFbos[i];
|
||||
|
||||
shadowParms.flags = VPF_SHADOWMAP | VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
|
||||
shadowParms.flags = VPF_DEPTHSHADOW | VPF_NOVIEWMODEL;
|
||||
shadowParms.zFar = shadow->lightRadius;
|
||||
|
||||
VectorCopy(shadow->lightOrigin, shadowParms.or.origin);
|
||||
|
|
|
@ -400,7 +400,7 @@ void RE_BeginScene(const refdef_t *fd)
|
|||
|
||||
// derived info
|
||||
|
||||
tr.refdef.floatTime = tr.refdef.time * 0.001f;
|
||||
tr.refdef.floatTime = tr.refdef.time * 0.001;
|
||||
|
||||
tr.refdef.numDrawSurfs = r_firstSceneDrawSurf;
|
||||
tr.refdef.drawSurfs = backEndData->drawSurfs;
|
||||
|
|
|
@ -65,7 +65,7 @@ R_BindAnimatedImageToTMU
|
|||
=================
|
||||
*/
|
||||
static void R_BindAnimatedImageToTMU( textureBundle_t *bundle, int tmu ) {
|
||||
int index;
|
||||
int64_t index;
|
||||
|
||||
if ( bundle->isVideoMap ) {
|
||||
ri.CIN_RunCinematic(bundle->videoMapHandle);
|
||||
|
@ -81,7 +81,7 @@ static void R_BindAnimatedImageToTMU( textureBundle_t *bundle, int tmu ) {
|
|||
|
||||
// it is necessary to do this messy calc to make sure animations line up
|
||||
// exactly with waveforms of the same frequency
|
||||
index = ri.ftol(tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE);
|
||||
index = tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE;
|
||||
index >>= FUNCTABLE_SIZE2;
|
||||
|
||||
if ( index < 0 ) {
|
||||
|
@ -115,6 +115,7 @@ static void DrawTris (shaderCommands_t *input) {
|
|||
GLSL_SetUniformMat4(sp, UNIFORM_MODELVIEWPROJECTIONMATRIX, glState.modelviewProjection);
|
||||
VectorSet4(color, 1, 1, 1, 1);
|
||||
GLSL_SetUniformVec4(sp, UNIFORM_COLOR, color);
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
R_DrawElements(input->numIndexes, input->firstIndex);
|
||||
}
|
||||
|
@ -383,6 +384,8 @@ static void ProjectDlightTexture( void ) {
|
|||
GL_State( GLS_ATEST_GT_0 | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ONE | GLS_DEPTHFUNC_EQUAL );
|
||||
}
|
||||
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 1);
|
||||
|
||||
R_DrawElements(tess.numIndexes, tess.firstIndex);
|
||||
|
||||
backEnd.pc.c_totalIndexes += tess.numIndexes;
|
||||
|
@ -746,6 +749,7 @@ static void ForwardDlight( void ) {
|
|||
// include GLS_DEPTHFUNC_EQUAL so alpha tested surfaces don't add light
|
||||
// where they aren't rendered
|
||||
GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ONE | GLS_DEPTHFUNC_EQUAL );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
GLSL_SetUniformMat4(sp, UNIFORM_MODELMATRIX, backEnd.or.transformMatrix);
|
||||
|
||||
|
@ -858,6 +862,7 @@ static void ProjectPshadowVBOGLSL( void ) {
|
|||
// include GLS_DEPTHFUNC_EQUAL so alpha tested surfaces don't add light
|
||||
// where they aren't rendered
|
||||
GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA | GLS_DEPTHFUNC_EQUAL );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
GL_BindToTMU( tr.pshadowMaps[l], TB_DIFFUSEMAP );
|
||||
|
||||
|
@ -939,6 +944,7 @@ static void RB_FogPass( void ) {
|
|||
} else {
|
||||
GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
R_DrawElements(tess.numIndexes, tess.firstIndex);
|
||||
}
|
||||
|
@ -1081,6 +1087,23 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
|
|||
}
|
||||
|
||||
GL_State( pStage->stateBits );
|
||||
if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_GT_0)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 1);
|
||||
}
|
||||
else if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_LT_80)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 2);
|
||||
}
|
||||
else if ((pStage->stateBits & GLS_ATEST_BITS) == GLS_ATEST_GE_80)
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
vec4_t baseColor;
|
||||
|
@ -1368,6 +1391,7 @@ static void RB_RenderShadowmap( shaderCommands_t *input )
|
|||
GLSL_SetUniformFloat(sp, UNIFORM_LIGHTRADIUS, backEnd.viewParms.zFar);
|
||||
|
||||
GL_State( 0 );
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
//
|
||||
// do multitexture
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#endif
|
||||
|
||||
|
||||
#define WAVEVALUE( table, base, amplitude, phase, freq ) ((base) + table[ ri.ftol( ( ( (phase) + tess.shaderTime * (freq) ) * FUNCTABLE_SIZE ) ) & FUNCTABLE_MASK ] * (amplitude))
|
||||
#define WAVEVALUE( table, base, amplitude, phase, freq ) ((base) + table[ ( (int64_t) ( ( (phase) + tess.shaderTime * (freq) ) * FUNCTABLE_SIZE ) ) & FUNCTABLE_MASK ] * (amplitude))
|
||||
|
||||
static float *TableForFunc( genFunc_t func )
|
||||
{
|
||||
|
@ -204,12 +204,12 @@ void RB_CalcBulgeVertexes( deformStage_t *ds ) {
|
|||
const float *st = ( const float * ) tess.texCoords[0];
|
||||
float *xyz = ( float * ) tess.xyz;
|
||||
int16_t *normal = tess.normal[0];
|
||||
float now;
|
||||
double now;
|
||||
|
||||
now = backEnd.refdef.time * ds->bulgeSpeed * 0.001f;
|
||||
now = backEnd.refdef.time * 0.001 * ds->bulgeSpeed;
|
||||
|
||||
for ( i = 0; i < tess.numVertexes; i++, xyz += 4, st += 2, normal += 4 ) {
|
||||
int off;
|
||||
int64_t off;
|
||||
float scale;
|
||||
vec3_t fNormal;
|
||||
|
||||
|
@ -776,8 +776,8 @@ void RB_CalcScaleTexMatrix( const float scale[2], float *matrix )
|
|||
*/
|
||||
void RB_CalcScrollTexMatrix( const float scrollSpeed[2], float *matrix )
|
||||
{
|
||||
float timeScale = tess.shaderTime;
|
||||
float adjustedScrollS, adjustedScrollT;
|
||||
double timeScale = tess.shaderTime;
|
||||
double adjustedScrollS, adjustedScrollT;
|
||||
|
||||
adjustedScrollS = scrollSpeed[0] * timeScale;
|
||||
adjustedScrollT = scrollSpeed[1] * timeScale;
|
||||
|
@ -805,9 +805,9 @@ void RB_CalcTransformTexMatrix( const texModInfo_t *tmi, float *matrix )
|
|||
*/
|
||||
void RB_CalcRotateTexMatrix( float degsPerSecond, float *matrix )
|
||||
{
|
||||
float timeScale = tess.shaderTime;
|
||||
float degs;
|
||||
int index;
|
||||
double timeScale = tess.shaderTime;
|
||||
double degs;
|
||||
int64_t index;
|
||||
float sinValue, cosValue;
|
||||
|
||||
degs = -degsPerSecond * timeScale;
|
||||
|
|
|
@ -2255,7 +2255,7 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
|
|||
{
|
||||
char normalName[MAX_QPATH];
|
||||
image_t *normalImg;
|
||||
imgFlags_t normalFlags = (diffuseImg->flags & ~(IMGFLAG_GENNORMALMAP | IMGFLAG_SRGB)) | IMGFLAG_NOLIGHTSCALE;
|
||||
imgFlags_t normalFlags = (diffuseImg->flags & ~IMGFLAG_GENNORMALMAP) | IMGFLAG_NOLIGHTSCALE;
|
||||
|
||||
// try a normalheight image first
|
||||
COM_StripExtension(diffuseImg->imgName, normalName, MAX_QPATH);
|
||||
|
@ -2301,7 +2301,7 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
|
|||
{
|
||||
char specularName[MAX_QPATH];
|
||||
image_t *specularImg;
|
||||
imgFlags_t specularFlags = (diffuseImg->flags & ~(IMGFLAG_GENNORMALMAP | IMGFLAG_SRGB)) | IMGFLAG_NOLIGHTSCALE;
|
||||
imgFlags_t specularFlags = (diffuseImg->flags & ~IMGFLAG_GENNORMALMAP) | IMGFLAG_NOLIGHTSCALE;
|
||||
|
||||
COM_StripExtension(diffuseImg->imgName, specularName, MAX_QPATH);
|
||||
Q_strcat(specularName, MAX_QPATH, "_s");
|
||||
|
@ -3072,9 +3072,7 @@ static shader_t *FinishShader( void ) {
|
|||
//
|
||||
// look for multitexture potential
|
||||
//
|
||||
if ( qglActiveTextureARB ) {
|
||||
stage = CollapseStagesToGLSL();
|
||||
}
|
||||
stage = CollapseStagesToGLSL();
|
||||
|
||||
if ( shader.lightmapIndex >= 0 && !hasLightmapStage ) {
|
||||
if (vertexLightmap) {
|
||||
|
|
|
@ -458,6 +458,8 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
|
||||
VectorSet4(vector, 0.0, 0.0, 0.0, 0.0);
|
||||
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXOFFTURB, vector);
|
||||
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
}
|
||||
|
||||
R_DrawElements(tess.numIndexes - tess.firstIndex, tess.firstIndex);
|
||||
|
|
|
@ -546,6 +546,8 @@ static void RB_SurfaceBeam( void )
|
|||
|
||||
GLSL_SetUniformVec4(sp, UNIFORM_COLOR, colorRed);
|
||||
|
||||
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
|
||||
|
||||
R_DrawElements(tess.numIndexes, tess.firstIndex);
|
||||
|
||||
tess.numIndexes = 0;
|
||||
|
|
|
@ -215,7 +215,7 @@ static void GLimp_DetectAvailableModes(void)
|
|||
GLimp_SetMode
|
||||
===============
|
||||
*/
|
||||
static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
|
||||
static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qboolean coreContext)
|
||||
{
|
||||
const char *glstring;
|
||||
int perChannelColorBits;
|
||||
|
@ -477,7 +477,52 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
|
|||
|
||||
SDL_SetWindowIcon( SDL_window, icon );
|
||||
|
||||
if( ( SDL_glContext = SDL_GL_CreateContext( SDL_window ) ) == NULL )
|
||||
if (coreContext)
|
||||
{
|
||||
int profileMask, majorVersion, minorVersion;
|
||||
SDL_GL_GetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, &profileMask);
|
||||
SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &majorVersion);
|
||||
SDL_GL_GetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, &minorVersion);
|
||||
|
||||
ri.Printf(PRINT_ALL, "Trying to get an OpenGL 3.2 core context\n");
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||
if ((SDL_glContext = SDL_GL_CreateContext(SDL_window)) == NULL)
|
||||
{
|
||||
ri.Printf(PRINT_ALL, "SDL_GL_CreateContext failed: %s\n", SDL_GetError());
|
||||
ri.Printf(PRINT_ALL, "Reverting to default context\n");
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, profileMask);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majorVersion);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minorVersion);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *renderer;
|
||||
|
||||
ri.Printf(PRINT_ALL, "SDL_GL_CreateContext succeeded.\n");
|
||||
|
||||
renderer = (const char *)qglGetString(GL_RENDERER);
|
||||
if (renderer && (strstr(renderer, "Software Renderer") || strstr(renderer, "Software Rasterizer")))
|
||||
{
|
||||
ri.Printf(PRINT_ALL, "GL_RENDERER is %s, rejecting context\n", renderer);
|
||||
|
||||
SDL_GL_DeleteContext(SDL_glContext);
|
||||
SDL_glContext = NULL;
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, profileMask);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majorVersion);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minorVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_glContext = NULL;
|
||||
}
|
||||
|
||||
if( !SDL_glContext && ( SDL_glContext = SDL_GL_CreateContext( SDL_window ) ) == NULL )
|
||||
{
|
||||
ri.Printf( PRINT_DEVELOPER, "SDL_GL_CreateContext failed: %s\n", SDL_GetError( ) );
|
||||
continue;
|
||||
|
@ -522,7 +567,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
|
|||
GLimp_StartDriverAndSetMode
|
||||
===============
|
||||
*/
|
||||
static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qboolean noborder)
|
||||
static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qboolean noborder, qboolean gl3Core)
|
||||
{
|
||||
rserr_t err;
|
||||
|
||||
|
@ -549,7 +594,7 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
|
|||
fullscreen = qfalse;
|
||||
}
|
||||
|
||||
err = GLimp_SetMode(mode, fullscreen, noborder);
|
||||
err = GLimp_SetMode(mode, fullscreen, noborder, gl3Core);
|
||||
|
||||
switch ( err )
|
||||
{
|
||||
|
@ -744,7 +789,7 @@ This routine is responsible for initializing the OS specific portions
|
|||
of OpenGL
|
||||
===============
|
||||
*/
|
||||
void GLimp_Init( void )
|
||||
void GLimp_Init( qboolean coreContext)
|
||||
{
|
||||
ri.Printf( PRINT_DEVELOPER, "Glimp_Init( )\n" );
|
||||
|
||||
|
@ -764,13 +809,13 @@ void GLimp_Init( void )
|
|||
ri.Sys_GLimpInit( );
|
||||
|
||||
// Create the window and set up the context
|
||||
if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, r_noborder->integer))
|
||||
if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, r_noborder->integer, coreContext))
|
||||
goto success;
|
||||
|
||||
// Try again, this time in a platform specific "safe mode"
|
||||
ri.Sys_GLimpSafeInit( );
|
||||
|
||||
if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, qfalse))
|
||||
if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, qfalse, coreContext))
|
||||
goto success;
|
||||
|
||||
// Finally, try the default screen resolution
|
||||
|
@ -779,7 +824,7 @@ void GLimp_Init( void )
|
|||
ri.Printf( PRINT_ALL, "Setting r_mode %d failed, falling back on r_mode %d\n",
|
||||
r_mode->integer, R_MODE_FALLBACK );
|
||||
|
||||
if(GLimp_StartDriverAndSetMode(R_MODE_FALLBACK, qfalse, qfalse))
|
||||
if(GLimp_StartDriverAndSetMode(R_MODE_FALLBACK, qfalse, qfalse, coreContext))
|
||||
goto success;
|
||||
}
|
||||
|
||||
|
@ -801,7 +846,10 @@ success:
|
|||
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
|
||||
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
|
||||
Q_strncpyz( glConfig.version_string, (char *) qglGetString (GL_VERSION), sizeof( glConfig.version_string ) );
|
||||
Q_strncpyz( glConfig.extensions_string, (char *) qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
|
||||
if (qglGetString(GL_EXTENSIONS))
|
||||
Q_strncpyz( glConfig.extensions_string, (char *) qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
|
||||
else
|
||||
Q_strncpyz( glConfig.extensions_string, "Not available (core context, fixme)", sizeof( glConfig.extensions_string ) );
|
||||
|
||||
// initialize extensions
|
||||
GLimp_InitExtensions( );
|
||||
|
|
|
@ -1260,6 +1260,7 @@ static void SV_ConSay_f(void) {
|
|||
|
||||
strcat(text, p);
|
||||
|
||||
Com_Printf("%s\n", text);
|
||||
SV_SendServerCommand(NULL, "chat \"%s\"", text);
|
||||
}
|
||||
|
||||
|
@ -1299,6 +1300,7 @@ static void SV_ConTell_f(void) {
|
|||
|
||||
strcat(text, p);
|
||||
|
||||
Com_Printf("%s\n", text);
|
||||
SV_SendServerCommand(cl, "chat \"%s\"", text);
|
||||
}
|
||||
|
||||
|
@ -1364,6 +1366,7 @@ static void SV_ConSayto_f(void) {
|
|||
|
||||
strcat(text, p);
|
||||
|
||||
Com_Printf("%s\n", text);
|
||||
SV_SendServerCommand(saytocl, "chat \"%s\"", text);
|
||||
}
|
||||
|
||||
|
|
|
@ -744,11 +744,10 @@ int main( int argc, char **argv )
|
|||
Q_strcat( commandLine, sizeof( commandLine ), " " );
|
||||
}
|
||||
|
||||
CON_Init( );
|
||||
Com_Init( commandLine );
|
||||
NET_Init( );
|
||||
|
||||
CON_Init( );
|
||||
|
||||
signal( SIGILL, Sys_SigHandler );
|
||||
signal( SIGFPE, Sys_SigHandler );
|
||||
signal( SIGSEGV, Sys_SigHandler );
|
||||
|
|
|
@ -55,20 +55,22 @@ static const int numSkillLevels = ARRAY_LEN( skillLevels );
|
|||
|
||||
|
||||
#define UIAS_LOCAL 0
|
||||
#define UIAS_GLOBAL1 1
|
||||
#define UIAS_GLOBAL2 2
|
||||
#define UIAS_GLOBAL3 3
|
||||
#define UIAS_GLOBAL4 4
|
||||
#define UIAS_GLOBAL5 5
|
||||
#define UIAS_FAVORITES 6
|
||||
#define UIAS_GLOBAL0 1
|
||||
#define UIAS_GLOBAL1 2
|
||||
#define UIAS_GLOBAL2 3
|
||||
#define UIAS_GLOBAL3 4
|
||||
#define UIAS_GLOBAL4 5
|
||||
#define UIAS_GLOBAL5 6
|
||||
#define UIAS_FAVORITES 7
|
||||
|
||||
static const char *netSources[] = {
|
||||
"Local",
|
||||
"Internet1",
|
||||
"Internet2",
|
||||
"Internet3",
|
||||
"Internet4",
|
||||
"Internet5",
|
||||
"Internet",
|
||||
"Master1",
|
||||
"Master2",
|
||||
"Master3",
|
||||
"Master4",
|
||||
"Master5",
|
||||
"Favorites"
|
||||
};
|
||||
static const int numNetSources = ARRAY_LEN( netSources );
|
||||
|
@ -999,6 +1001,7 @@ int UI_SourceForLAN(void) {
|
|||
default:
|
||||
case UIAS_LOCAL:
|
||||
return AS_LOCAL;
|
||||
case UIAS_GLOBAL0:
|
||||
case UIAS_GLOBAL1:
|
||||
case UIAS_GLOBAL2:
|
||||
case UIAS_GLOBAL3:
|
||||
|
@ -2484,7 +2487,7 @@ static qboolean UI_NetSource_HandleKey(int flags, float *special, int key) {
|
|||
|
||||
while(ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5)
|
||||
{
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", ui_netSource.integer);
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", ui_netSource.integer - UIAS_GLOBAL0);
|
||||
trap_Cvar_VariableStringBuffer(cvarname, masterstr, sizeof(masterstr));
|
||||
if(*masterstr)
|
||||
break;
|
||||
|
@ -6008,7 +6011,7 @@ static void UI_StartServerRefresh(qboolean full, qboolean force)
|
|||
// This function is called with force=qfalse when server browser menu opens or net source changes.
|
||||
// Automatically update local and favorite servers.
|
||||
// Only auto update master server list if there is no server info cache.
|
||||
if ( !force && ( ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5 ) ) {
|
||||
if ( !force && ( ui_netSource.integer >= UIAS_GLOBAL0 && ui_netSource.integer <= UIAS_GLOBAL5 ) ) {
|
||||
if ( trap_LAN_GetServerCount( UI_SourceForLAN() ) > 0 ) {
|
||||
return; // have cached list
|
||||
}
|
||||
|
@ -6041,14 +6044,14 @@ static void UI_StartServerRefresh(qboolean full, qboolean force)
|
|||
}
|
||||
|
||||
uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 5000;
|
||||
if( ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5 ) {
|
||||
if( ui_netSource.integer >= UIAS_GLOBAL0 && ui_netSource.integer <= UIAS_GLOBAL5 ) {
|
||||
|
||||
ptr = UI_Cvar_VariableString("debug_protocol");
|
||||
if (strlen(ptr)) {
|
||||
trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %s full empty\n", ui_netSource.integer - UIAS_GLOBAL1, ptr ) );
|
||||
trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %s full empty\n", ui_netSource.integer - UIAS_GLOBAL0, ptr ) );
|
||||
}
|
||||
else {
|
||||
trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %d full empty\n", ui_netSource.integer - UIAS_GLOBAL1, (int)trap_Cvar_VariableValue( "protocol" ) ) );
|
||||
trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %d full empty\n", ui_netSource.integer - UIAS_GLOBAL0, (int)trap_Cvar_VariableValue( "protocol" ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue