From: Ryan C. Gordon Date: Wed, 12 May 2010 20:50:59 +0000 (-0400) Subject: Merging cmake branch to the default branch. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=9a5f2758e538d9216d255b4797f042a1b6874272;hp=44146d06c780d3aaa283672fedb08b8870ebe1b9;p=lugaru.git Merging cmake branch to the default branch. --- diff --git a/.hgignore b/.hgignore index 4165d64..4c53c52 100644 --- a/.hgignore +++ b/.hgignore @@ -4,3 +4,6 @@ run Xcode/build Xcode/*.xcodeproj/*.mode1v3 Xcode/*.xcodeproj/*.pbxuser +build +*~ +.*.swp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3506973 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,64 @@ +project(lugaru) + +cmake_minimum_required(VERSION 2.6) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" + FORCE) +endif(NOT CMAKE_BUILD_TYPE) + +if(NOT LUGARU_INSTALL_PREFIX) + if(WIN32) + set(LUGARU_INSTALL_PREFIX C:\Lugaru CACHE PATH + "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories." + FORCE) + else(WIN32) + set(LUGARU_INSTALL_PREFIX /usr/local/lugaru CACHE PATH + "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories." + FORCE) + endif(WIN32) +endif(NOT LUGARU_INSTALL_PREFIX) + +set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix +prepended to install directories" FORCE) + + + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") +find_package(OpenAL REQUIRED) +find_package(BZip2 REQUIRED) +find_package(PNG REQUIRED) +find_package(JPEG REQUIRED) +find_package(ZLIB REQUIRED) +find_package(OpenGL REQUIRED) +find_package(GLU REQUIRED) +find_package(SDL REQUIRED) +find_package(OggVorbis REQUIRED) + +include_directories( + ${OPENAL_INCLUDES} + ${BZIP2_INCLUDE_DIR} + ${JPEG_INCLUDE_DIR} + ${PNG_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} + ${OPENGL_INCLUDE_DIR} + ${GLU_INCLUDE_DIR} + ${SDL_INCLUDE_DIR} + ${VORBISFILE_INCLUDE_DIR} + ${OGG_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/Source) + +set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY}) + +add_subdirectory(Source) + +# Install target +if(WIN32) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX}) +else(WIN32) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif(WIN32) + +install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX}) + diff --git a/CONTENT-LICENSE.txt b/CONTENT-LICENSE.txt new file mode 100644 index 0000000..29eb140 --- /dev/null +++ b/CONTENT-LICENSE.txt @@ -0,0 +1,5 @@ +All game assets and demo data (should all be in "Data" folder +in the root of the source tree) are not under the same license +as the engine code. Wolfire has allowed the data to be freely redistributed +for non commercial purposes, but it is forbidden to use in any revenue +generating works. diff --git a/Data/Campaigns/main.txt b/Data/Campaigns/main.txt index bfe72f9..9ea6a54 100644 --- a/Data/Campaigns/main.txt +++ b/Data/Campaigns/main.txt @@ -1 +1 @@ -Campaign Levels: 27 Level 1: Name: Start1 Description: Village_-_start_campaign_mode! ChooseNext: 2 NumNext: 1 NextLevel: 2 LocationX: 264 LocationY: 310 Level 2: Name: Start2 Description: Stranger ChooseNext: 0 NumNext: 1 NextLevel: 3 LocationX: 264 LocationY: 310 Level 3: Name: Start3 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 4 LocationX: 264 LocationY: 310 Level 4: Name: Start4 Description: Wanderer ChooseNext: 1 NumNext: 1 NextLevel: 5 LocationX: 274 LocationY: 310 Level 5: Name: Start5 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 6 LocationX: 264 LocationY: 310 Level 6: Name: Start6 Description: Clearing ChooseNext: 1 NumNext: 1 NextLevel: 7 LocationX: 260 LocationY: 295 Level 7: Name: Start7 Description: Raider_Patrol ChooseNext: 1 NumNext: 1 NextLevel: 8 LocationX: 250 LocationY: 278 Level 8: Name: raidercamp Description: Raider_Camp ChooseNext: 1 NumNext: 1 NextLevel: 9 LocationX: 240 LocationY: 270 Level 8: Name: Start8 Description: Raider_Sentries ChooseNext: 1 NumNext: 1 NextLevel: 10 LocationX: 255 LocationY: 265 \ No newline at end of file +Campaign Levels: 27 Level 1: Name: Start1 Description: Village_-_start_campaign_mode! ChooseNext: 2 NumNext: 1 NextLevel: 2 LocationX: 264 LocationY: 310 Level 2: Name: Start2 Description: Stranger ChooseNext: 0 NumNext: 1 NextLevel: 3 LocationX: 264 LocationY: 310 Level 3: Name: Start3 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 4 LocationX: 264 LocationY: 310 Level 4: Name: Start4 Description: Wanderer ChooseNext: 1 NumNext: 1 NextLevel: 5 LocationX: 274 LocationY: 310 Level 5: Name: Start5 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 6 LocationX: 264 LocationY: 310 Level 6: Name: Start6 Description: Clearing ChooseNext: 1 NumNext: 1 NextLevel: 7 LocationX: 260 LocationY: 295 Level 7: Name: Start7 Description: Raider_Patrol ChooseNext: 1 NumNext: 1 NextLevel: 8 LocationX: 250 LocationY: 278 Level 8: Name: raidercamp Description: Raider_Camp ChooseNext: 1 NumNext: 1 NextLevel: 9 LocationX: 240 LocationY: 270 Level 8: Name: Start8 Description: Raider_Sentries ChooseNext: 1 NumNext: 1 NextLevel: 10 LocationX: 255 LocationY: 265 Level 9: Name: Start9 Description: Raider_Base ChooseNext: 0 NumNext: 1 NextLevel: 11 LocationX: 265 LocationY: 273 Level 10: Name: Start10 Description: Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 12 LocationX: 265 LocationY: 273 Level 11: Name: Start11 Description: Old_Raider_Base ChooseNext: 1 NumNext: 1 NextLevel: 13 LocationX: 286 LocationY: 276 Level 12: Name: Start12 Description: Village ChooseNext: 1 NumNext: 1 NextLevel: 14 LocationX: 264 LocationY: 310 Level 13: Name: Start13 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 15 LocationX: 284 LocationY: 312 Level 14: Name: Start14 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 16 LocationX: 332 LocationY: 272 Level 15: Name: Start15 Description: Heading_North ChooseNext: 1 NumNext: 1 NextLevel: 17 LocationX: 345 LocationY: 246 Level 16: Name: Start16 Description: Jack's_camp ChooseNext: 0 NumNext: 1 NextLevel: 18 LocationX: 324 LocationY: 224 Level 17: Name: Start17 Description: Jack's_camp ChooseNext: 1 NumNext: 1 NextLevel: 19 LocationX: 324 LocationY: 224 Level 18: Name: Start18 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 20 LocationX: 284 LocationY: 312 Level 19: Name: Start19 Description: Rocky_Hall ChooseNext: 1 NumNext: 1 NextLevel: 21 LocationX: 284 LocationY: 312 Level 20: Name: Start20 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 22 LocationX: 360 LocationY: 269 Level 21: Name: Start21 Description: To_Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 23 LocationX: 343 LocationY: 219 Level 22: Name: Start22 Description: Wolf_Den ChooseNext: 0 NumNext: 1 NextLevel: 24 LocationX: 327 LocationY: 179 Level 23: Name: Start23 Description: Alpha_Wolf ChooseNext: 1 NumNext: 1 NextLevel: 25 LocationX: 314 LocationY: 179 Level 24: Name: Start24 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 26 LocationX: 284 LocationY: 312 Level 25: Name: Start25 Description: Rocky_Hall ChooseNext: 0 NumNext: 1 NextLevel: 27 LocationX: 284 LocationY: 312 Level 26: Name: Start26 Description: Leave ChooseNext: 1 NumNext: 0 LocationX: 284 LocationY: 312 \ No newline at end of file diff --git a/Data/Dialogues/Example.txt b/Data/Dialogues/Example.txt index 6105b8b..910baf5 100644 --- a/Data/Dialogues/Example.txt +++ b/Data/Dialogues/Example.txt @@ -1 +1 @@ -Dialogue boxes: 7 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hi, Skipper! Sound: 7 Box 2: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: Hey, Turner! Sound: 7 Box 3: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: What's all this talk about hiring guards? Sound: 1 Box 4: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: There's never been any trouble here while I've been in\charge! Sound: 4 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: The raiders are getting more confident... you never\know. Sound: 1 Box 6: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: I've seen you when you get mad; I think you could\take care of yourself. Sound: 6 Box 7: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It's not me that I'm worried about. Sound: 4 \ No newline at end of file +Dialogue boxes: 7 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hi, Skipper! Sound: 7 Box 2: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: Hey, Turner! Sound: 7 Box 3: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: What's all this talk about hiring guards? Sound: 1 Box 4: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: There's never been any trouble here while I've been in\charge! Sound: 4 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: The raiders are getting more confident... you never\know. Sound: 1 Box 6: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: I've seen you when you get mad; I think you could\take care of yourself. Sound: 6 Box 7: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It's not me that I'm worried about. Sound: 4 \ No newline at end of file diff --git a/Data/Dialogues/clover.txt b/Data/Dialogues/clover.txt index 13ad681..4838c74 100644 --- a/Data/Dialogues/clover.txt +++ b/Data/Dialogues/clover.txt @@ -1 +1 @@ -Dialogue boxes: 6 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hey, Clover! Sound: 7 Box 2: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: Wha, time to wake up already? Sound: 4 Box 3: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Why are you so sleepy? Sound: 6 Box 4: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: I had a horrible dream last night... Sound: 4 Box 5: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: I don't want to talk about it. Sound: 5 Box 6: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Ah, okay. Sound: 3 \ No newline at end of file +Dialogue boxes: 6 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hey, Clover! Sound: 7 Box 2: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: Wha, time to wake up already? Sound: 4 Box 3: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Why are you so sleepy? Sound: 6 Box 4: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: I had a horrible dream last night... Sound: 4 Box 5: Location: 2 Color: 0.0 0.2 0.0 Name: Clover Text: I don't want to talk about it. Sound: 5 Box 6: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Ah, okay. Sound: 3 \ No newline at end of file diff --git a/Data/Dialogues/protest.txt b/Data/Dialogues/protest.txt index 4b59e94..9d2f02e 100644 --- a/Data/Dialogues/protest.txt +++ b/Data/Dialogues/protest.txt @@ -1 +1 @@ -Dialogue boxes: 5 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Why are opposing my rule? Don't you realise that\the penalty for treason is death? Sound: 1 Box 2: Location: 2 Color: 0.2 0.2 0.0 Name: Nat Text: That is what we are protesting! You kill anyone\who disagrees with you! Sound: 4 Box 3: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: I only kill those who disobey me. I have no law\against dissent, but I can't allow you to undermine\my authority. Sound: 2 Box 4: Location: 2 Color: 0.2 0.2 0.0 Name: Nat Text: If you want to stop us, you will have to kill us\all! Sound: 6 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It would be my pleasure. Sound: 7 \ No newline at end of file +Dialogue boxes: 5 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Why are opposing my rule? Don't you realise that\the penalty for treason is death? Sound: 1 Box 2: Location: 2 Color: 0.2 0.2 0.0 Name: Nat Text: That is what we are protesting! You kill anyone\who disagrees with you! Sound: 4 Box 3: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: I only kill those who disobey me. I have no law\against dissent, but I can't allow you to undermine\my authority. Sound: 2 Box 4: Location: 2 Color: 0.2 0.2 0.0 Name: Nat Text: If you want to stop us, you will have to kill us\all! Sound: 6 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It would be my pleasure. Sound: 7 \ No newline at end of file diff --git a/Data/Dialogues/skipper.txt b/Data/Dialogues/skipper.txt index 6105b8b..910baf5 100644 --- a/Data/Dialogues/skipper.txt +++ b/Data/Dialogues/skipper.txt @@ -1 +1 @@ -Dialogue boxes: 7 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hi, Skipper! Sound: 7 Box 2: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: Hey, Turner! Sound: 7 Box 3: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: What's all this talk about hiring guards? Sound: 1 Box 4: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: There's never been any trouble here while I've been in\charge! Sound: 4 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: The raiders are getting more confident... you never\know. Sound: 1 Box 6: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: I've seen you when you get mad; I think you could\take care of yourself. Sound: 6 Box 7: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It's not me that I'm worried about. Sound: 4 \ No newline at end of file +Dialogue boxes: 7 Box 1: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: Hi, Skipper! Sound: 7 Box 2: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: Hey, Turner! Sound: 7 Box 3: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: What's all this talk about hiring guards? Sound: 1 Box 4: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: There's never been any trouble here while I've been in\charge! Sound: 4 Box 5: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: The raiders are getting more confident... you never\know. Sound: 1 Box 6: Location: 2 Color: 0.0 0.0 0.2 Name: Skipper Text: I've seen you when you get mad; I think you could\take care of yourself. Sound: 6 Box 7: Location: 1 Color: 0.0 0.0 0.0 Name: Turner Text: It's not me that I'm worried about. Sound: 4 \ No newline at end of file diff --git a/Data/Maps/Start24 b/Data/Maps/Start24 new file mode 100644 index 0000000..690bf40 Binary files /dev/null and b/Data/Maps/Start24 differ diff --git a/Data/Maps/Start25 b/Data/Maps/Start25 new file mode 100644 index 0000000..6566cee Binary files /dev/null and b/Data/Maps/Start25 differ diff --git a/Data/Maps/Start26 b/Data/Maps/Start26 new file mode 100644 index 0000000..d1dee3c Binary files /dev/null and b/Data/Maps/Start26 differ diff --git a/Data/Maps/Start27 b/Data/Maps/Start27 new file mode 100644 index 0000000..ec28bcd Binary files /dev/null and b/Data/Maps/Start27 differ diff --git a/Data/Maps/Start28 b/Data/Maps/Start28 new file mode 100644 index 0000000..edbf320 Binary files /dev/null and b/Data/Maps/Start28 differ diff --git a/Data/Maps/Start29 b/Data/Maps/Start29 new file mode 100644 index 0000000..22fb902 Binary files /dev/null and b/Data/Maps/Start29 differ diff --git a/Data/Maps/Start30 b/Data/Maps/Start30 new file mode 100644 index 0000000..bfdd7af Binary files /dev/null and b/Data/Maps/Start30 differ diff --git a/Data/Maps/map10 b/Data/Maps/map10 new file mode 100644 index 0000000..4c4785c Binary files /dev/null and b/Data/Maps/map10 differ diff --git a/Data/Maps/map11 b/Data/Maps/map11 new file mode 100644 index 0000000..ee11078 Binary files /dev/null and b/Data/Maps/map11 differ diff --git a/Data/Maps/map12 b/Data/Maps/map12 new file mode 100644 index 0000000..77d4316 Binary files /dev/null and b/Data/Maps/map12 differ diff --git a/Data/Maps/map13 b/Data/Maps/map13 new file mode 100644 index 0000000..b2c3021 Binary files /dev/null and b/Data/Maps/map13 differ diff --git a/Data/Maps/map14 b/Data/Maps/map14 new file mode 100644 index 0000000..bbf5559 Binary files /dev/null and b/Data/Maps/map14 differ diff --git a/Data/Maps/map4 b/Data/Maps/map4 new file mode 100644 index 0000000..4640d08 Binary files /dev/null and b/Data/Maps/map4 differ diff --git a/Data/Maps/map5 b/Data/Maps/map5 new file mode 100644 index 0000000..7328124 Binary files /dev/null and b/Data/Maps/map5 differ diff --git a/Data/Maps/map6 b/Data/Maps/map6 new file mode 100644 index 0000000..c7f8adf Binary files /dev/null and b/Data/Maps/map6 differ diff --git a/Data/Maps/map7 b/Data/Maps/map7 new file mode 100644 index 0000000..53def78 Binary files /dev/null and b/Data/Maps/map7 differ diff --git a/Data/Maps/map8 b/Data/Maps/map8 new file mode 100644 index 0000000..94d6e35 Binary files /dev/null and b/Data/Maps/map8 differ diff --git a/Data/Maps/map9 b/Data/Maps/map9 new file mode 100644 index 0000000..89426f1 Binary files /dev/null and b/Data/Maps/map9 differ diff --git a/Data/Maps/start10 b/Data/Maps/start10 new file mode 100644 index 0000000..79d5e17 Binary files /dev/null and b/Data/Maps/start10 differ diff --git a/Data/Maps/start11 b/Data/Maps/start11 new file mode 100644 index 0000000..547bb3c Binary files /dev/null and b/Data/Maps/start11 differ diff --git a/Data/Maps/start12 b/Data/Maps/start12 new file mode 100644 index 0000000..055dd63 Binary files /dev/null and b/Data/Maps/start12 differ diff --git a/Data/Maps/start13 b/Data/Maps/start13 new file mode 100644 index 0000000..a383f82 Binary files /dev/null and b/Data/Maps/start13 differ diff --git a/Data/Maps/start14 b/Data/Maps/start14 new file mode 100644 index 0000000..b06be60 Binary files /dev/null and b/Data/Maps/start14 differ diff --git a/Data/Maps/start15 b/Data/Maps/start15 new file mode 100644 index 0000000..64e431a Binary files /dev/null and b/Data/Maps/start15 differ diff --git a/Data/Maps/start16 b/Data/Maps/start16 new file mode 100644 index 0000000..9aabd00 Binary files /dev/null and b/Data/Maps/start16 differ diff --git a/Data/Maps/start17 b/Data/Maps/start17 new file mode 100644 index 0000000..45a0b22 Binary files /dev/null and b/Data/Maps/start17 differ diff --git a/Data/Maps/start18 b/Data/Maps/start18 new file mode 100644 index 0000000..768af0e Binary files /dev/null and b/Data/Maps/start18 differ diff --git a/Data/Maps/start19 b/Data/Maps/start19 new file mode 100644 index 0000000..7da1f08 Binary files /dev/null and b/Data/Maps/start19 differ diff --git a/Data/Maps/start20 b/Data/Maps/start20 new file mode 100644 index 0000000..d80cdd7 Binary files /dev/null and b/Data/Maps/start20 differ diff --git a/Data/Maps/start21 b/Data/Maps/start21 new file mode 100644 index 0000000..6b35097 Binary files /dev/null and b/Data/Maps/start21 differ diff --git a/Data/Maps/start22 b/Data/Maps/start22 new file mode 100644 index 0000000..09a4ce4 Binary files /dev/null and b/Data/Maps/start22 differ diff --git a/Data/Maps/start23 b/Data/Maps/start23 new file mode 100644 index 0000000..16665b5 Binary files /dev/null and b/Data/Maps/start23 differ diff --git a/Data/Maps/start9 b/Data/Maps/start9 new file mode 100644 index 0000000..61bf1fe Binary files /dev/null and b/Data/Maps/start9 differ diff --git a/Data/Textures/Quit.png b/Data/Textures/Quit.png index e69de29..b6f3622 100644 Binary files a/Data/Textures/Quit.png and b/Data/Textures/Quit.png differ diff --git a/Data/Textures/Quit.png b/Data/Textures/Quit.png new file mode 100644 index 0000000..9b9db64 Binary files /dev/null and b/Data/Textures/Quit.png differ diff --git a/Data/Textures/Resume.png b/Data/Textures/Resume.png index e69de29..7df225f 100644 Binary files a/Data/Textures/Resume.png and b/Data/Textures/Resume.png differ diff --git a/Data/Textures/Sable.jpg b/Data/Textures/Sable.jpg index e69de29..1503601 100644 Binary files a/Data/Textures/Sable.jpg and b/Data/Textures/Sable.jpg differ diff --git a/Data/Textures/Shine.png b/Data/Textures/Shine.png index e69de29..d8382cd 100644 Binary files a/Data/Textures/Shine.png and b/Data/Textures/Shine.png differ diff --git a/Data/Textures/Skybox(grass)/Back.jpg b/Data/Textures/Skybox(grass)/Back.jpg index e69de29..c131ca6 100644 Binary files a/Data/Textures/Skybox(grass)/Back.jpg and b/Data/Textures/Skybox(grass)/Back.jpg differ diff --git a/Data/Textures/Skybox(grass)/Down.jpg b/Data/Textures/Skybox(grass)/Down.jpg index e69de29..cafff43 100644 Binary files a/Data/Textures/Skybox(grass)/Down.jpg and b/Data/Textures/Skybox(grass)/Down.jpg differ diff --git a/Data/Textures/Skybox(grass)/Front.jpg b/Data/Textures/Skybox(grass)/Front.jpg index e69de29..fb4d386 100644 Binary files a/Data/Textures/Skybox(grass)/Front.jpg and b/Data/Textures/Skybox(grass)/Front.jpg differ diff --git a/Data/Textures/Skybox(grass)/Left.jpg b/Data/Textures/Skybox(grass)/Left.jpg index e69de29..59f9e13 100644 Binary files a/Data/Textures/Skybox(grass)/Left.jpg and b/Data/Textures/Skybox(grass)/Left.jpg differ diff --git a/Data/Textures/Skybox(grass)/Right.jpg b/Data/Textures/Skybox(grass)/Right.jpg index e69de29..bea5d65 100644 Binary files a/Data/Textures/Skybox(grass)/Right.jpg and b/Data/Textures/Skybox(grass)/Right.jpg differ diff --git a/Data/Textures/Skybox(grass)/Up.jpg b/Data/Textures/Skybox(grass)/Up.jpg index e69de29..cb59905 100644 Binary files a/Data/Textures/Skybox(grass)/Up.jpg and b/Data/Textures/Skybox(grass)/Up.jpg differ diff --git a/Data/Textures/Skybox(sand)/Back.jpg b/Data/Textures/Skybox(sand)/Back.jpg index e69de29..e745846 100644 Binary files a/Data/Textures/Skybox(sand)/Back.jpg and b/Data/Textures/Skybox(sand)/Back.jpg differ diff --git a/Data/Textures/Skybox(sand)/Down.jpg b/Data/Textures/Skybox(sand)/Down.jpg index e69de29..87d3d4e 100644 Binary files a/Data/Textures/Skybox(sand)/Down.jpg and b/Data/Textures/Skybox(sand)/Down.jpg differ diff --git a/Data/Textures/Skybox(sand)/Front.jpg b/Data/Textures/Skybox(sand)/Front.jpg index e69de29..8d10353 100644 Binary files a/Data/Textures/Skybox(sand)/Front.jpg and b/Data/Textures/Skybox(sand)/Front.jpg differ diff --git a/Data/Textures/Skybox(sand)/Left.jpg b/Data/Textures/Skybox(sand)/Left.jpg index e69de29..fa917fd 100644 Binary files a/Data/Textures/Skybox(sand)/Left.jpg and b/Data/Textures/Skybox(sand)/Left.jpg differ diff --git a/Data/Textures/Skybox(sand)/Right.jpg b/Data/Textures/Skybox(sand)/Right.jpg index e69de29..bee4cb7 100644 Binary files a/Data/Textures/Skybox(sand)/Right.jpg and b/Data/Textures/Skybox(sand)/Right.jpg differ diff --git a/Data/Textures/Skybox(sand)/Up.jpg b/Data/Textures/Skybox(sand)/Up.jpg index e69de29..2fdd67f 100644 Binary files a/Data/Textures/Skybox(sand)/Up.jpg and b/Data/Textures/Skybox(sand)/Up.jpg differ diff --git a/Data/Textures/Skybox(snow)/Back.jpg b/Data/Textures/Skybox(snow)/Back.jpg index e69de29..c297bb1 100644 Binary files a/Data/Textures/Skybox(snow)/Back.jpg and b/Data/Textures/Skybox(snow)/Back.jpg differ diff --git a/Data/Textures/Skybox(snow)/Down.jpg b/Data/Textures/Skybox(snow)/Down.jpg index e69de29..09fcf61 100644 Binary files a/Data/Textures/Skybox(snow)/Down.jpg and b/Data/Textures/Skybox(snow)/Down.jpg differ diff --git a/Data/Textures/Skybox(snow)/Front.jpg b/Data/Textures/Skybox(snow)/Front.jpg index e69de29..cd4ec13 100644 Binary files a/Data/Textures/Skybox(snow)/Front.jpg and b/Data/Textures/Skybox(snow)/Front.jpg differ diff --git a/Data/Textures/Skybox(snow)/Left.jpg b/Data/Textures/Skybox(snow)/Left.jpg index e69de29..dc53fb8 100644 Binary files a/Data/Textures/Skybox(snow)/Left.jpg and b/Data/Textures/Skybox(snow)/Left.jpg differ diff --git a/Data/Textures/Skybox(snow)/Right.jpg b/Data/Textures/Skybox(snow)/Right.jpg index e69de29..9289801 100644 Binary files a/Data/Textures/Skybox(snow)/Right.jpg and b/Data/Textures/Skybox(snow)/Right.jpg differ diff --git a/Data/Textures/Skybox(snow)/Up.jpg b/Data/Textures/Skybox(snow)/Up.jpg index e69de29..f123295 100644 Binary files a/Data/Textures/Skybox(snow)/Up.jpg and b/Data/Textures/Skybox(snow)/Up.jpg differ diff --git a/Data/Textures/Smoke.png b/Data/Textures/Smoke.png index e69de29..9c62216 100644 Binary files a/Data/Textures/Smoke.png and b/Data/Textures/Smoke.png differ diff --git a/Data/Textures/SnowBox.jpg b/Data/Textures/SnowBox.jpg index e69de29..893c784 100644 Binary files a/Data/Textures/SnowBox.jpg and b/Data/Textures/SnowBox.jpg differ diff --git a/Data/Textures/SnowWolf.jpg b/Data/Textures/SnowWolf.jpg index e69de29..3157cab 100644 Binary files a/Data/Textures/SnowWolf.jpg and b/Data/Textures/SnowWolf.jpg differ diff --git a/Data/Textures/Staff.jpg b/Data/Textures/Staff.jpg index e69de29..0175f10 100644 Binary files a/Data/Textures/Staff.jpg and b/Data/Textures/Staff.jpg differ diff --git a/Data/Textures/Sword.jpg b/Data/Textures/Sword.jpg index e69de29..571e68e 100644 Binary files a/Data/Textures/Sword.jpg and b/Data/Textures/Sword.jpg differ diff --git a/Data/Textures/Swordblood.jpg b/Data/Textures/Swordblood.jpg index e69de29..a56bd99 100644 Binary files a/Data/Textures/Swordblood.jpg and b/Data/Textures/Swordblood.jpg differ diff --git a/Data/Textures/Swordbloodlight.jpg b/Data/Textures/Swordbloodlight.jpg index e69de29..ed04383 100644 Binary files a/Data/Textures/Swordbloodlight.jpg and b/Data/Textures/Swordbloodlight.jpg differ diff --git a/Data/Textures/WB2.jpg b/Data/Textures/WB2.jpg index e69de29..1bc190d 100644 Binary files a/Data/Textures/WB2.jpg and b/Data/Textures/WB2.jpg differ diff --git a/Data/Textures/Wireframe.jpg b/Data/Textures/Wireframe.jpg index e69de29..6a5a27d 100644 Binary files a/Data/Textures/Wireframe.jpg and b/Data/Textures/Wireframe.jpg differ diff --git a/Data/Textures/Wolf.jpg b/Data/Textures/Wolf.jpg index e69de29..19c7181 100644 Binary files a/Data/Textures/Wolf.jpg and b/Data/Textures/Wolf.jpg differ diff --git a/Data/Textures/Wolfbloodfur.png b/Data/Textures/Wolfbloodfur.png index e69de29..02ddd85 100644 Binary files a/Data/Textures/Wolfbloodfur.png and b/Data/Textures/Wolfbloodfur.png differ diff --git a/Data/Textures/World.png b/Data/Textures/World.png index e69de29..2f3fab1 100644 Binary files a/Data/Textures/World.png and b/Data/Textures/World.png differ diff --git a/Data/Textures/blood.png b/Data/Textures/blood.png index e69de29..4dab8e8 100644 Binary files a/Data/Textures/blood.png and b/Data/Textures/blood.png differ diff --git a/Data/Textures/bloodfur.png b/Data/Textures/bloodfur.png index e69de29..9c05063 100644 Binary files a/Data/Textures/bloodfur.png and b/Data/Textures/bloodfur.png differ diff --git a/Data/Textures/bloodparticle.png b/Data/Textures/bloodparticle.png index e69de29..afdbc0f 100644 Binary files a/Data/Textures/bloodparticle.png and b/Data/Textures/bloodparticle.png differ diff --git a/Data/Textures/bloodparticleinverse.png b/Data/Textures/bloodparticleinverse.png index e69de29..7b39f8f 100644 Binary files a/Data/Textures/bloodparticleinverse.png and b/Data/Textures/bloodparticleinverse.png differ diff --git a/Data/Textures/bodyprint.png b/Data/Textures/bodyprint.png index e69de29..ecdc0cd 100644 Binary files a/Data/Textures/bodyprint.png and b/Data/Textures/bodyprint.png differ diff --git a/Data/Textures/break.png b/Data/Textures/break.png index e69de29..24daba9 100644 Binary files a/Data/Textures/break.png and b/Data/Textures/break.png differ diff --git a/Data/Textures/bush.png b/Data/Textures/bush.png index e69de29..e48f5e3 100644 Binary files a/Data/Textures/bush.png and b/Data/Textures/bush.png differ diff --git a/Data/Textures/bushdesert.png b/Data/Textures/bushdesert.png index e69de29..ce09091 100644 Binary files a/Data/Textures/bushdesert.png and b/Data/Textures/bushdesert.png differ diff --git a/Data/Textures/bushsnow.png b/Data/Textures/bushsnow.png index e69de29..a6671aa 100644 Binary files a/Data/Textures/bushsnow.png and b/Data/Textures/bushsnow.png differ diff --git a/Data/Textures/cloud.png b/Data/Textures/cloud.png index e69de29..33b0fdd 100644 Binary files a/Data/Textures/cloud.png and b/Data/Textures/cloud.png differ diff --git a/Data/Textures/cloudimpact.png b/Data/Textures/cloudimpact.png index e69de29..ae36647 100644 Binary files a/Data/Textures/cloudimpact.png and b/Data/Textures/cloudimpact.png differ diff --git a/Data/Textures/deserttree.png b/Data/Textures/deserttree.png index e69de29..66d3915 100644 Binary files a/Data/Textures/deserttree.png and b/Data/Textures/deserttree.png differ diff --git a/Data/Textures/earwrap.png b/Data/Textures/earwrap.png index e69de29..bb60d54 100644 Binary files a/Data/Textures/earwrap.png and b/Data/Textures/earwrap.png differ diff --git a/Data/Textures/fancypants.png b/Data/Textures/fancypants.png index e69de29..dd47ce6 100644 Binary files a/Data/Textures/fancypants.png and b/Data/Textures/fancypants.png differ diff --git a/Data/Textures/fancypantscamo.png b/Data/Textures/fancypantscamo.png index e69de29..382be34 100644 Binary files a/Data/Textures/fancypantscamo.png and b/Data/Textures/fancypantscamo.png differ diff --git a/Data/Textures/fancypantscamoarctic.png b/Data/Textures/fancypantscamoarctic.png index e69de29..bc5283d 100644 Binary files a/Data/Textures/fancypantscamoarctic.png and b/Data/Textures/fancypantscamoarctic.png differ diff --git a/Data/Textures/fancypantscamodesert.png b/Data/Textures/fancypantscamodesert.png index e69de29..9490610 100644 Binary files a/Data/Textures/fancypantscamodesert.png and b/Data/Textures/fancypantscamodesert.png differ diff --git a/Data/Textures/footprint.png b/Data/Textures/footprint.png index e69de29..940607c 100644 Binary files a/Data/Textures/footprint.png and b/Data/Textures/footprint.png differ diff --git a/Data/Textures/footprintsand.png b/Data/Textures/footprintsand.png index e69de29..69ad09e 100644 Binary files a/Data/Textures/footprintsand.png and b/Data/Textures/footprintsand.png differ diff --git a/Data/Textures/footwrap.png b/Data/Textures/footwrap.png index e69de29..f26106f 100644 Binary files a/Data/Textures/footwrap.png and b/Data/Textures/footwrap.png differ diff --git a/Data/Textures/fur.jpg b/Data/Textures/fur.jpg index e69de29..25a6d3d 100644 Binary files a/Data/Textures/fur.jpg and b/Data/Textures/fur.jpg differ diff --git a/Data/Textures/fur2.jpg b/Data/Textures/fur2.jpg index e69de29..b3178db 100644 Binary files a/Data/Textures/fur2.jpg and b/Data/Textures/fur2.jpg differ diff --git a/Data/Textures/fur3.jpg b/Data/Textures/fur3.jpg index e69de29..1240324 100644 Binary files a/Data/Textures/fur3.jpg and b/Data/Textures/fur3.jpg differ diff --git a/Data/Textures/furdarko.jpg b/Data/Textures/furdarko.jpg index e69de29..8ae01fe 100644 Binary files a/Data/Textures/furdarko.jpg and b/Data/Textures/furdarko.jpg differ diff --git a/Data/Textures/grassdirt 2.jpg b/Data/Textures/grassdirt 2.jpg index e69de29..19a8ca5 100644 Binary files a/Data/Textures/grassdirt 2.jpg and b/Data/Textures/grassdirt 2.jpg differ diff --git a/Data/Textures/grassdirt.jpg b/Data/Textures/grassdirt.jpg index e69de29..0cee237 100644 Binary files a/Data/Textures/grassdirt.jpg and b/Data/Textures/grassdirt.jpg differ diff --git a/Data/Textures/hawk.png b/Data/Textures/hawk.png index e69de29..5ef2abc 100644 Binary files a/Data/Textures/hawk.png and b/Data/Textures/hawk.png differ diff --git a/Data/Textures/headband.png b/Data/Textures/headband.png index e69de29..bbaf0f2 100644 Binary files a/Data/Textures/headband.png and b/Data/Textures/headband.png differ diff --git a/Data/Textures/heightmap.png b/Data/Textures/heightmap.png index e69de29..0632f69 100644 Binary files a/Data/Textures/heightmap.png and b/Data/Textures/heightmap.png differ diff --git a/Data/Textures/leaf.png b/Data/Textures/leaf.png index e69de29..65e11b9 100644 Binary files a/Data/Textures/leaf.png and b/Data/Textures/leaf.png differ diff --git a/Data/Textures/leatherarmor.png b/Data/Textures/leatherarmor.png index e69de29..56686ae 100644 Binary files a/Data/Textures/leatherarmor.png and b/Data/Textures/leatherarmor.png differ diff --git a/Data/Textures/leatherpants.png b/Data/Textures/leatherpants.png index e69de29..7fb96c2 100644 Binary files a/Data/Textures/leatherpants.png and b/Data/Textures/leatherpants.png differ diff --git a/Data/Textures/logo.png b/Data/Textures/logo.png index e69de29..77a8ae5 100644 Binary files a/Data/Textures/logo.png and b/Data/Textures/logo.png differ diff --git a/Data/Textures/longsleeve.png b/Data/Textures/longsleeve.png index e69de29..3bec857 100644 Binary files a/Data/Textures/longsleeve.png and b/Data/Textures/longsleeve.png differ diff --git a/Data/Textures/mossrock.jpg b/Data/Textures/mossrock.jpg index e69de29..d166202 100644 Binary files a/Data/Textures/mossrock.jpg and b/Data/Textures/mossrock.jpg differ diff --git a/Data/Textures/pants.png b/Data/Textures/pants.png index e69de29..7c0e702 100644 Binary files a/Data/Textures/pants.png and b/Data/Textures/pants.png differ diff --git a/Data/Textures/rock.jpg b/Data/Textures/rock.jpg index e69de29..3011bd8 100644 Binary files a/Data/Textures/rock.jpg and b/Data/Textures/rock.jpg differ diff --git a/Data/Textures/rock2.jpg b/Data/Textures/rock2.jpg index e69de29..d3b5fb9 100644 Binary files a/Data/Textures/rock2.jpg and b/Data/Textures/rock2.jpg differ diff --git a/Data/Textures/sand.jpg b/Data/Textures/sand.jpg index e69de29..aaa34f8 100644 Binary files a/Data/Textures/sand.jpg and b/Data/Textures/sand.jpg differ diff --git a/Data/Textures/sandslope.jpg b/Data/Textures/sandslope.jpg index e69de29..e4e195a 100644 Binary files a/Data/Textures/sandslope.jpg and b/Data/Textures/sandslope.jpg differ diff --git a/Data/Textures/scar.png b/Data/Textures/scar.png index e69de29..456297f 100644 Binary files a/Data/Textures/scar.png and b/Data/Textures/scar.png differ diff --git a/Data/Textures/shadow.png b/Data/Textures/shadow.png index e69de29..52b0a22 100644 Binary files a/Data/Textures/shadow.png and b/Data/Textures/shadow.png differ diff --git a/Data/Textures/shirt.png b/Data/Textures/shirt.png index e69de29..ac9f0c9 100644 Binary files a/Data/Textures/shirt.png and b/Data/Textures/shirt.png differ diff --git a/Data/Textures/shirtfemale.png b/Data/Textures/shirtfemale.png index e69de29..e862c28 100644 Binary files a/Data/Textures/shirtfemale.png and b/Data/Textures/shirtfemale.png differ diff --git a/Data/Textures/snow.jpg b/Data/Textures/snow.jpg index e69de29..3d3e05f 100644 Binary files a/Data/Textures/snow.jpg and b/Data/Textures/snow.jpg differ diff --git a/Data/Textures/snow.png b/Data/Textures/snow.png index e69de29..4c0f980 100644 Binary files a/Data/Textures/snow.png and b/Data/Textures/snow.png differ diff --git a/Data/Textures/snowflake.png b/Data/Textures/snowflake.png index e69de29..b9b18d3 100644 Binary files a/Data/Textures/snowflake.png and b/Data/Textures/snowflake.png differ diff --git a/Data/Textures/snowtree.png b/Data/Textures/snowtree.png index e69de29..229df6e 100644 Binary files a/Data/Textures/snowtree.png and b/Data/Textures/snowtree.png differ diff --git a/Data/Textures/splinter.png b/Data/Textures/splinter.png index e69de29..645acbd 100644 Binary files a/Data/Textures/splinter.png and b/Data/Textures/splinter.png differ diff --git a/Data/Textures/tooth.png b/Data/Textures/tooth.png index e69de29..21ad87a 100644 Binary files a/Data/Textures/tooth.png and b/Data/Textures/tooth.png differ diff --git a/Data/Textures/tree.png b/Data/Textures/tree.png index e69de29..bf3725d 100644 Binary files a/Data/Textures/tree.png and b/Data/Textures/tree.png differ diff --git a/Data/Users b/Data/Users index e69de29..94ed689 100644 Binary files a/Data/Users and b/Data/Users differ diff --git a/Data/config.txt b/Data/config.txt index e69de29..f613b60 100644 --- a/Data/config.txt +++ b/Data/config.txt @@ -0,0 +1,72 @@ +Screenwidth: +1024 +Screenheight: +768 +Mouse sensitivity: +1 +Blur(0,1): +0 +Overall Detail(0,1,2) higher=better: +2 +Floating jump: +0 +Mouse jump: +0 +Ambient sound: +1 +Blood (0,1,2): +1 +Auto slomo: +1 +Foliage: +1 +Music: +1 +Trilinear: +1 +Decals(shadows,blood puddles,etc): +1 +Invert mouse: +0 +Gamespeed: +1 +Difficulty(0,1,2) higher=harder: +2 +Damage effects(blackout, doublevision): +1 +Text: +1 +Debug: +0 +VBL Sync: +0 +Show Points: +0 +Always Blur: +0 +Immediate mode (turn on on G5): +0 +Velocity blur: +1 +Volume: +0.8 +Forward key: +w +Back key: +s +Left key: +a +Right key: +d +Jump key: +space +Crouch key: +shift +Draw key: +e +Throw key: +q +Attack key: +mouse1 +Chat key: +unknown \ No newline at end of file diff --git a/Lugaru.sln b/Lugaru.sln deleted file mode 100644 index cd2144e..0000000 --- a/Lugaru.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lugaru", "Lugaru.vcproj", "{71D87E45-76A7-497F-9176-DA2600007A65}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {71D87E45-76A7-497F-9176-DA2600007A65}.Debug.ActiveCfg = Debug|Win32 - {71D87E45-76A7-497F-9176-DA2600007A65}.Debug.Build.0 = Debug|Win32 - {71D87E45-76A7-497F-9176-DA2600007A65}.Release.ActiveCfg = Release|Win32 - {71D87E45-76A7-497F-9176-DA2600007A65}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Lugaru.vcproj b/Lugaru.vcproj deleted file mode 100644 index 7661834..0000000 --- a/Lugaru.vcproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt new file mode 100644 index 0000000..b2ffe3f --- /dev/null +++ b/Source/CMakeLists.txt @@ -0,0 +1,157 @@ +set(LUGARU_SRCS + Frustum.cpp + GameDraw.cpp + GameInitDispose.cpp + GameTick.cpp + Globals.cpp + Lights.cpp + Models.cpp + Objects.cpp + OpenGL_Full_Screen.cpp + OpenGL_Windows.cpp + Person.cpp + Quaternions.cpp + Random.c + Skeleton.cpp + Skybox.cpp + Sprites.cpp + TGALoader.cpp + Terrain.cpp + Text.cpp + Weapons.cpp + WinInput.cpp + mmgr.cpp + nsp_network.c + openal_wrapper.cpp + pack.c + pack_private.c + private.c + unpack.c + unpack_private.c) + +set(LUGARU_SRCS + Frustum.cpp + GameDraw.cpp + GameInitDispose.cpp + GameTick.cpp + Globals.cpp + Lights.cpp + Models.cpp + Objects.cpp + pack.c + pack_private.c + Person.cpp + private.c + Quaternions.cpp + Random.c + Skeleton.cpp + Skybox.cpp + Sprites.cpp + Terrain.cpp + Text.cpp + TGALoader.cpp + unpack.c + unpack_private.c + Weapons.cpp + MacCompatibility.cpp + logger/logger.cpp + OpenGL_Windows.cpp + openal_wrapper.cpp + WinInput.cpp) + +set(LUGARU_H + Constants.h + Frustum.h + Game.h + Lights.h + LinkedList.h + MacCompatibility.h + MacInput.h + Models.h + MoreFilesX.h + Objects.h + Person.h + PhysicsMath.h + Pointer.h + Quaternions.h + Random.h + Skeleton.h + Skybox.h + Sprites.h + TGALoader.h + Terrain.h + Text.h + Weapons.h + WinInput.h + alstubs.h + binio.h + fmod.h + fmod_errors.h + fmod_header.h + fmoddyn.h + gamegl.h + glstubs.h + md5.h + mmgr.h + nommgr.h + pack_private.h + private.h + unpack_private.h + wincompat.h) + +if(CMAKE_HOST_APPLE) + set(LUGARU_SRCS + ${LUGARU_SRCS} + MacCompatibility.cpp + MoreFilesX.c + MacInput.cpp) + set(LUGARU_H + ${LUGARU_H} + "Carbon Include.h" + CarbonStdCLib.h) +endif(CMAKE_HOST_APPLE) + +if(WIN32) + if(CMAKE_CROSSCOMPILING) + ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + COMMAND i686-pc-mingw32-windres + -I${CMAKE_CURRENT_SOURCE_DIR}/res + -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + -i${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc + ) + endif(CMAKE_CROSSCOMPILING) + if(NOT CMAKE_CROSSCOMPILING) + ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + COMMAND windres + -I${CMAKE_CURRENT_SOURCE_DIR}/res + -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + -i${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/lugaru.rc + ) + endif(NOT CMAKE_CROSSCOMPILING) + + set(LUGARU_SRCS + ${LUGARU_SRCS} + WinDefs.cpp) + + set(LUGARU_H + ${LUGARU_H} + WinDefs.h + res/lugaru.h) +endif(WIN32) + +if(WIN32) +add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj) +else(WIN32) +add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) +endif(WIN32) + +target_link_libraries(lugaru ${LUGARU_LIBS}) + +if(WIN32) + add_definitions(-DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=) +else(WIN32) + add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=) +endif(WIN32) + diff --git a/Source/Game.h b/Source/Game.h index 79f2abc..cbd7090 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -10,7 +10,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -51,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Terrain.h" #include "Skybox.h" #include "Skeleton.h" -#include "Models.h" +#include "Models.h" #include "Lights.h" #include "Person.h" #include "Constants.h" @@ -68,7 +68,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern GLuint rabbittexture; -class Game +class Game { public: @@ -279,7 +279,7 @@ public: int musicselected; int change; Game(); - ~Game() { + ~Game() { for(int i=0;i<10;i++){ if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] ); } diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index c817285..1275a45 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -1092,10 +1092,10 @@ int Game::DrawGLScene(void) if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound; if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; - PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE); + PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], FALSE); + FSOUND_SetPaused(channels[whichsoundplay], false); } } } diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 00190a9..118a7b5 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -10,7 +10,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "Game.h" +#include "Game.h" extern float screenwidth,screenheight; extern float viewdistance; extern XYZ viewer; @@ -112,7 +112,7 @@ extern int accountcampaignchoices[10][5000]; extern FSOUND_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); Game::TextureList Game::textures; @@ -226,69 +226,69 @@ void Game::LoadSounds() FSOUND_3D_SetDopplerFactor(0); FSOUND_SetSFXMasterVolume((int)(volume*255)); - + samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); samp[landsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f); samp[jumpsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:jump.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f); samp[hawksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:hawk.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f); samp[whooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:whoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f); FSOUND_Sample_SetMode(samp[whooshsound], FSOUND_LOOP_NORMAL); samp[landsound1] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f); samp[landsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f); samp[breaksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:broken.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f); samp[lowwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Lowwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f); samp[midwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:midwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f); samp[highwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:highwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f); samp[movewhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:movewhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f); samp[heavyimpactsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:heavyimpact.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f); samp[whooshhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Whooshhit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f); samp[thudsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:thud.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f); samp[alarmsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:alarm.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f); samp[breaksound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:break.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f); samp[knifedrawsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifedraw.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} FSOUND_Sample_SetMinMaxDistance(samp[knifedrawsound], 8.0f, 2000.0f); @@ -318,7 +318,7 @@ void Game::LoadSounds() FSOUND_Sample_SetMinMaxDistance(samp[snowskidsound], 8.0f, 2000.0f); samp[bushrustle] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bushrustle.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f); samp[clank1sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} FSOUND_Sample_SetMinMaxDistance(samp[clank1sound], 8.0f, 2000.0f); @@ -333,10 +333,10 @@ void Game::LoadSounds() FSOUND_Sample_SetMinMaxDistance(samp[clank4sound], 8.0f, 2000.0f); samp[consolesuccesssound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolesuccess.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f); samp[consolefailsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolefail.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f); samp[metalhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:MetalHit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} FSOUND_Sample_SetMinMaxDistance(samp[metalhitsound], 8.0f, 2000.0f); @@ -426,7 +426,7 @@ void Game::LoadTexture(char *fileName, GLuint *textureid,int mipmap, bool hasalp unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image - upload_image( fileNamep ,hasalpha); + upload_image( fileNamep ,hasalpha); // std::string fname(fileName); // std::transform(fname.begin(), fname.end(), tolower); @@ -482,8 +482,8 @@ void Game::LoadTextureSave(char *fileName, GLuint *textureid,int mipmap,GLubyte unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image - upload_image( fileNamep ,0); - //LoadTGA( fileName ); + upload_image( fileNamep ,0); + //LoadTGA( fileName ); // std::string fname(fileName); // std::transform(fname.begin(), fname.end(), tolower); @@ -544,13 +544,13 @@ void Game::LoadSave(char *fileName, GLuint *textureid,bool mipmap,GLubyte *array //Load Image float temptexdetail=texdetail; texdetail=1; - //upload_image( fileName ); - //LoadTGA( fileName ); + //upload_image( fileName ); + //LoadTGA( fileName ); //Load Image unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image - upload_image( fileNamep ,0); + upload_image( fileNamep ,0); texdetail=temptexdetail; //Is it valid? @@ -574,14 +574,14 @@ bool Game::AddClothes(char *fileName, GLuint *textureid,bool mipmap,GLubyte *arr LOGFUNC; - //upload_image( fileName ); - //LoadTGA( fileName ); + //upload_image( fileName ); + //LoadTGA( fileName ); //Load Image unsigned char fileNamep[256]; CopyCStringToPascal(fileName,fileNamep); //Load Image bool opened; - opened=upload_image( fileNamep ,1); + opened=upload_image( fileNamep ,1); float alphanum; //Is it valid? @@ -631,11 +631,11 @@ GLvoid Game::ReSizeGLScene(float fov, float pnear) gluPerspective(fov,(GLfloat)screenwidth/(GLfloat)screenheight,pnear,viewdistance); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } -void Game::LoadingScreen() +void Game::LoadingScreen() { static float loadprogress,minprogress,maxprogress; static AbsoluteTime time = {0,0}; @@ -702,13 +702,13 @@ void Game::LoadingScreen() //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(.1-loadprogress/100,0+loadprogress/100+.3); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3); glVertex3f(1, 1, 0.0f); glTexCoord2f(.1-loadprogress/100,1+loadprogress/100+.3); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glEnable(GL_BLEND); @@ -716,13 +716,13 @@ void Game::LoadingScreen() //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(.4+loadprogress/100,0+loadprogress/100); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(.4+loadprogress/100,0+loadprogress/100); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(.4+loadprogress/100,1+loadprogress/100); glVertex3f(1, 1, 0.0f); glTexCoord2f(.4+loadprogress/100,1+loadprogress/100); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); @@ -765,13 +765,13 @@ void Game::LoadingScreen() //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0+.5,0+.5); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(1+.5,0+.5); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(1+.5,1+.5); glVertex3f(1, 1, 0.0f); glTexCoord2f(0+.5,1+.5); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); @@ -806,13 +806,13 @@ void Game::LoadingScreen() //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0+.2,0+.8); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(1+.2,0+.8); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(1+.2,1+.8); glVertex3f(1, 1, 0.0f); glTexCoord2f(0+.2,1+.8); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); @@ -856,10 +856,10 @@ void Game::LoadingScreen() glEnable(GL_BLEND); glColor4f(flashr,flashg,flashb,flashamount); glBegin(GL_QUADS); - glVertex3f(0, 0, 0.0f); - glVertex3f(256, 0, 0.0f); + glVertex3f(0, 0, 0.0f); + glVertex3f(256, 0, 0.0f); glVertex3f(256, 256, 0.0f); - glVertex3f(0, 256, 0.0f); + glVertex3f(0, 256, 0.0f); glEnd(); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix @@ -869,14 +869,14 @@ void Game::LoadingScreen() glEnable(GL_CULL_FACE); glDisable(GL_BLEND); glDepthMask(1); - } + } swap_gl_buffers(); loadscreencolor=0; } } -void Game::FadeLoadingScreen(float howmuch) +void Game::FadeLoadingScreen(float howmuch) { static float loadprogress,minprogress,maxprogress; @@ -924,13 +924,13 @@ void Game::FadeLoadingScreen(float howmuch) //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glDisable(GL_TEXTURE_2D); @@ -955,7 +955,7 @@ void Game::FadeLoadingScreen(float howmuch) } -void Game::InitGame() +void Game::InitGame() { #if PLATFORM_MACOSX ProcessSerialNumber PSN; @@ -1234,7 +1234,7 @@ void Game::InitGame() output = FSOUND_OUTPUT_NOSOUND; FSOUND_SetOutput(output); - if ((rc = FSOUND_Init(44100, 32, 0)) == FALSE) + if ((rc = FSOUND_Init(44100, 32, 0)) == false) { // if we tried ALSA and failed, fall back to OSS. if ( (output == FSOUND_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) @@ -1246,7 +1246,7 @@ void Game::InitGame() } } - if (rc == FALSE) + if (rc == false) { FSOUND_Close(); output = FSOUND_OUTPUT_NOSOUND; // we tried! just do silence. @@ -1260,13 +1260,13 @@ void Game::InitGame() FSOUND_SetSFXMasterVolume((int)(volume*255)); strm[stream_music3] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music3.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_music3], FSOUND_LOOP_NORMAL); if(musictoggle){ -// PlaySoundEx( stream_music3, strm[stream_music3], NULL, TRUE); - PlayStreamEx(stream_music3, strm[stream_music3], 0, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); +// PlaySoundEx( stream_music3, strm[stream_music3], NULL, true); + PlayStreamEx(stream_music3, strm[stream_music3], 0, true); + FSOUND_SetPaused(channels[stream_music3], false); FSOUND_SetVolume(channels[stream_music3], 256); } @@ -1274,48 +1274,48 @@ void Game::InitGame() if(ambientsound){ strm[stream_wind] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:wind.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_wind], FSOUND_LOOP_NORMAL); FadeLoadingScreen(30); strm[stream_desertambient] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:desertambient.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_desertambient], FSOUND_LOOP_NORMAL); } FadeLoadingScreen(40); samp[firestartsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:firestart.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); strm[stream_firesound] = FSOUND_Stream_Open(":Data:Sounds:fire.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f); FSOUND_Stream_SetMode(strm[stream_firesound], FSOUND_LOOP_NORMAL); FadeLoadingScreen(50); samp[fireendsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:fireend.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); //if(musictoggle){ strm[stream_music1grass] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1grass.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_music1grass], FSOUND_LOOP_NORMAL); strm[stream_music1snow] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1snow.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_music1snow], FSOUND_LOOP_NORMAL); FadeLoadingScreen(60); strm[stream_music1desert] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1desert.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_music1desert], FSOUND_LOOP_NORMAL); FadeLoadingScreen(80); strm[stream_music2] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music2.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f); +// FSOUND_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f); FSOUND_Stream_SetMode(strm[stream_music2], FSOUND_LOOP_NORMAL); //} @@ -1358,17 +1358,17 @@ void Game::InitGame() newscreenwidth=screenwidth; newscreenheight=screenheight; - - + + /* float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -1379,11 +1379,11 @@ void Game::InitGame() } -void Game::LoadStuff() +void Game::LoadStuff() { static float temptexdetail; static float viewdistdetail; - static int i,j,texsize; + static int i,j,texsize; float megascale =1; LOGFUNC; @@ -1391,8 +1391,8 @@ void Game::LoadStuff() visibleloading=1; /*musicvolume[3]=512; - PlaySoundEx( music4, samp[music4], NULL, TRUE); - FSOUND_SetPaused(channels[music4], FALSE); + PlaySoundEx( music4, samp[music4], NULL, true); + FSOUND_SetPaused(channels[music4], false); FSOUND_SetVolume(channels[music4], 512); */ loadtime=0; @@ -1424,7 +1424,7 @@ void Game::LoadStuff() text.BuildFont(); texdetail=temptexdetail; - numsounds=71; + numsounds=71; viewdistdetail=2; viewdistance=50*megascale*viewdistdetail; @@ -1762,7 +1762,7 @@ void Game::LoadStuff() for(i=0;i Tick() <*****/ extern FSOUND_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern void ScreenShot(const char * fname); @@ -239,14 +239,14 @@ void Screenshot (void) mkdir("Screenshots", S_IRWXU); ScreenShot(temp/*"Screenshots\\Screenshot.png"*/); - /*FSSpec MAC_file; - GraphicsExportComponent QT_exporter; + /*FSSpec MAC_file; + GraphicsExportComponent QT_exporter; OSErr MAC_error_code; CGrafPtr MAC_currentPort; GDHandle MAC_currentDevice; unsigned char* MAC_pixels; Rect MAC_picture_rectangle; - GWorldPtr MAC_offscreen_graphics_port; + GWorldPtr MAC_offscreen_graphics_port; static int numscreenshots=0; @@ -307,7 +307,7 @@ void Screenshot (void) // Get the GWorld - GWorldPtr MAC_gWorld = (CGrafPtr) FrontWindow(); + GWorldPtr MAC_gWorld = (CGrafPtr) FrontWindow(); //assert(MAC_gWorld != NULL); // Allocate memory for loading image @@ -318,18 +318,18 @@ void Screenshot (void) } // Get GWorld - ::GetGWorld(&MAC_currentPort, &MAC_currentDevice); + ::GetGWorld(&MAC_currentPort, &MAC_currentDevice); // Make a picture Rectangle MAC_picture_rectangle.left = 0; MAC_picture_rectangle.right = screenwidth; MAC_picture_rectangle.top = 0; - MAC_picture_rectangle.bottom = screenheight; + MAC_picture_rectangle.bottom = screenheight; // Create new offscreen GWorld MAC_error_code = ::QTNewGWorldFromPtr (&MAC_offscreen_graphics_port, k32ARGBPixelFormat, &MAC_picture_rectangle, NULL, NULL, 0, (char *) MAC_pixels, screenwidth * 4); if (MAC_error_code) { - ::SetGWorld(MAC_currentPort, MAC_currentDevice); + ::SetGWorld(MAC_currentPort, MAC_currentDevice); delete MAC_pixels; //UTIL_Error("Could not create offscreen GWorld. "); return; @@ -337,7 +337,7 @@ void Screenshot (void) } // Copy OpenGL Context to new GWorld - glReadBuffer(GL_FRONT); + glReadBuffer(GL_FRONT); glReadPixels(0,0,screenwidth,screenheight,GL_RGBA,GL_UNSIGNED_BYTE,MAC_pixels); // Swizzle texture @@ -355,7 +355,7 @@ void Screenshot (void) int dst_index; unsigned char temp; for (int horz = 0; horz < screenwidth; ++horz) - for (vert = 0; vert < screenheight / 2; ++vert) { + for (vert = 0; vert < screenheight / 2; ++vert) { src_index = (screenwidth * vert + horz) * 4; dst_index = (screenwidth * (screenheight - vert - 1) + horz) * 4; @@ -381,12 +381,12 @@ void Screenshot (void) // Export the Gworld MAC_error_code = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypeBMP, &QT_exporter); if (MAC_error_code) { - //UTIL_Warning("Unable to export screenshot."); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); + //UTIL_Warning("Unable to export screenshot."); + ::SetGWorld(MAC_currentPort, MAC_currentDevice); ::DisposeGWorld(MAC_offscreen_graphics_port); delete MAC_pixels; return; - } + } MAC_error_code = GraphicsExportSetInputGWorld(QT_exporter,MAC_offscreen_graphics_port); if (MAC_error_code) { @@ -396,27 +396,27 @@ void Screenshot (void) delete MAC_pixels; //UTIL_Warning("Unable to export screenshot."); return; - } + } MAC_error_code = GraphicsExportSetOutputFile(QT_exporter,&MAC_file); if (MAC_error_code) { ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); + ::SetGWorld(MAC_currentPort, MAC_currentDevice); ::DisposeGWorld(MAC_offscreen_graphics_port); delete MAC_pixels; //UTIL_Warning("Unable to export screenshot."); return; - } + } MAC_error_code = GraphicsExportDoExport(QT_exporter,NULL); if (MAC_error_code) { ::CloseComponent(QT_exporter); - ::SetGWorld(MAC_currentPort, MAC_currentDevice); + ::SetGWorld(MAC_currentPort, MAC_currentDevice); ::DisposeGWorld(MAC_offscreen_graphics_port); delete MAC_pixels; //UTIL_Warning("Unable to export screenshot."); return; - } + } ::CloseComponent(QT_exporter); ::SetGWorld(MAC_currentPort, MAC_currentDevice); @@ -427,14 +427,14 @@ void Screenshot (void) -void Game::SetUpLighting(){ +void Game::SetUpLighting(){ if(environment==snowyenvironment){ light.color[0]=.65; light.color[1]=.65; light.color[2]=.7; light.ambient[0]=.4; light.ambient[1]=.4; - light.ambient[2]=.44; + light.ambient[2]=.44; } if(environment==desertenvironment){ light.color[0]=.95; @@ -442,7 +442,7 @@ void Game::SetUpLighting(){ light.color[2]=.95; light.ambient[0]=.4; light.ambient[1]=.35; - light.ambient[2]=.3; + light.ambient[2]=.3; } if(environment==grassyenvironment){ @@ -451,7 +451,7 @@ void Game::SetUpLighting(){ light.color[2]=1; light.ambient[0]=.4; light.ambient[1]=.4; - light.ambient[2]=.44; + light.ambient[2]=.44; } if(!skyboxtexture){ light.color[0]=1; @@ -459,7 +459,7 @@ void Game::SetUpLighting(){ light.color[2]=1; light.ambient[0]=.4; light.ambient[1]=.4; - light.ambient[2]=.4; + light.ambient[2]=.4; } float average; average=(skyboxlightr+skyboxlightg+skyboxlightb)/3; @@ -468,7 +468,7 @@ void Game::SetUpLighting(){ light.color[2]*=(skyboxlightb+average)/2; light.ambient[0]=light.ambient[0]*(skyboxlightr+average)/2*1; light.ambient[1]=light.ambient[1]*(skyboxlightg+average)/2*1; - light.ambient[2]=light.ambient[2]*(skyboxlightb+average)/2*1; + light.ambient[2]=light.ambient[2]*(skyboxlightb+average)/2*1; /* light.ambient[0]=0; light.ambient[1]=0; @@ -555,7 +555,7 @@ int Game::checkcollide(XYZ startpoint,XYZ endpoint){ if(objects.type[i]!=treeleavestype&&objects.type[i]!=bushtype&&objects.type[i]!=firetype){ colviewer=startpoint; coltarget=endpoint; - if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)return i; + if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)return i; } } } @@ -601,7 +601,7 @@ int Game::checkcollide(XYZ startpoint,XYZ endpoint,int what){ if(objects.type[what]!=treeleavestype&&objects.type[what]!=bushtype&&objects.type[what]!=firetype){ colviewer=startpoint; coltarget=endpoint; - if(objects.model[what].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[what],&objects.rotation[what])!=-1)return i; + if(objects.model[what].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[what],&objects.rotation[what])!=-1)return i; } } } @@ -611,7 +611,7 @@ int Game::checkcollide(XYZ startpoint,XYZ endpoint,int what){ return -1; } -void Game::Setenvironment(int which) +void Game::Setenvironment(int which) { LOGFUNC; @@ -620,26 +620,26 @@ void Game::Setenvironment(int which) float temptexdetail; environment=which; /* - FSOUND_SetPaused(channels[music1snow], TRUE); - FSOUND_SetPaused(channels[music1grass], TRUE); - FSOUND_SetPaused(channels[music1desert], TRUE); - FSOUND_SetPaused(channels[wind], TRUE); - FSOUND_SetPaused(channels[desertambient], TRUE); + FSOUND_SetPaused(channels[music1snow], true); + FSOUND_SetPaused(channels[music1grass], true); + FSOUND_SetPaused(channels[music1desert], true); + FSOUND_SetPaused(channels[wind], true); + FSOUND_SetPaused(channels[desertambient], true); */ - FSOUND_SetPaused(channels[stream_music1snow], TRUE); - FSOUND_SetPaused(channels[stream_music1grass], TRUE); - FSOUND_SetPaused(channels[stream_music1desert], TRUE); - FSOUND_SetPaused(channels[stream_wind], TRUE); - FSOUND_SetPaused(channels[stream_desertambient], TRUE); + FSOUND_SetPaused(channels[stream_music1snow], true); + FSOUND_SetPaused(channels[stream_music1grass], true); + FSOUND_SetPaused(channels[stream_music1desert], true); + FSOUND_SetPaused(channels[stream_wind], true); + FSOUND_SetPaused(channels[stream_desertambient], true); if(environment==snowyenvironment){ windvector=0; windvector.z=3; if(ambientsound){ - //PlaySoundEx( wind, samp[wind], NULL, TRUE); - PlayStreamEx(stream_wind, strm[stream_wind], 0, TRUE); - FSOUND_SetPaused(channels[stream_wind], FALSE); + //PlaySoundEx( wind, samp[wind], NULL, true); + PlayStreamEx(stream_wind, strm[stream_wind], 0, true); + FSOUND_SetPaused(channels[stream_wind], false); FSOUND_SetVolume(channels[stream_wind], 256); } @@ -656,10 +656,10 @@ void Game::Setenvironment(int which) samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:snow.jpg",&terraintexture,1,0); @@ -696,9 +696,9 @@ void Game::Setenvironment(int which) if(ambientsound){ - //PlaySoundEx( desertambient, samp[desertambient], NULL, TRUE); - PlayStreamEx( stream_desertambient, strm[stream_desertambient], NULL, TRUE); - FSOUND_SetPaused(channels[stream_desertambient], FALSE); + //PlaySoundEx( desertambient, samp[desertambient], NULL, true); + PlayStreamEx( stream_desertambient, strm[stream_desertambient], NULL, true); + FSOUND_SetPaused(channels[stream_desertambient], false); FSOUND_SetVolume(channels[stream_desertambient], 256); } @@ -710,10 +710,10 @@ void Game::Setenvironment(int which) samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:sand.jpg",&terraintexture,1,0); @@ -748,8 +748,8 @@ void Game::Setenvironment(int which) LoadTexture(":Data:Textures:grassbox.jpg",&objects.boxtextureptr,1,0); if(ambientsound){ - PlayStreamEx( stream_wind, strm[stream_wind], NULL, TRUE); - FSOUND_SetPaused(channels[stream_wind], FALSE); + PlayStreamEx( stream_wind, strm[stream_wind], NULL, true); + FSOUND_SetPaused(channels[stream_wind], false); FSOUND_SetVolume(channels[stream_wind], 100); } @@ -761,10 +761,10 @@ void Game::Setenvironment(int which) samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepgrass2.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); + FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:grassdirt.jpg",&terraintexture,1,0); @@ -797,7 +797,7 @@ void Game::Setenvironment(int which) } -void Game::Loadlevel(int which){ +void Game::Loadlevel(int which){ stealthloading=0; if(which==0)Loadlevel((char *)":Data:Maps:map1"); @@ -827,9 +827,9 @@ char temp[50]; char temp2[100]; strcpy(temp2,(const char *)string); -strcat((char *)temp2,(const char *)"Lugaru"); +strcat((char *)temp2,(const char *)"Lugaru"); sprintf (temp, "%d",strlen((char *)temp2)); -strcat((char *)temp2,temp); +strcat((char *)temp2,temp); MD5 context; unsigned int len = strlen ( (char *)temp2); @@ -842,7 +842,7 @@ return context.hex_digest(); -void Game::Loadlevel(char *name){ +void Game::Loadlevel(char *name){ int i,j,k,l,m; static int oldlevel; int templength; @@ -876,15 +876,15 @@ void Game::Loadlevel(char *name){ if(!firstload){ oldlevel=50; } - FSOUND_SetPaused(channels[whooshsound], TRUE); - FSOUND_SetPaused(channels[stream_firesound], TRUE); + FSOUND_SetPaused(channels[whooshsound], true); + FSOUND_SetPaused(channels[stream_firesound], true); int mapvers; FILE *tfile; tfile=fopen( name, "rb" ); if(tfile) { - FSOUND_SetPaused(channels[stream_firesound], TRUE); + FSOUND_SetPaused(channels[stream_firesound], true); scoreadded=0; @@ -955,9 +955,9 @@ void Game::Loadlevel(char *name){ changedelay=0; if(console) { - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); freeze=0; console=0; } @@ -1108,7 +1108,7 @@ void Game::Loadlevel(char *name){ for(m=0;m20) + //if(i<16||i>20) FSOUND_StopSound(i); } */ @@ -1612,8 +1612,8 @@ void Game::Loadlevel(char *name){ { if(ambientsound) { - PlayStreamEx(stream_wind, strm[stream_wind], NULL, TRUE); - FSOUND_SetPaused(channels[stream_wind], FALSE); + PlayStreamEx(stream_wind, strm[stream_wind], NULL, true); + FSOUND_SetPaused(channels[stream_wind], false); FSOUND_SetVolume(channels[stream_wind], 256); } } @@ -1622,10 +1622,10 @@ void Game::Loadlevel(char *name){ if(ambientsound) { //PlaySoundEx(desertambient, - // samp[desertambient], NULL, TRUE); + // samp[desertambient], NULL, true); PlayStreamEx(stream_desertambient, - strm[stream_desertambient], NULL, TRUE); - FSOUND_SetPaused(channels[stream_desertambient], FALSE); + strm[stream_desertambient], NULL, true); + FSOUND_SetPaused(channels[stream_desertambient], false); FSOUND_SetVolume(channels[stream_desertambient], 256); } } @@ -1633,9 +1633,9 @@ void Game::Loadlevel(char *name){ { if(ambientsound) { - //PlaySoundEx(wind, samp[wind], NULL, TRUE); - PlayStreamEx(stream_wind, strm[stream_wind], NULL, TRUE); - FSOUND_SetPaused(channels[stream_wind], FALSE); + //PlaySoundEx(wind, samp[wind], NULL, true); + PlayStreamEx(stream_wind, strm[stream_wind], NULL, true); + FSOUND_SetPaused(channels[stream_wind], false); FSOUND_SetVolume(channels[stream_wind], 100); } } @@ -1665,7 +1665,7 @@ void Game::Loadlevel(char *name){ visibleloading=0; } -void Game::Tick() +void Game::Tick() { static int i,k,j,l,m; static XYZ facing,flatfacing,absflatfacing; @@ -1687,9 +1687,9 @@ void Game::Tick() if(newnetmessages){ newnetmessages=0; - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); for(k=14;k>=2;k--){ for(j=0;j<255;j++){ @@ -1750,12 +1750,12 @@ void Game::Tick() if(!stealthloading){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -1828,7 +1828,7 @@ void Game::Tick() campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[music3], TRUE); + FSOUND_SetPaused(channels[music3], true); stealthloading=0;*/ } @@ -1836,26 +1836,26 @@ void Game::Tick() if(mainmenu&&musictoggle){ if(mainmenu==1||mainmenu==2||mainmenu==100){ FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); FSOUND_SetVolume(channels[stream_music3], 256); - FSOUND_SetPaused(channels[music1], TRUE); + FSOUND_SetPaused(channels[music1], true); } } if(!mainmenu){ - FSOUND_SetPaused(channels[stream_music3], TRUE); - FSOUND_SetPaused(channels[music1], FALSE); + FSOUND_SetPaused(channels[stream_music3], true); + FSOUND_SetPaused(channels[music1], false); } } if(mainmenu==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -1947,23 +1947,23 @@ void Game::Tick() opstream << "\nChat key:\n"; opstream << KeyToChar(chatkey); opstream.close(); - } + } if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==10||mainmenu==11||mainmenu==100){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; flashb=0; flashamount=1; flashdelay=1; - } + } if(mainmenu==3&&gameon)mainmenu=2; if(mainmenu==3&&!gameon)mainmenu=1; if(mainmenu==5&&gameon)mainmenu=2; @@ -2003,9 +2003,9 @@ void Game::Tick() if(IsKeyDown(theKeyMap, MAC_TAB_KEY)&&!minimaptogglekeydown&&tutoriallevel){ if(tutorialstage!=51) tutorialstagetime=tutorialmaxtime; - PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, TRUE); + PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true); FSOUND_SetVolume(channels[consolefailsound], 128); - FSOUND_SetPaused(channels[consolefailsound], FALSE); + FSOUND_SetPaused(channels[consolefailsound], false); minimaptogglekeydown=1; } if(!IsKeyDown(theKeyMap, MAC_TAB_KEY)){ @@ -2019,12 +2019,12 @@ void Game::Tick() if(!gameon){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2047,26 +2047,26 @@ void Game::Tick() } mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[music3], TRUE); */ + FSOUND_SetPaused(channels[music3], true); */ } else { //resume mainmenu=0; - FSOUND_SetPaused(channels[stream_music3], TRUE); - FSOUND_SetPaused(channels[music1], FALSE); + FSOUND_SetPaused(channels[stream_music3], true); + FSOUND_SetPaused(channels[music1], false); } } if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2076,25 +2076,25 @@ void Game::Tick() //options - mainmenu=3; + mainmenu=3; if(newdetail>2)newdetail=detail; if(newdetail<0)newdetail=detail; if(newscreenwidth>3000)newscreenwidth=screenwidth; if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight>3000)newscreenheight=screenheight; - if(newscreenheight<0)newscreenheight=screenheight; + if(newscreenheight<0)newscreenheight=screenheight; } if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2105,7 +2105,7 @@ void Game::Tick() if(!gameon){ //quit tryquit=1; - if(registered)FSOUND_SetPaused(channels[stream_music3], TRUE); + if(registered)FSOUND_SetPaused(channels[stream_music3], true); } else{ //end game @@ -2121,12 +2121,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==0){ #if USE_SDL @@ -2247,9 +2247,9 @@ void Game::Tick() musictoggle=1-musictoggle; if(!musictoggle){ - FSOUND_SetPaused(channels[music1], TRUE); - FSOUND_SetPaused(channels[stream_music2], TRUE); - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[music1], true); + FSOUND_SetPaused(channels[stream_music2], true); + FSOUND_SetPaused(channels[stream_music3], true); for(i=0;i<4;i++){ oldmusicvolume[i]=0; @@ -2258,9 +2258,9 @@ void Game::Tick() } if(musictoggle){ - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); - FSOUND_SetVolume(channels[stream_music3], 256); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); + FSOUND_SetVolume(channels[stream_music3], 256); } } if(Button()&&!oldbutton&&selected==9){ @@ -2278,12 +2278,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==7){ /*float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); */ flashr=1; flashg=0; @@ -2293,18 +2293,18 @@ void Game::Tick() //options - mainmenu=4; + mainmenu=4; keyselect=-1; } if(Button()&&!oldbutton&&selected==8){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2408,12 +2408,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1&&keyselect==-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected<9&&keyselect==-1){ keyselect=selected; @@ -2429,12 +2429,12 @@ void Game::Tick() if(i!=MAC_ESCAPE_KEY&&(strcmp(KeyToChar(i),"unknown")||(buttons[0]&&!oldbuttons[0]&&!oldbutton)||(buttons[1]&&!oldbuttons[1]&&!oldbutton))){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); int keynum; keynum=i; @@ -2459,12 +2459,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==9){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2485,9 +2485,9 @@ void Game::Tick() if(mainmenu==5){ if(accountcampaignchoicesmade[accountactive]>8&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); + FSOUND_SetFrequency(FSOUND_ALL, 0.001); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); FSOUND_SetVolume(channels[stream_music3], 256); gameon=0; @@ -2498,12 +2498,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2519,15 +2519,15 @@ void Game::Tick() endgame=0; } - if(Button()&&!oldbutton&&selected==1){ + if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2548,17 +2548,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); } - if(Button()&&!oldbutton&&selected-7>=accountcampaignchoicesmade[accountactive]){//selected>=7&&(selected-7<=campaignnumchoices)){ + if(Button()&&!oldbutton&&selected-7>=accountcampaignchoicesmade[accountactive]){//selected>=7&&(selected-7<=campaignnumchoices)){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2598,17 +2598,17 @@ void Game::Tick() campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==4){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2622,12 +2622,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==5){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2640,12 +2640,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2658,12 +2658,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2677,15 +2677,15 @@ void Game::Tick() else oldbutton=0; } if(mainmenu==9){ - if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ + if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2707,17 +2707,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==numchallengelevels){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2731,15 +2731,15 @@ void Game::Tick() else oldbutton=0; } if(mainmenu==11){ - if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ + if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2761,17 +2761,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==numchallengelevels){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2789,12 +2789,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2812,12 +2812,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2838,12 +2838,12 @@ void Game::Tick() if(tryquit)quit=1; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2859,12 +2859,12 @@ void Game::Tick() quit=1; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2878,12 +2878,12 @@ void Game::Tick() tryquit=0; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2900,22 +2900,22 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2956,12 +2956,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2978,12 +2978,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==0&&numaccounts<8){ entername=1; @@ -3000,12 +3000,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==numaccounts+1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -3029,18 +3029,18 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); if(selected==0)accountdifficulty[accountactive]=0; if(selected==1)accountdifficulty[accountactive]=1; if(selected==2)accountdifficulty[accountactive]=2; - mainmenu=5; + mainmenu=5; flashr=1; flashg=0; @@ -3156,7 +3156,7 @@ void Game::Tick() loaddistrib=0; } } - FSOUND_SetFrequency(channels[stream_music3], 22050); + FSOUND_SetFrequency(channels[stream_music3], 22050); if(entername||mainmenu==13||mainmenu==14){ for(i=0;i<140;i++){ @@ -3228,12 +3228,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3331,12 +3331,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3360,12 +3360,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3405,7 +3405,7 @@ void Game::Tick() } } - if(!mainmenu){ + if(!mainmenu){ if(hostile==1)hostiletime+=multiplier; else hostiletime=0; if(!winfreeze)leveltime+=multiplier; @@ -3581,9 +3581,9 @@ void Game::Tick() archiveselected=0; donesomething=0; if(Compare(consoletext[0],"quit ",0,4)||Compare(consoletext[0],"exit ",0,4)){ - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); donesomething=1; tryquit=1; } @@ -3667,12 +3667,12 @@ void Game::Tick() consoleselected=0; } } - else + else { donesomething=1; - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); if(consolechars[0]>0){ for(k=14;k>=1;k--){ @@ -3729,9 +3729,9 @@ void Game::Tick() else { donesomething=1; - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); if(consolechars[0]>0){ for(k=14;k>=1;k--){ @@ -3768,9 +3768,9 @@ void Game::Tick() } mapname[consolechars[0]-5+11]='\0'; - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); int mapvers; mapvers=12; @@ -3828,7 +3828,7 @@ void Game::Tick() fpackf(tfile, "Bi",templength); for(m=0;m49){ - realdialoguetype=dialoguetype[i]-50; + realdialoguetype=dialoguetype[i]-50; special=1; } else if(dialoguetype[i]>39){ - realdialoguetype=dialoguetype[i]-40; + realdialoguetype=dialoguetype[i]-40; special=1; } else if(dialoguetype[i]>29){ - realdialoguetype=dialoguetype[i]-30; + realdialoguetype=dialoguetype[i]-30; special=1; } else if(dialoguetype[i]>19){ - realdialoguetype=dialoguetype[i]-20; + realdialoguetype=dialoguetype[i]-20; special=1; } else if(dialoguetype[i]>9){ - realdialoguetype=dialoguetype[i]-10; + realdialoguetype=dialoguetype[i]-10; special=1; } else { @@ -5904,10 +5904,10 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound; if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; - PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE); + PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], FALSE); + FSOUND_SetPaused(channels[whichsoundplay], false); } if(IsKeyDown(theKeyMap, attackkey))oldbuttondialogue=1; } @@ -5935,7 +5935,7 @@ void Game::Tick() hotspotsprite+=hotspot[i]; sprites.MakeSprite(breathsprite, hotspotsprite, hotspotsprite*0, 1,0.5,0, 7, 0.4); hotspotvisual[i]+=0.1/hotspotsize[i]/hotspotsize[i]/hotspotsize[i]; - } + } } for(i=0;i=1){ @@ -6472,16 +6472,16 @@ void Game::Tick() if(tutoriallevel!=1){ if(bonustime==0&&bonus!=solidhit&&bonus!=spinecrusher&&bonus!=tracheotomy&&bonus!=backstab&&bonusvalue>10){ - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, TRUE); + PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], FALSE); + FSOUND_SetPaused(channels[consolesuccesssound], false); } } else if(bonustime==0){ - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); + FSOUND_SetPaused(channels[fireendsound], false); } if(bonustime==0){ if(bonus!=solidhit&&bonus!=twoxcombo&&bonus!=threexcombo&&bonus!=fourxcombo&&bonus!=megacombo)bonusnum[bonus]++; @@ -6595,11 +6595,11 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); - if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[movewhooshsound], false); + if(k==0)FSOUND_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6626,11 +6626,11 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); - if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[movewhooshsound], false); + if(k==0)FSOUND_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6657,11 +6657,11 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); - if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[movewhooshsound], false); + if(k==0)FSOUND_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6688,11 +6688,11 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); - if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[movewhooshsound], false); + if(k==0)FSOUND_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6723,11 +6723,11 @@ void Game::Tick() if(player[k].targetanimation==jumpupanim){player[k].jumppower=-4;player[k].targetanimation=player[k].getIdle();} player[k].target=0; - player[k].targetframe=0; + player[k].targetframe=0; player[k].onterrain=1; if(player[k].id==0){ - FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[whooshsound], true); FSOUND_SetVolume(channels[whooshsound], 0); } @@ -6742,10 +6742,10 @@ void Game::Tick() vel[0]=player[k].velocity.x; vel[1]=player[k].velocity.y; vel[2]=player[k].velocity.z; - PlaySoundEx( landsound, samp[landsound], NULL, TRUE); + PlaySoundEx( landsound, samp[landsound], NULL, true); FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], FALSE); + FSOUND_SetPaused(channels[landsound], false); if(k==0){ envsound[numenvsounds]=player[k].coords; envsoundvol[numenvsounds]=16; @@ -6755,7 +6755,7 @@ void Game::Tick() } } - } + } } } if(tempcollide&&terrain.patchobjectnum[player[k].whichpatchx][player[k].whichpatchz]&&(/*player[k].jumptogglekeydown*/1==1||player[k].aitype!=playercontrolled)) @@ -6765,10 +6765,10 @@ void Game::Tick() lowpoint.y+=1.35; if(objects.type[i]!=rocktype) if(player[k].SphereCheck(&lowpoint, 1.33, &colpoint, &objects.position[i], &objects.rotation[i], &objects.model[i])!=-1){ - if(player[k].targetanimation!=jumpupanim&&player[k].targetanimation!=jumpdownanim&&player[k].onterrain)player[k].avoidcollided=1; + if(player[k].targetanimation!=jumpupanim&&player[k].targetanimation!=jumpdownanim&&player[k].onterrain)player[k].avoidcollided=1; player[k].coords=lowpoint; player[k].coords.y-=1.35; - player[k].collide=1; + player[k].collide=1; if((player[k].grabdelay<=0||player[k].aitype!=playercontrolled)&&((/*(player[k].isRun()||player[k].targetanimation==sneakanim||player[k].targetanimation==walkanim)&&*/player[k].currentanimation!=climbanim&&player[k].currentanimation!=hanganim&&!player[k].isWallJump())||player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim)){ lowpoint=player[k].coords; @@ -6841,9 +6841,9 @@ void Game::Tick() player[k].coords.y=lowpointtarget.y-.07; player[k].currentoffset=(flatfacing-player[k].coords)/player[k].scale; - if(j>10||!player[k].isRun()){ + if(j>10||!player[k].isRun()){ if(player[k].targetanimation==jumpdownanim||player[k].targetanimation==jumpupanim){ - if(k==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + if(k==0)FSOUND_SetPaused(channels[whooshsound], true); } float gLoc[3]; float vel[3]; @@ -6853,10 +6853,10 @@ void Game::Tick() vel[0]=player[k].velocity.x; vel[1]=player[k].velocity.y; vel[2]=player[k].velocity.z; - PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE); + PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], FALSE); + FSOUND_SetPaused(channels[jumpsound], false); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6885,7 +6885,7 @@ void Game::Tick() //player[k].currentanimation=hanganim; player[k].targetanimation=hanganim; player[k].jumppower=0; - } + } } j=100; } @@ -6915,10 +6915,10 @@ void Game::Tick() vel[1]=player[k].velocity.y; vel[2]=player[k].velocity.z; if(k==0){ - PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE); + PlaySoundEx( whooshsound, samp[whooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); FSOUND_SetVolume(channels[whooshsound], 128); - FSOUND_SetPaused(channels[whooshsound], FALSE); + FSOUND_SetPaused(channels[whooshsound], false); } } player[k].velocity.y+=gravity; @@ -6959,7 +6959,7 @@ void Game::Tick() static bool endkeydown; if(indialogue!=-1){ cameramode=1; - if(directing){ + if(directing){ facing=0; facing.z=-1; @@ -7045,10 +7045,10 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound; if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; - PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE); + PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], FALSE); + FSOUND_SetPaused(channels[whichsoundplay], false); } } @@ -7085,12 +7085,12 @@ void Game::Tick() cameramode=0; } } - if(!directing){ - FSOUND_SetPaused(channels[whooshsound], TRUE); + if(!directing){ + FSOUND_SetPaused(channels[whooshsound], true); viewer=dialoguecamera[whichdialogue][indialogue]; if(viewer.y0.5) @@ -7137,10 +7137,10 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; if(dialogueboxsound[whichdialogue][indialogue]==-6)whichsoundplay=alarmsound; if(dialogueboxsound[whichdialogue][indialogue]!=-5){ - PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, TRUE); + PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], FALSE); + FSOUND_SetPaused(channels[whichsoundplay], false); } if(dialogueboxsound[whichdialogue][indialogue]==-5){ hotspot[numhotspots]=player[0].coords; @@ -7324,10 +7324,10 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( hawksound, samp[hawksound], NULL, TRUE); + PlaySoundEx( hawksound, samp[hawksound], NULL, true); FSOUND_3D_SetAttributes(channels[hawksound], gLoc, vel); FSOUND_SetVolume(channels[hawksound], 128); - FSOUND_SetPaused(channels[hawksound], FALSE); + FSOUND_SetPaused(channels[hawksound], false); hawkcalldelay=16+abs(Random()%8); } @@ -7397,7 +7397,7 @@ void Game::Tick() for(j=0;j2)drawmode=0; - if(objects.numobjects0&&closest>=0)objects.DeleteObject(closest); + if(closestdist>0&&closest>=0)objects.DeleteObject(closest); drawmodetogglekeydown=1; } @@ -8335,11 +8335,11 @@ void Game::Tick() vel[0]=player[0].velocity.x; vel[1]=player[0].velocity.y; vel[2]=player[0].velocity.z; - PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE); + PlaySoundEx( whooshsound, samp[whooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); FSOUND_SetVolume(channels[whooshsound], 128); - FSOUND_SetPaused(channels[whooshsound], FALSE); - //FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[whooshsound], false); + //FSOUND_SetPaused(channels[whooshsound], true); texturesizetogglekeydown=1; } @@ -8419,7 +8419,7 @@ void Game::Tick() for(i=0;i1) for(i=0;i1000||player[k].isRun()||(hasstaff)||(player[k].weaponactive!=-1&&player[i].skeleton.free&&(player[i].skeleton.longdead>2000||player[i].damage>player[i].damagetolerance/8||player[i].bloodloss>player[i].damagetolerance/2)&&findDistancefast(&player[k].coords,&player[i].coords)<1.5*(player[k].scale*5)*(player[k].scale*5)))){ @@ -8708,7 +8708,7 @@ void Game::Tick() if(player[i].onfire||player[k].onfire){ if(!player[i].onfire)player[i].CatchFire(); if(!player[k].onfire)player[k].CatchFire(); - } + } } tempcoords1=player[i].coords; @@ -8718,7 +8718,7 @@ void Game::Tick() collisionradius=1.2*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5); if(player[0].hasvictim) if(player[0].targetanimation==rabbitkickanim&&(k==0||i==0)&&!player[0].victim->skeleton.free)collisionradius=3; - if((!player[i].skeleton.oldfree||!player[k].skeleton.oldfree)&&(findDistancefast(&tempcoords1,&tempcoords2)1)||(player[k].skeleton.oldfree==1&&findLengthfast(&player[k].velocity)>1)||(player[i].skeleton.oldfree==0&&player[k].skeleton.oldfree==0)){ + if((player[i].skeleton.oldfree==1&&findLengthfast(&player[i].velocity)>1)||(player[k].skeleton.oldfree==1&&findLengthfast(&player[k].velocity)>1)||(player[i].skeleton.oldfree==0&&player[k].skeleton.oldfree==0)){ rotatetarget=player[k].velocity-player[i].velocity; if(((player[i].targetanimation!=getupfrombackanim&&player[i].targetanimation!=getupfromfrontanim)||player[i].skeleton.free)&&((player[k].targetanimation!=getupfrombackanim&&player[k].targetanimation!=getupfromfrontanim)||player[k].skeleton.free)) if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree))){ @@ -8759,10 +8759,10 @@ void Game::Tick() vel[1]=player[i].velocity.y; vel[2]=player[i].velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 256); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } //player[i].velocity=player[k].velocity; //player[k].velocity=player[i].velocity; @@ -8843,7 +8843,7 @@ void Game::Tick() player[k].velocity.y=player[i].velocity.y; player[i].DoDamage(20); player[i].RagDoll(0); - player[k].lastcollide=1; + player[k].lastcollide=1; if(k==0){ bonus=AboveBonus; bonustime=0; @@ -8856,8 +8856,8 @@ void Game::Tick() //player[k].velocity.y-=10; player[i].velocity.y=player[k].velocity.y; player[k].DoDamage(20); - player[k].RagDoll(0); - player[i].lastcollide=1; + player[k].RagDoll(0); + player[i].lastcollide=1; if(i==0){ bonus=AboveBonus; bonustime=0; @@ -9060,7 +9060,7 @@ void Game::Tick() /* if(IsKeyDown(theKeyMap, MAC_Z_KEY)){ //Respawn - FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[whooshsound], true); changedelay=0; for(k=0;kplayer[i].numwaypoints-1)player[i].waypoint=0; } - } + } if(player[i].numwaypoints>1&&player[i].howactive==typeactive&&player[i].pausetime<=0)player[i].forwardkeydown=1; else player[i].forwardkeydown=0; @@ -9406,7 +9406,7 @@ void Game::Tick() else player[i].targetrotation-=90; } } - } + } if(player[i].collided<1||player[i].targetanimation!=jumpupanim)player[i].jumpkeydown=0; if((player[i].collided>.8&&player[i].jumppower>=5))player[i].jumpkeydown=1; @@ -9438,7 +9438,7 @@ void Game::Tick() player[i].howactive=typeactive; } - } + } if(player[i].howactive=0){ if(weapons.owner[player[i].ally]!=-1||findDistancefast(&player[i].coords,&weapons.position[player[i].ally])>16){ @@ -9758,7 +9758,7 @@ void Game::Tick() if(rotatetarget.z<0)player[i].targetrotation=180-player[i].targetrotation; player[i].lookrotation=player[i].targetrotation; player[i].aiupdatedelay=.05; - player[i].forwardkeydown=1; + player[i].forwardkeydown=1; if(player[i].avoidcollided>.8&&!player[i].jumpkeydown&&player[i].collided<.8){ @@ -9796,7 +9796,7 @@ void Game::Tick() player[i].rightkeydown=0; player[i].attackkeydown=0; player[i].throwkeydown=1; - player[i].crouchkeydown=0; + player[i].crouchkeydown=0; if(player[i].targetanimation!=crouchremoveknifeanim&&player[i].targetanimation!=removeknifeanim)player[i].throwtogglekeydown=0; player[i].drawkeydown=0; } @@ -9888,7 +9888,7 @@ void Game::Tick() player[i].lastpathfindpoint2=-1; player[i].lastpathfindpoint3=-1; player[i].lastpathfindpoint4=-1; - } + } if(player[i].aiupdatedelay<0&&!animation[player[i].targetanimation].attack&&player[i].targetanimation!=staggerbackhighanim&&player[i].targetanimation!=staggerbackhardanim&&player[i].targetanimation!=backhandspringanim&&player[i].targetanimation!=dodgebackanim){ if(player[i].weaponactive==-1&&player[i].num_weapons>0)player[i].drawkeydown=Random()%2; else player[i].drawkeydown=0; @@ -10133,10 +10133,10 @@ void Game::Tick() vel[1]=player[i].velocity.y; vel[2]=player[i].velocity.z; if(weapons.type[j]!=staff){ - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } player[i].weaponactive=0; @@ -10180,10 +10180,10 @@ void Game::Tick() vel[1]=player[i].velocity.y; vel[2]=player[i].velocity.z; if(weapons.type[k]!=staff){ - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } player[i].weaponactive=0; @@ -10241,17 +10241,17 @@ void Game::Tick() } if(!fleshstuck){ if(weapons.type[k]!=staff){ - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } } if(fleshstuck){ - PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE); + PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabremovesound], 128); - FSOUND_SetPaused(channels[fleshstabremovesound], FALSE); + FSOUND_SetPaused(channels[fleshstabremovesound], false); } player[i].weaponactive=0; @@ -10339,7 +10339,7 @@ void Game::Tick() player[i].victim=&player[j]; XYZ aim; weapons.owner[player[i].weaponids[0]]=-1; - aim=player[i].victim->coords+DoRotation(player[i].victim->skeleton.joints[player[i].victim->skeleton.jointlabels[abdomen]].position,0,player[i].victim->rotation,0)*player[i].victim->scale+player[i].victim->velocity*findDistance(&player[i].victim->coords,&player[i].coords)/50-(player[i].coords+DoRotation(player[i].skeleton.joints[player[i].skeleton.jointlabels[righthand]].position,0,player[i].rotation,0)*player[i].scale); + aim=player[i].victim->coords+DoRotation(player[i].victim->skeleton.joints[player[i].victim->skeleton.jointlabels[abdomen]].position,0,player[i].victim->rotation,0)*player[i].victim->scale+player[i].victim->velocity*findDistance(&player[i].victim->coords,&player[i].coords)/50-(player[i].coords+DoRotation(player[i].skeleton.joints[player[i].skeleton.jointlabels[righthand]].position,0,player[i].rotation,0)*player[i].scale); Normalise(&aim); aim=DoRotation(aim,(float)abs(Random()%30)-15,(float)abs(Random()%30)-15,0); @@ -10355,7 +10355,7 @@ void Game::Tick() player[i].weaponids[0]=player[i].weaponids[player[i].num_weapons]; } player[i].weaponactive=-1; - } + } } } } @@ -10415,7 +10415,7 @@ void Game::Tick() player[i].target=0; player[i].drawtogglekeydown=1; } - } + } } if(player[i].isCrouch()&&weapons.bloody[player[i].weaponids[player[i].weaponactive]]&&bloodtoggle&&player[i].onterrain&&player[i].num_weapons&&player[i].weaponactive!=-1&&player[i].attackkeydown){ if(weapons.bloody[player[i].weaponids[player[i].weaponactive]]&&player[i].onterrain&&bloodtoggle&&musictype!=stream_music2){ @@ -10513,7 +10513,7 @@ void Game::Tick() if(target>=0)player[target].Reverse(); player[i].highreversaldelay=.5; - if(player[i].isCrouch()){ + if(player[i].isCrouch()){ if(!player[i].wasCrouch()){ player[i].currentanimation=player[i].getCrouch(); player[i].currentframe=0; @@ -10676,17 +10676,17 @@ void Game::Tick() vel[2]=player[i].velocity.z; if(i==0){ - PlaySoundEx( whooshsound, samp[whooshsound], NULL, TRUE); + PlaySoundEx( whooshsound, samp[whooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); FSOUND_SetVolume(channels[whooshsound], 128); - FSOUND_SetPaused(channels[whooshsound], FALSE); + FSOUND_SetPaused(channels[whooshsound], false); } - PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE); + PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], FALSE); - } + FSOUND_SetPaused(channels[jumpsound], false); + } if((player[i].isIdle())&&player[i].jumppower>1){ player[i].targetanimation=player[i].getLanding(); player[i].landhard=0; @@ -10694,7 +10694,7 @@ void Game::Tick() player[i].targetframe=2; player[i].jumpstart=1; player[i].tempdeltav=deltav; - } + } if(player[i].targetanimation==jumpupanim&&(((!floatjump&&!editorenabled)||!debugmode)||player[i].aitype!=playercontrolled)){ if(player[i].jumppower>multiplier*6){ player[i].velocity.y+=multiplier*6; @@ -10705,7 +10705,7 @@ void Game::Tick() player[i].jumppower=0; } } - if(((floatjump||editorenabled)&&debugmode)&&i==0)player[i].velocity.y+=multiplier*30; + if(((floatjump||editorenabled)&&debugmode)&&i==0)player[i].velocity.y+=multiplier*30; } if(!movekey){ @@ -10852,8 +10852,8 @@ void Game::Tick() FSOUND_StopSound(FSOUND_ALL); // hack...OpenAL renderer isn't stopping music after tutorial goes to level menu... FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); FSOUND_SetVolume(channels[stream_music3], 256); gameon=0; @@ -10861,12 +10861,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -10884,10 +10884,10 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); + FSOUND_SetPaused(channels[fireendsound], false); player[0].coords=(oldtemp+oldtemp2)/2; @@ -10907,10 +10907,10 @@ void Game::Tick() vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); + FSOUND_SetPaused(channels[fireendsound], false); for(int i=0;i128&&!loading&&!mainmenu)musicvolume[2]=128; - if(musictoggle){ + if(musictoggle){ if(musicvolume[0]>0&&oldmusicvolume[0]<=0){ - PlayStreamEx( music1, strm[music1], NULL, TRUE); - FSOUND_SetPaused(channels[music1], FALSE); + PlayStreamEx( music1, strm[music1], NULL, true); + FSOUND_SetPaused(channels[music1], false); } if(musicvolume[1]>0&&oldmusicvolume[1]<=0){ - PlayStreamEx( stream_music2, strm[stream_music2], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music2], FALSE); + PlayStreamEx( stream_music2, strm[stream_music2], NULL, true); + FSOUND_SetPaused(channels[stream_music2], false); } if(musicvolume[2]>0&&oldmusicvolume[2]<=0){ - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); } } - if(!musictoggle){ - FSOUND_SetPaused(channels[music1], TRUE); - FSOUND_SetPaused(channels[stream_music2], TRUE); - FSOUND_SetPaused(channels[stream_music3], TRUE); + if(!musictoggle){ + FSOUND_SetPaused(channels[music1], true); + FSOUND_SetPaused(channels[stream_music2], true); + FSOUND_SetPaused(channels[stream_music3], true); for(i=0;i<4;i++){ oldmusicvolume[i]=0; @@ -11163,15 +11163,15 @@ void Game::TickOnceAfter(){ } } - if(musictoggle){ + if(musictoggle){ if(musicvolume[0]<=0&&oldmusicvolume[0]>0){ - FSOUND_SetPaused(channels[music1], TRUE); + FSOUND_SetPaused(channels[music1], true); } if(musicvolume[1]<=0&&oldmusicvolume[1]>0){ - FSOUND_SetPaused(channels[stream_music2], TRUE); + FSOUND_SetPaused(channels[stream_music2], true); } if(musicvolume[2]<=0&&oldmusicvolume[2]>0){ - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); } if(musicvolume[0]!=oldmusicvolume[0]){ @@ -11214,19 +11214,19 @@ void Game::TickOnceAfter(){ int numalarmed=0; if(numplayers>1) - for(i=1;imaxalarmed)maxalarmed=numalarmed; - if(changedelay<=0&&!loading&&!editorenabled&&gameon&&!tutoriallevel&&changedelay!=-999&&!won){ + if(changedelay<=0&&!loading&&!editorenabled&&gameon&&!tutoriallevel&&changedelay!=-999&&!won){ if(player[0].dead&&changedelay<=0){ changedelay=1; targetlevel=whichlevel; } alldead=1; if(numplayers>1) - for(i=1;iaccounthighscore[accountactive][whichlevel])accounthighscore[accountactive][whichlevel]=bonustotal-startbonustotal; - if(accountfasttime[accountactive][whichlevel]==0||leveltime3&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, TRUE); - FSOUND_SetPaused(channels[stream_music3], FALSE); + FSOUND_SetFrequency(FSOUND_ALL, 0.001); + PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); + FSOUND_SetPaused(channels[stream_music3], false); FSOUND_SetVolume(channels[stream_music3], 256); gameon=0; @@ -11377,12 +11377,12 @@ void Game::TickOnceAfter(){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -11414,12 +11414,12 @@ void Game::TickOnceAfter(){ if(!stealthloading){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + FSOUND_SetPaused(channels[firestartsound], false); + FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -11530,7 +11530,7 @@ void Game::TickOnceAfter(){ campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], TRUE); + FSOUND_SetPaused(channels[stream_music3], true); stealthloading=0; } @@ -11556,7 +11556,7 @@ void Game::TickOnceAfter(){ target.y+=.1; if(player[0].skeleton.free){ for(i=0;itarget.y) + if(player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y>target.y) target.y=player[0].skeleton.joints[i].position.y*player[0].scale+player[0].coords.y; } target.y+=.1; @@ -11586,7 +11586,7 @@ void Game::TickOnceAfter(){ i=terrain.patchobjects[player[0].whichpatchx][player[0].whichpatchz][j]; colviewer=viewer; coltarget=cameraloc; - if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col; + if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.rotation[i])!=-1)viewer=col; } if(terrain.patchobjectnum[player[0].whichpatchx][player[0].whichpatchz]) for(j=0;jd_name, ptr) == 0) + if (strcasecmp(dent->d_name, ptr) == 0) { strcpy(ptr, dent->d_name); /* found a match. Overwrite with this case. */ closedir(dirp); diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index b4faa66..7fbeb49 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif -#include "Game.h" - #ifndef USE_DEVIL # ifdef WIN32 # define USE_DEVIL @@ -36,13 +34,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "IL/il.h" #include "IL/ilu.h" #include "IL/ilut.h" + #include "Game.h" #else - // just use libpng and libjpg directly; it's lighter-weight and easier - // to manage the dependencies on Linux... - extern "C" { - #include "png.h" - #include "jpeglib.h" - } + + #include + #include + #include + #include "Game.h" static bool load_image(const char * fname, TGAImageRec & tex); static bool load_png(const char * fname, TGAImageRec & tex); static bool load_jpg(const char * fname, TGAImageRec & tex); @@ -268,7 +266,7 @@ bool cmdline(const char *cmd) char *arg = _argv[i]; while (*arg == '-') arg++; - if (stricmp(arg, cmd) == 0) + if (strcasecmp(arg, cmd) == 0) return true; } @@ -1522,7 +1520,7 @@ char *calcBaseDir(const char *argv0) char *retval; char *envr; - char *ptr = strrchr(argv0, '/'); + char *ptr = strrchr((char *)argv0, '/'); if (strchr(argv0, '/')) { retval = strdup(argv0); @@ -2576,12 +2574,12 @@ int main(int argc, char **argv) #if !USE_DEVIL static bool load_image(const char *file_name, TGAImageRec &tex) { - char *ptr = strrchr(file_name, '.'); + char *ptr = strrchr((char *)file_name, '.'); if (ptr) { - if (stricmp(ptr+1, "png") == 0) + if (strcasecmp(ptr+1, "png") == 0) return load_png(file_name, tex); - else if (stricmp(ptr+1, "jpg") == 0) + else if (strcasecmp(ptr+1, "jpg") == 0) return load_jpg(file_name, tex); } @@ -2681,7 +2679,7 @@ static bool load_png(const char *file_name, TGAImageRec &tex) png_init_io(png_ptr, fp); png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING, - png_voidp_NULL); + NULL); png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL); @@ -2731,7 +2729,7 @@ static bool load_png(const char *file_name, TGAImageRec &tex) retval = true; png_done: - png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); if (fp) fclose(fp); return (retval); @@ -2740,10 +2738,10 @@ png_done: static bool save_image(const char *file_name) { - char *ptr = strrchr(file_name, '.'); + char *ptr = strrchr((char *)file_name, '.'); if (ptr) { - if (stricmp(ptr+1, "png") == 0) + if (strcasecmp(ptr+1, "png") == 0) return save_png(file_name); } diff --git a/Source/Person.cpp b/Source/Person.cpp index 9362358..e495d77 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -10,7 +10,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -109,7 +109,7 @@ extern int indialogue; extern bool gamestarted; extern FSOUND_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); void Person::CheckKick(){ @@ -139,10 +139,10 @@ void Person::CheckKick(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); relative=velocity; @@ -162,7 +162,7 @@ void Person::CheckKick(){ velocity=facing*-10; velocity.y=5; skeleton.free=0; - if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], false); //if(victim->damage>victim->damagetolerance){ if(id==0){ @@ -214,19 +214,19 @@ void Person::CatchFire(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); + FSOUND_SetPaused(channels[firestartsound], false); vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - //PlaySoundEx( firesound, samp[firesound], NULL, TRUE); - PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, TRUE); + //PlaySoundEx( firesound, samp[firesound], NULL, true); + PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, true); FSOUND_3D_SetAttributes(channels[stream_firesound], gLoc, vel); FSOUND_SetVolume(channels[stream_firesound], 256); - FSOUND_SetPaused(channels[stream_firesound], FALSE); + FSOUND_SetPaused(channels[stream_firesound], false); flamedelay=0; @@ -440,7 +440,7 @@ void Person::DoBlood(float howmuch,int which){ if(!skeleton.free){ sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1); - } + } } if(Random()%2==0) for(int i=0;i<3;i++){ @@ -531,10 +531,10 @@ void Person::DoBloodBig(float howmuch,int which){ } if(whichsound!=-1){ - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } } @@ -567,7 +567,7 @@ void Person::DoBloodBig(float howmuch,int which){ if(!skeleton.free){ sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1); - } + } } } int offsetx=0,offsety=0; @@ -608,7 +608,7 @@ void Person::DoBloodBig(float howmuch,int which){ if(i>endx)endx=i; if(j>endy)endy=j; } - } + } } if(creature==wolftype) for(i=0;i<512;i++){ @@ -619,7 +619,7 @@ void Person::DoBloodBig(float howmuch,int which){ if(i>endx)endx=i; if(j>endy)endy=j; } - } + } } startx+=offsetx; @@ -697,7 +697,7 @@ void Person::DoBloodBig(float howmuch,int which){ bloodloss+=bleeding*3; if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodlossendx)endx=i; if(j>endy)endy=j; } - } + } } if(creature==wolftype) for(i=0;i<512;i++){ @@ -835,7 +835,7 @@ bool Person::DoBloodBigWhere(float howmuch,int which, XYZ where){ if(i>endx)endx=i; if(j>endy)endy=j; } - } + } } startx+=offsetx; endx+=offsetx; @@ -915,7 +915,7 @@ bool Person::DoBloodBigWhere(float howmuch,int which, XYZ where){ bloodloss+=bleeding*3; if(tutoriallevel!=1&&aitype!=playercontrolled&&bloodloss>damagetolerance*2/3&&bloodlossweaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; - PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE); + PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], FALSE); + FSOUND_SetPaused(channels[swordstaffsound], false); } else{ - PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE); + FSOUND_SetPaused(channels[metalhitsound], false); } } XYZ aim; @@ -1227,10 +1227,10 @@ void Person::Reverse(){ - /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE);*/ + FSOUND_SetPaused(channels[metalhitsound], false);*/ } if(abs(Random()%20)==0){ @@ -1247,16 +1247,16 @@ void Person::Reverse(){ if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; - PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE); + PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], FALSE); + FSOUND_SetPaused(channels[swordstaffsound], false); } else{ - PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE); + FSOUND_SetPaused(channels[metalhitsound], false); } } @@ -1288,10 +1288,10 @@ void Person::Reverse(){ } - /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE);*/ + FSOUND_SetPaused(channels[metalhitsound], false);*/ } } if(hasvictim) @@ -1366,7 +1366,7 @@ void Person::DoDamage(float howmuch){ if(aitype==passivetype&&damagedamagetolerance*2/3&&creature==rabbittype){ - if(abs(Random()%2)==0){aitype=gethelptype; + if(abs(Random()%2)==0){aitype=gethelptype; lastseentime=12; } else aitype=attacktypecutoff; @@ -1397,10 +1397,10 @@ void Person::DoDamage(float howmuch){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( splattersound, samp[splattersound], NULL, TRUE); + PlaySoundEx( splattersound, samp[splattersound], NULL, true); FSOUND_3D_SetAttributes(channels[splattersound], gLoc, vel); FSOUND_SetVolume(channels[splattersound], 256); - FSOUND_SetPaused(channels[splattersound], FALSE); + FSOUND_SetPaused(channels[splattersound], false); skeleton.free=2; DoDamage(10000); @@ -1412,7 +1412,7 @@ void Person::DoDamage(float howmuch){ if(!dead&&creature==wolftype){ bonus=Wolfbonus; bonustime=0; - bonusvalue=300; + bonusvalue=300; } dead=2; coords=20; @@ -1451,10 +1451,10 @@ void Person::DoDamage(float howmuch){ } if(whichsound!=-1){ - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } } speechdelay=.3; @@ -1758,7 +1758,7 @@ void Person::Puff(int whichlabel){ /* -HitStruct Person::BulletCollideWithPlayer(XYZ start, XYZ end){ +HitStruct Person::BulletCollideWithPlayer(XYZ start, XYZ end){ float damage=20; XYZ tempbulletloc[2]; XYZ collisionpoint; @@ -1926,7 +1926,7 @@ hitstruct.hitlocation=hitstruct.hitlocation+coords; return hitstruct; } */ -void Person::DoAnimations(){ +void Person::DoAnimations(){ if(!skeleton.free){ int i = 0; static float oldtarget; @@ -1934,7 +1934,7 @@ void Person::DoAnimations(){ if(isIdle()&¤tanimation!=getIdle())normalsupdatedelay=0; if(targetanimation==tempanim||currentanimation==tempanim){ - animation[tempanim]=tempanimation; + animation[tempanim]=tempanimation; } if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ float gLoc[3]; @@ -1950,7 +1950,7 @@ void Person::DoAnimations(){ FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); FSOUND_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); } - if(((velocity.y<-15)||(crouchkeydown&&velocity.y<-8))&&abs(velocity.y)*4>fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1; + if(((velocity.y<-15)||(crouchkeydown&&velocity.y<-8))&&abs(velocity.y)*4>fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1; if(!crouchkeydown&&velocity.y>=-15)landhard=0; } if((currentanimation==jumpupanim||targetanimation==jumpdownanim)/*&&velocity.y<40*/&&!isFlip()&&(!isLanding()&&!isLandhard())&&((crouchkeydown&&!crouchtogglekeydown))){ @@ -1974,7 +1974,7 @@ void Person::DoAnimations(){ crouchtogglekeydown=0; if(aitype==playercontrolled)feint=0; } - else + else { if(!crouchtogglekeydown&&animation[targetanimation].attack==reversed&&aitype==playercontrolled&&(escapednum<2||reversaltrain))feint=1; if(!isFlip())crouchtogglekeydown=1; @@ -1996,11 +1996,11 @@ void Person::DoAnimations(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( fireendsound, samp[fireendsound], NULL, TRUE); + PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], FALSE); - FSOUND_SetPaused(channels[stream_firesound], TRUE); + FSOUND_SetPaused(channels[fireendsound], false); + FSOUND_SetPaused(channels[stream_firesound], true); deathbleeding=0; } @@ -2026,10 +2026,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(1/victim->armorhead,210); } @@ -2057,10 +2057,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE); + PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], FALSE); + FSOUND_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -2072,10 +2072,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } } drawtogglekeydown=1; @@ -2103,11 +2103,11 @@ void Person::DoAnimations(){ FootLand(0,1); } - } + } if(terrain.getOpacity(coords.x,coords.z)>=.2){ if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3; else whichsound=footstepsound4; - } + } } if(!onterrain){ if(animation[targetanimation].label[targetframe]==1)whichsound=footstepsound3; @@ -2125,12 +2125,12 @@ void Person::DoAnimations(){ else if(animation[targetanimation].label[targetframe]==4)whichsound=knifeswishsound; if(animation[targetanimation].label[targetframe]==8&&tutoriallevel!=1)whichsound=landsound2; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(whichsound!=knifeswishsound)FSOUND_SetVolume(channels[whichsound], 128); if(whichsound!=knifeswishsound&&(targetanimation==staffhitanim||targetanimation==staffgroundsmashanim||targetanimation==staffspinhitanim))FSOUND_SetVolume(channels[whichsound], 256); if(whichsound==knifeswishsound)FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); if(id==0) if(whichsound==footstepsound||whichsound==footstepsound2||whichsound==footstepsound3||whichsound==footstepsound4){ @@ -2143,10 +2143,10 @@ void Person::DoAnimations(){ if(animation[targetanimation].label[targetframe]==3){ whichsound--; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); FSOUND_SetVolume(channels[whichsound], 128); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } } @@ -2187,16 +2187,16 @@ void Person::DoAnimations(){ //if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2; if(whichsound!=-1){ - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } } - if((!wasLanding()&&!wasLandhard())&¤tanimation!=getIdle()&&(isLanding()||isLandhard())){ + if((!wasLanding()&&!wasLandhard())&¤tanimation!=getIdle()&&(isLanding()||isLandhard())){ FootLand(0,1); FootLand(1,1); } @@ -2221,10 +2221,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } weaponactive=0; @@ -2267,17 +2267,17 @@ void Person::DoAnimations(){ } if(!fleshstuck){ if(weapons.type[i]!=staff){ - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } } if(fleshstuck){ - PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE); + PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabremovesound], 128); - FSOUND_SetPaused(channels[fleshstabremovesound], FALSE); + FSOUND_SetPaused(channels[fleshstabremovesound], false); } weaponactive=0; if(weapons.owner[i]!=-1){ @@ -2354,10 +2354,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE); + PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], FALSE); + FSOUND_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -2369,10 +2369,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } } @@ -2406,10 +2406,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE); + PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], FALSE); + FSOUND_SetPaused(channels[jumpsound], false); } float closestdist; @@ -2454,10 +2454,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( jumpsound, samp[jumpsound], NULL, TRUE); + PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], FALSE); + FSOUND_SetPaused(channels[jumpsound], false); } } } @@ -2486,16 +2486,16 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2535,15 +2535,15 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE); + PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], FALSE); + FSOUND_SetPaused(channels[whooshhitsound], false); if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2,175); } @@ -2580,16 +2580,16 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 160); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2635,16 +2635,16 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 160); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2691,10 +2691,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE); + PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], FALSE); + FSOUND_SetPaused(channels[whooshhitsound], false); victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; @@ -2722,15 +2722,15 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - /*PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + /*PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); */ - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); + FSOUND_SetPaused(channels[movewhooshsound], false); victim->skeleton.longdead=0; victim->skeleton.free=1; @@ -2772,10 +2772,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } XYZ relative; relative=victim->coords-coords; @@ -2807,10 +2807,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( thudsound, samp[thudsound], NULL, TRUE); + PlaySoundEx( thudsound, samp[thudsound], NULL, true); FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel); FSOUND_SetVolume(channels[thudsound], 400); - FSOUND_SetPaused(channels[thudsound], FALSE); + FSOUND_SetPaused(channels[thudsound], false); } victim->skeleton.longdead=0; @@ -2862,10 +2862,10 @@ void Person::DoAnimations(){ if(!hasvictim){ terrain.MakeDecal(blooddecalfast,(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2),.08,.6,Random()%360); - PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE); + PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], FALSE); + FSOUND_SetPaused(channels[knifesheathesound], false); } if(victim&&hasvictim){ @@ -2928,10 +2928,10 @@ void Person::DoAnimations(){ victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } - PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE); + PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabsound], 128); - FSOUND_SetPaused(channels[fleshstabsound], FALSE); + FSOUND_SetPaused(channels[fleshstabsound], false); } if(whichtri!=-1||weapons.bloody[weaponids[weaponactive]]){ @@ -2940,10 +2940,10 @@ void Person::DoAnimations(){ } if(whichtri==-1){ hasvictim=0; - PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE); + PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], FALSE); + FSOUND_SetPaused(channels[knifesheathesound], false); } } } @@ -2961,19 +2961,19 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(!hasvictim){ - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } if(victim&&hasvictim){ - XYZ footvel,footpoint; + XYZ footvel,footpoint; - PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE); + PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabremovesound], 128); - FSOUND_SetPaused(channels[fleshstabremovesound], FALSE); + FSOUND_SetPaused(channels[fleshstabremovesound], false); footvel=0; footpoint=(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2); @@ -3033,7 +3033,7 @@ void Person::DoAnimations(){ for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; - victim->skeleton.joints[i].locked=0; + victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } @@ -3056,7 +3056,7 @@ void Person::DoAnimations(){ if(!hasvictim&&onterrain){ weapons.bloody[weaponids[weaponactive]]=0; weapons.blooddrip[weaponids[weaponactive]]=0; - } + } } if(targetanimation==upunchanim&&animation[targetanimation].label[currentframe]==5){ @@ -3078,18 +3078,18 @@ void Person::DoAnimations(){ //if(!victim->isIdle()||victim->damage>victim->damagetolerance-60){ if(1==1){ if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } } else { if(tutoriallevel!=1){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 256); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } } @@ -3136,27 +3136,27 @@ void Person::DoAnimations(){ //if(!victim->isIdle()||victim->damage>victim->damagetolerance-60){ if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height!=lowheight){ if(tutoriallevel!=1){ - PlaySoundEx( thudsound, samp[thudsound], NULL, TRUE); + PlaySoundEx( thudsound, samp[thudsound], NULL, true); FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel); FSOUND_SetVolume(channels[thudsound], 512); - FSOUND_SetPaused(channels[thudsound], FALSE); + FSOUND_SetPaused(channels[thudsound], false); } } else if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height==lowheight){ if(tutoriallevel!=1){ - PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE); + PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], FALSE); + FSOUND_SetPaused(channels[whooshhitsound], false); } } else { if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 256); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); - } + FSOUND_SetPaused(channels[heavyimpactsound], false); + } } if(victim->damage>victim->damagetolerance-60||normaldotproduct(victim->facing,victim->coords-coords)>0||animation[victim->targetanimation].height==lowheight) @@ -3199,10 +3199,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 256); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); Puff(righthand); } @@ -3225,16 +3225,16 @@ void Person::DoAnimations(){ if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; - PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE); + PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], FALSE); + FSOUND_SetPaused(channels[swordstaffsound], false); } else{ - PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE); + FSOUND_SetPaused(channels[metalhitsound], false); } } @@ -3247,7 +3247,7 @@ void Person::DoAnimations(){ escapednum=0; XYZ aim; weapons.owner[weaponids[0]]=-1; - aim=victim->coords+DoRotation(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position,0,victim->rotation,0)*victim->scale+victim->velocity*findDistance(&victim->coords,&coords)/50-(coords+DoRotation(skeleton.joints[skeleton.jointlabels[righthand]].position,0,rotation,0)*scale); + aim=victim->coords+DoRotation(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position,0,victim->rotation,0)*victim->scale+victim->velocity*findDistance(&victim->coords,&coords)/50-(coords+DoRotation(skeleton.joints[skeleton.jointlabels[righthand]].position,0,rotation,0)*scale); Normalise(&aim); /*if(victim->targetanimation==jumpupanim||victim->targetanimation==jumpdownanim){ aim=DoRotation(aim,(float)abs(Random()%15)-7,(float)abs(Random()%15)-7,0); @@ -3264,7 +3264,7 @@ void Person::DoAnimations(){ weaponids[0]=weaponids[num_weapons]; } weaponactive=-1; - } + } } if(targetanimation==knifeslashstartanim&&animation[targetanimation].label[currentframe]==5){ @@ -3289,10 +3289,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE); + PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], FALSE); + FSOUND_SetPaused(channels[knifeslicesound], false); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; if(animation[victim->targetanimation].attack&&(victim->aitype!=playercontrolled||victim->targetanimation==knifeslashstartanim)&&(victim->creature==rabbittype||victim->deathbleeding<=0)){ @@ -3310,14 +3310,14 @@ void Person::DoAnimations(){ if(tutoriallevel!=1)if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; if(tutoriallevel!=1)weapons.blooddrip[weaponids[weaponactive]]+=3; - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; if(skeleton.free){ footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords; } if(!skeleton.free){ footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords; - } + } if(tutoriallevel!=1){ if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3); footvel=DoRotation(facing,0,90,0)*.8; @@ -3341,7 +3341,7 @@ void Person::DoAnimations(){ bonustime=0; bonusvalue=40; } - escapednum=0; + escapednum=0; if(tutoriallevel!=1){ if(normaldotproduct(victim->facing,victim->coords-coords)<0)victim->DoBloodBig(2/victim->armorhigh,190); else victim->DoBloodBig(2/victim->armorhigh,185); @@ -3354,10 +3354,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( swordslicesound, samp[swordslicesound], NULL, TRUE); + PlaySoundEx( swordslicesound, samp[swordslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[swordslicesound], gLoc, vel); FSOUND_SetVolume(channels[swordslicesound], 512); - FSOUND_SetPaused(channels[swordslicesound], FALSE); + FSOUND_SetPaused(channels[swordslicesound], false); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //if(animation[victim->targetanimation].attack){ @@ -3381,14 +3381,14 @@ void Person::DoAnimations(){ //victim->bloodloss+=100*(6.5-findDistancefast(&coords,&victim->coords)); victim->DoDamage(damagemult*0); - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; if(skeleton.free){ footpoint=(victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2*victim->scale+victim->coords; } if(!skeleton.free){ footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords; - } + } if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); footvel=DoRotation(facing,0,90,0)*.8; footvel.y-=.3; @@ -3414,16 +3414,16 @@ void Person::DoAnimations(){ if(weapons.type[victim->weaponids[0]]==staff)weapons.damage[victim->weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; - PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, TRUE); + PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], FALSE); + FSOUND_SetPaused(channels[swordstaffsound], false); } else{ - PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE); + FSOUND_SetPaused(channels[metalhitsound], false); } } @@ -3455,10 +3455,10 @@ void Person::DoAnimations(){ player[i].wentforweapon=0; } - /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, TRUE); + /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], FALSE);*/ + FSOUND_SetPaused(channels[metalhitsound], false);*/ } } @@ -3481,10 +3481,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, TRUE); + PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true); FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel); FSOUND_SetVolume(channels[staffheadsound], 256); - FSOUND_SetPaused(channels[staffheadsound], FALSE); + FSOUND_SetPaused(channels[staffheadsound], false); } victim->RagDoll(0); XYZ relative; @@ -3530,10 +3530,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, TRUE); + PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true); FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel); FSOUND_SetVolume(channels[staffheadsound], 256); - FSOUND_SetPaused(channels[staffheadsound], FALSE); + FSOUND_SetPaused(channels[staffheadsound], false); } victim->RagDoll(0); XYZ relative; @@ -3576,10 +3576,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( staffbodysound, samp[staffbodysound], NULL, TRUE); + PlaySoundEx( staffbodysound, samp[staffbodysound], NULL, true); FSOUND_3D_SetAttributes(channels[staffbodysound], gLoc, vel); FSOUND_SetVolume(channels[staffbodysound], 256); - FSOUND_SetPaused(channels[staffbodysound], FALSE); + FSOUND_SetPaused(channels[staffbodysound], false); } victim->skeleton.longdead=0; victim->skeleton.free=1; @@ -3587,7 +3587,7 @@ void Person::DoAnimations(){ for(i=0;iskeleton.num_joints;i++){ victim->skeleton.joints[i].velchange=0; - victim->skeleton.joints[i].locked=0; + victim->skeleton.joints[i].locked=0; //victim->skeleton.joints[i].velocity=0; } @@ -3660,19 +3660,19 @@ void Person::DoAnimations(){ } victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } victim->Puff(head); victim->DoDamage(damagemult*100/victim->protectionhead); if(victim->howactive==typesleeping)victim->DoDamage(damagemult*150/victim->protectionhead); if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -3688,18 +3688,18 @@ void Person::DoAnimations(){ victim->targetrotation=targetrotation+180; victim->target=0; if(tutoriallevel!=1){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionhigh); if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } @@ -3721,10 +3721,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } XYZ relative; relative=victim->coords-coords; @@ -3763,10 +3763,10 @@ void Person::DoAnimations(){ victim->targetrotation=targetrotation+180; victim->target=0; if(tutoriallevel!=1){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionlow); @@ -3778,7 +3778,7 @@ void Person::DoAnimations(){ } } - } + } if(animation[targetanimation].attack==reversal&&(!victim->feint||(victim->lastattack==victim->lastattack2&&victim->lastattack2==victim->lastattack3&&Random()%2)||targetanimation==knifefollowanim)){ if(targetanimation==spinkickreversalanim&&animation[targetanimation].label[currentframe]==7){ escapednum=0; @@ -3796,16 +3796,16 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } @@ -3865,10 +3865,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, TRUE); + PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); FSOUND_SetVolume(channels[whooshhitsound], 128); - FSOUND_SetPaused(channels[whooshhitsound], FALSE); + FSOUND_SetPaused(channels[whooshhitsound], false); victim->RagDoll(0); XYZ relative; relative=victim->coords-oldcoords; @@ -3907,10 +3907,10 @@ void Person::DoAnimations(){ } if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); if(id==0){ @@ -3978,18 +3978,18 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhigh,225); - PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE); + PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], FALSE); + FSOUND_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; } if(weaponactive==-1&&creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,175); } @@ -4036,10 +4036,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; victim->DoBloodBig(2,225); - PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE); + PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], FALSE); + FSOUND_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; }*/ @@ -4061,10 +4061,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); XYZ relative; @@ -4117,19 +4117,19 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(weaponactive!=-1){ victim->DoBloodBig(200,225); - PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE); + PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], FALSE); + FSOUND_SetPaused(channels[knifeslicesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } if(creature==wolftype&&weaponactive==-1){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2,175); } @@ -4154,7 +4154,7 @@ void Person::DoAnimations(){ bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale; sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); */ - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; footpoint=weapons.tippoint[weaponids[0]]; if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); @@ -4178,7 +4178,7 @@ void Person::DoAnimations(){ bonustime=0; bonusvalue=40; } - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; footpoint=weapons.tippoint[weaponids[0]]; if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); @@ -4199,10 +4199,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE); + PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabsound], 512); - FSOUND_SetPaused(channels[fleshstabsound], FALSE); + FSOUND_SetPaused(channels[fleshstabsound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } @@ -4229,14 +4229,14 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE); + PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabremovesound], 512); - FSOUND_SetPaused(channels[fleshstabremovesound], FALSE); + FSOUND_SetPaused(channels[fleshstabremovesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; footpoint=weapons.tippoint[weaponids[0]]; if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); @@ -4258,7 +4258,7 @@ void Person::DoAnimations(){ escapednum=0; - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; footpoint=(weapons.tippoint[weaponids[0]]+weapons.position[weaponids[0]])/2; if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); @@ -4279,10 +4279,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, TRUE); + PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabsound], 512); - FSOUND_SetPaused(channels[fleshstabsound], FALSE); + FSOUND_SetPaused(channels[fleshstabsound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } @@ -4303,14 +4303,14 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, TRUE); + PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); FSOUND_SetVolume(channels[fleshstabremovesound], 512); - FSOUND_SetPaused(channels[fleshstabremovesound], FALSE); + FSOUND_SetPaused(channels[fleshstabremovesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; - XYZ footvel,footpoint; + XYZ footvel,footpoint; footvel=0; footpoint=weapons.tippoint[weaponids[0]]; if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3); @@ -4339,10 +4339,10 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(weaponactive==-1){ if(tutoriallevel!=1){ - PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, TRUE); + PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], FALSE); + FSOUND_SetPaused(channels[heavyimpactsound], false); } } bool doslice; @@ -4352,18 +4352,18 @@ void Person::DoAnimations(){ if(doslice){ if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhead,225); - PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, TRUE); + PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], FALSE); + FSOUND_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; } - if(weaponactive==-1&&creature==wolftype){ - PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, TRUE); + if(weaponactive==-1&&creature==wolftype){ + PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], FALSE); + FSOUND_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -4442,10 +4442,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); + FSOUND_SetPaused(channels[movewhooshsound], false); } if(currentanimation==staggerbackhighanim){ targetanimation=getIdle(); @@ -4494,10 +4494,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, TRUE); + PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], FALSE); + FSOUND_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -4509,10 +4509,10 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, TRUE); + PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], FALSE); + FSOUND_SetPaused(channels[knifedrawsound], false); } } if(currentanimation==rollanim){ @@ -4587,7 +4587,7 @@ void Person::DoAnimations(){ targetframe=3; velocity=facing*-8; velocity.y=4; - if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], false); } if(targetanimation==walljumprightanim){ targetanimation=rightflipanim; @@ -4605,7 +4605,7 @@ void Person::DoAnimations(){ velocity=facing*8; velocity.y=4; } - if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], false); } if(targetanimation==walljumpleftanim){ if(attackkeydown){ @@ -4645,7 +4645,7 @@ void Person::DoAnimations(){ velocity=DoRotation(facing,0,-30,0)*-8; velocity.y=4; } - if(id==0)FSOUND_SetPaused(channels[whooshsound], FALSE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], false); } if(targetanimation==sneakattackanim){ float ycoords=oldcoords.y; @@ -4740,10 +4740,10 @@ void Person::DoAnimations(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( landsound, samp[landsound], NULL, TRUE); + PlaySoundEx( landsound, samp[landsound], NULL, true); FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], FALSE); + FSOUND_SetPaused(channels[landsound], false); if(currentanimation==upunchreversedanim||currentanimation==swordslashreversedanim){ targetanimation=rollanim; @@ -4809,7 +4809,7 @@ void Person::DoAnimations(){ escapednum++; targetanimation=rollanim; coords+=facing; - if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], true); } lastfeint=0; } @@ -4832,7 +4832,7 @@ void Person::DoAnimations(){ escapednum++; targetanimation=rollanim; coords+=facing*2; - if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], true); } lastfeint=0; } @@ -4864,7 +4864,7 @@ void Person::DoAnimations(){ targetanimation=jumpdownanim; } } - if(!skeleton.free){ + if(!skeleton.free){ oldtarget=target; if(!transspeed&&animation[targetanimation].attack!=2&&animation[targetanimation].attack!=3){ if(!isRun()||!wasRun()){ @@ -4904,7 +4904,7 @@ void Person::DoAnimations(){ if(currentanimation!=oldcurrentanimation||targetanimation!=oldtargetanimation||((currentframe!=oldcurrentframe||targetframe!=oldtargetframe)&&!calcrot)){ //Old rotates for(i=0;i0){ @@ -5155,7 +5155,7 @@ void Person::DoStuff(){ if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale; if(skeleton.free)sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1); if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1); - } + } } /*if(id==0){ bloodloss+=deathbleeding*40; @@ -5164,7 +5164,7 @@ void Person::DoStuff(){ bloodloss+=deathbleeding*multiplier*80; deathbleeding-=multiplier*1.6; //if(id==0)deathbleeding-=multiplier*.2; - if(deathbleeding<0)deathbleeding=0; + if(deathbleeding<0)deathbleeding=0; if(bloodloss>damagetolerance&&animation[targetanimation].attack==neutral){ if(weaponactive!=-1){ weapons.owner[weaponids[0]]=-1; @@ -5198,7 +5198,7 @@ void Person::DoStuff(){ if(!dead&&creature==wolftype){ bonus=Wolfbonus; bonustime=0; - bonusvalue=300; + bonusvalue=300; } dead=2; if(targetanimation==knifefollowedanim&&!skeleton.free){ @@ -5380,7 +5380,7 @@ void Person::DoStuff(){ if(!skeleton.free)footpoint=DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords; if(skeleton.free)footpoint=((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2)*scale+coords; if(targetanimation==sleepanim)footvel=DoRotation(footvel,0,90,0); - sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3); + sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3); } } @@ -5468,7 +5468,7 @@ void Person::DoStuff(){ } } } - if(creature==wolftype){ + if(creature==wolftype){ twitchdelay2-=multiplier*1.5; if(tailmorphend!=0) if((isRun()||targetanimation==jumpupanim||targetanimation==jumpdownanim||targetanimation==backflipanim)&&!skeleton.free){ @@ -5579,7 +5579,7 @@ void Person::DoStuff(){ if(creature==wolftype){ bonus=Wolfbonus; bonustime=0; - bonusvalue=300; + bonusvalue=300; } RagDoll(0); @@ -5617,7 +5617,7 @@ void Person::DoStuff(){ /* if(bloodlossdamagetolerance&&dead!=2){ @@ -5675,7 +5675,7 @@ void Person::DoStuff(){ if(!dead&&creature==wolftype){ bonus=Wolfbonus; bonustime=0; - bonusvalue=300; + bonusvalue=300; } if(id!=0&&unconscioustime<.1&&(bonus!=spinecrusher||bonustime>1)&&(bonus!=FinishedBonus||bonustime>1)&&bloodloss2000){ if(skeleton.longdead>6000){ - if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], true); skeleton.free=3; DrawSkeleton(); skeleton.free=2; @@ -5832,7 +5832,7 @@ void Person::DoStuff(){ if(objects.type[i]!=treeleavestype&&objects.type[i]!=bushtype&&objects.type[i]!=firetype){ colviewer=startpoint; coltarget=endpoint; - if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)canrecover=0; + if(objects.model[i].LineCheck(&colviewer,&coltarget,&colpoint,&objects.position[i],&objects.rotation[i])!=-1)canrecover=0; } } if(canrecover){ @@ -5889,7 +5889,7 @@ void Person::DoStuff(){ if(findLength(&average)<10&&!dead&&skeleton.free){ skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier; if(skeleton.longdead>(damage+500)*1.5){ - if(id==0)FSOUND_SetPaused(channels[whooshsound], TRUE); + if(id==0)FSOUND_SetPaused(channels[whooshsound], true); skeleton.free=0; velocity=0; XYZ middle; @@ -6016,10 +6016,10 @@ void Person::DoStuff(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, TRUE); + PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], FALSE); + FSOUND_SetPaused(channels[movewhooshsound], false); currentanimation=targetanimation; currentframe=targetframe-1; @@ -6056,10 +6056,10 @@ void Person::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); + FSOUND_SetPaused(channels[firestartsound], false); } objects.onfire[i]=1; } @@ -6081,10 +6081,10 @@ void Person::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); + FSOUND_SetPaused(channels[firestartsound], false); } objects.onfire[i]=1; } @@ -6106,10 +6106,10 @@ void Person::DoStuff(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( bushrustle, samp[bushrustle], NULL, TRUE); + PlaySoundEx( bushrustle, samp[bushrustle], NULL, true); FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel); FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity)); - FSOUND_SetPaused(channels[bushrustle], FALSE); + FSOUND_SetPaused(channels[bushrustle], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6152,7 +6152,7 @@ void Person::DoStuff(){ } } objects.rotx[i]+=velocity.x*multiplier*6; - objects.roty[i]+=velocity.z*multiplier*6; + objects.roty[i]+=velocity.z*multiplier*6; objects.messedwith[i]=.5; } XYZ tempcoord; @@ -6175,10 +6175,10 @@ void Person::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( firestartsound, samp[firestartsound], NULL, TRUE); + PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], FALSE); + FSOUND_SetPaused(channels[firestartsound], false); objects.onfire[i]=1; } }*/ @@ -6194,10 +6194,10 @@ void Person::DoStuff(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( bushrustle, samp[bushrustle], NULL, TRUE); + PlaySoundEx( bushrustle, samp[bushrustle], NULL, true); FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel); FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity)); - FSOUND_SetPaused(channels[bushrustle], FALSE); + FSOUND_SetPaused(channels[bushrustle], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6242,11 +6242,11 @@ void Person::DoStuff(){ } } objects.messedwith[i]=.5; - } + } } } - if(!skeleton.free){ + if(!skeleton.free){ bool play; play=0; if((stunned>0||surprised>0)&&numplayers>2&&aitype!=passivetype)play=1; @@ -6279,12 +6279,12 @@ void Person::DoStuff(){ //if(animation[targetanimation].label[targetframe]==8)whichsound=landsound2; if(whichsound!=-1){ - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], FALSE); - } - } + FSOUND_SetPaused(channels[whichsound], false); + } + } if(targetanimation==staggerbackhighanim)staggerdelay=1; if(targetanimation==staggerbackhardanim)staggerdelay=1; @@ -6400,7 +6400,7 @@ void Person::DoStuff(){ } } /* - if(speechdelay>.25){ + if(speechdelay>.25){ if(headmorphend!=2)headmorphness=0; headmorphend=2; targetheadmorphness=1; @@ -6494,7 +6494,7 @@ void Person::DoStuff(){ //if(!creature==wolftype||targetanimation==rabbitkickanim) if(targetanimation==rabbittackleanim){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*65*scale){ velocity/=velspeed; velspeed=speed*65*scale; @@ -6502,13 +6502,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if(targetanimation!=rabbitrunninganim&&targetanimation!=wolfrunninganim){ if(isRun()||targetanimation==rabbitkickanim){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*45*scale){ velocity/=velspeed; velspeed=speed*45*scale; @@ -6516,14 +6516,14 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeedspeed*55*scale){ velocity/=velspeed; @@ -6540,14 +6540,14 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } /*if(creature==wolftype) if(isRun()){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*55*scale){ velocity/=velspeed; velspeed=speed*55*scale; @@ -6555,13 +6555,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; }*/ if(targetanimation==rollanim&&animation[targetanimation].label[targetframe]!=6){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*45*scale){ velocity/=velspeed; velspeed=speed*45*scale; @@ -6569,14 +6569,14 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } /*if(currentanimation==rollanim&&(isCrouch()||isIdle())){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*25*scale){ velocity/=velspeed; velspeed=speed*25*scale; @@ -6584,13 +6584,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; }*/ if(targetanimation==sneakanim||targetanimation==walkanim){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*12*scale){ velocity/=velspeed; velspeed=speed*12*scale; @@ -6598,13 +6598,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if((targetanimation==fightidleanim||targetanimation==knifefightidleanim)&&(currentanimation==bounceidleanim||currentanimation==hurtidleanim)){ velocity+=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*2*scale){ velocity/=velspeed; velspeed=speed*2*scale; @@ -6612,14 +6612,14 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } if((targetanimation==bounceidleanim||currentanimation==hurtidleanim)&&(currentanimation==fightidleanim||currentanimation==knifefightidleanim)){ velocity-=facing*multiplier*speed*700*scale; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*2*scale){ velocity/=velspeed; velspeed=speed*2*scale; @@ -6627,13 +6627,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==fightsidestep){ velocity+=DoRotation(facing*multiplier*speed*700*scale,0,-90,0); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*12*scale){ velocity/=velspeed; velspeed=speed*12*scale; @@ -6641,7 +6641,7 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=DoRotation(flatfacing*velspeed,0,-90,0); } @@ -6657,7 +6657,7 @@ void Person::DoStuff(){ if(targetanimation==backhandspringanim){ //coords-=facing*multiplier*50*scale; velocity+=facing*multiplier*speed*700*scale*-1; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*50*scale){ velocity/=velspeed; velspeed=speed*50*scale; @@ -6665,13 +6665,13 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==dodgebackanim){ //coords-=facing*multiplier*50*scale; velocity+=facing*multiplier*speed*700*scale*-1; - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); if(velspeed>speed*60*scale){ velocity/=velspeed; velspeed=speed*60*scale; @@ -6679,12 +6679,12 @@ void Person::DoStuff(){ } velocity.y+=gravity*multiplier*20; ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity=flatfacing*velspeed*-1; } if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); } @@ -6699,11 +6699,11 @@ void Person::DoStuff(){ if(targetanimation==jumpupanim){jumppower=-4;targetanimation=getIdle();} target=0; - targetframe=0; + targetframe=0; onterrain=1; if(id==0){ - FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[whooshsound], true); FSOUND_SetVolume(channels[whooshsound], 0); } @@ -6718,10 +6718,10 @@ void Person::DoStuff(){ vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( landsound, samp[landsound], NULL, TRUE); + PlaySoundEx( landsound, samp[landsound], NULL, true); FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], FALSE); + FSOUND_SetPaused(channels[landsound], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6740,7 +6740,7 @@ void Person::DoStuff(){ if(isIdle()||targetanimation==drawrightanim||targetanimation==drawleftanim||targetanimation==crouchdrawrightanim||targetanimation==crouchstabanim||targetanimation==swordgroundstabanim||isStop()||targetanimation==removeknifeanim||targetanimation==crouchremoveknifeanim||isLanding()||isCrouch()||animation[targetanimation].attack||(targetanimation==rollanim&&animation[targetanimation].label[targetframe]==6)){ - velspeed=findLength(&velocity); + velspeed=findLength(&velocity); velocity.y=0; if(velspeedcoords; } } - skeleton.oldfree=skeleton.free; + skeleton.oldfree=skeleton.free; XYZ midterrain; midterrain=0; @@ -6834,7 +6834,7 @@ void Person::DoStuff(){ int Person::DrawSkeleton(){ int oldplayerdetail; - if((frustum.SphereInFrustum(coords.x,coords.y+scale*3,coords.z,scale*8)&&findDistancefast(&viewer,&coords)0){ for(k=0;klabel==righthand||skeleton.muscles[j].parent2->label==righthand)&&skeleton.muscles[j].numvertices>0){ @@ -7419,7 +7419,7 @@ int Person::DrawSkeleton(){ }*/ } } - if(weaponactive!=k&&weaponstuck!=k){ + if(weaponactive!=k&&weaponstuck!=k){ if(weapons.type[i]==knife)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[righthip]].position-skeleton.joints[skeleton.jointlabels[lefthip]].position)*.1+(skeleton.joints[skeleton.jointlabels[rightshoulder]].position-skeleton.joints[skeleton.jointlabels[leftshoulder]].position)*.35; if(weapons.type[i]==sword)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33; if(weapons.type[i]==staff)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position+(skeleton.joints[skeleton.jointlabels[lefthip]].position-skeleton.joints[skeleton.jointlabels[righthip]].position)*.09+(skeleton.joints[skeleton.jointlabels[leftshoulder]].position-skeleton.joints[skeleton.jointlabels[rightshoulder]].position)*.33; @@ -7429,7 +7429,7 @@ int Person::DrawSkeleton(){ } } } - if(weaponstuck==k){ + if(weaponstuck==k){ if(weaponstuckwhere==0)weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5-skeleton.forward*.8; else weaponpoint=skeleton.joints[skeleton.jointlabels[abdomen]].position*.5+skeleton.joints[skeleton.jointlabels[neck]].position*.5+skeleton.forward*.8; for(j=0;jtemppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; + if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; } if((currentanimation==knifeslashreversalanim&&targetanimation==knifeslashreversalanim)||(currentanimation==knifeslashreversedanim&&targetanimation==knifeslashreversedanim)){ XYZ temppoint1,temppoint2,tempforward; @@ -7497,7 +7497,7 @@ int Person::DrawSkeleton(){ weapons.rotation3[i]=0; weapons.smallrotation[i]=90; weapons.smallrotation2[i]=0; - if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; + if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; } if(targetanimation==knifethrowanim){ weapons.smallrotation[i]=90; @@ -7540,7 +7540,7 @@ int Person::DrawSkeleton(){ weapons.rotation3[i]=0; weapons.smallrotation[i]=90; weapons.smallrotation2[i]=0; - if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; + if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; } } if(weapons.type[i]==staff){ @@ -7562,7 +7562,7 @@ int Person::DrawSkeleton(){ weapons.rotation3[i]=0; weapons.smallrotation[i]=90; weapons.smallrotation2[i]=0; - if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; + if(temppoint1.x>temppoint2.x)weapons.rotation1[i]=360-weapons.rotation1[i]; } } } @@ -7649,11 +7649,11 @@ int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, if(targetanimation==jumpupanim){jumppower=-4;targetanimation=getIdle();} target=0; - targetframe=0; + targetframe=0; onterrain=1; if(id==0){ - FSOUND_SetPaused(channels[whooshsound], TRUE); + FSOUND_SetPaused(channels[whooshsound], true); FSOUND_SetVolume(channels[whooshsound], 0); } @@ -7668,10 +7668,10 @@ int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; - PlaySoundEx( landsound, samp[landsound], NULL, TRUE); + PlaySoundEx( landsound, samp[landsound], NULL, true); FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], FALSE); + FSOUND_SetPaused(channels[landsound], false); if(id==0){ envsound[numenvsounds]=coords; diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index c731434..fd44de1 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -10,7 +10,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -49,7 +49,7 @@ extern int whichjointendarray[26]; #include "Game.h" extern Game * pgame; extern bool visibleloading; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); void dealloc2(void* param){ free(param); @@ -203,7 +203,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) objects.SphereCheckPossible(&terrainlight, 1); /* for(i=0; i2500){ Normalise(&bounceness); bounceness=bounceness*50; - } + } joints[i].velocity+=bounceness*elasticity; @@ -547,10 +547,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound1, samp[landsound1], NULL, TRUE); + PlaySoundEx( landsound1, samp[landsound1], NULL, true); FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel); FSOUND_SetVolume(channels[landsound1], 128); - FSOUND_SetPaused(channels[landsound1], FALSE); + FSOUND_SetPaused(channels[landsound1], false); } breaking=1; } @@ -567,10 +567,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } } @@ -596,10 +596,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[0]=joints[i].velocity.x; vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; - PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE); + PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel); FSOUND_SetVolume(channels[breaksound2], 300); - FSOUND_SetPaused(channels[breaksound2], FALSE); + FSOUND_SetPaused(channels[breaksound2], false); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; @@ -683,9 +683,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) for(i=0; iposition.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z); glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z); } - } + } glEnd(); if(muscleview!=2){ @@ -906,7 +906,7 @@ void Skeleton::SetJoint(float x, float y, float z, int which, int whichjoint) joints[whichjoint].parent=&joints[which]; joints[whichjoint].hasparent=1; joints[whichjoint].length=findDistance(&joints[whichjoint].position,&joints[whichjoint].parent->position); - } + } } } @@ -1102,7 +1102,7 @@ void Animation::Load(char *filename, int aheight, int aattack) funpackf(tfile, "Bf Bf Bf", &weapontarget[i].x,&weapontarget[i].y,&weapontarget[i].z); } - fclose(tfile); + fclose(tfile); } startoffset=0; @@ -1250,8 +1250,8 @@ void Skeleton::Load(char *filename,char *lowfilename,char *clothesfilename, char funpackf(tfile, "Bi", &lowforwardjoints[j]); } for(j=0;j.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); if(terrain.getOpacity(position[i].x,position[i].z)<.2){ XYZ terrainlight; @@ -761,11 +761,11 @@ void Weapons::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)<.2){ XYZ terrainlight; @@ -819,11 +819,11 @@ void Weapons::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } position[i]+=(mid-oldmid)*20; } @@ -863,11 +863,11 @@ void Weapons::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } tippoint[i]+=(mid-oldmid)*20; } @@ -905,11 +905,11 @@ void Weapons::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } } @@ -944,11 +944,11 @@ void Weapons::DoStuff(){ vel[0]=0; vel[1]=0; vel[2]=0; - PlaySoundEx( whichsound, samp[whichsound], NULL, TRUE); + PlaySoundEx( whichsound, samp[whichsound], NULL, true); FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], FALSE); + FSOUND_SetPaused(channels[whichsound], false); } }*/ @@ -1060,7 +1060,7 @@ void Weapons::DoStuff(){ } //velocity[i]=(position[i]-oldposition[i])/multiplier; - //tipvelocity[i]==(tippoint[i-+oldtippoint[i])/multiplier; + //tipvelocity[i]==(tippoint[i-+oldtippoint[i])/multiplier; if(freetime[i]>.4){ velocity[i]=0; tipvelocity[i]=0; @@ -1083,7 +1083,7 @@ void Weapons::DoStuff(){ if(bloodtoggle){ bloodvel=0; sprites.MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1); - } + } } } if(onfire[i]){ @@ -1182,8 +1182,8 @@ int Weapons::Draw() glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); glColor4f(terrainlight.x,terrainlight.y,terrainlight.z,j/drawhowmany[i]); - if(owner[i]!=-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])-.02+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i])); - if(owner[i]==-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i])); + if(owner[i]!=-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])-.02+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i])); + if(owner[i]==-1)glTranslatef(position[i].x*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].x*(1-((float)(j))/drawhowmany[i]),position[i].y*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].y*(1-((float)(j))/drawhowmany[i]),position[i].z*(((float)(j))/drawhowmany[i])+lastdrawnposition[i].z*(1-((float)(j))/drawhowmany[i])); //glTranslatef(position[i].x,position[i].y-.02,position[i].z); glRotatef(bigrotation[i]*(((float)(j))/drawhowmany[i])+lastdrawnbigrotation[i]*(1-((float)(j))/drawhowmany[i]),0,1,0); glRotatef(bigtilt2[i]*(((float)(j))/drawhowmany[i])+lastdrawnbigtilt2[i]*(1-((float)(j))/drawhowmany[i]),1,0,0); @@ -1213,7 +1213,7 @@ int Weapons::Draw() if(type[i]==knife) { - glEnable(GL_LIGHTING); + glEnable(GL_LIGHTING); if(!bloody[i]||!bloodtoggle)throwingknifemodel.drawdifftex(knifetextureptr); if(bloodtoggle) { @@ -1223,7 +1223,7 @@ int Weapons::Draw() } if(type[i]==sword) { - glEnable(GL_LIGHTING); + glEnable(GL_LIGHTING); if(!bloody[i]||!bloodtoggle)swordmodel.drawdifftex(swordtextureptr); if(bloodtoggle) { @@ -1233,7 +1233,7 @@ int Weapons::Draw() } if(type[i]==staff) { - glEnable(GL_LIGHTING); + glEnable(GL_LIGHTING); staffmodel.drawdifftex(stafftextureptr); } @@ -1266,7 +1266,7 @@ int Weapons::Draw() glRotatef(-rotation3[i],0,1,0); glRotatef(smallrotation[i],1,0,0); glRotatef(smallrotation2[i],0,1,0); - glTranslatef(0,0,length[i]); + glTranslatef(0,0,length[i]); glGetFloatv(GL_MODELVIEW_MATRIX,M); tippoint[i].x=M[12]; tippoint[i].y=M[13]; diff --git a/Source/WinDefs.cpp b/Source/WinDefs.cpp new file mode 100644 index 0000000..55a7190 --- /dev/null +++ b/Source/WinDefs.cpp @@ -0,0 +1,134 @@ +/* +Copyright (C) 2003, 2010 - Wolfire Games + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/**> HEADER FILES <**/ +#include "WinDefs.h" +#include +#include +#include +#include + + +class AppTime +{ +public: + AppTime() + { + counterRate = 1; + baseCounter = 0; + QueryPerformanceFrequency( (LARGE_INTEGER*)&counterRate); + QueryPerformanceCounter( (LARGE_INTEGER*)&baseCounter); + } + __int64 counterRate; // LARGE_INTEGER type has no math functions so use int64 + __int64 baseCounter; +}; +static AppTime g_appTime; + + + +void CopyCStringToPascal( const char* src, unsigned char dst[256]) +{ + int len = strlen( src); + dst[ 0] = len; + memcpy( dst + 1, src, len); +} + + +void CopyPascalStringToC( const unsigned char* src, char* dst) +{ + int len = src[ 0]; + memcpy( dst, src + 1, len); + dst[ len] = 0; +} + + +AbsoluteTime UpTime() +{ + __int64 counter; + QueryPerformanceCounter( (LARGE_INTEGER*)&counter); + + counter -= g_appTime.baseCounter; + + AbsoluteTime time; + time.lo = (unsigned long)counter; + time.hi = (unsigned long)(counter >> 32); + return time; +} + + +Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b) +{ + __int64 value = a.hi; + value <<= 32; + value |= a.lo; + __int64 value2 = b.hi; + value2 <<= 32; + value2 |= b.lo; + value -= value2; + + if (value <= 0) + return durationImmediate; + + __int64 frac = value % g_appTime.counterRate; + value /= g_appTime.counterRate; + + Duration time; + + if (value == 0) + { + frac *= -1000000; + frac /= g_appTime.counterRate; + time = (Duration)frac; + } + else + { + frac *= 1000; + frac /= g_appTime.counterRate; + value *= 1000; + value += frac; + time = (Duration)value; + } + + return time; +} + + +static char g_filename[ 256]; +char* ConvertFileName( const char* orgfilename) +{ + // translate filename into proper path name + if (orgfilename[ 0] == ':') + orgfilename++; + strcpy( g_filename, orgfilename); + + for (int n = 0; g_filename[ n]; n++) + { + if (g_filename[ n] == ':') + g_filename[ n] = '/'; + } + + return g_filename; +} + +char* ConvertFileName( const char* orgfilename, const char* junk) +{ + return ConvertFileName(orgfilename); +} diff --git a/Source/WinDefs.h b/Source/WinDefs.h new file mode 100644 index 0000000..e598863 --- /dev/null +++ b/Source/WinDefs.h @@ -0,0 +1,120 @@ +/* +Copyright (C) 2003, 2010 - Wolfire Games + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _WINDEFS_H_ +#define _WINDEFS_H_ +#ifdef WIN32 + + +#include +#include + +// stuff to make Mac code compatable with Windows + + +// disable warnings about double to float conversions +#pragma warning(disable:4305) +#pragma warning(disable:4244) + +// disable warnings about boolean to int conversions +#pragma warning(disable:4800) + +// disable warning about unreferenced local variables +#pragma warning(disable:4101) + +typedef bool Boolean; + + +struct Point +{ + short v; + short h; +}; + +typedef signed char SInt8; +typedef unsigned int UInt32; + + +#include "Random.h" + + +void CopyCStringToPascal( const char* src, unsigned char dst[256]); +void CopyPascalStringToC( const unsigned char* src, char* dst); + + +typedef struct AbsoluteTime +{ + unsigned long hi; + unsigned long lo; +} AbsoluteTime; + +AbsoluteTime UpTime(); // NOTE: returns time since app started, not system start + +typedef long Duration; + +enum +{ + durationMicrosecond = -1, + durationMillisecond = 1, + durationSecond = 1000, + durationMinute = 1000 * 60, + durationHour = 1000 * 60 * 60, + durationDay = 1000 * 60 * 60 * 24, + durationForever = 0x7FFFFFFF, + durationImmediate = 0, +}; + +Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b); + + +inline bool isnormal( double x) +{ + int ret = _fpclass( x); + return (ret == _FPCLASS_NN || ret == _FPCLASS_PN); +} + +typedef unsigned int uintptr_t; + + +// fix file names to use '/' instead of ':' +char* ConvertFileName( const char* orgfilename); +char* ConvertFileName( const char* orgfilename, const char* junk); + + +#define fopen( a, b) fopen( ConvertFileName( a), b); + +inline float abs( float f) +{ + if (f < 0) + return -f; + return f; +} + +inline double abs( double f) +{ + if (f < 0) + return -f; + return f; +} + + +#endif +#endif diff --git a/Source/WinInput.cpp b/Source/WinInput.cpp index 53a5598..513924d 100644 --- a/Source/WinInput.cpp +++ b/Source/WinInput.cpp @@ -64,297 +64,297 @@ Boolean IsKeyDown( unsigned char *keyMap, unsigned short theKey ) unsigned short CharToKey(char* which) { // alphabetic keys - if(!stricmp(which,"a")){ + if(!strcasecmp(which,"a")){ return MAC_A_KEY; } - if(!stricmp(which,"b")){ + if(!strcasecmp(which,"b")){ return MAC_B_KEY; } - if(!stricmp(which,"c")){ + if(!strcasecmp(which,"c")){ return MAC_C_KEY; } - if(!stricmp(which,"d")){ + if(!strcasecmp(which,"d")){ return MAC_D_KEY; } - if(!stricmp(which,"e")){ + if(!strcasecmp(which,"e")){ return MAC_E_KEY; } - if(!stricmp(which,"f")){ + if(!strcasecmp(which,"f")){ return MAC_F_KEY; } - if(!stricmp(which,"g")){ + if(!strcasecmp(which,"g")){ return MAC_G_KEY; } - if(!stricmp(which,"h")){ + if(!strcasecmp(which,"h")){ return MAC_H_KEY; } - if(!stricmp(which,"i")){ + if(!strcasecmp(which,"i")){ return MAC_I_KEY; } - if(!stricmp(which,"j")){ + if(!strcasecmp(which,"j")){ return MAC_J_KEY; } - if(!stricmp(which,"k")){ + if(!strcasecmp(which,"k")){ return MAC_K_KEY; } - if(!stricmp(which,"l")){ + if(!strcasecmp(which,"l")){ return MAC_L_KEY; } - if(!stricmp(which,"m")){ + if(!strcasecmp(which,"m")){ return MAC_M_KEY; } - if(!stricmp(which,"n")){ + if(!strcasecmp(which,"n")){ return MAC_N_KEY; } - if(!stricmp(which,"o")){ + if(!strcasecmp(which,"o")){ return MAC_O_KEY; } - if(!stricmp(which,"p")){ + if(!strcasecmp(which,"p")){ return MAC_P_KEY; } - if(!stricmp(which,"q")){ + if(!strcasecmp(which,"q")){ return MAC_Q_KEY; } - if(!stricmp(which,"r")){ + if(!strcasecmp(which,"r")){ return MAC_R_KEY; } - if(!stricmp(which,"s")){ + if(!strcasecmp(which,"s")){ return MAC_S_KEY; } - if(!stricmp(which,"t")){ + if(!strcasecmp(which,"t")){ return MAC_T_KEY; } - if(!stricmp(which,"u")){ + if(!strcasecmp(which,"u")){ return MAC_U_KEY; } - if(!stricmp(which,"v")){ + if(!strcasecmp(which,"v")){ return MAC_V_KEY; } - if(!stricmp(which,"w")){ + if(!strcasecmp(which,"w")){ return MAC_W_KEY; } - if(!stricmp(which,"x")){ + if(!strcasecmp(which,"x")){ return MAC_X_KEY; } - if(!stricmp(which,"y")){ + if(!strcasecmp(which,"y")){ return MAC_Y_KEY; } - if(!stricmp(which,"z")){ + if(!strcasecmp(which,"z")){ return MAC_Z_KEY; } // keypad keys - if(!stricmp(which,"KP0")){ + if(!strcasecmp(which,"KP0")){ return MAC_NUMPAD_0_KEY; } - if(!stricmp(which,"KP1")){ + if(!strcasecmp(which,"KP1")){ return MAC_NUMPAD_1_KEY; } - if(!stricmp(which,"KP2")){ + if(!strcasecmp(which,"KP2")){ return MAC_NUMPAD_2_KEY; } - if(!stricmp(which,"KP3")){ + if(!strcasecmp(which,"KP3")){ return MAC_NUMPAD_3_KEY; } - if(!stricmp(which,"KP4")){ + if(!strcasecmp(which,"KP4")){ return MAC_NUMPAD_4_KEY; } - if(!stricmp(which,"KP5")){ + if(!strcasecmp(which,"KP5")){ return MAC_NUMPAD_5_KEY; } - if(!stricmp(which,"KP6")){ + if(!strcasecmp(which,"KP6")){ return MAC_NUMPAD_6_KEY; } - if(!stricmp(which,"KP7")){ + if(!strcasecmp(which,"KP7")){ return MAC_NUMPAD_7_KEY; } - if(!stricmp(which,"KP8")){ + if(!strcasecmp(which,"KP8")){ return MAC_NUMPAD_8_KEY; } - if(!stricmp(which,"KP9")){ + if(!strcasecmp(which,"KP9")){ return MAC_NUMPAD_9_KEY; } // enter - if(!stricmp(which,"enter")){ + if(!strcasecmp(which,"enter")){ return MAC_ENTER_KEY; } // number keys - if(!stricmp(which,"0")){ + if(!strcasecmp(which,"0")){ return MAC_0_KEY; } - if(!stricmp(which,"1")){ + if(!strcasecmp(which,"1")){ return MAC_1_KEY; } - if(!stricmp(which,"2")){ + if(!strcasecmp(which,"2")){ return MAC_2_KEY; } - if(!stricmp(which,"3")){ + if(!strcasecmp(which,"3")){ return MAC_3_KEY; } - if(!stricmp(which,"4")){ + if(!strcasecmp(which,"4")){ return MAC_4_KEY; } - if(!stricmp(which,"5")){ + if(!strcasecmp(which,"5")){ return MAC_5_KEY; } - if(!stricmp(which,"6")){ + if(!strcasecmp(which,"6")){ return MAC_6_KEY; } - if(!stricmp(which,"7")){ + if(!strcasecmp(which,"7")){ return MAC_7_KEY; } - if(!stricmp(which,"8")){ + if(!strcasecmp(which,"8")){ return MAC_8_KEY; } - if(!stricmp(which,"9")){ + if(!strcasecmp(which,"9")){ return MAC_9_KEY; } // function keys - if(!stricmp(which,"F1")){ + if(!strcasecmp(which,"F1")){ return MAC_F1_KEY; } - if(!stricmp(which,"F2")){ + if(!strcasecmp(which,"F2")){ return MAC_F2_KEY; } - if(!stricmp(which,"F3")){ + if(!strcasecmp(which,"F3")){ return MAC_F3_KEY; } - if(!stricmp(which,"F4")){ + if(!strcasecmp(which,"F4")){ return MAC_F4_KEY; } - if(!stricmp(which,"F5")){ + if(!strcasecmp(which,"F5")){ return MAC_F5_KEY; } - if(!stricmp(which,"F6")){ + if(!strcasecmp(which,"F6")){ return MAC_F6_KEY; } - if(!stricmp(which,"F7")){ + if(!strcasecmp(which,"F7")){ return MAC_F7_KEY; } - if(!stricmp(which,"F8")){ + if(!strcasecmp(which,"F8")){ return MAC_F8_KEY; } - if(!stricmp(which,"F9")){ + if(!strcasecmp(which,"F9")){ return MAC_F9_KEY; } - if(!stricmp(which,"F10")){ + if(!strcasecmp(which,"F10")){ return MAC_F10_KEY; } - if(!stricmp(which,"F11")){ + if(!strcasecmp(which,"F11")){ return MAC_F11_KEY; } - if(!stricmp(which,"F12")){ + if(!strcasecmp(which,"F12")){ return MAC_F12_KEY; } // escape - if(!stricmp(which,"escape")){ + if(!strcasecmp(which,"escape")){ return MAC_ESCAPE_KEY; } - if(!stricmp(which,"backspace")){ + if(!strcasecmp(which,"backspace")){ return MAC_DELETE_KEY; } - if(!stricmp(which,"tab")){ + if(!strcasecmp(which,"tab")){ return MAC_TAB_KEY; } - if(!stricmp(which,"`")){ + if(!strcasecmp(which,"`")){ return MAC_TILDE_KEY; } - if(!stricmp(which,"caps_lock")){ + if(!strcasecmp(which,"caps_lock")){ return MAC_CAPS_LOCK_KEY; } // if(which==){ // return ""; // } - if(!stricmp(which,"command")){ + if(!strcasecmp(which,"command")){ return MAC_COMMAND_KEY; } - if(!stricmp(which,"option")){ + if(!strcasecmp(which,"option")){ return MAC_OPTION_KEY; } - if(!stricmp(which,"delete")){ + if(!strcasecmp(which,"delete")){ return MAC_DEL_KEY; } - if(!stricmp(which,"insert")){ + if(!strcasecmp(which,"insert")){ return MAC_INSERT_KEY; } - if(!stricmp(which,"home")){ + if(!strcasecmp(which,"home")){ return MAC_HOME_KEY; } - if(!stricmp(which,"end")){ + if(!strcasecmp(which,"end")){ return MAC_END_KEY; } - if(!stricmp(which,"page_up")){ + if(!strcasecmp(which,"page_up")){ return MAC_PAGE_UP_KEY; } - if(!stricmp(which,"page_down")){ + if(!strcasecmp(which,"page_down")){ return MAC_PAGE_DOWN_KEY; } - if(!stricmp(which,"clear")){ + if(!strcasecmp(which,"clear")){ return MAC_NUMPAD_CLEAR_KEY; } - if(!stricmp(which,"control")){ + if(!strcasecmp(which,"control")){ return MAC_CONTROL_KEY; } - if(!stricmp(which,"return")){ + if(!strcasecmp(which,"return")){ return MAC_RETURN_KEY; } - if(!stricmp(which,"space")){ + if(!strcasecmp(which,"space")){ return MAC_SPACE_KEY; } - if(!stricmp(which,"shift")){ + if(!strcasecmp(which,"shift")){ return MAC_SHIFT_KEY; } - if(!stricmp(which,"uparrow")){ + if(!strcasecmp(which,"uparrow")){ return MAC_ARROW_UP_KEY; } - if(!stricmp(which,"downarrow")){ + if(!strcasecmp(which,"downarrow")){ return MAC_ARROW_DOWN_KEY; } - if(!stricmp(which,"leftarrow")){ + if(!strcasecmp(which,"leftarrow")){ return MAC_ARROW_LEFT_KEY; } - if(!stricmp(which,"rightarrow")){ + if(!strcasecmp(which,"rightarrow")){ return MAC_ARROW_RIGHT_KEY; } - if(!stricmp(which,"mouse1")){ + if(!strcasecmp(which,"mouse1")){ return MAC_MOUSEBUTTON1; } - if(!stricmp(which,"mouse2")){ + if(!strcasecmp(which,"mouse2")){ return MAC_MOUSEBUTTON2; } - if(!stricmp(which,"+")){ + if(!strcasecmp(which,"+")){ return MAC_NUMPAD_PLUS_KEY; } - if(!stricmp(which,"*")){ + if(!strcasecmp(which,"*")){ return MAC_NUMPAD_ASTERISK_KEY; } - if(!stricmp(which,"/")){ + if(!strcasecmp(which,"/")){ return MAC_SLASH_KEY; } - if(!stricmp(which,"\\")){ + if(!strcasecmp(which,"\\")){ return MAC_BACKSLASH_KEY; } - if(!stricmp(which,"[")){ + if(!strcasecmp(which,"[")){ return MAC_LEFTBRACKET_KEY; } - if(!stricmp(which,"]")){ + if(!strcasecmp(which,"]")){ return MAC_RIGHTBRACKET_KEY; } - if(!stricmp(which,".")){ + if(!strcasecmp(which,".")){ return MAC_PERIOD_KEY; } - if(!stricmp(which,",")){ + if(!strcasecmp(which,",")){ return MAC_COMMA_KEY; } - if(!stricmp(which,"\"")){ + if(!strcasecmp(which,"\"")){ return MAC_APOSTROPHE_KEY; } - if(!stricmp(which,";")){ + if(!strcasecmp(which,";")){ return MAC_SEMICOLON_KEY; } return UNKNOWN_KEY; diff --git a/Source/gamegl.h b/Source/gamegl.h index c88278a..203cc4d 100644 --- a/Source/gamegl.h +++ b/Source/gamegl.h @@ -33,13 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef WIN32 #if PLATFORM_UNIX #define GL_GLEXT_PROTOTYPES - #include "gl.h" - #include "glu.h" - #include "glext.h" + #include "GL/gl.h" + #include "GL/glu.h" + #include "GL/glext.h" #else - #include - #include - #include + #include + #include + #include #endif #else #define WIN32_LEAN_AND_MEAN diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index 41be240..9f8debc 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -205,15 +205,15 @@ void F_API OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, signed char F_API OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel) { - if (!initialized) return FALSE; - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if (!initialized) return false; + if ((channel < 0) || (channel >= num_channels)) return false; if (pos != NULL) set_channel_position(channel, pos[0], pos[1], -pos[2]); // we ignore velocity, since doppler's broken in the Linux AL at the moment... - return TRUE; + return true; } void F_API OPENAL_3D_SetDopplerFactor(float scale) @@ -224,31 +224,31 @@ void F_API OPENAL_3D_SetDopplerFactor(float scale) signed char F_API OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags) { - if (initialized) return FALSE; - if (maxsoftwarechannels == 0) return FALSE; + if (initialized) return false; + if (maxsoftwarechannels == 0) return false; if (flags != 0) // unsupported. - return FALSE; + return false; if (!lookup_all_alsyms("./openal.so")) // !!! FIXME: linux specific lib name { if (!lookup_all_alsyms("openal.so.1")) // !!! FIXME: linux specific lib name { if (!lookup_all_alsyms("openal.so")) // !!! FIXME: linux specific lib name - return FALSE; + return false; } } ALCdevice *dev = alcOpenDevice(NULL); if (!dev) - return FALSE; + return false; ALint caps[] = { ALC_FREQUENCY, mixrate, 0 }; ALCcontext *ctx = alcCreateContext(dev, caps); if (!ctx) { alcCloseDevice(dev); - return FALSE; + return false; } alcMakeContextCurrent(ctx); @@ -270,7 +270,7 @@ signed char F_API OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int alGenSources(1, &channels[i].sid); // !!! FIXME: verify this didn't fail! initialized = true; - return TRUE; + return true; } void F_API OPENAL_Close() @@ -310,14 +310,14 @@ FSOUND_SAMPLE *F_API OPENAL_GetCurrentSample(int channel) signed char F_API OPENAL_GetPaused(int channel) { - if (!initialized) return FALSE; - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if (!initialized) return false; + if ((channel < 0) || (channel >= num_channels)) return false; if (channels[channel].startpaused) - return(TRUE); + return(true); ALint state = 0; alGetSourceiv(channels[channel].sid, AL_SOURCE_STATE, &state); - return((state == AL_PAUSED) ? TRUE : FALSE); + return((state == AL_PAUSED) ? true : false); } unsigned int F_API OPENAL_GetLoopMode(int channel) @@ -333,11 +333,11 @@ unsigned int F_API OPENAL_GetLoopMode(int channel) signed char F_API OPENAL_IsPlaying(int channel) { - if (!initialized) return FALSE; - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if (!initialized) return false; + if ((channel < 0) || (channel >= num_channels)) return false; ALint state = 0; alGetSourceiv(channels[channel].sid, AL_SOURCE_STATE, &state); - return((state == AL_PLAYING) ? TRUE : FALSE); + return((state == AL_PLAYING) ? true : false); } int F_API OPENAL_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused) @@ -525,17 +525,17 @@ void F_API OPENAL_Sample_Free(FSOUND_SAMPLE *sptr) signed char F_API OPENAL_Sample_SetMode(FSOUND_SAMPLE *sptr, unsigned int mode) { - if (!initialized) return FALSE; - if ((mode != FSOUND_LOOP_NORMAL) && (mode != FSOUND_LOOP_OFF)) return FALSE; - if (!sptr) return FALSE; + if (!initialized) return false; + if ((mode != FSOUND_LOOP_NORMAL) && (mode != FSOUND_LOOP_OFF)) return false; + if (!sptr) return false; sptr->mode = mode; - return TRUE; + return true; } signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float mindist, float maxdist) { - if (!initialized) return FALSE; - if (sptr == NULL) return FALSE; + if (!initialized) return false; + if (sptr == NULL) return false; sptr->min_distance = mindist; // we ignore maxdist. It's not really important to this game, and the // FMOD docs suggest that it's worthless anyhow. @@ -555,54 +555,54 @@ signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min signed char F_API OPENAL_SetFrequency(int channel, int freq) { - if (!initialized) return FALSE; + if (!initialized) return false; if (channel == FSOUND_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetFrequency(i, freq); - return TRUE; + return true; } - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if ((channel < 0) || (channel >= num_channels)) return false; if (freq == 8012) // hack alSourcef(channels[channel].sid, AL_PITCH, 8012.0f / 44100.0f); else alSourcef(channels[channel].sid, AL_PITCH, 1.0f); - return TRUE; + return true; } signed char F_API OPENAL_SetVolume(int channel, int vol) { - if (!initialized) return FALSE; + if (!initialized) return false; if (channel == FSOUND_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetVolume(i, vol); - return TRUE; + return true; } - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if ((channel < 0) || (channel >= num_channels)) return false; if (vol < 0) vol = 0; else if (vol > 255) vol = 255; ALfloat gain = ((ALfloat) vol) / 255.0f; alSourcef(channels[channel].sid, AL_GAIN, gain); - return TRUE; + return true; } signed char F_API OPENAL_SetPaused(int channel, signed char paused) { - if (!initialized) return FALSE; + if (!initialized) return false; if (channel == FSOUND_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetPaused(i, paused); - return TRUE; + return true; } - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if ((channel < 0) || (channel >= num_channels)) return false; ALint state = 0; if (channels[channel].startpaused) @@ -617,7 +617,7 @@ signed char F_API OPENAL_SetPaused(int channel, signed char paused) alSourcePlay(channels[channel].sid); channels[channel].startpaused = false; } - return TRUE; + return true; } void F_API OPENAL_SetSFXMasterVolume(int volume) @@ -629,19 +629,19 @@ void F_API OPENAL_SetSFXMasterVolume(int volume) signed char F_API OPENAL_StopSound(int channel) { - if (!initialized) return FALSE; + if (!initialized) return false; if (channel == FSOUND_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_StopSound(i); - return TRUE; + return true; } - if ((channel < 0) || (channel >= num_channels)) return FALSE; + if ((channel < 0) || (channel >= num_channels)) return false; alSourceStop(channels[channel].sid); channels[channel].startpaused = false; - return TRUE; + return true; } FSOUND_STREAM * F_API OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length) @@ -667,7 +667,7 @@ int F_API OPENAL_Stream_PlayEx(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNI signed char F_API OPENAL_Stream_Stop(FSOUND_STREAM *stream) { - if (!initialized) return FALSE; + if (!initialized) return false; for (int i = 0; i < num_channels; i++) { if (channels[i].sample == (FSOUND_SAMPLE *) stream) @@ -676,7 +676,7 @@ signed char F_API OPENAL_Stream_Stop(FSOUND_STREAM *stream) channels[i].startpaused = false; } } - return TRUE; + return true; } signed char F_API OPENAL_Stream_SetMode(FSOUND_STREAM *stream, unsigned int mode) @@ -692,7 +692,7 @@ void F_API OPENAL_Update() signed char F_API OPENAL_SetOutput(int outputtype) { - return TRUE; + return true; } #endif diff --git a/cmake/Modules/FindOggVorbis.cmake b/cmake/Modules/FindOggVorbis.cmake new file mode 100644 index 0000000..8f90b9d --- /dev/null +++ b/cmake/Modules/FindOggVorbis.cmake @@ -0,0 +1,91 @@ +# - Try to find the OggVorbis libraries +# Once done this will define +# +# OGGVORBIS_FOUND - system has OggVorbis +# OGGVORBIS_VERSION - set either to 1 or 2 +# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory +# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis +# OGG_LIBRARY - The Ogg library +# VORBIS_LIBRARY - The Vorbis library +# VORBISFILE_LIBRARY - The VorbisFile library +# VORBISENC_LIBRARY - The VorbisEnc library + +# Copyright (c) 2006, Richard Laerkaeng, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +include (CheckLibraryExists) + +find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) +find_path(OGG_INCLUDE_DIR ogg/ogg.h) + +find_library(OGG_LIBRARY NAMES ogg) +find_library(VORBIS_LIBRARY NAMES vorbis) +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) +find_library(VORBISENC_LIBRARY NAMES vorbisenc) + +mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR + OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY) + + +if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set(OGGVORBIS_FOUND TRUE) + + set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY}) + + set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES}) + check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP}) + + if (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 2) + else (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 1) + endif (HAVE_LIBVORBISENC2) + +else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set (OGGVORBIS_VERSION) + set(OGGVORBIS_FOUND FALSE) +endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + + +if (OGGVORBIS_FOUND) + if (NOT OggVorbis_FIND_QUIETLY) + message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}") + endif (NOT OggVorbis_FIND_QUIETLY) +else (OGGVORBIS_FOUND) + if (OggVorbis_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OggVorbis libraries") + endif (OggVorbis_FIND_REQUIRED) + if (NOT OggVorbis_FIND_QUITELY) + message(STATUS "Could NOT find OggVorbis libraries") + endif (NOT OggVorbis_FIND_QUITELY) +endif (OGGVORBIS_FOUND) + +#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H) +#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG) +#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS) +#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE) +#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC) +#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + +#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis found") +# set (VORBIS_LIBS "-lvorbis") +# set (OGG_LIBS "-logg") +# set (VORBISFILE_LIBS "-lvorbisfile") +# set (VORBISENC_LIBS "-lvorbisenc") +# set (OGGVORBIS_FOUND TRUE) +# if (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 2) +# else (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 1) +# endif (HAVE_LIBVORBISENC2) +#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis not found") +#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) + + diff --git a/makefile b/makefile deleted file mode 100644 index 223e3b8..0000000 --- a/makefile +++ /dev/null @@ -1,393 +0,0 @@ - -macosx := false -use_devil := false -use_fmod := false - -ifeq ($(strip $(shell uname -s)),Darwin) - macosx := true -endif - -#OPT += -O0 -OPT += -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno -#OPT += -Os -fno-strict-aliasing - -BINDIR := bin -RUNDIR := Data -SRCDIR := Source -SDLDIR := SDL12 -LIBPNGDIR := libpng-1.2.8 -JPEGLIBDIR := jpeg-6b -ZLIBDIR := zlib-1.2.3 -OPENALDIR := OpenAL -GLUDIR := GLU -LIBOGGDIR := libogg-1.0 -LIBVORBISDIR := libvorbis-1.0.1 - -ifeq ($(strip $(macosx)),true) - CXX := g++-4.0 - CC := gcc-4.0 - LD := g++-4.0 - - ifeq ($(strip $(use_devil)),true) - $(error DEVIL isn't supported in the Mac OS X builds right now.) - endif - - ifeq ($(strip $(use_fmod)),true) - $(error FMOD isn't supported in the Mac OS X builds right now.) - endif - - ifeq ($(strip $(XCODE_DIR)),) - XCODE_DIR := /Developer - endif - - ifeq ($(strip $(macosx_arch)),) - macosx_arch := $(shell uname -m) - endif - - ifeq ($(strip $(macosx_arch)),ppc) - macosx_arch_okay := true - macosx_version_min := 10.4 - macosx_version_min_required := 1040 - macosx_sdk_dir := MacOSX10.4u.sdk - macosx_gcc_dir := powerpc-apple-darwin10/4.0.1 - macosx_gcc_libdir := $(macosx_gcc_dir) - macosx_cxx_dir := powerpc-apple-darwin8 - endif - - ifeq ($(strip $(macosx_arch)),i386) - macosx_arch_okay := true - macosx_version_min := 10.4 - macosx_version_min_required := 1040 - macosx_sdk_dir := MacOSX10.4u.sdk - macosx_gcc_dir := i686-apple-darwin10/4.0.1 - macosx_gcc_libdir := $(macosx_gcc_dir) - macosx_cxx_dir := i686-apple-darwin8 - endif - - ifeq ($(strip $(macosx_arch)),x86_64) - macosx_arch_okay := true - macosx_version_min := 10.6 - macosx_version_min_required := 1060 - macosx_sdk_dir := MacOSX10.6.sdk - macosx_gcc_dir := i686-apple-darwin10/4.0.1 - macosx_gcc_libdir := $(macosx_gcc_dir)/x86_64 - macosx_cxx_dir := x86_64-apple-darwin8 - endif - - ifneq ($(strip $(macosx_arch_okay)),true) - $(error Unknown Mac OS X architecture. Please update the makefile.) - endif - - EXEEXT := $(macosx_arch) - - CFLAGS += -arch $(macosx_arch) - CFLAGS += -mmacosx-version-min=$(macosx_version_min) - CFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=$(macosx_version_min_required) - CFLAGS += -nostdinc - CFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks - CFLAGS += -I$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_dir)/include - CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include - CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0 - CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir) - CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)/bits - CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/backward - CFLAGS += -mdynamic-no-pic - - LDFLAGS += -arch $(macosx_arch) - LDFLAGS += -mmacosx-version-min=$(macosx_version_min) - LDFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks - LDFLAGS += -L$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_libdir) - LDFLAGS += -Wl,-syslibroot,$(XCODE_DIR)/SDKs/$(macosx_sdk_dir) - LDFLAGS += -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL - LDFLAGS += ./libSDL-1.2.0.dylib ./libSDLmain-osx.a -else - CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ - CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc - LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ - - CFLAGS += -DPLATFORM_LINUX=1 - LDFLAGS += ./libSDL-1.2.so.0 -Wl,-rpath,\$$ORIGIN - - ifeq ($(strip $(use_devil)),true) - LDFLAGS += ./libIL.so.1 ./libILU.so.1 ./libILUT.so.1 - endif - - ifeq ($(strip $(use_fmod)),true) - POSTLDFLAGS += -lpthread ./libfmod-linux-x86.a - else - LDFLAGS += ./libopenal.so.1 - endif -endif - -DEFINES += \ - -DPLATFORM_UNIX=1 \ - -DUSE_SDL=1 \ - -DTRUE=1 \ - -DFALSE=0 \ - -Dstricmp=strcasecmp \ - -DBinIO_STDINT_HEADER="" \ - -INCLUDES += \ - -I$(SRCDIR) \ - -I$(SDLDIR)/include \ - -I./OpenGL/ \ - -I./OpenGL/GL \ - -ifeq ($(strip $(use_devil)),true) - DEFINES += -DUSE_DEVIL=1 - INCLUDES += -I$(SRCDIR)/devil/include -else - DEFINES += -DZ_PREFIX=1 - INCLUDES += -I$(ZLIBDIR) -I$(LIBPNGDIR) -I$(JPEGLIBDIR) -endif - -ifeq ($(strip $(use_fmod)),false) - DEFINES += -DUSE_OPENAL=1 - INCLUDES += -I$(OPENALDIR)/include -I$(LIBOGGDIR)/include -I$(LIBVORBISDIR)/include -endif - -CFLAGS += -g -c $(OPT) $(INCLUDES) $(DEFINES) -fsigned-char -pipe -w - - -ifeq ($(strip $(EXEEXT)),) - EXEEXT := bin -endif -EXE := $(RUNDIR)/lugaru-$(EXEEXT) - -CXXFLAGS := $(CFLAGS) - -SRCS := \ - Frustum.cpp \ - GameDraw.cpp \ - GameInitDispose.cpp \ - GameTick.cpp \ - Globals.cpp \ - Lights.cpp \ - Models.cpp \ - Objects.cpp \ - pack.c \ - pack_private.c \ - Person.cpp \ - private.c \ - Quaternions.cpp \ - Random.c \ - Skeleton.cpp \ - Skybox.cpp \ - Sprites.cpp \ - Terrain.cpp \ - Text.cpp \ - TGALoader.cpp \ - unpack.c \ - unpack_private.c \ - Weapons.cpp \ - MacCompatibility.cpp \ - logger/logger.cpp \ - WinInput.cpp \ - OpenGL_Windows.cpp \ - openal_wrapper.cpp \ - -SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f)) - - -UNUSED_SRCS := \ - DRIVER.CC \ - MD5.CC \ - - -PNGSRCS := \ - png.c \ - pngerror.c \ - pnggccrd.c \ - pngget.c \ - pngmem.c \ - pngpread.c \ - pngread.c \ - pngrio.c \ - pngrtran.c \ - pngrutil.c \ - pngset.c \ - pngtrans.c \ - pngvcrd.c \ - pngwio.c \ - pngwrite.c \ - pngwtran.c \ - pngwutil.c \ - -PNGSRCS := $(foreach f,$(PNGSRCS),$(LIBPNGDIR)/$(f)) - -JPEGSRCS := \ - jdapistd.c \ - jdmaster.c \ - jdapimin.c \ - jcapimin.c \ - jdmerge.c \ - jdatasrc.c \ - jdatadst.c \ - jdcoefct.c \ - jdcolor.c \ - jddctmgr.c \ - jdhuff.c \ - jdinput.c \ - jdmainct.c \ - jdmarker.c \ - jdphuff.c \ - jdpostct.c \ - jdsample.c \ - jdtrans.c \ - jerror.c \ - jidctflt.c \ - jidctfst.c \ - jidctint.c \ - jidctred.c \ - jmemmgr.c \ - jutils.c \ - jmemnobs.c \ - jquant1.c \ - jquant2.c \ - jcomapi.c \ - jcmarker.c \ - jcapistd.c \ - jcparam.c \ - jcinit.c \ - jcdctmgr.c \ - jccoefct.c \ - jcmainct.c \ - jfdctflt.c \ - jfdctint.c \ - jfdctfst.c \ - jchuff.c \ - jcphuff.c \ - jcsample.c \ - jcmaster.c \ - jccolor.c \ - jcprepct.c \ - -JPEGSRCS := $(foreach f,$(JPEGSRCS),$(JPEGLIBDIR)/$(f)) - - -ZLIBSRCS = \ - adler32.c \ - compress.c \ - crc32.c \ - deflate.c \ - gzio.c \ - infback.c \ - inffast.c \ - inflate.c \ - inftrees.c \ - trees.c \ - uncompr.c \ - zutil.c \ - -ZLIBSRCS := $(foreach f,$(ZLIBSRCS),$(ZLIBDIR)/$(f)) - - -GLUSRCS := \ - dict.c \ - geom.c \ - memalloc.c \ - mesh.c \ - mipmap.c \ - normal.c \ - priorityq.c \ - render.c \ - sweep.c \ - tess.c \ - tessmono.c \ - util.c \ - -GLUSRCS := $(foreach f,$(GLUSRCS),$(GLUDIR)/$(f)) - - -OGGSRCS := \ - bitwise.o \ - framing.o - -OGGSRCS := $(foreach f,$(OGGSRCS),$(LIBOGGDIR)/src/$(f)) - -VORBISSRCS := \ - analysis.o \ - bitrate.o \ - block.o \ - codebook.o \ - envelope.o \ - floor0.o \ - floor1.o \ - info.o \ - lpc.o \ - lsp.o \ - mapping0.o \ - mdct.o \ - psy.o \ - registry.o \ - res0.o \ - sharedbook.o \ - smallft.o \ - synthesis.o \ - vorbisfile.o \ - window.o - -VORBISSRCS := $(foreach f,$(VORBISSRCS),$(LIBVORBISDIR)/lib/$(f)) - -ifeq ($(strip $(macosx)),false) - SRCS += $(GLUSRCS) -endif - -ifeq ($(strip $(use_devil)),false) - SRCS += $(PNGSRCS) $(JPEGSRCS) $(ZLIBSRCS) -endif - -ifeq ($(strip $(use_fmod)),false) - SRCS += $(OGGSRCS) $(VORBISSRCS) -endif - -OBJS := $(SRCS:.CC=.o) -OBJS := $(OBJS:.cc=.o) -OBJS := $(OBJS:.cpp=.o) -OBJS := $(OBJS:.c=.o) -OBJS := $(OBJS:.m=.o) -OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f)) - - -.PHONY: clean all - -all : $(EXE) - -$(BINDIR)/%.o : %.cpp - @mkdir -p $(dir $@) - $(CXX) -o $@ $(CXXFLAGS) $< - -$(BINDIR)/%.o : %.CC - @mkdir -p $(dir $@) - $(CXX) -x c++ -o $@ $(CXXFLAGS) $< - -$(BINDIR)/%.o : %.cc - @mkdir -p $(dir $@) - $(CXX) -o $@ $(CXXFLAGS) $< - -$(BINDIR)/%.o : %.m - @mkdir -p $(dir $@) - $(CC) -o $@ $(CFLAGS) $< - -$(BINDIR)/%.o : %.c - @mkdir -p $(dir $@) - $(CC) -o $@ $(CFLAGS) $< - -$(EXE) : $(OBJS) $(APPOBJS) - @mkdir -p $(dir $@) - $(LD) -o $@ $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS) - -clean: - rm -f $(BINDIR)/*.o - rm -f $(BINDIR)/$(SRCDIR)/*.o - rm -f $(BINDIR)/$(SRCDIR)/logger/*.o - rm -f $(BINDIR)/$(GLUDIR)/*.o - rm -f $(BINDIR)/$(LIBPNGDIR)/*.o - rm -f $(BINDIR)/$(JPEGLIBDIR)/*.o - rm -f $(BINDIR)/$(ZLIBDIR)/*.o - rm -f $(BINDIR)/$(LIBOGGDIR)/src/*.o - rm -f $(BINDIR)/$(LIBVORBISDIR)/lib/*.o - rm -f $(EXE) - -# end of makefile ... - diff --git a/makefile.old b/makefile.old new file mode 100644 index 0000000..223e3b8 --- /dev/null +++ b/makefile.old @@ -0,0 +1,393 @@ + +macosx := false +use_devil := false +use_fmod := false + +ifeq ($(strip $(shell uname -s)),Darwin) + macosx := true +endif + +#OPT += -O0 +OPT += -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno +#OPT += -Os -fno-strict-aliasing + +BINDIR := bin +RUNDIR := Data +SRCDIR := Source +SDLDIR := SDL12 +LIBPNGDIR := libpng-1.2.8 +JPEGLIBDIR := jpeg-6b +ZLIBDIR := zlib-1.2.3 +OPENALDIR := OpenAL +GLUDIR := GLU +LIBOGGDIR := libogg-1.0 +LIBVORBISDIR := libvorbis-1.0.1 + +ifeq ($(strip $(macosx)),true) + CXX := g++-4.0 + CC := gcc-4.0 + LD := g++-4.0 + + ifeq ($(strip $(use_devil)),true) + $(error DEVIL isn't supported in the Mac OS X builds right now.) + endif + + ifeq ($(strip $(use_fmod)),true) + $(error FMOD isn't supported in the Mac OS X builds right now.) + endif + + ifeq ($(strip $(XCODE_DIR)),) + XCODE_DIR := /Developer + endif + + ifeq ($(strip $(macosx_arch)),) + macosx_arch := $(shell uname -m) + endif + + ifeq ($(strip $(macosx_arch)),ppc) + macosx_arch_okay := true + macosx_version_min := 10.4 + macosx_version_min_required := 1040 + macosx_sdk_dir := MacOSX10.4u.sdk + macosx_gcc_dir := powerpc-apple-darwin10/4.0.1 + macosx_gcc_libdir := $(macosx_gcc_dir) + macosx_cxx_dir := powerpc-apple-darwin8 + endif + + ifeq ($(strip $(macosx_arch)),i386) + macosx_arch_okay := true + macosx_version_min := 10.4 + macosx_version_min_required := 1040 + macosx_sdk_dir := MacOSX10.4u.sdk + macosx_gcc_dir := i686-apple-darwin10/4.0.1 + macosx_gcc_libdir := $(macosx_gcc_dir) + macosx_cxx_dir := i686-apple-darwin8 + endif + + ifeq ($(strip $(macosx_arch)),x86_64) + macosx_arch_okay := true + macosx_version_min := 10.6 + macosx_version_min_required := 1060 + macosx_sdk_dir := MacOSX10.6.sdk + macosx_gcc_dir := i686-apple-darwin10/4.0.1 + macosx_gcc_libdir := $(macosx_gcc_dir)/x86_64 + macosx_cxx_dir := x86_64-apple-darwin8 + endif + + ifneq ($(strip $(macosx_arch_okay)),true) + $(error Unknown Mac OS X architecture. Please update the makefile.) + endif + + EXEEXT := $(macosx_arch) + + CFLAGS += -arch $(macosx_arch) + CFLAGS += -mmacosx-version-min=$(macosx_version_min) + CFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=$(macosx_version_min_required) + CFLAGS += -nostdinc + CFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks + CFLAGS += -I$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_dir)/include + CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include + CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0 + CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir) + CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)/bits + CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/backward + CFLAGS += -mdynamic-no-pic + + LDFLAGS += -arch $(macosx_arch) + LDFLAGS += -mmacosx-version-min=$(macosx_version_min) + LDFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks + LDFLAGS += -L$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_libdir) + LDFLAGS += -Wl,-syslibroot,$(XCODE_DIR)/SDKs/$(macosx_sdk_dir) + LDFLAGS += -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL + LDFLAGS += ./libSDL-1.2.0.dylib ./libSDLmain-osx.a +else + CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ + CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc + LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ + + CFLAGS += -DPLATFORM_LINUX=1 + LDFLAGS += ./libSDL-1.2.so.0 -Wl,-rpath,\$$ORIGIN + + ifeq ($(strip $(use_devil)),true) + LDFLAGS += ./libIL.so.1 ./libILU.so.1 ./libILUT.so.1 + endif + + ifeq ($(strip $(use_fmod)),true) + POSTLDFLAGS += -lpthread ./libfmod-linux-x86.a + else + LDFLAGS += ./libopenal.so.1 + endif +endif + +DEFINES += \ + -DPLATFORM_UNIX=1 \ + -DUSE_SDL=1 \ + -DTRUE=1 \ + -DFALSE=0 \ + -Dstricmp=strcasecmp \ + -DBinIO_STDINT_HEADER="" \ + +INCLUDES += \ + -I$(SRCDIR) \ + -I$(SDLDIR)/include \ + -I./OpenGL/ \ + -I./OpenGL/GL \ + +ifeq ($(strip $(use_devil)),true) + DEFINES += -DUSE_DEVIL=1 + INCLUDES += -I$(SRCDIR)/devil/include +else + DEFINES += -DZ_PREFIX=1 + INCLUDES += -I$(ZLIBDIR) -I$(LIBPNGDIR) -I$(JPEGLIBDIR) +endif + +ifeq ($(strip $(use_fmod)),false) + DEFINES += -DUSE_OPENAL=1 + INCLUDES += -I$(OPENALDIR)/include -I$(LIBOGGDIR)/include -I$(LIBVORBISDIR)/include +endif + +CFLAGS += -g -c $(OPT) $(INCLUDES) $(DEFINES) -fsigned-char -pipe -w + + +ifeq ($(strip $(EXEEXT)),) + EXEEXT := bin +endif +EXE := $(RUNDIR)/lugaru-$(EXEEXT) + +CXXFLAGS := $(CFLAGS) + +SRCS := \ + Frustum.cpp \ + GameDraw.cpp \ + GameInitDispose.cpp \ + GameTick.cpp \ + Globals.cpp \ + Lights.cpp \ + Models.cpp \ + Objects.cpp \ + pack.c \ + pack_private.c \ + Person.cpp \ + private.c \ + Quaternions.cpp \ + Random.c \ + Skeleton.cpp \ + Skybox.cpp \ + Sprites.cpp \ + Terrain.cpp \ + Text.cpp \ + TGALoader.cpp \ + unpack.c \ + unpack_private.c \ + Weapons.cpp \ + MacCompatibility.cpp \ + logger/logger.cpp \ + WinInput.cpp \ + OpenGL_Windows.cpp \ + openal_wrapper.cpp \ + +SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f)) + + +UNUSED_SRCS := \ + DRIVER.CC \ + MD5.CC \ + + +PNGSRCS := \ + png.c \ + pngerror.c \ + pnggccrd.c \ + pngget.c \ + pngmem.c \ + pngpread.c \ + pngread.c \ + pngrio.c \ + pngrtran.c \ + pngrutil.c \ + pngset.c \ + pngtrans.c \ + pngvcrd.c \ + pngwio.c \ + pngwrite.c \ + pngwtran.c \ + pngwutil.c \ + +PNGSRCS := $(foreach f,$(PNGSRCS),$(LIBPNGDIR)/$(f)) + +JPEGSRCS := \ + jdapistd.c \ + jdmaster.c \ + jdapimin.c \ + jcapimin.c \ + jdmerge.c \ + jdatasrc.c \ + jdatadst.c \ + jdcoefct.c \ + jdcolor.c \ + jddctmgr.c \ + jdhuff.c \ + jdinput.c \ + jdmainct.c \ + jdmarker.c \ + jdphuff.c \ + jdpostct.c \ + jdsample.c \ + jdtrans.c \ + jerror.c \ + jidctflt.c \ + jidctfst.c \ + jidctint.c \ + jidctred.c \ + jmemmgr.c \ + jutils.c \ + jmemnobs.c \ + jquant1.c \ + jquant2.c \ + jcomapi.c \ + jcmarker.c \ + jcapistd.c \ + jcparam.c \ + jcinit.c \ + jcdctmgr.c \ + jccoefct.c \ + jcmainct.c \ + jfdctflt.c \ + jfdctint.c \ + jfdctfst.c \ + jchuff.c \ + jcphuff.c \ + jcsample.c \ + jcmaster.c \ + jccolor.c \ + jcprepct.c \ + +JPEGSRCS := $(foreach f,$(JPEGSRCS),$(JPEGLIBDIR)/$(f)) + + +ZLIBSRCS = \ + adler32.c \ + compress.c \ + crc32.c \ + deflate.c \ + gzio.c \ + infback.c \ + inffast.c \ + inflate.c \ + inftrees.c \ + trees.c \ + uncompr.c \ + zutil.c \ + +ZLIBSRCS := $(foreach f,$(ZLIBSRCS),$(ZLIBDIR)/$(f)) + + +GLUSRCS := \ + dict.c \ + geom.c \ + memalloc.c \ + mesh.c \ + mipmap.c \ + normal.c \ + priorityq.c \ + render.c \ + sweep.c \ + tess.c \ + tessmono.c \ + util.c \ + +GLUSRCS := $(foreach f,$(GLUSRCS),$(GLUDIR)/$(f)) + + +OGGSRCS := \ + bitwise.o \ + framing.o + +OGGSRCS := $(foreach f,$(OGGSRCS),$(LIBOGGDIR)/src/$(f)) + +VORBISSRCS := \ + analysis.o \ + bitrate.o \ + block.o \ + codebook.o \ + envelope.o \ + floor0.o \ + floor1.o \ + info.o \ + lpc.o \ + lsp.o \ + mapping0.o \ + mdct.o \ + psy.o \ + registry.o \ + res0.o \ + sharedbook.o \ + smallft.o \ + synthesis.o \ + vorbisfile.o \ + window.o + +VORBISSRCS := $(foreach f,$(VORBISSRCS),$(LIBVORBISDIR)/lib/$(f)) + +ifeq ($(strip $(macosx)),false) + SRCS += $(GLUSRCS) +endif + +ifeq ($(strip $(use_devil)),false) + SRCS += $(PNGSRCS) $(JPEGSRCS) $(ZLIBSRCS) +endif + +ifeq ($(strip $(use_fmod)),false) + SRCS += $(OGGSRCS) $(VORBISSRCS) +endif + +OBJS := $(SRCS:.CC=.o) +OBJS := $(OBJS:.cc=.o) +OBJS := $(OBJS:.cpp=.o) +OBJS := $(OBJS:.c=.o) +OBJS := $(OBJS:.m=.o) +OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f)) + + +.PHONY: clean all + +all : $(EXE) + +$(BINDIR)/%.o : %.cpp + @mkdir -p $(dir $@) + $(CXX) -o $@ $(CXXFLAGS) $< + +$(BINDIR)/%.o : %.CC + @mkdir -p $(dir $@) + $(CXX) -x c++ -o $@ $(CXXFLAGS) $< + +$(BINDIR)/%.o : %.cc + @mkdir -p $(dir $@) + $(CXX) -o $@ $(CXXFLAGS) $< + +$(BINDIR)/%.o : %.m + @mkdir -p $(dir $@) + $(CC) -o $@ $(CFLAGS) $< + +$(BINDIR)/%.o : %.c + @mkdir -p $(dir $@) + $(CC) -o $@ $(CFLAGS) $< + +$(EXE) : $(OBJS) $(APPOBJS) + @mkdir -p $(dir $@) + $(LD) -o $@ $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS) + +clean: + rm -f $(BINDIR)/*.o + rm -f $(BINDIR)/$(SRCDIR)/*.o + rm -f $(BINDIR)/$(SRCDIR)/logger/*.o + rm -f $(BINDIR)/$(GLUDIR)/*.o + rm -f $(BINDIR)/$(LIBPNGDIR)/*.o + rm -f $(BINDIR)/$(JPEGLIBDIR)/*.o + rm -f $(BINDIR)/$(ZLIBDIR)/*.o + rm -f $(BINDIR)/$(LIBOGGDIR)/src/*.o + rm -f $(BINDIR)/$(LIBVORBISDIR)/lib/*.o + rm -f $(EXE) + +# end of makefile ... + diff --git a/makemac.sh b/makemac.sh index f02e189..ac33ff1 100755 --- a/makemac.sh +++ b/makemac.sh @@ -6,8 +6,8 @@ set -x NCPU=`sysctl -n hw.ncpu` for arch in ppc i386 x86_64 ; do - make macosx=true macosx_arch=$arch clean - make macosx=true macosx_arch=$arch -j$NCPU + make -f makefile.old macosx=true macosx_arch=$arch clean + make -f makefile.old macosx=true macosx_arch=$arch -j$NCPU # We always strip here. For debugging, you should do "make" directly. strip run/lugaru-$arch BINS="$BINS run/lugaru-$arch"