Skip to content

Instantly share code, notes, and snippets.

@Jire
Created May 16, 2012 16:05
Show Gist options
  • Save Jire/2711670 to your computer and use it in GitHub Desktop.
Save Jire/2711670 to your computer and use it in GitHub Desktop.
Huge data fit into a long
long hp = 99;
long read = 27;
long magic = 255;
long rating = 30;
long picture = 10;
long sand = 12;
long confirmation = 1;
long skin = 7;
long resolutionX = 120;
long resolutionY = 120;
long oUpdate = 2000;
long debug = 0;
long footer = 1;
long box = ((hp & 0x7F) << 57) | ((read & 0x1F) << 52) | ((magic & 0xFF) << 44) | ((rating & 0x1F) << 39) | ((picture & 0xF) << 35) | ((sand & 0xF) << 31) | ((confirmation & 1) << 30) | ((skin & 3) << 27) | ((resolutionX & 0x7F) << 20) | ((resolutionY & 0x7F) << 13) | ((oUpdate & 0x7FF) << 2) | ((debug & 1) << 1) | (footer & 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment