From cf7c480aca8e24c62e6563e96a1bb4636a1ac81f Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 8 Feb 2023 01:21:03 +0200 Subject: BLEND_ALPHA_PREMULTIPLY. --- changelog | 2 ++ devnotes | 5 +++-- examples/platformer/main.lua | 2 +- examples/resources/images/arcade_platformerV2.png | Bin 37323 -> 38470 bytes src/lua_core.c | 1 + src/textures.c | 5 ++--- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog b/changelog index 6084c4d..5ab34e4 100644 --- a/changelog +++ b/changelog @@ -26,3 +26,5 @@ ADDED: RL_IsPathFile. ADDED: RL_SetMaterialShader. ADDED: RL_GetFileLength. ADDED: RL_LoadFontEx. +FIXED: RL_ImageAlphaClear expecting wrong arguments. +ADDED: BLEND_ALPHA_PREMULTIPLY diff --git a/devnotes b/devnotes index 29800b7..27edbae 100644 --- a/devnotes +++ b/devnotes @@ -2,10 +2,11 @@ Current { } Backlog { - * Audio - * AudioStream. * Text + * Ability to set font texture filtering. * Codepoints? + * Audio + * AudioStream. * VR. * Core. * Compression/Encoding functionality. diff --git a/examples/platformer/main.lua b/examples/platformer/main.lua index 8fc33d8..c9b17bf 100644 --- a/examples/platformer/main.lua +++ b/examples/platformer/main.lua @@ -286,7 +286,7 @@ local function drawPlayer() end function draw() - RL_ClearBackground( BLACK ) + RL_ClearBackground( RED ) RL_SetTextureSource( TEXTURE_SOURCE_TEXTURE ) RL_BeginTextureMode( framebuffer ) diff --git a/examples/resources/images/arcade_platformerV2.png b/examples/resources/images/arcade_platformerV2.png index 1a529d2..9f8b0a0 100644 Binary files a/examples/resources/images/arcade_platformerV2.png and b/examples/resources/images/arcade_platformerV2.png differ diff --git a/src/lua_core.c b/src/lua_core.c index 7056f40..32759bf 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -323,6 +323,7 @@ void defineGlobals() { assignGlobalInt( BLEND_MULTIPLIED, "BLEND_MULTIPLIED" ); assignGlobalInt( BLEND_ADD_COLORS, "BLEND_ADD_COLORS" ); assignGlobalInt( BLEND_SUBTRACT_COLORS, "BLEND_SUBTRACT_COLORS" ); + assignGlobalInt( BLEND_ALPHA_PREMULTIPLY, "BLEND_ALPHA_PREMULTIPLY" ); assignGlobalInt( BLEND_CUSTOM, "BLEND_CUSTOM" ); /* Gesture */ assignGlobalInt( GESTURE_NONE, "GESTURE_NONE" ); diff --git a/src/textures.c b/src/textures.c index 0b1a198..5121718 100644 --- a/src/textures.c +++ b/src/textures.c @@ -695,10 +695,10 @@ int ltexturesImageAlphaClear( lua_State *L ) { lua_pushboolean( L, false ); return 1; } - Color color = uluaGetColor( L ); - lua_pop( L, 1 ); float threshold = lua_tonumber( L, -1 ); lua_pop( L, 1 ); + Color color = uluaGetColor( L ); + lua_pop( L, 1 ); size_t imageId = lua_tointeger( L, -1 ); if ( !validImage( imageId ) ) { @@ -1766,7 +1766,6 @@ int ltexturesLoadRenderTexture( lua_State *L ) { return 1; } - /* > success = RL_UnloadTexture( Texture2D texture ) -- cgit v1.2.3