playdemo should now play older protocol versions.

some more tweaks for xonotic
rcon-over-xmpp, because I can. Server might see your rcon password, so watch out for that.
qcc tweaks.
updated q1qvm api stuff to api version 15.
android port updated. egl now handled by native code, which means we now have proper control over everything and can default to gles2. requires android 2.0+. vulkan-on-android renderer added, but not tested.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5153 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-10-12 12:02:25 +00:00
parent 8e44dde063
commit 696c7e8260
50 changed files with 4017 additions and 1879 deletions

View file

@ -109,8 +109,8 @@ static struct
qboolean triedlib;
dllhandle_t lib;
lua_State * (QDECL *newstate) (lua_Alloc f, void *ud);
lua_CFunction (QDECL *atpanic) (lua_State *L, lua_CFunction panicf);
lua_State * (QDECL *newstate) (lua_Alloc f, void *ud);
lua_CFunction (QDECL *atpanic) (lua_State *L, lua_CFunction panicf);
void (QDECL *close) (lua_State *L);
int (QDECL *load) (lua_State *L, lua_Reader reader, void *dt, const char *chunkname, const char *mode);
int (QDECL *pcallk) (lua_State *L, int nargs, int nresults, int errfunc, int ctx, lua_CFunction k);
@ -150,22 +150,22 @@ static struct
int (QDECL *Lcallmeta) (lua_State *L, int obj, const char *e);
int (QDECL *Lnewmetatable) (lua_State *L, const char *tname);
} lua;
} lua;
#define pcall(L,n,r,f) pcallk(L, (n), (r), (f), 0, NULL)
#define call(L,n,r) callk(L, (n), (r), 0, NULL)
#define pop(L,n) settop(L, -(n)-1)
#define pushstring(L,s) pushfstring(L,"%s",s)
#define LUA_TNONE (-1)
#define LUA_TNIL 0
#define LUA_TBOOLEAN 1
#define LUA_TLIGHTUSERDATA 2
#define LUA_TNUMBER 3
#define LUA_TSTRING 4
#define LUA_TTABLE 5
#define LUA_TFUNCTION 6
#define LUA_TUSERDATA 7
#define LUA_TTHREAD 8
#define LUA_TNONE (-1)
#define LUA_TNIL 0
#define LUA_TBOOLEAN 1
#define LUA_TLIGHTUSERDATA 2
#define LUA_TNUMBER 3
#define LUA_TSTRING 4
#define LUA_TTABLE 5
#define LUA_TFUNCTION 6
#define LUA_TUSERDATA 7
#define LUA_TTHREAD 8
#define LUA_NUMTAGS 9
#define LUA_REGISTRYINDEX (-1000000 - 1000)
@ -506,13 +506,13 @@ static int my_lua_entity_get(lua_State *L) //__index
lua.pushinteger(L, eval->_int);
return 1;
case ev_vector:
lua.createtable(L, 0, 0);
//FIXME: should provide a metatable with a __tostring
lua.pushnumber(L, eval->_vector[0]);
lua.setfield (L, -2, "x");
lua.pushnumber(L, eval->_vector[1]);
lua.setfield (L, -2, "y");
lua.pushnumber(L, eval->_vector[2]);
lua.createtable(L, 0, 0);
//FIXME: should provide a metatable with a __tostring
lua.pushnumber(L, eval->_vector[0]);
lua.setfield (L, -2, "x");
lua.pushnumber(L, eval->_vector[1]);
lua.setfield (L, -2, "y");
lua.pushnumber(L, eval->_vector[2]);
lua.setfield (L, -2, "z");
return 1;
case ev_function:
@ -1147,13 +1147,13 @@ static int bi_lua_vectoangles(lua_State *L)
}
VectorAngles(forward, up, ret);
lua.createtable(L, 0, 0);
//FIXME: should provide a metatable with a __tostring
lua.pushnumber(L, ret[0]);
lua.setfield (L, -2, "x");
lua.pushnumber(L, ret[1]);
lua.setfield (L, -2, "y");
lua.pushnumber(L, ret[2]);
lua.createtable(L, 0, 0);
//FIXME: should provide a metatable with a __tostring
lua.pushnumber(L, ret[0]);
lua.setfield (L, -2, "x");
lua.pushnumber(L, ret[1]);
lua.setfield (L, -2, "y");
lua.pushnumber(L, ret[2]);
lua.setfield (L, -2, "z");
return 1;
}
@ -1509,35 +1509,35 @@ static int bi_lua_loadlua(lua_State *L)
#define registerfunc(n) lua.pushcclosure(L, bi_lua_##n, 0); lua.setglobal(L, #n);
static void my_lua_registerbuiltins(lua_State *L)
{
lua.atpanic (L, my_lua_panic);
//standard lua library replacement
//this avoids the risk of including any way to access os.execute etc, or other file access.
lua.pushcclosure(L, my_lua_tostring, 0);
lua.setglobal(L, "tostring");
lua.pushcclosure(L, my_lua_print, 0);
lua.setglobal(L, "print");
lua.pushcclosure(L, my_lua_conprint, 0); //for the luls.
lua.setglobal(L, "conprint");
registerfunc(loadlua);
registerfunc(setmodel);
registerfunc(precache_model);
registerfunc(precache_sound);
registerfunc(lightstyle);
registerfunc(spawn);
registerfunc(remove);
{
lua.atpanic (L, my_lua_panic);
//standard lua library replacement
//this avoids the risk of including any way to access os.execute etc, or other file access.
lua.pushcclosure(L, my_lua_tostring, 0);
lua.setglobal(L, "tostring");
lua.pushcclosure(L, my_lua_print, 0);
lua.setglobal(L, "print");
lua.pushcclosure(L, my_lua_conprint, 0); //for the luls.
lua.setglobal(L, "conprint");
registerfunc(loadlua);
registerfunc(setmodel);
registerfunc(precache_model);
registerfunc(precache_sound);
registerfunc(lightstyle);
registerfunc(spawn);
registerfunc(remove);
registerfunc(nextent);
registerfunc(nextclient);
//registerfunc(AIM);
registerfunc(makestatic);
registerfunc(setorigin);
registerfunc(setsize);
registerfunc(dprint);
registerfunc(makestatic);
registerfunc(setorigin);
registerfunc(setsize);
registerfunc(dprint);
registerfunc(bprint);
registerfunc(sprint);
registerfunc(centerprint);
@ -1602,20 +1602,20 @@ static void my_lua_registerbuiltins(lua_State *L)
//registerfunc(PRECACHE_VWEP_MODEL);
//registerfunc(SETPAUSE);
lua.createtable(L, 0, 0);
if (lua.Lnewmetatable(L, "globals"))
{
lua.pushcclosure(L, my_lua_global_set, 0); //for the luls.
lua.setfield (L, -2, "__newindex");
lua.pushcclosure(L, my_lua_global_get, 0); //for the luls.
lua.setfield (L, -2, "__index");
}
lua.setmetatable(L, -2);
lua.setglobal(L, "glob");
lua.createtable(L, 0, 0);
if (lua.Lnewmetatable(L, "globals"))
{
lua.pushcclosure(L, my_lua_global_set, 0); //for the luls.
lua.setfield (L, -2, "__newindex");
lua.pushcclosure(L, my_lua_global_get, 0); //for the luls.
lua.setfield (L, -2, "__index");
}
lua.setmetatable(L, -2);
lua.setglobal(L, "glob");
}
@ -1692,21 +1692,21 @@ static edict_t *Lua_DoRespawn(pubprogfuncs_t *pf, edict_t *e, int num)
//create a new table for the entity, give it a suitable metatable, and store it into the registry (avoiding GC and allowing us to actually hold on to it).
lua.pushlightuserdata(L, lua.edicttable[num]);
lua.createtable(L, 0, 0);
if (lua.Lnewmetatable(L, "entity"))
{
lua.pushcclosure(L, my_lua_entity_set, 0); //known writes should change the internal info so the engine can use the information.
lua.setfield (L, -2, "__newindex");
lua.pushcclosure(L, my_lua_entity_get, 0); //we need to de-translate the engine's fields too.
lua.setfield (L, -2, "__index");
lua.pushcclosure(L, my_lua_entity_tostring, 0); //cos its prettier than seeing 'table 0x5425729' all over the place
lua.setfield (L, -2, "__tostring");
lua.pushcclosure(L, my_lua_entity_eq, 0); //for comparisons, you know?
lua.setfield (L, -2, "__eq");
}
lua.createtable(L, 0, 0);
if (lua.Lnewmetatable(L, "entity"))
{
lua.pushcclosure(L, my_lua_entity_set, 0); //known writes should change the internal info so the engine can use the information.
lua.setfield (L, -2, "__newindex");
lua.pushcclosure(L, my_lua_entity_get, 0); //we need to de-translate the engine's fields too.
lua.setfield (L, -2, "__index");
lua.pushcclosure(L, my_lua_entity_tostring, 0); //cos its prettier than seeing 'table 0x5425729' all over the place
lua.setfield (L, -2, "__tostring");
lua.pushcclosure(L, my_lua_entity_eq, 0); //for comparisons, you know?
lua.setfield (L, -2, "__eq");
}
lua.setmetatable(L, -2);
lua.pushinteger(L, num);
lua.setfield (L, -2, "entnum"); //so we know which entity it is.