faluco@505: /** faluco@505: * vim: set ts=4 : faluco@505: * =============================================================== faluco@505: * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. faluco@505: * =============================================================== faluco@505: * faluco@505: * This file is part of the SourceMod/SourcePawn SDK. This file may only be used faluco@505: * or modified under the Terms and Conditions of its License Agreement, which is found faluco@505: * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins faluco@505: * may change at any time. To view the latest information, see: faluco@505: * http://www.sourcemod.net/license.php faluco@505: * faluco@505: * Version: $Id$ faluco@505: */ faluco@505: faluco@505: #if defined _bitbuffer_included faluco@505: #endinput faluco@505: #endif faluco@505: #define _bitbuffer_included faluco@505: faluco@505: /** faluco@505: * Writes a single bit to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param bit Bit to write (true for 1, false for 0). faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteBool(Handle:bf, bool:bit); faluco@505: faluco@505: /** faluco@505: * Writes a byte to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param byte Byte to write (value will be written as 8bit). faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteByte(Handle:bf, byte); faluco@505: faluco@505: /** faluco@505: * Writes a byte to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param chr Character to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteChar(Handle:bf, chr); faluco@505: faluco@505: /** faluco@505: * Writes a 16bit integer to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param num Integer to write (value will be written as 16bit). faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteShort(Handle:bf, num); faluco@505: faluco@505: /** faluco@505: * Writes a 16bit unsigned integer to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param num Integer to write (value will be written as 16bit). faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteWord(Handle:bf, num); faluco@505: faluco@505: /** faluco@505: * Writes a normal integer to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param num Integer to write (value will be written as 32bit). faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteNum(Handle:bf, num); faluco@505: faluco@505: /** faluco@505: * Writes a floating point number to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param num Number to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteFloat(Handle:bf, Float:num); faluco@505: faluco@505: /** faluco@505: * Writes a string to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param string Text string to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteString(Handle:bf, const String:string[]); faluco@505: faluco@505: /** faluco@505: * Writes an entity to a writable bitbuffer (bf_write). faluco@505: * @note This is a wrapper around BfWriteShort(). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param ent Entity index to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle, or invalid entity. faluco@505: */ faluco@505: native BfWriteEntity(Handle:bf, ent); faluco@505: faluco@505: /** faluco@505: * Writes a bit angle to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param angle Angle to write. faluco@505: * @param numBits Optional number of bits to use. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteAngle(Handle:bf, Float:angle, numBits=8); faluco@505: faluco@505: /** faluco@505: * Writes a coordinate to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bf bf_write handle to write to. faluco@505: * @param coord Coordinate to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteCoord(Handle:bf, Float:coord); faluco@505: faluco@505: /** faluco@505: * Writes a 3D vector of coordinates to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bif bf_write handle to write to. faluco@505: * @param coord Coordinate array to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteVecCoord(Handle:bf, Float:coord[3]); faluco@505: faluco@505: /** faluco@505: * Writes a 3D normal vector to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bif bf_write handle to write to. faluco@505: * @param vec Vector to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteVecNormal(Handle:bf, Float:vec[3]); faluco@505: faluco@505: /** faluco@505: * Writes a 3D angle vector to a writable bitbuffer (bf_write). faluco@505: * faluco@505: * @param bif bf_write handle to write to. faluco@505: * @param angles Angle vector to write. faluco@505: * @noreturn faluco@505: * @error Invalid or incorrect Handle. faluco@505: */ faluco@505: native BfWriteAngles(Handle:bf, Float:angles[3]);