Pull in some fixes from upstream (but not too many :)
This commit is contained in:
Jonas Kulla 2015-08-03 04:10:13 +02:00
commit 213ee81f1c
19 changed files with 32 additions and 444 deletions

View file

@ -236,7 +236,6 @@ void ALStream::openSource(const std::string &filename)
char buf[512];
snprintf(buf, sizeof(buf), "Unable to decode audio stream: %s.%s: %s",
filename.c_str(), ext, e.msg.c_str());
buf[sizeof(buf)-1] = '\0';
Debug() << buf;
}

View file

@ -28,6 +28,8 @@
#include <SDL_thread.h>
#include <SDL_touch.h>
#include <al.h>
#include <alc.h>
#include <alext.h>
#include "sharedstate.h"

View file

@ -611,7 +611,6 @@ static void fontSetEnumCB(void *data, const char *,
char filename[512];
snprintf(filename, sizeof(filename), "Fonts/%s", fname);
filename[sizeof(filename)-1] = '\0';
PHYSFS_File *handle = PHYSFS_openRead(filename);

View file

@ -175,9 +175,9 @@ void blitSource(TEXFBO &source)
}
}
void blitRectangle(const IntRect &src, const Vec2i &dstPos, bool smooth)
void blitRectangle(const IntRect &src, const Vec2i &dstPos)
{
blitRectangle(src, IntRect(dstPos.x, dstPos.y, src.w, src.h), smooth);
blitRectangle(src, IntRect(dstPos.x, dstPos.y, src.w, src.h), false);
}
void blitRectangle(const IntRect &src, const IntRect &dst, bool smooth)

View file

@ -68,8 +68,7 @@ void vaoUnbind(VAO &vao);
void blitBegin(TEXFBO &target);
void blitBeginScreen(const Vec2i &size);
void blitSource(TEXFBO &source);
void blitRectangle(const IntRect &src, const Vec2i &dstPos,
bool smooth = false);
void blitRectangle(const IntRect &src, const Vec2i &dstPos);
void blitRectangle(const IntRect &src, const IntRect &dst,
bool smooth = false);
void blitEnd();

View file

@ -174,7 +174,12 @@ public:
const IntRect &viewpRect = glState.scissorBox.get();
const IntRect &screenRect = geometry.rect;
if (t.w != 0.0)
bool toneRGBEffect = t.xyzHasEffect();
bool toneGrayEffect = t.w != 0;
bool colorEffect = c.w > 0;
bool flashEffect = f.w > 0;
if (toneGrayEffect)
{
pp.swapRender();
@ -206,19 +211,14 @@ public:
glState.blend.pop();
}
bool toneEffect = t.xyzHasEffect();
bool colorEffect = c.xyzHasEffect();
bool flashEffect = f.xyzHasEffect();
if (!toneEffect && !colorEffect && !flashEffect)
if (!toneRGBEffect && !colorEffect && !flashEffect)
return;
FlatColorShader &shader = shState->shaders().flatColor;
shader.bind();
shader.applyViewportProj();
/* Apply tone */
if (toneEffect)
if (toneRGBEffect)
{
/* First split up additive / substractive components */
Vec4 add, sub;
@ -722,7 +722,7 @@ void Graphics::transition(int duration,
return;
vague = clamp(vague, 1, 256);
Bitmap *transMap = filename ? new Bitmap(filename) : 0;
Bitmap *transMap = *filename ? new Bitmap(filename) : 0;
setBrightness(255);

View file

@ -37,7 +37,7 @@ public:
void update();
void freeze();
void transition(int duration = 8,
const char *filename = 0,
const char *filename = "",
int vague = 40);
void frameReset();

View file

@ -44,7 +44,7 @@ int __sdlThreadFun(void *obj)
template<class C, void (C::*func)()>
SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string())
{
return SDL_CreateThread(__sdlThreadFun<C, func>, name.c_str(), obj);
return SDL_CreateThread((__sdlThreadFun<C, func>), name.c_str(), obj);
}
/* On Android, SDL_RWFromFile always opens files from inside

View file

@ -533,7 +533,6 @@ struct SettingsMenuPrivate
{
char buf[64];
snprintf(buf, sizeof(buf), "Press key or joystick button for \"%s\"", captureName);
buf[sizeof(buf)-1] = '\0';
drawOff = Vec2i();

View file

@ -213,7 +213,6 @@ SoundBuffer *SoundEmitter::allocateBuffer(const std::string &filename)
char buf[512];
snprintf(buf, sizeof(buf), "Unable to decode sound: %s.%s: %s",
filename.c_str(), ext, Sound_GetError());
buf[sizeof(buf)-1] = '\0';
Debug() << buf;
return 0;

View file

@ -607,7 +607,12 @@ static void
readLayer(Reader &reader, const Table &data,
const Table *flags, int ox, int oy, int w, int h, int z)
{
for (int y = 0; y < h; ++y)
/* The table autotile pattern (A2) has two quads (table
* legs, etc.) which extend over the tile below. We process
* the tiles in rows from bottom to top so the table extents
* are added after the tile below and drawn over it. */
for (int y = h-1; y >= 0; --y)
for (int x = 0; x < w; ++x)
{
int16_t tileID = tableGetWrapped(data, x+ox, y+oy, z);

View file

@ -25,6 +25,7 @@
#define OV_EXCLUDE_STATIC_CALLBACKS
#include <vorbis/vorbisfile.h>
#include <vector>
#include <algorithm>
static size_t vfRead(void *ptr, size_t size, size_t nmemb, void *ops)
{