summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/cube2font.c11
-rw-r--r--src/shared/glexts.h9
-rw-r--r--src/shared/iengine.h10
-rw-r--r--src/shared/igame.h5
-rw-r--r--src/shared/stream.cpp18
-rw-r--r--src/shared/tools.h4
-rw-r--r--src/shared/zip.cpp4
7 files changed, 20 insertions, 41 deletions
diff --git a/src/shared/cube2font.c b/src/shared/cube2font.c
index bbd8878..c411862 100644
--- a/src/shared/cube2font.c
+++ b/src/shared/cube2font.c
@@ -530,20 +530,11 @@ int main(int argc, char **argv) {
}
}
if(rh > 0) numtex++;
-#if 0
- if(sw <= 0) {
-
- if(FT_Load_Char(f, ' ', FT_LOAD_DEFAULT))
- fatal("cube2font: failed loading space character");
- sw = (f->glyph->advance.x+0x3F)>>6;
- }
-#endif
if(sh <= 0) sh = y2 - y1;
if(sw <= 0) sw = sh/3;
writetexs(argv[2], chars, numchars, numtex, tw, th);
writecfg(argv[2], chars, numchars, x1, y1, x2, y2, sw, sh, argc, argv);
- for(i = 0; i < numchars; i++) {
-
+ for(i = 0; i < numchars; i++) {
if(chars[i].alpha != chars[i].color) FT_Done_Glyph((FT_Glyph)chars[i].alpha);
FT_Done_Glyph((FT_Glyph)chars[i].color);
}
diff --git a/src/shared/glexts.h b/src/shared/glexts.h
index edc9e04..8d33921 100644
--- a/src/shared/glexts.h
+++ b/src/shared/glexts.h
@@ -359,12 +359,3 @@ extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray_;
extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays_;
extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays_;
extern PFNGLISVERTEXARRAYPROC glIsVertexArray_;
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#endif
diff --git a/src/shared/iengine.h b/src/shared/iengine.h
index 3c52e1e..58698ab 100644
--- a/src/shared/iengine.h
+++ b/src/shared/iengine.h
@@ -26,7 +26,7 @@ enum { // cube empty-space materials {
};
extern void lightent(extentity &e, float height = 8.0f);
-extern void lightreaching(const vec &target, vec &color, vec &dir, bool fast = false, extentity *e = 0, float ambient = 0.4f);
+extern void lightreaching(const vec &target, vec &color, vec &dir, extentity *e = 0, float ambient = 0.4f);
extern entity *brightestlight(const vec &target, const vec &dir);
enum { RAY_BB = 1, RAY_POLY = 3, RAY_ALPHAPOLY = 7, RAY_ENTS = 9, RAY_CLIPMAT = 16, RAY_SKIPFIRST = 32, RAY_EDITMAT = 64, RAY_SHADOW = 128, RAY_PASS = 256 };
@@ -259,10 +259,6 @@ enum {
DL_FLASH = 1<<2
};
-extern void adddynlight(const vec &o, float radius, const vec &color, int fade = 0, int peak = 0, int flags = 0, float initradius = 0, const vec &initcolor = vec(0, 0, 0), physent *owner = NULL);
-extern void dynlightreaching(const vec &target, vec &color, vec &dir, bool hud = false);
-extern void removetrackeddynlights(physent *owner = NULL);
-
// rendergl
extern physent *camera1;
extern vec worldpos, camdir, camright, camup;
@@ -363,8 +359,8 @@ enum {
SND_USE_ALT = 1<<2
};
-extern int playsound(int n, const vec *loc = NULL, extentity *ent = NULL, int flags = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
-extern int playsoundname(const char *s, const vec *loc = NULL, int vol = 0, int flags = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
+extern int playsound(int n, const vec *loc = NULL, extentity *ent = NULL, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
+extern int playsoundname(const char *s, const vec *loc = NULL, int vol = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
extern void preloadsound(int n);
extern void preloadmapsound(int n);
extern bool stopsound(int n, int chanid, int fade = 0);
diff --git a/src/shared/igame.h b/src/shared/igame.h
index 4b0e933..bb69eb9 100644
--- a/src/shared/igame.h
+++ b/src/shared/igame.h
@@ -14,10 +14,9 @@ namespace entities {
}
namespace game {
+ extern string connectpass;
extern void gamedisconnect(bool cleanup);
extern void parsepacketclient(int chan, packetbuf &p);
- extern void connectattempt(const char *name, const char *password, const ENetAddress &address);
- extern void connectfail();
extern void gameconnect(bool _remote);
extern bool allowedittoggle();
extern void edittoggled(bool on);
@@ -66,9 +65,7 @@ namespace game {
extern bool allowthirdperson(bool msg = false);
extern bool detachcamera();
extern bool collidecamera();
- extern void adddynlights();
extern void particletrack(physent *owner, vec &o, vec &d);
- extern void dynlighttrack(physent *owner, vec &o, vec &hud);
extern int maxsoundradius(int n);
extern bool serverinfostartcolumn(g3d_gui *g, int i);
extern void serverinfoendcolumn(g3d_gui *g, int i);
diff --git a/src/shared/stream.cpp b/src/shared/stream.cpp
index 3a5c6e2..1bb98ff 100644
--- a/src/shared/stream.cpp
+++ b/src/shared/stream.cpp
@@ -298,9 +298,13 @@ char *path(char *s) {
char *path(const char *s, bool copy) {
static string tmp;
- copystring(tmp, s);
- path(tmp);
- return tmp;
+ if (copy) {
+ copystring(tmp, s);
+ path(tmp);
+ return tmp;
+ } else {
+ return (char *) s;
+ }
}
const char *parentdir(const char *directory) {
@@ -406,6 +410,7 @@ static size_t rwopswrite(SDL_RWops *rw, const void *buf, size_t size, size_t nme
}
static int rwopsclose(SDL_RWops *rw) {
+ (void) rw;
return 0;
}
@@ -465,7 +470,7 @@ struct filestream : stream {
file = fopen(name, mode);
return file!=NULL;
}
- bool opentemp(const char *name, const char *mode) {
+ bool opentemp() {
if(file) return false;
file = tmpfile();
return file!=NULL;
@@ -854,10 +859,9 @@ stream *openfile(const char *filename, const char *mode) {
return openrawfile(filename, mode);
}
-stream *opentempfile(const char *name, const char *mode) {
- const char *found = findfile(name, mode);
+stream *opentempfile() {
filestream *file = new filestream;
- if(!file->opentemp(found ? found : name, mode)) { delete file; return NULL; }
+ if(!file->opentemp()) { delete file; return NULL; }
return file;
}
diff --git a/src/shared/tools.h b/src/shared/tools.h
index 6e7eeab..44be57d 100644
--- a/src/shared/tools.h
+++ b/src/shared/tools.h
@@ -758,7 +758,7 @@ template<class T> struct hashnameset : hashbase<hashnameset<T>, T, const char *,
template<class U> static inline const char *getkey(const U &elem) { return elem.name; }
template<class U> static inline const char *getkey(U *elem) { return elem->name; }
static inline T &getdata(T &elem) { return elem; }
- template<class K> static inline void setkey(T &elem, const K &key) {}
+ template<class K> static inline void setkey(T &, const K &) {}
template<class V>
T &add(const V &elem) {
return basetype::access(getkey(elem), elem);
@@ -1023,7 +1023,7 @@ extern bool findzipfile(const char *filename);
extern stream *openrawfile(const char *filename, const char *mode);
extern stream *openzipfile(const char *filename, const char *mode);
extern stream *openfile(const char *filename, const char *mode);
-extern stream *opentempfile(const char *filename, const char *mode);
+extern stream *opentempfile();
extern stream *opengzfile(const char *filename, const char *mode, stream *file = NULL, int level = Z_BEST_COMPRESSION);
extern stream *openutf8file(const char *filename, const char *mode, stream *file = NULL);
extern char *loadfile(const char *fn, size_t *size, bool utf8 = true);
diff --git a/src/shared/zip.cpp b/src/shared/zip.cpp
index 98ac8fb..d3b7e21 100644
--- a/src/shared/zip.cpp
+++ b/src/shared/zip.cpp
@@ -88,7 +88,7 @@ static bool findzipdirectory(FILE *f, zipdirectoryheader &hdr) {
return true;
}
-static bool readzipdirectory(const char *archname, FILE *f, int entries, int offset, uint size, vector<zipfile> &files) {
+static bool readzipdirectory(FILE *f, int entries, int offset, uint size, vector<zipfile> &files) {
uchar *buf = new (false) uchar[size], *src = buf;
if(!buf || fseek(f, offset, SEEK_SET) < 0 || fread(buf, 1, size, f) != size) { delete[] buf; return false; }
loopi(entries) {
@@ -230,7 +230,7 @@ bool addzip(const char *name, const char *mount = NULL, const char *strip = NULL
}
zipdirectoryheader h;
vector<zipfile> files;
- if(!findzipdirectory(f, h) || !readzipdirectory(pname, f, h.entries, h.offset, h.size, files)) {
+ if(!findzipdirectory(f, h) || !readzipdirectory(f, h.entries, h.offset, h.size, files)) {
conoutf(CON_ERROR, "could not read directory in zip %s", pname);
fclose(f);
return false;