Results 1 to 12 of 12

Thread: Store information with Bitmaps!

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default Store information with Bitmaps!

    Yep, posted about earlier, I'm seeing how people like it.

    SCAR Code:
    program New;
    //{.Include SRL/SRL.scar}
     
    function IntToBool(TheInt: Integer): Boolean;
      begin;
        If (TheInt = 0) Then
          Result:= False;
         else
          Result:= True;
      end;
     
    function BoolToInt(TheBool: Boolean): Integer;
      begin;
        If not (TheBool) Then
          Result:= False;
         else
          Result:= True;
      end;
     
    { function SetIntBMP                                                  ]
    [                                                   ]
    [ Desc.   : Returns True if it had to split the integer in half to    ]
    [           store it. In which case, you must specify if it has been  ]
    [           split on retrieval                                        }

     
    function SetIntBMP(BitMSet, Valu, X, Y: Integer): Boolean;
      begin;
        If not (Valu > 16777215) Then
          begin;
            FastSetPixel(BitMSet, X, Y, Valu);
            Result:= False;
          end else
          begin;
            FastSetPixel(BitMSet, X, Y, Round(Valu - Round(Valu/2)));
            Result:= True;
          end;
      end;
     
    function SetFloatBMP(BitMSet, X, Y: Integer; Valu: Extended): Boolean;
      Var
        S, L, sValu ssValu: Extended;
      begin;
        If not (Valu > 16777215) Then
          begin;
            sValu:= Valu - Round(Valu);
            ssValu:= sValu - (sValu / 2);
            FastSetPixel(BitMSet, X, Y, HSLToColor(Valu, ssValu, ssValu));
            Result:= False;
          end else
          begin;
            sValu:= Valu - Round(Valu);
            ssValu:= sValu - (sValu / 2);
            FastSetPixel(BitMSet, X, Y, HSLToColor(Valu/2, ssValu, 0.0));
            Result:= True;
          end;
      end;
     
    function SetBoolBMP(BitMSet, X, Y: Integer; Valu: Boolean): Boolean;
      begin;
        Result:= Valu;
        FastSetPixel(BitMSet, X, Y, BoolToInt(Valu));
      end;
     
    function ReadIntBMP(BitMSet, X, Y: Integer, Halved: Boolean): Integer;
      begin;
        If (Halved) Then
          Result:= FastGetPixel(BitMSet, X, Y) * 2;
         else
          Result:= FastGetPixel(BitMSet, X, Y);
      end;
     
    function ReadFloatBMP(BitMSet, X, Y: Integer; Halved: Boolean): Extended;
      Var H, S, L, sValu: Extended;
      begin;
        If (Halved) Then
          begin;
            ColorToHSL(FastGetPixel(BitMSet, X, Y), H, S, L);
            Result:= H+S+L*2;
          end else
          begin;
            ColorToHSL(FastGetPixel(BitMSet, X, Y), H, S, L);
            Result:= H+S+L;
          end;
      end;
     
    function ReadBoolBMP(BitMSet, X, Y: Integer): Boolean;
      begin;
        Result:= IntToBool(FastGetPixel(BitMSet, X, Y));
      end;
     
    begin;
    end.
     
    {
    This agreement may be ignored for identified members of SRL-Forums.com under the discretion of R0b0t1. All members of aforementioned website under the title of SRL Member, SRL Dev, Dev, SSRL (Senior Scar Resource Library Member), Admin, or Administrator, will be excused from the above clause and instead be able to use this file without discretion of R0b0t1, but may be asked to remove said file from use if required to by request from R0b0t1.

    <OWNER> = User under the alias of R0b0t1, R0b0t1, unextended family of alias R0b0t1.
    <ORGANIZATION> = R0b0t1
    <YEAR> = 2007
     
    Copyright (c) <YEAR>, <OWNER>
     
    All rights reserved.
     
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
     
        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
     
        * Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
     
        * Neither the name of the <ORGANIZATION> nor the names of its
          contributors may be used to endorse or promote products derived
          from this software without specific prior written permission.
     
        * You may not use this software for personal gain and/or bussiness
          purposes without specific prior written permision.
     
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.          }
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  2. #2
    Join Date
    Mar 2006
    Location
    USA
    Posts
    948
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Me thinks its funny that you put it under a license agreement.

    I have a question...
    What did you create this intending it to be used for?

  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i want to know what the use of this is for

    Join the fastest growing merchanting clan on the the net!

  4. #4
    Join Date
    Oct 2006
    Location
    C:\Program Files\SCAR 2.03
    Posts
    1,194
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe he created it to be a sort of Recorder that will store variable that you tell it to into a BMP using some sort of numbering technique, which I believe develops into color when you look at the BMP.

    I don't know why he's so protective of it, but it is a good idea, although just storing a text document and reading from it is less efficient but a lot easier.
    [FONT="Garamond"][SIZE="3"]
    Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.
    [/SIZE][/FONT][URL="http://www.villavu.com/forum/forumdisplay.php?f=125"][IMG]http://i40.tinypic.com/r1lzdv.jpg[/IMG][/URL]

  5. #5
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by r0b0t1 View Post
    Yep, posted about earlier, I'm seeing how people like it.

    SCAR Code:
    {
    <OWNER> = User under the alias of R0b0t1
    <ORGANIZATION> = R0b0t1
    <YEAR> = 2007
     
    Copyright (c) <YEAR>, <OWNER>
     
    All rights reserved.
     
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
     
        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
     
        * Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
     
        * Neither the name of the <ORGANIZATION> nor the names of its
          contributors may be used to endorse or promote products derived
          from this software without specific prior written permission.
     
        * You may not use this software for personal gain and/or bussiness
          purposes without specific prior written permision.
     
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.          }

    Paranoid much?





    *uploads torrent*

  6. #6
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Huh? Oh shit... Sorry, forgot to leave that out. No, im over being paranoid.


    Nut yes, you store stuff in a savable bitmap.


    EDIT: Added escape clause.

    EDIT: No strings, that would be too slow. But it is useful for storing integers, if you haven't caught on.

    EDIT: Also, legal notices are more to scare people... Piracy much?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  7. #7
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function IntToBool(TheInt: Integer): Boolean;
      begin;
        If (TheInt = 0) Then
          Result:= False;
         else
          Result:= True;
      end;
     
    function BoolToInt(TheBool: Boolean): Integer;
      begin;
        If not (TheBool) Then
          Result:= False;
         else
          Result:= True;
      end;

    Erm...the function is meant to return an integer but you're making it return a boolean...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  8. #8
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Grave dig: And BrainFuck!
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    9 days isn't grave-digging. And...what's with the second part?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  10. #10
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    My brain wasn't working. Lol?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  11. #11
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I see that happens quite a lot lately

    You did the same thing on some other thread.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  12. #12
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Lolzmunch
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Shuttle u Information
    By Waddo in forum Discussions & Debates
    Replies: 3
    Last Post: 09-04-2008, 04:34 PM
  2. UID information.
    By richk1693 in forum Bot Information and Spottings
    Replies: 12
    Last Post: 10-14-2007, 10:06 AM
  3. NEED HELP with login information
    By Nme28 in forum OSR Help
    Replies: 3
    Last Post: 01-15-2007, 06:29 PM

Posting Permissions

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