enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] Port of r99 to Lua 5.1


From: Ronald Lamprecht
Subject: Re: [Enigma-devel] Port of r99 to Lua 5.1
Date: Fri, 31 Mar 2006 22:20:34 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi,

Tacvek schrieb:
The main challenge is to update all the scripts that use %upvalues, and anyhting
else that does not happen to work with lua5.

I faced the "challenge" - the Lua 5.1 upgrade looks quite seamless:

- replace "%upvalue" by "upvalue"
- replace "for k,v in t" by "for k,v in pairs(t)" for table t
- place the opening brace of a function call on the same line as the
identifier; linebreak with the first argument if necessary

with the addition of the library compatibility script and forcing all
Lua access via one of your error handled routines I succeeded quickly in
passing "startup.lua, init.lua, simple_levels.lua, models-nn.lua,
models-2d.lua". (Revision 107) - Use Levels like Enigma I #1 Welcome or #20 - Meditation -.

The app is starting, the menus are running, but on start of a level the
app crashes due to prior problems on load of "models.lua". The reason are problems with all tolua++ class access code:

Error loading './data/models-48.lua'
Error: './data/models.lua:36: attempt to index global 'GS' (a nil value)'

caused by the line:
    local gs = GS:new(d:size())

that should create an object:
px-lua.pkg
    class GS {
        GS (const Rect &clipr);
        ~GS();

        Rect cliprect;
        PackedColor pcolor;
    };

If I comment out the GS object access, the same problem occurs with the
tolua++ Rect object access.

The tolua++ routines are initialized:
d_models.cc
    tolua_px_open(L);

calls
lua/ecl.cc
TOLUA_API int tolua_px_open (lua_State* tolua_S)

The debugger shows that the initialization is performed.


As I have no special tolua++ experience I would be glad if you could
have a look on the problem while I try to convert the Lua level libraries.

Thanks

Ronald





reply via email to

[Prev in Thread] Current Thread [Next in Thread]