Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. if (width % 8 == 0)
  2. {
  3. if ((width / 8) % 4 != 0)
  4. {
  5. withOffset = width + ((4 - (width / 8) % 4)) * 8;
  6. offsetByte = 4 - ((width / 8) % 4);
  7. }
  8. else
  9. {
  10. withOffset = width;
  11. offsetByte = 0;
  12. }
  13. }
  14. else
  15. {
  16. if (((width / 8) + 1) % 4 != 0)
  17. {
  18. withOffset = (width / 8 + 1) * 8 + ((4 - (width / 8 + 1) % 4)) * 8;
  19. offsetByte = (4 - ((width / 8 + 1) % 4));
  20. }
  21. else
  22. {
  23. withOffset = width;
  24. offsetByte = 0;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement