Skip to content

Commit c10dfe6

Browse files
committed
math.floor
1 parent d0674ed commit c10dfe6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/raylib-lua-sol.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*
4545
********************************************************************************************/
4646

47+
#include <sol/sol.hpp>
4748
#include <iostream>
4849
#include <string>
4950

@@ -98,11 +99,10 @@ int main(int argc, char *argv[])
9899

99100
// Execute the script.
100101
// TODO: Use JIT compiler
101-
try {
102-
lua.script_file(fileToLoad);
103-
}
104-
catch (const std::exception& e) {
105-
std::cout << e.what() << std::endl;
102+
auto result = lua.safe_script_file(fileToLoad, sol::script_pass_on_error);
103+
if (!result.valid()) {
104+
sol::error err = result;
105+
std::cerr << "The code was unable to run." << std::endl << err.what() << std::endl;
106106
return 1;
107107
}
108108

examples/textures/textures_bunnymark.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC key
8787
-- Process of sending data is costly and it could happen that GPU data has not been completely
8888
-- processed for drawing while new data is tried to be sent (updating current in-use buffers)
8989
-- it could generates a stall and consequently a frame drop, limiting the number of drawn bunnies
90-
DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, bunnies[i].color);
90+
DrawTexture(texBunny, math.floor(bunnies[i].position.x), math.floor(bunnies[i].position.y), bunnies[i].color);
9191
end
9292

9393
DrawRectangle(0, 0, screenWidth, 40, BLACK)

0 commit comments

Comments
 (0)