Results 1 to 10 of 34

Thread: BeRoPNG - A very tiny but complete PNG loader

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #15
    Quote Originally Posted by deathshadow View Post
    word and $FFFF0000 === 0 -- ALWAYS
    word shl 16 === 0 -- ALWAYS.
    Sorry, you're wrong. See my code again:

    Code:
    function Swap32(x:word):word;
    begin
     result:=(Swap16(x and $ffff) shl 16) or Swap16((x and $ffff0000) shr 16);
    end;
    The first swap16 call gets "x and $ffff", and the result of it will shifted 16 bits to left, which's correct.
    The second swap16 call gets "(x and $ffff0000) shr 16" or short "x shr 16", and the result of it will not shifted because it was already shifted 16 bits to right, which's also correct.

    I guess, you had simply overlook the correct nested levels of the (...) blocks in my code.
    Last edited by BeRo; 31-08-2011 at 09:46 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •