Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu audio glitchfix #14101

Merged
merged 2 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Common/GPU/OpenGL/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class OpenGLPipeline : public Pipeline {

// TODO: Optimize by getting the locations first and putting in a custom struct
UniformBufferDesc dynamicUniforms;
GLint samplerLocs_[8];
GLint samplerLocs_[8]{};
std::vector<GLint> dynamicUniformLocs_;
GLRProgram *program_ = nullptr;

Expand Down Expand Up @@ -1038,8 +1038,8 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
ERROR_LOG(G3D, "Pipeline requires at least one shader");
return nullptr;
}
if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) {
ERROR_LOG(G3D, "Invalid primitive type");
if ((uint32_t)desc.prim >= (uint32_t)Primitive::PRIMITIVE_TYPE_COUNT) {
ERROR_LOG(G3D, "Invalid primitive type");
return nullptr;
}
if (!desc.depthStencil || !desc.blend || !desc.raster) {
Expand Down
4 changes: 2 additions & 2 deletions Common/UI/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ class UIContext {
Bounds TransformBounds(const Bounds &bounds);

private:
Draw::DrawContext *draw_;
Draw::DrawContext *draw_ = nullptr;
Bounds bounds_;

float fontScaleX_ = 1.0f;
float fontScaleY_ = 1.0f;
UI::FontStyle *fontStyle_ = nullptr;
TextDrawer *textDrawer_ = nullptr;

Draw::SamplerState *sampler_;
Draw::SamplerState *sampler_ = nullptr;
Draw::Pipeline *ui_pipeline_ = nullptr;
Draw::Pipeline *ui_pipeline_notex_ = nullptr;
std::unique_ptr<ManagedTexture> uitexture_;
Expand Down
14 changes: 6 additions & 8 deletions UI/BackgroundAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,12 @@ int BackgroundAudio::Play() {
int sz = lastPlaybackTime_ <= 0.0 ? 44100 / 60 : (int)((now - lastPlaybackTime_) * 44100);
sz = std::min(BUFSIZE / 2, sz);
if (at3Reader_) {
if (sz >= 16) {
if (at3Reader_->Read(buffer, sz)) {
if (fadingOut_) {
for (int i = 0; i < sz*2; i += 2) {
buffer[i] *= volume_;
buffer[i + 1] *= volume_;
volume_ += delta_;
}
if (at3Reader_->Read(buffer, sz)) {
if (fadingOut_) {
for (int i = 0; i < sz*2; i += 2) {
buffer[i] *= volume_;
buffer[i + 1] *= volume_;
volume_ += delta_;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions UI/MiscScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ void LogoScreen::render() {

const Bounds &bounds = dc.GetBounds();

float xres = dc.GetBounds().w;
float yres = dc.GetBounds().h;
float xres = bounds.w;
float yres = bounds.h;

dc.Begin();

Expand Down