equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Hedgewars Xfire integration |
2 * Hedgewars Xfire integration |
3 * Copyright (c) 2010 Mario Liebisch <mario.liebisch AT googlemail.com> |
3 * Copyright (c) 2010 Andrey Korotaev <unC0Rr@gmail.com> |
4 * |
4 * |
5 * This program is free software; you can redistribute it and/or modify |
5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation; version 2 of the License |
7 * the Free Software Foundation; version 2 of the License |
8 * |
8 * |
32 void xfire_init(void) |
32 void xfire_init(void) |
33 { |
33 { |
34 if(use_xfire) |
34 if(use_xfire) |
35 return; |
35 return; |
36 use_xfire = XfireIsLoaded() == 1; |
36 use_xfire = XfireIsLoaded() == 1; |
37 |
37 |
38 if(!use_xfire) |
38 if(!use_xfire) |
39 return; |
39 return; |
40 |
40 |
41 for(int i = 0; i < XFIRE_KEY_COUNT; i++) |
41 for(int i = 0; i < XFIRE_KEY_COUNT; i++) |
42 { |
42 { |
43 keys[i] = new char[256]; |
43 keys[i] = new char[256]; |
44 values[i] = new char[256]; |
44 values[i] = new char[256]; |
45 strcpy(keys[i], ""); |
45 strcpy(keys[i], ""); |
46 strcpy(values[i], ""); |
46 strcpy(values[i], ""); |
47 } |
47 } |
48 |
48 |
49 strcpy(keys[XFIRE_NICKNAME], "Nickname"); |
49 strcpy(keys[XFIRE_NICKNAME], "Nickname"); |
50 strcpy(keys[XFIRE_ROOM], "Room"); |
50 strcpy(keys[XFIRE_ROOM], "Room"); |
51 strcpy(keys[XFIRE_SERVER], "Server"); |
51 strcpy(keys[XFIRE_SERVER], "Server"); |
52 strcpy(keys[XFIRE_STATUS], "Status"); |
52 strcpy(keys[XFIRE_STATUS], "Status"); |
53 xfire_update(); |
53 xfire_update(); |
56 // xfire_free(): used to free up ressources used etc. |
56 // xfire_free(): used to free up ressources used etc. |
57 void xfire_free(void) |
57 void xfire_free(void) |
58 { |
58 { |
59 if(!use_xfire) |
59 if(!use_xfire) |
60 return; |
60 return; |
61 |
61 |
62 for(int i = 0; i < XFIRE_KEY_COUNT; i++) |
62 for(int i = 0; i < XFIRE_KEY_COUNT; i++) |
63 { |
63 { |
64 delete [] keys[i]; |
64 delete [] keys[i]; |
65 delete [] values[i]; |
65 delete [] values[i]; |
66 } |
66 } |