diff --git a/Source/RuntimeBuilder.Lua.pas b/Source/RuntimeBuilder.Lua.pas index 9122d86..c8dee5b 100644 --- a/Source/RuntimeBuilder.Lua.pas +++ b/Source/RuntimeBuilder.Lua.pas @@ -49,8 +49,8 @@ type consts:TList>; FText:string; //function GetIncLibs():string; - //function GetText:string;override; - //procedure SetText(S:string);override; + function GetText:string;override; + procedure SetText(S:string);override; public constructor Create(Compiler:TRTBLuaCompiler); @@ -359,7 +359,7 @@ end; destructor TRTBLuaCompiler.TRTBLuaSource.TRTBLuaLib.Destroy; begin FreeLibrary(Lib); -end;} +end;*) function TRTBLuaCompiler.TRTBLuaSource.GetText:string; begin @@ -371,7 +371,7 @@ begin FText:=S; end; -constructor TRTBLuaCompiler.TRTBLuaSource.Create(Compiler:TRTBLuaCompiler); +{constructor TRTBLuaCompiler.TRTBLuaSource.Create(Compiler:TRTBLuaCompiler); begin inherited Create(Compiler); FText:=''; @@ -598,11 +598,14 @@ function TRTBLuaCompiler.TRTBLuaSource.Compilate:TRTBModule; PreDecl:=PreDecl+Key+' equ 0'+sLineBreak; end; var - templib,PreDecl:string; + s,PreDecl:string; i,sb:NativeUInt; RegVarDict:TDictionary>; p:pointer; begin +PreDecl:=''; +for s in libs do + PreDecl:=PreDecl+'local '+s+'=require("'+s+'")'; {RegVarDict:=TDictionary>.Create(); with regvars do if Count<>0 then diff --git a/Source/RuntimeBuilder.pas b/Source/RuntimeBuilder.pas index 7adcf68..ebc097f 100644 Binary files a/Source/RuntimeBuilder.pas and b/Source/RuntimeBuilder.pas differ