From 9e36caf9014e868b845392ffe34c3eff7704e5aa Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sat, 26 Jan 2013 00:33:37 +0100 Subject: [PATCH] Misc global lua var hunt 1 - Remove the useless map reference when saving a map in the editor - Turned instance var to local (and this is faster btw) - make the kalya_sprite be set to a new pointer instead of being init (if init at all on second map load?) to nil. --- dat/maps/introduction.lua | 10 +++++++--- .../layna_forest_crystal_appearance_anim.lua | 5 +++++ dat/maps/layna_forest/layna_forest_cave1_1.lua | 12 ++++++++---- dat/maps/layna_forest/layna_forest_cave1_2.lua | 12 ++++++++---- .../layna_forest_cave1_2_stone_sign_image.lua | 4 ++++ dat/maps/layna_forest/layna_forest_cave2.lua | 10 +++++++--- .../layna_forest_caves_background_anim.lua | 5 +++++ dat/maps/layna_forest/layna_forest_crystal.lua | 12 ++++++++---- dat/maps/layna_forest/layna_forest_entrance.lua | 12 ++++++++---- dat/maps/layna_forest/layna_forest_north_east.lua | 10 +++++++--- dat/maps/layna_forest/layna_forest_north_west.lua | 12 ++++++++---- dat/maps/layna_forest/layna_forest_south_east.lua | 10 +++++++--- dat/maps/layna_forest/layna_forest_south_west.lua | 12 ++++++++---- dat/maps/layna_forest/layna_forest_wolf_cave.lua | 12 ++++++++---- .../layna_village/layna_village_bronanns_home.lua | 10 +++++++--- .../layna_village_bronanns_home_first_floor.lua | 10 +++++++--- dat/maps/layna_village/layna_village_center.lua | 10 +++++++--- dat/maps/layna_village/layna_village_center_shop.lua | 10 +++++++--- .../layna_village_center_sophia_house.lua | 10 +++++++--- .../layna_village_kalya_house_exterior.lua | 10 +++++++--- .../layna_village/layna_village_kalya_house_path.lua | 10 +++++++--- .../layna_village_kalya_house_path_small_house.lua | 10 +++++++--- dat/maps/layna_village/layna_village_riverbank.lua | 10 +++++++--- .../layna_village/layna_village_riverbank_house.lua | 10 +++++++--- .../layna_village/layna_village_south_entrance.lua | 10 +++++++--- .../layna_village_south_entrance_left_house.lua | 10 +++++++--- .../layna_village_south_entrance_right_house.lua | 10 +++++++--- dat/maps/to_be_continued_anim.lua | 5 +++++ src/editor/grid.cpp | 4 ---- 29 files changed, 194 insertions(+), 83 deletions(-) diff --git a/dat/maps/introduction.lua b/dat/maps/introduction.lua index 1c0eb5a2b..0ed11d288 100644 --- a/dat/maps/introduction.lua +++ b/dat/maps/introduction.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); introduction = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "" map_image_filename = "" @@ -354,6 +351,13 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local crystal = {}; -- the main map loading code diff --git a/dat/maps/layna_forest/crystal_appearance/layna_forest_crystal_appearance_anim.lua b/dat/maps/layna_forest/crystal_appearance/layna_forest_crystal_appearance_anim.lua index 623617b02..482036765 100644 --- a/dat/maps/layna_forest/crystal_appearance/layna_forest_crystal_appearance_anim.lua +++ b/dat/maps/layna_forest/crystal_appearance/layna_forest_crystal_appearance_anim.lua @@ -68,6 +68,11 @@ local crystal_position_y = 44.0; local pos_x = 0.0; local pos_y = 0.0; +-- c++ objects instances +local Map = {}; +local Script = {}; +local Effects = {}; + function Initialize(map_instance) Map = map_instance; diff --git a/dat/maps/layna_forest/layna_forest_cave1_1.lua b/dat/maps/layna_forest/layna_forest_cave1_1.lua index 17a1a4f00..83be6dcc5 100644 --- a/dat/maps/layna_forest/layna_forest_cave1_1.lua +++ b/dat/maps/layna_forest/layna_forest_cave1_1.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_cave1_1 = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest Cave" map_image_filename = "img/menus/locations/desert_cave.png" @@ -357,11 +354,18 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the first forest entrance event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_cave1_2.lua b/dat/maps/layna_forest/layna_forest_cave1_2.lua index 468a77938..fe5ff39c7 100644 --- a/dat/maps/layna_forest/layna_forest_cave1_2.lua +++ b/dat/maps/layna_forest/layna_forest_cave1_2.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_cave1_2 = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest Cave" map_image_filename = "img/menus/locations/desert_cave.png" @@ -356,11 +353,18 @@ layers[3][47] = { 668, 669, 670, 671, 668, 669, 670, 671, 668, 669, 670, 671, 66 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the first forest entrance event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_cave1_2_stone_sign_image.lua b/dat/maps/layna_forest/layna_forest_cave1_2_stone_sign_image.lua index 790c1ffa6..b02324a9d 100644 --- a/dat/maps/layna_forest/layna_forest_cave1_2_stone_sign_image.lua +++ b/dat/maps/layna_forest/layna_forest_cave1_2_stone_sign_image.lua @@ -13,6 +13,10 @@ setfenv(1, ns); local stone_sign_id = 0; local display_time = 0; +-- c++ objects instances +local Map = {}; +local Script = {}; + function Initialize(map_instance) Map = map_instance; diff --git a/dat/maps/layna_forest/layna_forest_cave2.lua b/dat/maps/layna_forest/layna_forest_cave2.lua index ae42d710b..2318293ac 100644 --- a/dat/maps/layna_forest/layna_forest_cave2.lua +++ b/dat/maps/layna_forest/layna_forest_cave2.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_cave2 = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest Cave" map_image_filename = "img/menus/locations/desert_cave.png" @@ -354,6 +351,13 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; diff --git a/dat/maps/layna_forest/layna_forest_caves_background_anim.lua b/dat/maps/layna_forest/layna_forest_caves_background_anim.lua index aad4719df..87f58566d 100644 --- a/dat/maps/layna_forest/layna_forest_caves_background_anim.lua +++ b/dat/maps/layna_forest/layna_forest_caves_background_anim.lua @@ -16,6 +16,11 @@ local fog_alpha = 0.0; local fog_timer; local fog_time_length = 8000; +-- c++ objects instances +local Map = {}; +local Script = {}; +local Effects = {}; + function Initialize(map_instance) Map = map_instance; Script = Map:GetScriptSupervisor(); diff --git a/dat/maps/layna_forest/layna_forest_crystal.lua b/dat/maps/layna_forest/layna_forest_crystal.lua index 38e0f68d1..92b5b42cd 100644 --- a/dat/maps/layna_forest/layna_forest_crystal.lua +++ b/dat/maps/layna_forest/layna_forest_crystal.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_crystal = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -354,11 +351,18 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_entrance.lua b/dat/maps/layna_forest/layna_forest_entrance.lua index a148117e6..46915a33c 100644 --- a/dat/maps/layna_forest/layna_forest_entrance.lua +++ b/dat/maps/layna_forest/layna_forest_entrance.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_entrance = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -211,11 +208,18 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the firt forest entrance event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_north_east.lua b/dat/maps/layna_forest/layna_forest_north_east.lua index a21cbdf85..8a5a018a0 100644 --- a/dat/maps/layna_forest/layna_forest_north_east.lua +++ b/dat/maps/layna_forest/layna_forest_north_east.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_north_east = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -353,6 +350,13 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; diff --git a/dat/maps/layna_forest/layna_forest_north_west.lua b/dat/maps/layna_forest/layna_forest_north_west.lua index d6a215c90..9d891f35e 100644 --- a/dat/maps/layna_forest/layna_forest_north_west.lua +++ b/dat/maps/layna_forest/layna_forest_north_west.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_north_west = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -354,6 +351,13 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; @@ -361,7 +365,7 @@ local hero = {}; local orlinn = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the first forest entrance event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_south_east.lua b/dat/maps/layna_forest/layna_forest_south_east.lua index 31ace8f2b..c5aa2c186 100644 --- a/dat/maps/layna_forest/layna_forest_south_east.lua +++ b/dat/maps/layna_forest/layna_forest_south_east.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_south_east = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -355,6 +352,13 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; diff --git a/dat/maps/layna_forest/layna_forest_south_west.lua b/dat/maps/layna_forest/layna_forest_south_west.lua index 2947d0d69..5c425a4eb 100644 --- a/dat/maps/layna_forest/layna_forest_south_west.lua +++ b/dat/maps/layna_forest/layna_forest_south_west.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_south_west = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest" map_image_filename = "img/menus/locations/layna_forest.png" @@ -352,11 +349,18 @@ layers[3][47] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the first forest entrance event. local main_sprite_name = ""; diff --git a/dat/maps/layna_forest/layna_forest_wolf_cave.lua b/dat/maps/layna_forest/layna_forest_wolf_cave.lua index 5ebe38c09..8a44a7126 100644 --- a/dat/maps/layna_forest/layna_forest_wolf_cave.lua +++ b/dat/maps/layna_forest/layna_forest_wolf_cave.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_forest_wolf_cave = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Layna Forest Cave" map_image_filename = "img/menus/locations/desert_cave.png" @@ -208,11 +205,18 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, 150, -1, 149, -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local hero = {}; -- Forest dialogue secondary hero -local kalya_sprite = nil; +local kalya_sprite = {}; -- Name of the main sprite. Used to reload the good one at the end of the dialogue events. local main_sprite_name = ""; diff --git a/dat/maps/layna_village/layna_village_bronanns_home.lua b/dat/maps/layna_village/layna_village_bronanns_home.lua index f59a2f2f5..13aecb9e6 100644 --- a/dat/maps/layna_village/layna_village_bronanns_home.lua +++ b/dat/maps/layna_village/layna_village_bronanns_home.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_bronanns_home = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "" map_image_filename = "" @@ -238,6 +235,13 @@ layers[4][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- The main character handlers local bronann = {}; local bronanns_dad = {}; diff --git a/dat/maps/layna_village/layna_village_bronanns_home_first_floor.lua b/dat/maps/layna_village/layna_village_bronanns_home_first_floor.lua index ce31f782a..4aa220f45 100644 --- a/dat/maps/layna_village/layna_village_bronanns_home_first_floor.lua +++ b/dat/maps/layna_village/layna_village_bronanns_home_first_floor.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_bronanns_home_first_floor = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name and location image map_name = " " map_image_filename = "" @@ -249,6 +246,13 @@ context_02 = { 0, 8, 20, 596, 0, 8, 21, 597, 0, 9, 14, 594, 0, 9, 15, 579, 0, 9, -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_center.lua b/dat/maps/layna_village/layna_village_center.lua index b996bea47..febf888ee 100644 --- a/dat/maps/layna_village/layna_village_center.lua +++ b/dat/maps/layna_village/layna_village_center.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_center = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -263,6 +260,13 @@ layers[2][39] = { -1, -1, -1, -1, -1, -1, 40, 41, 20, 21, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local bronann = {}; local kalya = {}; diff --git a/dat/maps/layna_village/layna_village_center_shop.lua b/dat/maps/layna_village/layna_village_center_shop.lua index 3407544fa..f92c3fdef 100644 --- a/dat/maps/layna_village/layna_village_center_shop.lua +++ b/dat/maps/layna_village/layna_village_center_shop.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_center_shop = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -209,6 +206,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- The main character handlers local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_center_sophia_house.lua b/dat/maps/layna_village/layna_village_center_sophia_house.lua index 7843577a5..be565cfde 100644 --- a/dat/maps/layna_village/layna_village_center_sophia_house.lua +++ b/dat/maps/layna_village/layna_village_center_sophia_house.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_center_sophia_house = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -209,6 +206,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_kalya_house_exterior.lua b/dat/maps/layna_village/layna_village_kalya_house_exterior.lua index aacc64f3b..03d087ed0 100644 --- a/dat/maps/layna_village/layna_village_kalya_house_exterior.lua +++ b/dat/maps/layna_village/layna_village_kalya_house_exterior.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_kalya_house_exterior = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -213,6 +210,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local bronann = {}; -- the main map loading code diff --git a/dat/maps/layna_village/layna_village_kalya_house_path.lua b/dat/maps/layna_village/layna_village_kalya_house_path.lua index bc8401f56..8670c85f9 100644 --- a/dat/maps/layna_village/layna_village_kalya_house_path.lua +++ b/dat/maps/layna_village/layna_village_kalya_house_path.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_kalya_house_path = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -268,6 +265,13 @@ layers[5][23] = { 531, 532, 533, -1, -1, -1, 513, 514, 515, 516, -1, -1, -1, -1, -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local bronann = {}; -- the main map loading code diff --git a/dat/maps/layna_village/layna_village_kalya_house_path_small_house.lua b/dat/maps/layna_village/layna_village_kalya_house_path_small_house.lua index 4bd512b42..e5c891a7d 100644 --- a/dat/maps/layna_village/layna_village_kalya_house_path_small_house.lua +++ b/dat/maps/layna_village/layna_village_kalya_house_path_small_house.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_kalya_house_path_small_house = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -209,6 +206,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_riverbank.lua b/dat/maps/layna_village/layna_village_riverbank.lua index e31636206..b89f8adf6 100644 --- a/dat/maps/layna_village/layna_village_riverbank.lua +++ b/dat/maps/layna_village/layna_village_riverbank.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_riverbank = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -352,6 +349,13 @@ layers[4][39] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local bronann = {}; local kalya = {}; local orlinn = {}; diff --git a/dat/maps/layna_village/layna_village_riverbank_house.lua b/dat/maps/layna_village/layna_village_riverbank_house.lua index 703552685..2bdeec48f 100644 --- a/dat/maps/layna_village/layna_village_riverbank_house.lua +++ b/dat/maps/layna_village/layna_village_riverbank_house.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_riverbank_house = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -210,6 +207,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_south_entrance.lua b/dat/maps/layna_village/layna_village_south_entrance.lua index 9f01754f0..b41fcd791 100644 --- a/dat/maps/layna_village/layna_village_south_entrance.lua +++ b/dat/maps/layna_village/layna_village_south_entrance.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_south_entrance = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -241,6 +238,13 @@ layers[4][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + local bronann = {}; local orlinn = {}; diff --git a/dat/maps/layna_village/layna_village_south_entrance_left_house.lua b/dat/maps/layna_village/layna_village_south_entrance_left_house.lua index e59e170d7..f45200c41 100644 --- a/dat/maps/layna_village/layna_village_south_entrance_left_house.lua +++ b/dat/maps/layna_village/layna_village_south_entrance_left_house.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_south_entrance_left_house = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -209,6 +206,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/layna_village/layna_village_south_entrance_right_house.lua b/dat/maps/layna_village/layna_village_south_entrance_right_house.lua index d2196e587..d108f3291 100644 --- a/dat/maps/layna_village/layna_village_south_entrance_right_house.lua +++ b/dat/maps/layna_village/layna_village_south_entrance_right_house.lua @@ -6,9 +6,6 @@ setmetatable(ns, {__index = _G}); layna_village_south_entrance_right_house = ns; setfenv(1, ns); --- A reference to the C++ MapMode object that was created with this file -map = {} - -- The map name, subname and location image map_name = "Mountain Village of Layna" map_image_filename = "img/menus/locations/mountain_village.png" @@ -209,6 +206,13 @@ layers[3][23] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -- Valyria Tear map editor end. Do not edit this line. Place your scripts after this line. -- +-- c++ objects instances +local Map = {}; +local ObjectManager = {}; +local DialogueManager = {}; +local EventManager = {}; +local GlobalEvents = {}; + -- the main character handler local bronann = {}; diff --git a/dat/maps/to_be_continued_anim.lua b/dat/maps/to_be_continued_anim.lua index 68b841bcb..8f61ca370 100644 --- a/dat/maps/to_be_continued_anim.lua +++ b/dat/maps/to_be_continued_anim.lua @@ -13,6 +13,11 @@ local dark_overlay_id = -1; local to_be_continued_text = {}; +-- c++ objects instances +local Map = {}; +local Script = {}; +local Effects = {}; + function Initialize(map_instance) Map = map_instance; diff --git a/src/editor/grid.cpp b/src/editor/grid.cpp index b49c0db22..b184bff91 100644 --- a/src/editor/grid.cpp +++ b/src/editor/grid.cpp @@ -550,10 +550,6 @@ void Grid::SaveMap() std::string main_map_table = std::string(_file_name.section('/', -1).remove(".lua").toAscii()); write_data.WriteNamespace(main_map_table); - write_data.InsertNewLine(); - write_data.WriteComment("A reference to the C++ MapMode object that was created with this file"); - write_data.WriteLine("map = {}"); - write_data.InsertNewLine(); write_data.WriteComment("The map name, subname and location image"); write_data.WriteString("map_name", map_name.toStdString());