This commit is contained in:
Joris 2013-02-11 11:09:26 +01:00
parent d02100c20a
commit 24fe5a7fab
10 changed files with 21 additions and 23 deletions

View file

@ -306,8 +306,8 @@ bool COrder_SpellCast::SpellMoveToTarget(CUnit &unit)
unit.Type->Name.c_str(), spell.Name.c_str());
} else if (unit.Player->CheckCosts(spell.Costs)) {
unit.Player->Notify(NotifyYellow, unit.tilePos,
_("%s: not enough resources to cast spell: %s"),
unit.Type->Name.c_str(), spell.Name.c_str());
_("%s: not enough resources to cast spell: %s"),
unit.Type->Name.c_str(), spell.Name.c_str());
} else {
unit.Player->Notify(NotifyYellow, unit.tilePos,
_("%s: can't cast spell: %s"),

View file

@ -259,8 +259,8 @@ static void HandleRegenerations(CUnit &unit)
&& unit.CurrentAction() != UnitActionDie) {
if (((100 * unit.Variable[HP_INDEX].Value) / unit.Variable[HP_INDEX].Max) <= unit.Type->BurnPercent
&& unit.Type->BurnDamageRate) {
HitUnit(NoUnitP, unit, unit.Type->BurnDamageRate);
burn = true;
HitUnit(NoUnitP, unit, unit.Type->BurnDamageRate);
burn = true;
}
if (unit.Variable[POISON_INDEX].Value && unit.Type->PoisonDrain) {
@ -329,7 +329,7 @@ static void HandleBuffsEachSecond(CUnit &unit)
for (unsigned int i = 0; i < UnitTypeVar.GetNumberVariable(); i++) {
if (i == BLOODLUST_INDEX || i == HASTE_INDEX || i == SLOW_INDEX
|| i == INVISIBLE_INDEX || i == UNHOLYARMOR_INDEX || i == POISON_INDEX) {
continue;
continue;
}
if (unit.Variable[i].Enable && unit.Variable[i].Increase) {
IncreaseVariable(unit, i);

View file

@ -102,7 +102,7 @@ public:
static size_t Size() { return 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 * PlayerMax + 4 * PlayerMax + 4 * PlayerMax + 4 * PlayerMax; }
void Clear() {
ResourcesOption = UnitsOption = FogOfWar = RevealMap = TilesetSelection =
GameTypeOption = Difficulty = MapRichness = 0;
GameTypeOption = Difficulty = MapRichness = 0;
memset(CompOpt, 0, sizeof(CompOpt));
memset(Ready, 0, sizeof(Ready));
memset(LastFrame, 0, sizeof(LastFrame));

View file

@ -122,7 +122,7 @@ extern size_t strnlen(const char *str, size_t strsize);
#else
extern char *optarg;
extern int optind, opterr, optopt;
int getopt(int argc, char * const argv[], const char *optstring);
int getopt(int argc, char *const argv[], const char *optstring);
#endif
/*----------------------------------------------------------------------------

View file

@ -298,11 +298,11 @@ public:
void FillTransCircleClip(Uint32 color, int x, int y, int radius, unsigned char alpha);
inline Uint32 MapRGB(SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b) {
#if defined(USE_OPENGL) || defined(USE_GLES)
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
return MapRGBA(f, r, g, b, 0xFF);
} else
#endif
#endif
{
return SDL_MapRGB(f, r, g, b);
}
@ -311,11 +311,11 @@ public:
return MapRGB(f, color.R, color.G, color.B);
}
inline Uint32 MapRGBA(SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b, Uint8 a) {
#if defined(USE_OPENGL) || defined(USE_GLES)
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
return ((r << RSHIFT) | (g << GSHIFT) | (b << BSHIFT) | (a << ASHIFT));
} else
#endif
#endif
{
return SDL_MapRGBA(f, r, g, b, a);
}
@ -324,26 +324,26 @@ public:
return MapRGBA(f, color.R, color.G, color.B, color.A);
}
inline void GetRGB(Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b) {
#if defined(USE_OPENGL) || defined(USE_GLES)
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
*r = (c >> RSHIFT) & 0xff;
*g = (c >> GSHIFT) & 0xff;
*b = (c >> BSHIFT) & 0xff;
} else
#endif
#endif
{
SDL_GetRGB(c, f, r, g, b);
}
}
inline void GetRGBA(Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) {
#if defined(USE_OPENGL) || defined(USE_GLES)
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
*r = (c >> RSHIFT) & 0xff;
*g = (c >> GSHIFT) & 0xff;
*b = (c >> BSHIFT) & 0xff;
*a = (c >> ASHIFT) & 0xff;
} else
#endif
#endif
{
SDL_GetRGBA(c, f, r, g, b, a);
}

View file

@ -265,7 +265,6 @@ static void CclSpellAutocast(lua_State *l, AutoCastInfo *autocast)
lua_pop(l, 1);
lua_pop(l, 1);
} else if (!strcmp(value, "condition")) {
if (!autocast->Condition) {
autocast->Condition = new ConditionInfo;

View file

@ -293,13 +293,12 @@ static Target *SelectTargetUnitsOfAutoCast(CUnit &caster, const SpellType &spell
// For the best target???
if (autocast->PriorytyVar != ACP_NOVALUE) {
std::sort(table.begin(), table.begin() + n,
AutoCastPrioritySort(caster, autocast->PriorytyVar, autocast->ReverseSort));
AutoCastPrioritySort(caster, autocast->PriorytyVar, autocast->ReverseSort));
return NewTargetUnit(*table[0]);
} else { // Use the old behavior
return NewTargetUnit(*table[SyncRand() % n]);
}
}
}
break;
}
default:

View file

@ -1573,7 +1573,7 @@ static int CclDefineDecorations(lua_State *l)
decovarstaticsprite->n = LuaToNumber(l, -2);
decovarstaticsprite->FadeValue = LuaToNumber(l, -1);
lua_pop(l, 3);
}
}
decovar = decovarstaticsprite;
} else { // Error
LuaError(l, "invalid method '%s' for Method in DefineDecorations" _C_ key);

View file

@ -263,7 +263,7 @@ void DrawCursor()
#else
if (
#endif
!GameRunning && !Editor.Running) {
!GameRunning && !Editor.Running) {
if (!HiddenSurface
|| HiddenSurface->w != GameCursor->G->getWidth()
|| HiddenSurface->h != GameCursor->G->getHeight()) {
@ -303,7 +303,7 @@ void HideCursor()
#else
if (
#endif
!GameRunning && !Editor.Running && GameCursor) {
!GameRunning && !Editor.Running && GameCursor) {
const PixelPos pos = CursorScreenPos - GameCursor->HotPos;
SDL_Rect dstRect = {Sint16(pos.x), Sint16(pos.y), 0, 0 };
SDL_BlitSurface(HiddenSurface, NULL, TheScreen, &dstRect);

View file

@ -670,7 +670,7 @@ void InitVideoSdl()
// Get the SDL window handle
SDL_SysWMinfo sysInfo; //Will hold our Window information
SDL_VERSION(&sysInfo.version); //Set SDL version
if(SDL_GetWMInfo(&sysInfo) <= 0) {
if (SDL_GetWMInfo(&sysInfo) <= 0) {
fprintf(stderr, "Unable to get window handle\n");
exit(1);
}