Questions about Löve's source code structure
Re: Questions about Löve's source code structure
I'm debugging audio issues on LöveFTW. On ARM builds, the sound from playing .ogg files is just white noise. .wav files sound like they do on desktop Löve, so I initially assumed that the problem can't be in OpenAL (as that would have broken playing .wav files as well) but after trying everything I can think of with libogg/libvorbis/libvorbisfile, I'm starting to question my assumption. Do both .wav and .ogg files play through OpenAL in Löve? Any other ideas on how I can debug this is of course appreciated if you can think of anything
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Questions about Löve's source code structure
Given that .wav works, I'd suspect the VorbisDecoder. Have you tried logging a few samples from the SoundData? Compare some random sample on ARM to the same sample on x86. If the underlying samples are different, then it's probably the decoder. If they are the same, there is some other problem.
Re: Questions about Löve's source code structure
Thanks for this genious idea. Yes, it seems like it's the decoder because the binary samples don't match on ARM vs x86.szensk wrote:Given that .wav works, I'd suspect the VorbisDecoder. Have you tried logging a few samples from the SoundData? Compare some random sample on ARM to the same sample on x86. If the underlying samples are different, then it's probably the decoder. If they are the same, there is some other problem.
EDIT: LOLOLOLOLOLOLOLOLOL I had the wrong endian for ARM x'D I apologize for my stupidity.
Okay, so the final issue I have is landscape support. ANGLE doesn't support it for some reason, and I've tried the workaround mentioned there. It does work, but like they say it does affect performance quite noticably. I'm therefore looking for another solution.
What I've tried is to modify src/modules/graphics/opengl/Graphics.cpp's setViewportSize function, replacing
Code: Select all
gl.matrices.projection.back() = Matrix::ortho(0.0, width, height, 0.0);
Code: Select all
#ifdef LOVE_LEGENDARY_ROTATION_HACK
Matrix proj = Matrix::ortho(0.0, height, width, 0.0);
proj.rotate(LOVE_M_PI_2);
proj.translate(0, -height);
gl.matrices.projection.back() = proj;
#else
gl.matrices.projection.back() = Matrix::ortho(0.0, width, height, 0.0);
#endif
The function as a whole (untouched) looks like this (I won't blame you for not wanting to look it up):
Code: Select all
void Graphics::setViewportSize(int width, int height)
{
this->width = width;
this->height = height;
if (!isCreated())
return;
// We want to affect the main screen, not any Canvas that's currently active
// (not that any *should* be active when this is called.)
std::vector<StrongRef<Canvas>> canvases = states.back().canvases;
setCanvas();
// Set the viewport to top-left corner.
gl.setViewport(OpenGL::Viewport(0, 0, width, height));
// If a canvas was bound before this function was called, it needs to be
// made aware of the new system viewport size.
Canvas::systemViewport = gl.getViewport();
// Set up the projection matrix
gl.matrices.projection.back() = Matrix::ortho(0.0, width, height, 0.0);
// Restore the previously active Canvas.
setCanvas(canvases);
}
Compare these two images: https://love2d.org/imgmirrur/M6PC8.html (the background scrolls, so don't look at that, look at the text and details)
I've also attempted to modify matrices.transform instead of matrices.projection, but I'm not sure where it's set; I've tried modifying it in OpenGL::initMatrices() but it doesn't change anything, so I assume it's overwritten somewhere I can't find?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: No registered users and 1 guest