Commit Graph

2452 Commits

Author SHA1 Message Date
bjorn f564444641 Fix some WebGL issues; 2019-07-28 17:28:18 -07:00
mcc d391a4750f Use base diffuse color from materials in Standard shader 2019-07-25 15:08:53 -07:00
bjorn 239a9514ea Model: Fix animations that aren't keyed at t=0; 2019-07-19 16:42:51 -07:00
bjorn d0ee0d9b1a glTF: Fix transform for scenes with multiple root nodes; 2019-07-19 16:42:13 -07:00
bjorn 2b19c64aca rm primary DeviceButton and DeviceAxis;
It is confusing and doesn't really solve the intended problem very well.

For now we will all just suffer with our tedious device-specific Lua code.
2019-07-17 17:33:21 -07:00
bjorn c92c0ef3c5 lovr.headset.isTracked; 2019-07-17 17:09:45 -07:00
bjorn 416f28990a Tracking functions return 0 instead of nil; rm lovr.headset.getDirection; 2019-07-17 17:07:33 -07:00
bjorn 62fe520da1 maf: Fix quat_getDirection; 2019-07-16 23:03:37 -07:00
bjorn a04d55d13e Fix quat indexing in vanilla Lua; 2019-07-16 23:03:27 -07:00
bjorn 013d301c35 Fix vec3:sub in vanilla lua; 2019-07-16 22:53:01 -07:00
bjorn a5326d530a LuaJIT: Fix quaternion __newindex; 2019-07-16 22:52:34 -07:00
bjorn 7f445db3cc Update mat4:set for vanilla lua; 2019-07-16 22:51:26 -07:00
bjorn db519f7f53 mat4:scale: Allow for a single argument in LuaJIT; 2019-07-16 22:02:18 -07:00
bjorn 122143b13a vec4; 2019-07-16 20:30:51 -07:00
bjorn 23bba1d59b CMake; 2019-07-16 20:30:51 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
mcc 39f8203442 Don't reset camera position of desktop driver on reset 2019-07-16 20:27:45 -07:00
bjorn 84cdc592bc Make sure lovrBufferUnmap always unmaps; 2019-07-12 20:16:18 -07:00
bjorn 2eb4b779ab Model cleanup; 2019-07-11 20:13:47 -07:00
bjorn 4b4020d3a7 Model:pose; Model:getNodePose; 2019-07-11 20:09:46 -07:00
mcc 6f45b90044 Fix CMakeLists.txt after animator removed 2019-07-11 13:30:26 -07:00
bjorn 8e2775ef6d Math: cleanup; 2019-07-11 11:35:50 -07:00
bjorn 6b87576e6d Channel: cleanup; 2019-07-11 11:29:18 -07:00
bjorn 8c76e6f19b RandomGenerator: cleanup; 2019-07-11 11:24:34 -07:00
bjorn 1f8a7e073f Curve: cleanup; 2019-07-11 11:22:03 -07:00
bjorn f81a65430b Add support for cubic spline keyframe interpolation; 2019-07-11 11:05:53 -07:00
bjorn 3c07ad6b0b Replace Animator with Model:animate; 2019-07-10 22:08:19 -07:00
bjorn 4372eb293e rm comma operator;
everyone is making fun of me haha
2019-07-10 18:46:51 -07:00
mcc f5633f4248 Fix lovr.filesystem.append()
Previously, this program function lovr.update(dt) lovr.filesystem.append("/test123", lovr.timer.getTime()) end would fail in lovr because lovrFileWrite required the file to be in write mode (not append)
2019-07-10 16:29:09 -07:00
bjorn 82b865d851 Tuprules: Always use C99;
Now that we mostly use the clang/gcc atomics, just use c99 all the
time instead of conditionally changing the C standard.
2019-07-10 16:25:47 -07:00
mcc a6936b5649 Fix -DLOVR_ENABLE_THREAD=OFF compile
l_event.c was processing a thread-related event and in the process using a thread struct, even when LOVR_ENABLE_THREAD is undefined and threads do not exist. I caused the thread event type to simply not exist when the thread module is not being built.

Since the event is now only sometimes present, I put it at the end of the enum as slight protection against binary mismatches with dynamically loaded modules.
2019-07-10 16:23:20 -07:00
mcc 070892ee12 Fix crash with lovr.event.quit("restart") on Oculus Mobile
Because of how and when draws occur in our Oculus Mobile path, during a restart it would attempt to draw a frame after lovrGraphicsDestroy() is called, leading to a crash in lovrGraphicsSetCamera(). This blocks draws until the restart is finished and renderTo() has been called (conveniently detectable using the existing state.renderCallback).
2019-07-10 16:10:02 -07:00
mcc 8bfc8683db Patch maf.h so it can be included in C++
A C-only feature is used in one spot currently, which would be fine if maf.h were maf.c, but it's designed to be #included...
2019-07-10 14:58:55 -07:00
mcc 38886f0dc4 Patch sds.h so that it can be #included from C++
Empty arrays aren't allowed in C++, so a single dummy element has to be added. sds works by scary cast magic so this dummy element is never actually allocated. A #define is used in this patch so in C this compiles exactly the same as before.
2019-07-10 14:58:55 -07:00
mcc 99f8122f23 ref.h compiles in C++
Check for GCC version >=4.7 [covers GCC or, theoretically, Intel C Compiler] or __has_builtin(__atomic_add_fetch) [covers Clang]. If either of these are found, prefer the GCC atomic builtins instead of the C11 builtins.

Also: Gates Microsoft atomics on _MSC_VER, not _WIN32. This may help improve compatibility with mingw but has not been tested.
2019-07-10 14:58:25 -07:00
bjorn f208a5e067 Fix array initialization;
Because the new arr.h contains an array on the stack, we can't
initialize it and then copy it, or the pointer to the stack array
will be pointing to the wrong thing, causing incorrect behavior.
2019-07-09 09:06:11 -07:00
bjorn af29e29e4d Fix lovr.graphics.setProjection;
Needed to be using new frameData stuff.
2019-07-08 14:35:54 -07:00
bjorn f2feda9420 oculus: Remove offset;
Since we are calling SetTrackingOriginType with floor level, we don't
need to apply the seated-level t.headset.offset adjustment.
2019-07-05 01:05:02 -07:00
bjorn 348798b86c Make shader in nogame screen more correct; 2019-07-02 20:12:24 -07:00
mcc dc98846169 Fix error screen on Android
As discussed in slack, lovr.errhand appears to predate lovr.graphics.hasWindow() and does not use it. This resulted in a crash on Oculus Go
2019-07-02 18:45:08 -07:00
mcc 53270fbd76 mat4_transform_project in maf.h
mat4_transform ignores the final row of the matrix, which normally contains scale data. This is fine for modelview matrices, which is all lovr currently uses mat4_transform for. However it fails if you ever use mat4_transform on a projection matrix.

mat4_transform_project takes the final row into account, so you can use it with projection matrices. This was useful in my fork and might be useful to have around in lovr someday later.
2019-07-02 13:37:33 -07:00
mcc 1b085a00ea As discussed in slack, Oculus should be letting lovrCanvasCreate decide whether to double 2019-07-02 13:28:36 -07:00
bjorn 57f97056da Use I4ui instead of I1ui for lovrDrawID constant value;
glVertexAttribI1ui isn't supported on GLES for some reason.
2019-07-02 12:51:36 -07:00
bjorn 2d6aa18069 Be a little more correct about when draw id is written; 2019-07-02 00:14:01 -07:00
bjorn 775cf5cda1 Don't accidentally draw meshes too many times;
Oops!
2019-07-02 00:09:43 -07:00
bjorn 44da36b610 Write draw ids at the right time (fix flicker); 2019-07-01 02:47:59 -07:00
bjorn 2fb393306c rm skybox args;
They used to always be necessary, now they are almost never necessary.
2019-06-29 21:01:03 -07:00
bjorn e3e930d6cc Set index buffer at the right time;
Just a small ordering issue with previous commit.
2019-06-29 20:39:01 -07:00
bjorn 6256acfc6d Ahhh fix everything;
- If you have an instanced batch, it will use the instanced mesh.  That
  has a drawID attribute that uses the identity buffer, which has a vertex
  divisor.  BUT if you only have one instance, then we won't emit an
  instanced draw, and the use of a divisor'd attribute w/ a non-instanced
  draw is causing mega problems on macOS.
- This also fixes observed macOS bugs like:
  - Needing to have a small UBO
  - Flickering at startup
  - Flicker when writing to the last byte of a UBO
  - etc.
- Also make the generic attribute value for lovrDrawID more correct (scalar instead of vector).
2019-06-29 20:24:36 -07:00
bjorn afe4d8c0e3 Fix GL error with buffer unmapping;
This doesn't seem to fix any of the macOS rendering bugs though...
2019-06-29 20:08:31 -07:00