mmortatti / pico8-emulator

MIT License
27 stars 3 forks source link

Default Value Parameters #85

Open matheusmortatti opened 4 years ago

matheusmortatti commented 4 years ago

Outside the P8 API, I believe it's better to have multiple function signatures instead of having parameters with default values. That makes the code more usable and readable.

An example is tie RequestBuffer function in AudioUnit. It should have one signature without any value, using the default samplePerBuffer value, and another one where you could specify the buffer size requested.

egordorichev commented 4 years ago

Using dynamic size for the audio buffer size is a really bad idea, it can impact the audio quality a lot. I do not recommend changing it.

matheusmortatti commented 4 years ago

It needs to at least support it because that's how Unity works. It gives you a buffer for you to fill out that can change sizes between calls. I believe it doesn't change sizes often though, so it won't be a super big quality impact.