Commit Graph

52 Commits

Author SHA1 Message Date
bjorn 4a47afca38 Organize api folder; 2019-05-19 00:31:42 -07:00
bjorn f268810d2a Minor cleanup; Fix some undefined behavior; 2019-04-20 13:11:11 -07:00
bjorn 6fdeda9e61 Make lovrRelease non-generic;
We know what type we're releasing 99% of the time, we don't need to
play a guessing game in lovrRelease, just have the caller say which
destructor to use.

There is lovrGenericRelease for situations where we need it, which
does the slower lookup of the destructor.
2019-04-05 03:41:03 -07:00
bjorn 85c51399a6 Fix MSVC warnings; 2019-03-17 00:58:13 -07:00
bjorn 27e2c56bee lovr.filesystem.read takes and returns byte count; 2019-03-05 01:59:31 -08:00
bjorn 90d6e2b407 Make binding functions static; 2019-02-17 14:52:22 -08:00
bjorn bea2140676 Animation optimization; Cleanup; 2019-02-13 15:10:52 -08:00
bjorn 540b6a60e0 Refactoring; 2019-02-13 15:10:52 -08:00
bjorn cb9f166234 Revert "Replace sprintf with stb version;"
This reverts commit 8f9d24c51f.
2019-01-24 17:39:27 -08:00
bjorn 8f9d24c51f Replace sprintf with stb version; 2019-01-18 08:55:29 -08:00
bjorn 1fb2d6be02 Always use pushliteral when possible; 2018-12-15 21:45:32 -08:00
mcc 778b654f1d Move lovr.android.getApplicationId() to lovr.filesystem.getApplicationId(). Kill Android module
This requires adding an application id function to platform and adding a mini definition to sds into platform.h. All platforms except Android return NULL (no application id)
2018-11-27 15:02:25 -08:00
bjorn 0e99d47394 Fix module destruction;
There is a problem when a Thread stops: it destroys all of the modules
that it required.  This is because we unconditionally call luax_atexit
when modules are required, and when the thread lua_State dies it takes
all of the modules with it.  To fix this, lovr<Module>Init will return
whether or not initialization successfully happened, which provides us
with enough info to know if we should place the luax_atexit destructor
2018-11-19 09:24:28 -08:00
bjorn 784d61ef4a Modify module loading;
Dynamically loading things was cool but is causing more pain than
pleasure because it just barely doesn't work everywhere.  Instead,
find a better way to load modules.  Use a data driven luaL_Reg array
to define the module mapping and luaL_register to smoosh it into
package.preload at boot time.  Benefits:

- LOVR_ENABLE_<x> defines are respected and only require a single #if
- Module list is data driven and defined in one place
- It's faster (luax_preloadmodule did a global lookup every invocation)
- It works everywhere

Oh also threads were totally broken and this (mostly) fixes them.
2018-11-15 07:51:21 -08:00
mcc 91daeae634 Style/functional fixes to args for PR. --inside is now --root 2018-11-13 22:07:19 -05:00
mcc 2213b3bcfd Allow the mountpoint to be set "inside" a zip file, using an --inside parameter.
This is used in the oculus mobile driver, allowing replacement of the (dubious) recursive-copy-from-zip code.

In order for this to work, the argument parsing must be beefed up a bit and also PhysFS must be updated to the newest master in order to get a new PHYSFS_setRoot. The github submodule source has been changed to one which updates more frequently to get this.
2018-11-13 15:20:04 -05:00
mcc 26af794e3c Adjust the lovr command line construction to follow the lua/love standards. This is a BC-breaking change.
Source for lua standard: https://en.wikibooks.org/wiki/Lua_Programming/command_line_parameter
2018-11-13 16:28:56 -05:00
bjorn 5f8f8a540e lovr.filesystem no longer relies on arg global; 2018-10-23 11:12:13 -07:00
bjorn 238af0064f Add missing lovr.filesystem.unmount function; 2018-09-27 18:38:44 -07:00
bjorn cee3c28f4e luax_atexit; rm lovrDestroy;
Modules register themselves in the registry for destruction at
lua_close instead of having a hardcoded list in lovrDestroy.
2018-09-27 18:38:44 -07:00
bjorn 92e6ad93cb Dynamically load modules; 2018-09-27 18:38:44 -07:00
bjorn e02d22365f api: refactor; 2018-09-27 18:38:44 -07:00
bjorn 83ddb82162 Simplify Lua object management; 2018-07-24 20:13:54 -07:00
bjorn c19d69cfdd Fix dll/so loading; Respect hyphens; 2018-07-18 17:09:47 -07:00
bjorn b1b9dc734d Woops make sure to use cross platform dlsym; 2018-07-07 13:57:32 -07:00
bjorn 0214c7605e Support requiring dll/so files;
Still WIP
2018-07-07 13:55:22 -07:00
bjorn 22f6e7831b Support C require paths; 2018-07-06 21:21:07 -07:00
bjorn 57c8dfe146 Clean up includes; 2018-07-04 13:51:35 -07:00
bjorn 275006847d Prepend @ to loaded Lua chunks for better errors; 2018-05-27 19:05:10 -07:00
bjorn 5fd20cc955 Fix lovr.filesystem.setRequirePath; 2018-03-22 10:39:31 -07:00
bjorn adee0a3012 Replace dots with slashes instead of question marks;
In filesystem loader.
2018-03-22 10:07:19 -07:00
bjorn 4b82a12b15 Add lovr.filesystem.getWorkingDirectory; 2018-03-19 16:52:17 -07:00
bjorn 399544cf9d lovr.filesystem.getRequirePath; setRequirePath; 2018-03-11 16:25:21 -07:00
bjorn 6916137dc6 VertexData and TextureData properly extend Blob;
...He hates it!
2018-03-10 21:28:22 -08:00
bjorn 4df836727c Simplify refcounting; 2018-02-26 00:59:03 -08:00
bjorn 5493a980ff Move Blob to lovr.data;
Keep lovr.filesystem.newBlob though...
2018-02-19 21:04:53 -08:00
bjorn 2727544408 Copy strings in loader; 2018-01-04 18:49:14 -08:00
bjorn de320be1cd Improve error messages in the filesystem loader;
Also fix a memory leak in lovr.filesystem.load.
2017-12-31 13:20:42 -08:00
bjorn 1d20e49829 Move api header; 2017-12-10 12:41:43 -08:00
bjorn ecde864ec4 Use spooky BOOleans everywhere; 2017-10-31 01:14:09 -07:00
bjorn 9b3723145b Changes for physfs 3; rm lovr.filesystem.exists; 2017-10-22 01:37:06 -07:00
bjorn 231056e7e0 Fix issues with model IO; 2017-10-21 20:19:33 -07:00
bjorn a12a003ccb Use custom IO callbacks for assimp; 2017-10-21 12:31:53 -07:00
bjorn c518cadcf7 Cleanup; 2017-07-19 07:00:11 +09:00
bjorn 265a81c411 Add window title; Improve initial error handling; 2017-06-10 15:34:35 -07:00
bjorn 1061134800 Improve error messages; 2017-06-02 01:31:14 -07:00
bjorn eddc7af482 Fix require leak; 2017-05-17 00:17:13 -06:00
bjorn 6695be5eb8 Add missing bindings for lovr.filesystem.createDirectory; 2017-04-02 15:10:46 -07:00
bjorn 7f687f9732 No game screen; 2017-04-02 05:55:21 -07:00
bjorn 66bb9063f5 Add Blobs; 2017-04-01 16:50:10 -07:00