File: cosplay.pas

package info (click to toggle)
gearhead 1.310-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 10,028 kB
  • sloc: pascal: 36,375; makefile: 78
file content (82 lines) | stat: -rw-r--r-- 3,034 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
unit cosplay;

interface
    uses gears,sdlgfx,sdlmenus,colormenu,sdl;

    Procedure DoCosplay();


implementation
    Procedure RedrawOpening;
        { The opening menu redraw procedure. }
    begin
        ClrScreen;
        ClearExtendedBorder( ZONE_Menu.GetRect() );
    end;

    Procedure BrowseByType( FPat: String; width,height,frames,ColorMode: Integer );
        { Browse the images by file pattern and color mode. }
    var
        FileMenu: RPGMenuPtr;
        SpriteName: String;
    begin
        FileMenu := CreateRPGMenu( MenuItem , MenuSelect , ZONE_Menu );
        if FPat = '' then begin
            { We want all the mecha. All of them!!! }
            BuildFileMenu( FileMenu , Graphics_Directory + 'aer_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'ara_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'btr_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'gca_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'ger_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'ghu_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'hov_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'orn_*.png' );
            BuildFileMenu( FileMenu , Graphics_Directory + 'zoa_*.png' );

        end else BuildFileMenu( FileMenu , Graphics_Directory + FPat );
        RPMSortAlpha( FileMenu );
        AddRPGMenuItem( FileMenu, MsgString( 'EXIT' ), -1 );
        SpriteName := '';

        repeat
            SpriteName := SelectFile( FileMenu , @RedrawOpening );
            if SpriteName <> '' then SelectColorPalette( ColorMode, SpriteName, '200 0 0 200 200 0 0 200 0', width, height, frames, @ClrScreen );
        until SpriteName = '';

        DisposeRPGMenu( FileMenu );
    end;
    
    Procedure DoCosplay();

    var
        FileMenu: RPGMenuPtr;
        N: Integer;
        MySprite: SensibleSpritePtr;

    begin
        FileMenu := CreateRPGMenu( MenuItem , MenuSelect , ZONE_Menu );

        {MySprite := ConfirmSprite( 'Elisha_Demo.png', '80 40 120 255 230 200 166 47 32', 64, 64 );}
        {SDL_SaveBmp( MySprite^.img , 'out.bmp' );}

        AddRPGMenuItem( FileMenu , 'Browse Portraits' , 1 );
        AddRPGMenuItem( FileMenu , 'Browse Mecha' , 2 );
        AddRPGMenuItem( FileMenu , 'Browse Monsters' , 3 );
        AddRPGMenuItem( FileMenu , 'Browse All' , 4 );

        repeat
            N := SelectMenu( FileMenu , @RedrawOpening );
            case N of
                1: BrowseByType( 'por_*.png' , 100, 150, 0, colormenu_mode_character );
                2: BrowseByType( '' , 64, 64, 8, colormenu_mode_mecha );
                3: BrowseByType( 'monster_*.png' , 64, 64, 8, colormenu_mode_allcolors );
                4: BrowseByType( '*.png' , 211, 308, 0, colormenu_mode_allcolors );
            end;

        until N = -1;



        DisposeRPGMenu( FileMenu );
    end;
end.