1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-04 13:33:34 +00:00
Commit graph

2431 commits

Author SHA1 Message Date
Nevyn Bengtsson 3cb7649996 audiostream: what the heck is memory.h
fixes review comment
2020-01-08 17:49:13 +01:00
mcc dac50c4687 Pragma once in core/hash.h 2020-01-06 13:55:39 -05:00
Nevyn Bengtsson ae5877a299 Rewind raw sources on explicit stop
I missed this one in dbe2edd8
2020-01-05 21:26:41 +01:00
Nevyn Bengtsson 1db932d856 Source: Stop, then unqueue buffers
Doing it the other way around is illegal; you may not unqueue unprocessed buffers, so we need to stop first.
2020-01-05 21:26:14 +01:00
Nevyn Bengtsson b3fb31f5a4 Destructor for raw audio stream 2020-01-05 21:19:08 +01:00
Nevyn Bengtsson dbe2edd89d Source: Do rewind on stop like before, and clear buffers
I changed my mind. Let's use rewind to clear buffers on a raw stream like Bjorn suggested, and put rewind at stop like it was before.
2020-01-05 21:08:30 +01:00
Nevyn Bengtsson a8b4dc673d Accessor for RawAudioStream:getQueueLength
Useful for determining current amount of latency.
2020-01-05 00:05:29 +01:00
Nevyn Bengtsson 5232aa2ff2 RawAudioStream: Add a limit to amount of queued data
This is useful for making sure the audio subsystem doesn't go haywire with too much generated data
2020-01-04 23:49:58 +01:00
Nevyn Bengtsson 2d681260e5 RawAudioStream: Fix byte/sample confusion
dequeue_raw thought that size was in bytes, but it's in samples.
2020-01-04 23:22:58 +01:00
Nevyn Bengtsson a3720b494b RawAudioStream: Fix use-after-free 2020-01-04 02:02:32 +01:00
Nevyn Bengtsson e85a9b74c6 Audio source: unqueue before playing 2020-01-04 01:58:03 +01:00
Nevyn Bengtsson a274eb05d1 RawAudioStream: Fix a buncha crashes
It's still buggy but at least less so
2020-01-03 23:01:21 +01:00
Nevyn Bengtsson 33bee6ce44 Audio: Rewind on play, not stop
Before, streams were rewound when they stopped, so that next time they're played they're played from the start.

Instead, rewind on play instead, so that it's done when it's needed. This gets us a good point to make sure we're not rewinding raw streams too.
2020-01-03 23:00:58 +01:00
Nevyn Bengtsson c6806f50e1 RawAudioStream: getter for isRaw
And disallow looping raw streams
2020-01-03 22:59:37 +01:00
Nevyn Bengtsson 4fb4f6cdd1 RawAudioStream lua API 2020-01-03 17:15:12 +01:00
Nevyn Bengtsson f6abb8d714 Raw audiostream implementation
Naive unoptimized implementation to get a feel
for the API design.
2020-01-02 20:34:55 +01:00
Jason Dogariu 163367a3ba rm pragma pack to fix OpenVR on Linux and Mac 2020-01-01 17:34:45 -05:00
bjorn c9b1f257bf api: try new file naming convention; Tupfile: cleanup;
I assume full responsibility for any catastrophes this causes.
2019-12-31 19:31:44 -08:00
bjorn d228dc95d7 Automatically convert binary resources;
- Teach CMake how to compile binary resources to C headers, like xxd.
- Note: tup is already using xxd to do this.
- gitignore binary resource headers to reduce git noise and avoid problematic
  interactions between git and build systems.
2019-12-29 11:25:30 -08:00
bjorn 12fcaffc3b Slight update to lovrDirSep;
Macro instead of global variable.
2019-12-29 10:30:26 -08:00
bjorn 79fd5ad7d8 Name boot.lua chunk properly;
This makes error messages nicer.
2019-12-28 23:18:03 -08:00
bjorn e538965f77 Add newline to end of stb_image.h; 2019-12-28 23:16:36 -08:00
bjorn a5db2d6c5c mv appveyor config to resources folder; 2019-12-28 20:13:19 -08:00
mcc 21a52368f5 Patch in thread local storage for stb_image vflip
This makes loading images in multiple threads concurrently safe.

Adds a new CMake variable LOVR_USE_THREADLOCAL, by default on
2019-12-20 16:09:18 -05:00
mcc 735d2e1011 Upgrade stb_image from v2.12 to v2.23 2019-12-20 16:24:05 -05:00
bjorn a103637419 Fix ModelData refcounting; 2019-12-20 04:52:55 -08:00
bjorn d1657f401d Fix some memory leaks; 2019-12-20 04:13:38 -08:00
Bjorn ebde129204
Merge pull request #174 from mcclure/android-0.14
Android fixes. Major change is lovrMain() {} is now lovrMain {}
2019-12-17 17:23:50 -08:00
Bjorn 6c6e5bb60d
Merge pull request #173 from mcclure/file
Bring back old File C API (read-only currently)
2019-12-17 17:22:09 -08:00
mcc c563787f7d Android fixes. Major change is lovrMain() {} is now lovrMain {}
The oculus drivers choke on #define lovrMain()
2019-12-17 20:20:09 -05:00
mcc 3ff94d8797 Bring back old File C API (read-only currently)
This code path is not used anywhere in this commit, but aids in developing Lovr addons.
2019-12-17 20:06:42 -05:00
mcc ff1ae2c050 Minor fix to let header files compile in C++ 2019-12-17 20:02:33 -05:00
bjorn fd437423e7 Fix refcount alignment;
Once and for all?  How does alignment even work.
2019-12-15 17:04:26 -08:00
Bjorn 16b93869ee
Merge pull request #143 from bjornbytes/shadow-samplers
Shadow samplers;
2019-12-14 11:34:38 -08:00
bjorn 0d156549f7 Fix remaining references to platform; 2019-12-13 19:59:09 -08:00
bjorn bb279b451c Fix remaining platform references; 2019-12-13 19:58:22 -08:00
bjorn e2d8f8c645 platform -> os;
The function names are staying the same for now.
2019-12-13 19:55:46 -08:00
bjorn 63dc8f6c9b Only use glfw for window creation;
This allows for headless operation.  Currently GLFW throws an error
if you call glfwInit without an X server running, preventing lovr
from starting at all in that situation.

Because GLFW is currently used for time functions, those had to be
moved into the platform layer.  There's lots of duplication here,
ideally the platform layer would just return raw timer values and the
timer module would handle the epoch logic, but it was too difficult to
coordinate that right now.

Also, lovrPlatformInit is guaranteed to set the time epoch to 0 now.
2019-12-13 19:55:46 -08:00
bjorn 5957a1d007 Channel:peek also returns status; 2019-12-13 19:53:31 -08:00
bjorn e2f67c106d Thread:start supports up to 4 arguments;
They are passed to the chunk.
2019-12-13 15:50:10 -08:00
bjorn 33991b41ad tup macOS fixes;
- Need to use dylib suffix.
- Need pagezero stuff (should we only do this when using LuaJIT?)
- rpath is totally different.
- stb_vorbis alloca broke?
2019-12-13 07:27:37 -08:00
bjorn 6f24da9f7f Rework Tupfiles;
- One toplevel Tupfile that makes it more clear what happens.
- Add config flags for -Werror, -fsanitize, and separate debug/optimize flags.
- Automatically integrate with libs built by CMake (build folder, rpath, libs folder).
- Disabling modules actually works, only the stuff that's needed is built.
2019-12-13 06:52:57 -08:00
bjorn 5957d07448 Fix warnings; 2019-12-13 03:41:35 -08:00
bjorn fe422ba60f Use nanosleep instead of usleep;
usleep is deprecated and does not exist on some new Linux systems.
2019-12-13 03:41:02 -08:00
bjorn 1ebe68b934 tup: make CONFIG_ENET=n work; 2019-12-10 15:21:34 -08:00
bjorn e316e6156b lovr.graphics.get/setColorMask; 2019-12-10 13:44:51 -08:00
bjorn c87d6dec3d lovrPlatformGetProcAddress;
Seems nicer than a global and allows for logging/hooks;
2019-12-10 13:15:12 -08:00
bjorn 2f9400a5f7 Adjust includes; 2019-12-10 13:01:28 -08:00
bjorn b518a4c983 rm misc physfs; 2019-12-10 12:38:06 -08:00
bjorn 403ed8d3b0 Windows; 2019-12-10 12:19:50 -08:00
bjorn 8795ebb31d Windows WIP; 2019-12-10 12:19:50 -08:00
bjorn 488c125c5f Draw the rest of the owl; 2019-12-10 12:19:50 -08:00
bjorn 6a8048765f luax_loadfile uses core/fs; 2019-12-10 12:19:50 -08:00
bjorn d2b0b30faf Texture:encode doesn't use File; 2019-12-10 12:19:50 -08:00
bjorn 8da7df68d8 core/fs; 2019-12-10 12:19:50 -08:00
bjorn f3745a1edc Use uint64_t for seed in luax_checkrandomseed; 2019-12-05 13:46:12 -08:00
bjorn bc948e7ea5 rm trailing whitespace; 2019-12-05 13:40:05 -08:00
bjorn bfd63e3515 Use restrict modifier in curve evaluation;
Allows compiler to emit SIMD, way smaller/faster.
2019-12-05 13:39:04 -08:00
bjorn c07b9e3fec rm unnecessary include; 2019-11-28 16:04:41 -08:00
bjorn 08f90ab1bd Make refcount 64 bits to avoid alignment issues;
There may be a better way to solve this, but I can't think of one
that doesn't also violate strict aliasing.
2019-11-28 16:03:42 -08:00
bjorn 1030c01a35 Stop aligning pool memory;
It isn't necessary anymore since we aren't hiding data in the alignment
bits and it seems to be causing problems in wasm.
2019-11-28 15:59:04 -08:00
bjorn b9f5ece72b Fix arr_splice; 2019-11-28 15:58:38 -08:00
bjorn 3e347f0521 Properly initialize uniform.dirty; 2019-11-28 15:31:27 -08:00
bjorn ad5389b1f4 Improve luax_readquat(nil); 2019-11-28 15:26:52 -08:00
bjorn 898a3f9f35 rm double underscores from glsl;
This naming pattern is reserved.
2019-11-28 15:25:19 -08:00
bjorn b69a5ba1a3 Update conf.version;
opps
2019-11-27 20:48:58 -08:00
bjorn 2a5bae0b18 Improve error messages for unknown types; 2019-11-27 20:45:18 -08:00
bjorn 2ecc1c552f Fix uniform array hashing; 2019-11-26 11:34:39 -08:00
bjorn 31b5792713 ifdef out glfwInitHint on emscripten; 2019-11-22 19:36:30 -08:00
Bjorn 539e25897b
Merge pull request #157 from bjornbytes/shape-sensor
Shape:isSensor; Shape:setSensor;
2019-11-20 18:35:24 -08:00
bjorn 6ad2d8ccef Add lovrMain macro to shaders (no breaking change); 2019-11-18 23:20:08 -08:00
bjorn c031c0c578 Fix comment; 2019-11-18 03:37:42 -08:00
bjorn bd169a4a4d Fix readable buffers;
Unsynchronized/invalidated mapping doesn't work if the read bit is set.
2019-11-14 12:42:52 -08:00
bjorn 9ac34ff190 Add :release to all objects; 2019-11-11 18:42:11 -08:00
bjorn 13136482b9 Fix Channel memory leak;
Channels need to be removed from the global array/map when destroyed.

Note that this exposes an infinite loop in map_remove, which will
be fixed later.

Note also that Channel's are retained if they have any messages in
them, to prevent releasing a channel while it has pending messages.
2019-11-11 18:33:33 -08:00
bjorn 8d12f0b867 Make userdata hashes 64 bit; 2019-11-11 16:39:02 -08:00
bjorn a7e24ab28e Joint:isEnabled; Joint:setEnabled; 2019-11-11 16:39:02 -08:00
bjorn 0bd5fced12 Use new glfw method for avoiding chdir; 2019-11-03 15:31:21 -08:00
bjorn d21911d010 Add core/map hash table; rm lib/map; 2019-10-30 00:07:05 -07:00
bjorn b35ebc15b6 rm LOVR_USE_SSE;
It doesn't really improve performance on an average LÖVR app and
isn't worth the complexity.
2019-10-22 16:46:54 -07:00
bjorn d51d2b4105 Fix stack balance with luax_checkvariant;
Was breaking Channel:push.
2019-10-22 16:42:10 -07:00
bjorn b940f2d53f Add AABB to OBJ models; 2019-10-21 17:46:28 -07:00
Bjorn d7b3e1cf46
Merge pull request #160 from nevyn/fix/objc_msgsend_cast
Cast objc_msgSend before calling it
2019-10-15 13:12:19 -07:00
Bjorn 0bb3271bb5
Merge pull request #159 from nevyn/fake-controller-position
Desktop driver: Move left controller with mouse
2019-10-15 13:05:36 -07:00
Nevyn Bengtsson ab6e4891e1 Cast objc_msgSend before calling it
Calling objc_msgSend with its vararg signature will only work most
of the time, and fail very weirdly when it doesn't. It's weird,
but you're supposed to always cast it to the signature of the
selector you're calling.

I think this is even required when building on Catalina, or for arm64?
2019-10-15 22:00:15 +02:00
Nevyn Bengtsson e35a5435ca update leftHandTransform in desktop_update
to be consistent with how headTransform is calculated.

also, rename ‘transform’ to ‘headTransform’ for consistency.
2019-10-15 21:50:28 +02:00
bjorn 4d2aa81647 Reset active texture in lovrGpuInit; 2019-10-15 11:34:49 -07:00
bjorn e32c3ea2df v0.13.0; 2019-10-14 18:21:07 -07:00
bjorn d93e17e800 Texture:setCompareMode; Shadow samplers; 2019-10-14 17:12:34 -07:00
bjorn 25fa80f1d5 Fix comment; 2019-10-14 16:10:34 -07:00
bjorn c3f91e9ff3 Actually fix/test the issue with .lovr files on macOS apps; 2019-10-14 15:24:02 -07:00
bjorn f6cd8120ad Add macOS bundle resources; 2019-10-14 15:23:46 -07:00
Nevyn Bengtsson cb75b387e5 Desktop driver: Move left controller with mouse 2019-10-14 10:08:12 +02:00
bjorn 77258ec4dd mat4 multiplication works with vec4; 2019-10-13 16:02:21 -07:00
bjorn ac441ec15b lovrGraphicsGetCamera; 2019-10-12 12:45:11 -07:00
bjorn f0342341af Fix quat:mul accidentally working on vec2/vec4; 2019-10-12 12:43:49 -07:00
bjorn b6093eda2a Shape:isSensor; Shape:setSensor; 2019-10-10 15:36:28 -07:00
bjorn 8c0ae3fbb3 More WebVR (controller) fixes; 2019-10-09 14:54:07 -07:00
bjorn ac53f5a56f Fix Collider:addShape and Collider:removeShape; 2019-10-08 15:45:53 -07:00
bjorn 6ef27ec7cc Merge branch 'master' of github.com:bjornbytes/lovr 2019-10-08 15:29:04 -07:00