|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 9216 (0x2400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Repaint_Title, seg_00539d, separate Puz_Main
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
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;
nblk1=8
nid=0
hdr6=10
[0x00] rec0=1d rec1=00 rec2=01 rec3=048
[0x01] rec0=03 rec1=00 rec2=08 rec3=02e
[0x02] rec0=1a rec1=00 rec2=02 rec3=010
[0x03] rec0=00 rec1=00 rec2=07 rec3=03c
[0x04] rec0=12 rec1=00 rec2=03 rec3=060
[0x05] rec0=03 rec1=00 rec2=06 rec3=03a
[0x06] rec0=15 rec1=00 rec2=04 rec3=052
[0x07] rec0=0a rec1=00 rec2=05 rec3=001
tail 0x21500a04281978957d2ee 0x42a00088462063203