mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-18 18:06:44 +00:00
Launcher for the LuaJIT backend.
Looks for main.lua. Launch it like this:
luajit myapp/lib/luigi/launch.lua
If luigi isn't inside the project directory, pass
the path containing main.lua as the second argument.
The path must end with a directory separator.
luajit /opt/luigi/launch.lua ./myapp/
If the app prefixes luigi modules with something
other then 'luigi', pass that prefix as the third
argument.
luajit /opt/luigi/launch.lua ./myapp/ lib.luigi
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local REL = (...):gsub('[^.]*$', '')
|
||||
local APP_ROOT = rawget(_G, 'LUIGI_APP_ROOT') or ''
|
||||
|
||||
local ffi = require 'ffi'
|
||||
local sdl = require(REL .. 'sdl')
|
||||
@@ -207,7 +208,7 @@ function Font:constructor (path, size)
|
||||
local key = path .. '_' .. size
|
||||
|
||||
if not fontCache[key] then
|
||||
local font = SDL2_ttf.TTF_OpenFont(path, size)
|
||||
local font = SDL2_ttf.TTF_OpenFont(APP_ROOT .. path, size)
|
||||
|
||||
if font == nil then
|
||||
error(ffi.string(sdl.getError()))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
local REL = (...):gsub('[^.]*$', '')
|
||||
local APP_ROOT = rawget(_G, 'LUIGI_APP_ROOT') or ''
|
||||
|
||||
local ffi = require 'ffi'
|
||||
local sdl = require(REL .. 'sdl')
|
||||
@@ -15,7 +16,7 @@ end })
|
||||
function Image:constructor (renderer, path)
|
||||
self.sdlRenderer = renderer
|
||||
self.sdlSurface = ffi.gc(
|
||||
SDL2_image.IMG_Load(path),
|
||||
SDL2_image.IMG_Load(APP_ROOT .. path),
|
||||
sdl.freeSurface)
|
||||
|
||||
if self.sdlSurface == nil then
|
||||
|
||||
Reference in New Issue
Block a user