Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 4696 → Rev 4697

/polymer/eduke32/build/include/baselayer.h
89,8 → 89,8
#define NUMKEYS 256
#define KEYSTATUSSIZ 256
#define KEYFIFOSIZ 64
extern char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
extern char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
extern char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyasciififo[KEYFIFOSIZ];
extern uint8_t keyasciififoplc, keyasciififoend, keyfifoplc, keyfifoend;
extern char scantoasc[128], remap[KEYSTATUSSIZ], key_names[NUMKEYS][24];
extern int32_t remapinit;
 
/polymer/eduke32/build/include/compat.h
44,10 → 44,12
# define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
 
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) x=x
#ifdef UNREFERENCED_PARAMETER
#undef UNREFERENCED_PARAMETER
#endif
 
#define UNREFERENCED_PARAMETER(x) x = x
 
#if defined __GNUC__ || defined __clang__
# define ATTRIBUTE(attrlist) __attribute__(attrlist)
#else
582,7 → 584,15
# define Bcalloc calloc
# define Brealloc realloc
# define Bfree free
#ifdef __cplusplus
# define Bstrdup _strdup
# define Bchdir _chdir
# define Bgetcwd _getcwd
#else
# define Bstrdup strdup
# define Bchdir chdir
# define Bgetcwd getcwd
#endif
# define Bmemalign memalign
# define Bopen open
# define Bclose close
680,7 → 690,6
# define Bvsnprintf vsnprintf
# endif
# define Bvfprintf vfprintf
# define Bgetcwd getcwd
# define Bgetenv getenv
# define Btime() time(NULL)
# define Butime utime
/polymer/eduke32/build/src/baselayer.c
10,8 → 10,8
 
// input
char inputdevices=0;
char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend;
char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend;
char keystatus[KEYSTATUSSIZ], keyfifo[KEYFIFOSIZ], keyasciififo[KEYFIFOSIZ];
uint8_t keyfifoplc, keyfifoend, keyasciififoplc, keyasciififoend;
char remap[KEYSTATUSSIZ];
int32_t remapinit=0;
char key_names[NUMKEYS][24];
/polymer/eduke32/build/src/build.c
10695,7 → 10695,7
if ((program_origcwd[0] == '\0') || !getcwd(current_cwd, BMAX_PATH))
current_cwd[0] = '\0';
else // Before we check if file exists, for the case there's no absolute path.
chdir(program_origcwd);
Bchdir(program_origcwd);
 
fp = fopen(game_executable, "rb"); // File exists?
if (fp != NULL)
10719,7 → 10719,7
}
 
if (current_cwd[0] != '\0') // Temporarily changing back,
chdir(current_cwd); // after checking if file exists.
Bchdir(current_cwd); // after checking if file exists.
 
if (testplay_addparam)
slen = Bstrlen(testplay_addparam);
10765,10 → 10765,10
#else
if (current_cwd[0] != '\0')
{
chdir(program_origcwd);
Bchdir(program_origcwd);
if (system(fullparam))
message("Error launching the game!");
chdir(current_cwd);
Bchdir(current_cwd);
}
else system(fullparam);
#endif
/polymer/eduke32/build/src/compat.c
97,7 → 97,7
 
void Bfree(void *ptr)
{
free(ptr);
Bfree(ptr);
}
 
int32_t Bopen(const char *pathname, int32_t flags, uint32_t mode)
/polymer/eduke32/build/src/lz4.c
157,11 → 157,12
/**************************************
Memory routines
**************************************/
#include "compat.h"
#include <stdlib.h> /* malloc, calloc, free */
#define ALLOCATOR(n,s) calloc(n,s)
#define FREEMEM free
#define ALLOCATOR(n,s) Xcalloc(n,s)
#define FREEMEM Bfree
#include <string.h> /* memset, memcpy */
#define MEM_INIT memset
#define MEM_INIT Bmemset
 
 
/**************************************
/polymer/eduke32/source/common.c
352,7 → 352,7
else asperr = -1;
}
if (asperr == 0)
chdir(cwd);
Bchdir(cwd);
Bfree(homedir);
}
}
/polymer/eduke32/source/game.c
11021,15 → 11021,15
 
if (g_modDir[0] != '/' && (cwd = getcwd(NULL, 0)))
{
chdir(g_modDir);
Bchdir(g_modDir);
if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
{
chdir(cwd);
Bchdir(cwd);
if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
G_GameExit("Failed loading art.");
}
chdir(cwd);
free(cwd);
Bchdir(cwd);
Bfree(cwd);
}
else if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0)
G_GameExit("Failed loading art.");