Fixed fast_tilemap and texture_atlas_repeat examples.

This commit is contained in:
jussi
2025-09-18 15:30:12 +03:00
parent 3f27d9037d
commit 77ba40f97e
6 changed files with 61 additions and 28 deletions

View File

@@ -60,6 +60,8 @@ DETAILED CHANGES:
- ADDED: GetSoundStream and GetMusicStream. - ADDED: GetSoundStream and GetMusicStream.
- ADDED: Audio stream effects example. - ADDED: Audio stream effects example.
- CHANGE: Bit fastes uluaGet* functions for vectors, color, rectangle and quaternion. - CHANGE: Bit fastes uluaGet* functions for vectors, color, rectangle and quaternion.
- FIXED: fast_tilemap and texture_atlas_repeat examples were giving truncated vectors
which isn't allowed anymore.
------------------------------------------------------------------------ ------------------------------------------------------------------------
Release: ReiLua version 0.8.0 Using Raylib 5.0 and Forked Raygui 4.0 Release: ReiLua version 0.8.0 Using Raylib 5.0 and Forked Raygui 4.0

View File

@@ -39,7 +39,7 @@ local function setTile( meshData, pos, texcoord )
local texelSize = Vector2:new( 1 / tilemap.texSize.x, 1 / tilemap.texSize.y ) local texelSize = Vector2:new( 1 / tilemap.texSize.x, 1 / tilemap.texSize.y )
for i, v in ipairs( QUAD.VERTICES ) do for i, v in ipairs( QUAD.VERTICES ) do
table.insert( meshData.vertices, ( pos + v ):scale( tilemap.tileSize ) ) table.insert( meshData.vertices, ( Vector3:temp( pos.x + v.x, pos.y + v.y, 0 ) ):scale( tilemap.tileSize ) )
table.insert( meshData.texcoords, ( QUAD.TEXCOORDS[i] + texcoord ) * texelSize:scale( tilemap.tileSize ) ) table.insert( meshData.texcoords, ( QUAD.TEXCOORDS[i] + texcoord ) * texelSize:scale( tilemap.tileSize ) )
table.insert( meshData.colors, RL.WHITE ) table.insert( meshData.colors, RL.WHITE )
end end

View File

@@ -28,8 +28,8 @@ function RL.draw()
RL.ClearBackground( RL.RAYWHITE ) RL.ClearBackground( RL.RAYWHITE )
RL.BeginShaderMode( shader ) RL.BeginShaderMode( shader )
RL.DrawTexturePro( atlas, { 0, 0, 32, 32 }, { 0, 0, 64, 64 }, { 0.0 }, 0.0, RL.WHITE ) RL.DrawTexturePro( atlas, { 0, 0, 32, 32 }, { 0, 0, 64, 64 }, { 0.0, 0.0 }, 0.0, RL.WHITE )
RL.DrawTexturePro( atlas, { 32, 0, 32, 32 }, { 0, 64, 128, 64 }, { 0.0 }, 0.0, RL.WHITE ) RL.DrawTexturePro( atlas, { 32, 0, 32, 32 }, { 0, 64, 128, 64 }, { 0.0, 0.0 }, 0.0, RL.WHITE )
RL.DrawTriangle( { 32, 200 }, { 128, 400 }, { 320, 240 }, RL.WHITE ) RL.DrawTriangle( { 32, 200 }, { 128, 400 }, { 320, 240 }, RL.WHITE )
RL.EndShaderMode() RL.EndShaderMode()
end end

View File

@@ -13,6 +13,13 @@
#include <stdint.h> #include <stdint.h>
#include "external/glad.h" #include "external/glad.h"
// #ifndef STB_RECT_PACK_IMPLEMENTATION
// #if !defined(SUPPORT_FILEFORMAT_TTF) && !defined(SUPPORT_FILEFORMAT_BDF)
// #ifndef STB_INCLUDE_STB_RECT_PACK_H
// #define STB_RECT_PACK_IMPLEMENTATION
// #endif
#include "external/stb_rect_pack.h" #include "external/stb_rect_pack.h"
#ifdef PLATFORM_DESKTOP #ifdef PLATFORM_DESKTOP

View File

@@ -2142,6 +2142,7 @@ Decompress data (DEFLATE algorithm).
*/ */
int lcoreDecompressData( lua_State* L ) { int lcoreDecompressData( lua_State* L ) {
Buffer* inBuffer = uluaGetBuffer( L, 1 ); Buffer* inBuffer = uluaGetBuffer( L, 1 );
Buffer outBuffer = { Buffer outBuffer = {
.size = 0, .size = 0,
.type = inBuffer->type .type = inBuffer->type
@@ -2166,10 +2167,10 @@ Encode data to Base64 string
*/ */
int lcoreEncodeDataBase64( lua_State* L ) { int lcoreEncodeDataBase64( lua_State* L ) {
int dataSize = 0; int dataSize = 0;
const char* string = luaL_checklstring( L, 1, (size_t*)&dataSize ); const unsigned char* data = luaL_checklstring( L, 1, (size_t*)&dataSize );
int outputSize = 0; int outputSize = 0;
char* compData = EncodeDataBase64( string, dataSize, &outputSize ); char* compData = EncodeDataBase64( data, dataSize, &outputSize );
lua_pushstring( L, compData ); lua_pushstring( L, compData );
lua_pushinteger( L, outputSize ); lua_pushinteger( L, outputSize );
@@ -2187,8 +2188,10 @@ Decode Base64 string data
- Success return string, int - Success return string, int
*/ */
int lcoreDecodeDataBase64( lua_State* L ) { int lcoreDecodeDataBase64( lua_State* L ) {
const unsigned char* data = luaL_checkstring( L, 1 );
int outputSize = 0; int outputSize = 0;
unsigned char* decodedData = DecodeDataBase64( luaL_checkstring( L, 1 ), &outputSize ); unsigned char* decodedData = DecodeDataBase64( data, &outputSize );
lua_pushstring( L, decodedData ); lua_pushstring( L, decodedData );
lua_pushinteger( L, outputSize ); lua_pushinteger( L, outputSize );

View File

@@ -3339,11 +3339,12 @@ Transform uluaGetTransform( lua_State* L, int index ) {
} }
Buffer* uluaGetBuffer( lua_State* L, int index ) { Buffer* uluaGetBuffer( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Buffer*)lua_touserdata( L, index ); return (Buffer*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "buffer", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "buffer", lua_tostring( L, -2 ) ) ) {
@@ -3369,11 +3370,12 @@ Buffer* uluaGetBuffer( lua_State* L, int index ) {
} }
Image* uluaGetImage( lua_State* L, int index ) { Image* uluaGetImage( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Image*)lua_touserdata( L, index ); return (Image*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "image", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "image", lua_tostring( L, -2 ) ) ) {
@@ -3399,11 +3401,12 @@ Image* uluaGetImage( lua_State* L, int index ) {
} }
Texture* uluaGetTexture( lua_State* L, int index ) { Texture* uluaGetTexture( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Texture*)lua_touserdata( L, index ); return (Texture*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "texture", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "texture", lua_tostring( L, -2 ) ) ) {
@@ -3429,11 +3432,12 @@ Texture* uluaGetTexture( lua_State* L, int index ) {
} }
RenderTexture* uluaGetRenderTexture( lua_State* L, int index ) { RenderTexture* uluaGetRenderTexture( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (RenderTexture*)lua_touserdata( L, index ); return (RenderTexture*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "renderTexture", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "renderTexture", lua_tostring( L, -2 ) ) ) {
@@ -3459,11 +3463,12 @@ RenderTexture* uluaGetRenderTexture( lua_State* L, int index ) {
} }
Shader* uluaGetShader( lua_State* L, int index ) { Shader* uluaGetShader( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Shader*)lua_touserdata( L, index ); return (Shader*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "shader", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "shader", lua_tostring( L, -2 ) ) ) {
@@ -3489,11 +3494,12 @@ Shader* uluaGetShader( lua_State* L, int index ) {
} }
Mesh* uluaGetMesh( lua_State* L, int index ) { Mesh* uluaGetMesh( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Mesh*)lua_touserdata( L, index ); return (Mesh*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "mesh", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "mesh", lua_tostring( L, -2 ) ) ) {
@@ -3519,11 +3525,12 @@ Mesh* uluaGetMesh( lua_State* L, int index ) {
} }
Camera2D* uluaGetCamera2D( lua_State* L, int index ) { Camera2D* uluaGetCamera2D( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Camera2D*)lua_touserdata( L, index ); return (Camera2D*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "camera2D", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "camera2D", lua_tostring( L, -2 ) ) ) {
@@ -3549,11 +3556,12 @@ Camera2D* uluaGetCamera2D( lua_State* L, int index ) {
} }
Camera3D* uluaGetCamera3D( lua_State* L, int index ) { Camera3D* uluaGetCamera3D( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Camera3D*)lua_touserdata( L, index ); return (Camera3D*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "camera3D", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "camera3D", lua_tostring( L, -2 ) ) ) {
@@ -3579,11 +3587,12 @@ Camera3D* uluaGetCamera3D( lua_State* L, int index ) {
} }
Font* uluaGetFont( lua_State* L, int index ) { Font* uluaGetFont( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Font*)lua_touserdata( L, index ); return (Font*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "font", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "font", lua_tostring( L, -2 ) ) ) {
@@ -3609,11 +3618,12 @@ Font* uluaGetFont( lua_State* L, int index ) {
} }
GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ) { GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (GlyphInfo*)lua_touserdata( L, index ); return (GlyphInfo*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "glyphInfo", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "glyphInfo", lua_tostring( L, -2 ) ) ) {
@@ -3639,11 +3649,12 @@ GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ) {
} }
Wave* uluaGetWave( lua_State* L, int index ) { Wave* uluaGetWave( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Wave*)lua_touserdata( L, index ); return (Wave*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "wave", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "wave", lua_tostring( L, -2 ) ) ) {
@@ -3669,11 +3680,12 @@ Wave* uluaGetWave( lua_State* L, int index ) {
} }
Sound* uluaGetSound( lua_State* L, int index ) { Sound* uluaGetSound( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Sound*)lua_touserdata( L, index ); return (Sound*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "sound", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "sound", lua_tostring( L, -2 ) ) ) {
@@ -3699,17 +3711,18 @@ Sound* uluaGetSound( lua_State* L, int index ) {
return (Sound*)lua_touserdata( L, index ); return (Sound*)lua_touserdata( L, index );
} }
else { else {
luaL_checkudata( L, index, "Sound" ); return luaL_checkudata( L, index, "Sound" );
} }
} }
} }
Music* uluaGetMusic( lua_State* L, int index ) { Music* uluaGetMusic( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Music*)lua_touserdata( L, index ); return (Music*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "music", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "music", lua_tostring( L, -2 ) ) ) {
@@ -3735,11 +3748,12 @@ Music* uluaGetMusic( lua_State* L, int index ) {
} }
AudioStream* uluaGetAudioStream( lua_State* L, int index ) { AudioStream* uluaGetAudioStream( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (AudioStream*)lua_touserdata( L, index ); return (AudioStream*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "audioStream", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "audioStream", lua_tostring( L, -2 ) ) ) {
@@ -3765,11 +3779,12 @@ AudioStream* uluaGetAudioStream( lua_State* L, int index ) {
} }
Light* uluaGetLight( lua_State* L, int index ) { Light* uluaGetLight( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Light*)lua_touserdata( L, index ); return (Light*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "light", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "light", lua_tostring( L, -2 ) ) ) {
@@ -3795,11 +3810,12 @@ Light* uluaGetLight( lua_State* L, int index ) {
} }
Material* uluaGetMaterial( lua_State* L, int index ) { Material* uluaGetMaterial( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Material*)lua_touserdata( L, index ); return (Material*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "material", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "material", lua_tostring( L, -2 ) ) ) {
@@ -3825,11 +3841,12 @@ Material* uluaGetMaterial( lua_State* L, int index ) {
} }
Model* uluaGetModel( lua_State* L, int index ) { Model* uluaGetModel( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (Model*)lua_touserdata( L, index ); return (Model*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "model", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "model", lua_tostring( L, -2 ) ) ) {
@@ -3855,11 +3872,12 @@ Model* uluaGetModel( lua_State* L, int index ) {
} }
ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ) { ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (ModelAnimation*)lua_touserdata( L, index ); return (ModelAnimation*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "modelAnimation", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "modelAnimation", lua_tostring( L, -2 ) ) ) {
@@ -3885,11 +3903,12 @@ ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ) {
} }
rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ) { rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (rlRenderBatch*)lua_touserdata( L, index ); return (rlRenderBatch*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "rlRenderBatch", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "rlRenderBatch", lua_tostring( L, -2 ) ) ) {
@@ -3915,11 +3934,12 @@ rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ) {
} }
AutomationEvent* uluaGetAutomationEvent( lua_State* L, int index ) { AutomationEvent* uluaGetAutomationEvent( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (AutomationEvent*)lua_touserdata( L, index ); return (AutomationEvent*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "automationEvent", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "automationEvent", lua_tostring( L, -2 ) ) ) {
@@ -3945,11 +3965,12 @@ AutomationEvent* uluaGetAutomationEvent( lua_State* L, int index ) {
} }
AutomationEventList* uluaGetAutomationEventList( lua_State* L, int index ) { AutomationEventList* uluaGetAutomationEventList( lua_State* L, int index ) {
int t = index, i = 0;
switch ( lua_type( L, index ) ) { switch ( lua_type( L, index ) ) {
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
return (AutomationEventList*)lua_touserdata( L, index ); return (AutomationEventList*)lua_touserdata( L, index );
case LUA_TTABLE: case LUA_TTABLE:
int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) { while ( lua_next( L, t ) != 0 ) {
if ( TextIsEqual( "automationEventList", lua_tostring( L, -2 ) ) ) { if ( TextIsEqual( "automationEventList", lua_tostring( L, -2 ) ) ) {