X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=424404febe492414d4584d9291037e70717837e9;hb=4b3deb01b66307f5025938538d27e6ad86cfea13;hp=bebeed106e14bf8520b80b00aa8affaa2b07bc14;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index bebeed1..424404f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,8 @@ #include "graphics/Menu.h" #include "graphics/SimpleAnimation.h" #include "graphics/Sprite.h" +#include "loader/ParsedSource.h" +#include "loader/Parser.h" #include "sdl/InitImage.h" #include "sdl/InitScreen.h" #include "sdl/InitSDL.h" @@ -32,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +58,8 @@ using graphics::Gauge; using graphics::Menu; using graphics::SimpleAnimation; using graphics::Sprite; +using loader::ParsedSource; +using loader::Parser; using sdl::InitImage; using sdl::InitScreen; using sdl::InitSDL; @@ -73,6 +78,15 @@ int main(int argc, char **argv) { // std::srand(std::time(0)); try { + std::ifstream file("test-data/test.l2s"); + ParsedSource source; + Parser parser(file, source); + parser.Parse(); + + cout << source; + + return 0; + InitSDL sdl; InitImage image(IMG_INIT_PNG); InitScreen screen(width, height); @@ -123,8 +137,7 @@ int main(int argc, char **argv) { maxim.SetIP(0); maxim.SetStats(Stats(28, 22, 28, 17, 14, 100, 10)); ComplexAnimation maximAttackAnimation(&maximSprite, framerate); - // TODO: cross check double frames; could be related to differences in framerates - maximAttackAnimation.AddFrames(1, 0, Vector(0, 0), 7); // TODO: maybe this could also be a pause before the battle animation + maximAttackAnimation.AddFrames(1, 0, Vector(0, 0), 7); maximAttackAnimation.AddFrames(1, 0, Vector(4, -1), 2); maximAttackAnimation.AddFrames(2, 0, Vector(4, -2), 2); maximAttackAnimation.AddFrames(2, 0, Vector(6, -2), 2); @@ -133,7 +146,7 @@ int main(int argc, char **argv) { maximAttackAnimation.AddFrames(2, 1, Vector(0, 0), 1); maximAttackAnimation.AddFrames(2, 2, Vector(0, 0), 2); maximAttackAnimation.AddFrames(2, 2, Vector(2, 0), 1); - maximAttackAnimation.AddFrames(1, 0, Vector(0, 0), 7); // TODO: maybe this could also be a pause between two animations + maximAttackAnimation.AddFrames(1, 0, Vector(0, 0), 7); maxim.SetAttackAnimation(&maximAttackAnimation); ComplexAnimation maximSpellAnimation(&maximSprite, 5 * framerate); maximSpellAnimation.AddFrames(3, 0, Vector(), 2); @@ -508,7 +521,7 @@ int main(int argc, char **argv) { Ikari lightGuard; lightGuard.SetName("Light guard"); lightGuard.SetCost(128); - lightGuard.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self + lightGuard.GetTargetingMode().TargetAllAllies(); // actually only targets self lightGuard.SetMagical(); holyShield.SetIkari(&lightGuard); maxim.SetShield(&holyShield); @@ -518,7 +531,7 @@ int main(int argc, char **argv) { Ikari boomerang; boomerang.SetName("Boomerang"); boomerang.SetCost(164); - boomerang.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self + boomerang.GetTargetingMode().TargetAllAllies(); // actually only targets self boomerang.SetMagical(); legendHelm.SetIkari(&boomerang); maxim.SetHelmet(&legendHelm); @@ -623,7 +636,7 @@ int main(int argc, char **argv) { Ikari ironBarrier; ironBarrier.SetName("Iron barrier"); ironBarrier.SetCost(255); - ironBarrier.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self + ironBarrier.GetTargetingMode().TargetAllAllies(); // actually only targets self ironBarrier.SetMagical(); megaShield.SetIkari(&ironBarrier); guy.SetShield(&megaShield);