-rw-r--r-- | noncore/games/backgammon/moveengine.cpp | 6 | ||||
-rw-r--r-- | noncore/games/kbill/UI.cpp | 31 | ||||
-rw-r--r-- | noncore/games/kcheckers/echeckers.cpp | 12 | ||||
-rw-r--r-- | noncore/games/kcheckers/rcheckers.cpp | 36 | ||||
-rw-r--r-- | noncore/settings/sysinfo/contrib/fft.c | 2 | ||||
-rw-r--r-- | noncore/styles/theme/othemebase.cpp | 2 |
6 files changed, 51 insertions, 38 deletions
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp index a4145cc..b102258 100644 --- a/noncore/games/backgammon/moveengine.cpp +++ b/noncore/games/backgammon/moveengine.cpp | |||
@@ -40,33 +40,34 @@ MoveEngine::~MoveEngine() | |||
40 | {} | 40 | {} |
41 | 41 | ||
42 | void MoveEngine::position(Pieces& pieces,bool non_qte) | 42 | void MoveEngine::position(Pieces& pieces,bool non_qte) |
43 | { | 43 | { |
44 | int player1_counter=0; | 44 | int player1_counter=0; |
45 | int player2_counter=0; | 45 | int player2_counter=0; |
46 | 46 | ||
47 | //non qte styles are smaller !! | 47 | //non qte styles are smaller !! |
48 | int offset=(non_qte) ? 5 : 0; | 48 | int offset=(non_qte) ? 5 : 0; |
49 | 49 | ||
50 | for(int a=0;a<28;a++) | 50 | for(int a=0;a<28;a++) |
51 | { | 51 | { |
52 | for(int b=0;b<abs(population[a].total);b++) | 52 | for(int b=0;b<abs(population[a].total);b++) |
53 | { | 53 | { |
54 | if(population[a].total>0) //player 1 pieces | 54 | if(population[a].total>0) //player 1 pieces |
55 | { | 55 | { |
56 | pieces.player1[player1_counter].x=x_coord[a]-offset; | 56 | if (a < 26) |
57 | pieces.player1[player1_counter].x=x_coord[a]-offset; | ||
57 | if(a>=0 && a<13) | 58 | if(a>=0 && a<13) |
58 | { | 59 | { |
59 | pieces.player1[player1_counter].y=yup_coord[b]-offset; | 60 | pieces.player1[player1_counter].y=yup_coord[b]-offset; |
60 | pieces.player1[player1_counter].z=z_coord[b]; | 61 | pieces.player1[player1_counter].z=z_coord[b]; |
61 | pieces.player1[player1_counter].side=false; | 62 | pieces.player1[player1_counter].side=false; |
62 | player1_counter++; | 63 | player1_counter++; |
63 | } | 64 | } |
64 | else if(a>12 && a<26) | 65 | else if(a>12 && a<26) |
65 | { | 66 | { |
66 | pieces.player1[player1_counter].y=ylow_coord[b]-offset; | 67 | pieces.player1[player1_counter].y=ylow_coord[b]-offset; |
67 | pieces.player1[player1_counter].z=z_coord[b]; | 68 | pieces.player1[player1_counter].z=z_coord[b]; |
68 | pieces.player1[player1_counter].side=false; | 69 | pieces.player1[player1_counter].side=false; |
69 | player1_counter++; | 70 | player1_counter++; |
70 | } | 71 | } |
71 | else if(a==26) | 72 | else if(a==26) |
72 | { | 73 | { |
@@ -83,33 +84,34 @@ void MoveEngine::position(Pieces& pieces,bool non_qte) | |||
83 | pieces.player1[player1_counter].z=z_fin; | 84 | pieces.player1[player1_counter].z=z_fin; |
84 | } | 85 | } |
85 | else | 86 | else |
86 | { | 87 | { |
87 | pieces.player1[player1_counter].x=x_fin1[2]-offset; | 88 | pieces.player1[player1_counter].x=x_fin1[2]-offset; |
88 | pieces.player1[player1_counter].y=y_fin[b-10]-offset; | 89 | pieces.player1[player1_counter].y=y_fin[b-10]-offset; |
89 | pieces.player1[player1_counter].z=z_fin; | 90 | pieces.player1[player1_counter].z=z_fin; |
90 | } | 91 | } |
91 | pieces.player1[player1_counter].side=true; | 92 | pieces.player1[player1_counter].side=true; |
92 | player1_counter++; | 93 | player1_counter++; |
93 | 94 | ||
94 | } | 95 | } |
95 | } | 96 | } |
96 | 97 | ||
97 | else if(population[a].total<0) //player 2 pieces | 98 | else if(population[a].total<0) //player 2 pieces |
98 | { | 99 | { |
99 | pieces.player2[player2_counter].x=x_coord[a]-offset; | 100 | if (a < 26) |
101 | pieces.player2[player2_counter].x=x_coord[a]-offset; | ||
100 | if(a>=0 && a<13) | 102 | if(a>=0 && a<13) |
101 | { | 103 | { |
102 | pieces.player2[player2_counter].y=yup_coord[b]-offset; | 104 | pieces.player2[player2_counter].y=yup_coord[b]-offset; |
103 | pieces.player2[player2_counter].z=z_coord[b]; | 105 | pieces.player2[player2_counter].z=z_coord[b]; |
104 | pieces.player2[player2_counter].side=false; | 106 | pieces.player2[player2_counter].side=false; |
105 | player2_counter++; | 107 | player2_counter++; |
106 | } | 108 | } |
107 | else if(a>12 && a<26) | 109 | else if(a>12 && a<26) |
108 | { | 110 | { |
109 | pieces.player2[player2_counter].y=ylow_coord[b]-offset; | 111 | pieces.player2[player2_counter].y=ylow_coord[b]-offset; |
110 | pieces.player2[player2_counter].z=z_coord[b]; | 112 | pieces.player2[player2_counter].z=z_coord[b]; |
111 | pieces.player2[player2_counter].side=false; | 113 | pieces.player2[player2_counter].side=false; |
112 | player2_counter++; | 114 | player2_counter++; |
113 | } | 115 | } |
114 | else if(a==27) | 116 | else if(a==27) |
115 | { | 117 | { |
diff --git a/noncore/games/kbill/UI.cpp b/noncore/games/kbill/UI.cpp index 611cebf..a49c3c1 100644 --- a/noncore/games/kbill/UI.cpp +++ b/noncore/games/kbill/UI.cpp | |||
@@ -55,54 +55,53 @@ void UI::graph_init() { | |||
55 | pix = new QPixmap(Game::scrwidth, Game::scrheight); | 55 | pix = new QPixmap(Game::scrwidth, Game::scrheight); |
56 | paint.begin(pix, field); | 56 | paint.begin(pix, field); |
57 | paint.setPen(QPen(Qt::black, 3)); | 57 | paint.setPen(QPen(Qt::black, 3)); |
58 | } | 58 | } |
59 | 59 | ||
60 | void UI::make_mainwin() { | 60 | void UI::make_mainwin() { |
61 | main = new KBill(); | 61 | main = new KBill(); |
62 | app->showMainWidget(main,true); | 62 | app->showMainWidget(main,true); |
63 | main->showMaximized(); | 63 | main->showMaximized(); |
64 | field = main->getField(); | 64 | field = main->getField(); |
65 | } | 65 | } |
66 | 66 | ||
67 | void UI::popup_dialog (int dialog) { | 67 | void UI::popup_dialog (int dialog) { |
68 | kill_timer(); | 68 | kill_timer(); |
69 | switch (dialog) { | 69 | switch (dialog) { |
70 | case Game::ENDGAME: | 70 | case Game::ENDGAME: |
71 | QMessageBox::message(("Endgame"), QT_TR_NOOP(endgamestr)); | 71 | QMessageBox::message(("Endgame"), QT_TR_NOOP(endgamestr)); |
72 | break; | 72 | break; |
73 | case Game::HIGHSCORE: | 73 | case Game::HIGHSCORE: |
74 | //QMessageBox::message(("HighScore"), highscorestr); | 74 | break; |
75 | break; | 75 | case Game::ENTERNAME: |
76 | case Game::ENTERNAME: { | 76 | { |
77 | InputBox b(main, 0, ("Enter Name"), QT_TR_NOOP(enternamestr)); | 77 | InputBox b(main, 0, ("Enter Name"), QT_TR_NOOP(enternamestr)); |
78 | bool state = b.exec() == 2; | 78 | bool state = b.exec() == 2; |
79 | char str[20], *nl; | 79 | char str[20], *nl; |
80 | strcpy(str, b.getText()); | 80 | strncpy(str, b.getText(), 19); |
81 | if (!str[0] || state) | 81 | if (!str[0] || state) |
82 | strcpy(str, "Anonymous"); | 82 | strcpy(str, "Anonymous"); |
83 | else if ((nl = strchr(str, '\n'))) | 83 | else if ((nl = strchr(str, '\n'))) |
84 | *nl = '\0'; | 84 | *nl = '\0'; |
85 | if (strlen(str) > 20) | 85 | if (strlen(str) > 19) |
86 | str[20] = 0; /* truncate string if too long */ | 86 | str[19] = '\0'; /* truncate/terminate the string if it is too long */ |
87 | // scores.recalc(str); | 87 | } |
88 | } | 88 | break; |
89 | break; | ||
90 | case Game::SCORE: | 89 | case Game::SCORE: |
91 | QMessageBox::message(("Score"), scorestr); | 90 | QMessageBox::message(("Score"), scorestr); |
92 | break; | 91 | break; |
93 | } | 92 | } |
94 | restart_timer(); | 93 | restart_timer(); |
95 | } | 94 | } |
96 | 95 | ||
97 | /*********************/ | 96 | /*********************/ |
98 | /* Graphics routines */ | 97 | /* Graphics routines */ |
99 | /*********************/ | 98 | /*********************/ |
100 | 99 | ||
101 | void UI::set_cursor(int cursor) { | 100 | void UI::set_cursor(int cursor) { |
102 | QCursor *cur; | 101 | QCursor *cur; |
103 | switch (cursor) { | 102 | switch (cursor) { |
104 | case Game::BUCKETC: | 103 | case Game::BUCKETC: |
105 | cur = bucket.cursor.cursor; | 104 | cur = bucket.cursor.cursor; |
106 | break; | 105 | break; |
107 | case Game::DOWNC: | 106 | case Game::DOWNC: |
108 | cur = downcursor.cursor; | 107 | cur = downcursor.cursor; |
diff --git a/noncore/games/kcheckers/echeckers.cpp b/noncore/games/kcheckers/echeckers.cpp index 1146059..afe62eb 100644 --- a/noncore/games/kcheckers/echeckers.cpp +++ b/noncore/games/kcheckers/echeckers.cpp | |||
@@ -66,35 +66,35 @@ bool ECheckers::checkCapture1() | |||
66 | for(int i=6;i<48;i++) | 66 | for(int i=6;i<48;i++) |
67 | { | 67 | { |
68 | switch(board[i]) | 68 | switch(board[i]) |
69 | { | 69 | { |
70 | case MAN1: | 70 | case MAN1: |
71 | if(board[i-6]==MAN2 || board[i-6]==KING2) | 71 | if(board[i-6]==MAN2 || board[i-6]==KING2) |
72 | if(board[i-12]==FREE) return true; | 72 | if(board[i-12]==FREE) return true; |
73 | if(board[i-5]==MAN2 || board[i-5]==KING2) | 73 | if(board[i-5]==MAN2 || board[i-5]==KING2) |
74 | if(board[i-10]==FREE) return true; | 74 | if(board[i-10]==FREE) return true; |
75 | break; | 75 | break; |
76 | case KING1: | 76 | case KING1: |
77 | if(board[i-6]==MAN2 || board[i-6]==KING2) | 77 | if(board[i-6]==MAN2 || board[i-6]==KING2) |
78 | if(board[i-12]==FREE) return true; | 78 | if(board[i-12]==FREE) return true; |
79 | if(board[i-5]==MAN2 || board[i-5]==KING2) | 79 | if(board[i-5]==MAN2 || board[i-5]==KING2) |
80 | if(board[i-10]==FREE) return true; | 80 | if(board[i-10]==FREE) return true; |
81 | if(board[i+5]==MAN2 || board[i+5]==KING2) | 81 | if(board[i+5]==MAN2 || board[i+5]==KING2) |
82 | if(board[i+10]==FREE) return true; | 82 | if(board[((i+10) < 54) ? i+10 : 53]==FREE) return true; |
83 | if(board[i+6]==MAN2 || board[i+6]==KING2) | 83 | if(board[i+6]==MAN2 || board[i+6]==KING2) |
84 | if(board[i+12]==FREE) return true; | 84 | if(board[((i+12) < 54) ? i+12 : 53]==FREE) return true; |
85 | } | 85 | } |
86 | } | 86 | } |
87 | return false; | 87 | return false; |
88 | } | 88 | } |
89 | 89 | ||
90 | 90 | ||
91 | // Return TRUE if a course of the user true | 91 | // Return TRUE if a course of the user true |
92 | // Return FALSE if a course of the user incorrect | 92 | // Return FALSE if a course of the user incorrect |
93 | 93 | ||
94 | bool ECheckers::manCapture1(int from,int direction,bool &capture) | 94 | bool ECheckers::manCapture1(int from,int direction,bool &capture) |
95 | { | 95 | { |
96 | int i=from+direction; | 96 | int i=from+direction; |
97 | if(board[i]==MAN2 || board[i]==KING2) | 97 | if(board[i]==MAN2 || board[i]==KING2) |
98 | { | 98 | { |
99 | int k=i+direction; | 99 | int k=i+direction; |
100 | if(board[k]==FREE) | 100 | if(board[k]==FREE) |
@@ -208,45 +208,45 @@ void ECheckers::kingMove2(int from,int &resMax) | |||
208 | turn(resMax); | 208 | turn(resMax); |
209 | board[i]=FREE; | 209 | board[i]=FREE; |
210 | } | 210 | } |
211 | 211 | ||
212 | board[from]=KING2; | 212 | board[from]=KING2; |
213 | } | 213 | } |
214 | 214 | ||
215 | 215 | ||
216 | bool ECheckers::checkCapture2() | 216 | bool ECheckers::checkCapture2() |
217 | { | 217 | { |
218 | for(int i=6;i<48;i++) | 218 | for(int i=6;i<48;i++) |
219 | { | 219 | { |
220 | switch(board[i]) | 220 | switch(board[i]) |
221 | { | 221 | { |
222 | case MAN2: | 222 | case MAN2: |
223 | if(board[i+5]==MAN1 || board[i+5]==KING1) | 223 | if(board[i+5]==MAN1 || board[i+5]==KING1) |
224 | if(board[i+10]==FREE) return true; | 224 | if(board[((i+10) < 54) ? i+10 : 53]==FREE) return true; |
225 | if(board[i+6]==MAN1 || board[i+6]==KING1) | 225 | if(board[i+6]==MAN1 || board[i+6]==KING1) |
226 | if(board[i+12]==FREE) return true; | 226 | if(board[((i+12) < 54) ? i+12 : 53]==FREE) return true; |
227 | break; | 227 | break; |
228 | case KING2: | 228 | case KING2: |
229 | if(board[i-6]==MAN1 || board[i-6]==KING1) | 229 | if(board[i-6]==MAN1 || board[i-6]==KING1) |
230 | if(board[i-12]==FREE) return true; | 230 | if(board[i-12]==FREE) return true; |
231 | if(board[i-5]==MAN1 || board[i-5]==KING1) | 231 | if(board[i-5]==MAN1 || board[i-5]==KING1) |
232 | if(board[i-10]==FREE) return true; | 232 | if(board[i-10]==FREE) return true; |
233 | if(board[i+5]==MAN1 || board[i+5]==KING1) | 233 | if(board[i+5]==MAN1 || board[i+5]==KING1) |
234 | if(board[i+10]==FREE) return true; | 234 | if(board[((i+10) < 54) ? i+10 : 53]==FREE) return true; |
235 | if(board[i+6]==MAN1 || board[i+6]==KING1) | 235 | if(board[i+6]==MAN1 || board[i+6]==KING1) |
236 | if(board[i+12]==FREE) return true; | 236 | if(board[((i+12) < 54) ? i+12 : 53]==FREE) return true; |
237 | } | 237 | } |
238 | } | 238 | } |
239 | return false; | 239 | return false; |
240 | } | 240 | } |
241 | 241 | ||
242 | 242 | ||
243 | // Return TRUE if it is possible to capture | 243 | // Return TRUE if it is possible to capture |
244 | // Return FALSE if it is impossible to capture | 244 | // Return FALSE if it is impossible to capture |
245 | 245 | ||
246 | bool ECheckers::manCapture2(int from,int &resMax) | 246 | bool ECheckers::manCapture2(int from,int &resMax) |
247 | { | 247 | { |
248 | bool capture=false; | 248 | bool capture=false; |
249 | 249 | ||
250 | int i=from+5; | 250 | int i=from+5; |
251 | if(board[i]==MAN1 || board[i]==KING1) | 251 | if(board[i]==MAN1 || board[i]==KING1) |
252 | { | 252 | { |
diff --git a/noncore/games/kcheckers/rcheckers.cpp b/noncore/games/kcheckers/rcheckers.cpp index a1c7afa..d808780 100644 --- a/noncore/games/kcheckers/rcheckers.cpp +++ b/noncore/games/kcheckers/rcheckers.cpp | |||
@@ -99,53 +99,59 @@ bool RCheckers::go1(int from,int field) | |||
99 | return false; | 99 | return false; |
100 | } | 100 | } |
101 | 101 | ||
102 | 102 | ||
103 | bool RCheckers::checkCapture1() | 103 | bool RCheckers::checkCapture1() |
104 | { | 104 | { |
105 | for(int i=6;i<48;i++) | 105 | for(int i=6;i<48;i++) |
106 | { | 106 | { |
107 | switch(board[i]) | 107 | switch(board[i]) |
108 | { | 108 | { |
109 | case MAN1: | 109 | case MAN1: |
110 | if(board[i-6]==MAN2 || board[i-6]==KING2) | 110 | if(board[i-6]==MAN2 || board[i-6]==KING2) |
111 | if(board[i-12]==FREE) return true; | 111 | if(board[i-12]==FREE) return true; |
112 | if(board[i-5]==MAN2 || board[i-5]==KING2) | 112 | if(board[i-5]==MAN2 || board[i-5]==KING2) |
113 | if(board[i-10]==FREE) return true; | 113 | if(board[i-10]==FREE) return true; |
114 | if(board[i+5]==MAN2 || board[i+5]==KING2) | 114 | if(board[i+5]==MAN2 || board[i+5]==KING2) |
115 | if(board[i+10]==FREE) return true; | 115 | if(board[((i+10) < 54) ? i+10 : 53]==FREE) return true; |
116 | if(board[i+6]==MAN2 || board[i+6]==KING2) | 116 | if(board[i+6]==MAN2 || board[i+6]==KING2) |
117 | if(board[i+12]==FREE) return true; | 117 | if(board[((i+12) < 54) ? i+12 : 53]==FREE) return true; |
118 | break; | 118 | break; |
119 | case KING1: | 119 | case KING1: |
120 | int k; | 120 | int k; |
121 | for(k=i-6;board[k]==FREE;k-=6); | 121 | for(k=i-6;board[k]==FREE;k-=6); |
122 | if(board[k]==MAN2 || board[k]==KING2) | 122 | if(board[k]==MAN2 || board[k]==KING2) |
123 | if(board[k-6]==FREE) return true; | 123 | if(board[k-6]==FREE) return true; |
124 | 124 | ||
125 | for(k=i-5;board[k]==FREE;k-=5); | 125 | for(k=i-5;board[k]==FREE;k-=5); |
126 | if(board[k]==MAN2 || board[k]==KING2) | 126 | if(board[k]==MAN2 || board[k]==KING2) |
127 | if(board[k-5]==FREE) return true; | 127 | if(board[k-5]==FREE) return true; |
128 | 128 | ||
129 | for(k=i+5;board[k]==FREE;k+=5); | 129 | for(k=i+5;board[k]==FREE;k+=5) { |
130 | if (k >= 49) | ||
131 | break; | ||
132 | } | ||
130 | if(board[k]==MAN2 || board[k]==KING2) | 133 | if(board[k]==MAN2 || board[k]==KING2) |
131 | if(board[k+5]==FREE) return true; | 134 | if(board[((k+5) < 54) ? k+5 : 53]==FREE) return true; |
132 | 135 | ||
133 | for(k=i+6;board[k]==FREE;k+=6); | 136 | for(k=i+6;board[k]==FREE;k+=6) { |
137 | if (k >=48) | ||
138 | break; | ||
139 | } | ||
134 | if(board[k]==MAN2 || board[k]==KING2) | 140 | if(board[k]==MAN2 || board[k]==KING2) |
135 | if(board[k+6]==FREE) return true; | 141 | if(board[((k+6) < 54) ? k+6 : 53]==FREE) return true; |
136 | } | 142 | } |
137 | } | 143 | } |
138 | return false; | 144 | return false; |
139 | } | 145 | } |
140 | 146 | ||
141 | 147 | ||
142 | // Return TRUE if a course of the user true | 148 | // Return TRUE if a course of the user true |
143 | // Return FALSE if a course of the user incorrect | 149 | // Return FALSE if a course of the user incorrect |
144 | 150 | ||
145 | bool RCheckers::manCapture1(int from,int direction,bool &capture) | 151 | bool RCheckers::manCapture1(int from,int direction,bool &capture) |
146 | { | 152 | { |
147 | int i=from+direction; | 153 | int i=from+direction; |
148 | if(board[i]==MAN2 || board[i]==KING2) | 154 | if(board[i]==MAN2 || board[i]==KING2) |
149 | { | 155 | { |
150 | int k=i+direction; | 156 | int k=i+direction; |
151 | if(board[k]==FREE) | 157 | if(board[k]==FREE) |
@@ -273,53 +279,59 @@ void RCheckers::kingMove2(int from,int &resMax) | |||
273 | board[from]=KING2; | 279 | board[from]=KING2; |
274 | } | 280 | } |
275 | 281 | ||
276 | 282 | ||
277 | bool RCheckers::checkCapture2() | 283 | bool RCheckers::checkCapture2() |
278 | { | 284 | { |
279 | for(int i=6;i<48;i++) | 285 | for(int i=6;i<48;i++) |
280 | { | 286 | { |
281 | switch(board[i]) | 287 | switch(board[i]) |
282 | { | 288 | { |
283 | case MAN2: | 289 | case MAN2: |
284 | if(board[i-6]==MAN1 || board[i-6]==KING1) | 290 | if(board[i-6]==MAN1 || board[i-6]==KING1) |
285 | if(board[i-12]==FREE) return true; | 291 | if(board[i-12]==FREE) return true; |
286 | if(board[i-5]==MAN1 || board[i-5]==KING1) | 292 | if(board[i-5]==MAN1 || board[i-5]==KING1) |
287 | if(board[i-10]==FREE) return true; | 293 | if(board[i-10]==FREE) return true; |
288 | if(board[i+5]==MAN1 || board[i+5]==KING1) | 294 | if(board[i+5]==MAN1 || board[i+5]==KING1) |
289 | if(board[i+10]==FREE) return true; | 295 | if(board[((i+10) < 54) ? i+10 : 53]==FREE) return true; |
290 | if(board[i+6]==MAN1 || board[i+6]==KING1) | 296 | if(board[i+6]==MAN1 || board[i+6]==KING1) |
291 | if(board[i+12]==FREE) return true; | 297 | if(board[((i+12) < 54) ? i+12 : 53]==FREE) return true; |
292 | break; | 298 | break; |
293 | case KING2: | 299 | case KING2: |
294 | int k; | 300 | int k; |
295 | for(k=i-6;board[k]==FREE;k-=6); | 301 | for(k=i-6;board[k]==FREE;k-=6); |
296 | if(board[k]==MAN1 || board[k]==KING1) | 302 | if(board[k]==MAN1 || board[k]==KING1) |
297 | if(board[k-6]==FREE) return true; | 303 | if(board[k-6]==FREE) return true; |
298 | 304 | ||
299 | for(k=i-5;board[k]==FREE;k-=5); | 305 | for(k=i-5;board[k]==FREE;k-=5); |
300 | if(board[k]==MAN1 || board[k]==KING1) | 306 | if(board[k]==MAN1 || board[k]==KING1) |
301 | if(board[k-5]==FREE) return true; | 307 | if(board[k-5]==FREE) return true; |
302 | 308 | ||
303 | for(k=i+5;board[k]==FREE;k+=5); | 309 | for(k=i+5;board[k]==FREE;k+=5) { |
310 | if (k>=49) | ||
311 | break; | ||
312 | } | ||
304 | if(board[k]==MAN1 || board[k]==KING1) | 313 | if(board[k]==MAN1 || board[k]==KING1) |
305 | if(board[k+5]==FREE) return true; | 314 | if(board[((k+5) < 54) ? k+5 : 53]==FREE) return true; |
306 | 315 | ||
307 | for(k=i+6;board[k]==FREE;k+=6); | 316 | for(k=i+6;board[k]==FREE;k+=6) { |
317 | if (k>=48) | ||
318 | break; | ||
319 | } | ||
308 | if(board[k]==MAN1 || board[k]==KING1) | 320 | if(board[k]==MAN1 || board[k]==KING1) |
309 | if(board[k+6]==FREE) return true; | 321 | if(board[((k+6) < 54) ? k+6 : 53]==FREE) return true; |
310 | } | 322 | } |
311 | } | 323 | } |
312 | return false; | 324 | return false; |
313 | } | 325 | } |
314 | 326 | ||
315 | 327 | ||
316 | // Return TRUE if it is possible to capture | 328 | // Return TRUE if it is possible to capture |
317 | // Return FALSE if it is impossible to capture | 329 | // Return FALSE if it is impossible to capture |
318 | 330 | ||
319 | bool RCheckers::manCapture2(int from,int &resMax) | 331 | bool RCheckers::manCapture2(int from,int &resMax) |
320 | { | 332 | { |
321 | bool capture=false; | 333 | bool capture=false; |
322 | 334 | ||
323 | int i=from-6; | 335 | int i=from-6; |
324 | if(board[i]==MAN1 || board[i]==KING1) | 336 | if(board[i]==MAN1 || board[i]==KING1) |
325 | { | 337 | { |
diff --git a/noncore/settings/sysinfo/contrib/fft.c b/noncore/settings/sysinfo/contrib/fft.c index 01a1b26..60ee27d 100644 --- a/noncore/settings/sysinfo/contrib/fft.c +++ b/noncore/settings/sysinfo/contrib/fft.c | |||
@@ -16,33 +16,33 @@ | |||
16 | // along with this program; if not, write to the Free Software | 16 | // along with this program; if not, write to the Free Software |
17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 | // | 18 | // |
19 | // | 19 | // |
20 | // Author : Satoshi ( af230533@im07.alpha-net.ne.jp ) | 20 | // Author : Satoshi ( af230533@im07.alpha-net.ne.jp ) |
21 | // ****************************************************************** | 21 | // ****************************************************************** |
22 | 22 | ||
23 | //*********************************************************************** | 23 | //*********************************************************************** |
24 | // ¹â®¥Õ¡¼¥ê¥¨ÊÑ´¹¡Ê£Æ£Æ£Ô¡Ë | 24 | // ¹â®¥Õ¡¼¥ê¥¨ÊÑ´¹¡Ê£Æ£Æ£Ô¡Ë |
25 | // ¹¹¤Ë¥¹¥Ô¡¼¥É¡¦¥¢¥Ã¥×¤¹¤ë¤Ë¤Ï£Ã£Ï£Ó¤ò¸ÇÄê¤Ç»ý¤Ä¤³¤È¡ª | 25 | // ¹¹¤Ë¥¹¥Ô¡¼¥É¡¦¥¢¥Ã¥×¤¹¤ë¤Ë¤Ï£Ã£Ï£Ó¤ò¸ÇÄê¤Ç»ý¤Ä¤³¤È¡ª |
26 | // | 26 | // |
27 | // Copyright (C) Satoshi 1994-2002 All rights reserved. | 27 | // Copyright (C) Satoshi 1994-2002 All rights reserved. |
28 | // *********************************************************************** | 28 | // *********************************************************************** |
29 | 29 | ||
30 | #include <math.h> | 30 | #include <math.h> |
31 | 31 | ||
32 | #define FFT_TEST_COUNT 500 // Bench FFT | 32 | #define FFT_TEST_COUNT 332 // Bench FFT |
33 | 33 | ||
34 | // ----------------------------------------------------- FFT | 34 | // ----------------------------------------------------- FFT |
35 | #define OBJ_DATA_COUNT 128 | 35 | #define OBJ_DATA_COUNT 128 |
36 | #define OBJ_DATA_SISU 7 // 128 = 2 ** 7 | 36 | #define OBJ_DATA_SISU 7 // 128 = 2 ** 7 |
37 | #define OBJ_DATA_SLIDE 1 | 37 | #define OBJ_DATA_SLIDE 1 |
38 | 38 | ||
39 | #define FFT_TRN 1 | 39 | #define FFT_TRN 1 |
40 | #define IFFT_TRN -1 | 40 | #define IFFT_TRN -1 |
41 | 41 | ||
42 | typedef struct _fft { | 42 | typedef struct _fft { |
43 | int N; // ¥Ç¥¸¥¿¥ë¡¦¥Ç¡¼¥¿·ï¿ô | 43 | int N; // ¥Ç¥¸¥¿¥ë¡¦¥Ç¡¼¥¿·ï¿ô |
44 | int r; // N = 2^r | 44 | int r; // N = 2^r |
45 | double* result_A; // ¥µ¥ó¥×¥ê¥ó¥°¥Ç¡¼¥¿¤ò¤³¤³¤Ë¥»¥Ã¥È¤¹¤ë | 45 | double* result_A; // ¥µ¥ó¥×¥ê¥ó¥°¥Ç¡¼¥¿¤ò¤³¤³¤Ë¥»¥Ã¥È¤¹¤ë |
46 | // cos À®Ê¬¡Äµá¤á¤ë¥¹¥Ú¥¯¥È¥ëÀ®Ê¬¤Î¿ôʬ¤ÎÎΰ褬ɬÍ× | 46 | // cos À®Ê¬¡Äµá¤á¤ë¥¹¥Ú¥¯¥È¥ëÀ®Ê¬¤Î¿ôʬ¤ÎÎΰ褬ɬÍ× |
47 | double* result_B; // sin À®Ê¬¡Äµá¤á¤ë¥¹¥Ú¥¯¥È¥ëÀ®Ê¬¤Î¿ôʬ¤ÎÎΰ褬ɬÍ× | 47 | double* result_B; // sin À®Ê¬¡Äµá¤á¤ë¥¹¥Ú¥¯¥È¥ëÀ®Ê¬¤Î¿ôʬ¤ÎÎΰ褬ɬÍ× |
48 | } FFT; | 48 | } FFT; |
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp index 4275dd6..7fb12a3 100644 --- a/noncore/styles/theme/othemebase.cpp +++ b/noncore/styles/theme/othemebase.cpp | |||
@@ -991,33 +991,33 @@ void OThemeBase::readResourceGroup( int i, QString *copyfrom, QString *pixnames, | |||
991 | 991 | ||
992 | int tmpVal; | 992 | int tmpVal; |
993 | QString tmpStr; | 993 | QString tmpStr; |
994 | 994 | ||
995 | tmpStr = copyfrom [ i ]; | 995 | tmpStr = copyfrom [ i ]; |
996 | if ( !tmpStr.isEmpty() ) { // Duplicate another widget's config | 996 | if ( !tmpStr.isEmpty() ) { // Duplicate another widget's config |
997 | int sIndex; | 997 | int sIndex; |
998 | loadArray[ i ] = true; | 998 | loadArray[ i ] = true; |
999 | for ( sIndex = 0; sIndex < WIDGETS; ++sIndex ) { | 999 | for ( sIndex = 0; sIndex < WIDGETS; ++sIndex ) { |
1000 | if ( tmpStr == widgetEntries[ sIndex ] ) { | 1000 | if ( tmpStr == widgetEntries[ sIndex ] ) { |
1001 | if ( !loadArray[ sIndex ] ) // hasn't been loaded yet | 1001 | if ( !loadArray[ sIndex ] ) // hasn't been loaded yet |
1002 | readResourceGroup( sIndex, copyfrom, pixnames, brdnames, | 1002 | readResourceGroup( sIndex, copyfrom, pixnames, brdnames, |
1003 | loadArray ); | 1003 | loadArray ); |
1004 | break; | 1004 | break; |
1005 | } | 1005 | } |
1006 | } | 1006 | } |
1007 | if ( loadArray[ sIndex ] ) { | 1007 | if ( sIndex < 54 && loadArray[ sIndex ] ) { |
1008 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); | 1008 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); |
1009 | } | 1009 | } |
1010 | else | 1010 | else |
1011 | odebug << "OThemeBase: Unable to identify source widget for " << widgetEntries[ i ] << oendl; | 1011 | odebug << "OThemeBase: Unable to identify source widget for " << widgetEntries[ i ] << oendl; |
1012 | return ; | 1012 | return ; |
1013 | } | 1013 | } |
1014 | // special inheritance for disabled arrows (these are tri-state unlike | 1014 | // special inheritance for disabled arrows (these are tri-state unlike |
1015 | // the rest of what we handle). | 1015 | // the rest of what we handle). |
1016 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { | 1016 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { |
1017 | if ( tmpVal == i ) { | 1017 | if ( tmpVal == i ) { |
1018 | tmpStr = pixnames [ i ]; | 1018 | tmpStr = pixnames [ i ]; |
1019 | if ( tmpStr.isEmpty() ) { | 1019 | if ( tmpStr.isEmpty() ) { |
1020 | copyWidgetConfig( ArrowUp + ( tmpVal - DisArrowUp ), i, pixnames, | 1020 | copyWidgetConfig( ArrowUp + ( tmpVal - DisArrowUp ), i, pixnames, |
1021 | brdnames ); | 1021 | brdnames ); |
1022 | return ; | 1022 | return ; |
1023 | } | 1023 | } |