Improved Docs, AnimationStepApplyMesh+Materials, some other minor tweaks
This commit is contained in:
@@ -256,22 +256,22 @@
|
||||
// either.
|
||||
//
|
||||
// Lua has a datatype called 'lightuserdata'. A lightuserdata holds an
|
||||
// int64. That gives me an option: I can store json null as
|
||||
// lightuserdata(0x6E756C6C00000000). When we see this lightuserdata
|
||||
// value, we would know we have a json null. Why 0x6E756C6C00000000?
|
||||
// Because if you interpret those 8 bytes as 8 ascii characters, it's the
|
||||
// string "null".
|
||||
// int64. That gives me an option: I can store json null as a
|
||||
// lightuserdata. When we see this lightuserdata value, we would know
|
||||
// we have a json null.
|
||||
//
|
||||
// So that finally brings me to what a "token" is. A token is a lightuserdata
|
||||
// containing up to 8 ascii characters. So in effect, it's a short string,
|
||||
// but it's a string that's distinguishable from a normal lua string. It
|
||||
// doesn't have the same type as a lua string (it shows up as a lightuserdata).
|
||||
// containing a short string encoded as a base36 number. Tokens may only
|
||||
// contain the characters a-z and 0-9, and can be up to 12 characters long
|
||||
// (since 36^12 fits in 64 bits). In effect, it's a short string, but it's
|
||||
// a string that's distinguishable from a normal lua string. It doesn't have
|
||||
// the same type as a lua string (it shows up as a lightuserdata).
|
||||
// The purpose of tokens is to represent special unique values, like json null.
|
||||
//
|
||||
// To make working with tokens easy, I've created a C++ class 'LuaToken'.
|
||||
// To make working with tokens easy, I've created a C++ struct 'LuaToken'.
|
||||
// It stores an int64. You can construct a LuaToken in two different ways:
|
||||
//
|
||||
// LuaToken(0x6E756C6C00000000)
|
||||
// LuaToken(0x10FAA9)
|
||||
// LuaToken("null")
|
||||
//
|
||||
// Those are equivalent. The second form is just as fast as the first,
|
||||
|
||||
Reference in New Issue
Block a user