From f64917313278da8fb923335b60f952ecd905eb04 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Wed, 18 Jan 2023 14:19:42 +0000 Subject: [PATCH] Fix a couple of crashes from the full pack --- .../org/lwjgl/openal/OpenALException.java | 43 ++++++++++++++++++- .../java/org/lwjglx/input/EventQueue.java | 2 +- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/generated/java/org/lwjgl/openal/OpenALException.java b/src/generated/java/org/lwjgl/openal/OpenALException.java index 8ec0b6b..c705bda 100644 --- a/src/generated/java/org/lwjgl/openal/OpenALException.java +++ b/src/generated/java/org/lwjgl/openal/OpenALException.java @@ -1,3 +1,44 @@ package org.lwjgl.openal; -public class OpenALException extends java.lang.RuntimeException {} +public class OpenALException extends org.lwjglx.openal.OpenALException { + private static final long serialVersionUID = 1L; + + /** + * Constructor for OpenALException. + */ + public OpenALException() { + super(); + } + + /** + * Constructor that takes an AL error number + */ + public OpenALException(int error_code) { + super("OpenAL error: " + org.lwjgl.openal.AL10.alGetString(error_code) + " (" + error_code + ")"); + } + + /** + * Constructor for OpenALException. + * @param message + */ + public OpenALException(String message) { + super(message); + } + + /** + * Constructor for OpenALException. + * @param message + * @param cause + */ + public OpenALException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructor for OpenALException. + * @param cause + */ + public OpenALException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/org/lwjglx/input/EventQueue.java b/src/main/java/org/lwjglx/input/EventQueue.java index fc503a3..cae28cf 100644 --- a/src/main/java/org/lwjglx/input/EventQueue.java +++ b/src/main/java/org/lwjglx/input/EventQueue.java @@ -60,7 +60,7 @@ class EventQueue { } int getCurrentPos() { - return currentEventPos; + return Math.max(0, currentEventPos); } int getNextPos() {