Petr Mrázek 2012-03-18 20:51:13 +01:00
commit 2bec9f6711
3 changed files with 20 additions and 8 deletions

@ -512,6 +512,14 @@ function Allocate(size)
engine.poked(ptr,curptr)
return curptr-size+ptr
end
function initType(object,...)
local m=getmetatable(object)
if m~=nil and m.__setup~=nil then
m.__setup(object,...)
else
error("This object does not have __setup function")
end
end
dofile("dfusion/patterns.lua")
dofile("dfusion/patterns2.lua")
dofile("dfusion/itempatterns.lua")

@ -45,6 +45,14 @@ function mainmenu(t1)
end
end
end
function RunSaved()
print("Locating saves...")
local str=df.world.cur_savegame.save_dir
print("Current region:"..str)
str="data/save/"..str.."/dfusion/init.lua"
print("Trying to run:"..str)
dofile_silent(str)
end
dofile("dfusion/common.lua")
dofile("dfusion/utils.lua")
dofile("dfusion/offsets_misc.lua")
@ -70,14 +78,7 @@ table.insert(plugins,{"saves","run current worlds's init.lua",RunSaved})
loadall(plugins)
dofile_silent("dfusion/initcustom.lua")
function RunSaved()
print("Locating saves...")
local str=df.world.cur_savegame.save_dir
print("Current region:"..str)
str="data/save/"..str.."/dfusion/init.lua"
print("Trying to run:"..str)
dofile_silent(str)
end
if not INIT then
mainmenu(plugins)
end

@ -1,3 +1,6 @@
--<angavrilov> otherwise you just maintain alignment granularity in addition to size for all fields,
-- round up current offset to field alignment,
-- assign structs the max alignment of any field, and round up struct size to its alignment
function type_read(valtype,address)
if valtype.issimple then
--print("Simple read:"..tostring(valtype.ctype))