Skip to content

Commit

Permalink
Misc global lua var hunt 1
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Yohann Ferreira committed Jan 27, 2013
1 parent 410391c commit 9e36caf
Show file tree
Hide file tree
Showing 29 changed files with 194 additions and 83 deletions.
10 changes: 7 additions & 3 deletions dat/maps/introduction.lua
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
Expand Down
Expand Up @@ -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;

Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_cave1_1.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_cave1_2.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
Expand Up @@ -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;

Expand Down
10 changes: 7 additions & 3 deletions dat/maps/layna_forest/layna_forest_cave2.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {};

Expand Down
5 changes: 5 additions & 0 deletions dat/maps/layna_forest/layna_forest_caves_background_anim.lua
Expand Up @@ -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();
Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_crystal.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_entrance.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
10 changes: 7 additions & 3 deletions dat/maps/layna_forest/layna_forest_north_east.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {};

Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_north_west.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -354,14 +351,21 @@ 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 = {};

-- Orlinn's sprite
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 = "";
Expand Down
10 changes: 7 additions & 3 deletions dat/maps/layna_forest/layna_forest_south_east.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {};

Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_south_west.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
12 changes: 8 additions & 4 deletions dat/maps/layna_forest/layna_forest_wolf_cave.lua
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = "";
Expand Down
10 changes: 7 additions & 3 deletions dat/maps/layna_village/layna_village_bronanns_home.lua
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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 = {};
Expand Down
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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 = {};

Expand Down

0 comments on commit 9e36caf

Please sign in to comment.