the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 57 lines 1.3 kB view raw
1#pragma once 2 3#include "Buffer.h" 4#include "Definitions.h" 5 6class IntBuffer; 7class FloatBuffer; 8 9class ByteBuffer : public Buffer 10{ 11protected: 12 byte *buffer; 13 ByteOrder byteOrder; 14 15public: 16 ByteBuffer(unsigned int capacity); 17 static ByteBuffer *allocateDirect(int capacity); 18 ByteBuffer( unsigned int capacity, byte *backingArray ); 19 virtual ~ByteBuffer(); 20 21 static ByteBuffer *wrap(byteArray &b); 22 static ByteBuffer *allocate(unsigned int capacity); 23 void order(ByteOrder a); 24 ByteBuffer *flip(); 25 byte *getBuffer(); 26 int getSize(); 27 int getInt(); 28 int getInt(unsigned int index); 29 void get(byteArray) {} // 4J - TODO 30 byte get(int index); 31 __int64 getLong(); 32 short getShort(); 33 void getShortArray(shortArray &s); 34 ByteBuffer *put(int index, byte b); 35 ByteBuffer *putInt(int value); 36 ByteBuffer *putInt(unsigned int index, int value); 37 ByteBuffer *putShort(short value); 38 ByteBuffer *putShortArray(shortArray &s); 39 ByteBuffer *putLong(__int64 value); 40 ByteBuffer *put(byteArray inputArray); 41 byteArray array(); 42 IntBuffer *asIntBuffer(); 43 FloatBuffer *asFloatBuffer(); 44 45}; 46 47 48#ifdef __PS3__ 49// we're using the RSX now to upload textures to vram, so we need th main ram textures allocated from io space 50class ByteBuffer_IO : public ByteBuffer 51{ 52public: 53 ByteBuffer_IO(unsigned int capacity); 54 ~ByteBuffer_IO(); 55}; 56 57#endif // __PS3__