avoid global zlib.h include

master
Daniel Kolesa 2020-07-30 04:28:27 +02:00
parent 085e61148f
commit fca0057334
13 changed files with 25 additions and 5 deletions

View File

@ -4,6 +4,7 @@
#include "command.hh"
#include <cctype>
#include <climits>
#include <sauerlib/encoding.hh>

View File

@ -3,6 +3,7 @@
#include "octa.hh"
#include <cassert>
#include <climits>
#include <shared/command.hh>
#include <shared/igame.hh>

View File

@ -2,6 +2,8 @@
#include <new>
#include <zlib.h>
#include <shared/command.hh>
#include <shared/glemu.hh>
#include <shared/igame.hh>

View File

@ -1,5 +1,7 @@
#include "pvs.hh"
#include <climits>
#include <shared/command.hh>
#include "console.hh" /* conoutf */

View File

@ -1,5 +1,7 @@
#include "renderlights.hh"
#include <climits>
#include <shared/command.hh>
#include <shared/glemu.hh>
#include <shared/igame.hh>

View File

@ -1,5 +1,7 @@
#include "rendermodel.hh"
#include <climits>
#include <new>
#include <sauerlib/encoding.hh>

View File

@ -2,6 +2,8 @@
#include "renderva.hh"
#include <climits>
#include <shared/command.hh>
#include <shared/glemu.hh>
#include <shared/igame.hh>

View File

@ -2,6 +2,8 @@
#include "shader.hh"
#include <climits>
#include <sauerlib/encoding.hh>
#include <shared/command.hh>

View File

@ -1,6 +1,8 @@
#ifndef ENGINE_SHADER_HH
#define ENGINE_SHADER_HH
#include <climits>
#include <shared/glexts.hh>
#include <shared/tools.hh>
#include <shared/geom.hh>

View File

@ -4,6 +4,8 @@
#include <ctime>
#include <zlib.h>
#include <sauerlib/encoding.hh>
#include <shared/command.hh>

View File

@ -6,13 +6,12 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdarg>
#include <cmath>
#include <cassert>
#include <new>
#include <zlib.h>
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
@ -1243,7 +1242,7 @@ 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 *opengzfile(const char *filename, const char *mode, stream *file = nullptr, int level = Z_BEST_COMPRESSION);
extern stream *opengzfile(const char *filename, const char *mode, stream *file = nullptr);
extern stream *openutf8file(const char *filename, const char *mode, stream *file = nullptr);
extern char *loadfile(const char *fn, size_t *size, bool utf8 = true);
extern bool listdir(const char *dir, bool rel, const char *ext, vector<char *> &files);

View File

@ -1,6 +1,7 @@
#include <new>
#include <SDL.h>
#include <zlib.h>
#include <sauerlib/encoding.hh>
@ -1201,12 +1202,12 @@ stream *opentempfile(const char *name, const char *mode)
return file;
}
stream *opengzfile(const char *filename, const char *mode, stream *file, int level)
stream *opengzfile(const char *filename, const char *mode, stream *file)
{
stream *source = file ? file : openfile(filename, mode);
if(!source) return nullptr;
gzstream *gz = new gzstream;
if(!gz->open(source, mode, !file, level)) { if(!file) delete source; delete gz; return nullptr; }
if(!gz->open(source, mode, !file, Z_BEST_COMPRESSION)) { if(!file) delete source; delete gz; return nullptr; }
return gz;
}

View File

@ -1,5 +1,7 @@
#include <new>
#include <zlib.h>
#include "command.hh"
#include <engine/console.hh> /* conoutf */