DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦33ac32044⟧ TextFile

    Length: 4295 (0x10c7)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦306851c02⟧ 
                └─⟦this⟧ 

TextFile

separate (Puz_Main)  
procedure Repaint_Title (Method : Title_Method) is  
    Twidth        : S_Long;  
    Theight       : S_Long;  
    Box_X         : S_Long;  
    Box_Y         : S_Long;  
    I             : S_Long;  
    J             : S_Long;  
    Start_Color   : S_Natural;  
    Color2        : S_Natural;  
    Tiny_Box_Size : S_Long;  
    Tx            : S_Long;  
    Ty            : S_Long;  
begin

----applications painting their own title is out of style,
--  so don't just leave it there;

    Tiny_Box_Size := 5;  
    Twidth        := Puzzle_Win_Info.Width * 3 / 4;  
    Tx            := (Puzzle_Win_Info.Width - Twidth) / 2;  
    Text_X_Start  := Tx;

    if Method = Title_Text then  
        Twidth  := S_Long (X_Text_Width (Title_Font_Info, "Puzzle"));  
        Theight := S_Long (Title_Font_Info.Ascent + Title_Font_Info.Descent);  
        Tx      := (Puzzle_Win_Info.Width - Twidth) / 2;  
        Ty      := S_Long ((Title_Win_Height - Theight) / 2 +  
                           S_Long (Title_Font_Info.Ascent));

        X_Set_Font (Dpy, Gc, Title_Font_Info.Font_Id);  
        X_Draw_String (Dpy, Title_Window.Drawable, Gc,  
                       S_Short (Tx), S_Short (Ty), "Puzzle");  
        X_Flush (Dpy);

    elsif Method = Title_Tiles then  
        Start_Color := 0;  
        I           := 0;  
        while I < Title_Win_Height loop  
            Color2 := Start_Color;  
            J      := 0;  
            while J < Twidth loop  
                Rect_Set (Title_Window, J + Text_X_Start, I, Tiny_Box_Size,  
                          Tiny_Box_Size, X_Pixel (Color2 rem 2));  
                J      := J + Tiny_Box_Size;  
                Color2 := Color2 + 1;  
            end loop;  
            I           := I + Tiny_Box_Size;  
            Start_Color := Start_Color + 1;  
        end loop;

    else
        -- method = TITLE_ANIMATED
        declare  
            Tiles_High : S_Long :=  
               (Title_Win_Height + Tiny_Box_Size - 1) / Tiny_Box_Size;  
            Tiles_Wide : S_Long := (Twidth + Tiny_Box_Size - 1) / Tiny_Box_Size;  
            Num_Tiles  : S_Long := Tiles_High * Tiles_Wide;  
            Color_Val  : X_Pixel_Array (0 .. S_Natural (Num_Tiles) - 1);  
            Xloc       : S_Short_Array (0 .. S_Natural (Num_Tiles) - 1);  
            Yloc       : S_Short_Array (0 .. S_Natural (Num_Tiles) - 1);  
            Permute    : U_Short_Array (0 .. S_Natural (Num_Tiles) - 1);  
            Tmp        : S_Long;  
            Swap_With  : S_Natural;  
            Counter    : S_Natural;  
        begin

            for I in 0 .. Num_Tiles - 1 loop  
                Permute (S_Natural (I)) := U_Short (I);  
            end loop;  
            for I in reverse 2 .. Num_Tiles - 1 loop  
                Swap_With               := Random rem S_Natural (I);  
                Tmp                     := S_Long (Permute (Swap_With));  
                Permute (Swap_With)     := Permute (S_Natural (I));  
                Permute (S_Natural (I)) := U_Short (Tmp);  
            end loop;

            Counter     := 0;  
            Start_Color := 0;  
            I           := 0;  
            while I < Title_Win_Height loop  
                Color2 := Start_Color;  
                J      := 0;  
                while J < Twidth loop  
                    Color_Val (Counter) := X_Pixel (Color2 rem 2);  
                    Xloc (Counter)      := S_Short (J + Text_X_Start);  
                    Yloc (Counter)      := S_Short (I);  
                    Counter             := Counter + 1;  
                    J                   := J + Tiny_Box_Size;  
                    Color2              := Color2 + 1;  
                end loop;  
                I           := I + Tiny_Box_Size;  
                Start_Color := Start_Color + 1;  
            end loop;

            for I in 0 .. Num_Tiles - 1 loop  
                J := S_Long (Permute (S_Natural (I)));  
                Rect_Set (Title_Window, S_Long (Xloc (S_Natural (J))),  
                          S_Long (Yloc (S_Natural (J))), Tiny_Box_Size,  
                          Tiny_Box_Size, Color_Val (S_Natural (J)));  
                X_Flush (Dpy);  
            end loop;

        end;

    end if;

end Repaint_Title;