/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/text.h

  • Committer: Tim Marston
  • Date: 2012-05-09 21:36:01 UTC
  • Revision ID: tim@ed.am-20120509213601-kk1tqa9yg4xk45y9
added info mode, a '/' to the fonts and cleaned up a couple of bits

Show diffs side-by-side

added added

removed removed

35
35
{
36
36
        enum {
37
37
                // one of these to select face
38
 
                MODE_TOP = 0,
39
 
                MODE_BOTTOM = 64,
 
38
                MODE_TOP = 1,
 
39
                MODE_BOTTOM = 0,
40
40
 
41
41
                // one of these to select size
42
 
                MODE_ONEQUARTER = 1,
43
 
                MODE_ONETHIRD = 2,
44
 
                MODE_HALF = 3,
45
 
                MODE_TWOTHIRDS = 4,
46
 
                MODE_THREEQUARTERS = 5,
47
 
                MODE_ALL = 6,
 
42
                MODE_ONEQUARTER = 0,
 
43
                MODE_ONETHIRD = 4,
 
44
                MODE_HALF = 8,
 
45
                MODE_TWOTHIRDS = 12,
 
46
                MODE_THREEQUARTERS = 16,
 
47
                MODE_ALL = 20,
48
48
 
49
49
                // flag to turn on horizontal scrolling
50
50
                MODE_HSCROLL = 32,
51
51
        };
52
52
 
53
 
        enum {
54
 
                SCALE_VSMALL = 1,
55
 
                SCALE_SMALL = 2,
56
 
                SCALE_NORMAL = 3,
57
 
                SCALE_FAT = 4,
58
 
                SCALE_VFAT = 5,
59
 
        };
60
 
 
61
 
        /**
62
 
         * Reset internal state, for a new text display. This deactivates all
63
 
         * messages and they will need to be enabled again with set_up_message().
64
 
         */
65
 
        void reset();
66
 
 
67
 
        /**
68
 
         * Activate the display of a message and specify its display parameters.
69
 
         *
70
 
         * @param message_num the message to reset
71
 
         * @param mode the new mode for this message
72
 
         * @param scale text
73
 
         */
74
 
        void set_up_message( int message_num, char mode, char scale = SCALE_NORMAL );
75
 
 
76
53
        /**
77
54
         * After modifying a message buffer, call this to reset the internal state
78
55
         * of the text renderer with regard to this message.
80
57
         * @param message_num the buffer number
81
58
         * @param pstring the PString that represents this message's buffer
82
59
         */
83
 
        void set_message_text( int message_num, PString &pstring );
 
60
        void set_message( int message_num, PString &pstring );
 
61
 
 
62
        /**
 
63
         * Reset the display of a message and specify its display parameters.
 
64
         *
 
65
         * @param message_num the message to reset
 
66
         * @param mode the new mode for this message
 
67
         * @param scale text
 
68
         */
 
69
        void reset_message( int message_num, char mode, int scale = 3 );
 
70
 
 
71
        /**
 
72
         * Reset internal state, for a new text display.
 
73
         */
 
74
        void reset();
84
75
 
85
76
        /**
86
77
         * Call at the start of each frame.
88
79
        void draw_reset();
89
80
 
90
81
        /**
91
 
         * Call after drawing each frame
92
 
         */
93
 
        void post_draw();
94
 
 
95
 
        /**
96
82
         * Draw segment for the specified message number using whatever mode that
97
83
         * message is set to.
98
84
         *
 
85
         * @param message_num the message buffer number
99
86
         * @param segment to draw
100
87
         */
101
 
        void draw( int segment );
 
88
        void draw( int message_num, int segment );
102
89
 
103
90
        /** internal message buffers */
104
91
        extern char _messages[ NUM_MESSAGE_BUFFERS ][ MESSAGE_LEN ];