summaryrefslogtreecommitdiff
path: root/source/tests/05-physfs/main.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-30 11:59:35 +0800
committerchai <chaifix@163.com>2019-03-30 11:59:35 +0800
commitc270d033fa04873ee7a8925dbb00cae5edc4555c (patch)
treeee27a45c5b946b08dd7a726a925028f6ca3eabf1 /source/tests/05-physfs/main.cpp
parent771df5c31cd5653467fd6e76c1a3e002ca39582c (diff)
*misc
Diffstat (limited to 'source/tests/05-physfs/main.cpp')
-rw-r--r--source/tests/05-physfs/main.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/source/tests/05-physfs/main.cpp b/source/tests/05-physfs/main.cpp
index 0ddade0..f30a75b 100644
--- a/source/tests/05-physfs/main.cpp
+++ b/source/tests/05-physfs/main.cpp
@@ -26,19 +26,19 @@ function main()
print(file:GetExtension())
print(file:GetName())
dst = DataBuffer.New(138567)
- thread = Thread.New(EThreadType.DEFFERRED)
+ thread = Thread.New()
local content = ""
local cont = "ok"
if true then
local buff=DataBuffer.New(10)
- print(buff:GetSize())
+ print(buff:GetCapacity())
buff = nil
- end
+ end
local task = IOTask.New("root/physfs2.txt", dst, EIOTaskType.READ, function(db)
function _r()
print("test..............")
local c = db:GetData()
- print(#c)
+ print(c)
end
function err(msg)
print(msg)
@@ -51,15 +51,8 @@ function main()
thread:Start()
while true do
- thread:Post()
+ thread:Dispatch()
Thread.Sleep(100)
- local a = io.read()
- if a == "x" then
- thread:Stop()
- end
- if thread:IsStopped() then
- break
- end
end
end
@@ -76,9 +69,9 @@ int main(int argc, char* args[])
AsuraEngine::UtilsModule utils;
// ÿһasura򱣴һlua stateһһlua߳
- AEScripting::LuaEnv::Get()->Init();
-
- LUAX_STATE(LuaEnv::Get()->GetMainThread());
+ Luax::LuaxVM* vm = new Luax::LuaxVM();
+ vm->Setup();
+ Luax::LuaxState state = vm->GetMainState();
state.OpenLibs();
state.PushGlobalNamespace();
@@ -89,7 +82,7 @@ int main(int argc, char* args[])
state.DoString(code);
- LuaEnv::Get()->Exit();
+ delete vm;
return 0;
} \ No newline at end of file