« Return to Thread: On screen text display high level method proposal

Re: On screen text display high level method proposal

by Christian Walther :: Rate this Message:

Reply to Author | View in Thread

Andrea Viarengo wrote:

> I think that at this point, we have to make some thought about a
> more sophisticated library/plugin system to make Pipmak more modular...
>
> For example, what are you thinking about this:
>
> a folder called lib or plugin or something like at the level of pipmak.exe
> inside the folder we put files with extension .pipmaklib
> which are .zip renamed like "Pipmak Resource"
>
> each pipmaklib file have an own default.lua and own nodes and resources,
>
> On open project, pipmak scans the folder and load every
> default.lua inside the pipmaklib files and load new pipmaklib functions
> that use own nodes and resources included into .pipmaklib files

I don't feel comfortable about loading everything from the start. That
could introduce namespace collisions, and loading plugins that are not
going to be used is a waste of resources. What about requiring project
authors to state what plugins they need using some kind of "require" or
"import" command?

When designing such a system, we should also take care to make it
compatible with the package/module system of Lua 5.1, so we don't have
to redesign everything once we switch to Lua 5.1 with Pipmak 0.3
(probably Lua will be at 5.7 by that time...). Description at
<http://www.lua.org/manual/5.1/manual.html#5.3> and
<http://www.inf.puc-rio.br/~roberto/pil2/chapter15.pdf>, for the reference.

> There only a missing function: pipmak.getos() or pipmak.getplatform()
> which return a string describing the host operating system
> {"osx","linux","win"}, so I can load the correct library
> DLL for windows or .so for OSX or Linux;

Wouldn't it be simpler and less error-prone to just try loading one
after the other of the platform-specific binaries until you find one
that fits? Can you think of a constellation in which that would give
incorrect results?

> To resolve the issue about library nodes which can have the same number,
> I believe that we should introduce the concept of "nodespace"
> there are a nodespace of the project (which own nodes)
> and other nodespaces for each pipmaklib
> lua file of the project or into "Pipmak Resources" have as default
> nodespace that of the project ("../" "/" or something) ,
> lua file inside pipmaklib have as default nodespace of the library
> ("nameofthelib").
> If I don't want use the default I could change it with
> pipmak.setnodespace(ns) (like an unix cd) or retrive the
> current nodespace with pipmak.getnodespace() (like unix pwd),
> in this way I could have project and pipmaklib package with nodes numbered
> with the same number...

I'm having trouble seeing how this would work, but maybe my mind is just
too far removed from Pipmak and Lua at this time... in a C Lua function
within the Pipmak core (like pipmak.getimage), how do you tell whether
the call came from a library or from the project?

The first approach to this problem that comes to my mind is to provide
some function by which modules can register their nodes with Pipmak and
get back a unique (negative) node number, which they then assign to a
name within the module to make it available to users. Pipmak would keep
an internal table of these nodes and would direct accesses by node
number to the correct path.

  -Christian


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

 « Return to Thread: On screen text display high level method proposal