Exemplo n.º 1
0
 OggFile(Gosu::Reader reader)
 : reader_(buffer_.frontReader())
 {
     buffer_.resize(reader.resource().size() - reader.position());
     reader.read(buffer_.data(), buffer_.size());
     
     setup();
 }
Exemplo n.º 2
0
void FI(loadImageFile)(Bitmap& bitmap, Gosu::Reader input)
{
    // Read all available input
    std::vector<BYTE> data(input.resource().size() - input.position());
    input.read(&data[0], data.size());
    FIMEMORY* fim = FreeImage_OpenMemory(&data[0], data.size());
    FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(fim);
    FIBITMAP* fib = FreeImage_LoadFromMemory(fif, fim, GOSU_FIFLAGS);
    checkForFreeImageErrors(fib != 0);
    fibToBitmap(bitmap, fib, fif);
}
Exemplo n.º 3
0
    typename boost::uint_t<bits>::fast readVal(Gosu::Reader& reader)
    {
    	typename boost::uint_t<bits>::least val;
        reader.readPod(val, Gosu::boLittle);
	return val;
    }