Changeset 26 for trunk/Classes/achievements.mm
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/achievements.mm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/achievements.mm
r23 r26 14 14 #include "achievements.h" 15 15 16 #i nclude "OpenFeint.h"16 #ifndef DISABLE_OPENFEINT 17 17 18 #include "OFAchievementService.h" 19 #include "OFAchievement.h" 18 #include "OpenFeint.h" 19 20 #include "OFAchievementService.h" 21 #include "OFAchievement.h" 22 23 #import "SampleOFDelegate.h" 24 25 SampleOFDelegate *ofDelegate; 26 27 #endif 20 28 21 29 #include "game_preferences.hpp" … … 24 32 #include "game_display.hpp" 25 33 #include "stdio.h" 34 35 #import "Appirater.h" 36 37 38 39 26 40 27 41 std::string names[] = { "Bloodied", "Slayer", "Battle Master", "Bone Crusher", "Predator", "Penny Pincher", "Money Hoarder", "Veteran Unit", … … 40 54 bool gInitialized = false; 41 55 56 extern "C" unsigned char gFlippedGL; 57 58 59 42 60 void of_init(void) 43 61 { … … 45 63 return; 46 64 65 #ifndef DISABLE_OPENFEINT 66 67 UIInterfaceOrientation orient; 68 if (!gFlippedGL) 69 orient = UIInterfaceOrientationLandscapeRight; 70 else 71 orient = UIInterfaceOrientationLandscapeLeft; 72 73 74 47 75 NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys: 48 [NSNumber numberWithInt: UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,76 [NSNumber numberWithInt:orient], OpenFeintSettingDashboardOrientation, 49 77 @"Wesnoth", OpenFeintSettingShortDisplayName, 50 78 [NSNumber numberWithBool:YES], OpenFeintSettingEnablePushNotifications, 51 79 [NSNumber numberWithBool:NO], OpenFeintSettingDisableUserGeneratedContent, 52 80 [NSNumber numberWithBool:YES], OpenFeintSettingPromptToPostAchievementUnlock, 81 // [UIApplication sharedApplication].keyWindow, OpenFeintSettingPresentationWindow, 53 82 nil 54 83 ]; 55 84 56 [OpenFeint initializeWithProductKey:@"WDYPKxGL2aP5ujZFrnKmQ" andSecret:@"WoRs8Pt7ch9r0Re1UI7Zx5d62gezqfHDLPy4t5suQE" andDisplayName:@"Wesnoth" andSettings:settings andDelegates:nil]; 57 gInitialized = true; 85 ofDelegate = [SampleOFDelegate new]; 86 87 OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:ofDelegate 88 andChallengeDelegate:nil 89 andNotificationDelegate:nil]; 90 91 [OpenFeint initializeWithProductKey:@"WDYPKxGL2aP5ujZFrnKmQ" 92 andSecret:@"WoRs8Pt7ch9r0Re1UI7Zx5d62gezqfHDLPy4t5suQE" 93 andDisplayName:@"Wesnoth" 94 andSettings:settings 95 andDelegates:delegates]; 96 97 #endif 98 99 gInitialized = true; 100 101 102 // now also set up AppiRater 103 [Appirater appLaunched]; 104 58 105 } 59 106 60 107 void of_dashboard(void) 61 108 { 62 [OpenFeint launchDashboard]; 109 #ifndef DISABLE_OPENFEINT 110 { 111 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 112 [OpenFeint launchDashboard]; 113 [pool release]; 114 } 115 #endif 63 116 } 64 117 … … 70 123 void earn_achievement(int achievement, bool show_dlg) 71 124 { 125 #ifndef DISABLE_OPENFEINT 126 72 127 if (preferences::achievement_earned(achievement)) 73 128 return; … … 95 150 // do OpenFeint stuff 96 151 [OFAchievementService unlockAchievement:ids[achievement]]; 152 #endif 97 153 }
Note: See TracChangeset
for help on using the changeset viewer.