PreviousUpNext

15.4.1359  src/lib/x-kit/tut/arithmetic-game/diver-images.pkg

## diver-images.pkg
#
# This file contains the stick-figure diver images
# used in diver_pane:   src/lib/x-kit/tut/arithmetic-game/diver-pane.pkg 


# Compiled by:
#     src/lib/x-kit/tut/arithmetic-game/arithmetic-game-app.lib

stipulate
    package xc =  xclient;                              # xclient       is from   src/lib/x-kit/xclient/xclient.pkg
    package g2d=  geometry2d;                           # geometry2d    is from   src/lib/std/2d/geometry2d.pkg
herein
    package diver_images {

        stipulate
            bv = byte::string_to_bytes;
        herein

            Image
                =
                { origin:  g2d::Point,
                  data:    xc::Ro_Pixmap
                };

            fun make_diver_image screen (pt, image)
                = 
                { origin =>  pt,
                  data   =>  xc::make_readonly_pixmap_from_clientside_pixmap  screen  image
                }
                : Image;

            fun set_diver_image
                    (draww, pen)
                    ( { origin, data }, point)
                =
                {   my size as { wide, high }           # These values appear utterly unused. *blink*
                        =
                        xc::size_of_ro_pixmap  data;

                    to_pos =  g2d::point::subtract (point, origin);

                    xc::texture_blt draww pen { from => data, to_pos };
                };


            fun clear_diver_image draww ( { origin, data }, point)
                =
                {   size =  xc::size_of_ro_pixmap  data;

                    to_pos =  g2d::point::subtract (point, origin);

                    xc::clear_box  draww  (g2d::box::make (to_pos, size));
                };

            dive_index  = 0;
            stand_index = 1;
            climb_index = 2;
            top_index   = 6;

            dive =
              ( { col=>15, row=>31 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>32 },

                    data => [ [
                        bv "\x00\x00",
                        bv "\x01\xe0",
                        bv "\x01\xe0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x01\xc0",
                        bv "\x03\xc0",
                        bv "\x07\xc0",
                        bv "\x07\xc0",
                        bv "\x04\x40",
                        bv "\x04\x40",
                        bv "\x34\x40",
                        bv "\x34\x40",
                        bv "\x34\x40",
                        bv "\x35\xe0",
                        bv "\x34\x10",
                        bv "\x3c\x10",
                        bv "\x3f\x90",
                        bv "\x1c\x48",
                        bv "\x1c\x48",
                        bv "\x0e\x48",
                        bv "\x07\xa8",
                        bv "\x03\xa8",
                        bv "\x00\x28",
                        bv "\x00\x10"
                      ] ]
                  }
              );

            stand =
              ( { col=>0, row=>31 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>32 },

                    data => [ [
                        bv "\x00\x00",
                        bv "\x00\x00",
                        bv "\x00\x00",
                        bv "\x81\xc0",
                        bv "\xc1\xe0",
                        bv "\xa2\x70",
                        bv "\x52\x38",
                        bv "\x2a\x38",
                        bv "\x15\xfc",
                        bv "\x0a\x3c",
                        bv "\x04\x2c",
                        bv "\x03\xac",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x03\xe0",
                        bv "\x03\xe0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x03\xc0",
                        bv "\x07\xc0",
                        bv "\x07\xc0"
                      ] ]
                  }
              );

            climb1 =
              ( { col=>0, row=>25 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>26 },

                    data => [ [
                        bv "\x81\xc0",
                        bv "\xc1\xe0",
                        bv "\xa2\x70",
                        bv "\x52\x38",
                        bv "\x2a\x38",
                        bv "\x15\xfc",
                        bv "\x0a\x3c",
                        bv "\x04\x2c",
                        bv "\x03\xac",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x07\xe0",
                        bv "\x0f\xe0",
                        bv "\x1f\xc0",
                        bv "\x1f\x80",
                        bv "\x3c\x00",
                        bv "\x78\x00",
                        bv "\x78\x00",
                        bv "\xf0\x00",
                        bv "\xf0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00"
                      ] ]
                  }
              );

            climb2 =
              ( { col=>0, row=>25 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>26 },

                    data => [ [
                        bv "\x81\xc0",
                        bv "\xc1\xe0",
                        bv "\xa2\x70",
                        bv "\x52\x38",
                        bv "\x2a\x38",
                        bv "\x15\xfc",
                        bv "\x0a\x3c",
                        bv "\x04\x2c",
                        bv "\x03\xac",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x32\x20",
                        bv "\x7a\x20",
                        bv "\xff\xe0",
                        bv "\xef\xe0",
                        bv "\xdf\xc0",
                        bv "\xdf\x80",
                        bv "\x3c\x00",
                        bv "\x78\x00",
                        bv "\x78\x00",
                        bv "\xf0\x00",
                        bv "\xf0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00"
                    ] ]
                  }
              );

            climb3 =
              ( { col=>0, row=>25 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>26 },

                    data => [ [
                        bv "\x01\xc0",
                        bv "\x01\xe0",
                        bv "\x02\x70",
                        bv "\x02\x38",
                        bv "\x02\x38",
                        bv "\x01\xfc",
                        bv "\x1e\x3c",
                        bv "\xf0\x2c",
                        bv "\x07\xac",
                        bv "\xfa\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x07\xe0",
                        bv "\x0f\xe0",
                        bv "\x1f\xc0",
                        bv "\x1f\x80",
                        bv "\x3c\x00",
                        bv "\x78\x00",
                        bv "\x78\x00",
                        bv "\xf0\x00",
                        bv "\xf0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00"
                      ] ]
                  }
              );

            climb4 =
              ( { col=>0, row=>25 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>26 },

                    data => [ [
                        bv "\x81\xc0",
                        bv "\x41\xe0",
                        bv "\xb2\x70",
                        bv "\x4a\x38",
                        bv "\x36\x38",
                        bv "\x09\xfc",
                        bv "\x06\x3c",
                        bv "\xf8\x2c",
                        bv "\x07\xac",
                        bv "\xfa\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x2c",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x07\xe0",
                        bv "\x0f\xe0",
                        bv "\x1f\xc0",
                        bv "\x1f\x80",
                        bv "\x3c\x00",
                        bv "\x78\x00",
                        bv "\x78\x00",
                        bv "\xf0\x00",
                        bv "\xf0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00",
                        bv "\xe0\x00"
                      ] ]
                  }
              );

            top1 =
              ( { col=>8, row=>41 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>16, high=>42 },

                    data => [ [
                        bv "\x00\x1c",
                        bv "\x00\x64",
                        bv "\x00\x84",
                        bv "\x01\x04",
                        bv "\x00\xe4",
                        bv "\x00\x1c",
                        bv "\x00\x04",
                        bv "\x00\x04",
                        bv "\x00\x04",
                        bv "\x10\x04",
                        bv "\x28\x0a",
                        bv "\x28\x0a",
                        bv "\x28\x0a",
                        bv "\x29\xca",
                        bv "\x2b\xea",
                        bv "\x26\x32",
                        bv "\x12\xa4",
                        bv "\x0a\x28",
                        bv "\x05\xd0",
                        bv "\x04\x10",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x02\x20",
                        bv "\x03\xe0",
                        bv "\x03\xe0",
                        bv "\x03\xe0",
                        bv "\x03\xe0",
                        bv "\x03\xe0",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x03\x60",
                        bv "\x07\x70",
                        bv "\x07\x70"
                      ] ]
                  }
              );

            top2 =
              ( { col=>10, row=>35 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>32, high=>36 },

                    data => [ [
                        bv "\x00\x00\x00\x10",
                        bv "\x00\x00\x00\x28",
                        bv "\x00\x00\x00\x44",
                        bv "\x00\x00\x00\x84",
                        bv "\x00\x00\x01\xc2",
                        bv "\x00\x00\x02\x39",
                        bv "\x00\x00\x02\x07",
                        bv "\x00\x70\x04\x00",
                        bv "\xe0\xf8\x38\x00",
                        bv "\x90\x88\x48\x00",
                        bv "\xcc\xa9\x98\x00",
                        bv "\x23\x8e\x20\x00",
                        bv "\x18\x70\xc0\x00",
                        bv "\x06\x03\x00\x00",
                        bv "\x03\x8e\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x01\xdc\x00\x00",
                        bv "\x01\xdc\x00\x00"
                      ] ]
                  }
              );

            top3 =
              ( { col=>10, row=>31 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>32, high=>32 },

                    data => [ [
                        bv "\x00\x00\x00\x00",
                        bv "\x00\x00\x00\x00",
                        bv "\x00\x00\x00\x00",
                        bv "\x00\x70\x00\x00",
                        bv "\x00\xf8\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x00\xa8\x00\x00",
                        bv "\x00\x88\x00\x00",
                        bv "\x01\x74\x00\x00",
                        bv "\x03\x06\x00\x00",
                        bv "\x06\x8b\x00\x00",
                        bv "\x18\x88\xc0\x00",
                        bv "\x23\x8e\x20\x00",
                        bv "\xcc\x89\x98\x00",
                        bv "\x90\x88\x48\x00",
                        bv "\xe0\x88\x3e\x00",
                        bv "\x00\x88\x01\x80",
                        bv "\x00\xf8\x00\x60",
                        bv "\x00\xf8\x00\x58",
                        bv "\x00\xf8\x00\x44",
                        bv "\x00\xf8\x00\x44",
                        bv "\x00\xf8\x00\x24",
                        bv "\x00\xd8\x00\x24",
                        bv "\x00\xd8\x00\x24",
                        bv "\x00\xd8\x00\x18",
                        bv "\x00\xd8\x00\x10",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x00\xd8\x00\x00",
                        bv "\x01\xdc\x00\x00",
                        bv "\x01\xdc\x00\x00"
                      ] ]
                  }
              );

            top4 =
              ( { col=>8, row=>31 },

                xc::CS_PIXMAP
                  {
                    size => { wide=>20, high=>32 },

                    data => [ [
                        bv "\x00\x00\x00",
                        bv "\x00\x00\x00",
                        bv "\x00\x00\x00",
                        bv "\x01\xc0\x00",
                        bv "\x03\xe0\x00",
                        bv "\x02\x20\x00",
                        bv "\x02\xa0\x00",
                        bv "\x02\x20\x00",
                        bv "\x05\xd0\x00",
                        bv "\x04\x10\x00",
                        bv "\x0a\x28\x00",
                        bv "\x12\x24\x00",
                        bv "\x26\x32\x00",
                        bv "\x2a\x2a\x00",
                        bv "\x2a\x2a\x00",
                        bv "\x2a\x2a\x00",
                        bv "\x2a\x2a\x00",
                        bv "\x2b\xea\x00",
                        bv "\x13\xe4\x00",
                        bv "\x03\xe4\x00",
                        bv "\x03\xe4\x00",
                        bv "\x03\xe4\x00",
                        bv "\x03\x66\x00",
                        bv "\x03\x65\x00",
                        bv "\x03\x64\x80",
                        bv "\x03\x64\x80",
                        bv "\x03\x64\x40",
                        bv "\x03\x67\x40",
                        bv "\x03\x61\x40",
                        bv "\x03\x61\x40",
                        bv "\x07\x70\x80",
                        bv "\x07\x70\x00"
                      ] ]
                  }
              );

            images = [ dive, stand, climb1, climb2, climb3, climb4, top1, top2, top3, top4];

        end;                            # stipulate
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext