X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=a8a722552e2d8126cd6c22e40f88a92720dbcc9f;hb=2ad47aa3758fe5d04ba1764f275a0fe30706d200;hp=beef2feba24a0a74497c282b4dcf112a1d832350;hpb=6e88a625710c7936f87b38ecf6094472f3a49f4f;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index beef2fe..a8a7225 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,7 @@ #include "common/Ikari.h" #include "common/Inventory.h" #include "common/Item.h" +#include "common/Script.h" #include "common/Spell.h" #include "common/Stats.h" #include "geometry/Vector.h" @@ -65,6 +66,7 @@ using common::Hero; using common::Ikari; using common::Inventory; using common::Item; +using common::Script; using common::Spell; using common::Stats; using geometry::Vector; @@ -518,11 +520,43 @@ int main(int argc, char **argv) { map2.SetWidth(1); map2.SetBattleBackground(bg); - triggers1[0].map = &map2; - triggers1[0].target = Vector(6, 2); - - triggers2[0].map = &map1; - triggers2[0].target = Vector(8, 3); + unsigned char transition1text[4 + sizeof(int) + sizeof(Map *) + sizeof(Vector)]; + int i(0); + transition1text[i++] = Script::CODE_MOVE_I0; + *reinterpret_cast(transition1text + i) = 1; + i += sizeof(int); + transition1text[i++] = Script::CODE_MOVE_A0; + *reinterpret_cast(transition1text + i) = &map2; + i += sizeof(Map *); + transition1text[i++] = Script::CODE_MOVE_V0; + *reinterpret_cast *>(transition1text + i) = Vector(6, 2); + i += sizeof(Vector); + transition1text[i++] = Script::CODE_SYSCALL; + + Script transition1; + transition1.text = transition1text; + transition1.textlen = sizeof(transition1text); + + triggers1[0].SetScript(&transition1); + + unsigned char transition2text[4 + sizeof(int) + sizeof(Map *) + sizeof(Vector)]; + i = 0; + transition2text[i++] = Script::CODE_MOVE_I0; + *reinterpret_cast(transition2text + i) = 1; + i += sizeof(int); + transition2text[i++] = Script::CODE_MOVE_A0; + *reinterpret_cast(transition2text + i) = &map1; + i += sizeof(Map *); + transition2text[i++] = Script::CODE_MOVE_V0; + *reinterpret_cast *>(transition2text + i) = Vector(8, 3); + i += sizeof(Vector); + transition2text[i++] = Script::CODE_SYSCALL; + + Script transition2; + transition2.text = transition2text; + transition2.textlen = sizeof(transition2text); + + triggers2[0].SetScript(&transition2); gameState.heroes[0].MapEntity().Position() = Vector(64, 128);