diff options
| author | jussi | 2024-03-29 20:51:43 +0200 |
|---|---|---|
| committer | jussi | 2024-03-29 20:51:43 +0200 |
| commit | b96960a1f97f815a6872fedc422ea950ed477cda (patch) | |
| tree | 5dd7cc471be60806744b9869358e43cf507202fe /src | |
| parent | 523351609a36ceb48581aa8edab160037a634ea8 (diff) | |
| download | reilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.tar.gz reilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.tar.bz2 reilua-enhanced-b96960a1f97f815a6872fedc422ea950ed477cda.zip | |
Raygui lib examples file browser.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -843,7 +843,7 @@ int lcoreEndScissorMode( lua_State* L ) { */ /* -> shader = RL.LoadShader( string vsFileName, string fsFileName ) +> shader = RL.LoadShader( string|nil vsFileName, string|nil fsFileName ) Load shader from files and bind default locations. NOTE: Set nil if no shader @@ -867,7 +867,7 @@ int lcoreLoadShader( lua_State* L ) { } /* -> shader = RL.LoadShaderFromMemory( string vsCode, string fsCode ) +> shader = RL.LoadShaderFromMemory( string|nil vsCode, string|nil fsCode ) Load shader from code strings and bind default locations NOTE: Set nil if no shader @@ -1761,7 +1761,7 @@ int lcoreLoadDirectoryFiles( lua_State* L ) { } /* -> fileNames = RL.LoadDirectoryFilesEx( string basePath, string filter, bool scanSubdirs ) +> fileNames = RL.LoadDirectoryFilesEx( string basePath, string|nil filter, bool scanSubdirs ) Load directory filepaths with extension filtering and recursive directory scan @@ -1769,8 +1769,13 @@ Load directory filepaths with extension filtering and recursive directory scan */ int lcoreLoadDirectoryFilesEx( lua_State* L ) { bool scanSubdirs = uluaGetBoolean( L, 3 ); + const char* basePath = luaL_checkstring( L, 1 ); + char* filter = NULL; - FilePathList files = LoadDirectoryFilesEx( luaL_checkstring( L, 1 ), luaL_checkstring( L, 2 ), scanSubdirs ); + if ( lua_isstring( L, 2 ) ) { + filter = (char*)lua_tostring( L, 2 ); + } + FilePathList files = LoadDirectoryFilesEx( basePath, filter, scanSubdirs ); lua_createtable( L, files.count, 0 ); |
