2021-26-03
+ Texture compression ~ General spring cleaning
This commit is contained in:
parent
bf1118c261
commit
7afec9c9ef
8 changed files with 42 additions and 32 deletions
|
|
@ -13,8 +13,8 @@ namespace SM.Base.Controls
|
|||
/// </summary>
|
||||
public static class Keyboard
|
||||
{
|
||||
internal static KeyboardState? _keyboardState;
|
||||
internal static List<Key> _lastPressedKeys = new List<Key>();
|
||||
private static KeyboardState? _keyboardState;
|
||||
private static List<Key> _lastPressedKeys = new List<Key>();
|
||||
|
||||
/// <summary>
|
||||
/// True, when ANY key pressed.
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ namespace SM.Base.Controls
|
|||
/// </summary>
|
||||
public class Mouse
|
||||
{
|
||||
internal static MouseState? _mouseState;
|
||||
internal static List<MouseButton> _lastButtonsPressed = new List<MouseButton>();
|
||||
private static MouseState? _mouseState;
|
||||
private static List<MouseButton> _lastButtonsPressed = new List<MouseButton>();
|
||||
|
||||
/// <summary>
|
||||
/// The current position of the mouse in the screen.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace SM.Base.Drawing.Particles
|
|||
/// <summary>
|
||||
/// The maximum speed of the particles
|
||||
/// </summary>
|
||||
public float MaxSpeed = 1;
|
||||
public float MaxSpeed = 50;
|
||||
|
||||
/// <summary>
|
||||
/// This contains all important information for each particle.
|
||||
|
|
@ -67,13 +67,14 @@ namespace SM.Base.Drawing.Particles
|
|||
public abstract Func<TDirection, ParticleContext, TDirection> MovementCalculation { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool UpdateActive { get; set; }
|
||||
public bool UpdateActive {
|
||||
get => timer.Active;
|
||||
set { return; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Update(UpdateContext context)
|
||||
{
|
||||
if (!timer.Running) return;
|
||||
|
||||
ParticleContext particleContext = new ParticleContext
|
||||
{
|
||||
Timer = timer
|
||||
|
|
|
|||
|
|
@ -15,6 +15,21 @@ namespace SM.Base.Textures
|
|||
/// </summary>
|
||||
public class Texture : TextureBase
|
||||
{
|
||||
static HintMode _hintMode;
|
||||
/// <summary>
|
||||
/// Defines the texture quailty.
|
||||
/// <para>It won't change already compiled textures!</para>
|
||||
/// </summary>
|
||||
public static HintMode TextureQuality
|
||||
{
|
||||
get => _hintMode;
|
||||
set
|
||||
{
|
||||
_hintMode = value;
|
||||
GL.Hint(HintTarget.TextureCompressionHint, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int? _height;
|
||||
private int? _width;
|
||||
|
||||
|
|
@ -116,7 +131,7 @@ namespace SM.Base.Textures
|
|||
var transparenz = map.PixelFormat == PixelFormat.Format32bppArgb;
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0,
|
||||
transparenz ? PixelInternalFormat.Rgba : PixelInternalFormat.Rgb,
|
||||
transparenz ? PixelInternalFormat.CompressedRgba : PixelInternalFormat.CompressedRgb,
|
||||
data.Width, data.Height, 0,
|
||||
transparenz ? OpenTK.Graphics.OpenGL4.PixelFormat.Bgra : OpenTK.Graphics.OpenGL4.PixelFormat.Bgr,
|
||||
PixelType.UnsignedByte, data.Scan0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue