diff --git a/Tupfile.lua b/Tupfile.lua index ca7c32c8..7261de46 100644 --- a/Tupfile.lua +++ b/Tupfile.lua @@ -437,7 +437,7 @@ src += config.modules.thread and 'src/lib/tinycthread/*.c' or nil -- embed resource files with xxd -res = { 'etc/boot.lua', 'etc/*.ttf', 'etc/shaders/*.glsl' } +res = { 'etc/boot.lua', 'etc/nogame.lua', 'etc/*.ttf', 'etc/shaders/*.glsl' } tup.foreach_rule(res, '^ XD %b^ xxd -i %f > %o', '%f.h') for i, pattern in ipairs(res) do diff --git a/etc/boot.lua b/etc/boot.lua index 82405a00..3a4db897 100644 --- a/etc/boot.lua +++ b/etc/boot.lua @@ -1,71 +1,5 @@ lovr = require 'lovr' -local function nogame() - function lovr.conf(t) - t.headset.supersample = true - t.modules.audio = false - t.modules.physics = false - t.modules.thread = false - end - - local models = {} - - function lovr.load() - if not lovr.graphics then - print(string.format('LÖVR %d.%d.%d\nNo game', lovr.getVersion())) - lovr.event.quit() - return - end - - lovr.graphics.setBackground(0x20232c) - - logo = lovr.graphics.newShader([[ - vec4 lovrmain() { - return DefaultPosition; - } - ]], [[ - vec4 lovrmain() { - float y = FragUV.y; - vec2 uv = vec2(FragUV.x, 1. - FragUV.y); - uv = uv * 4. - 2.; - const float k = sqrt(3.); - uv.x = abs(uv.x) - 1.; - uv.y = uv.y + 1. / k + .25; - if (uv.x + k * uv.y > 0.) { - uv = vec2(uv.x - k * uv.y, -k * uv.x - uv.y) / 2.; - } - uv.x -= clamp(uv.x, -2., 0.); - float sdf = -length(uv) * sign(uv.y) - .5; - float w = fwidth(sdf) * .5; - float alpha = smoothstep(.22 + w, .22 - w, sdf); - vec3 color = mix(vec3(.094, .662, .890), vec3(.913, .275, .6), clamp(y * 1.5 - .25, 0., 1.)); - color = mix(color, vec3(.2, .2, .24), smoothstep(-.12 + w, -.12 - w, sdf)); - return vec4(pow(color, vec3(2.2)), alpha); - } - ]]) - end - - function lovr.draw(pass) - local padding = .1 - local font = lovr.graphics.getDefaultFont() - local fade = .315 + .685 * math.abs(math.sin(lovr.headset.getTime() * 2)) - local titlePosition = 1.5 - padding - local subtitlePosition = titlePosition - font:getHeight() * .25 - padding - - pass:setCullMode('back') - pass:setBlendMode('alpha') - pass:setShader(logo) - pass:plane(0, 2, -3) - - pass:setShader() - pass:setColor(1, 1, 1) - pass:text('LÖVR', -.012, titlePosition, -3, .25, quat(0, 0, 1, 0), nil, 'center', 'top') - - pass:setColor(.9, .9, .9, fade) - pass:text('No game :(', -.005, subtitlePosition, -3, .15, 0, 0, 1, 0, nil, 'center', 'top') - end -end - -- Note: Cannot be overloaded function lovr.boot() local conf = { @@ -115,7 +49,7 @@ function lovr.boot() lovr.filesystem = require('lovr.filesystem') local main = arg[0] and arg[0]:match('[^\\/]-%.lua$') or 'main.lua' local hasConf, hasMain = lovr.filesystem.isFile('conf.lua'), lovr.filesystem.isFile(main) - if not lovr.filesystem.getSource() or not (hasConf or hasMain) then nogame() end + if not lovr.filesystem.getSource() or not (hasConf or hasMain) then require('nogame') end -- Shift args up in fused mode, instead of consuming one for the source path if lovr.filesystem.isFused() then diff --git a/etc/nogame.lua b/etc/nogame.lua new file mode 100644 index 00000000..3871bbcc --- /dev/null +++ b/etc/nogame.lua @@ -0,0 +1,402 @@ +function lovr.conf(t) + t.headset.supersample = true + t.modules.audio = false + t.modules.physics = false + t.modules.thread = false +end + +local models = {} + +function lovr.load() + if not lovr.graphics then + print(string.format('LÖVR %d.%d.%d\nNo game', lovr.getVersion())) + lovr.event.quit() + return + end + + lovr.graphics.setBackground(0x20232c) + + --[=[ + logo = lovr.graphics.newShader([[ + vec4 lovrmain() { + return DefaultPosition; + } + ]], [[ + vec4 lovrmain() { + float y = UV.y; + vec2 uv = vec2(UV.x, 1. - UV.y); + uv = uv * 4. - 2.; + const float k = sqrt(3.); + uv.x = abs(uv.x) - 1.; + uv.y = uv.y + 1. / k + .25; + if (uv.x + k * uv.y > 0.) { + uv = vec2(uv.x - k * uv.y, -k * uv.x - uv.y) / 2.; + } + uv.x -= clamp(uv.x, -2., 0.); + float sdf = -length(uv) * sign(uv.y) - .5; + float w = fwidth(sdf) * .5; + float alpha = smoothstep(.22 + w, .22 - w, sdf); + vec3 color = mix(vec3(.094, .662, .890), vec3(.913, .275, .6), clamp(y * 1.5 - .25, 0., 1.)); + color = mix(color, vec3(.2, .2, .24), smoothstep(-.12 + w, -.12 - w, sdf)); + return vec4(pow(color, vec3(2.2)), alpha); + } + ]]) + ]=] + + logo = lovr.graphics.newShader({ + 0x07230203,0x00010300,0x0008000a,0x00000064,0x00000000,0x00020011,0x00000001,0x00020011, + 0x0000114b,0x00020011,0x00001157,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e, + 0x00000000,0x0003000e,0x00000000,0x00000001,0x0010000f,0x00000000,0x00000004,0x6e69616d, + 0x00000000,0x00000009,0x00000015,0x0000001c,0x00000021,0x00000030,0x00000036,0x00000038, + 0x0000003e,0x00000045,0x0000004d,0x00000063,0x00030003,0x00000002,0x000001cc,0x00060004, + 0x455f4c47,0x6d5f5458,0x69746c75,0x77656976,0x00000000,0x000a0004,0x475f4c47,0x4c474f4f, + 0x70635f45,0x74735f70,0x5f656c79,0x656e696c,0x7269645f,0x69746365,0x00006576,0x00080004, + 0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,0x69645f65,0x74636572,0x00657669,0x00040005, + 0x00000004,0x6e69616d,0x00000000,0x00040005,0x00000009,0x6f6c6f43,0x00000072,0x00040005, + 0x0000000b,0x77617244,0x00000000,0x00060006,0x0000000b,0x00000000,0x6e617274,0x726f6673, + 0x0000006d,0x00070006,0x0000000b,0x00000001,0x6d726f6e,0x614d6c61,0x78697274,0x00000000, + 0x00050006,0x0000000b,0x00000002,0x6f6c6f63,0x00000072,0x00050005,0x0000000f,0x77617244, + 0x66667542,0x00007265,0x00050006,0x0000000f,0x00000000,0x77617244,0x00000073,0x00030005, + 0x00000011,0x00000000,0x00060005,0x00000015,0x425f6c67,0x49657361,0x6174736e,0x0065636e, + 0x00050005,0x0000001c,0x74726556,0x6f437865,0x00726f6c,0x00040005,0x00000021,0x6d726f4e, + 0x00006c61,0x00060005,0x00000030,0x74726556,0x6f4e7865,0x6c616d72,0x00000000,0x00030005, + 0x00000036,0x00005655,0x00050005,0x00000038,0x74726556,0x56557865,0x00000000,0x00060005, + 0x0000003c,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x0000003c,0x00000000, + 0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x0000003c,0x00000001,0x505f6c67,0x746e696f, + 0x657a6953,0x00000000,0x00070006,0x0000003c,0x00000002,0x435f6c67,0x4470696c,0x61747369, + 0x0065636e,0x00070006,0x0000003c,0x00000003,0x435f6c67,0x446c6c75,0x61747369,0x0065636e, + 0x00030005,0x0000003e,0x00000000,0x00040005,0x0000003f,0x656d6143,0x00006172,0x00050006, + 0x0000003f,0x00000000,0x77656976,0x00000000,0x00060006,0x0000003f,0x00000001,0x6a6f7270, + 0x69746365,0x00006e6f,0x00070006,0x0000003f,0x00000002,0x77656976,0x6a6f7250,0x69746365, + 0x00006e6f,0x00080006,0x0000003f,0x00000003,0x65766e69,0x50657372,0x656a6f72,0x6f697463, + 0x0000006e,0x00060005,0x00000042,0x656d6143,0x75426172,0x72656666,0x00000000,0x00050006, + 0x00000042,0x00000000,0x656d6143,0x00736172,0x00030005,0x00000044,0x00000000,0x00060005, + 0x00000045,0x565f6c67,0x49776569,0x7865646e,0x00000000,0x00060005,0x0000004d,0x74726556, + 0x6f507865,0x69746973,0x00006e6f,0x00040005,0x00000056,0x706d6153,0x0072656c,0x00060005, + 0x00000057,0x6574614d,0x6c616972,0x66667542,0x00007265,0x00070006,0x00000057,0x00000000, + 0x6574614d,0x6c616972,0x6f6c6f43,0x00000072,0x00060006,0x00000057,0x00000001,0x776f6c47, + 0x6f6c6f43,0x00000072,0x00050006,0x00000057,0x00000002,0x68535655,0x00746669,0x00050006, + 0x00000057,0x00000003,0x63535655,0x00656c61,0x00060006,0x00000057,0x00000004,0x52464453, + 0x65676e61,0x00000000,0x00060006,0x00000057,0x00000005,0x6174654d,0x73656e6c,0x00000073, + 0x00060006,0x00000057,0x00000006,0x67756f52,0x73656e68,0x00000073,0x00060006,0x00000057, + 0x00000007,0x61656c43,0x616f6372,0x00000074,0x00080006,0x00000057,0x00000008,0x61656c43, + 0x616f6372,0x756f5274,0x656e6867,0x00007373,0x00080006,0x00000057,0x00000009,0x6c63634f, + 0x6f697375,0x7274536e,0x74676e65,0x00000068,0x00070006,0x00000057,0x0000000a,0x776f6c47, + 0x65727453,0x6874676e,0x00000000,0x00060006,0x00000057,0x0000000b,0x6d726f4e,0x63536c61, + 0x00656c61,0x00060006,0x00000057,0x0000000c,0x68706c41,0x74754361,0x0066666f,0x00060006, + 0x00000057,0x0000000d,0x6e696f50,0x7a695374,0x00000065,0x00030005,0x00000059,0x00000000, + 0x00060005,0x0000005c,0x6f6c6f43,0x78655472,0x65727574,0x00000000,0x00050005,0x0000005d, + 0x776f6c47,0x74786554,0x00657275,0x00070005,0x0000005e,0x6c63634f,0x6f697375,0x7865546e, + 0x65727574,0x00000000,0x00070005,0x0000005f,0x6174654d,0x73656e6c,0x78655473,0x65727574, + 0x00000000,0x00070005,0x00000060,0x67756f52,0x73656e68,0x78655473,0x65727574,0x00000000, + 0x00070005,0x00000061,0x61656c43,0x616f6372,0x78655474,0x65727574,0x00000000,0x00060005, + 0x00000062,0x6d726f4e,0x65546c61,0x72757478,0x00000065,0x00060005,0x00000063,0x74726556, + 0x61547865,0x6e65676e,0x00000074,0x00040047,0x00000009,0x0000001e,0x0000000b,0x00040048, + 0x0000000b,0x00000000,0x00000005,0x00050048,0x0000000b,0x00000000,0x00000023,0x00000000, + 0x00050048,0x0000000b,0x00000000,0x00000007,0x00000010,0x00040048,0x0000000b,0x00000001, + 0x00000005,0x00050048,0x0000000b,0x00000001,0x00000023,0x00000040,0x00050048,0x0000000b, + 0x00000001,0x00000007,0x00000010,0x00050048,0x0000000b,0x00000002,0x00000023,0x00000080, + 0x00040047,0x0000000e,0x00000006,0x00000090,0x00050048,0x0000000f,0x00000000,0x00000023, + 0x00000000,0x00030047,0x0000000f,0x00000002,0x00040047,0x00000011,0x00000022,0x00000000, + 0x00040047,0x00000011,0x00000021,0x00000001,0x00040047,0x00000015,0x0000000b,0x00001149, + 0x00040047,0x0000001c,0x0000001e,0x0000000d,0x00040047,0x00000021,0x0000001e,0x0000000a, + 0x00040047,0x00000030,0x0000001e,0x0000000b,0x00040047,0x00000036,0x0000001e,0x0000000c, + 0x00040047,0x00000038,0x0000001e,0x0000000c,0x00050048,0x0000003c,0x00000000,0x0000000b, + 0x00000000,0x00050048,0x0000003c,0x00000001,0x0000000b,0x00000001,0x00050048,0x0000003c, + 0x00000002,0x0000000b,0x00000003,0x00050048,0x0000003c,0x00000003,0x0000000b,0x00000004, + 0x00030047,0x0000003c,0x00000002,0x00040048,0x0000003f,0x00000000,0x00000005,0x00050048, + 0x0000003f,0x00000000,0x00000023,0x00000000,0x00050048,0x0000003f,0x00000000,0x00000007, + 0x00000010,0x00040048,0x0000003f,0x00000001,0x00000005,0x00050048,0x0000003f,0x00000001, + 0x00000023,0x00000040,0x00050048,0x0000003f,0x00000001,0x00000007,0x00000010,0x00040048, + 0x0000003f,0x00000002,0x00000005,0x00050048,0x0000003f,0x00000002,0x00000023,0x00000080, + 0x00050048,0x0000003f,0x00000002,0x00000007,0x00000010,0x00040048,0x0000003f,0x00000003, + 0x00000005,0x00050048,0x0000003f,0x00000003,0x00000023,0x000000c0,0x00050048,0x0000003f, + 0x00000003,0x00000007,0x00000010,0x00040047,0x00000041,0x00000006,0x00000100,0x00050048, + 0x00000042,0x00000000,0x00000023,0x00000000,0x00030047,0x00000042,0x00000002,0x00040047, + 0x00000044,0x00000022,0x00000000,0x00040047,0x00000044,0x00000021,0x00000000,0x00040047, + 0x00000045,0x0000000b,0x00001158,0x00040047,0x0000004d,0x0000001e,0x0000000a,0x00040047, + 0x00000056,0x00000022,0x00000000,0x00040047,0x00000056,0x00000021,0x00000002,0x00050048, + 0x00000057,0x00000000,0x00000023,0x00000000,0x00050048,0x00000057,0x00000001,0x00000023, + 0x00000010,0x00050048,0x00000057,0x00000002,0x00000023,0x00000020,0x00050048,0x00000057, + 0x00000003,0x00000023,0x00000028,0x00050048,0x00000057,0x00000004,0x00000023,0x00000030, + 0x00050048,0x00000057,0x00000005,0x00000023,0x00000038,0x00050048,0x00000057,0x00000006, + 0x00000023,0x0000003c,0x00050048,0x00000057,0x00000007,0x00000023,0x00000040,0x00050048, + 0x00000057,0x00000008,0x00000023,0x00000044,0x00050048,0x00000057,0x00000009,0x00000023, + 0x00000048,0x00050048,0x00000057,0x0000000a,0x00000023,0x0000004c,0x00050048,0x00000057, + 0x0000000b,0x00000023,0x00000050,0x00050048,0x00000057,0x0000000c,0x00000023,0x00000054, + 0x00050048,0x00000057,0x0000000d,0x00000023,0x00000058,0x00030047,0x00000057,0x00000002, + 0x00040047,0x00000059,0x00000022,0x00000001,0x00040047,0x00000059,0x00000021,0x00000000, + 0x00040047,0x0000005c,0x00000022,0x00000001,0x00040047,0x0000005c,0x00000021,0x00000001, + 0x00040047,0x0000005d,0x00000022,0x00000001,0x00040047,0x0000005d,0x00000021,0x00000002, + 0x00040047,0x0000005e,0x00000022,0x00000001,0x00040047,0x0000005e,0x00000021,0x00000003, + 0x00040047,0x0000005f,0x00000022,0x00000001,0x00040047,0x0000005f,0x00000021,0x00000004, + 0x00040047,0x00000060,0x00000022,0x00000001,0x00040047,0x00000060,0x00000021,0x00000005, + 0x00040047,0x00000061,0x00000022,0x00000001,0x00040047,0x00000061,0x00000021,0x00000006, + 0x00040047,0x00000062,0x00000022,0x00000001,0x00040047,0x00000062,0x00000021,0x00000007, + 0x00040047,0x00000063,0x0000001e,0x0000000e,0x00020013,0x00000002,0x00030021,0x00000003, + 0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004, + 0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003, + 0x00040018,0x0000000a,0x00000007,0x00000004,0x0005001e,0x0000000b,0x0000000a,0x0000000a, + 0x00000007,0x00040015,0x0000000c,0x00000020,0x00000000,0x0004002b,0x0000000c,0x0000000d, + 0x00000100,0x0004001c,0x0000000e,0x0000000b,0x0000000d,0x0003001e,0x0000000f,0x0000000e, + 0x00040020,0x00000010,0x00000002,0x0000000f,0x0004003b,0x00000010,0x00000011,0x00000002, + 0x00040015,0x00000012,0x00000020,0x00000001,0x0004002b,0x00000012,0x00000013,0x00000000, + 0x00040020,0x00000014,0x00000001,0x00000012,0x0004003b,0x00000014,0x00000015,0x00000001, + 0x0004002b,0x00000012,0x00000017,0x00000002,0x00040020,0x00000018,0x00000002,0x00000007, + 0x00040020,0x0000001b,0x00000001,0x00000007,0x0004003b,0x0000001b,0x0000001c,0x00000001, + 0x00040017,0x0000001f,0x00000006,0x00000003,0x00040020,0x00000020,0x00000003,0x0000001f, + 0x0004003b,0x00000020,0x00000021,0x00000003,0x0004002b,0x00000012,0x00000023,0x00000001, + 0x00040020,0x00000024,0x00000002,0x0000000a,0x00040018,0x00000027,0x0000001f,0x00000003, + 0x00040020,0x0000002f,0x00000001,0x0000001f,0x0004003b,0x0000002f,0x00000030,0x00000001, + 0x00040017,0x00000034,0x00000006,0x00000002,0x00040020,0x00000035,0x00000003,0x00000034, + 0x0004003b,0x00000035,0x00000036,0x00000003,0x00040020,0x00000037,0x00000001,0x00000034, + 0x0004003b,0x00000037,0x00000038,0x00000001,0x0004002b,0x0000000c,0x0000003a,0x00000001, + 0x0004001c,0x0000003b,0x00000006,0x0000003a,0x0006001e,0x0000003c,0x00000007,0x00000006, + 0x0000003b,0x0000003b,0x00040020,0x0000003d,0x00000003,0x0000003c,0x0004003b,0x0000003d, + 0x0000003e,0x00000003,0x0006001e,0x0000003f,0x0000000a,0x0000000a,0x0000000a,0x0000000a, + 0x0004002b,0x0000000c,0x00000040,0x00000006,0x0004001c,0x00000041,0x0000003f,0x00000040, + 0x0003001e,0x00000042,0x00000041,0x00040020,0x00000043,0x00000002,0x00000042,0x0004003b, + 0x00000043,0x00000044,0x00000002,0x0004003b,0x00000014,0x00000045,0x00000001,0x0004003b, + 0x0000001b,0x0000004d,0x00000001,0x0004002b,0x00000006,0x00000051,0x3f800000,0x00040020, + 0x00000052,0x00000003,0x00000006,0x0002001a,0x00000054,0x00040020,0x00000055,0x00000000, + 0x00000054,0x0004003b,0x00000055,0x00000056,0x00000000,0x0010001e,0x00000057,0x00000007, + 0x00000007,0x00000034,0x00000034,0x00000034,0x00000006,0x00000006,0x00000006,0x00000006, + 0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00040020,0x00000058,0x00000002, + 0x00000057,0x0004003b,0x00000058,0x00000059,0x00000002,0x00090019,0x0000005a,0x00000006, + 0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x00040020,0x0000005b, + 0x00000000,0x0000005a,0x0004003b,0x0000005b,0x0000005c,0x00000000,0x0004003b,0x0000005b, + 0x0000005d,0x00000000,0x0004003b,0x0000005b,0x0000005e,0x00000000,0x0004003b,0x0000005b, + 0x0000005f,0x00000000,0x0004003b,0x0000005b,0x00000060,0x00000000,0x0004003b,0x0000005b, + 0x00000061,0x00000000,0x0004003b,0x0000005b,0x00000062,0x00000000,0x0004003b,0x0000002f, + 0x00000063,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8, + 0x00000005,0x0004003d,0x00000012,0x00000016,0x00000015,0x00070041,0x00000018,0x00000019, + 0x00000011,0x00000013,0x00000016,0x00000017,0x0004003d,0x00000007,0x0000001a,0x00000019, + 0x0004003d,0x00000007,0x0000001d,0x0000001c,0x00050085,0x00000007,0x0000001e,0x0000001a, + 0x0000001d,0x0003003e,0x00000009,0x0000001e,0x0004003d,0x00000012,0x00000022,0x00000015, + 0x00070041,0x00000024,0x00000025,0x00000011,0x00000013,0x00000022,0x00000023,0x0004003d, + 0x0000000a,0x00000026,0x00000025,0x00050051,0x00000007,0x00000028,0x00000026,0x00000000, + 0x0008004f,0x0000001f,0x00000029,0x00000028,0x00000028,0x00000000,0x00000001,0x00000002, + 0x00050051,0x00000007,0x0000002a,0x00000026,0x00000001,0x0008004f,0x0000001f,0x0000002b, + 0x0000002a,0x0000002a,0x00000000,0x00000001,0x00000002,0x00050051,0x00000007,0x0000002c, + 0x00000026,0x00000002,0x0008004f,0x0000001f,0x0000002d,0x0000002c,0x0000002c,0x00000000, + 0x00000001,0x00000002,0x00060050,0x00000027,0x0000002e,0x00000029,0x0000002b,0x0000002d, + 0x0004003d,0x0000001f,0x00000031,0x00000030,0x00050091,0x0000001f,0x00000032,0x0000002e, + 0x00000031,0x0006000c,0x0000001f,0x00000033,0x00000001,0x00000045,0x00000032,0x0003003e, + 0x00000021,0x00000033,0x0004003d,0x00000034,0x00000039,0x00000038,0x0003003e,0x00000036, + 0x00000039,0x0004003d,0x00000012,0x00000046,0x00000045,0x00070041,0x00000024,0x00000047, + 0x00000044,0x00000013,0x00000046,0x00000017,0x0004003d,0x0000000a,0x00000048,0x00000047, + 0x0004003d,0x00000012,0x00000049,0x00000015,0x00070041,0x00000024,0x0000004a,0x00000011, + 0x00000013,0x00000049,0x00000013,0x0004003d,0x0000000a,0x0000004b,0x0000004a,0x00050092, + 0x0000000a,0x0000004c,0x00000048,0x0000004b,0x0004003d,0x00000007,0x0000004e,0x0000004d, + 0x00050091,0x00000007,0x0000004f,0x0000004c,0x0000004e,0x00050041,0x00000008,0x00000050, + 0x0000003e,0x00000013,0x0003003e,0x00000050,0x0000004f,0x00050041,0x00000052,0x00000053, + 0x0000003e,0x00000023,0x0003003e,0x00000053,0x00000051,0x000100fd,0x00010038 + }, { + 0x07230203,0x00010300,0x0008000a,0x000000b7,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, + 0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x00000089,0x000000b4, + 0x000000b6,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001cc,0x00060004, + 0x455f4c47,0x6d5f5458,0x69746c75,0x77656976,0x00000000,0x000a0004,0x475f4c47,0x4c474f4f, + 0x70635f45,0x74735f70,0x5f656c79,0x656e696c,0x7269645f,0x69746365,0x00006576,0x00080004, + 0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,0x69645f65,0x74636572,0x00657669,0x00040005, + 0x00000004,0x6e69616d,0x00000000,0x00030005,0x00000008,0x00000079,0x00030005,0x0000000b, + 0x00005655,0x00030005,0x00000012,0x00007675,0x00030005,0x00000051,0x00666473,0x00030005, + 0x0000005b,0x00000077,0x00040005,0x0000005f,0x68706c61,0x00000061,0x00040005,0x00000069, + 0x6f6c6f63,0x00000072,0x00050005,0x00000089,0x65786950,0x6c6f436c,0x0073726f,0x00040005, + 0x00000098,0x656d6143,0x00006172,0x00050006,0x00000098,0x00000000,0x77656976,0x00000000, + 0x00060006,0x00000098,0x00000001,0x6a6f7270,0x69746365,0x00006e6f,0x00070006,0x00000098, + 0x00000002,0x77656976,0x6a6f7250,0x69746365,0x00006e6f,0x00080006,0x00000098,0x00000003, + 0x65766e69,0x50657372,0x656a6f72,0x6f697463,0x0000006e,0x00060005,0x0000009b,0x656d6143, + 0x75426172,0x72656666,0x00000000,0x00050006,0x0000009b,0x00000000,0x656d6143,0x00736172, + 0x00030005,0x0000009d,0x00000000,0x00040005,0x0000009e,0x77617244,0x00000000,0x00060006, + 0x0000009e,0x00000000,0x6e617274,0x726f6673,0x0000006d,0x00070006,0x0000009e,0x00000001, + 0x6d726f6e,0x614d6c61,0x78697274,0x00000000,0x00050006,0x0000009e,0x00000002,0x6f6c6f63, + 0x00000072,0x00050005,0x000000a1,0x77617244,0x66667542,0x00007265,0x00050006,0x000000a1, + 0x00000000,0x77617244,0x00000073,0x00030005,0x000000a3,0x00000000,0x00040005,0x000000a6, + 0x706d6153,0x0072656c,0x00060005,0x000000a7,0x6574614d,0x6c616972,0x66667542,0x00007265, + 0x00070006,0x000000a7,0x00000000,0x6574614d,0x6c616972,0x6f6c6f43,0x00000072,0x00060006, + 0x000000a7,0x00000001,0x776f6c47,0x6f6c6f43,0x00000072,0x00050006,0x000000a7,0x00000002, + 0x68535655,0x00746669,0x00050006,0x000000a7,0x00000003,0x63535655,0x00656c61,0x00060006, + 0x000000a7,0x00000004,0x52464453,0x65676e61,0x00000000,0x00060006,0x000000a7,0x00000005, + 0x6174654d,0x73656e6c,0x00000073,0x00060006,0x000000a7,0x00000006,0x67756f52,0x73656e68, + 0x00000073,0x00060006,0x000000a7,0x00000007,0x61656c43,0x616f6372,0x00000074,0x00080006, + 0x000000a7,0x00000008,0x61656c43,0x616f6372,0x756f5274,0x656e6867,0x00007373,0x00080006, + 0x000000a7,0x00000009,0x6c63634f,0x6f697375,0x7274536e,0x74676e65,0x00000068,0x00070006, + 0x000000a7,0x0000000a,0x776f6c47,0x65727453,0x6874676e,0x00000000,0x00060006,0x000000a7, + 0x0000000b,0x6d726f4e,0x63536c61,0x00656c61,0x00060006,0x000000a7,0x0000000c,0x68706c41, + 0x74754361,0x0066666f,0x00060006,0x000000a7,0x0000000d,0x6e696f50,0x7a695374,0x00000065, + 0x00030005,0x000000a9,0x00000000,0x00060005,0x000000ac,0x6f6c6f43,0x78655472,0x65727574, + 0x00000000,0x00050005,0x000000ad,0x776f6c47,0x74786554,0x00657275,0x00070005,0x000000ae, + 0x6c63634f,0x6f697375,0x7865546e,0x65727574,0x00000000,0x00070005,0x000000af,0x6174654d, + 0x73656e6c,0x78655473,0x65727574,0x00000000,0x00070005,0x000000b0,0x67756f52,0x73656e68, + 0x78655473,0x65727574,0x00000000,0x00070005,0x000000b1,0x61656c43,0x616f6372,0x78655474, + 0x65727574,0x00000000,0x00060005,0x000000b2,0x6d726f4e,0x65546c61,0x72757478,0x00000065, + 0x00040005,0x000000b4,0x6d726f4e,0x00006c61,0x00040005,0x000000b6,0x6f6c6f43,0x00000072, + 0x00040047,0x0000000b,0x0000001e,0x0000000c,0x00040047,0x00000089,0x0000001e,0x00000000, + 0x00040048,0x00000098,0x00000000,0x00000005,0x00050048,0x00000098,0x00000000,0x00000023, + 0x00000000,0x00050048,0x00000098,0x00000000,0x00000007,0x00000010,0x00040048,0x00000098, + 0x00000001,0x00000005,0x00050048,0x00000098,0x00000001,0x00000023,0x00000040,0x00050048, + 0x00000098,0x00000001,0x00000007,0x00000010,0x00040048,0x00000098,0x00000002,0x00000005, + 0x00050048,0x00000098,0x00000002,0x00000023,0x00000080,0x00050048,0x00000098,0x00000002, + 0x00000007,0x00000010,0x00040048,0x00000098,0x00000003,0x00000005,0x00050048,0x00000098, + 0x00000003,0x00000023,0x000000c0,0x00050048,0x00000098,0x00000003,0x00000007,0x00000010, + 0x00040047,0x0000009a,0x00000006,0x00000100,0x00050048,0x0000009b,0x00000000,0x00000023, + 0x00000000,0x00030047,0x0000009b,0x00000002,0x00040047,0x0000009d,0x00000022,0x00000000, + 0x00040047,0x0000009d,0x00000021,0x00000000,0x00040048,0x0000009e,0x00000000,0x00000005, + 0x00050048,0x0000009e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000009e,0x00000000, + 0x00000007,0x00000010,0x00040048,0x0000009e,0x00000001,0x00000005,0x00050048,0x0000009e, + 0x00000001,0x00000023,0x00000040,0x00050048,0x0000009e,0x00000001,0x00000007,0x00000010, + 0x00050048,0x0000009e,0x00000002,0x00000023,0x00000080,0x00040047,0x000000a0,0x00000006, + 0x00000090,0x00050048,0x000000a1,0x00000000,0x00000023,0x00000000,0x00030047,0x000000a1, + 0x00000002,0x00040047,0x000000a3,0x00000022,0x00000000,0x00040047,0x000000a3,0x00000021, + 0x00000001,0x00040047,0x000000a6,0x00000022,0x00000000,0x00040047,0x000000a6,0x00000021, + 0x00000002,0x00050048,0x000000a7,0x00000000,0x00000023,0x00000000,0x00050048,0x000000a7, + 0x00000001,0x00000023,0x00000010,0x00050048,0x000000a7,0x00000002,0x00000023,0x00000020, + 0x00050048,0x000000a7,0x00000003,0x00000023,0x00000028,0x00050048,0x000000a7,0x00000004, + 0x00000023,0x00000030,0x00050048,0x000000a7,0x00000005,0x00000023,0x00000038,0x00050048, + 0x000000a7,0x00000006,0x00000023,0x0000003c,0x00050048,0x000000a7,0x00000007,0x00000023, + 0x00000040,0x00050048,0x000000a7,0x00000008,0x00000023,0x00000044,0x00050048,0x000000a7, + 0x00000009,0x00000023,0x00000048,0x00050048,0x000000a7,0x0000000a,0x00000023,0x0000004c, + 0x00050048,0x000000a7,0x0000000b,0x00000023,0x00000050,0x00050048,0x000000a7,0x0000000c, + 0x00000023,0x00000054,0x00050048,0x000000a7,0x0000000d,0x00000023,0x00000058,0x00030047, + 0x000000a7,0x00000002,0x00040047,0x000000a9,0x00000022,0x00000001,0x00040047,0x000000a9, + 0x00000021,0x00000000,0x00040047,0x000000ac,0x00000022,0x00000001,0x00040047,0x000000ac, + 0x00000021,0x00000001,0x00040047,0x000000ad,0x00000022,0x00000001,0x00040047,0x000000ad, + 0x00000021,0x00000002,0x00040047,0x000000ae,0x00000022,0x00000001,0x00040047,0x000000ae, + 0x00000021,0x00000003,0x00040047,0x000000af,0x00000022,0x00000001,0x00040047,0x000000af, + 0x00000021,0x00000004,0x00040047,0x000000b0,0x00000022,0x00000001,0x00040047,0x000000b0, + 0x00000021,0x00000005,0x00040047,0x000000b1,0x00000022,0x00000001,0x00040047,0x000000b1, + 0x00000021,0x00000006,0x00040047,0x000000b2,0x00000022,0x00000001,0x00040047,0x000000b2, + 0x00000021,0x00000007,0x00040047,0x000000b4,0x0000001e,0x0000000a,0x00040047,0x000000b6, + 0x0000001e,0x0000000b,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016, + 0x00000006,0x00000020,0x00040020,0x00000007,0x00000007,0x00000006,0x00040017,0x00000009, + 0x00000006,0x00000002,0x00040020,0x0000000a,0x00000001,0x00000009,0x0004003b,0x0000000a, + 0x0000000b,0x00000001,0x00040015,0x0000000c,0x00000020,0x00000000,0x0004002b,0x0000000c, + 0x0000000d,0x00000001,0x00040020,0x0000000e,0x00000001,0x00000006,0x00040020,0x00000011, + 0x00000007,0x00000009,0x0004002b,0x0000000c,0x00000013,0x00000000,0x0004002b,0x00000006, + 0x00000016,0x3f800000,0x0004002b,0x00000006,0x0000001c,0x40800000,0x0004002b,0x00000006, + 0x0000001e,0x40000000,0x0004002b,0x00000006,0x00000028,0x3f13cd3a,0x0004002b,0x00000006, + 0x0000002a,0x3e800000,0x0004002b,0x00000006,0x0000002f,0x3fddb3d7,0x0004002b,0x00000006, + 0x00000034,0x00000000,0x00020014,0x00000035,0x0004002b,0x00000006,0x0000003f,0xbfddb3d7, + 0x0004002b,0x00000006,0x0000004b,0xc0000000,0x0004002b,0x00000006,0x00000059,0x3f000000, + 0x0004002b,0x00000006,0x00000060,0x3e6147ae,0x00040017,0x00000067,0x00000006,0x00000003, + 0x00040020,0x00000068,0x00000007,0x00000067,0x0004002b,0x00000006,0x0000006a,0x3dc08312, + 0x0004002b,0x00000006,0x0000006b,0x3f2978d5,0x0004002b,0x00000006,0x0000006c,0x3f63d70a, + 0x0006002c,0x00000067,0x0000006d,0x0000006a,0x0000006b,0x0000006c,0x0004002b,0x00000006, + 0x0000006e,0x3f69ba5e,0x0004002b,0x00000006,0x0000006f,0x3e8ccccd,0x0004002b,0x00000006, + 0x00000070,0x3f19999a,0x0006002c,0x00000067,0x00000071,0x0000006e,0x0000006f,0x00000070, + 0x0004002b,0x00000006,0x00000073,0x3fc00000,0x0004002b,0x00000006,0x0000007a,0x3e4ccccd, + 0x0004002b,0x00000006,0x0000007b,0x3e75c28f,0x0006002c,0x00000067,0x0000007c,0x0000007a, + 0x0000007a,0x0000007b,0x0004002b,0x00000006,0x0000007d,0xbdf5c28f,0x00040017,0x00000086, + 0x00000006,0x00000004,0x0004001c,0x00000087,0x00000086,0x0000000d,0x00040020,0x00000088, + 0x00000003,0x00000087,0x0004003b,0x00000088,0x00000089,0x00000003,0x00040015,0x0000008a, + 0x00000020,0x00000001,0x0004002b,0x0000008a,0x0000008b,0x00000000,0x0004002b,0x00000006, + 0x0000008d,0x400ccccd,0x0006002c,0x00000067,0x0000008e,0x0000008d,0x0000008d,0x0000008d, + 0x00040020,0x00000095,0x00000003,0x00000086,0x00040018,0x00000097,0x00000086,0x00000004, + 0x0006001e,0x00000098,0x00000097,0x00000097,0x00000097,0x00000097,0x0004002b,0x0000000c, + 0x00000099,0x00000006,0x0004001c,0x0000009a,0x00000098,0x00000099,0x0003001e,0x0000009b, + 0x0000009a,0x00040020,0x0000009c,0x00000002,0x0000009b,0x0004003b,0x0000009c,0x0000009d, + 0x00000002,0x0005001e,0x0000009e,0x00000097,0x00000097,0x00000086,0x0004002b,0x0000000c, + 0x0000009f,0x00000100,0x0004001c,0x000000a0,0x0000009e,0x0000009f,0x0003001e,0x000000a1, + 0x000000a0,0x00040020,0x000000a2,0x00000002,0x000000a1,0x0004003b,0x000000a2,0x000000a3, + 0x00000002,0x0002001a,0x000000a4,0x00040020,0x000000a5,0x00000000,0x000000a4,0x0004003b, + 0x000000a5,0x000000a6,0x00000000,0x0010001e,0x000000a7,0x00000086,0x00000086,0x00000009, + 0x00000009,0x00000009,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006, + 0x00000006,0x00000006,0x00000006,0x00040020,0x000000a8,0x00000002,0x000000a7,0x0004003b, + 0x000000a8,0x000000a9,0x00000002,0x00090019,0x000000aa,0x00000006,0x00000001,0x00000000, + 0x00000000,0x00000000,0x00000001,0x00000000,0x00040020,0x000000ab,0x00000000,0x000000aa, + 0x0004003b,0x000000ab,0x000000ac,0x00000000,0x0004003b,0x000000ab,0x000000ad,0x00000000, + 0x0004003b,0x000000ab,0x000000ae,0x00000000,0x0004003b,0x000000ab,0x000000af,0x00000000, + 0x0004003b,0x000000ab,0x000000b0,0x00000000,0x0004003b,0x000000ab,0x000000b1,0x00000000, + 0x0004003b,0x000000ab,0x000000b2,0x00000000,0x00040020,0x000000b3,0x00000001,0x00000067, + 0x0004003b,0x000000b3,0x000000b4,0x00000001,0x00040020,0x000000b5,0x00000001,0x00000086, + 0x0004003b,0x000000b5,0x000000b6,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000, + 0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000007,0x00000008,0x00000007,0x0004003b, + 0x00000011,0x00000012,0x00000007,0x0004003b,0x00000007,0x00000051,0x00000007,0x0004003b, + 0x00000007,0x0000005b,0x00000007,0x0004003b,0x00000007,0x0000005f,0x00000007,0x0004003b, + 0x00000068,0x00000069,0x00000007,0x00050041,0x0000000e,0x0000000f,0x0000000b,0x0000000d, + 0x0004003d,0x00000006,0x00000010,0x0000000f,0x0003003e,0x00000008,0x00000010,0x00050041, + 0x0000000e,0x00000014,0x0000000b,0x00000013,0x0004003d,0x00000006,0x00000015,0x00000014, + 0x00050041,0x0000000e,0x00000017,0x0000000b,0x0000000d,0x0004003d,0x00000006,0x00000018, + 0x00000017,0x00050083,0x00000006,0x00000019,0x00000016,0x00000018,0x00050050,0x00000009, + 0x0000001a,0x00000015,0x00000019,0x0003003e,0x00000012,0x0000001a,0x0004003d,0x00000009, + 0x0000001b,0x00000012,0x0005008e,0x00000009,0x0000001d,0x0000001b,0x0000001c,0x00050050, + 0x00000009,0x0000001f,0x0000001e,0x0000001e,0x00050083,0x00000009,0x00000020,0x0000001d, + 0x0000001f,0x0003003e,0x00000012,0x00000020,0x00050041,0x00000007,0x00000021,0x00000012, + 0x00000013,0x0004003d,0x00000006,0x00000022,0x00000021,0x0006000c,0x00000006,0x00000023, + 0x00000001,0x00000004,0x00000022,0x00050083,0x00000006,0x00000024,0x00000023,0x00000016, + 0x00050041,0x00000007,0x00000025,0x00000012,0x00000013,0x0003003e,0x00000025,0x00000024, + 0x00050041,0x00000007,0x00000026,0x00000012,0x0000000d,0x0004003d,0x00000006,0x00000027, + 0x00000026,0x00050081,0x00000006,0x00000029,0x00000027,0x00000028,0x00050081,0x00000006, + 0x0000002b,0x00000029,0x0000002a,0x00050041,0x00000007,0x0000002c,0x00000012,0x0000000d, + 0x0003003e,0x0000002c,0x0000002b,0x00050041,0x00000007,0x0000002d,0x00000012,0x00000013, + 0x0004003d,0x00000006,0x0000002e,0x0000002d,0x00050041,0x00000007,0x00000030,0x00000012, + 0x0000000d,0x0004003d,0x00000006,0x00000031,0x00000030,0x00050085,0x00000006,0x00000032, + 0x0000002f,0x00000031,0x00050081,0x00000006,0x00000033,0x0000002e,0x00000032,0x000500ba, + 0x00000035,0x00000036,0x00000033,0x00000034,0x000300f7,0x00000038,0x00000000,0x000400fa, + 0x00000036,0x00000037,0x00000038,0x000200f8,0x00000037,0x00050041,0x00000007,0x00000039, + 0x00000012,0x00000013,0x0004003d,0x00000006,0x0000003a,0x00000039,0x00050041,0x00000007, + 0x0000003b,0x00000012,0x0000000d,0x0004003d,0x00000006,0x0000003c,0x0000003b,0x00050085, + 0x00000006,0x0000003d,0x0000002f,0x0000003c,0x00050083,0x00000006,0x0000003e,0x0000003a, + 0x0000003d,0x00050041,0x00000007,0x00000040,0x00000012,0x00000013,0x0004003d,0x00000006, + 0x00000041,0x00000040,0x00050085,0x00000006,0x00000042,0x0000003f,0x00000041,0x00050041, + 0x00000007,0x00000043,0x00000012,0x0000000d,0x0004003d,0x00000006,0x00000044,0x00000043, + 0x00050083,0x00000006,0x00000045,0x00000042,0x00000044,0x00050050,0x00000009,0x00000046, + 0x0000003e,0x00000045,0x00050050,0x00000009,0x00000047,0x0000001e,0x0000001e,0x00050088, + 0x00000009,0x00000048,0x00000046,0x00000047,0x0003003e,0x00000012,0x00000048,0x000200f9, + 0x00000038,0x000200f8,0x00000038,0x00050041,0x00000007,0x00000049,0x00000012,0x00000013, + 0x0004003d,0x00000006,0x0000004a,0x00000049,0x0008000c,0x00000006,0x0000004c,0x00000001, + 0x0000002b,0x0000004a,0x0000004b,0x00000034,0x00050041,0x00000007,0x0000004d,0x00000012, + 0x00000013,0x0004003d,0x00000006,0x0000004e,0x0000004d,0x00050083,0x00000006,0x0000004f, + 0x0000004e,0x0000004c,0x00050041,0x00000007,0x00000050,0x00000012,0x00000013,0x0003003e, + 0x00000050,0x0000004f,0x0004003d,0x00000009,0x00000052,0x00000012,0x0006000c,0x00000006, + 0x00000053,0x00000001,0x00000042,0x00000052,0x0004007f,0x00000006,0x00000054,0x00000053, + 0x00050041,0x00000007,0x00000055,0x00000012,0x0000000d,0x0004003d,0x00000006,0x00000056, + 0x00000055,0x0006000c,0x00000006,0x00000057,0x00000001,0x00000006,0x00000056,0x00050085, + 0x00000006,0x00000058,0x00000054,0x00000057,0x00050083,0x00000006,0x0000005a,0x00000058, + 0x00000059,0x0003003e,0x00000051,0x0000005a,0x0004003d,0x00000006,0x0000005c,0x00000051, + 0x000400d1,0x00000006,0x0000005d,0x0000005c,0x00050085,0x00000006,0x0000005e,0x0000005d, + 0x00000059,0x0003003e,0x0000005b,0x0000005e,0x0004003d,0x00000006,0x00000061,0x0000005b, + 0x00050081,0x00000006,0x00000062,0x00000060,0x00000061,0x0004003d,0x00000006,0x00000063, + 0x0000005b,0x00050083,0x00000006,0x00000064,0x00000060,0x00000063,0x0004003d,0x00000006, + 0x00000065,0x00000051,0x0008000c,0x00000006,0x00000066,0x00000001,0x00000031,0x00000062, + 0x00000064,0x00000065,0x0003003e,0x0000005f,0x00000066,0x0004003d,0x00000006,0x00000072, + 0x00000008,0x00050085,0x00000006,0x00000074,0x00000072,0x00000073,0x00050083,0x00000006, + 0x00000075,0x00000074,0x0000002a,0x0008000c,0x00000006,0x00000076,0x00000001,0x0000002b, + 0x00000075,0x00000034,0x00000016,0x00060050,0x00000067,0x00000077,0x00000076,0x00000076, + 0x00000076,0x0008000c,0x00000067,0x00000078,0x00000001,0x0000002e,0x0000006d,0x00000071, + 0x00000077,0x0003003e,0x00000069,0x00000078,0x0004003d,0x00000067,0x00000079,0x00000069, + 0x0004003d,0x00000006,0x0000007e,0x0000005b,0x00050081,0x00000006,0x0000007f,0x0000007d, + 0x0000007e,0x0004003d,0x00000006,0x00000080,0x0000005b,0x00050083,0x00000006,0x00000081, + 0x0000007d,0x00000080,0x0004003d,0x00000006,0x00000082,0x00000051,0x0008000c,0x00000006, + 0x00000083,0x00000001,0x00000031,0x0000007f,0x00000081,0x00000082,0x00060050,0x00000067, + 0x00000084,0x00000083,0x00000083,0x00000083,0x0008000c,0x00000067,0x00000085,0x00000001, + 0x0000002e,0x00000079,0x0000007c,0x00000084,0x0003003e,0x00000069,0x00000085,0x0004003d, + 0x00000067,0x0000008c,0x00000069,0x0007000c,0x00000067,0x0000008f,0x00000001,0x0000001a, + 0x0000008c,0x0000008e,0x0004003d,0x00000006,0x00000090,0x0000005f,0x00050051,0x00000006, + 0x00000091,0x0000008f,0x00000000,0x00050051,0x00000006,0x00000092,0x0000008f,0x00000001, + 0x00050051,0x00000006,0x00000093,0x0000008f,0x00000002,0x00070050,0x00000086,0x00000094, + 0x00000091,0x00000092,0x00000093,0x00000090,0x00050041,0x00000095,0x00000096,0x00000089, + 0x0000008b,0x0003003e,0x00000096,0x00000094,0x000100fd,0x00010038 + }) +end + +function lovr.draw(pass) + local padding = .1 + local font = lovr.graphics.getDefaultFont() + local fade = .315 + .685 * math.abs(math.sin(lovr.headset.getTime() * 2)) + local titlePosition = 1.5 - padding + local subtitlePosition = titlePosition - font:getHeight() * .25 - padding + + pass:setCullMode('back') + pass:setBlendMode('alpha') + pass:setShader(logo) + pass:plane(0, 2, -3) + + pass:setShader() + pass:setColor(1, 1, 1) + pass:text('LÖVR', -.012, titlePosition, -3, .25, quat(0, 0, 1, 0), nil, 'center', 'top') + + pass:setColor(.9, .9, .9, fade) + pass:text('No game :(', -.005, subtitlePosition, -3, .15, 0, 0, 1, 0, nil, 'center', 'top') +end diff --git a/src/api/l_graphics.c b/src/api/l_graphics.c index 0737484c..df0dde37 100644 --- a/src/api/l_graphics.c +++ b/src/api/l_graphics.c @@ -1009,6 +1009,17 @@ static Blob* luax_checkshadercode(lua_State* L, int index, ShaderStage stage) { lovrAssert(data, "Out of memory"); memcpy(data, string, length); source = lovrBlobCreate(data, length, "Shader code"); + } else if (lua_istable(L, index)) { + int length = luax_len(L, index); + size_t size = length * 4; + uint32_t* words = malloc(size); + lovrAssert(words, "Out of memory"); + source = lovrBlobCreate(words, size, "SPIR-V code"); + for (int i = 0; i < length; i++) { + lua_rawgeti(L, index, i + 1); + words[i] = lua_tointeger(L, -1); + lua_pop(L, 1); + } } else { source = luax_readblob(L, index, "Shader"); } @@ -1033,7 +1044,7 @@ static int l_lovrGraphicsNewShader(lua_State* L) { ShaderInfo info = { 0 }; int index; - if (lua_gettop(L) == 1 || lua_istable(L, 2)) { + if (lua_gettop(L) == 1 || (lua_istable(L, 2) && luax_len(L, 2) == 0)) { info.type = SHADER_COMPUTE; info.stages[0] = luax_checkshadercode(L, 1, STAGE_COMPUTE); index = 2; diff --git a/src/main.c b/src/main.c index 738e1b7c..f888dc10 100644 --- a/src/main.c +++ b/src/main.c @@ -3,6 +3,7 @@ #include "core/os.h" #include "util.h" #include "boot.lua.h" +#include "nogame.lua.h" #include #include #include @@ -25,6 +26,14 @@ static void emscriptenLoop(void*); static Variant cookie; +static int luaopen_lovr_nogame(lua_State* L) { + if (!luaL_loadbuffer(L, (const char*) etc_nogame_lua, etc_nogame_lua_len, "@nogame.lua")) { + lua_call(L, 0, 1); + } + + return 1; +} + int main(int argc, char** argv) { if (argc > 1 && (!strcmp(argv[1], "--version") || !strcmp(argv[1], "-v"))) { os_open_console(); @@ -59,6 +68,16 @@ int main(int argc, char** argv) { luaL_openlibs(L); luax_preload(L); + const luaL_Reg nogame[] = { + { "nogame", luaopen_lovr_nogame }, + { NULL, NULL } + }; + + lua_getglobal(L, "package"); + lua_getfield(L, -1, "preload"); + luax_register(L, nogame); + lua_pop(L, 2); + // arg table lua_newtable(L); lua_pushstring(L, argc > 0 ? argv[0] : "lovr"); diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 341f205e..f4f4278f 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -1858,8 +1858,6 @@ Material* lovrMaterialCreate(MaterialInfo* info) { lovrRetain(textures[i]); Texture* texture = textures[i] ? textures[i] : state.defaultTexture; lovrCheck(i == 0 || texture->info.type == TEXTURE_2D, "Material textures must be 2D"); - // The below is only to make resource tracking more efficient - lovrCheck(texture->info.usage == TEXTURE_SAMPLE, "Currently, Material textures can only have the 'sample' usage"); bindings[i + 1] = (gpu_binding) { i + 1, GPU_SLOT_SAMPLED_TEXTURE, .texture = texture->gpu }; }