Skip to content

Instantly share code, notes, and snippets.

@byteandahalf
Last active August 29, 2015 14:26
Show Gist options
  • Save byteandahalf/4ed20a655309681575a6 to your computer and use it in GitHub Desktop.
Save byteandahalf/4ed20a655309681575a6 to your computer and use it in GitHub Desktop.
PortalTexture::tick
virtual void PortalTexture::tick() {
// copy the next frame of the image into the current frame buffer
// Left shift by 10 is the same as * 1024
// 0x400 = 1024, which is the number of uchars in one frame
// (16*16 pixels, with an RGBA for each pixel)
memcpy(currentFramePixels, pixels[currentFrame << 10], 0x400);
currentFrame++;
if(currentFrame >= frameCount) {
currentFrame = 0;
}
}
@rekmolly
Copy link

rekmolly commented Aug 4, 2015

How make custom entity?

@byteandahalf
Copy link
Author

I'll post an example later.

@rekmolly
Copy link

rekmolly commented Aug 6, 2015

Thanks!All Russia love you :)

@rekmolly
Copy link

rekmolly commented Aug 6, 2015

Buy you can help me with initialization FoodItem?I get crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment