From 66e15a79914d21ff27b65c7e1c2a1f2d6daf32ef Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 20 Aug 2011 18:30:12 +0200 Subject: [PATCH 1/2] Sound works fine --- src/Events.pbi | 3 +++ src/Globals.pbi | 8 ++++---- src/Main.pb | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Events.pbi b/src/Events.pbi index d75e901..6027240 100644 --- a/src/Events.pbi +++ b/src/Events.pbi @@ -2,6 +2,7 @@ Procedure HandleEventMenu() If KeyboardReleased(#PB_Key_Up) + PlaySound(0, #PB_Sound_MultiChannel) Menu_GotoCurrent() *ActiveMenu\Entries()\Selected = #False @@ -15,6 +16,7 @@ Procedure HandleEventMenu() EndIf If KeyboardReleased(#PB_Key_Down) + PlaySound(0, #PB_Sound_MultiChannel) Menu_GotoCurrent() *ActiveMenu\Entries()\Selected = #False @@ -29,6 +31,7 @@ Procedure HandleEventMenu() ; We go to the target game state If KeyboardReleased(#PB_Key_Return) + PlaySound(1, #PB_Sound_MultiChannel) Menu_GotoCurrent() CurrentState = *ActiveMenu\Entries()\TargetState *ActiveMenu.GameMenu = Menus(CurrentState) diff --git a/src/Globals.pbi b/src/Globals.pbi index ddd0173..ad40847 100644 --- a/src/Globals.pbi +++ b/src/Globals.pbi @@ -1,5 +1,5 @@  -Global DataPath.s = "../data/" +#DATA_PATH = "../data/" ; Global variables Global Fullscreen = 0 @@ -27,6 +27,6 @@ Enumeration 500 EndEnumeration ; Sounds -Global Dim Sounds.s(2) -Sounds(0) = DataPath + "sound/menu_change.wav" -Sounds(1) = DataPath + "sound/menu_select.wav" \ No newline at end of file +Global Dim Sounds.i(2) +Sounds(0) = LoadSound(0, #DATA_PATH + "sound/menu_change.wav") +Sounds(1) = LoadSound(1, #DATA_PATH + "sound/menu_select.wav") diff --git a/src/Main.pb b/src/Main.pb index bac0c50..41b5e2f 100644 --- a/src/Main.pb +++ b/src/Main.pb @@ -18,9 +18,6 @@ XIncludeFile "Functions.pbi" XIncludeFile "Events.pbi" - - - ; Initialize all the variables and stuff. I think we refactor this ; into a separate file if it gets messy. GameStates("MAIN_MENU")\DrawFun = @DrawMenu() From f089be7018687821daf886b8c0e8a0d907df0e2d Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 20 Aug 2011 18:33:24 +0200 Subject: [PATCH 2/2] change DATA_PATH constant --- src/Functions.pbi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Functions.pbi b/src/Functions.pbi index acaf932..bf3409b 100644 --- a/src/Functions.pbi +++ b/src/Functions.pbi @@ -6,7 +6,7 @@ UsePNGImageDecoder() Procedure InitTileset() - LoadSprite(#Tile01, DataPath+"gfx/tileset01.png") + LoadSprite(#Tile01, #DATA_PATH+"gfx/tileset01.png") ;ClipSprite(#Tile01, 0, 0, 16, 16) EndProcedure