本文整理汇总了C++中GLua_CheckBitStream函数的典型用法代码示例。如果您正苦于以下问题:C++ GLua_CheckBitStream函数的具体用法?C++ GLua_CheckBitStream怎么用?C++ GLua_CheckBitStream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GLua_CheckBitStream函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GLua_BitStream_Index
static int GLua_BitStream_Index(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
const char *key = lua_tostring(L,2);
GLUA_UNUSED(stream);
lua_getmetatable(L,1);
lua_getfield(L,-1,key);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:8,代码来源:glua_bitstream.cpp
示例2: GLua_BitStream_ToString
static int GLua_BitStream_ToString(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
lua_pushstring(L,va("BitStream [ Reading - %i / %i bytes ]", stream->stream.readcount, stream->stream.maxsize ));
} else {
lua_pushstring(L,va("BitStream [ Writing - %i / %i bytes ]", stream->stream.cursize, stream->stream.maxsize ));
}
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:9,代码来源:glua_bitstream.cpp
示例3: GLua_BitStream_GetData
static int GLua_BitStream_GetData(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
lua_pushlstring(L, stream->data, stream->stream.maxsize);
} else {
lua_pushlstring(L, stream->data, stream->stream.cursize);
}
return 1;
}
开发者ID:Stoiss,项目名称:JediKnightGalaxies,代码行数:10,代码来源:glua_bitstream.c
示例4: GLua_BitStream_Reset
static int GLua_BitStream_Reset(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
BitStream_BeginReading(&stream->stream);
} else {
stream->stream.cursize = 0;
stream->stream.bit = 0;
}
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp
示例5: GLua_BitStream_GetLength
static int GLua_BitStream_GetLength(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
lua_pushinteger(L, stream->stream.maxsize);
} else {
lua_pushinteger(L, stream->stream.cursize);
}
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp
示例6: GLua_BitStream_BytesRemaining
static int GLua_BitStream_BytesRemaining(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
lua_pushinteger(L, stream->stream.maxsize - stream->stream.readcount);
} else {
lua_pushinteger(L, stream->stream.maxsize - stream->stream.cursize);
}
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp
示例7: GLua_BitStream_GetData
static int GLua_BitStream_GetData(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
if (stream->reading) {
lua_pushlstring(L, reinterpret_cast<const char *>(stream->data), stream->stream.maxsize);
} else {
lua_pushlstring(L, reinterpret_cast<const char *>(stream->data), stream->stream.cursize);
}
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp
示例8: GLua_BitStream_WriteUInt
static int GLua_BitStream_WriteUInt(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
unsigned int val = luaL_checkinteger(L,2);
if (stream->reading) {
luaL_error(L, "Attempted to write to a read-only bitstream");
return 0;
}
BitStream_WriteUInt(&stream->stream, val);
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp
示例9: GLua_BitStream_WriteBool
static int GLua_BitStream_WriteBool(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
int val = lua_toboolean(L,2);
if (stream->reading) {
luaL_error(L, "Attempted to write to a read-only bitstream");
return 0;
}
BitStream_WriteBool(&stream->stream, val);
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp
示例10: GLua_BitStream_WriteString
static int GLua_BitStream_WriteString(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
const char *val = luaL_checkstring(L,2);
if (stream->reading) {
luaL_error(L, "Attempted to write to a read-only bitstream");
return 0;
}
BitStream_WriteString(&stream->stream, val);
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp
示例11: GLua_BitStream_WriteDouble
static int GLua_BitStream_WriteDouble(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
double val = luaL_checknumber(L,2);
if (stream->reading) {
luaL_error(L, "Attempted to write to a read-only bitstream");
return 0;
}
BitStream_WriteDouble(&stream->stream, val);
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp
示例12: GLua_BitStream_ReadDouble
static int GLua_BitStream_ReadDouble(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
double val;
if (!stream->reading) {
luaL_error(L, "Attempted to read from a write-only bitstream");
return 0;
}
val = BitStream_ReadDouble(&stream->stream);
lua_pushnumber(L, val);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp
示例13: GLua_BitStream_ReadUInt
static int GLua_BitStream_ReadUInt(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
unsigned int val;
if (!stream->reading) {
luaL_error(L, "Attempted to read from a write-only bitstream");
return 0;
}
val = BitStream_ReadUInt(&stream->stream);
lua_pushinteger(L, val);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp
示例14: GLua_BitStream_ReadBool
static int GLua_BitStream_ReadBool(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
int val;
if (!stream->reading) {
luaL_error(L, "Attempted to read from a write-only bitstream");
return 0;
}
val = BitStream_ReadBool(&stream->stream);
lua_pushboolean(L, val);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp
示例15: GLua_BitStream_ReadString
static int GLua_BitStream_ReadString(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
luaL_Buffer B;
char ch;
if (!stream->reading) {
luaL_error(L, "Attempted to read from a write-only bitstream");
return 0;
}
luaL_buffinit(L, &B);
while (1) {
ch = BitStream_ReadChar(&stream->stream);
if (!ch) {
break;
}
luaL_addchar(&B, ch);
}
luaL_pushresult(&B);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:21,代码来源:glua_bitstream.cpp
示例16: GLua_BitStream_WriteData
static int GLua_BitStream_WriteData(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
unsigned int length;
unsigned int deslength;
const char *val = luaL_checklstring(L,2, &length);
if (!lua_isnoneornil(L,3)) {
deslength = luaL_checkinteger(L,3);
if (length < deslength) {
luaL_error(L, "BitStream_WriteData: Specified length is less than data length");
}
length = deslength;
}
if (stream->reading) {
luaL_error(L, "Attempted to write to a read-only bitstream");
return 0;
}
BitStream_WriteData(&stream->stream, (const unsigned char *)val, length);
return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:23,代码来源:glua_bitstream.cpp
示例17: GLua_BitStream_GetMaxLength
static int GLua_BitStream_GetMaxLength(lua_State *L) {
GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
lua_pushinteger(L, stream->stream.maxsize);
return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:6,代码来源:glua_bitstream.cpp
注:本文中的GLua_CheckBitStream函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论