mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-15 22:16:37 +02:00
* compile fixes & minor changes (I hope they are correct, SComponent::setSurface didn't return any value and failed to compile - I'm not sure if I return proper value).
This commit is contained in:
parent
d732565002
commit
6ebfe25f86
@ -944,6 +944,7 @@ SDL_Surface * SComponent::setSurface(std:: string defname, int imagepos)
|
|||||||
img = def->ourImages[imagepos].bitmap;
|
img = def->ourImages[imagepos].bitmap;
|
||||||
img->refcount++;//to preserve surface whed def is deleted
|
img->refcount++;//to preserve surface whed def is deleted
|
||||||
delete def;
|
delete def;
|
||||||
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SComponent::show(SDL_Surface * to)
|
void SComponent::show(SDL_Surface * to)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef __GRAPHICS_H__
|
#ifndef __GRAPHICS_H__
|
||||||
#define __GRAPHICS_H__
|
#define __GRAPHICS_H__
|
||||||
|
|
||||||
#include <SDL_ttf.h>
|
|
||||||
#include "../global.h"
|
#include "../global.h"
|
||||||
#include "FontBase.h"
|
#include "FontBase.h"
|
||||||
#include "GUIBase.h"
|
#include "GUIBase.h"
|
||||||
@ -25,6 +24,7 @@ class CHeroClass;
|
|||||||
struct SDL_Color;
|
struct SDL_Color;
|
||||||
struct InfoAboutHero;
|
struct InfoAboutHero;
|
||||||
struct InfoAboutTown;
|
struct InfoAboutTown;
|
||||||
|
typedef struct _TTF_Font TTF_Font; //from SDL_ttf.h
|
||||||
|
|
||||||
class Graphics
|
class Graphics
|
||||||
{
|
{
|
||||||
|
@ -4409,7 +4409,7 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
|
|||||||
{
|
{
|
||||||
int was = n.res[player][i];
|
int was = n.res[player][i];
|
||||||
n.res[player][i] += ev->resources[i];
|
n.res[player][i] += ev->resources[i];
|
||||||
n.res[player][i] = std::max(n.res[player][i], 0);
|
n.res[player][i] = std::max<si32>(n.res[player][i], 0);
|
||||||
|
|
||||||
if(pinfo->resources[i] != n.res[player][i]) //if non-zero res change
|
if(pinfo->resources[i] != n.res[player][i]) //if non-zero res change
|
||||||
iw.components.push_back(Component(Component::RESOURCE,i,n.res[player][i]-was,0));
|
iw.components.push_back(Component(Component::RESOURCE,i,n.res[player][i]-was,0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user