OpenTTD Source 20251213-master-g1091fa6071
squirrel_std.cpp File Reference

Implements the Squirrel Standard Function class. More...

#include "../stdafx.h"
#include <squirrel.h>
#include <sqstdmath.h>
#include "../debug.h"
#include "squirrel_std.hpp"
#include "../string_func.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

void squirrel_register_global_std (Squirrel &engine)
 Register all standard functions that are available on first startup.
 
void squirrel_register_std (Squirrel &engine)
 Register all standard functions we want to give to a script.
 

Detailed Description

Implements the Squirrel Standard Function class.

Definition in file squirrel_std.cpp.

Function Documentation

◆ squirrel_register_global_std()

void squirrel_register_global_std ( Squirrel engine)

Register all standard functions that are available on first startup.

Note
this set is very limited, and is only meant to load other scripts and things like that.

Definition at line 84 of file squirrel_std.cpp.

References Squirrel::AddMethod(), SquirrelStd::notifyallexceptions(), and SquirrelStd::require().

Referenced by Squirrel::Initialize().

◆ squirrel_register_std()

void squirrel_register_std ( Squirrel engine)

Register all standard functions we want to give to a script.

Definition at line 92 of file squirrel_std.cpp.

References Squirrel::AddMethod(), Squirrel::GetVM(), SquirrelStd::max(), and SquirrelStd::min().

Referenced by ScriptInstance::RegisterAPI().