Permalink
Browse files

initial commit with 8 example pages

  • Loading branch information...
0 parents commit 2c4c3302f1a0eca89f75074e19bc02ca32691ec6 @internaut internaut committed Jun 13, 2012
Showing with 22,329 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +1 −0 _Scripts/export_layers_png24.jsx
  3. +2,546 −0 iDiary_Review/iDiary2.xcodeproj/project.pbxproj
  4. +7 −0 iDiary_Review/iDiary2.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. +85 −0 iDiary_Review/iDiary2.xcodeproj/xcshareddata/xcschemes/Alice-Debug.xcscheme
  6. +86 −0 iDiary_Review/iDiary2.xcodeproj/xcshareddata/xcschemes/Alice-Release.xcscheme
  7. +60 −0 iDiary_Review/iDiary2/Audio/SoundHandler.h
  8. +177 −0 iDiary_Review/iDiary2/Audio/SoundHandler.mm
  9. +44 −0 iDiary_Review/iDiary2/Audio/SoundObject.h
  10. +131 −0 iDiary_Review/iDiary2/Audio/SoundObject.mm
  11. +20 −0 iDiary_Review/iDiary2/Ctrl/AppDelegate.h
  12. +195 −0 iDiary_Review/iDiary2/Ctrl/AppDelegate.mm
  13. +36 −0 iDiary_Review/iDiary2/Ctrl/BookControl.h
  14. +135 −0 iDiary_Review/iDiary2/Ctrl/BookControl.mm
  15. +142 −0 iDiary_Review/iDiary2/Ctrl/CoreHolder.h
  16. +484 −0 iDiary_Review/iDiary2/Ctrl/CoreHolder.mm
  17. +43 −0 iDiary_Review/iDiary2/Ctrl/DiaryDefinitions/Diaries_Alice.h
  18. +63 −0 iDiary_Review/iDiary2/Ctrl/Physics/Box2DWorldHolder.h
  19. +319 −0 iDiary_Review/iDiary2/Ctrl/Physics/Box2DWorldHolder.mm
  20. +35 −0 iDiary_Review/iDiary2/Ctrl/Physics/MyContactListener.h
  21. +38 −0 iDiary_Review/iDiary2/Ctrl/Physics/MyContactListener.mm
  22. +20 −0 iDiary_Review/iDiary2/Ctrl/Physics/VPoint.h
  23. +49 −0 iDiary_Review/iDiary2/Ctrl/Physics/VPoint.m
  24. +95 −0 iDiary_Review/iDiary2/Ctrl/Physics/VRope.h
  25. +183 −0 iDiary_Review/iDiary2/Ctrl/Physics/VRope.mm
  26. +19 −0 iDiary_Review/iDiary2/Ctrl/Physics/VStick.h
  27. +38 −0 iDiary_Review/iDiary2/Ctrl/Physics/VStick.m
  28. +16 −0 iDiary_Review/iDiary2/Ctrl/RootViewController.h
  29. +155 −0 iDiary_Review/iDiary2/Ctrl/RootViewController.mm
  30. +64 −0 iDiary_Review/iDiary2/Model/MediaDefinition.h
  31. +186 −0 iDiary_Review/iDiary2/Model/MediaDefinition.m
  32. +35 −0 iDiary_Review/iDiary2/Model/PageElementPersistency.h
  33. +50 −0 iDiary_Review/iDiary2/Model/PageElementPersistency.m
  34. +29 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example2.h
  35. +251 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example2.mm
  36. +17 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example3.h
  37. +95 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example3.mm
  38. +17 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example4.h
  39. +60 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example4.mm
  40. +18 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example5.h
  41. +97 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example5.mm
  42. +27 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example6.h
  43. +163 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example6.mm
  44. +18 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example7.h
  45. +104 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example7.mm
  46. +13 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example8.h
  47. +51 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Example8.mm
  48. +17 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Intro.h
  49. +44 −0 iDiary_Review/iDiary2/Pages/Alice/Page_Alice_Intro.mm
  50. +15 −0 iDiary_Review/iDiary2/Prefix.pch
  51. BIN iDiary_Review/iDiary2/Resources/Default.png
  52. BIN iDiary_Review/iDiary2/Resources/Icon.png
  53. +63 −0 iDiary_Review/iDiary2/Resources/Info-Alice.plist
  54. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice/alice_buch_hintergrund.png
  55. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice/alice_seiten_hintergrund.png
  56. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice/startscreen_bg_Alice.png
  57. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice/startscreen_diary_Alice.png
  58. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice/startscreen_diary_glow_Alice.png
  59. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__etikett1.png
  60. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__etikett1_rueck.png
  61. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__etikett1_strick.png
  62. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__orden.png
  63. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__schrift_best_3.png
  64. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__silhouette.png
  65. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example2/alice_example2__textur.png
  66. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__foto1.jpg
  67. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__foto2.jpg
  68. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__foto3.jpg
  69. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__foto4.jpg
  70. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__foto5.jpg
  71. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__umschlag-u_8.png
  72. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example3/alice_example3__umschlag_o_b.png
  73. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__agypten_flaeche.png
  74. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__agypten_hintergrund.png
  75. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__agypten_outline.png
  76. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__agypten_zettel.png
  77. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__australien_flaeche.png
  78. BIN ...y_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__australien_hintergrund.png
  79. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__australien_outline.png
  80. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__australien_zettel.png
  81. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__brasilien_flaeche.png
  82. BIN ...ry_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__brasilien_hintergrund.png
  83. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__brasilien_outline.png
  84. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__brasilien_zettel.png
  85. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__deutschland_fertig.png
  86. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__israel_flaeche.png
  87. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__israel_hintergrund.png
  88. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__israel_outline.png
  89. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__israel_zettel.png
  90. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__japan_flaeche.png
  91. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__japan_hintergrund.png
  92. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__japan_outline.png
  93. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__japan_zettel.png
  94. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__norwegen_flaeche.png
  95. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__norwegen_hintergrund.png
  96. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__norwegen_outline.png
  97. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__norwegen_zettel.png
  98. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__usa_flaeche.png
  99. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__usa_hintergrund.png
  100. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__usa_outline.png
  101. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example4/alice_example4__usa_zettel.png
  102. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__button_li.png
  103. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__button_re.png
  104. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__gewitter.png
  105. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__player.png
  106. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__playertail.png
  107. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__wolke1.png
  108. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__wolke2.png
  109. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example5/alice_example5__wolke3.png
  110. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__baum.png
  111. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__bogen.png
  112. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__koecher_pfei_1.png
  113. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__koecher_pfei_5.png
  114. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__koerper.png
  115. +282 −0 iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__koerper_0.plist
  116. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__koerper_0.pvr.ccz
  117. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__pfeil.png
  118. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__treffer.png
  119. +139 −0 iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__vogel_0.plist
  120. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__vogel_0.pvr.ccz
  121. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example6/alice_example6__ziel.png
  122. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__Text_Perfekt.png
  123. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__Text_Probiers.png
  124. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__grafik_zettel.png
  125. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__noten.png
  126. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__text_aufpas_3.png
  127. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__text_du_bis_e.png
  128. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/alice_example7__text_titel.png
  129. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black1.png
  130. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black2.png
  131. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black3.png
  132. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black4.png
  133. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black5.png
  134. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black6.png
  135. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_black__taste_black7.png
  136. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white1.png
  137. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white10.png
  138. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white2.png
  139. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white3.png
  140. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white4.png
  141. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white5.png
  142. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white6.png
  143. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white7.png
  144. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white8.png
  145. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example7/tasten_white__taste_white9.png
  146. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_Example8/alice_example8__blatt1.png
  147. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_intro/alice_example1.png
  148. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_intro/alice_example2.png
  149. BIN iDiary_Review/iDiary2/Resources/PageContents/Alice_intro/alice_example_video.mov
  150. BIN iDiary_Review/iDiary2/Resources/PageContents/applause1.mp3
  151. BIN iDiary_Review/iDiary2/Resources/PageContents/applause2.mp3
  152. BIN iDiary_Review/iDiary2/Resources/PageContents/arrow_fly.mp3
  153. BIN iDiary_Review/iDiary2/Resources/PageContents/arrow_hit.mp3
  154. BIN iDiary_Review/iDiary2/Resources/PageContents/aua.mp3
  155. BIN iDiary_Review/iDiary2/Resources/PageContents/ball1.mp3
  156. BIN iDiary_Review/iDiary2/Resources/PageContents/ball2.mp3
  157. BIN iDiary_Review/iDiary2/Resources/PageContents/ball3.mp3
  158. BIN iDiary_Review/iDiary2/Resources/PageContents/birds1.mp3
  159. BIN iDiary_Review/iDiary2/Resources/PageContents/blingbling.mp3
  160. BIN iDiary_Review/iDiary2/Resources/PageContents/blopp1.mp3
  161. BIN iDiary_Review/iDiary2/Resources/PageContents/car_move.mp3
  162. BIN iDiary_Review/iDiary2/Resources/PageContents/car_start.mp3
  163. BIN iDiary_Review/iDiary2/Resources/PageContents/car_tire_squeek.mp3
  164. BIN iDiary_Review/iDiary2/Resources/PageContents/chime.mp3
  165. BIN iDiary_Review/iDiary2/Resources/PageContents/crisp_eat.mp3
  166. BIN iDiary_Review/iDiary2/Resources/PageContents/desk_background.png
  167. BIN iDiary_Review/iDiary2/Resources/PageContents/dia-klick.mp3
  168. BIN iDiary_Review/iDiary2/Resources/PageContents/epic_fail.mp3
  169. BIN iDiary_Review/iDiary2/Resources/PageContents/fear.mp3
  170. BIN iDiary_Review/iDiary2/Resources/PageContents/female_giggle1.mp3
  171. BIN iDiary_Review/iDiary2/Resources/PageContents/hey.mp3
  172. BIN iDiary_Review/iDiary2/Resources/PageContents/hymn_germany.mp3
  173. BIN iDiary_Review/iDiary2/Resources/PageContents/hymn_usbekistan.mp3
  174. BIN iDiary_Review/iDiary2/Resources/PageContents/oops1.mp3
  175. BIN iDiary_Review/iDiary2/Resources/PageContents/piano_c.mp3
  176. BIN iDiary_Review/iDiary2/Resources/PageContents/pig1.mp3
  177. BIN iDiary_Review/iDiary2/Resources/PageContents/play_button_bg.png
  178. BIN iDiary_Review/iDiary2/Resources/PageContents/pouring.mp3
  179. BIN iDiary_Review/iDiary2/Resources/PageContents/punch.mp3
  180. BIN iDiary_Review/iDiary2/Resources/PageContents/rimshot1.mp3
  181. BIN iDiary_Review/iDiary2/Resources/PageContents/ringring.mp3
  182. BIN iDiary_Review/iDiary2/Resources/PageContents/rope.png
  183. BIN iDiary_Review/iDiary2/Resources/PageContents/rumble1.mp3
  184. BIN iDiary_Review/iDiary2/Resources/PageContents/scratch1.mp3
  185. BIN iDiary_Review/iDiary2/Resources/PageContents/scratch2.mp3
  186. BIN iDiary_Review/iDiary2/Resources/PageContents/scratch3.mp3
  187. BIN iDiary_Review/iDiary2/Resources/PageContents/scribble.mp3
  188. BIN iDiary_Review/iDiary2/Resources/PageContents/scribble_1.5sec.mp3
  189. BIN iDiary_Review/iDiary2/Resources/PageContents/slimy1.mp3
  190. BIN iDiary_Review/iDiary2/Resources/PageContents/squeak1.mp3
  191. BIN iDiary_Review/iDiary2/Resources/PageContents/squeak2.mp3
  192. BIN iDiary_Review/iDiary2/Resources/PageContents/success1.mp3
  193. BIN iDiary_Review/iDiary2/Resources/PageContents/success2.mp3
  194. BIN iDiary_Review/iDiary2/Resources/PageContents/swosh1.mp3
  195. BIN iDiary_Review/iDiary2/Resources/PageContents/thunder1.mp3
  196. BIN iDiary_Review/iDiary2/Resources/PageContents/wiener_walzer.mp3
  197. BIN iDiary_Review/iDiary2/Resources/PageContents/wind1.mp3
  198. BIN iDiary_Review/iDiary2/Resources/PageContents/wingflap1.mp3
  199. BIN iDiary_Review/iDiary2/Resources/PageContents/wood_in_bowl_drop1.mp3
  200. BIN iDiary_Review/iDiary2/Resources/PageContents/zonk.mp3
  201. BIN iDiary_Review/iDiary2/Resources/backButton.png
  202. BIN iDiary_Review/iDiary2/Resources/blocks.png
  203. BIN iDiary_Review/iDiary2/Resources/closeButton.png
  204. BIN iDiary_Review/iDiary2/Resources/common_play_button.png
  205. BIN iDiary_Review/iDiary2/Resources/disclaimer_bg.png
  206. BIN iDiary_Review/iDiary2/Resources/disclaimer_btn.png
  207. BIN iDiary_Review/iDiary2/Resources/fps_images.png
  208. BIN iDiary_Review/iDiary2/Resources/iTunesArtwork
  209. +110 −0 iDiary_Review/iDiary2/Util/Config.h
  210. +25 −0 iDiary_Review/iDiary2/Util/Constants.h
  211. +25 −0 iDiary_Review/iDiary2/Util/DotToDotLineSegment.h
  212. +48 −0 iDiary_Review/iDiary2/Util/DotToDotLineSegment.m
  213. +32 −0 iDiary_Review/iDiary2/Util/Makros.h
  214. +17 −0 iDiary_Review/iDiary2/Util/Singleton.h
  215. +74 −0 iDiary_Review/iDiary2/Util/Tools.h
  216. +222 −0 iDiary_Review/iDiary2/Util/Tools.m
  217. +266 −0 iDiary_Review/iDiary2/Util/types.h
  218. +33 −0 iDiary_Review/iDiary2/View/Actions/CommonActions.h
  219. +68 −0 iDiary_Review/iDiary2/View/Actions/CommonActions.mm
  220. +35 −0 iDiary_Review/iDiary2/View/Actions/Node3DRotateActions.h
  221. +120 −0 iDiary_Review/iDiary2/View/Actions/Node3DRotateActions.mm
  222. +27 −0 iDiary_Review/iDiary2/View/Actions/ShakeAction.h
  223. +63 −0 iDiary_Review/iDiary2/View/Actions/ShakeAction.mm
  224. +74 −0 iDiary_Review/iDiary2/View/ContentElement.h
  225. +592 −0 iDiary_Review/iDiary2/View/ContentElement.mm
  226. +71 −0 iDiary_Review/iDiary2/View/GLES-Render.h
  227. +190 −0 iDiary_Review/iDiary2/View/GLES-Render.mm
  228. +200 −0 iDiary_Review/iDiary2/View/Layers/ArrangeGameLayer.h
  229. +700 −0 iDiary_Review/iDiary2/View/Layers/ArrangeGameLayer.mm
  230. +84 −0 iDiary_Review/iDiary2/View/Layers/ArrowGameLayer.h
  231. +536 −0 iDiary_Review/iDiary2/View/Layers/ArrowGameLayer.mm
  232. +55 −0 iDiary_Review/iDiary2/View/Layers/BoxingLayer.h
  233. +241 −0 iDiary_Review/iDiary2/View/Layers/BoxingLayer.mm
  234. +36 −0 iDiary_Review/iDiary2/View/Layers/CountryQuiz.h
  235. +149 −0 iDiary_Review/iDiary2/View/Layers/CountryQuiz.mm
  236. +23 −0 iDiary_Review/iDiary2/View/Layers/HandLayer.h
  237. +105 −0 iDiary_Review/iDiary2/View/Layers/HandLayer.mm
  238. +43 −0 iDiary_Review/iDiary2/View/Layers/MagicLayer.h
  239. +148 −0 iDiary_Review/iDiary2/View/Layers/MagicLayer.mm
  240. +69 −0 iDiary_Review/iDiary2/View/Layers/ManikinLayer.h
  241. +271 −0 iDiary_Review/iDiary2/View/Layers/ManikinLayer.mm
  242. +117 −0 iDiary_Review/iDiary2/View/Layers/MemoryGameLayer.h
  243. +518 −0 iDiary_Review/iDiary2/View/Layers/MemoryGameLayer.mm
  244. +29 −0 iDiary_Review/iDiary2/View/Layers/ModalOverlay.h
  245. +99 −0 iDiary_Review/iDiary2/View/Layers/ModalOverlay.mm
  246. +34 −0 iDiary_Review/iDiary2/View/Layers/OverviewLayer.h
  247. +179 −0 iDiary_Review/iDiary2/View/Layers/OverviewLayer.mm
  248. +155 −0 iDiary_Review/iDiary2/View/Layers/PageLayer.h
  249. +639 −0 iDiary_Review/iDiary2/View/Layers/PageLayer.mm
  250. +65 −0 iDiary_Review/iDiary2/View/Layers/PageMainLayer.h
  251. +441 −0 iDiary_Review/iDiary2/View/Layers/PageMainLayer.mm
  252. +149 −0 iDiary_Review/iDiary2/View/Layers/PanningLayer.h
  253. +720 −0 iDiary_Review/iDiary2/View/Layers/PanningLayer.mm
  254. +49 −0 iDiary_Review/iDiary2/View/Layers/PanningLayerDelegate.h
  255. +70 −0 iDiary_Review/iDiary2/View/Layers/PhotoHeapLayer.h
  256. +222 −0 iDiary_Review/iDiary2/View/Layers/PhotoHeapLayer.mm
  257. +61 −0 iDiary_Review/iDiary2/View/Layers/PhotoQuizLayer.h
  258. +280 −0 iDiary_Review/iDiary2/View/Layers/PhotoQuizLayer.mm
  259. +118 −0 iDiary_Review/iDiary2/View/Layers/PianoLayer.h
  260. +425 −0 iDiary_Review/iDiary2/View/Layers/PianoLayer.mm
  261. +44 −0 iDiary_Review/iDiary2/View/Layers/ProgressLayer.h
  262. +119 −0 iDiary_Review/iDiary2/View/Layers/ProgressLayer.mm
  263. +90 −0 iDiary_Review/iDiary2/View/Layers/ScrollingRaceGame.h
  264. +447 −0 iDiary_Review/iDiary2/View/Layers/ScrollingRaceGame.mm
  265. +106 −0 iDiary_Review/iDiary2/View/Layers/SoccerGameLayer.h
  266. +497 −0 iDiary_Review/iDiary2/View/Layers/SoccerGameLayer.mm
  267. +32 −0 iDiary_Review/iDiary2/View/Layers/StartscreenLayer.h
  268. +130 −0 iDiary_Review/iDiary2/View/Layers/StartscreenLayer.mm
  269. +30 −0 iDiary_Review/iDiary2/View/Layers/TextureLayer.h
  270. +115 −0 iDiary_Review/iDiary2/View/Layers/TextureLayer.mm
  271. +27 −0 iDiary_Review/iDiary2/View/Layers/VideoLayer.h
  272. +81 −0 iDiary_Review/iDiary2/View/Layers/VideoLayer.mm
  273. +18 −0 iDiary_Review/iDiary2/View/Node3D.h
  274. +66 −0 iDiary_Review/iDiary2/View/Node3D.mm
  275. +24 −0 iDiary_Review/iDiary2/View/Sprites/PhotoSprite.h
  276. +48 −0 iDiary_Review/iDiary2/View/Sprites/PhotoSprite.mm
  277. +42 −0 iDiary_Review/iDiary2/View/Sprites/PhySprite.h
  278. +164 −0 iDiary_Review/iDiary2/View/Sprites/PhySprite.mm
  279. +35 −0 iDiary_Review/iDiary2/View/Sprites/PunchingBag.h
  280. +101 −0 iDiary_Review/iDiary2/View/Sprites/PunchingBag.mm
  281. +69 −0 iDiary_Review/iDiary2/libs/Box2D/Box2D.h
  282. +100 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2CircleShape.cpp
  283. +91 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2CircleShape.h
  284. +139 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2EdgeShape.cpp
  285. +70 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2EdgeShape.h
  286. +130 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2LoopShape.cpp
  287. +96 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2LoopShape.h
  288. +361 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2PolygonShape.cpp
  289. +95 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2PolygonShape.h
  290. +103 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/Shapes/b2Shape.h
  291. +122 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2BroadPhase.cpp
  292. +248 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2BroadPhase.h
  293. +154 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2CollideCircle.cpp
  294. +673 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2CollideEdge.cpp
  295. +317 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2CollidePolygon.cpp
  296. +249 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2Collision.cpp
  297. +276 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2Collision.h
  298. +603 −0 iDiary_Review/iDiary2/libs/Box2D/Collision/b2Distance.cpp
Sorry, we could not display the entire diff because too many files (586) changed.
18 .gitignore
@@ -0,0 +1,18 @@
+# video / audio data
+_Anim/
+_Archive/
+_Audio/*
+_Videos/*
+
+# xcode noise
+build/*
+*xcuserdata/*
+*.pbxuser
+*.mode1v3
+iDiary_Review/iDiary2.xcodeproj/project.xcworkspace/xcuserdata/
+iDiary_Review/iDiary2.xcodeproj/xcuserdata/
+
+# osx noise
+.DS_Store
+profile
+
1 _Scripts/export_layers_png24.jsx
@@ -0,0 +1 @@
+// Extended: export only visible layers to png-24, create index file
2,546 iDiary_Review/iDiary2.xcodeproj/project.pbxproj
2,546 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
7 iDiary_Review/iDiary2.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:iDiary2.xcodeproj">
+ </FileRef>
+</Workspace>
85 iDiary_Review/iDiary2.xcodeproj/xcshareddata/xcschemes/Alice-Debug.xcscheme
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
86 iDiary_Review/iDiary2.xcodeproj/xcshareddata/xcschemes/Alice-Release.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = ""
+ selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ enablesOpenGLESFrameCapture = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "28A046E7157F99870020CD16"
+ BuildableName = "Alice Diary.app"
+ BlueprintName = "Alice"
+ ReferencedContainer = "container:iDiary2.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
60 iDiary_Review/iDiary2/Audio/SoundHandler.h
@@ -0,0 +1,60 @@
+//
+// SoundHandler.h
+// iDiary2
+//
+// Created by Markus Konrad on 07.06.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "CDAudioManager.h"
+#import "Singleton.h"
+
+#import "SoundObject.h"
+
+static int soundIdCounter = 0;
+
+@protocol SoundHandlerDelegate <NSObject>
+-(void)readyToPlaySounds:(NSArray *)soundObjects;
+@end
+
+@interface SoundHandler : NSObject<Singleton> {
+ id<SoundHandlerDelegate> delegate; // SoundHandlerDelegate
+ NSMutableDictionary *soundObjects; // NSMutableDictionary with LOADED SoundObjects: NSNumber soundId -> SoundObject mapping
+ NSMutableArray *registeredSoundObjects; // NSMutableArray with registered but NOT loaded SoundObjects
+
+ CDSoundEngine *audio; // Shortcut to CDSoundEngine singleton
+}
+
+@property (nonatomic,assign) id<SoundHandlerDelegate> delegate;
+@property (nonatomic,readonly) NSMutableDictionary *soundObjects;
+
+// load an array with NSStrings that point to sound files
+// will return an array of sound ids in the order of the submitted sound files
+//-(NSArray *)loadSounds:(NSArray *)soundFiles looped:(BOOL)looped gain:(float)gain;
+
+// register a sound to be loaded afterwards. return the sound id
+-(int)registerSoundToLoad:(NSString *)pFile looped:(BOOL)looped gain:(float)gain;
+
+// load all registered sound objects and clear the registeredSoundObjects array
+-(void)loadRegisteredSounds;
+
+// will set the delegate to nil if oldDelegate == delegate
+-(void)unregisterDelegate:(id)oldDelegate;
+
+// unload a sound buffer
+-(void)unloadSound:(int)soundId;
+-(void)unloadSounds:(NSArray *)soundIds;
+
+// unload all sound buffers
+-(void)unloadAllSounds;
+
+// get a sound object from a sound id
+-(SoundObject *)getSound:(int)soundId;
+
+// get a sound object from a file
+-(SoundObject *)getSoundByFile:(NSString *)pFile;
+
+
+@end
177 iDiary_Review/iDiary2/Audio/SoundHandler.mm
@@ -0,0 +1,177 @@
+//
+// SoundHandler.mm
+// iDiary2
+//
+// Created by Markus Konrad on 07.06.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import "SoundHandler.h"
+
+static const float kBufferCheckInterval = 0.5f;
+
+@interface SoundHandler(PrivateMethods)
+-(void)checkBufferLoadingState:(id)paramObj;
+@end
+
+@implementation SoundHandler
+
+@synthesize delegate;
+@synthesize soundObjects;
+
+#pragma mark init/dealloc
+
+- (id)init {
+ self = [super init];
+
+ if (self) {
+ audio = [CDAudioManager sharedManager].soundEngine;
+
+ soundObjects = [[NSMutableDictionary alloc] init];
+ registeredSoundObjects = [[NSMutableArray alloc] init];
+ }
+
+ return self;
+}
+
+// dealloc unused, because this is a singleton!
+//- (void)dealloc {
+//
+// [super dealloc];
+//}
+
+#pragma mark public messages
+
+-(int)registerSoundToLoad:(NSString *)pFile looped:(BOOL)looped gain:(float)gain {
+ // load and configure sound object
+ int sId = soundIdCounter++;
+ SoundObject *sObj = [[SoundObject alloc] initWithSoundId:sId andFile:pFile];
+ [sObj setPlayLooped:looped];
+ [sObj setGain:gain];
+
+ // add it to the registered sound objects
+ [registeredSoundObjects addObject:sObj];
+
+ // cleanup
+ [sObj release];
+
+ return sId;
+}
+
+-(void)loadRegisteredSounds {
+ NSMutableArray *loadRequests = [[NSMutableArray alloc] initWithCapacity:[registeredSoundObjects count]];
+
+ // create the load request array and add the registered objects to the soundObjects array
+ for (SoundObject *sObj in registeredSoundObjects) {
+ NSLog(@"Loading registered sound#%d: %@", sObj.soundId, sObj.file);
+
+ // add a load request
+ [loadRequests addObject:[sObj createBufferLoadRequest]];
+
+ // add a sound object
+ [soundObjects setObject:sObj forKey:[NSNumber numberWithInt:sObj.soundId]];
+ }
+
+ // load the buffers in background
+ [audio loadBuffersAsynchronously:loadRequests];
+
+ // start checking for the loading state
+ [self checkBufferLoadingState:nil];
+
+ // cleanup
+ [loadRequests release];
+ [registeredSoundObjects removeAllObjects];
+}
+
+-(void)unloadSounds:(NSArray *)soundIds {
+ for (NSNumber *sId in soundIds) {
+ [self unloadSound:[sId intValue]];
+ }
+}
+
+-(void)unloadSound:(int)soundId {
+ [[self getSound:soundId] unloadBuffer];
+ [soundObjects removeObjectForKey:[NSNumber numberWithInt:soundId]];
+}
+
+-(void)unloadAllSounds {
+// for (SoundObject *sObj in [soundObjects allValues]) {
+// [sObj unloadBuffer];
+// }
+
+ [soundObjects removeAllObjects];
+}
+
+-(SoundObject *)getSound:(int)soundId {
+ return [soundObjects objectForKey:[NSNumber numberWithInt:soundId]];
+}
+
+-(SoundObject *)getSoundByFile:(NSString *)pFile {
+ for (SoundObject *sObj in [soundObjects allValues]) {
+ if ([sObj.file isEqualToString:pFile]) {
+ return sObj;
+ }
+ }
+
+ return nil;
+}
+
+-(void)unregisterDelegate:(id)oldDelegate {
+ if (oldDelegate == delegate) {
+ [NSObject cancelPreviousPerformRequestsWithTarget:self]; // stop checkBufferLoadingState: method
+ delegate = nil;
+ }
+}
+
+#pragma mark private messages
+
+-(void)checkBufferLoadingState:(id)paramObj {
+ float bufferState = audio.asynchLoadProgress;
+
+// NSLog(@"Audio buffer loading state is now %f", bufferState);
+
+ if (bufferState >= 1.0f) {
+ [delegate readyToPlaySounds:[soundObjects allKeys]];
+ } else {
+ // check again after some time
+ [self performSelector:@selector(checkBufferLoadingState:) withObject:nil afterDelay:kBufferCheckInterval];
+ }
+}
+
+#pragma mark singleton stuff
+
+static SoundHandler* sharedObject;
+
++ (SoundHandler*)shared {
+ if (sharedObject == nil) {
+ sharedObject = [[super allocWithZone:NULL] init];
+ }
+ return sharedObject;
+}
+
++ (id)allocWithZone:(NSZone *)zone {
+ return [[self shared] retain];
+}
+
+- (id)copyWithZone:(NSZone *)zone {
+ return self;
+}
+
+- (id)retain {
+ return self;
+}
+
+- (NSUInteger)retainCount {
+ return NSUIntegerMax; //denotes an object that cannot be released
+}
+
+- (void)release {
+ //do nothing
+}
+
+- (id)autorelease {
+ return self;
+}
+
+
+@end
44 iDiary_Review/iDiary2/Audio/SoundObject.h
@@ -0,0 +1,44 @@
+//
+// SoundObject.h
+// iDiary2
+//
+// Created by Markus Konrad on 07.06.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "CDAudioManager.h"
+
+@interface SoundObject : NSObject {
+ CDSoundEngine *audio; // Shortcut to CDSoundEngine singleton
+
+ int soundId;
+ NSString *file;
+ BOOL playLooped;
+ BOOL isPlaying;
+
+ float gain;
+ float pitch;
+}
+
+@property (nonatomic,assign) int soundId;
+@property (nonatomic,retain) NSString *file;
+@property (nonatomic,assign) BOOL playLooped;
+@property (nonatomic,readonly) BOOL isPlaying;
+@property (nonatomic,assign) float gain;
+@property (nonatomic,assign) float pitch;
+
+-(id)initWithSoundId:(int)pSoundId andFile:(NSString *)pFile;
+
+-(CDBufferLoadRequest *)createBufferLoadRequest;
+-(void)unloadBuffer;
+
+-(void)playWithCallback:(SEL)callback atObject:(id)object;
+-(void)play;
+-(void)playAtPitch:(float)pPitch;
+
+//-(void)pause;
+-(void)stop;
+
+@end
131 iDiary_Review/iDiary2/Audio/SoundObject.mm
@@ -0,0 +1,131 @@
+//
+// SoundObject.mm
+// iDiary2
+//
+// Created by Markus Konrad on 07.06.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import "SoundObject.h"
+
+@interface SoundObject(PrivateMethods)
+-(void)soundEnded;
+@end
+
+@implementation SoundObject
+
+@synthesize soundId;
+@synthesize file;
+@synthesize playLooped;
+@synthesize isPlaying;
+@synthesize gain;
+@synthesize pitch;
+
+#pragma mark init / dealloc
+
+- (id)init {
+ self = [super init];
+ if (self) {
+ audio = [CDAudioManager sharedManager].soundEngine;
+
+ // set default vars
+ playLooped = NO;
+ isPlaying = NO;
+ pitch = 1.0f;
+ gain = 1.0f;
+ }
+ return self;
+}
+
+-(id)initWithSoundId:(int)pSoundId andFile:(NSString *)pFile {
+ if ((self = [self init])) {
+ // set default vars
+ soundId = pSoundId;
+ file = [pFile retain];
+ }
+
+ return self;
+}
+
+- (void)dealloc {
+ [self unloadBuffer];
+
+ [file release];
+
+ [super dealloc];
+}
+
+#pragma mark public messages
+
+-(CDBufferLoadRequest *)createBufferLoadRequest {
+ NSAssert(file != nil, @"Sound file cannot be nil!");
+
+ return [[[CDBufferLoadRequest alloc] init:soundId filePath:file] autorelease];
+}
+
+-(void)unloadBuffer {
+ [self stop];
+
+// NSLog(@"Unloading sound#%d %@", soundId, file);
+ [audio unloadBuffer:soundId];
+}
+
+-(void)playWithCallback:(SEL)callback atObject:(id)object {
+ [object performSelector:callback withObject:nil afterDelay:[audio bufferDurationInSeconds:soundId]];
+
+ [self play];
+}
+
+-(void)play {
+ NSLog(@"Playing sound#%d %@", soundId, file);
+ [self playAtPitch:pitch];
+}
+
+-(void)playAtPitch:(float)pPitch; {
+// NSLog(@"Playing sound#%d %@", soundId, file);
+
+ isPlaying = YES;
+
+ [audio playSound:soundId
+ sourceGroupId:0
+ pitch:pPitch
+ pan:0.0f
+ gain:gain
+ loop:playLooped];
+
+ [self performSelector:@selector(soundEnded) withObject:nil afterDelay:[audio bufferDurationInSeconds:soundId]];
+}
+
+//-(void)pause {
+// [audio stopSound:soundId];
+//}
+
+-(void)stop {
+ [audio stopSound:soundId];
+
+ if (playLooped) {
+ NSLog(@"Warning: Looped sounds can not be stopped or paused or anything!");
+ } else {
+ isPlaying = NO;
+ }
+//
+// CDSoundSource *src = [audio soundSourceForSound:soundId sourceGroupId:0];
+//
+// [src setMute:YES];
+// [src setGain:0.0f];
+// [src setLooping:NO];
+// [src stop];
+//
+// NSLog(@"Stopping sound#%d %@: %p", soundId, file, src);
+//
+// [src pause];
+// [src rewind];
+}
+
+#pragma mark private messages
+
+-(void)soundEnded {
+ isPlaying = NO;
+}
+
+@end
20 iDiary_Review/iDiary2/Ctrl/AppDelegate.h
@@ -0,0 +1,20 @@
+//
+// AppDelegate.h
+// iDiary2
+//
+// Created by Markus Konrad on 27.04.11.
+// Copyright INKA Forschungsgruppe 2011. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RootViewController;
+
+@interface AppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ RootViewController *viewController;
+}
+
+@property (nonatomic, retain) UIWindow *window;
+
+@end
195 iDiary_Review/iDiary2/Ctrl/AppDelegate.mm
@@ -0,0 +1,195 @@
+//
+// AppDelegate.m
+// iDiary2
+//
+// Created by Markus Konrad on 27.04.11.
+// Copyright INKA Forschungsgruppe 2011. All rights reserved.
+//
+
+#import "cocos2d.h"
+
+#import "AppDelegate.h"
+#import "Config.h"
+#import "RootViewController.h"
+#import "CoreHolder.h"
+#import "Config.h"
+#import "Makros.h"
+
+#ifdef DIARY_LAUNCHER
+#import "LauncherLayer.h"
+#endif
+
+@implementation AppDelegate
+
+@synthesize window;
+
+- (void) removeStartupFlicker
+{
+ //
+ // THIS CODE REMOVES THE STARTUP FLICKER
+ //
+ // Uncomment the following code if you Application only supports landscape mode
+ //
+#if GAME_AUTOROTATION == kGameAutorotationUIViewController
+
+ // CC_ENABLE_DEFAULT_GL_STATES();
+ // CCDirector *director = [CCDirector sharedDirector];
+ // CGSize size = [director winSize];
+ // CCSprite *sprite = [CCSprite spriteWithFile:@"Default.png"];
+ // sprite.position = ccp(size.width/2, size.height/2);
+ // sprite.rotation = -90;
+ // [sprite visit];
+ // [[director openGLView] swapBuffers];
+ // CC_ENABLE_DEFAULT_GL_STATES();
+
+#endif // GAME_AUTOROTATION == kGameAutorotationUIViewController
+}
+
+- (void) applicationDidFinishLaunching:(UIApplication*)application
+{
+ // Init the window
+ window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+
+ // Try to use CADisplayLink director
+ // if it fails (SDK < 3.1) use the default director
+ if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] )
+ [CCDirector setDirectorType:kCCDirectorTypeDefault];
+
+
+ CCDirector *director = [CCDirector sharedDirector];
+
+ // Init the View Controller
+ viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
+ viewController.wantsFullScreenLayout = YES;
+
+ //
+ // Create the EAGLView manually
+ // 1. Create a RGB565 format. Alternative: RGBA8
+ // 2. depth format of 0 bit. Use 16 or 24 bit for 3d effects, like CCPageTurnTransition
+ //
+ //
+ EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
+ pixelFormat:kEAGLColorFormatRGBA8 // kEAGLColorFormatRGBA8
+ depthFormat:0 // GL_DEPTH_COMPONENT16_OES
+ preserveBackbuffer:NO
+ sharegroup:nil
+ multiSampling:(kOpenGLMultisampling > 0 && IS_IPAD_2)
+ numberOfSamples:kOpenGLMultisampling
+ ];
+
+ [glView setMultipleTouchEnabled:YES];
+
+ // attach the openglView to the director
+ [director setOpenGLView:glView];
+
+// // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
+// if( ! [director enableRetinaDisplay:YES] )
+// CCLOG(@"Retina Display Not supported");
+
+ //
+ // VERY IMPORTANT:
+ // If the rotation is going to be controlled by a UIViewController
+ // then the device orientation should be "Portrait".
+ //
+ // IMPORTANT:
+ // By default, this template only supports Landscape orientations.
+ // Edit the RootViewController.m file to edit the supported orientations.
+ //
+#if GAME_AUTOROTATION == kGameAutorotationUIViewController
+ [director setDeviceOrientation:kCCDeviceOrientationPortrait];
+#else
+ [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
+#endif
+
+ [director setAnimationInterval:1.0/60];
+
+#ifdef DEBUG
+ [director setDisplayFPS:YES];
+#endif
+
+
+ // make the OpenGLView a child of the view controller
+ [viewController setView:glView];
+
+ // make the View Controller a child of the main window
+ [window addSubview: viewController.view];
+
+ [window makeKeyAndVisible];
+
+ // Default texture format for PNG/BMP/TIFF/JPEG/GIF images
+ // It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
+ // You can change anytime.
+ [CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];
+
+
+ // Removes the startup flicker
+ [self removeStartupFlicker];
+
+ // startup
+ CoreHolder *core = [CoreHolder sharedCoreHolder];
+ [core firstStart];
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ [[CCDirector sharedDirector] pause];
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ [[CCDirector sharedDirector] resume];
+}
+
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ [[CCDirector sharedDirector] purgeCachedData];
+}
+
+-(void) applicationDidEnterBackground:(UIApplication*)application {
+#ifdef DIARY_LAUNCHER
+ LauncherLayer *launcher = (LauncherLayer *)[[CoreHolder sharedCoreHolder] currentMainLayer];
+ [launcher hide];
+#endif
+
+ [[CCDirector sharedDirector] stopAnimation];
+}
+
+-(void) applicationWillEnterForeground:(UIApplication*)application {
+ [[CCDirector sharedDirector] startAnimation];
+
+#ifdef DIARY_LAUNCHER
+ LauncherLayer *launcher = (LauncherLayer *)[[CoreHolder sharedCoreHolder] currentMainLayer];
+ [launcher show];
+#endif
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ CCDirector *director = [CCDirector sharedDirector];
+
+ [[director openGLView] removeFromSuperview];
+
+ [viewController release];
+
+ [window release];
+
+ [director end];
+}
+
+- (void)applicationSignificantTimeChange:(UIApplication *)application {
+ [[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
+}
+
+- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
+
+ NSLog(@"Handling URL: %@ from source %@", url, sourceApplication);
+
+ [[CoreHolder sharedCoreHolder] setStartedFromLauncher:YES];
+
+ return YES;
+}
+
+- (void)dealloc {
+ [[CCDirector sharedDirector] end];
+ [window release];
+ [super dealloc];
+}
+
+@end
36 iDiary_Review/iDiary2/Ctrl/BookControl.h
@@ -0,0 +1,36 @@
+//
+// BookControl.h
+// iDiary2
+//
+// Created by Markus Konrad on 02.04.12.
+// Copyright (c) 2012 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "CoreHolder.h"
+
+typedef enum {
+ kBookControlTurnDirectionLeft = 0,
+ kBookControlTurnDirectionRight
+} BookControlTurnDirection;
+
+@interface BookControl : NSObject {
+ CFTimeInterval gestureStartTime; // start time of gesture touch
+ CGPoint gestureStartPoint; // start coordinates of gesture touch
+ CGRect tapRectLeft;
+ CGRect tapRectRight;
+
+ CoreHolder *core;
+}
+
+@property (nonatomic,assign) id target;
+@property (nonatomic,assign) SEL action;
+@property (nonatomic,assign) BOOL enabled;
+
+-(id)initWithTarget:(id)t action:(SEL)a;
+
+-(void)touchesBegan:(NSSet *)touches;
+-(void)touchesEnded:(NSSet *)touches;
+
+@end
135 iDiary_Review/iDiary2/Ctrl/BookControl.mm
@@ -0,0 +1,135 @@
+//
+// BookControl.m
+// iDiary2
+//
+// Created by Markus Konrad on 02.04.12.
+// Copyright (c) 2012 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import "BookControl.h"
+
+#import "Tools.h"
+#import "Config.h"
+
+@implementation BookControl
+
+@synthesize target;
+@synthesize action;
+@synthesize enabled;
+
+#pragma mark init/dealloc
+
+-(id)initWithTarget:(id)t action:(SEL)a {
+ self = [super init];
+
+ if (self) {
+ gestureStartTime = 0.0f;
+ gestureStartPoint = CGPointZero;
+ enabled = YES;
+
+ target = t;
+ action = a;
+
+ core = [CoreHolder sharedCoreHolder];
+
+ tapRectLeft = CGRectMake(0, 0, kPageTurnCornerW, kPageTurnCornerH);
+ tapRectRight = CGRectMake(core.screenW - kPageTurnCornerW, 0, kPageTurnCornerW, kPageTurnCornerH);
+ }
+
+ return self;
+}
+
+#pragma mark public methods
+
+-(void)touchesBegan:(NSSet *)touches {
+ if (!enabled) return;
+
+ CGPoint p = [Tools convertTouchToGLPoint:[touches anyObject]];
+
+ if ([touches count] > 1) { // check if valid movement, this means if the touch was in the right area
+ NSLog(@"Swipe: Cancelled (wrong touch count)");
+ gestureStartTime = -1.0f;
+ } else { // it was in the right area: save timestamp and startpoint of the touch
+ gestureStartTime = CACurrentMediaTime();
+ gestureStartPoint = p;
+ NSLog(@"Swipe: Began at %f, %f", p.x, p.y);
+ }
+
+}
+
+
+-(void)touchesEnded:(NSSet *)touches {
+ if (!enabled || gestureStartTime < 0) return;
+
+ CGPoint p = [Tools convertTouchToGLPoint:[touches anyObject]];
+
+// // somehow, "touchesEnded" has the coordinates flipped to portrait mode
+// // we must fix that:
+// CGFloat x = p.y;
+// p.y = p.x;
+// p.x = core.screenH - x;
+
+ // calc distance and angle
+ CGFloat dist = ccpDistance(p, gestureStartPoint);
+ CGFloat angle = fabsf(ccpToAngle(ccpSub(p, gestureStartPoint)));
+
+ NSLog(@"Swipe: Stop at: %f, %f", p.x, p.y);
+ NSLog(@"Swipe: dist = %f, angle = %f", dist, CC_RADIANS_TO_DEGREES(angle));
+
+ float angleTolerance = CC_DEGREES_TO_RADIANS(kPageTurnGestureAngleTolerance);
+ float targetAngleLeft = 0.0f; // to left
+ float targetAngleRight = M_PI; // to right
+ BookControlTurnDirection direction = kBookControlTurnDirectionLeft;
+
+ // check if valid movement
+ if (([touches count] > 1)
+ || (CACurrentMediaTime() - gestureStartTime > kPageTurnGestureMaxTime)) { // don't exceed maximum time
+ NSLog(@"Swipe: Cancelled (wrong touch count or took too long)!");
+ return;
+ } else {
+ if (dist <= kPageTurnTapMaxDist) { // we have a tap
+ if (CGRectContainsPoint(tapRectLeft, gestureStartPoint)) {
+ direction = kBookControlTurnDirectionLeft;
+ } else if (CGRectContainsPoint(tapRectRight, gestureStartPoint)) {
+ direction = kBookControlTurnDirectionRight;
+ } else {
+ NSLog(@"Swipe: Cancelled (tap was out of tap area)!");
+
+ return;
+ }
+ } else { // it might be a swipe gesture
+ if (dist < kPageTurnGestureMinDist) {
+ NSLog(@"Swipe: Cancelled (swipe was too short)!");
+
+ return;
+ }
+
+ if (fabsf(targetAngleLeft - angle) <= angleTolerance) {
+ direction = kBookControlTurnDirectionLeft;
+ } else if (fabsf(targetAngleRight - angle) <= angleTolerance) {
+ direction = kBookControlTurnDirectionRight;
+ } else {
+ NSLog(@"Swipe: Cancelled (swipe was in strange direction)!");
+
+ return;
+ }
+
+ if (direction == kBookControlTurnDirectionLeft && gestureStartPoint.x > core.screenCenter.x) {
+ NSLog(@"Swipe: Cancelled (swipe to left started at the wrong side)!");
+
+ return;
+ } else if (direction == kBookControlTurnDirectionRight && gestureStartPoint.x < core.screenCenter.x) {
+ NSLog(@"Swipe: Cancelled (swipe to right started at the wrong side)!");
+
+ return;
+ }
+ }
+
+ NSLog(@"Swipe: Ended successfully!");
+
+ [target performSelector:action withObject:[NSNumber numberWithInt:direction]];
+ }
+}
+
+
+@end
142 iDiary_Review/iDiary2/Ctrl/CoreHolder.h
@@ -0,0 +1,142 @@
+//
+// CoreHolder.h
+// InterviewStation
+//
+// Created by Markus Konrad on 23.03.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "OverviewLayer.h"
+#import "StartscreenLayer.h"
+#import "PageLayer.h"
+#import "PageMainLayer.h"
+#import "VideoLayer.h"
+#import "PanningLayer.h"
+#import "ModalOverlay.h"
+
+// Load diary definitions for this target
+#ifdef DIARIES_HEADER
+#import DIARIES_HEADER
+#else
+#define DIARY_LAUNCHER
+#endif
+
+// Application status types
+typedef enum {
+ kAppStateUninitialized = 0, // right at the beginning, this status is set
+ kAppStateStartscreenShowing, // when the startscreen for a person is shown
+ kAppStateVideoPlaying, // when a video is playing
+ kAppStatePageShowing // when a diary page is shown
+} appStateType;
+
+
+// Forward declarations
+
+@class ModalOverlay;
+
+// Core Holder class is a singleton class that implements the overall application behavior.
+// The public methods react to events like incomming RFID messages or video selection by the user.
+// All scenes and layers are created only once at the CoreHolder initialization method.
+@interface CoreHolder : NSObject {
+@private
+ CCDirector *director; // shortcut to the CCDirector
+ CCScene *currentScene; // the scene that is currently active
+ CCLayer *currentMainLayer; // the main layer (OverviewLayer, PageLayer or VideoLayer) that is currently active
+
+ ModalOverlay *currentModalOverlay; // modal overlay layer or nil
+
+ NSArray *persistentPageElements; // save data that will be loaded after a video has been played
+
+ NSArray *curPersonMetaData; // meta data for current person
+
+ NSString *currentPerson; // the selected person
+ NSString *currentPageName; // the selected page name
+ int currentPageNum; // the selected page index (beginning with 0)
+ int maxPageNum; // the maximum page index
+
+ appStateType appState; // the current app state. see appStateType
+
+ int screenW; // screen width (normally 1024 on iPad)
+ int screenH; // screen height (normally 768 on iPad)
+ CGPoint screenCenter; // screen center point
+
+ NSString *scheduledPerson; // this person's diary will be shown after a video has ended
+ int scheduledPageNum; // this page number of the diary will be shown after a video has ended
+
+ PageLayer *currentPageLayer; // PageLayer object that is currently shown
+ PageLayer *otherPageLayer; // PageLayer object for the next or the previous page
+
+ BOOL allowPageTurn; // enable / disable page navigation
+}
+
+@property (nonatomic,readonly) NSString *currentPerson;
+@property (nonatomic,readonly) NSString *currentPageName;
+@property (nonatomic,readonly) int currentPageNum;
+@property (nonatomic,readonly) int maxPageNum;
+@property (nonatomic,readonly) CCLayer *currentMainLayer;
+@property (nonatomic,readonly) int screenW;
+@property (nonatomic,readonly) int screenH;
+@property (nonatomic,readonly) CGPoint screenCenter;
+@property (nonatomic,readonly) BOOL allowPageTurn;
+@property (nonatomic,assign) BOOL interactiveObjectWasTouched;
+@property (nonatomic,readonly) NSArray *curPersonMetaData;
+@property (nonatomic,assign) BOOL startedFromLauncher;
+
+// Create / retrieve singleton object
++ (CoreHolder*)sharedCoreHolder;
+
+// called upon first start
+- (void)firstStart;
+
+// show a modal overlay
+- (void)showModalOverlay:(NSString *)overlayFile background:(NSString *)backgroundFile;
+- (void)closeModalOverlay;
+
+#ifndef DIARY_LAUNCHER
+// switch to overview
+- (void)showOverview:(id)sender;
+
+// will show the start screen (desk of the person)
+- (void)showStartscreen:(id)sender;
+
+// show a video
+- (void)showVideo:(NSString *)file;
+
+// called when a person has been selected on the overview layer
+- (void)selectedPerson:(NSString *)pPerson;
+
+// called when the diary in the startscreen for the person has been selected
+- (void)enterCurrentPersonsDiary;
+
+// return a page name from the diary page at pageNum for the person
+- (NSString *)getPageNameAtIndex:(int)pageNum forPerson:(NSString *)person;
+
+// display the previous page of the current person
+- (void)showPrevPage:(id)sender;
+
+// display the next page of the current person
+- (void)showNextPage:(id)sender;
+
+// show a page layer with a given key and page using a turn direction: -1 is back, +1 is forward, 0 is "no page turn"
+//- (void)showPageLayerWithKey:(NSString *)key andPage:(int)page usingPageTurn:(int)turnDir;
+
+// called when a movie in the VideoLayer finished
+- (void)videoLayerFinishedPlayback:(NSNotification *)notification;
+
+// schedules an action that will be performed after a video has been showed: show this same diary again
+- (void)scheduleAfterVideoPlaybackReturnToSameDiary;
+
+// schedules an action that will be performed after a video has been showed: show this person on this page
+- (void)scheduleAfterVideoPlaybackPerson:(NSString *)pPerson andPage:(int)page;
+
+// Called by a PageLayer when it is fully loaded
+- (void)pageTurnCompleted;
+
+// go back to diary launcher app
+- (void)switchToDiaryLauncher;
+
+#endif
+
+@end
484 iDiary_Review/iDiary2/Ctrl/CoreHolder.mm
@@ -0,0 +1,484 @@
+//
+// CoreHolder.m
+// InterviewStation
+//
+// Created by Markus Konrad on 23.03.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import "CoreHolder.h"
+
+#import "Tools.h"
+#import "Makros.h"
+#import "Config.h"
+#import "SoundHandler.h"
+#import "CommonActions.h"
+
+#ifdef DIARY_LAUNCHER
+#import "LauncherLayer.h"
+#endif
+
+// Private methods
+@interface CoreHolder(PrivateMethods)
+#ifndef DIARY_LAUNCHER
+// show to an app state with some parameters using a turn direction: -1 is back, +1 is forward, 0 is "no page turn"
+- (void)switchToAppState:(appStateType)state usingParameters:(id)params andPageTurn:(int)turnDir;
+#endif
+@end
+
+@implementation CoreHolder
+
+@synthesize currentPerson;
+@synthesize currentPageName;
+@synthesize currentPageNum;
+@synthesize maxPageNum;
+@synthesize currentMainLayer;
+@synthesize screenW;
+@synthesize screenH;
+@synthesize screenCenter;
+@synthesize allowPageTurn;
+@synthesize curPersonMetaData;
+@synthesize interactiveObjectWasTouched;
+@synthesize startedFromLauncher;
+
+#pragma mark other NSObject methods
+
+- (id)init {
+ self = [super init];
+
+ if (self) {
+ // init random
+ srand(time(NULL));
+
+ // set app state
+ appState = kAppStateUninitialized;
+
+ // show platform
+ NSLog(@"Device is iPad2: %d", IS_IPAD_2);
+
+ // must be called before any other call to the director
+ if( ![CCDirector setDirectorType:kCCDirectorTypeDisplayLink] ) {
+ [CCDirector setDirectorType:kCCDirectorTypeMainLoop];
+ }
+
+ // initialize sound
+ [SoundHandler shared];
+
+ // set defaults
+ director = [CCDirector sharedDirector];
+ screenW = [director winSize].width;
+ screenH = [director winSize].height;
+ screenCenter = ccp(screenW / 2, screenH / 2);
+
+ [director setDepthTest:YES];
+
+ currentScene = [[CCScene node] retain];
+
+ currentPerson = nil;
+ currentPageName = nil;
+ currentPageNum = 0;
+
+ allowPageTurn = YES;
+
+ interactiveObjectWasTouched = NO;
+
+ scheduledPerson = nil;
+ scheduledPageNum = 0;
+ }
+
+ return self;
+}
+
+- (void)dealloc {
+ [currentPerson release];
+ [currentPageName release];
+
+ [currentPageLayer release];
+ [otherPageLayer release];
+
+ [currentMainLayer release];
+ [currentScene release];
+
+ [super dealloc];
+}
+
+#pragma mark public messages
+
+- (void)showModalOverlay:(NSString *)overlayFile background:(NSString *)backgroundFile {
+ if (currentModalOverlay) return;
+
+ float fadeColor = 255.0f * 0.75f;
+
+ currentModalOverlay = [[ModalOverlay alloc] initWithColor:ccc4(0, 0, 0, fadeColor) width:screenW height:screenH];
+
+ [currentModalOverlay setBackgroundImage:backgroundFile];
+ [currentModalOverlay setContentImage:overlayFile];
+
+ [currentModalOverlay setOpacity:0];
+
+ [currentMainLayer addChild:currentModalOverlay];
+ [currentMainLayer setIsTouchEnabled:NO];
+
+ [CommonActions fadeElement:currentModalOverlay to:fadeColor];
+}
+
+- (void)closeModalOverlay {
+ CCFiniteTimeAction *fade = [CommonActions fadeActionForElement:currentModalOverlay to:0];
+
+ CCCallBlockN *finalAction = [CCCallBlockN actionWithBlock:^(CCNode *node) {
+ [currentModalOverlay removeFromParentAndCleanup:YES];
+ [currentModalOverlay release];
+ currentModalOverlay = nil;
+
+ [currentMainLayer setIsTouchEnabled:YES];
+ }];
+
+ [currentModalOverlay runAction:[CCSequence actions:fade, finalAction, nil]];
+}
+
+
+#ifdef DIARY_LAUNCHER
+
+- (void)firstStart {
+ NSLog(@"*** Started as Diary Launcher ***");
+
+ // create launcher layer as main layer
+ LauncherLayer *launcher = [LauncherLayer node];
+ currentMainLayer = [launcher retain];
+
+ // show the items on the launcher layer
+ [launcher show];
+
+ // create an empty scene as current scene and at the launcher layer
+ currentScene = [[CCScene node] retain];
+ [currentScene addChild:launcher];
+
+ // run with this scene
+ [director runWithScene:currentScene];
+}
+
+#else
+
+- (void)switchToDiaryLauncher {
+ // go back to the launcher
+ NSURL *url = [NSURL URLWithString:@"idiaryLauncher://"];
+ [[UIApplication sharedApplication] openURL:url];
+}
+
+- (void)firstStart {
+ [self selectedPerson:[[diaryPages allKeys] objectAtIndex:0]];
+
+#ifndef kDbgStartWithPageNum
+ NSArray *pageParams = [NSArray arrayWithObject:currentPerson];
+ [self switchToAppState:kAppStateStartscreenShowing usingParameters:pageParams andPageTurn:0];
+#else
+ NSArray *pageParams = [NSArray arrayWithObjects:currentPerson, [NSNumber numberWithInt:kDbgStartWithPageNum] , nil];
+ curPersonMetaData = [diaryMetaData objectForKey:currentPerson];
+ [self switchToAppState:kAppStatePageShowing usingParameters:pageParams andPageTurn:0];
+#endif
+}
+
+
+- (void)showOverview:(id)sender {
+ if (startedFromLauncher) {
+ // go back to diary launcher
+ [self switchToDiaryLauncher];
+ } else {
+ // show the desk again
+ [self showStartscreen:nil];
+ }
+}
+
+- (void)showStartscreen:(id)sender {
+ // show the desk again
+ NSArray *pageParams = [NSArray arrayWithObject:currentPerson];
+ [self switchToAppState:kAppStateStartscreenShowing usingParameters:pageParams andPageTurn:0];
+}
+
+- (void)showVideo:(NSString *)file {
+ if (appState == kAppStatePageShowing) {
+ [(PageMainLayer *)currentMainLayer savePageStatus];
+ }
+
+ [self switchToAppState:kAppStateVideoPlaying usingParameters:file andPageTurn:0];
+}
+
+- (void)showPrevPage:(id)sender {
+ if (!allowPageTurn) return;
+
+ if (currentPageNum == 0) {
+ [self showStartscreen:nil];
+ return;
+ }
+
+ // prevent from turning more than 1 page at a time
+ allowPageTurn = NO;
+
+ NSArray *pageParams = [NSArray arrayWithObjects:currentPerson, [NSNumber numberWithInt:(currentPageNum - 1)] , nil];
+ [self switchToAppState:kAppStatePageShowing usingParameters:pageParams andPageTurn:-1];
+}
+
+- (void)showNextPage:(id)sender {
+ if (!allowPageTurn) return;
+
+ if (currentPageNum == maxPageNum) {
+ // do nothing
+ return;
+ }
+
+ // prevent from turning more than 1 page at a time
+ allowPageTurn = NO;
+
+ // border checking for currentPageNum needs to be done in PageLayer
+ NSArray *pageParams = [NSArray arrayWithObjects:currentPerson, [NSNumber numberWithInt:(currentPageNum + 1)] , nil];
+ [self switchToAppState:kAppStatePageShowing usingParameters:pageParams andPageTurn:1];
+}
+
+- (void)selectedPerson:(NSString *)pPerson {
+ NSLog(@"Selected person: %@", pPerson);
+
+ if (currentPerson != pPerson) {
+ [currentPerson release];
+ currentPerson = [pPerson retain];
+ curPersonMetaData = [diaryMetaData objectForKey:currentPerson];
+ }
+
+// [self switchToAppState:kAppStateStartscreenShowing usingParameters:nil andPageTurn:0];
+}
+
+- (void)enterCurrentPersonsDiary {
+ currentPageNum = -1; // will be increased in showNextPage
+ [self showNextPage:nil];
+}
+
+// return a page name from the diary page at pageNum for the person
+- (NSString *)getPageNameAtIndex:(int)pageNum forPerson:(NSString *)person {
+ NSArray *personDiary = [diaryPages objectForKey:person];
+ NSAssert(personDiary != nil, ([NSString stringWithFormat:@"No diary for person %@ found", person]));
+ NSAssert(pageNum >= 0 && pageNum < [personDiary count], @"Invalid pageNum");
+
+ return [personDiary objectAtIndex:pageNum];
+}
+
+// schedules an action that will be performed after a video has been showed: show this same diary again
+- (void)scheduleAfterVideoPlaybackReturnToSameDiary {
+ [self scheduleAfterVideoPlaybackPerson:currentPerson andPage:currentPageNum];
+}
+
+// schedules an action that will be performed after a video has been showed: show this person on this page
+- (void)scheduleAfterVideoPlaybackPerson:(NSString *)pPerson andPage:(int)page {
+ scheduledPerson = pPerson;
+ scheduledPageNum = page;
+}
+
+- (void)videoLayerFinishedPlayback:(NSNotification *)notification { // Apple's MPMoviePlayer somehow sends this notification several times!
+ if (appState == kAppStateVideoPlaying) {
+ appState = kAppStateStartscreenShowing; // Important, because otherwise all this will be called twice which results in a BAD_ACCESS
+
+ [(VideoLayer *)currentMainLayer stop];
+
+ [[UIApplication sharedApplication] setStatusBarHidden:YES];
+
+ if (scheduledPerson == nil) {
+ [self showOverview:nil];
+ } else {
+ NSArray *pageParams = [NSArray arrayWithObjects:scheduledPerson, [NSNumber numberWithInt:scheduledPageNum], [NSNumber numberWithBool:YES], nil];
+ [self switchToAppState:kAppStatePageShowing usingParameters:pageParams andPageTurn:0];
+ }
+ }
+}
+
+- (void)pageTurnCompleted {
+ // check if cache needs to be cleared
+ double mem = [CCDirector getAvailableMegaBytes];
+ if (mem <= kClearCacheThreshold) {
+ NSLog(@"*** OH NO! Only %f MB of memory available -> Clearing Cache!", mem);
+ [director purgeCachedData];
+ }
+
+ // no object touched for now
+ interactiveObjectWasTouched = NO;
+
+ // re-enable page turn
+ allowPageTurn = YES;
+}
+
+#pragma mark private messages
+
+- (void)switchToAppState:(appStateType)state usingParameters:(id)params andPageTurn:(int)turnDir {
+ // decide whether we really changed the app state
+ BOOL switchedState = YES;
+ BOOL useFadeTransition = NO;
+
+ appStateType previousState = appState;
+
+ if (state == appState) {
+ switchedState = NO;
+ }
+
+ appState = state;
+
+ // do state chance specific actions
+ if (state == kAppStateVideoPlaying && previousState == kAppStatePageShowing) { // switched from page to video -> save the persistent objects
+ NSLog(@"switched from page to video -> save the persistent objects");
+ persistentPageElements = [((PageMainLayer *)currentMainLayer).persistentPageElements retain];
+ [((PageMainLayer *)currentMainLayer).currentPageLayer pageGoneInvisible];
+ }
+
+ if (switchedState) {
+ NSLog(@"Switched AppState, releasing currentMainLayer & removing perform requests for core...");
+ [NSObject cancelPreviousPerformRequestsWithTarget:currentMainLayer];
+ [NSObject cancelPreviousPerformRequestsWithTarget:self];
+
+ [currentMainLayer release];
+ currentMainLayer = nil;
+ }
+
+
+ // create new main layer
+ switch (state) {
+ default:
+ case kAppStateUninitialized:
+ case kAppStateStartscreenShowing: {
+ NSLog(@"Switching to appState: kAppStateStartscreenShowing");
+
+ // setup the start screen
+ NSArray *meta = [diaryMetaData objectForKey:currentPerson];
+ NSAssert(meta != nil, @"No meta data found!");
+ CGPoint diaryPos = [[meta objectAtIndex:0] CGPointValue];
+ CGPoint disclaimerPos = [[meta objectAtIndex:4] CGPointValue];
+
+ currentMainLayer = [StartscreenLayer node];
+ [(StartscreenLayer *)currentMainLayer setupForPerson:currentPerson withDiaryPos:diaryPos disclaimerPos:disclaimerPos];
+
+ // enable fading
+ useFadeTransition = YES;
+
+ break;
+ }
+
+ case kAppStateVideoPlaying: {
+ NSLog(@"Switching to appState: kAppStateVideoPlaying");
+
+ VideoLayer *videoLayer = [VideoLayer node];
+ [videoLayer performSelector:@selector(playVideo:) withObject:params afterDelay:kVideoFadeDuration];
+ currentMainLayer = videoLayer;
+
+ useFadeTransition = YES;
+
+ break;
+ }
+
+ case kAppStatePageShowing: {
+ [currentPerson release];
+
+ // get person and page number from param array
+ currentPerson = [params objectAtIndex:0];
+ currentPageNum = [[params objectAtIndex:1] intValue];
+
+ BOOL loadAfterVideoPlayed = NO;
+ if ([params count] >= 3) { // optional 3rd param: load page after video was shown?
+ loadAfterVideoPlayed = [[params objectAtIndex:2] boolValue];
+ }
+
+ maxPageNum = [[diaryPages objectForKey:currentPerson] count] - 1;
+ NSAssert(maxPageNum >= 0, @"Invalid maxPageNum!");
+
+ // get page name from diary
+ [currentPageName release];
+ currentPageName = [[self getPageNameAtIndex:currentPageNum forPerson:currentPerson] retain];
+
+ NSAssert(currentPageName != nil, @"currentPageName could not be set!");
+
+ NSLog(@"Switching to appState: kAppStatePageShowing with person %@ on page %d (%@)", currentPerson, currentPageNum, currentPageName);
+
+ // load a main layer with a background if this has not been loaded yet
+ if (switchedState) {
+ useFadeTransition = YES;
+
+ currentMainLayer = [PageMainLayer node];
+
+ [((PageMainLayer *)currentMainLayer) loadPerson:currentPerson
+ withPageName:currentPageName
+ andOldPageStatus:persistentPageElements];
+
+ [((PageMainLayer *)currentMainLayer).currentPageLayer pageTurnComplete];
+ } else {
+ [((PageMainLayer *)currentMainLayer) navigateInDirection:turnDir];
+ }
+
+ // switched from video to page -> release the persistent objects
+ if (previousState == kAppStateStartscreenShowing && persistentPageElements) { // video is "kAppStateStartscreenShowing" (see videoLayerFinishedPlayback for explanation)
+ NSLog(@"switched from video to page -> load the persistent objects");
+
+ [persistentPageElements release];
+ persistentPageElements = nil;
+ }
+
+ break;
+ }
+ }
+
+ // add the main layer to the main scene
+ if (switchedState) {
+ [currentScene release];
+ currentScene = nil;
+
+ currentScene = [[CCScene node] retain];
+ [currentScene addChild:currentMainLayer];
+
+ [currentMainLayer retain];
+
+ // set the new scene
+ if ([director runningScene] == nil) {
+ [director runWithScene:currentScene];
+ } else {
+ if (useFadeTransition) {
+ CCTransitionFade *sceneTransition = [CCTransitionFade transitionWithDuration:kVideoFadeDuration scene:currentScene withColor:ccBLACK];
+ [director replaceScene:sceneTransition];
+ } else {
+ [director replaceScene:currentScene];
+ }
+ }
+ }
+}
+#endif
+
+
+#pragma mark singleton stuff
+
+static CoreHolder* sharedCoreHolder;
+
++ (CoreHolder*)sharedCoreHolder {
+ if (sharedCoreHolder == nil) {
+ sharedCoreHolder = [[super allocWithZone:NULL] init];
+ }
+ return sharedCoreHolder;
+}
+
++ (id)allocWithZone:(NSZone *)zone {
+ return [[self sharedCoreHolder] retain];
+}
+
+- (id)copyWithZone:(NSZone *)zone {
+ return self;
+}
+
+- (id)retain {
+ return self;
+}
+
+- (NSUInteger)retainCount {
+ return NSUIntegerMax; //denotes an object that cannot be released
+}
+
+- (void)release {
+ //do nothing
+}
+
+- (id)autorelease {
+ return self;
+}
+
+
+@end
43 iDiary_Review/iDiary2/Ctrl/DiaryDefinitions/Diaries_Alice.h
@@ -0,0 +1,43 @@
+//
+// Diaries_Alice.h
+// iDiary2
+//
+// Created by Markus Konrad on 06.06.12
+// Copyright 2012 INKA Forschungsgruppe. All rights reserved.
+//
+
+// These Arrays define the pages
+static NSArray *diaryAlice = [NSArray arrayWithObjects:
+ @"Intro", // 0
+ @"Example2", // 1
+ @"Example3", // 2
+ @"Example4", // 3
+ @"Example5", // 4
+ @"Example6", // 5
+ @"Example7", // 6
+ @"Example8", // 7
+ nil];
+
+// This dictionary associates the diary-arrays with the persons
+static NSDictionary *diaryPages = [NSDictionary dictionaryWithObjectsAndKeys:
+ diaryAlice, @"Alice",
+ nil];
+
+// These Arrays define meta data for diaries, such as the position of the diary in the startscreen, page offset, anim corner size
+static NSArray *metaDataAlice = [NSArray arrayWithObjects:
+ [NSValue valueWithCGPoint:ccp(395, 768-417)], // position of the diary in the startscreen
+ [NSValue valueWithCGPoint:ccp(-1.5, 0)], // page offset
+ [NSValue valueWithCGSize:CGSizeMake(242, 200)], // page corner animation size
+ [NSValue valueWithCGPoint:ccp(-1, 1)], // page corner offset
+ [NSValue valueWithCGPoint:ccp(945, 768-725)], // disclamer coordinates
+ nil];
+
+// This dictionary associates the diary-metadata-arrays with the persons
+static NSDictionary *diaryMetaData = [NSDictionary dictionaryWithObjectsAndKeys:
+ metaDataAlice, @"Alice",
+ nil];
+
+// global settings
+static NSMutableDictionary *globalSettings = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:NO], @"controlElemShown",
+ nil];
63 iDiary_Review/iDiary2/Ctrl/Physics/Box2DWorldHolder.h
@@ -0,0 +1,63 @@
+//
+// Box2DWorldHolder.h
+// iDiary2
+//
+// Created by Markus Konrad on 02.05.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "cocos2d.h"
+#import "GLES-Render.h"
+#import "Constants.h"
+#import "Singleton.h"
+
+typedef enum {
+ kB2dWorldTypeTable = 0,
+ kB2dWorldTypeDefault,
+ kB2dWorldTypeBoxing,
+ kB2dWorldTypeNoBorders,
+} b2dWorldType;
+
+typedef struct {
+ float gravity;
+ BOOL fixedGravity;
+ b2World *world;
+ b2dWorldType worldType;
+ GLESDebugDraw *dbgDraw;
+} b2dWorldAttributes;
+
+@protocol PhysicsNotificationDelegate <NSObject>
+
+-(void)willUpdateNode:(CCNode *)node withNewPosition:(CGPoint *)posValue;
+
+@end
+
+@interface Box2DWorldHolder : NSObject<Singleton> {
+ NSMutableDictionary *worlds; // NSNumber kB2dWorldType to NSValue->b2dWorldAttributes pointer mapping
+
+ id<PhysicsNotificationDelegate> delegate;
+}
+
+@property (nonatomic,assign) id<PhysicsNotificationDelegate> delegate;
+
+// returns the b2dWorldAttributes struct with all information about a box2d world
+-(b2dWorldAttributes *)worldAttribsForType:(b2dWorldType)worldType;
+
+// remove a world from memory
+-(void)destroyWorldOfType:(b2dWorldType)worldType;
+
+// draws complete debug data for a world
+-(void)drawDebugViewForType:(b2dWorldType)worldType;
+-(void)drawDebugViewForAttributes:(b2dWorldAttributes *)w;
+
+// updates the worlds state and synchronizes the physical bodies with the cocos2D sprites
+-(void)updateWorldForType:(b2dWorldType)worldType withDeltaTime:(ccTime)dt;
+-(void)updateWorldForAttributes:(b2dWorldAttributes *)w withDeltaTime:(ccTime)dt;
+
+// updates the gravity vector for a world
+-(void)updateGravityForType:(b2dWorldType)worldType withX:(float)x andY:(float)y;
+-(void)updateGravityForAttributes:(b2dWorldAttributes *)w withX:(float)x andY:(float)y;
+
+@end
319 iDiary_Review/iDiary2/Ctrl/Physics/Box2DWorldHolder.mm
@@ -0,0 +1,319 @@
+//
+// Box2DWorldHolder.m
+// iDiary2
+//
+// Created by Markus Konrad on 02.05.11.
+// Copyright 2011 INKA Forschungsgruppe. All rights reserved.
+//
+
+#import "Box2DWorldHolder.h"
+
+@interface Box2DWorldHolder(PrivateMethods)
+- (b2dWorldAttributes *)createWorldAttribsForType:(b2dWorldType)worldType;
+- (b2World *)initWorldOfType:(b2dWorldType)worldType withGravity:(float)gravVal andSetDebugDraw:(GLESDebugDraw **)dbgDraw;
+- (b2dWorldAttributes *)getWorldAttribsForType:(b2dWorldType)type;
+@end
+
+@implementation Box2DWorldHolder
+
+@synthesize delegate;
+
+#pragma mark init/dealloc
+
+- (id)init {
+ self = [super init];
+
+ if (self) {
+ worlds = [[NSMutableDictionary alloc] init];
+ }
+
+ return self;
+}
+
+- (void)dealloc {
+ [worlds release];
+
+ [super dealloc];
+}
+
+#pragma mark public methods
+
+-(void)destroyWorldOfType:(b2dWorldType)worldType {
+ b2dWorldAttributes *w = [self getWorldAttribsForType:worldType];
+
+ if (w == NULL) {
+ return;
+ }
+
+ if (w->dbgDraw != NULL) {
+ delete w->dbgDraw; // produces EXC_BAD_ACCESS somehow...
+ w->dbgDraw = NULL;
+ }
+
+ if (w->world != NULL) {
+ delete w->world;
+ w->world = NULL;
+ }
+
+ [worlds removeObjectForKey:[NSNumber numberWithInt:worldType]];
+
+ delete w;
+ w = NULL;
+}
+
+-(b2dWorldAttributes *)worldAttribsForType:(b2dWorldType)worldType {
+ b2dWorldAttributes *w = [self getWorldAttribsForType:worldType];
+
+ // return these attributes if we already have an existing world
+ if (w != NULL) {
+ return w;
+ }
+
+ // else create the world, save it to the dictionary and return it
+ w = [self createWorldAttribsForType:worldType];
+
+ [worlds setObject:[NSValue valueWithPointer:w] forKey:[NSNumber numberWithInt:worldType]];
+
+ return w;
+}
+
+-(void)drawDebugViewForType:(b2dWorldType)worldType {
+ b2dWorldAttributes *w = [self getWorldAttribsForType:worldType];
+ NSAssert(w != NULL, @"Ups! The b2dWorldAttributes for this type is NULL.");
+
+ [self drawDebugViewForAttributes:w];
+}
+
+-(void)drawDebugViewForAttributes:(b2dWorldAttributes *)w {
+ if (!w) return;
+
+ glDisable(GL_TEXTURE_2D);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
+// glPushMatrix();
+//
+// glTranslatef(0, 0, 10);
+
+ w->world->DrawDebugData();
+
+// glPopMatrix();