diff --git a/JGE/Makefile b/JGE/Makefile index 3d86cc650..224d84629 100644 --- a/JGE/Makefile +++ b/JGE/Makefile @@ -32,6 +32,7 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \ CXXFLAGS = -W -Wall -Werror -Wno-unused CXXFLAGS += -DTIXML_USE_STL +CXXFLAGS += -Wno-deprecated-declarations -Wno-sign-compare ifdef DEBUG CXXFLAGS += -ggdb3 @@ -82,7 +83,7 @@ ifeq ($(TARGET_ARCHITECTURE),linux) OBJS = $(GENERIC_OBJS) $(LINUX_OBJS) TARGET_LIB = libjge.a TARGET_HGE = libhgetools.a -INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost -Isrc/zipFS -Iinclude/ +INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I/usr/include/boost -Isrc/zipFS -Iinclude/ CXXFLAGS += -DLINUX $(FMOD) CXXFLAGS += $(INCDIR) LIBDIR = lib/linux diff --git a/JGE/lib/linux/libhgetools.a b/JGE/lib/linux/libhgetools.a new file mode 100644 index 000000000..241dddad8 Binary files /dev/null and b/JGE/lib/linux/libhgetools.a differ diff --git a/JGE/lib/linux/libjge.a b/JGE/lib/linux/libjge.a new file mode 100644 index 000000000..a66d4e300 Binary files /dev/null and b/JGE/lib/linux/libjge.a differ diff --git a/JGE/src/JFileSystem.cpp b/JGE/src/JFileSystem.cpp index 4eeff8f4f..f8add0a29 100644 --- a/JGE/src/JFileSystem.cpp +++ b/JGE/src/JFileSystem.cpp @@ -16,9 +16,14 @@ User folder is the only one that is really needed to guarantee both read and wri The content that users should not be touching. */ -#ifndef PSP +#if defined (ANDROID) #include "PrecompiledHeader.h" -#endif //PSP +#endif //ANDROID + +#if defined (LINUX) +#include "../../projects/mtg/include/PrecompiledHeader.h" +#endif //LINUX + #ifdef WIN32 #pragma warning(disable : 4786) diff --git a/JGE/src/JGE.cpp b/JGE/src/JGE.cpp index eb606f302..6a7da0839 100644 --- a/JGE/src/JGE.cpp +++ b/JGE/src/JGE.cpp @@ -249,6 +249,7 @@ u32 JGE::BindKey(LocalKeySym sym, JButton button) u32 JGE::UnbindKey(LocalKeySym sym, JButton button) { for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); ) + { if (sym == it->first && button == it->second) { keycodes_it er = it; @@ -256,7 +257,8 @@ u32 JGE::UnbindKey(LocalKeySym sym, JButton button) keyBinds.erase(er); } else ++it; - return keyBinds.size(); + } + return keyBinds.size(); } u32 JGE::UnbindKey(LocalKeySym sym) diff --git a/JGE/src/Xmain.cpp b/JGE/src/Xmain.cpp index 4359eee6a..00839d842 100644 --- a/JGE/src/Xmain.cpp +++ b/JGE/src/Xmain.cpp @@ -185,9 +185,9 @@ static const int doubleBufferAttributes[] = { GLX_RED_SIZE, 1, /* the maximum number of bits per component */ GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, - None + 0L /* None */ }; -static Bool WaitForNotify(Display *dpy, XEvent *event, XPointer arg) +static int WaitForNotify(Display *dpy, XEvent *event, XPointer arg) { return (event->type == MapNotify) && (event->xmap.window == (Window) arg); } @@ -387,13 +387,13 @@ int main(int argc, char* argv[]) if (XCheckWindowEvent(gXDisplay, gXWindow, KeyPressMask | KeyReleaseMask | StructureNotifyMask, &event)) switch (event.type) { - case KeyPress: + case 2: /* KeyPress */ { const KeySym sym = XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1); g_engine->HoldKey_NoRepeat(sym); } break; - case KeyRelease: + case 3: /* KeyRelease */ g_engine->ReleaseKey(XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1)); break; case ConfigureNotify: diff --git a/JGE/src/pc/JGfx.cpp b/JGE/src/pc/JGfx.cpp index 093e2035e..926845cc6 100644 --- a/JGE/src/pc/JGfx.cpp +++ b/JGE/src/pc/JGfx.cpp @@ -1804,7 +1804,7 @@ static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t { png_size_t check; - JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr; + JFileSystem *fileSystem = (JFileSystem*)png_get_io_ptr(png_ptr); check = fileSystem->ReadFile(data, length); @@ -1887,7 +1887,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode //fclose(fp); fileSystem->CloseFile(); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + png_destroy_read_struct(&png_ptr, NULL, NULL); return JGE_ERR_PNG; } @@ -1896,11 +1896,15 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode png_set_sig_bytes(png_ptr, sig_read); png_read_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL); png_set_strip_16(png_ptr); png_set_packing(png_ptr); if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); +#if PNG_LIBPNG_VER >= 10400 + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); +#else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); +#endif if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); @@ -1910,7 +1914,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode //fclose(fp); fileSystem->CloseFile(); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + png_destroy_read_struct(&png_ptr, NULL, NULL); return JGE_ERR_MALLOC_FAILED; } @@ -1932,7 +1936,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode for (y = 0; y < (int)height; y++) { - png_read_row(png_ptr, (BYTE*) line, png_bytep_NULL); + png_read_row(png_ptr, (BYTE*) line, NULL); for (x = 0; x < (int)width; x++) { DWORD color32 = line[x]; @@ -1955,7 +1959,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode free (line); png_read_end(png_ptr, info_ptr); - png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fileSystem->CloseFile(); @@ -1998,8 +2002,15 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg GifFileType *GifFileIn = NULL; ColorMapObject *palette; int ExtCode; + +#if GIFLIB_MAJOR >= 5 + if ((GifFileIn = DGifOpen(handle, readFunc, NULL)) == NULL) + return 1; +#else if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL) return 1; +#endif + *bgcolor = 0; textureInfo.mWidth = 0; textureInfo.mHeight = 0; @@ -2008,7 +2019,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg do { if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR) { +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } @@ -2017,12 +2032,20 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg { if (DGifGetImageDesc(GifFileIn) == GIF_ERROR) { +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL) { +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } textureInfo.mWidth = GifFileIn->Image.Width; @@ -2030,7 +2053,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg *bgcolor = gif_color32(GifFileIn->SBackGroundColor); if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL) { +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width); @@ -2040,7 +2067,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg if((p32 = (DWORD *)malloc(sizeof(PIXEL_TYPE) * textureInfo.mTexWidth * textureInfo.mTexHeight)) == NULL) { free((void *)LineIn); +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } DWORD * curr = p32; @@ -2052,7 +2083,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg { free((void *)p32); free((void *)LineIn); +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } for (GifWord j = 0; j < GifFileIn->Image.Width; j ++) @@ -2081,7 +2116,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg } if(LineIn != NULL) free((void *)LineIn); +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } while (Extension != NULL) { @@ -2094,7 +2133,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg } if(LineIn != NULL) free((void *)LineIn); +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 1; } } @@ -2109,7 +2152,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg if(LineIn != NULL) free((void *)LineIn); +#if GIFLIB_MAJOR >= 5 + DGifCloseFile(GifFileIn, NULL); +#else DGifCloseFile(GifFileIn); +#endif return 0; } diff --git a/JGE/src/zipFS/zfsystem.cpp b/JGE/src/zipFS/zfsystem.cpp index 7611b60cf..87653c3f7 100644 --- a/JGE/src/zipFS/zfsystem.cpp +++ b/JGE/src/zipFS/zfsystem.cpp @@ -631,8 +631,8 @@ streamoff filesystem::CentralDirZipped(std::istream & File, std::streamoff begin std::streamoff eof = begin + size; // Look for the "end of central dir" header. Start minimum 22 bytes before end. - if (! File.seekg(eof - 22, ios::beg)) - return -1; + if (! File.seekg(eof - 22, ios::beg)) + return -1; streamoff EndPos; streamoff StartPos = File.tellg(); diff --git a/JGE/src/zipFS/zfsystem.h b/JGE/src/zipFS/zfsystem.h index 8fca5bc2a..4a9c7197a 100644 --- a/JGE/src/zipFS/zfsystem.h +++ b/JGE/src/zipFS/zfsystem.h @@ -258,8 +258,8 @@ inline void izfstream::open(const char * FilePath, filesystem * pFS) { if (pFS) m_pFS = pFS; - if (m_pFS != NULL) - m_pFS->Open(* this, FilePath); + if (m_pFS != NULL) + m_pFS->Open(* this, FilePath); } inline void izfstream::close() { diff --git a/JGE/src/zipFS/zstream.cpp b/JGE/src/zipFS/zstream.cpp index 51ed0557e..51e3daee2 100644 --- a/JGE/src/zipFS/zstream.cpp +++ b/JGE/src/zipFS/zstream.cpp @@ -76,8 +76,8 @@ bool zbuffer::use(std::streamoff Offset, std::streamoff Size) return false; //Don't use a buffer already used; - if (m_Used) - return false; + if (m_Used) + return false; // adjust file position if (! m_ZipFile.seekg(Offset, ios::beg)) diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index 7b53ff162..692836175 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -59,7 +59,6 @@ endif ifeq ($(TARGET_ARCHITECTURE),psp) DEFAULT_RULE = 3xx -TARGET_ARCHITECTURE = psp PSP_FW_VERSION=371 BUILD_PRX = 1 SIGN_PRX = 1 @@ -74,19 +73,33 @@ PSP_EBOOT_PIC1 = pic1.png INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost LIBDIR = ../../JGE/lib/psp CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL +endif +ifeq ($(MAKECMDGOALS),x11) + +OBJS += objs/TestSuiteAI.o +INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I/usr/include/boost -I../../JGE/src/zipFS +LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib +LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lpthread $(FMOD) +CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 -DTIXML_USE_STL + +ASFLAGS = $(CXXFLAGS) + +all: $(DEFAULT_RULE) else + OBJS += objs/TestSuiteAI.o INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib -L../../Boost/lib LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lboost_thread $(FMOD) CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 + ASFLAGS = $(CXXFLAGS) all: $(DEFAULT_RULE) endif -CFLAGS := -Wall -W -Werror -Wno-unused $(CFLAGS) +CFLAGS := -Wall -W -Werror -Wno-unused -Wno-deprecated-declarations -Wno-nonnull-compare $(CFLAGS) CXXFLAGS += $(CFLAGS) # -fno-exceptions @@ -110,8 +123,6 @@ debug: all else - - $(TARGET): Makefile.$(TARGET_ARCHITECTURE) $(OBJS) ../../JGE/lib/linux/libjge.a $(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 1c60abfbe..c590a55b6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -6636,7 +6636,7 @@ public: else source->removeptbonus(PowerModifier * (nbOpponents - MaxOpponent),ToughnessModifier * (nbOpponents - MaxOpponent)); - nbOpponents = 0; + nbOpponents = 0; } } return 1; @@ -6659,8 +6659,8 @@ public: int receiveEvent(WEvent * event) { WEventZoneChange * enters = dynamic_cast (event); - if (enters && enters->to == enters->card->controller()->game->inPlay) - if(enters->from != enters->card->controller()->game->inPlay && enters->from != enters->card->controller()->opponent()->game->inPlay) //cards changing from inplay to inplay don't re-enter battlefield + if (enters && enters->to == enters->card->controller()->game->inPlay) { + if(enters->from != enters->card->controller()->game->inPlay && enters->from != enters->card->controller()->opponent()->game->inPlay) { //cards changing from inplay to inplay don't re-enter battlefield if(enters->card->controller() == source->controller() && enters->card->isCreature()) { if(enters->card != source && (enters->card->power > source->power || enters->card->toughness > source->toughness)) @@ -6668,7 +6668,9 @@ public: source->counters->addCounter(1,1); } } - return 1; + } + } + return 1; } AEvolveAbility * clone() const diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 01a99c442..58f1a7127 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -7974,78 +7974,78 @@ int AACastCard::resolveSpell() if (_target->isLand()) putinplay = true; - Spell * spell = NULL; - MTGCardInstance * copy = NULL; - if ((normal || asNormalMadness)||(!_target->hasType(Subtypes::TYPE_INSTANT) && !_target->hasType(Subtypes::TYPE_SORCERY))) + Spell * spell = NULL; + MTGCardInstance * copy = NULL; + if ((normal || asNormalMadness)||(!_target->hasType(Subtypes::TYPE_INSTANT) && !_target->hasType(Subtypes::TYPE_SORCERY))) + { + if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) + copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); + else + copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent); + copy->changeController(source->controller(),true); + if(asNormalMadness) + copy->MadnessPlay = true; + } + else + { + if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) + copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); + else + copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent); + copy->changeController(source->controller(),true); + } + if (game->targetChooser) + { + game->targetChooser->Owner = source->controller(); + if(putinplay) { - if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); - else - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent); - copy->changeController(source->controller(),true); - if(asNormalMadness) - copy->MadnessPlay = true; + spell = NEW Spell(game, 0,copy,game->targetChooser,NULL, 1); + spell->resolve(); + } + else + spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0); + game->targetChooser = NULL; + } + else + { + if(putinplay) + { + spell = NEW Spell(game, 0,copy,NULL,NULL, 1); + spell->resolve(); + } + else + spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0); + } + + if (copy->has(Constants::STORM)) + { + int storm = _target->controller()->game->stack->seenThisTurn("*", Constants::CAST_ALL) + source->controller()->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL); + + for (int i = storm; i > 1; i--) + { + spell = game->mLayers->stackLayer()->addSpell(copy, NULL, 0, 1, 1); + + } + } + if (!copy->has(Constants::STORM)) + { + copy->X = _target->X; + copy->castX = copy->X; + } + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = copy; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); } else { - if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); - else - copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent); - copy->changeController(source->controller(),true); - } - if (game->targetChooser) - { - game->targetChooser->Owner = source->controller(); - if(putinplay) - { - spell = NEW Spell(game, 0,copy,game->targetChooser,NULL, 1); - spell->resolve(); - } - else - spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0); - game->targetChooser = NULL; - } - else - { - if(putinplay) - { - spell = NEW Spell(game, 0,copy,NULL,NULL, 1); - spell->resolve(); - } - else - spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0); - } - - if (copy->has(Constants::STORM)) - { - int storm = _target->controller()->game->stack->seenThisTurn("*", Constants::CAST_ALL) + source->controller()->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL); - - for (int i = storm; i > 1; i--) - { - spell = game->mLayers->stackLayer()->addSpell(copy, NULL, 0, 1, 1); - - } - } - if (!copy->has(Constants::STORM)) - { - copy->X = _target->X; - copy->castX = copy->X; - } - if(andAbility) - { - MTGAbility * andAbilityClone = andAbility->clone(); - andAbilityClone->target = copy; - if(andAbility->oneShot) - { - andAbilityClone->resolve(); - SAFE_DELETE(andAbilityClone); - } - else - { - andAbilityClone->addToGame(); - } + andAbilityClone->addToGame(); } + } this->forceDestroy = true; processed = true; diff --git a/projects/mtg/src/CardPrimitive.cpp b/projects/mtg/src/CardPrimitive.cpp index d2491a240..29a3411fc 100644 --- a/projects/mtg/src/CardPrimitive.cpp +++ b/projects/mtg/src/CardPrimitive.cpp @@ -45,7 +45,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source) for (size_t i = 0; i < source->types.size(); ++i) types.push_back(source->types[i]); - colors = source->colors; + colors = source->colors; manaCost.copy(source->getManaCost()); //reducedCost.copy(source->getReducedManaCost()); //increasedCost.copy(source->getIncreasedManaCost()); diff --git a/projects/mtg/src/GuiMana.cpp b/projects/mtg/src/GuiMana.cpp index bf8fd7dd0..a6236154b 100644 --- a/projects/mtg/src/GuiMana.cpp +++ b/projects/mtg/src/GuiMana.cpp @@ -305,8 +305,8 @@ void GuiMana::Render() for (vector::iterator it = manas.begin(); it != manas.end(); ++it) (*it)->Render(); - if (OptionManaDisplay::DYNAMIC != options[Options::MANADISPLAY].number && OptionManaDisplay::NOSTARSDYNAMIC != options[Options::MANADISPLAY].number ) - RenderStatic(); + if (OptionManaDisplay::DYNAMIC != options[Options::MANADISPLAY].number && OptionManaDisplay::NOSTARSDYNAMIC != options[Options::MANADISPLAY].number ) + RenderStatic(); } bool remove_dead(ManaIcon* m) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index b12327e52..fb1c92d24 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -5371,7 +5371,7 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana) case OPPONENT_TURN_ONLY: if (player == game->currentPlayer) return 0; - break; + break; case AS_SORCERY: if (player != game->currentPlayer) return 0; @@ -5543,7 +5543,7 @@ int ActivatedAbility::activateAbility() ExtraCost * tapper = dynamic_cast(cost->extraCosts->costs[i]); if(tapper) needsTapping = 1; - wasTappedForMana = true; + wasTappedForMana = true; } } else if(amp||femp) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 750d4883c..e78f1f4b6 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -2316,7 +2316,7 @@ int MTGBlockRule::reactToClick(MTGCardInstance * card) if(lured && currentOpponent && !currentOpponent->has(Constants::LURE)) currentOpponent = game->currentPlayer->game->inPlay->getNextLurer(currentOpponent); - canDefend = card->toggleDefenser(currentOpponent); + canDefend = card->toggleDefenser(currentOpponent); DebugTrace("Defenser Toggle: " << card->getName() << endl << "- canDefend: " << (canDefend == 0) << endl diff --git a/projects/mtg/src/Navigator.cpp b/projects/mtg/src/Navigator.cpp index 27a306766..39729e81a 100644 --- a/projects/mtg/src/Navigator.cpp +++ b/projects/mtg/src/Navigator.cpp @@ -43,6 +43,10 @@ public: mCurrentCard(0) { } + + virtual ~CardZone() + { + } /* ** diff --git a/projects/mtg/wagic.pri b/projects/mtg/wagic.pri index 62ab32ed9..3157ebf84 100644 --- a/projects/mtg/wagic.pri +++ b/projects/mtg/wagic.pri @@ -9,6 +9,7 @@ unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable unix|*macx*:QMAKE_CXXFLAGS += -Wno-unused-value unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror +unix|macx:QMAKE_CXXFLAGS += -Wno-nonnull-compare windows:DEFINES += _CRT_SECURE_NO_WARNINGS windows|winrt:DEFINES += NOMINMAX