type
stringclasses
5 values
content
stringlengths
9
163k
functions
qboolean GLimp_InitOpenGLContext() { #ifdef FEATURE_RENDERER2 int GLmajor, GLminor; #endif // get vendor Q_strncpyz(glConfig.vendor_string, (char *) qglGetString(GL_VENDOR), sizeof(glConfig.vendor_string)); // get renderer Q_strncpyz(glConfig.renderer_string, (char *) qglGetString(GL_RENDERER), sizeof(glConfig....
functions
GLAPIENTRY Glimp_DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) { Ren_Warning("Driver message: %s\n", message); }
functions
qboolean GLimp_CheckForVersionExtension(const char *ext, int coresince, qboolean required, cvar_t *var) { qboolean result = qfalse; if ((coresince >= 0 && coresince <= glConfig2.contextCombined) || GL_CheckForExtension(ext)) { if (var && var->integer) { result = qtrue; }
functions
else if (!var) { result = qtrue; }
functions
void GLimp_InitExtensionsR2(void) { Com_Printf("Initializing OpenGL extensions\n"); // GL_ARB_depth_texture GLimp_CheckForVersionExtension("GL_ARB_depth_texture", 130, qtrue, NULL); if (GLimp_CheckForVersionExtension("GL_ARB_texture_cube_map", 130, qtrue, NULL)) { glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB...
functions
void GLimp_InitExtensions(void) { if (!r_allowExtensions->integer) { Com_Printf("* IGNORING OPENGL EXTENSIONS *\n"); return; }
functions
GL_EXT_texture_compression_s3tc if (GLEW_ARB_texture_compression && GLEW_EXT_texture_compression_s3tc) { if (r_ext_compressed_textures->value) { glConfig.textureCompression = TC_S3TC_ARB; Com_Printf("...found OpenGL extension - GL_EXT_texture_compression_s3tc\n"); }
functions
else if (GLEW_ARB_multitexture) { if (r_ext_multitexture->value) { GLint glint = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &glint); glConfig.maxActiveTextures = (int) glint; if (glConfig.maxActiveTextures > 1) { Com_Printf("...found OpenGL extension - GL_ARB_multitexture\n"); }
functions
void Glimp_ClearScreen(void) { qglClearColor(0, 0, 0, 1); qglClear(GL_COLOR_BUFFER_BIT); ri.GLimp_SwapFrame(); }
functions
int RE_InitOpenGlSubsystems(void) { #ifndef FEATURE_RENDERER_GLES GLenum glewResult; #endif #if !defined(FEATURE_RENDERER_GLES) #if defined(FEATURE_RENDERER2) glewExperimental = GL_TRUE; #endif glewResult = glewInit(); if (GLEW_OK != glewResult) { // glewInit failed, something is seriously wrong Ren_Fatal(...
functions
void RE_InitOpenGl(void) { //Clear the screen with a black color thanks Glimp_ClearScreen(); glConfig.driverType = GLDRV_ICD; glConfig.hardwareType = GLHW_GENERIC; // Get extension strings #ifndef FEATURE_RENDERER2 Q_strncpyz(glConfig.extensions_string, ( char * ) glGetString(GL_EXTENSIONS), sizeof(glConfig.e...
functions
void R_DoGLimpShutdown(void) { ri.GLimp_Shutdown(); Com_Memset(&glConfig, 0, sizeof(glConfig)); Com_Memset(&glState, 0, sizeof(glState)); }
functions
QDECL Com_Printf(const char *msg, ...) { va_list argptr; char text[1024]; va_start(argptr, msg); Q_vsnprintf(text, sizeof(text), msg, argptr); va_end(argptr); Ren_Print("%s", text); }
functions
QDECL Com_DPrintf(const char *msg, ...) { va_list argptr; char text[1024]; va_start(argptr, msg); Q_vsnprintf(text, sizeof(text), msg, argptr); va_end(argptr); Ren_Developer("%s", text); }
functions
QDECL Com_Error(int level, const char *error, ...) { va_list argptr; char text[1024]; va_start(argptr, error); Q_vsnprintf(text, sizeof(text), error, argptr); va_end(argptr); ri.Error(level, "%s", text); }
includes
#include <config.h>
includes
#include <stdio.h>
functions
cdk_error_t do_encode_md (byte ** r_frame, size_t * r_flen, const byte * md, int algo, size_t len, unsigned nbits, const byte * asn, size_t asnlen) { byte *frame = NULL; size_t nframe = (nbits + 7) / 8; ssize_t i; size_t n = 0; if (!asn || !md || !r_frame || !r_flen) return CDK_Inv_Value; ...
functions
int _gnutls_get_digest_oid (gnutls_digest_algorithm_t algo, const byte ** data) { switch (algo) { case GNUTLS_DIG_MD5: *data = md5_asn; return sizeof (md5_asn); case GNUTLS_DIG_SHA1: *data = sha1_asn; return sizeof (sha1_asn); case GNUTLS_DIG_RMD160: *data = rmd160_asn; ...
functions
cdk_error_t _cdk_digest_encode_pkcs1 (byte ** r_md, size_t * r_mdlen, int pk_algo, const byte * md, int digest_algo, unsigned nbits) { size_t dlen; if (!md || !r_md || !r_mdlen) return CDK_Inv_Value; dlen = _gnutls_hash_get_algo_len (digest_algo); if (dlen <= 0) return CDK_In...
functions
cdk_error_t cdk_s2k_new (cdk_s2k_t * ret_s2k, int mode, int digest_algo, const byte * salt) { cdk_s2k_t s2k; if (!ret_s2k) return CDK_Inv_Value; if (mode != 0x00 && mode != 0x01 && mode != 0x03) return CDK_Inv_Mode; if (_gnutls_hash_get_algo_len (digest_algo) <= 0) return CDK_Inv_Alg...
functions
void cdk_s2k_free (cdk_s2k_t s2k) { cdk_free (s2k); }
functions
cdk_error_t _cdk_s2k_copy (cdk_s2k_t * r_dst, cdk_s2k_t src) { cdk_s2k_t dst; cdk_error_t err; err = cdk_s2k_new (&dst, src->mode, src->hash_algo, src->salt); if (err) return err; dst->count = src->count; *r_dst = dst; return 0; }
includes
#include <new>
defines
#define MI_FORWARD(fun) __attribute__((alias(#fun), used, visibility("default"), copy(fun)));
defines
#define MI_FORWARD(fun) __attribute__((alias(#fun), used, visibility("default")));
defines
#define MI_FORWARD1(fun,x) MI_FORWARD(fun)
defines
#define MI_FORWARD2(fun,x,y) MI_FORWARD(fun)
defines
#define MI_FORWARD3(fun,x,y,z) MI_FORWARD(fun)
defines
#define MI_FORWARD0(fun,x) MI_FORWARD(fun)
defines
#define MI_FORWARD02(fun,x,y) MI_FORWARD(fun)
defines
#define MI_FORWARD1(fun,x) { return fun(x); }
defines
#define MI_FORWARD2(fun,x,y) { return fun(x,y); }
defines
#define MI_FORWARD3(fun,x,y,z) { return fun(x,y,z); }
defines
#define MI_FORWARD0(fun,x) { fun(x); }
defines
#define MI_FORWARD02(fun,x,y) { fun(x,y); }
defines
#define MI_OSX_IS_INTERPOSED
defines
#define MI_INTERPOSE_FUN(oldfun,newfun) { (const void*)&newfun, (const void*)&oldfun }
defines
#define MI_INTERPOSE_MI(fun) MI_INTERPOSE_FUN(fun,mi_##fun)
structs
struct mi_interpose_s { const void* replacement; const void* target; };
functions
void _ZdlPvSt11align_val_t(void* p, size_t al) { mi_free_aligned(p,al); }
functions
void _ZdaPvSt11align_val_t(void* p, size_t al) { mi_free_aligned(p,al); }
functions
void _ZdlPvmSt11align_val_t(void* p, size_t n, size_t al) { mi_free_size_aligned(p,n,al); }
functions
void _ZdaPvmSt11align_val_t(void* p, size_t n, size_t al) { mi_free_size_aligned(p,n,al); }
functions
void vfree(void* p) { mi_free(p); }
functions
size_t malloc_good_size(size_t size) { return mi_malloc_good_size(size); }
functions
int posix_memalign(void** p, size_t alignment, size_t size) { return mi_posix_memalign(p, alignment, size); }
functions
void cfree(void* p) { mi_free(p); }
functions
int __posix_memalign(void** p, size_t alignment, size_t size) { return mi_posix_memalign(p,alignment,size); }
includes
#include <stdlib.h>
includes
#include <sys/types.h>
includes
#include <boolean.h>
includes
#include <compat/strl.h>
includes
#include <retro_assert.h>
includes
#include <string/stdstring.h>
includes
#include <net/net_http.h>
includes
#include <discord/discord.h>
includes
#include <file/file_path.h>
functions
bool netplay_is_alive(void) { if (!netplay_data) return false; return (netplay_data->is_server) || (!netplay_data->is_server && netplay_data->self_mode >= NETPLAY_CONNECTION_CONNECTED); }
functions
bool netplay_should_skip(netplay_t *netplay) { if (!netplay) return false; return netplay->is_replay && (netplay->self_mode >= NETPLAY_CONNECTION_CONNECTED); }
functions
bool netplay_can_poll(netplay_t *netplay) { if (!netplay) return false; return netplay->can_poll; }
functions
bool get_self_input_state(netplay_t *netplay) { unsigned i; struct delta_frame *ptr = &netplay->buffer[netplay->self_ptr]; netplay_input_state_t istate = NULL; uint32_t devices, used_devices = 0, devi, dev_type, local_device; if (!netplay_delta_frame_ready(netplay, ptr, netplay->self_frame_count)) ...
functions
bool init_netplay_deferred(const char* server, unsigned port) { if (!string_is_empty(server) && port != 0) { strlcpy(server_address_deferred, server, sizeof(server_address_deferred)); server_port_deferred = port; netplay_client_deferred = true; }
functions
bool netplay_poll(void) { int res; uint32_t client; size_t i; netplay_data->can_poll = false; if (!get_self_input_state(netplay_data)) goto catastrophe; /* If we're not connected, we're done */ if (netplay_data->self_mode == NETPLAY_CONNECTION_NONE) return true; /* Read Netplay i...
functions
void input_poll_net(void) { if (!netplay_should_skip(netplay_data) && netplay_can_poll(netplay_data)) netplay_poll(); }
functions
void video_frame_net(const void *data, unsigned width, unsigned height, size_t pitch) { if (!netplay_should_skip(netplay_data)) netplay_data->cbs.frame_cb(data, width, height, pitch); }
functions
void audio_sample_net(int16_t left, int16_t right) { if (!netplay_should_skip(netplay_data) && !netplay_data->stall) netplay_data->cbs.sample_cb(left, right); }
functions
size_t audio_sample_batch_net(const int16_t *data, size_t frames) { if (!netplay_should_skip(netplay_data) && !netplay_data->stall) return netplay_data->cbs.sample_batch_cb(data, frames); return frames; }
functions
int16_t netplay_input_state(netplay_t *netplay, unsigned port, unsigned device, unsigned idx, unsigned id) { size_t ptr = netplay->is_replay ? netplay->replay_ptr : netplay->run_ptr; struct delta_frame *delta; netplay_input_state_t istate; const uint32_t *curr_input_state = NULL; if (...
functions
void netplay_announce_cb(retro_task_t *task, void *task_data, void *user_data, const char *error) { RARCH_LOG("[netplay] announcing netplay game... \n"); if (task_data) { unsigned i, ip_len, port_len; http_transfer_data_t *data = (http_transfer_data_t*)task_data; struct netplay_roo...
functions
HAVE_DISCORD if (discord_is_inited) { discord_userdata_t userdata; userdata.status = DISCORD_PRESENCE_NETPLAY_HOSTING; command_event(CMD_EVENT_DISCORD_UPDATE, &userdata); }
functions
void netplay_get_architecture(char *frontend_architecture, size_t size) { const frontend_ctx_driver_t *frontend = frontend_get_ptr(); enum frontend_architecture arch = frontend_driver_get_cpu_architecture(); char architecture[PATH_MAX_LENGTH]; switch (arch) { case FRONTEND_A...
functions
void netplay_announce(void) { char buf[4600]; char frontend_architecture[PATH_MAX_LENGTH]; char url[2048] = "http://lobby.libretro.com/add/"; char *username = NULL; char *corename = NULL; char *gamename = NULL; char *subsystemn...
functions
int16_t input_state_net(unsigned port, unsigned device, unsigned idx, unsigned id) { if (netplay_is_alive()) return netplay_input_state(netplay_data, port, device, idx, id); return netplay_data->cbs.state_cb(port, device, idx, id); }
functions
bool netplay_command(netplay_t* netplay, struct netplay_connection *connection, enum netplay_cmd cmd, void* data, size_t sz, const char* command_str, const char* success_msg) { retro_assert(netplay); if (!netplay_send_raw_cmd(netplay, connection, cmd, data, sz)) return false; runloop_msg_queue_pu...
functions
void netplay_frontend_paused(netplay_t *netplay, bool paused) { size_t i; uint32_t paused_ct; /* Nothing to do if we already knew this */ if (netplay->local_paused == paused) return; netplay->local_paused = paused; /* Communicating this is a bit odd: If exactly one other connection is * p...
functions
bool netplay_pre_frame(netplay_t *netplay) { bool sync_stalled; settings_t *settings = config_get_ptr(); retro_assert(netplay); if (settings->bools.netplay_public_announce) { reannounce++; if ((netplay->is_server || is_mitm) && (reannounce % 600 == 0)) netplay_announce(); }
functions
void netplay_post_frame(netplay_t *netplay) { size_t i; retro_assert(netplay); netplay_update_unread_ptr(netplay); netplay_sync_post_frame(netplay, false); for (i = 0; i < netplay->connections_size; i++) { struct netplay_connection *connection = &netplay->connections[i]; if (connection->a...
functions
void netplay_force_future(netplay_t *netplay) { /* Wherever we're inputting, that's where we consider our state to be loaded */ netplay->run_ptr = netplay->self_ptr; netplay->run_frame_count = netplay->self_frame_count; /* We need to ignore any intervening data from the other side, * and never rewind p...
functions
void netplay_send_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *serial_info, uint32_t cx, struct compression_transcoder *z) { uint32_t header[4]; uint32_t rd, wn; size_t i; /* Compress it */ z->compression_backend->set_in(z->compression_stream, (const uint8_t*)serial_info->data_c...
functions
void netplay_load_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *serial_info, bool save) { retro_ctx_serialize_info_t tmp_serial_info; netplay_force_future(netplay); /* Record it in our own buffer */ if (save || !serial_info) { if (netplay_delta_frame_ready(netplay, ...
functions
void netplay_core_reset(netplay_t *netplay) { uint32_t cmd[3]; size_t i; /* Ignore past input */ netplay_force_future(netplay); /* Request that our peers reset */ cmd[0] = htonl(NETPLAY_CMD_RESET); cmd[1] = htonl(sizeof(uint32_t)); cmd[2] = htonl(netplay->self_frame_count); for (i = 0; i <...
functions
uint8_t netplay_settings_share_mode(void) { settings_t *settings = config_get_ptr(); uint8_t share_mode = 0; if (settings->uints.netplay_share_digital || settings->uints.netplay_share_analog) { switch (settings->uints.netplay_share_digital) { case RARCH_NETPLAY_SHARE_DIGITAL_O...
functions
void netplay_toggle_play_spectate(netplay_t *netplay) { enum rarch_netplay_connection_mode mode; if (netplay->self_mode == NETPLAY_CONNECTION_PLAYING || netplay->self_mode == NETPLAY_CONNECTION_SLAVE) { /* Switch to spectator mode immediately */ netplay->self_mode = NETPLAY_CONNECTION_SPECT...
functions
else if (netplay->self_mode == NETPLAY_CONNECTION_SPECTATING) { /* Switch only after getting permission */ mode = NETPLAY_CONNECTION_PLAYING; }
functions
bool netplay_disconnect(netplay_t *netplay) { size_t i; if (!netplay) return true; for (i = 0; i < netplay->connections_size; i++) netplay_hangup(netplay, &netplay->connections[i]); deinit_netplay(); #ifdef HAVE_DISCORD if (discord_is_inited) { discord_userdata_t userdata; u...
functions
void deinit_netplay(void) { if (netplay_data) { netplay_free(netplay_data); netplay_enabled = false; netplay_is_client = false; is_mitm = false; }
functions
bool init_netplay(void *direct_host, const char *server, unsigned port) { struct retro_callbacks cbs = {0}
functions
bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data) { bool ret = true; if (in_netplay) return true; in_netplay = true; if (!netplay_data) { switch (state) { case RARCH_NETPLAY_CTL_ENABLE_SERVER: netplay_enabled = true; netplay_is_cl...
includes
#include <ctype.h>
includes
#include <stddef.h>
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
defines
#define lstrlib_c
defines
#define LUA_LIB
defines
#define uchar(c) ((unsigned char)(c))
defines
#define CAP_UNFINISHED (-1)
defines
#define CAP_POSITION (-2)
defines
#define L_ESC '%'