载入中...
搜索中...
未找到
LightningBindings.cpp
浏览该文件的文档.
19 auto cls = table.addClass<Lightning>("Lightning", std::function<Lightning*()>([]() -> Lightning* {
23 weather.addFunc("prepareLightning", [vm](Weather*, graphics::Graphics* gfx, LightningSettings* s) {
26 vm, Status::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "Graphics and settings required",
34 cls.addFunc("setEndpoints", [vm](Lightning* s, float ax, float ay, float az, float bx, float by, float bz) {
The single Squirrel projection for common Result, Status and Value.
Explicit Value/Owned/Borrowed semantics at the Squirrel boundary.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
static Status failure(StatusCode code, Diagnostic diagnostic)
Construct a failed status with one diagnostic.
Definition Status.cpp:28
Definition Graphics.h:134
Independently owned, pooled visual effect; main/render thread only, no callbacks or gameplay damage....
Definition Lightning.h:44
float amplitude() const
Current visual amplitude; zero after stop or retirement.
Definition Lightning.cpp:161
static Result< std::unique_ptr< Lightning > > prepare(graphics::Graphics &graphics, const LightningSettings &settings)
Validate and prepare hidden geometry; Graphics must be live during this call.
Definition Lightning.cpp:55
Weather module — real-time precipitation / lightning / wind system.
Definition Weather.h:36
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:524
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
eve::Result< ssq::Object > makeOwnedSquirrelInstance(HSQUIRRELVM vm, Owned< T > object)
Creates a Squirrel instance that owns a C++ wrapper through a release hook.
Definition SquirrelOwnership.h:240
Definition LightingTarget.h:19
void exposeLightning(ssq::Table &table, ssq::Class &weather)
Register preparation/settings and owned Lightning methods on Weather.
Definition LightningBindings.cpp:9
@ InvalidArgument
Copied preparation settings. Width and displacement are world units, independent of endpoint distance...
Definition Lightning.h:16