diff --git a/source/enet/include/enet/enet.h b/source/enet/include/enet/enet.h index cfbd01f5..4a7295ec 100755 --- a/source/enet/include/enet/enet.h +++ b/source/enet/include/enet/enet.h @@ -423,7 +423,7 @@ ENET_API int enet_address_get_host (const ENetAddress * address, char * hostName ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32); ENET_API void enet_packet_destroy (ENetPacket *); ENET_API int enet_packet_resize (ENetPacket *, size_t); -extern enet_uint32 enet_crc32 (const ENetBuffer *, size_t); +ENET_API enet_uint32 enet_crc32 (const ENetBuffer *, size_t); ENET_API ENetHost * enet_host_create (const ENetAddress *, size_t, enet_uint32, enet_uint32); ENET_API void enet_host_destroy (ENetHost *); diff --git a/source/src/main.cpp b/source/src/main.cpp index f9f4ce4e..6f5e86e7 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -229,7 +229,9 @@ int main(int argc, char **argv) SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa); } +#if SDL_VERSION_ATLEAST(1, 2, 11) if(vsync>=0) SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, vsync); +#endif int resize = SDL_RESIZABLE; #if defined(WIN32) || defined(__APPLE__) diff --git a/source/src/md2.h b/source/src/md2.h index 390e76b4..8cfca80a 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -218,7 +218,7 @@ struct md2 : vertmodel if(!mdl.load(path(name1))) { delete[] pname; return false; } } Texture *skin; - loadskin(loadname, pname, skin, this); + loadskin(loadname, pname, skin); loopv(mdl.meshes) mdl.meshes[i]->skin = skin; if(skin==crosshair) conoutf("could not load model skin for %s", name1); loadingmd2 = this; diff --git a/source/src/md3.h b/source/src/md3.h index 604b76c2..bfa1291d 100644 --- a/source/src/md3.h +++ b/source/src/md3.h @@ -186,7 +186,7 @@ struct md3 : vertmodel s_sprintfd(cfgname)("packages/models/%s/md3.cfg", loadname); loadingmd3 = this; - if(execfile(cfgname)) // configured md3, will call the md3* commands below + if(execfile(cfgname) && parts.length()) // configured md3, will call the md3* commands below { delete[] pname; loadingmd3 = NULL; @@ -207,7 +207,7 @@ struct md3 : vertmodel if(!mdl.load(path(name1))) { delete[] pname; return false; }; }; Texture *skin; - loadskin(loadname, pname, skin, this); + loadskin(loadname, pname, skin); loopv(mdl.meshes) mdl.meshes[i]->skin = skin; if(skin==crosshair) conoutf("could not load model skin for %s", name1); } @@ -236,7 +236,7 @@ void md3skin(char *objname, char *skin) loopv(mdl.meshes) { md3::mesh &m = *mdl.meshes[i]; - if(!strcmp(m.name, objname)) + if(!strcmp(objname, "*") || !strcmp(m.name, objname)) { s_sprintfd(spath)("%s/%s", md3dir, skin); m.skin = textureload(spath); @@ -255,8 +255,8 @@ void md3anim(char *anim, char *startframe, char *range, char *speed) void md3link(char *parentno, char *childno, char *tagname) { if(!loadingmd3) { conoutf("not loading an md3"); return; }; - int parent = atoi(parentno), child = atoi(childno); - if(max(parent, child) >= loadingmd3->parts.length() || min(parent, child) < 0) { conoutf("no models loaded to link"); return; }; + int parent = ATOI(parentno), child = ATOI(childno); + if(!loadingmd3->parts.inrange(parent) || !loadingmd3->parts.inrange(child)) { conoutf("no models loaded to link"); return; } if(!loadingmd3->parts[parent]->link(loadingmd3->parts[child], tagname)) conoutf("could not link model %s", loadingmd3->loadname); } diff --git a/source/src/protos.h b/source/src/protos.h index 8e49d98a..efe879ea 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -271,7 +271,7 @@ extern void rendershadow(playerent *d); extern void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, float z, float yaw, float pitch, float speed = 0, int basetime = 0, playerent *d = NULL, char *vwepmdl = NULL, float scale = 1.0f); extern mapmodelinfo &getmminfo(int i); extern int findanim(const char *name); -extern void loadskin(const char *dir, const char *altdir, Texture *&skin, model *m); +extern void loadskin(const char *dir, const char *altdir, Texture *&skin); extern model *loadmodel(const char *name, int i = -1); extern void preload_playermodels(); extern void preload_entmodels(); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index c18732cf..f62d7c90 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -153,7 +153,7 @@ int findanim(const char *name) return -1; } -void loadskin(const char *dir, const char *altdir, Texture *&skin, model *m) // model skin sharing +void loadskin(const char *dir, const char *altdir, Texture *&skin) // model skin sharing { #define ifnoload if((skin = textureload(path))==crosshair) s_sprintfd(path)("packages/models/%s/skin.jpg", dir);