Need help understanding a line of code...

leap = yOff % 4 == 0;

Take yOff and modulus divide 4. If the result is 0, assign 1 to leap. Otherwise, assign 0 to leap.

A functionally equivalent example is

if ((yOff % 4) == 0)
  leap = 1;
else
  leap = 0;