mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
Scripting begins!
Hefty document with all the details of what's implemented so far (check out sub-pages in the Tasks grid) [here](https://www.notion.so/rive-app/Hydrogen-1175da0b06d9807ea221c1cd2fbd0175?pvs=4). Working in the desktop and web editors: Desktop  Web  There's also a standalone test app in packages/sample_code_core:  Diffs= b9773680e3 Scripting begins! (#8751) Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
7cc6f5bbe3c726fc1c94f2075aed7f262240282d
|
||||
b9773680e341b946fa06d046cfeeda8f97555645
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace rive
|
||||
{
|
||||
@@ -25,6 +26,7 @@ public:
|
||||
void writeDouble(double value);
|
||||
void write(uint16_t value);
|
||||
void write(uint32_t value);
|
||||
void write(std::string value);
|
||||
void clear();
|
||||
};
|
||||
} // namespace rive
|
||||
|
||||
34
scripting/premake5.lua
Executable file
34
scripting/premake5.lua
Executable file
@@ -0,0 +1,34 @@
|
||||
local dependency = require("dependency")
|
||||
luau = dependency.github("luigi-rosso/luau", "rive_0_2")
|
||||
|
||||
require("export-compile-commands")
|
||||
dofile("rive_build_config.lua")
|
||||
|
||||
project("luau_vm")
|
||||
do
|
||||
kind("StaticLib")
|
||||
exceptionhandling("On")
|
||||
|
||||
includedirs({
|
||||
luau .. "/VM/include",
|
||||
luau .. "/Common/include",
|
||||
})
|
||||
|
||||
files({ luau .. "/VM/src/**.cpp" })
|
||||
optimize("Size")
|
||||
end
|
||||
|
||||
project("luau_compiler")
|
||||
do
|
||||
kind("StaticLib")
|
||||
exceptionhandling("On")
|
||||
|
||||
includedirs({
|
||||
luau .. "/Compiler/include",
|
||||
luau .. "/Ast/include",
|
||||
luau .. "/Common/include",
|
||||
})
|
||||
|
||||
files({ luau .. "/Compiler/src/**.cpp", luau .. "/Ast/src/**.cpp" })
|
||||
optimize("Size")
|
||||
end
|
||||
@@ -142,4 +142,11 @@ void BinaryWriter::write(uint32_t value)
|
||||
m_Stream->write((const uint8_t*)&value, 4);
|
||||
}
|
||||
|
||||
void BinaryWriter::write(std::string value)
|
||||
{
|
||||
auto length = value.size();
|
||||
writeVarUint((uint64_t)length);
|
||||
write((uint8_t*)value.c_str(), length);
|
||||
}
|
||||
|
||||
void BinaryWriter::clear() { m_Stream->clear(); }
|
||||
Reference in New Issue
Block a user