Rev 82 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 82 | Rev 135 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | extends Canvas |
15 | extends Canvas |
16 | { |
16 | { |
Line 17... | Line 17... | ||
17 | 17 | ||
- | 18 | ||
- | 19 | public boolean showing=false; |
|
18 | 20 | public boolean paused=false; |
|
Line 19... | Line 21... | ||
19 | public boolean showing=false; |
21 | |
20 | public String debug_msg=""; |
22 | public String debug_msg=""; |
Line 21... | Line 23... | ||
21 | 23 | ||
Line 22... | Line 24... | ||
22 | private byte[] debug_screen_sequence={KEY_POUND,KEY_NUM4,KEY_NUM2}; |
24 | private byte[] debug_screen_sequence={KEY_POUND,KEY_NUM4,KEY_NUM2}; |
- | 25 | private byte debug_screen_sequence_pos=0; |
|
23 | private byte debug_screen_sequence_pos=0; |
26 | |
- | 27 | ||
- | 28 | public final static int DEBUG_HISTORY_LENGTH=1000; |
|
Line 24... | Line 29... | ||
24 | 29 | ||
Line 25... | Line 30... | ||
25 | 30 | ||
- | 31 | public String[] debug_msgs; |
|
- | 32 | ||
26 | public final static int DEBUG_HISTORY_LENGTH=100; |
33 | public int debug_pos=0; |
- | 34 | public int debug_paused_pos=0; |
|
- | 35 | ||
27 | 36 | ||
28 | 37 | int y_off=0; |
|
29 | public String[] debug_msgs; |
38 | |
30 | public int debug_pos=0; |
39 | |
Line 31... | Line 40... | ||
31 | 40 | public DUBwiseCanvas canvas; |
|
32 | int y_off=0; |
41 | |
- | 42 | public DUBwiseDebug(DUBwiseCanvas canvas_) |
|
33 | 43 | { |
|
34 | 44 | canvas=canvas_; |
|
35 | public DUBwiseDebug() |
45 | |
36 | { |
46 | debug_msgs=new String[DEBUG_HISTORY_LENGTH]; |
37 | debug_msgs=new String[DEBUG_HISTORY_LENGTH]; |
47 | for (int tmp_i=0;tmp_i<DEBUG_HISTORY_LENGTH;tmp_i++) |
Line 54... | Line 64... | ||
54 | Font debug_font= Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); |
64 | Font debug_font= Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); |
Line 55... | Line 65... | ||
55 | 65 | ||
Line 56... | Line 66... | ||
56 | g.setFont(debug_font); |
66 | g.setFont(debug_font); |
57 | 67 | ||
58 | g.setColor(0x0000FF); |
68 | g.setColor(0x0000FF); |
Line 59... | Line 69... | ||
59 | g.fillRect(0,0,this.getWidth(),this.getHeight()); |
69 | g.fillRect(0,0,canvas.getWidth(),canvas.getHeight()); |
- | 70 | g.setColor(0xFFFFFF); |
|
60 | g.setColor(0xFFFFFF); |
71 | |
61 | 72 | y_off=0; |
|
62 | y_off=0; |
73 | if (!paused) debug_paused_pos=debug_pos; |
63 | for (int tmp_pos=debug_pos;((tmp_pos>0)&&(y_off<this.getHeight()));tmp_pos--) |
74 | for (int tmp_pos=debug_paused_pos;((tmp_pos>0)&&(y_off<canvas.getHeight()));tmp_pos--) |
Line 64... | Line 75... | ||
64 | { |
75 | { |
Line 74... | Line 85... | ||
74 | tmp_str=""; |
85 | tmp_str=""; |
75 | } |
86 | } |
76 | else |
87 | else |
77 | tmp_str+=debug_msg.charAt(tmp_i); |
88 | tmp_str+=debug_msg.charAt(tmp_i); |
78 | } |
89 | } |
79 | g.drawString(tmp_str,0,y_off,Graphics.TOP | Graphics.LEFT); |
90 | g.drawString(tmp_pos+" "+tmp_str,0,y_off,Graphics.TOP | Graphics.LEFT); |
80 | y_off+=debug_font.getHeight(); |
91 | y_off+=debug_font.getHeight(); |
81 | } |
92 | } |
Line 82... | Line 93... | ||
82 | 93 | ||
Line 102... | Line 113... | ||
102 | } |
113 | } |
103 | else |
114 | else |
104 | { |
115 | { |
105 | if (keyCode==KEY_STAR) |
116 | if (keyCode==KEY_STAR) |
106 | showing=false; |
117 | showing=false; |
- | 118 | ||
- | 119 | if (keyCode==KEY_NUM0) |
|
- | 120 | paused=!paused; |
|
- | 121 | ||
- | 122 | ||
- | 123 | switch (getGameAction (keyCode)) |
|
- | 124 | { |
|
- | 125 | case UP: |
|
- | 126 | debug_paused_pos++; |
|
- | 127 | break; |
|
- | 128 | ||
- | 129 | case DOWN: |
|
- | 130 | debug_paused_pos--; |
|
- | 131 | break; |
|
- | 132 | ||
- | 133 | } |
|
- | 134 | ||
- | 135 | ||
107 | } |
136 | } |
Line 108... | Line 137... | ||
108 | 137 |