Skip to content

Different questions, migration attempt #193

@anass114

Description

@anass114

Hi,

I am currently trying to move a old project that was build around with lua_tinker to LuaBridge , I want to use a modern lua wrapper that will let me to switch between lua engines and try them all easily. I have several issues because of how lua_tinker was handling function returns,calls....

As an example of one of the issues I have :

Consider the current function that it's returning a pointer to an object :

  • void *lwRenderMan::AddScene(char const *pcID);

This function is returning a pointer to an object, this object can be used later in the lua code as parameter. so I don't really understand why I have the error InvalidTypeCast.

The second type of problems I have is :
g_ChatMgrClient:NoticeLevelColor_Add(1, 4294912559, 0xFF000000, true )

The third parameter is an unsigned int, it shouldn't be a problem but I am getting the error : IntegerDoesntFitIntoLuaInteger. I don't know ow to fix it and I already changed the type to __int64.

The third problem I am facing is this one.
This is the old code :

cpp class_<lwRenderMan>(pkState, "RenderMan")
		.def(pkState, constructor<PgRenderMan *>())
		.def(pkState, "AddScene", &lwRenderMan::AddScene)
		.def(pkState, "CleanUpScene", &lwRenderMan::CleanUpScene)
		.def(pkState, "CreateScene", &lwRenderMan::CreateScene)
		.def(pkState, "AddSceneByNo", &lwRenderMan::AddSceneByNo)
		.def(pkState, "RemoveScene", &lwRenderMan::RemoveScene)
		.def(pkState, "RemoveAllScene", &lwRenderMan::RemoveAllScene)
		.def(pkState, "InvalidateSceneContainer", &lwRenderMan::InvalidateSceneContainer)
		//.def(pkState, "PreloadScene", &lwRenderMan::PreloadScene)
		.def(pkState, "FindScene", &lwRenderMan::FindScene)
		.def(pkState, "Draw", &lwRenderMan::Draw)
		.def(pkState, "SetGraphicOption", &lwRenderMan::SetGraphicOption)
		.def(pkState, "SetUseAlphaGroup", &lwRenderMan::SetUseAlphaGroup)
		.def(pkState, "SetFrameDebug", &lwRenderMan::SetFrameDebug)
		;

`In the old code, the lwRenderMan is calling the constructor of PgRenderMan but with luabridge this type of operation isn't permitted, since there are checks to make sure the constructor we are calling is the correct one. So how to replace this code properly.

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions