diff --git a/.github/workflows/build-games.yml b/.github/workflows/build-games.yml new file mode 100644 index 0000000000..ae80eb0e49 --- /dev/null +++ b/.github/workflows/build-games.yml @@ -0,0 +1,124 @@ +name: Build Games + +permissions: + contents: read + pull-requests: write + +on: + push: + branches: + - main + paths: + - "Generals/**" + - "GeneralsMD/**" + - "Dependencies/**" + - "cmake/**" + - "CMakeLists.txt" + - "CMakePresets.json" + - ".github/workflows/build-games.yml" + - ".github/workflows/toolchain-common.yml" + pull_request: + branches: + - main + paths: + - "Generals/**" + - "GeneralsMD/**" + - "Dependencies/**" + - "cmake/**" + - "CMakeLists.txt" + - "CMakePresets.json" + - ".github/workflows/build-games.yml" + - ".github/workflows/toolchain-common.yml" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + check-changes: + name: Check Changes + runs-on: ubuntu-latest + outputs: + generals: ${{ steps.filter.outputs.generals }} + generalsmd: ${{ steps.filter.outputs.generalsmd }} + shared: ${{ steps.filter.outputs.shared }} + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + generals: + - 'Generals/**' + generalsmd: + - 'GeneralsMD/**' + shared: + - 'Dependencies/**' + - 'cmake/**' + - 'CMakeLists.txt' + - 'CMakePresets.json' + - ".github/workflows/build-games.yml" + - '.github/workflows/toolchain-common.yml' + + build-generals: + name: Build Generals (${{ matrix.preset }}${{ matrix.tools && '+tools' || '' }}) + needs: check-changes + if: ${{ github.event_name == 'workflow_dispatch' || needs.check-changes.outputs.generals == 'true' || needs.check-changes.outputs.shared == 'true' }} + strategy: + matrix: + include: + - preset: "vc6" + tools: true + - preset: "vc6prof" + tools: true + - preset: "vc6int" + tools: true + - preset: "vc6debug" + tools: true + # - preset: "msvc32" # TODO: Fix preset + # tools: false # TODO: Fix tools + # - preset: "msvc32prof" # TODO: Fix preset + # tools: false # TODO: Fix tools + # - preset: "msvc32int" # TODO: Fix preset + # tools: false # TODO: Fix tools + # - preset: "msvc32debug" # TODO: Fix preset + # tools: false # TODO: Fix tools + fail-fast: false + uses: ./.github/workflows/toolchain-common.yml + with: + game: "Generals" + preset: ${{ matrix.preset }} + tools: ${{ matrix.tools }} + secrets: inherit + + build-generalsmd: + name: Build GeneralsMD (${{ matrix.preset }}${{ matrix.tools && '+tools' || '' }}) + needs: check-changes + if: ${{ github.event_name == 'workflow_dispatch' || needs.check-changes.outputs.generalsmd == 'true' || needs.check-changes.outputs.shared == 'true' }} + strategy: + matrix: + include: + - preset: "vc6" + tools: true + - preset: "vc6prof" + tools: true + - preset: "vc6int" + tools: true + - preset: "vc6debug" + tools: true + - preset: "msvc32" + tools: false # TODO: Fix tools + # - preset: "msvc32prof" # TODO: Fix preset + # tools: false # TODO: Fix tools + # - preset: "msvc32int" # TODO: Fix preset + # tools: false # TODO: Fix tools + - preset: "msvc32debug" + tools: false # TODO: Fix tools + fail-fast: false + uses: ./.github/workflows/toolchain-common.yml + with: + game: "GeneralsMD" + preset: ${{ matrix.preset }} + tools: ${{ matrix.tools }} + secrets: inherit diff --git a/.github/workflows/build-vc6-generals.yml b/.github/workflows/build-vc6-generals.yml deleted file mode 100644 index 6f969e761f..0000000000 --- a/.github/workflows/build-vc6-generals.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build Generals with VC6 - -on: - push: - branches: - - main - paths: - - "Generals/**" - - "Dependencies/**" - - "cmake/**" - - "CMakeLists.txt" - - "CMakePresets.json" - - ".github/workflows/build-vc6-generals.yml" - - ".github/workflows/build-vc6-common.yml" - pull_request: - branches: - - main - paths: - - "Generals/**" - - "Dependencies/**" - - "cmake/**" - - "CMakeLists.txt" - - "CMakePresets.json" - - ".github/workflows/build-vc6-generals.yml" - - ".github/workflows/build-vc6-common.yml" - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - generals: - uses: ./.github/workflows/build-vc6-common.yml - with: - game: "Generals" - secrets: inherit diff --git a/.github/workflows/build-vc6-zerohour.yml b/.github/workflows/build-vc6-zerohour.yml deleted file mode 100644 index 60ac0daa04..0000000000 --- a/.github/workflows/build-vc6-zerohour.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build Zero Hour with VC6 - -on: - push: - branches: - - main - paths: - - "GeneralsMD/**" - - "Dependencies/**" - - "cmake/**" - - "CMakeLists.txt" - - "CMakePresets.json" - - ".github/workflows/build-vc6-zerohour.yml" - - ".github/workflows/build-vc6-common.yml" - pull_request: - branches: - - main - paths: - - "GeneralsMD/**" - - "Dependencies/**" - - "cmake/**" - - "CMakeLists.txt" - - "CMakePresets.json" - - ".github/workflows/build-vc6-zerohour.yml" - - ".github/workflows/build-vc6-common.yml" - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - zerohour: - uses: ./.github/workflows/build-vc6-common.yml - with: - game: "GeneralsMD" - secrets: inherit diff --git a/.github/workflows/build-vc6-common.yml b/.github/workflows/toolchain-common.yml similarity index 54% rename from .github/workflows/build-vc6-common.yml rename to .github/workflows/toolchain-common.yml index ba9a77df20..c20bcf0a5f 100644 --- a/.github/workflows/build-vc6-common.yml +++ b/.github/workflows/toolchain-common.yml @@ -1,4 +1,8 @@ -name: Build Game with VC6 +name: Common Toolchain + +permissions: + contents: read + pull-requests: write on: workflow_call: @@ -6,17 +10,26 @@ on: game: required: true type: string - description: "Game to build (Generals or GeneralsMD)" + description: "Game to build (Generals, GeneralsMD)" + preset: + required: true + type: string + description: "CMake preset" + tools: + default: false + type: boolean + description: "Build tools" jobs: build: runs-on: windows-latest - timeout-minutes: 15 + timeout-minutes: 20 steps: - name: Checkout code uses: actions/checkout@v4 - name: Cache VC6 installation + if: startsWith(inputs.preset, 'vc6') id: cache-vc6 uses: actions/cache@v4 with: @@ -27,13 +40,13 @@ jobs: id: cache-cmake-deps uses: actions/cache@v4 with: - path: build\vc6\_deps - key: cmake-deps-${{ hashFiles('cmake/**/*.cmake', '**/CMakeLists.txt') }} + path: build\${{ inputs.preset }}\_deps + key: cmake-deps-${{ inputs.preset }}-${{ hashFiles('cmake/**/*.cmake', '**/CMakeLists.txt') }} restore-keys: | - cmake-deps- + cmake-deps-${{ inputs.preset }}- - name: Download VC6 Portable from Cloudflare R2 - if: steps.cache-vc6.outputs.cache-hit != 'true' + if: ${{ startsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }} env: AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} @@ -56,14 +69,12 @@ jobs: Write-Host "Extracting archive..." & 7z x VS6_VisualStudio6.7z -oC:\VC6 - Write-Host "Cleaning up downloaded archive" - Remove-Item VS6_VisualStudio6.7z + Remove-Item VS6_VisualStudio6.7z -Verbose - name: Set up VC6 environment + if: startsWith(inputs.preset, 'vc6') shell: pwsh run: | - Write-Host "Setting up environment for using Microsoft Visual C++ tools" - # Define the base directories as local variables first $VSCommonDir = "C:\VC6\VC6SP6\Common" $MSDevDir = "C:\VC6\VC6SP6\Common\msdev98" @@ -75,54 +86,49 @@ jobs: "MSDevDir=$MSDevDir" >> $env:GITHUB_ENV "MSVCDir=$MSVCDir" >> $env:GITHUB_ENV "VcOsDir=$VcOsDir" >> $env:GITHUB_ENV - - # Set PATH "PATH=$MSDevDir\BIN;$MSVCDir\BIN;$VSCommonDir\TOOLS\$VcOsDir;$VSCommonDir\TOOLS;$env:PATH" >> $env:GITHUB_ENV - - # Set INCLUDE "INCLUDE=$MSVCDir\ATL\INCLUDE;$MSVCDir\INCLUDE;$MSVCDir\MFC\INCLUDE;$env:INCLUDE" >> $env:GITHUB_ENV - - # Set LIB "LIB=$MSVCDir\LIB;$MSVCDir\MFC\LIB;$env:LIB" >> $env:GITHUB_ENV - - name: Build with CMake using VC6 preset + - name: Build ${{ inputs.game }} with CMake using ${{ inputs.preset }} preset shell: pwsh run: | - Write-Host "Configuring project with CMake using VC6 preset - building only ${{ inputs.game }}" + Write-Host "Configuring project with CMake using preset: ${{ inputs.game }} (${{ inputs.preset }})" - # Set build flags based on game + # Set build flags based on game and tools if ("${{ inputs.game }}" -eq "Generals") { - $buildFlags = @("-DGENZH_BUILD_ZEROHOUR=OFF", "-DGENZH_BUILD_GENERALS=ON", "-DGENZH_BUILD_GENERALS_TOOLS=ON") + $buildFlags = @("-DGENZH_BUILD_ZEROHOUR=OFF", "-DGENZH_BUILD_GENERALS=ON") + if ("${{ inputs.tools }}" -eq "true") { + $buildFlags += "-DGENZH_BUILD_GENERALS_TOOLS=ON" + } } else { - $buildFlags = @("-DGENZH_BUILD_ZEROHOUR=ON", "-DGENZH_BUILD_GENERALS=OFF", "-DGENZH_BUILD_ZEROHOUR_TOOLS=ON") + $buildFlags = @("-DGENZH_BUILD_ZEROHOUR=ON", "-DGENZH_BUILD_GENERALS=OFF") + if ("${{ inputs.tools }}" -eq "true") { + $buildFlags += "-DGENZH_BUILD_ZEROHOUR_TOOLS=ON" + } } - cmake --preset vc6 $buildFlags + cmake --preset ${{ inputs.preset }} $buildFlags - Write-Host "Building project with CMake using VC6 preset - building only ${{ inputs.game }}" + Write-Host "Building project with CMake using preset: ${{ inputs.game }} (${{ inputs.preset }})" - $buildDir = "build/vc6" - "buildDir=$buildDir" >> $env:GITHUB_ENV + $buildDir = "build\${{ inputs.preset }}" cmake --build $buildDir - Write-Host "Collecting ${{ inputs.game }} tools" - $toolsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ inputs.game }}\Tools" - $files = Get-ChildItem -Path "$buildDir\${{ inputs.game }}" -File | Where-Object { ($_.Extension -eq ".exe" -or $_.Extension -eq ".dll") -and $_.Name -ne "generals.exe" } - $files | Move-Item -Destination $toolsDir - - - name: Upload ${{ inputs.game }} executable - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.game }} - path: ${{ env.buildDir }}/${{ inputs.game }}/generals.exe - retention-days: 30 - if-no-files-found: error + Write-Host "Collecting ${{ inputs.game }} artifacts" + $artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ inputs.game }}\artifacts" -Verbose + if ("${{ inputs.preset }}" -like "msvc32*") { + $files = Get-ChildItem -Path "$buildDir\${{ inputs.game }}\Debug" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose + } else { + $files = Get-ChildItem -Path "$buildDir\${{ inputs.game }}" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose + } + $files | Move-Item -Destination $artifactsDir -Verbose - - name: Upload ${{ inputs.game }} tools + - name: Upload ${{ inputs.game }} (${{ inputs.preset }}) artifact uses: actions/upload-artifact@v4 with: - name: ${{ inputs.game }}-Tools - path: ${{ env.buildDir }}/${{ inputs.game }}/Tools + name: ${{ inputs.game }}-${{ inputs.preset }}${{ inputs.tools == true && '-tools' || '' }} + path: build\${{ inputs.preset }}\${{ inputs.game }}\artifacts retention-days: 30 if-no-files-found: error diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5a024520..4360a97f2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,20 @@ endif() # Top level project, doesn't really affect anything. project(genzh LANGUAGES C CXX) +# Print some information +message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}") +message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") +if (DEFINED MSVC_VERSION) + message(STATUS "MSVC_VERSION: ${MSVC_VERSION}") +endif() + +# Set variable for VS6 to handle special cases. +if (DEFINED MSVC_VERSION AND MSVC_VERSION LESS 1300) + set(IS_VS6_BUILD TRUE) +else() + set(IS_VS6_BUILD FALSE) +endif() + # Create PDB for Release as long as debug info was generated during compile. if(MSVC) string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /DEBUG /OPT:REF /OPT:ICF") @@ -57,6 +71,20 @@ add_subdirectory(Dependencies/Benchmark) add_subdirectory(Dependencies/SafeDisc) add_subdirectory(Dependencies/MaxSDK) +if (NOT IS_VS6_BUILD) + # Set C++ standard + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) # Ensures only ISO features are used + + if (MSVC) + # Multithreaded build. + add_compile_options(/MP) + # Enforce strict __cplusplus version + add_compile_options(/Zc:__cplusplus) + endif() +endif() + # Do we want to build extra SDK stuff or just the game binary? option(GENZH_BUILD_ZEROHOUR "Build Zero Hour code." ON) option(GENZH_BUILD_GENERALS "Build Generals code." ON) diff --git a/Generals/CMakeLists.txt b/Generals/CMakeLists.txt index d7808f2cdb..046a59ba66 100644 --- a/Generals/CMakeLists.txt +++ b/Generals/CMakeLists.txt @@ -12,5 +12,30 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # Add main build targets add_subdirectory(Code) +# If we are building on windows for windows, try and get the game install path from the registry. +if("${CMAKE_HOST_SYSTEM}" MATCHES "Windows" AND "${CMAKE_SYSTEM}" MATCHES "Windows") + # Check the CD registry path + if(NOT GENERALS_INSTALL_PREFIX) + get_filename_component(GENERALS_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Generals;InstallPath]" ABSOLUTE CACHE) + endif() + + # Check the "First Decade" registry path + if(NOT GENERALS_INSTALL_PREFIX OR "${GENERALS_INSTALL_PREFIX}" STREQUAL "/registry") + get_filename_component(GENERALS_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer The First Decade;gr_folder]" ABSOLUTE CACHE) + endif() + + # Check the Steam registry path + if(NOT GENERALS_INSTALL_PREFIX OR "${GENERALS_INSTALL_PREFIX}" STREQUAL "/registry") + get_filename_component(GENERALS_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Generals;installPath]" ABSOLUTE CACHE) + endif() +endif() + +if(GENERALS_INSTALL_PREFIX AND NOT "${GENERALS_INSTALL_PREFIX}" STREQUAL "/registry") + install(TARGETS g_generals RUNTIME DESTINATION "${GENERALS_INSTALL_PREFIX}") + install(FILES $ DESTINATION "${GENERALS_INSTALL_PREFIX}" OPTIONAL) + install(TARGETS g_worldbuilder RUNTIME DESTINATION "${GENERALS_INSTALL_PREFIX}" OPTIONAL) + install(FILES $ DESTINATION "${GENERALS_INSTALL_PREFIX}" OPTIONAL) +endif() + feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") diff --git a/Generals/Code/Main/CMakeLists.txt b/Generals/Code/Main/CMakeLists.txt index dc73b1bcf9..26a57f1d23 100644 --- a/Generals/Code/Main/CMakeLists.txt +++ b/Generals/Code/Main/CMakeLists.txt @@ -1,6 +1,11 @@ add_executable(g_generals WIN32) -set_target_properties(g_generals PROPERTIES OUTPUT_NAME generals) +# Use a binary name that doesn't conflict with original game. +if("${CMAKE_SYSTEM}" MATCHES "Windows") + set_target_properties(g_generals PROPERTIES OUTPUT_NAME generalsv) +else() + set_target_properties(g_generals PROPERTIES OUTPUT_NAME generalsv) +endif() target_link_libraries(g_generals PRIVATE binkstub diff --git a/Generals/Code/Tools/Compress/CMakeLists.txt b/Generals/Code/Tools/Compress/CMakeLists.txt index 6b5daef887..c279de5a7d 100644 --- a/Generals/Code/Tools/Compress/CMakeLists.txt +++ b/Generals/Code/Tools/Compress/CMakeLists.txt @@ -16,7 +16,7 @@ target_link_libraries(g_compress PRIVATE ) if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") - if(MSVC_VERSION LESS 1300) # VS6 + if(IS_VS6_BUILD) target_compile_definitions(g_compress PRIVATE vsnprintf=_vsnprintf) endif() target_link_options(g_compress PRIVATE /subsystem:console) diff --git a/Generals/Code/Tools/WorldBuilder/CMakeLists.txt b/Generals/Code/Tools/WorldBuilder/CMakeLists.txt index 9c17c00aaa..f43e78fed8 100644 --- a/Generals/Code/Tools/WorldBuilder/CMakeLists.txt +++ b/Generals/Code/Tools/WorldBuilder/CMakeLists.txt @@ -224,9 +224,9 @@ if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") target_link_options(g_worldbuilder PRIVATE /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libc.lib) target_sources(g_worldbuilder PRIVATE res/WorldBuilder.rc) - set_target_properties(g_worldbuilder PROPERTIES OUTPUT_NAME WorldBuilder) + set_target_properties(g_worldbuilder PROPERTIES OUTPUT_NAME WorldBuilderV) else() - set_target_properties(g_worldbuilder PROPERTIES OUTPUT_NAME worldbuilder) + set_target_properties(g_worldbuilder PROPERTIES OUTPUT_NAME worldbuilderv) endif() target_sources(g_worldbuilder PRIVATE ${WORLDBUILDER_SRC}) diff --git a/GeneralsMD/CMakeLists.txt b/GeneralsMD/CMakeLists.txt index f545833086..d7c94bbaa2 100644 --- a/GeneralsMD/CMakeLists.txt +++ b/GeneralsMD/CMakeLists.txt @@ -12,5 +12,29 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # Add main build targets add_subdirectory(Code) +# If we are building on windows for windows, try and get the game install path from the registry. +if("${CMAKE_HOST_SYSTEM}" MATCHES "Windows" AND "${CMAKE_SYSTEM}" MATCHES "Windows") + if(NOT ZEROHOUR_INSTALL_PREFIX) + get_filename_component(ZEROHOUR_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour;InstallPath]" ABSOLUTE CACHE) + endif() + + # Check the "First Decade" registry path + if(NOT ZEROHOUR_INSTALL_PREFIX OR "${ZEROHOUR_INSTALL_PREFIX}" STREQUAL "/registry") + get_filename_component(ZEROHOUR_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer The First Decade;zh_folder]" ABSOLUTE CACHE) + endif() + + # Check the Steam registry path + if(NOT ZEROHOUR_INSTALL_PREFIX OR "${ZEROHOUR_INSTALL_PREFIX}" STREQUAL "/registry") + get_filename_component(ZEROHOUR_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\ZeroHour;installPath]" ABSOLUTE CACHE) + endif() +endif() + +if(ZEROHOUR_INSTALL_PREFIX AND NOT "${ZEROHOUR_INSTALL_PREFIX}" STREQUAL "/registry") + install(TARGETS z_generals RUNTIME DESTINATION "${ZEROHOUR_INSTALL_PREFIX}") + install(FILES $ DESTINATION "${ZEROHOUR_INSTALL_PREFIX}" OPTIONAL) + install(TARGETS z_worldbuilder RUNTIME DESTINATION "${ZEROHOUR_INSTALL_PREFIX}" OPTIONAL) + install(FILES $ DESTINATION "${ZEROHOUR_INSTALL_PREFIX}" OPTIONAL) +endif() + feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index c670abf446..d085db9dea 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -22,6 +22,7 @@ set(GAMEENGINE_SRC Include/Common/ClientUpdateModule.h Include/Common/CommandLine.h Include/Common/CopyProtection.h + Include/Common/CppMacros.h Include/Common/crc.h Include/Common/CRCDebug.h Include/Common/CriticalSection.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/AudioEventInfo.h b/GeneralsMD/Code/GameEngine/Include/Common/AudioEventInfo.h index 0d07a82117..b714bf8e92 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/AudioEventInfo.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/AudioEventInfo.h @@ -48,7 +48,7 @@ enum AudioType AT_SoundEffect }; -extern char *theAudioPriorityNames[]; +extern const char *theAudioPriorityNames[]; enum AudioPriority { AP_LOWEST, @@ -58,7 +58,7 @@ enum AudioPriority AP_CRITICAL }; -extern char *theSoundTypeNames[]; +extern const char *theSoundTypeNames[]; enum SoundType { ST_UI = 0x0001, @@ -72,7 +72,7 @@ enum SoundType ST_EVERYONE = 0x0100, }; -extern char *theAudioControlNames[]; +extern const char *theAudioControlNames[]; enum AudioControl { AC_LOOP = 0x0001, @@ -128,7 +128,7 @@ struct AudioEventInfo : public MemoryPoolObject /// Is this a permenant sound? That is, if I start this sound up, will it ever end /// "on its own" or only if I explicitly kill it? - Bool isPermanentSound() const { return BitTest( m_control, AC_LOOP ) && (m_loopCount == 0 ); } + Bool isPermanentSound() const { return BitIsSet( m_control, AC_LOOP ) && (m_loopCount == 0 ); } static const FieldParse m_audioEventInfo[]; ///< the parse table for INI definition const FieldParse *getFieldParse( void ) const { return m_audioEventInfo; } diff --git a/GeneralsMD/Code/GameEngine/Include/Common/AudioRandomValue.h b/GeneralsMD/Code/GameEngine/Include/Common/AudioRandomValue.h index 3078d6c3a4..263189228c 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/AudioRandomValue.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/AudioRandomValue.h @@ -35,8 +35,8 @@ #include "Lib/BaseType.h" // do NOT use these functions directly, rather use the macros below -extern Int GetGameAudioRandomValue( int lo, int hi, char *file, int line ); -extern Real GetGameAudioRandomValueReal( Real lo, Real hi, char *file, int line ); +extern Int GetGameAudioRandomValue( int lo, int hi, const char *file, int line ); +extern Real GetGameAudioRandomValueReal( Real lo, Real hi, const char *file, int line ); // use these macros to access the random value functions #define GameAudioRandomValue( lo, hi ) GetGameAudioRandomValue( lo, hi, __FILE__, __LINE__ ) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BorderColors.h b/GeneralsMD/Code/GameEngine/Include/Common/BorderColors.h index 72a8e06dc6..88618b370b 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/BorderColors.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/BorderColors.h @@ -22,7 +22,7 @@ struct BorderColor { - char *m_colorName; + const char *m_colorName; long m_borderColor; }; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/CppMacros.h b/GeneralsMD/Code/GameEngine/Include/Common/CppMacros.h new file mode 100644 index 0000000000..680aeda5d6 --- /dev/null +++ b/GeneralsMD/Code/GameEngine/Include/Common/CppMacros.h @@ -0,0 +1,10 @@ +// TheSuperHackers +// This file contains macros to help upgrade the code for newer cpp standards. + +#pragma once + +#if __cplusplus >= 201703L +#define NOEXCEPT_17 noexcept +#else +#define NOEXCEPT_17 +#endif diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h b/GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h index 0ee4f8240a..8acf22e08f 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h @@ -126,7 +126,7 @@ class DataChunkOutput DataChunkOutput( OutputStream *pOut ); ~DataChunkOutput(); - void openDataChunk( char *name, DataChunkVersionType ver ); + void openDataChunk( const char *name, DataChunkVersionType ver ); void closeDataChunk( void ); void writeReal(Real r); diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h b/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h index 3fa8540c41..63f89c5931 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameCommon.h @@ -318,7 +318,7 @@ public: \ inline DLINK_ITERATOR iterate_##LISTNAME() const \ { \ DEBUG_ASSERTCRASH(!BOGUSPTR(m_dlinkhead_##LISTNAME.m_head), ("bogus head ptr")); \ - return DLINK_ITERATOR(m_dlinkhead_##LISTNAME.m_head, OBJCLASS::dlink_next_##LISTNAME); \ + return DLINK_ITERATOR(m_dlinkhead_##LISTNAME.m_head, &OBJCLASS::dlink_next_##LISTNAME); \ } \ inline OBJCLASS *getFirstItemIn_##LISTNAME() const \ { \ diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h b/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h index 94e7906794..b25def60ce 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h @@ -875,11 +875,13 @@ extern void userMemoryAdjustPoolSize(const char *poolName, Int& initialAllocatio extern void* __cdecl operator new[](size_t nSize, const char *, int); extern void __cdecl operator delete[](void *, const char *, int); +#if defined(_MSC_VER) && _MSC_VER < 1300 // additional overloads for 'placement new' //inline void* __cdecl operator new (size_t s, void *p) { return p; } //inline void __cdecl operator delete (void *, void *p) { } inline void* __cdecl operator new[] (size_t s, void *p) { return p; } inline void __cdecl operator delete[] (void *, void *p) { } +#endif #endif diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameType.h b/GeneralsMD/Code/GameEngine/Include/Common/GameType.h index 1ca9b245de..7b95bd374a 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameType.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameType.h @@ -77,7 +77,7 @@ enum TimeOfDay TIME_OF_DAY_COUNT // keep this last }; -extern char *TimeOfDayNames[]; +extern const char *TimeOfDayNames[]; // defined in Common/GameType.cpp //------------------------------------------------------------------------------------------------- @@ -89,7 +89,7 @@ enum Weather WEATHER_COUNT // keep this last }; -extern char *WeatherNames[]; +extern const char *WeatherNames[]; enum Scorches { diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index 792945072d..f83a9128ae 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -44,7 +44,7 @@ // FORWARD DECLARATIONS /////////////////////////////////////////////////////////////////////////// struct FieldParse; -typedef enum _TerrainLOD; +enum _TerrainLOD; class GlobalData; class INI; class WeaponBonusSet; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/INI.h b/GeneralsMD/Code/GameEngine/Include/Common/INI.h index 1eef9ee1d9..8ac4254796 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/INI.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/INI.h @@ -99,7 +99,7 @@ typedef void (*INIFieldParseProc)( INI *ini, void *instance, void *store, const //------------------------------------------------------------------------------------------------- typedef const char* ConstCharPtr; -typedef const ConstCharPtr* ConstCharPtrArray; +typedef ConstCharPtr* ConstCharPtrArray; //------------------------------------------------------------------------------------------------- struct LookupListRec diff --git a/GeneralsMD/Code/GameEngine/Include/Common/LadderPreferences.h b/GeneralsMD/Code/GameEngine/Include/Common/LadderPreferences.h index 71ede47f16..9ff2e4d400 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/LadderPreferences.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/LadderPreferences.h @@ -50,7 +50,7 @@ class LadderPref UnsignedShort port; time_t lastPlayDate; - bool operator== (const LadderPref& other) + bool operator== (const LadderPref& other) const { return ( address==other.address && port==other.port ); } diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Overridable.h b/GeneralsMD/Code/GameEngine/Include/Common/Overridable.h index deaba59605..643cb52ef1 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Overridable.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Overridable.h @@ -31,6 +31,8 @@ #ifndef _OVERRIDABLE_H_ #define _OVERRIDABLE_H_ +#include "Common/GameMemory.h" + /* In order for something to live in an OVERRIDE<> object, it must be derived from Overridable (publicly). diff --git a/GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h b/GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h index f2178b21a6..6fbc011717 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/STLTypedefs.h @@ -70,7 +70,21 @@ enum DrawableID; #include #include +#ifdef USING_STLPORT #include +#else +#include +namespace std +{ +template < + class _Kty, + class _Ty, + class _Hasher = hash<_Kty>, + class _Keyeq = equal_to<_Kty>, + class _Alloc = allocator>> +using hash_map = unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>; +} +#endif #include #include #include diff --git a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h index 0af234aee4..a123825d0e 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h @@ -131,7 +131,7 @@ class SparseMatchFinder AsciiString curBestMatchStr, dupMatchStr; #endif - for (std::vector::const_iterator it = v.begin(); it != v.end(); ++it) + for (typename std::vector::const_iterator it = v.begin(); it != v.end(); ++it) { for (Int i = it->getConditionsYesCount()-1; i >= 0; --i) { @@ -197,7 +197,7 @@ class SparseMatchFinder //------------------------------------------------------------------------------------------------- const MATCHABLE* findBestInfo(const std::vector& v, const BITSET& bits) const { - MatchMap::const_iterator it = m_bestMatches.find(bits); + typename MatchMap::const_iterator it = m_bestMatches.find(bits); const MATCHABLE *first = NULL; if (it != m_bestMatches.end()) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h b/GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h index 6c29d3f2ac..eb8585a39a 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h @@ -94,7 +94,7 @@ typedef enum } TerrainClass; #ifdef DEFINE_TERRAIN_TYPE_NAMES -static char *terrainTypeNames[] = +static const char *terrainTypeNames[] = { "NONE", "DESERT_1", diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ThingSort.h b/GeneralsMD/Code/GameEngine/Include/Common/ThingSort.h index 222c4d7a2a..197b2c4444 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ThingSort.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ThingSort.h @@ -56,7 +56,7 @@ enum EditorSortingType }; #ifdef DEFINE_EDITOR_SORTING_NAMES -static char *EditorSortingNames[] = +static const char *EditorSortingNames[] = { "NONE", "STRUCTURE", diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h index 5cd8a1aa47..79f80649f3 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h @@ -279,7 +279,7 @@ class ModuleInfo ModuleInfo() { } void addModuleInfo( ThingTemplate *thingTemplate, const AsciiString& name, const AsciiString& moduleTag, const ModuleData* data, Int interfaceMask, Bool inheritable, Bool overrideableByLikeKind = FALSE ); - const ModuleInfo::Nugget *ModuleInfo::getNuggetWithTag( const AsciiString& tag ) const; + const ModuleInfo::Nugget *getNuggetWithTag( const AsciiString& tag ) const; Int getCount() const { diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h index a2218c7d15..eaed50be50 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h @@ -36,6 +36,7 @@ #include "Common/AudioEventRTS.h" #include "Common/INI.h" #include "Common/Snapshot.h" +#include "Common/BitFlags.h" // FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// class Player; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Xfer.h b/GeneralsMD/Code/GameEngine/Include/Common/Xfer.h index cab9f0b73a..e98ba4acbb 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Xfer.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Xfer.h @@ -35,8 +35,6 @@ #define __XFER_H_ // INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/STLTypedefs.h" -#include "Common/ModelState.h" #include "Common/Science.h" #include "Common/Upgrade.h" diff --git a/GeneralsMD/Code/GameEngine/Include/Common/crc.h b/GeneralsMD/Code/GameEngine/Include/Common/crc.h index 145097505d..0fc2998f99 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/crc.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/crc.h @@ -32,10 +32,11 @@ #define _CRC_H_ #include "Lib/BaseType.h" -#include "winsock2.h" // for htonl #ifdef _DEBUG +//#include "winsock2.h" // for htonl + class CRC { public: diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h index c155339fa1..e55545d7e2 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h @@ -56,7 +56,7 @@ enum Anim2DMode }; #ifdef DEFINE_ANIM_2D_MODE_NAMES -static char *Anim2DModeNames[] = +static const char *Anim2DModeNames[] = { "NONE", "ONCE", diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h b/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h index 2742711db1..67b761a3f8 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h @@ -95,13 +95,21 @@ enum AnimTypes } ; //----------------------------------------------------------------------------- +// TheSuperHackers @compile xezon 14/03/2025 Puts class into namespace to avoid name collision with AnimateWindow function in WinUser.h +namespace wnd +{ class AnimateWindow : public MemoryPoolObject { MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AnimateWindow, "AnimateWindow") public: AnimateWindow( void ); //~AnimateWindow( void ); - + + static AnimateWindow* createNewInstance() + { + return newInstance(AnimateWindow); + } + void setAnimData( ICoord2D startPos, ICoord2D endPos, ICoord2D curPos, ICoord2D restPos, Coord2D vel, UnsignedInt startTime, UnsignedInt endTime); ICoord2D getStartPos( void ); ///< Get the Start Position 2D coord @@ -146,11 +154,12 @@ class AnimateWindow : public MemoryPoolObject Bool m_needsToFinish; ///< Flag to tell the manager if we need to finish before it's done with it's animation Bool m_isFinished; ///< We're finished }; +} // namespace wnd //----------------------------------------------------------------------------- -typedef std::list AnimateWindowList; +typedef std::list AnimateWindowList; //----------------------------------------------------------------------------- class AnimateWindowManager : public SubsystemInterface @@ -191,6 +200,8 @@ class AnimateWindowManager : public SubsystemInterface //----------------------------------------------------------------------------- // INLINING /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- +namespace wnd +{ inline ICoord2D AnimateWindow::getStartPos( void ) { return m_startPos; }; inline ICoord2D AnimateWindow::getCurPos( void ) { return m_curPos; }; inline ICoord2D AnimateWindow::getEndPos( void ) { return m_endPos; }; @@ -217,6 +228,7 @@ class AnimateWindowManager : public SubsystemInterface inline Bool AnimateWindow::isFinished( void ) { return m_isFinished; }; inline void AnimateWindow::setNeedsToFinish( Bool needsToFinish) { m_needsToFinish = needsToFinish; }; inline Bool AnimateWindow::needsToFinish( void ) { return m_needsToFinish; }; +} // namespace wnd inline Bool AnimateWindowManager::isFinished( void ) { return !m_needsUpdate; }; inline Bool AnimateWindowManager::isReversed( void ) { return m_reverse; }; diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ClientRandomValue.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ClientRandomValue.h index 9ef9ffdf57..5a869e701b 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ClientRandomValue.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ClientRandomValue.h @@ -35,8 +35,8 @@ #include "Lib/BaseType.h" // do NOT use these functions directly, rather use the macros below -extern Int GetGameClientRandomValue( int lo, int hi, char *file, int line ); -extern Real GetGameClientRandomValueReal( Real lo, Real hi, char *file, int line ); +extern Int GetGameClientRandomValue( int lo, int hi, const char *file, int line ); +extern Real GetGameClientRandomValueReal( Real lo, Real hi, const char *file, int line ); // use these macros to access the random value functions #define GameClientRandomValue( lo, hi ) GetGameClientRandomValue( lo, hi, __FILE__, __LINE__ ) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h index 1a887c5af6..b535cf5b2b 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h @@ -116,7 +116,7 @@ enum FilterModes class PickAndPlayInfo { public: - PickAndPlayInfo::PickAndPlayInfo(); //INITIALIZE THE CONSTRUCTOR IN CPP + PickAndPlayInfo(); //INITIALIZE THE CONSTRUCTOR IN CPP Bool m_air; //Are we attacking an airborned target? Drawable *m_drawTarget; //Do we have an override draw target? diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DebugDisplay.h b/GeneralsMD/Code/GameEngine/Include/GameClient/DebugDisplay.h index 5ed1b5bd36..b3930688b2 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/DebugDisplay.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/DebugDisplay.h @@ -88,7 +88,7 @@ class DebugDisplayInterface virtual ~DebugDisplayInterface() {}; - virtual void printf( Char *format, ...) = 0; ///< Print formatted text at current cursor position + virtual void printf( const Char *format, ...) = 0; ///< Print formatted text at current cursor position virtual void setCursorPos( Int x, Int y ) = 0; ///< Set new cursor position virtual Int getCursorXPos( void ) = 0; ///< Get current X position of cursor virtual Int getCursorYPos( void ) = 0; ///< Get current Y position of cursor @@ -117,7 +117,7 @@ class DebugDisplay : public DebugDisplayInterface DebugDisplay(); virtual ~DebugDisplay() {}; - virtual void printf( Char *format, ...); ///< Print formatted text at current cursor position + virtual void printf( const Char *format, ...); ///< Print formatted text at current cursor position virtual void setCursorPos( Int x, Int y ); ///< Set new cursor position virtual Int getCursorXPos( void ); ///< Get current X position of cursor virtual Int getCursorYPos( void ); ///< Get current Y position of cursor diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h b/GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h index cc95b8a223..f52ff2cd08 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/DisconnectMenu.h @@ -69,13 +69,13 @@ class DisconnectMenu { DisconnectManager *m_disconnectManager; ///< For retrieving status updates from the disconnect manager. DisconnectMenuStateType m_menuState; ///< The current state of the menu screen. - static char *m_playerNameTextControlNames[MAX_SLOTS]; ///< names of the player name controls in the window. - static char *m_playerTimeoutTextControlNames[MAX_SLOTS]; ///< names of the timeout controls in the window. - static char *m_playerVoteButtonControlNames[MAX_SLOTS]; ///< names of the vote button controls in the window. - static char *m_playerVoteCountControlNames[MAX_SLOTS]; ///< names of the vote count static text controls in the window. - static char *m_packetRouterTimeoutControlName; ///< name of the packet router timeout control window. - static char *m_packetRouterTimeoutLabelControlName; ///< name of the packet router timeout label control window. - static char *m_textDisplayControlName; ///< name of the text display listbox control window. + static const char *m_playerNameTextControlNames[MAX_SLOTS]; ///< names of the player name controls in the window. + static const char *m_playerTimeoutTextControlNames[MAX_SLOTS]; ///< names of the timeout controls in the window. + static const char *m_playerVoteButtonControlNames[MAX_SLOTS]; ///< names of the vote button controls in the window. + static const char *m_playerVoteCountControlNames[MAX_SLOTS]; ///< names of the vote count static text controls in the window. + static const char *m_packetRouterTimeoutControlName; ///< name of the packet router timeout control window. + static const char *m_packetRouterTimeoutLabelControlName; ///< name of the packet router timeout label control window. + static const char *m_textDisplayControlName; ///< name of the text display listbox control window. }; extern DisconnectMenu *TheDisconnectMenu; diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h index b0cd8ba359..d08e5e3a6e 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h @@ -67,7 +67,7 @@ class Display : public SubsystemInterface DRAW_IMAGE_ADDITIVE //additive blend the image into frame buffer }; - typedef void (DebugDisplayCallback)( DebugDisplayInterface *debugDisplay, void *userData, FILE *fp = NULL ); + typedef void (DebugDisplayCallback)( DebugDisplayInterface *debugDisplay, void *userData, FILE *fp ); Display(); virtual ~Display(); diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h index 444f1ad297..6646130861 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h @@ -305,7 +305,7 @@ class Drawable : public Thing, void setTintStatus( TintStatus statusBits ) { BitSet( m_tintStatus, statusBits ); }; void clearTintStatus( TintStatus statusBits ) { BitClear( m_tintStatus, statusBits ); }; - Bool testTintStatus( TintStatus statusBits ) const { return BitTest( m_tintStatus, statusBits ); }; + Bool testTintStatus( TintStatus statusBits ) const { return BitIsSet( m_tintStatus, statusBits ); }; TintEnvelope *getColorTintEnvelope( void ) { return m_colorTintEnvelope; } void setColorTintEnvelope( TintEnvelope &source ) { if (m_colorTintEnvelope) *m_colorTintEnvelope = source; } @@ -371,7 +371,7 @@ class Drawable : public Thing, UnsignedInt getShroudClearFrame( void ) { return m_shroudClearFrame; } void setShadowsEnabled(Bool enable); - Bool getShadowsEnabled() const { return BitTest(m_status, DRAWABLE_STATUS_SHADOWS); } + Bool getShadowsEnabled() const { return BitIsSet(m_status, DRAWABLE_STATUS_SHADOWS); } void releaseShadows(void); ///< frees all shadow resources used by this module - used by Options screen. void allocateShadows(void); ///< create shadow resources if not already present. Used by Options screen. @@ -382,7 +382,7 @@ class Drawable : public Thing, // Put on ice until later... M Lorenzen // inline UnsignedByte getFullyObscuredByShroudWithCheatSpy(void) {return (UnsignedByte)m_drawableFullyObscuredByShroud | 128;}//8 looks like a zero in most fonts - Bool getDrawsInMirror() const { return BitTest(m_status, DRAWABLE_STATUS_DRAWS_IN_MIRROR) || isKindOf(KINDOF_CAN_CAST_REFLECTIONS); } + Bool getDrawsInMirror() const { return BitIsSet(m_status, DRAWABLE_STATUS_DRAWS_IN_MIRROR) || isKindOf(KINDOF_CAN_CAST_REFLECTIONS); } void colorFlash( const RGBColor *color, UnsignedInt decayFrames = DEF_DECAY_FRAMES, UnsignedInt attackFrames = 0, UnsignedInt sustainAtPeak = FALSE ); ///< flash a drawable in the color specified for a short time void colorTint( const RGBColor *color ); ///< tint this drawable the color specified diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h b/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h index 7a8a8db403..186c8b0661 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h @@ -47,9 +47,9 @@ class EstablishConnectionsMenu { protected: EstablishConnectionsMenuStateType m_menuState; - static char *m_playerReadyControlNames[MAX_SLOTS]; - static char *m_playerNameControlNames[MAX_SLOTS]; - static char *m_playerStatusControlNames[MAX_SLOTS]; + static const char *m_playerReadyControlNames[MAX_SLOTS]; + static const char *m_playerNameControlNames[MAX_SLOTS]; + static const char *m_playerStatusControlNames[MAX_SLOTS]; }; extern EstablishConnectionsMenu *TheEstablishConnectionsMenu; \ No newline at end of file diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h index a81a29eeff..6699328098 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h @@ -82,7 +82,7 @@ class LanguageFilter : public SubsystemInterface { void filterLine(UnicodeString &line); protected: - Bool readWord(File *file1, UnsignedShort *buf); + Bool readWord(File *file1, WideChar *buf); void unHaxor(UnicodeString &word); LangMap m_wordList; LangMap m_subWordList; diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h index 7184be9d2b..5a0075391c 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h @@ -251,33 +251,33 @@ class Particle : public MemoryPoolObject, /**** NOTE: These MUST be kept in sync with the enumerations below *****/ -static char *ParticleShaderTypeNames[] = +static const char *ParticleShaderTypeNames[] = { "NONE", "ADDITIVE", "ALPHA", "ALPHA_TEST", "MULTIPLY", NULL }; -static char *ParticleTypeNames[] = +static const char *ParticleTypeNames[] = { "NONE", "PARTICLE", "DRAWABLE", "STREAK", "VOLUME_PARTICLE","SMUDGE", NULL }; -static char *EmissionVelocityTypeNames[] = +static const char *EmissionVelocityTypeNames[] = { "NONE", "ORTHO", "SPHERICAL", "HEMISPHERICAL", "CYLINDRICAL", "OUTWARD", NULL }; -static char *EmissionVolumeTypeNames[] = +static const char *EmissionVolumeTypeNames[] = { "NONE", "POINT", "LINE", "BOX", "SPHERE", "CYLINDER", NULL }; //"NONE", "FLUFF", "DEBRIS", "NATURE", "WEAPON", "DAMAGE", "SPECIAL" -static char *ParticlePriorityNames[] = +static const char *ParticlePriorityNames[] = { "NONE", "WEAPON_EXPLOSION","SCORCHMARK","DUST_TRAIL","BUILDUP","DEBRIS_TRAIL","UNIT_DAMAGE_FX","DEATH_EXPLOSION","SEMI_CONSTANT","CONSTANT","WEAPON_TRAIL","AREA_EFFECT","CRITICAL", "ALWAYS_RENDER", NULL }; -static char *WindMotionNames[] = +static const char *WindMotionNames[] = { "NONE", "Unused", "PingPong", "Circular", NULL }; diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h index 000e305041..470eb5026e 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ProcessAnimateWindow.h @@ -64,7 +64,10 @@ //----------------------------------------------------------------------------- // FORWARD REFERENCES ///////////////////////////////////////////////////////// //----------------------------------------------------------------------------- +namespace wnd +{ class AnimateWindow; +} class GameWindow; //----------------------------------------------------------------------------- // TYPE DEFINES /////////////////////////////////////////////////////////////// @@ -77,10 +80,10 @@ class ProcessAnimateWindow ProcessAnimateWindow( void ){}; virtual ~ProcessAnimateWindow( void ){}; - virtual void initAnimateWindow( AnimateWindow *animWin ) = 0; - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ) = 0; - virtual Bool updateAnimateWindow( AnimateWindow *animWin ) = 0; - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ) = 0; + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ) = 0; + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ) = 0; + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ) = 0; + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ) = 0; virtual void setMaxDuration(UnsignedInt maxDuration) { } }; @@ -93,10 +96,10 @@ class ProcessAnimateWindowSlideFromRight : public ProcessAnimateWindow ProcessAnimateWindowSlideFromRight( void ); virtual ~ProcessAnimateWindowSlideFromRight( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting @@ -116,10 +119,10 @@ class ProcessAnimateWindowSlideFromLeft : public ProcessAnimateWindow ProcessAnimateWindowSlideFromLeft( void ); virtual ~ProcessAnimateWindowSlideFromLeft( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting @@ -139,10 +142,10 @@ class ProcessAnimateWindowSlideFromTop : public ProcessAnimateWindow ProcessAnimateWindowSlideFromTop( void ); virtual ~ProcessAnimateWindowSlideFromTop( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting @@ -160,10 +163,10 @@ class ProcessAnimateWindowSlideFromTopFast : public ProcessAnimateWindow ProcessAnimateWindowSlideFromTopFast( void ); virtual ~ProcessAnimateWindowSlideFromTopFast( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting @@ -183,10 +186,10 @@ class ProcessAnimateWindowSlideFromBottom : public ProcessAnimateWindow ProcessAnimateWindowSlideFromBottom( void ); virtual ~ProcessAnimateWindowSlideFromBottom( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting @@ -205,10 +208,10 @@ class ProcessAnimateWindowSpiral : public ProcessAnimateWindow ProcessAnimateWindowSpiral( void ); virtual ~ProcessAnimateWindowSpiral( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Real m_deltaTheta; Int m_maxR; @@ -223,10 +226,10 @@ class ProcessAnimateWindowSlideFromBottomTimed : public ProcessAnimateWindow ProcessAnimateWindowSlideFromBottomTimed( void ); virtual ~ProcessAnimateWindowSlideFromBottomTimed( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); virtual void setMaxDuration(UnsignedInt maxDuration) { m_maxDuration = maxDuration; } private: @@ -241,10 +244,10 @@ class ProcessAnimateWindowSlideFromRightFast : public ProcessAnimateWindow ProcessAnimateWindowSlideFromRightFast( void ); virtual ~ProcessAnimateWindowSlideFromRightFast( void ); - virtual void initAnimateWindow( AnimateWindow *animWin ); - virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); - virtual Bool updateAnimateWindow( AnimateWindow *animWin ); - virtual Bool reverseAnimateWindow( AnimateWindow *animWin ); + virtual void initAnimateWindow( wnd::AnimateWindow *animWin ); + virtual void initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay = 0 ); + virtual Bool updateAnimateWindow( wnd::AnimateWindow *animWin ); + virtual Bool reverseAnimateWindow( wnd::AnimateWindow *animWin ); private: Coord2D m_maxVel; // top speed windows travel in x and y Int m_slowDownThreshold; // when widnows get this close to their resting diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h index b26bc88a2a..30a61bcfc0 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h @@ -80,7 +80,7 @@ enum SHELL_SCRIPT_HOOK_TOTAL // Keep this guy last! }; -extern char *TheShellHookNames[]; ///< Contains a list of the text representation of the shell hooks Used in WorldBuilder and in the shell. +extern const char *TheShellHookNames[]; ///< Contains a list of the text representation of the shell hooks Used in WorldBuilder and in the shell. void SignalUIInteraction(Int interaction); #endif SHELLHOOKS_H diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/TerrainVisual.h b/GeneralsMD/Code/GameEngine/Include/GameClient/TerrainVisual.h index 63dc3ab608..712f3e583f 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/TerrainVisual.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/TerrainVisual.h @@ -187,7 +187,7 @@ typedef enum _TerrainLOD } TerrainLOD; #ifdef DEFINE_TERRAIN_LOD_NAMES -static char * TerrainLODNames[] = +static const char * TerrainLODNames[] = { "NONE", "MIN", diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h index bbbbaa7c5f..ecb7d34299 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h @@ -311,8 +311,18 @@ class Waypoint; class Team; class Weapon; +// TheSuperHackers @compile xezon 17/03/2025 Renames AI_PASSIVE to not conflict with macro in ws2def.h + // Note - written out in save/load xfer and .map files, don't change these numbers. -enum AttitudeType { AI_SLEEP = -2, AI_PASSIVE=-1, AI_NORMAL=0, AI_ALERT=1, AI_AGGRESSIVE=2, AI_INVALID=3 }; ///< AI "attitude" behavior modifiers +enum AttitudeType +{ + ATTITUDE_SLEEP = -2, + ATTITUDE_PASSIVE=-1, + ATTITUDE_NORMAL=0, + ATTITUDE_ALERT=1, + ATTITUDE_AGGRESSIVE=2, + ATTITUDE_INVALID=3 +}; ///< AI "attitude" behavior modifiers enum CommandSourceType; @@ -390,7 +400,7 @@ enum AICommandType // Stored in save file, do not reorder/renumber. jba. AICMD_FOLLOW_WAYPOINT_PATH_AS_TEAM_EXACT, AICMD_MOVE_AWAY_FROM_UNIT, AICMD_FOLLOW_PATH_APPEND, - AICMD_MOVE_TO_POSITION_EVEN_IF_SLEEPING, // same as AICMD_MOVE_TO_POSITION, but even AI_SLEEP units respond. + AICMD_MOVE_TO_POSITION_EVEN_IF_SLEEPING, // same as AICMD_MOVE_TO_POSITION, but even ATTITUDE_SLEEP units respond. AICMD_GUARD_TUNNEL_NETWORK, AICMD_EVACUATE_INSTANTLY, AICMD_EXIT_INSTANTLY, diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/LogicRandomValue.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/LogicRandomValue.h index d07a96c655..4f6d2b9912 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/LogicRandomValue.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/LogicRandomValue.h @@ -35,8 +35,8 @@ #include "Lib/BaseType.h" // do NOT use these functions directly, rather use the macros below -extern Int GetGameLogicRandomValue( int lo, int hi, char *file, int line ); -extern Real GetGameLogicRandomValueReal( Real lo, Real hi, char *file, int line ); +extern Int GetGameLogicRandomValue( int lo, int hi, const char *file, int line ); +extern Real GetGameLogicRandomValueReal( Real lo, Real hi, const char *file, int line ); // use these macros to access the random value functions #define GameLogicRandomValue( lo, hi ) GetGameLogicRandomValue( lo, hi, __FILE__, __LINE__ ) diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ChinookAIUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ChinookAIUpdate.h index 3213edf5ca..cdd11e8e57 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ChinookAIUpdate.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ChinookAIUpdate.h @@ -110,7 +110,7 @@ class ChinookAIUpdate : public SupplyTruckAIUpdate void recordOriginalPosition( const Coord3D &pos ) { m_originalPos.set( &pos ); } const Coord3D* getOriginalPosition() const { return &m_originalPos; } - Int ChinookAIUpdate::getUpgradedSupplyBoost() const; + Int getUpgradedSupplyBoost() const; protected: diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlightDeckBehavior.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlightDeckBehavior.h index 5386d0363c..b41c2bb43d 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlightDeckBehavior.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlightDeckBehavior.h @@ -50,7 +50,7 @@ enum struct RunwayDefinition { - RunwayDefinition::RunwayDefinition() + RunwayDefinition() { m_catapultParticleSystem = NULL; } diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailroadGuideAIUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailroadGuideAIUpdate.h index e02d2c109b..21df65f4ec 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailroadGuideAIUpdate.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailroadGuideAIUpdate.h @@ -265,7 +265,6 @@ class RailroadBehavior : public PhysicsBehavior void FindPosByPathDistance( Coord3D *pos, const Real dist, const Real length, Bool setState = FALSE ); void playImpactSound(Object *victim, const Coord3D *impactPosition); - TemplateNameIterator m_carriageTemplateNameIterator; StationTask m_nextStationTask; ObjectID m_trailerID; ///< the ID of the object I am directly pulling PullInfo conductorPullInfo; diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h index fd15a52f3b..896e845ce5 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h @@ -262,12 +262,12 @@ class Object : public Thing, public Snapshot Bool isLocallyControlled() const; Bool isNeutralControlled() const; - Bool getIsUndetectedDefector(void) const { return BitTest(m_privateStatus, UNDETECTED_DEFECTOR); } + Bool getIsUndetectedDefector(void) const { return BitIsSet(m_privateStatus, UNDETECTED_DEFECTOR); } void friend_setUndetectedDefector(Bool status); - inline Bool isOffMap() const { return BitTest(m_privateStatus, OFF_MAP); } + inline Bool isOffMap() const { return BitIsSet(m_privateStatus, OFF_MAP); } - inline Bool isCaptured() const { return BitTest(m_privateStatus, CAPTURED); } + inline Bool isCaptured() const { return BitIsSet(m_privateStatus, CAPTURED); } void setCaptured(Bool isCaptured); inline const GeometryInfo& getGeometryInfo() const { return m_geometryInfo; } @@ -330,8 +330,8 @@ class Object : public Thing, public Snapshot SpecialPowerUpdateInterface* findSpecialPowerWithOverridableDestinationActive( SpecialPowerType type = SPECIAL_INVALID ) const; SpecialPowerUpdateInterface* findSpecialPowerWithOverridableDestination( SpecialPowerType type = SPECIAL_INVALID ) const; - CountermeasuresBehaviorInterface* Object::getCountermeasuresBehaviorInterface(); - const CountermeasuresBehaviorInterface* Object::getCountermeasuresBehaviorInterface() const; + CountermeasuresBehaviorInterface* getCountermeasuresBehaviorInterface(); + const CountermeasuresBehaviorInterface* getCountermeasuresBehaviorInterface() const; inline ObjectStatusMaskType getStatusBits() const { return m_status; } inline Bool testStatus( ObjectStatusTypes bit ) const { return m_status.test( bit ); } @@ -349,7 +349,7 @@ class Object : public Thing, public Snapshot void forceRefreshSubObjectUpgradeStatus(); // Useful for status bits that can be set by the scripting system - inline Bool testScriptStatusBit(ObjectScriptStatusBit b) const { return BitTest(m_scriptStatus, b); } + inline Bool testScriptStatusBit(ObjectScriptStatusBit b) const { return BitIsSet(m_scriptStatus, b); } void setScriptStatus( ObjectScriptStatusBit bit, Bool set = true ); inline void clearScriptStatus( ObjectScriptStatusBit bit ) { setScriptStatus(bit, false); } @@ -467,7 +467,7 @@ class Object : public Thing, public Snapshot void setCommandSetStringOverride( AsciiString newCommandSetString ) { m_commandSetStringOverride = newCommandSetString; } /// People are faking their commandsets, and, Surprise!, they are authoritative. Challenge everything. - Bool Object::canProduceUpgrade( const UpgradeTemplate *upgrade ); + Bool canProduceUpgrade( const UpgradeTemplate *upgrade ); // Weapons & Damage ------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/PartitionManager.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/PartitionManager.h index 2e5c8f0bc1..69fabd4822 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/PartitionManager.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/PartitionManager.h @@ -517,7 +517,8 @@ class PartitionData : public MemoryPoolObject inline Int wasSeenByAnyPlayers() const /// VecNamedReveal; typedef VecNamedReveal::iterator VecNamedRevealIt; -class AttackPriorityInfo : public MemoryPoolObject, public Snapshot +// TheSuperHackers @compile xezon 17/03/2025 Fixes destructor visibility by removing MemoryPoolObject base class. +// MemoryPoolObject looks to be unnecessary because it is never dynamically allocated. +class AttackPriorityInfo : public Snapshot { - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AttackPriorityInfo, "AttackPriorityInfo") - -// friend bad for MPOs. (srj) -//friend class ScriptEngine; - public: AttackPriorityInfo(); - //~AttackPriorityInfo(); + ~AttackPriorityInfo(); public: @@ -150,7 +147,7 @@ class AttackPriorityInfo : public MemoryPoolObject, public Snapshot protected: - // sanapshot methods + // snapshot methods virtual void crc( Xfer *xfer ); virtual void xfer( Xfer *xfer ); virtual void loadPostProcess( void ); diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSet.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSet.h index 62f07f5185..802c3198df 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSet.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSet.h @@ -54,7 +54,7 @@ enum DamageType; #include "GameLogic/WeaponSetFlags.h" #ifdef DEFINE_WEAPONSLOTTYPE_NAMES -static char *TheWeaponSlotTypeNames[] = +static const char *TheWeaponSlotTypeNames[] = { "PRIMARY", "SECONDARY", diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/WebBrowser.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/WebBrowser.h index fa76db2b90..aaaf2bc7e4 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/WebBrowser.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/WebBrowser.h @@ -45,6 +45,7 @@ #ifndef __WEBBROWSER_H__ #define __WEBBROWSER_H__ +#include "Common/CppMacros.h" #include "Common/SubsystemInterface.h" #include #include @@ -86,7 +87,7 @@ class WebBrowser : void update( void ); // Create an instance of the embedded browser for Dune Emperor. - virtual Bool createBrowserWindow(char *tag, GameWindow *win) = 0; + virtual Bool createBrowserWindow(const char *tag, GameWindow *win) = 0; virtual void closeBrowserWindow(GameWindow *win) = 0; WebBrowserURL *makeNewURL(AsciiString tag); @@ -112,9 +113,9 @@ class WebBrowser : // IUnknown methods //--------------------------------------------------------------------------- protected: - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); - ULONG STDMETHODCALLTYPE AddRef(void); - ULONG STDMETHODCALLTYPE Release(void); + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) NOEXCEPT_17; + ULONG STDMETHODCALLTYPE AddRef(void) NOEXCEPT_17; + ULONG STDMETHODCALLTYPE Release(void) NOEXCEPT_17; //--------------------------------------------------------------------------- // IBrowserDispatch methods diff --git a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h index 97c95443b5..adbc6ebb90 100644 --- a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h +++ b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h @@ -49,12 +49,18 @@ class STLSpecialAlloc; #include #include #include +#ifdef USING_STLPORT #include +#else +#include +#endif #include #include #include #include +#if defined(_MSC_VER) && _MSC_VER < 1300 #include +#endif #include #include #include diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/AudioEventRTS.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/AudioEventRTS.cpp index 46800a5554..7d1dcc6ca4 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/AudioEventRTS.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/AudioEventRTS.cpp @@ -340,7 +340,7 @@ void AudioEventRTS::generateFilename( void ) - if (BitTest(m_eventInfo->m_control, AC_RANDOM)) + if (BitIsSet(m_eventInfo->m_control, AC_RANDOM)) { if (m_isLogicalAudio) { @@ -474,7 +474,7 @@ void AudioEventRTS::advanceNextPlayPortion( void ) m_portionToPlayNext = PP_Sound; break; case PP_Sound: - if (m_eventInfo && BitTest(m_eventInfo->m_control, AC_ALL)) + if (m_eventInfo && BitIsSet(m_eventInfo->m_control, AC_ALL)) { if (m_allCount == m_eventInfo->m_sounds.size()) { m_portionToPlayNext = PP_Decay; @@ -671,7 +671,7 @@ Bool AudioEventRTS::isPositionalAudio( void ) const { if( m_eventInfo ) { - if( !BitTest( m_eventInfo->m_type, ST_WORLD ) ) + if( !BitIsSet( m_eventInfo->m_type, ST_WORLD ) ) { return FALSE; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/DynamicAudioEventInfo.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/DynamicAudioEventInfo.cpp index 289cb4dc8e..f47c96c33c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/DynamicAudioEventInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/DynamicAudioEventInfo.cpp @@ -167,7 +167,7 @@ void DynamicAudioEventInfo::xferNoName( Xfer * xfer ) Int field; for ( field = 0; field < OVERRIDE_COUNT; field++ ) { - m_overriddenFields.set( field, BitTest( overriddenFlags, 1 << field ) ); + m_overriddenFields.set( field, BitIsSet( overriddenFlags, 1 << field ) ); } } else @@ -187,7 +187,7 @@ void DynamicAudioEventInfo::xferNoName( Xfer * xfer ) if ( wasLoopFlagOverriden() ) { - Bool loopFlag = BitTest( m_control, AC_LOOP ); + Bool loopFlag = BitIsSet( m_control, AC_LOOP ); xfer->xferBool( &loopFlag ); if ( loopFlag ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 4ff913367f..99fb6df89f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -1034,18 +1034,18 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) return TRUE; } - if (!BitTest(ei->m_type, (ST_PLAYER | ST_ALLIES | ST_ENEMIES | ST_EVERYONE))) { + if (!BitIsSet(ei->m_type, (ST_PLAYER | ST_ALLIES | ST_ENEMIES | ST_EVERYONE))) { DEBUG_CRASH(("No player restrictions specified for '%s'. Using Everyone.\n", ei->m_audioName.str())); return TRUE; } - if (BitTest(ei->m_type, ST_EVERYONE)) { + if (BitIsSet(ei->m_type, ST_EVERYONE)) { return TRUE; } Player *owningPlayer = ThePlayerList->getNthPlayer(audioEvent->getPlayerIndex()); - if (BitTest(ei->m_type, ST_PLAYER) && BitTest(ei->m_type, ST_UI) && owningPlayer == NULL) { + if (BitIsSet(ei->m_type, ST_PLAYER) && BitIsSet(ei->m_type, ST_UI) && owningPlayer == NULL) { DEBUG_ASSERTCRASH(!TheGameLogic->isInGameLogicUpdate(), ("Playing %s sound -- player-based UI sound without specifying a player.\n")); return TRUE; } @@ -1065,17 +1065,17 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) return FALSE; } - if (BitTest(ei->m_type, ST_PLAYER)) { + if (BitIsSet(ei->m_type, ST_PLAYER)) { return owningPlayer == localPlayer; } - if (BitTest(ei->m_type, ST_ALLIES)) { + if (BitIsSet(ei->m_type, ST_ALLIES)) { // We have to also check that the owning player isn't the local player, because PLAYER // wasn't specified, or we wouldn't have gotten here. return (owningPlayer != localPlayer) && owningPlayer->getRelationship(localTeam) == ALLIES; } - if (BitTest(ei->m_type, ST_ENEMIES)) { + if (BitIsSet(ei->m_type, ST_ENEMIES)) { return owningPlayer->getRelationship(localTeam) == ENEMIES; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp index 5ee9d289c9..727ece6810 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp @@ -217,7 +217,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) // if so, kill them and start our sound // if not, we're done. Can't play dude. - if( event->isPositionalAudio() && !BitTest( event->getAudioEventInfo()->m_type, ST_GLOBAL) && event->getAudioEventInfo()->m_priority != AP_CRITICAL ) + if( event->isPositionalAudio() && !BitIsSet( event->getAudioEventInfo()->m_type, ST_GLOBAL) && event->getAudioEventInfo()->m_priority != AP_CRITICAL ) { Coord3D distance = *TheAudio->getListenerPosition(); const Coord3D *pos = event->getCurrentPosition(); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp index ba3c04d2f4..fcc5765b06 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp @@ -141,13 +141,13 @@ DynamicGameLODInfo::DynamicGameLODInfo(void) }; //Keep this in sync with enum in GameLOD.h -static char *CPUNames[] = +static const char *CPUNames[] = { "XX","P3", "P4","K7", NULL }; //Keep this in sync with enum in GameLOD.h -static char *VideoNames[] = +static const char *VideoNames[] = { "XX","V2","V3","V4","V5","TNT","TNT2","GF2","R100","PS11","GF3","GF4","PS14","R200","PS20","R300", NULL }; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp index 318d36af1e..3404fdd6e6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp @@ -323,7 +323,8 @@ static INIBlockParse findBlockParse(const char* token) //------------------------------------------------------------------------------------------------- static INIFieldParseProc findFieldParse(const FieldParse* parseTable, const char* token, int& offset, const void*& userData) { - for (const FieldParse* parse = parseTable; parse->token; ++parse) + const FieldParse* parse = parseTable; + for (; parse->token; ++parse) { if (strcmp( parse->token, token ) == 0) { @@ -1504,7 +1505,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList for (int ptIdx = 0; ptIdx < parseTableList.getCount(); ++ptIdx) { int offset = 0; - void* userData = 0; + const void* userData = 0; INIFieldParseProc parse = findFieldParse(parseTableList.getNthFieldParse(ptIdx), field, offset, userData); if (parse) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp index eb3e8355bf..0ea67eee6b 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp @@ -179,7 +179,7 @@ static void parsePitchShift( INI* ini, void *instance, void *store, const void* // STATIC DEFINIITIONS //////////////////////////////////////////////////////////////////////////// -char *theAudioPriorityNames[] = +const char *theAudioPriorityNames[] = { "LOWEST", "LOW", @@ -189,7 +189,7 @@ char *theAudioPriorityNames[] = NULL }; -char *theSoundTypeNames[] = +const char *theSoundTypeNames[] = { "UI", "WORLD", @@ -203,7 +203,7 @@ char *theSoundTypeNames[] = NULL }; -char *theAudioControlNames[] = +const char *theAudioControlNames[] = { "LOOP", "RANDOM", diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp index 681e95e668..3035213cf0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INICommandButton.cpp @@ -77,7 +77,7 @@ void ControlBar::parseCommandButtonDefinition( INI *ini ) //Make sure buttons with special power templates also have the appropriate option set. const SpecialPowerTemplate *spTemplate = button->getSpecialPowerTemplate(); - Bool needsTemplate = BitTest( button->getOptions(), NEED_SPECIAL_POWER_SCIENCE ); + Bool needsTemplate = BitIsSet( button->getOptions(), NEED_SPECIAL_POWER_SCIENCE ); if( spTemplate && !needsTemplate ) { DEBUG_CRASH( ("[LINE: %d in '%s'] CommandButton %s has SpecialPower = %s but the button also requires Options = NEED_SPECIAL_POWER_SCIENCE. Failure to do so will cause bugs such as invisible side shortcut buttons", diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp index 5aa57ad5c8..766b314127 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWater.cpp @@ -57,7 +57,7 @@ void INI::parseWaterSettingDefinition( INI* ini ) name.set( token ); // get the water setting we want to load based on name - char **timeOfDayName = TimeOfDayNames; + const char **timeOfDayName = TimeOfDayNames; Int timeOfDayIndex = 0; // TIME_OF_DAY_INVALID while( timeOfDayName && *timeOfDayName ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp index 58f10de57a..fc2c79dc6c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp @@ -113,7 +113,8 @@ GameMessageArgumentDataType GameMessage::getArgumentDataType( Int argIndex ) return ARGUMENTDATATYPE_UNKNOWN; } int i=0; - for (GameMessageArgument *a = m_argList; a && (i < argIndex); a=a->m_next, ++i ); + GameMessageArgument *a = m_argList; + for (; a && (i < argIndex); a=a->m_next, ++i ); if (a != NULL) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 59959f24fe..fbfabb626e 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -2054,7 +2054,8 @@ void Player::setUnitsShouldHunt(Bool unitsShouldHunt, CommandSourceType source) //============================================================================= void Player::killPlayer(void) { - for (PlayerTeamList::iterator it = m_playerTeamPrototypes.begin(); it != m_playerTeamPrototypes.end(); ++it) { + PlayerTeamList::iterator it = m_playerTeamPrototypes.begin(); + for (; it != m_playerTeamPrototypes.end(); ++it) { for (DLINK_ITERATOR iter = (*it)->iterate_TeamInstanceList(); !iter.done(); iter.advance()) { Team *team = iter.cur(); if (!team) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 5000626891..ff739618df 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -380,7 +380,7 @@ Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) { player = getNthPlayer( i ); - if ( player && BitTest(player->getPlayerMask(), maskToAdjust )) + if ( player && BitIsSet(player->getPlayerMask(), maskToAdjust )) { maskToAdjust &= (~player->getPlayerMask()); return player; @@ -405,7 +405,7 @@ PlayerMaskType PlayerList::getPlayersWithRelationship( Int srcPlayerIndex, Unsig if (!srcPlayer) return retVal; - if (BitTest(allowedRelationships, ALLOW_SAME_PLAYER)) + if (BitIsSet(allowedRelationships, ALLOW_SAME_PLAYER)) BitSet(retVal, srcPlayer->getPlayerMask()); for ( Int i = 0; i < getPlayerCount(); ++i ) @@ -420,15 +420,15 @@ PlayerMaskType PlayerList::getPlayersWithRelationship( Int srcPlayerIndex, Unsig switch (srcPlayer->getRelationship(player->getDefaultTeam())) { case ENEMIES: - if (BitTest(allowedRelationships, ALLOW_ENEMIES)) + if (BitIsSet(allowedRelationships, ALLOW_ENEMIES)) BitSet(retVal, player->getPlayerMask()); break; case ALLIES: - if (BitTest(allowedRelationships, ALLOW_ALLIES)) + if (BitIsSet(allowedRelationships, ALLOW_ALLIES)) BitSet(retVal, player->getPlayerMask()); break; case NEUTRAL: - if (BitTest(allowedRelationships, ALLOW_NEUTRAL)) + if (BitIsSet(allowedRelationships, ALLOW_NEUTRAL)) BitSet(retVal, player->getPlayerMask()); break; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index 0f2a303b81..d2ce15c424 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -713,7 +713,7 @@ TeamTemplateInfo::TeamTemplateInfo(Dict *d) : m_automaticallyReinforce = d->getBool(TheKey_teamAutoReinforce, &exists); Int interact = d->getInt(TheKey_teamAggressiveness, &exists); - m_initialTeamAttitude = AI_NORMAL; + m_initialTeamAttitude = ATTITUDE_NORMAL; if (exists) { m_initialTeamAttitude = (AttitudeType) interact; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp index 01879f6a3c..70c0567e23 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp @@ -200,7 +200,7 @@ DEBUG_LOG(( "InitRandom Logic %08lx\n",seed)); // // Integer random value // -Int GetGameLogicRandomValue( int lo, int hi, char *file, int line ) +Int GetGameLogicRandomValue( int lo, int hi, const char *file, int line ) { //Int delta = hi - lo + 1; //Int rval; @@ -236,7 +236,7 @@ DEBUG_LOG(( "%d: GetGameLogicRandomValue = %d (%d - %d), %s line %d\n", // // Integer random value // -Int GetGameClientRandomValue( int lo, int hi, char *file, int line ) +Int GetGameClientRandomValue( int lo, int hi, const char *file, int line ) { UnsignedInt delta = hi - lo + 1; Int rval; @@ -259,7 +259,7 @@ DEBUG_LOG(( "%d: GetGameClientRandomValue = %d (%d - %d), %s line %d\n", // // Integer random value // -Int GetGameAudioRandomValue( int lo, int hi, char *file, int line ) +Int GetGameAudioRandomValue( int lo, int hi, const char *file, int line ) { UnsignedInt delta = hi - lo + 1; Int rval; @@ -282,7 +282,7 @@ DEBUG_LOG(( "%d: GetGameAudioRandomValue = %d (%d - %d), %s line %d\n", // // Real valued random value // -Real GetGameLogicRandomValueReal( Real lo, Real hi, char *file, int line ) +Real GetGameLogicRandomValueReal( Real lo, Real hi, const char *file, int line ) { Real delta = hi - lo; Real rval; @@ -306,7 +306,7 @@ DEBUG_LOG(( "%d: GetGameLogicRandomValueReal = %f, %s line %d\n", // // Real valued random value // -Real GetGameClientRandomValueReal( Real lo, Real hi, char *file, int line ) +Real GetGameClientRandomValueReal( Real lo, Real hi, const char *file, int line ) { Real delta = hi - lo; Real rval; @@ -330,7 +330,7 @@ DEBUG_LOG(( "%d: GetGameClientRandomValueReal = %f, %s line %d\n", // // Real valued random value // -Real GetGameAudioRandomValueReal( Real lo, Real hi, char *file, int line ) +Real GetGameAudioRandomValueReal( Real lo, Real hi, const char *file, int line ) { Real delta = hi - lo; Real rval; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp index 7a72776a9d..7f5abd08c1 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp @@ -1165,7 +1165,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) * Read a unicode string from the current file position. The string is assumed to be 0-terminated. */ UnicodeString RecorderClass::readUnicodeString() { - UnsignedShort str[1024] = L""; + WideChar str[1024] = L""; Int index = 0; Int c = fgetwc(m_file); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index 5ca2804fc6..cb8bd1b3e0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -684,13 +684,13 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos Relationship rel = builderObject ? builderObject->getRelationship( them ) : NEUTRAL; //Kris: If the object is stealthed and we can't see it, pretend we can build there. - if( BitTest( options, IGNORE_STEALTHED ) ) + if( BitIsSet( options, IGNORE_STEALTHED ) ) { if( rel != ALLIES ) { if( them->testStatus( OBJECT_STATUS_STEALTHED ) && !them->testStatus( OBJECT_STATUS_DETECTED ) && !them->testStatus( OBJECT_STATUS_DISGUISED ) ) { - if( BitTest( options, FAIL_STEALTHED_WITHOUT_FEEDBACK ) ) + if( BitIsSet( options, FAIL_STEALTHED_WITHOUT_FEEDBACK ) ) { feedbackWithFailure = FALSE; //We want to fail now but without feedback } @@ -823,7 +823,7 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos Relationship rel = builderObject ? builderObject->getRelationship( them ) : NEUTRAL; //Kris: If the building is stealthed and we can't see it, pretend we can build there. - if( BitTest( options, IGNORE_STEALTHED ) ) + if( BitIsSet( options, IGNORE_STEALTHED ) ) { if( rel != ALLIES ) { @@ -922,7 +922,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, // check shroud level // This should be the first check, since returning other errors for shrouded areas could be used to game the system - if( BitTest( options, SHROUD_REVEALED ) ) + if( BitIsSet( options, SHROUD_REVEALED ) ) { { Int x, y; @@ -943,7 +943,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, // any immobile objects, or an enemy object. Friendly objects should politely // "move out of the way" when you build something where they're standing // - if( BitTest( options, NO_OBJECT_OVERLAP ) ) + if( BitIsSet( options, NO_OBJECT_OVERLAP ) ) { LegalBuildCode code = isLocationClearOfObjects(worldPos, build, angle, builderObject, options, player); if( code != LBC_OK ) @@ -956,7 +956,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, // if NO_ENEMY_OBJECT_OVERLAP is set, we are not allowed to construct 'build' if it would overlap // any enemy objects. Friendly objects are ignored. // - if( BitTest( options, NO_ENEMY_OBJECT_OVERLAP ) ) + if( BitIsSet( options, NO_ENEMY_OBJECT_OVERLAP ) ) { LegalBuildCode code = isLocationClearOfObjects(worldPos, build, angle, builderObject, options, player); if( code != LBC_OK ) @@ -994,7 +994,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, } // if clear path is requested check to see if the builder object can get there (unless it's a structure) - if( BitTest( options, CLEAR_PATH ) && builderObject && !builderObject->isKindOf( KINDOF_IMMOBILE ) ) + if( BitIsSet( options, CLEAR_PATH ) && builderObject && !builderObject->isKindOf( KINDOF_IMMOBILE ) ) { AIUpdateInterface *ai = builderObject->getAIUpdateInterface(); @@ -1014,7 +1014,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, } // end if // check basic terrain restrctions - if( BitTest( options, TERRAIN_RESTRICTIONS ) ) + if( BitIsSet( options, TERRAIN_RESTRICTIONS ) ) { // diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp index 92b9f545a5..972f7feec0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp @@ -275,7 +275,7 @@ DataChunkOutput::~DataChunkOutput() ::fclose(m_tmp_file); } -void DataChunkOutput::openDataChunk( char *name, DataChunkVersionType ver ) +void DataChunkOutput::openDataChunk( const char *name, DataChunkVersionType ver ) { // allocate (or get existing) ID from the table of m_contents UnsignedInt id = m_contents.allocateID( AsciiString(name) ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp index 0a90b9cefc..c909b08b9d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp @@ -65,7 +65,7 @@ extern bool DX8Wrapper_IsWindowed; extern HWND ApplicationHWnd; -extern char *gAppPrefix; /// So WB can have a different log file name. +extern const char *gAppPrefix; /// So WB can have a different log file name. #ifdef _INTERNAL // this should ALWAYS be present @@ -771,7 +771,7 @@ void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m) theReleaseCrashLogFile = fopen(curbuf, "w"); if (theReleaseCrashLogFile) { - fprintf(theReleaseCrashLogFile, "Release Crash at %s; Reason %s\n", getCurrentTimeString(), mesg.str()); + fprintf(theReleaseCrashLogFile, "Release Crash at %s; Reason %ls\n", getCurrentTimeString(), mesg.str()); const int STACKTRACE_SIZE = 12; const int STACKTRACE_SKIP = 6; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp index 3d14ce41d5..9b4754eefb 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp @@ -95,7 +95,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) while (!done) { // if this is a subdirectory keep the name around till the end - if( BitTest( item.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY ) ) + if( BitIsSet( item.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY ) ) { if ( strcmp( item.cFileName, "." ) && strcmp( item.cFileName, ".." ) ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp index 3a7528fe25..b449d3cff4 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -1635,7 +1635,8 @@ void* MemoryPool::allocateBlockDoNotZeroImplementation(DECLARE_LITERALSTRING_ARG { // hmm... the current 'free' blob has nothing available. look and see if there // are any other existing blobs with freespace. - for (MemoryPoolBlob *blob = m_firstBlob; blob != NULL; blob = blob->getNextInList()) + MemoryPoolBlob *blob = m_firstBlob; + for (; blob != NULL; blob = blob->getNextInList()) { if (blob->hasAnyFreeBlocks()) break; @@ -3138,7 +3139,8 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en DEBUG_LOG(("------------------------------------------\n")); DEBUG_LOG(("Begin Pool Overflow Report\n")); DEBUG_LOG(("------------------------------------------\n")); - for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) + MemoryPool *pool = m_firstPoolInFactory; + for (; pool; pool = pool->getNextPoolInList()) { if (pool->getPeakBlockCount() > pool->getInitialBlockCount()) { @@ -3450,7 +3452,7 @@ void initMemoryManager() linktest = new char[8]; delete [] linktest; - linktest = new char("",1); + linktest = new char('\0'); delete linktest; #ifdef MEMORYPOOL_OVERRIDE_MALLOC diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp index 050b54846a..c02b378593 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameType.cpp @@ -26,7 +26,7 @@ #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine -char *TimeOfDayNames[] = +const char *TimeOfDayNames[] = { "NONE", "MORNING", @@ -37,7 +37,7 @@ char *TimeOfDayNames[] = NULL }; -char *WeatherNames[] = +const char *WeatherNames[] = { "NORMAL", "SNOWY", diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp index 15e9ac9a56..a4181645d6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp @@ -114,7 +114,7 @@ AsciiString AsciiStringToQuotedPrintable(AsciiString original) // Convert ascii quoted-printable strings into unicode strings UnicodeString QuotedPrintableToUnicodeString(AsciiString original) { - static unsigned short dest[1024]; + static WideChar dest[1024]; int i=0; unsigned char *c = (unsigned char *)dest; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp index 8362cea506..1b792fabbf 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp @@ -1025,7 +1025,8 @@ void Radar::createEvent( const Coord3D *world, RadarEventType type, Real seconds // lookup the colors we are to used based on the event RGBAColorInt color[ 2 ]; - for( Int i = 0; radarColorLookupTable[ i ].event != RADAR_EVENT_INVALID; ++i ) + Int i = 0; + for( ; radarColorLookupTable[ i ].event != RADAR_EVENT_INVALID; ++i ) { if( radarColorLookupTable[ i ].event == type ) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index 5e0b3a45b9..a388bccaf8 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -789,7 +789,7 @@ Bool GameState::isInSaveDirectory(const AsciiString& path) const // ------------------------------------------------------------------------------------------------ AsciiString GameState::getMapLeafName(const AsciiString& in) const { - char* p = strrchr(in.str(), '\\'); + const char* p = strrchr(in.str(), '\\'); if (p) { // diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp index 1627301f4b..4b022f9458 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -560,7 +560,8 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) /* ** Match the exception type with the error string and print it out */ - for ( int i=0 ; _codes[i] != 0xffffffff ; i++ ) + int i=0; + for ( ; _codes[i] != 0xffffffff ; i++ ) { if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/XferLoad.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/XferLoad.cpp index 33208b5584..c188c6e1c6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/XferLoad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/XferLoad.cpp @@ -186,7 +186,7 @@ void XferLoad::xferSnapshot( Snapshot *snapshot ) snapshot->xfer( this ); // add this snapshot to the game state for later post processing if not restricted - if( BitTest( getOptions(), XO_NO_POST_PROCESSING ) == FALSE ) + if( BitIsSet( getOptions(), XO_NO_POST_PROCESSING ) == FALSE ) TheGameState->addPostProcessSnapshot( snapshot ); } // end xferSnapshot diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp index 19eaf99bf5..960f21e163 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp @@ -88,8 +88,9 @@ Bool setStringInRegistry( HKEY root, AsciiString path, AsciiString key, AsciiStr unsigned long type; unsigned long returnValue; int size; + char lpClass[] = "REG_NONE"; - if ((returnValue = RegCreateKeyEx( root, path.str(), 0, "REG_NONE", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) + if ((returnValue = RegCreateKeyEx( root, path.str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) { type = REG_SZ; size = val.getLength()+1; @@ -106,8 +107,9 @@ Bool setUnsignedIntInRegistry( HKEY root, AsciiString path, AsciiString key, Uns unsigned long type; unsigned long returnValue; int size; + char lpClass[] = "REG_NONE"; - if ((returnValue = RegCreateKeyEx( root, path.str(), 0, "REG_NONE", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) + if ((returnValue = RegCreateKeyEx( root, path.str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) { type = REG_DWORD; size = 4; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 370d1d7e4c..918c04abd2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -111,7 +111,11 @@ ThingFactory::ThingFactory() m_firstTemplate = NULL; m_nextTemplateID = 1; // not zero! +#ifdef USING_STLPORT m_templateHashMap.resize( TEMPLATE_HASH_SIZE ); +#else + m_templateHashMap.reserve( TEMPLATE_HASH_SIZE ); +#endif } // end ThingFactory //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 1a481a9ff3..93fc07e60e 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -1322,7 +1322,8 @@ void ThingTemplate::initForLTA(const AsciiString& name) char buffer[1024]; strncpy(buffer, name.str(), sizeof(buffer)); - for (int i=0; buffer[i]; i++) { + int i=0; + for (; buffer[i]; i++) { if (buffer[i] == '/') { i++; break; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp b/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp index efd4c70042..0bebce1fe7 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp @@ -904,7 +904,8 @@ Bool LadderPreferences::loadProfile( Int profileID ) continue; p.port = atoi( ptr + 1 ); - for (Int i=0; iisPermanentSound() ) { - if( BitTest( info->m_type, ST_GLOBAL) || info->m_priority == AP_CRITICAL ) + if( BitIsSet( info->m_type, ST_GLOBAL) || info->m_priority == AP_CRITICAL ) { //Play it anyways. m_ambientSound->m_event.setDrawableID(getID()); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp index 9f49b758c9..1aca52d3e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp @@ -64,7 +64,9 @@ //----------------------------------------------------------------------------- // AnimateWindow PUBLIC FUNCTIONS ///////////////////////////////////////////// //----------------------------------------------------------------------------- -AnimateWindow::AnimateWindow( void ) +namespace wnd +{ +AnimateWindow::AnimateWindow(void) { m_delay = 0; m_startPos.x = m_startPos.y = 0; @@ -101,13 +103,15 @@ void AnimateWindow::setAnimData( ICoord2D startPos, ICoord2D endPos, } +} // namespace wnd + //----------------------------------------------------------------------------- // PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- static void clearWinList(AnimateWindowList &winList) { - AnimateWindow *win = NULL; + wnd::AnimateWindow *win = NULL; while (!winList.empty()) { win = *(winList.begin()); @@ -190,7 +194,7 @@ void AnimateWindowManager::update( void ) while (it != m_winMustFinishList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -219,7 +223,7 @@ void AnimateWindowManager::update( void ) while (it != m_winList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -255,7 +259,7 @@ void AnimateWindowManager::registerGameWindow(GameWindow *win, AnimTypes animTyp } // Create a new AnimateWindow class and fill in it's data. - AnimateWindow *animWin = newInstance(AnimateWindow); + wnd::AnimateWindow *animWin = wnd::AnimateWindow::createNewInstance(); animWin->setGameWindow(win); animWin->setAnimType(animType); animWin->setNeedsToFinish(needsToFinish); @@ -330,7 +334,7 @@ void AnimateWindowManager::reverseAnimateWindow( void ) AnimateWindowList::iterator it = m_winMustFinishList.begin(); while (it != m_winMustFinishList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -344,7 +348,7 @@ void AnimateWindowManager::reverseAnimateWindow( void ) it = m_winMustFinishList.begin(); while (it != m_winMustFinishList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -365,7 +369,7 @@ void AnimateWindowManager::reverseAnimateWindow( void ) while (it != m_winList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -390,7 +394,7 @@ void AnimateWindowManager::resetToRestPosition( void ) AnimateWindowList::iterator it = m_winMustFinishList.begin(); while (it != m_winMustFinishList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); @@ -405,7 +409,7 @@ void AnimateWindowManager::resetToRestPosition( void ) it = m_winList.begin(); while (it != m_winList.end()) { - AnimateWindow *animWin = *it; + wnd::AnimateWindow *animWin = *it; if (!animWin) { DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List")); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 2185a84a04..8e1a9aef82 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -206,7 +206,7 @@ void ControlBar::populatePurchaseScience( Player* player ) commandButton = commandSet1->getCommandButton(i); // if button is not present, just hide the window - if( commandButton == NULL || BitTest( commandButton->getOptions(), SCRIPT_ONLY ) ) + if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface m_sciencePurchaseWindowsRank1[ i ]->winHide( TRUE ); @@ -266,7 +266,7 @@ void ControlBar::populatePurchaseScience( Player* player ) commandButton = commandSet3->getCommandButton(i); // if button is not present, just hide the window - if( commandButton == NULL || BitTest( commandButton->getOptions(), SCRIPT_ONLY ) ) + if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface m_sciencePurchaseWindowsRank3[ i ]->winHide( TRUE ); @@ -329,7 +329,7 @@ void ControlBar::populatePurchaseScience( Player* player ) commandButton = commandSet8->getCommandButton(i); // if button is not present, just hide the window - if( commandButton == NULL || BitTest( commandButton->getOptions(), SCRIPT_ONLY ) ) + if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface m_sciencePurchaseWindowsRank8[ i ]->winHide( TRUE ); @@ -638,7 +638,7 @@ Bool CommandButton::isValidToUseOn(const Object *sourceObj, const Object *target return false; } - if( BitTest( m_options, COMMAND_OPTION_NEED_OBJECT_TARGET ) && !targetObj ) + if( BitIsSet( m_options, COMMAND_OPTION_NEED_OBJECT_TARGET ) && !targetObj ) { return false; } @@ -649,7 +649,7 @@ Bool CommandButton::isValidToUseOn(const Object *sourceObj, const Object *target pos.set( targetLocation ); } - if( BitTest( m_options, NEED_TARGET_POS ) && !targetLocation ) + if( BitIsSet( m_options, NEED_TARGET_POS ) && !targetLocation ) { if( targetObj ) { @@ -661,12 +661,12 @@ Bool CommandButton::isValidToUseOn(const Object *sourceObj, const Object *target } } - if( BitTest( m_options, COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( BitIsSet( m_options, COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { return TheActionManager->canDoSpecialPowerAtObject( sourceObj, targetObj, commandSource, m_specialPower, m_options, false ); } - if( BitTest( m_options, NEED_TARGET_POS ) ) + if( BitIsSet( m_options, NEED_TARGET_POS ) ) { return TheActionManager->canDoSpecialPowerAtLocation( sourceObj, &pos, commandSource, m_specialPower, NULL, m_options, false ); } @@ -729,7 +729,7 @@ const FieldParse CommandSet::m_commandSetFieldParseTable[] = //------------------------------------------------------------------------------------------------- Bool CommandButton::isContextCommand() const { - return BitTest( m_options, CONTEXTMODE_COMMAND ); + return BitIsSet( m_options, CONTEXTMODE_COMMAND ); } //------------------------------------------------------------------------------------------------- @@ -2449,7 +2449,7 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com // set the button gadget control to be a normal button or a check like button if // the command says it needs one // - if( BitTest( commandButton->getOptions(), CHECK_LIKE )) + if( BitIsSet( commandButton->getOptions(), CHECK_LIKE )) GadgetButtonEnableCheckLike( button, TRUE, FALSE ); else GadgetButtonEnableCheckLike( button, FALSE, FALSE ); @@ -3196,7 +3196,7 @@ void ControlBar::triggerRadarAttackGlow( void ) return; m_radarAttackGlowOn = TRUE; m_remainingRadarAttackGlowFrames = RADAR_ATTACK_GLOW_FRAMES; - if(BitTest(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED) == TRUE) + if(BitIsSet(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED) == TRUE) m_radarAttackGlowWindow->winEnable(FALSE); } @@ -3214,15 +3214,15 @@ void ControlBar::updateRadarAttackGlow ( void ) if(m_remainingRadarAttackGlowFrames % RADAR_ATTACK_GLOW_NUM_TIMES == 0) { - m_radarAttackGlowWindow->winEnable(!BitTest(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED)); + m_radarAttackGlowWindow->winEnable(!BitIsSet(m_radarAttackGlowWindow->winGetStatus(),WIN_STATUS_ENABLED)); } } void ControlBar::initSpecialPowershortcutBar( Player *player) { - - for( Int i = 0; i < MAX_SPECIAL_POWER_SHORTCUTS; ++i ) + Int i = 0; + for( ; i < MAX_SPECIAL_POWER_SHORTCUTS; ++i ) { m_specialPowerShortcutButtonParents[i] = NULL; m_specialPowerShortcutButtons[i] = NULL; @@ -3320,7 +3320,7 @@ void ControlBar::populateSpecialPowerShortcut( Player *player) else { - if( BitTest( commandButton->getOptions(), NEED_UPGRADE ) ) + if( BitIsSet( commandButton->getOptions(), NEED_UPGRADE ) ) { const UpgradeTemplate *upgrade = commandButton->getUpgradeTemplate(); if( upgrade && !ThePlayerList->getLocalPlayer()->hasUpgradeComplete( upgrade->getUpgradeMask() ) ) @@ -3335,7 +3335,7 @@ void ControlBar::populateSpecialPowerShortcut( Player *player) // commands that require sciences we don't have are hidden so they never show up // cause we can never pick "another" general technology throughout the game // - if( BitTest( commandButton->getOptions(), NEED_SPECIAL_POWER_SCIENCE ) ) + if( BitIsSet( commandButton->getOptions(), NEED_SPECIAL_POWER_SCIENCE ) ) { const SpecialPowerTemplate *power = commandButton->getSpecialPowerTemplate(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index a5777b858e..aaf3fd215a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -324,7 +324,7 @@ void ControlBar::populateCommand( Object *obj ) { //Script only command -- don't show it in the UI. - if( BitTest( commandButton->getOptions(), SCRIPT_ONLY ) ) + if( BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { m_commandWindows[ i ]->winHide( TRUE ); continue; @@ -350,7 +350,7 @@ void ControlBar::populateCommand( Object *obj ) // commands that require sciences we don't have are hidden so they never show up // cause we can never pick "another" general technology throughout the game // - if( BitTest( commandButton->getOptions(), NEED_SPECIAL_POWER_SCIENCE ) ) + if( BitIsSet( commandButton->getOptions(), NEED_SPECIAL_POWER_SCIENCE ) ) { const SpecialPowerTemplate *power = commandButton->getSpecialPowerTemplate(); @@ -887,11 +887,11 @@ void ControlBar::updateContextCommand( void ) // for check-like commands we will keep the push button "pushed" or "unpushed" depending // on the current running status of the command // - if( BitTest( command->getOptions(), CHECK_LIKE )) + if( BitIsSet( command->getOptions(), CHECK_LIKE )) { // sanity, check like commands should have windows that are check like as well - DEBUG_ASSERTCRASH( BitTest( win->winGetStatus(), WIN_STATUS_CHECK_LIKE ), + DEBUG_ASSERTCRASH( BitIsSet( win->winGetStatus(), WIN_STATUS_CHECK_LIKE ), ("updateContextCommand: Error, gadget window for command '%s' is not check-like!\n", command->getName().str()) ); @@ -1059,7 +1059,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com return COMMAND_RESTRICTED; } - if( BitTest( command->getOptions(), MUST_BE_STOPPED ) ) + if( BitIsSet( command->getOptions(), MUST_BE_STOPPED ) ) { //This button can only be activated when the unit isn't moving! AIUpdateInterface *ai = obj->getAI(); @@ -1074,7 +1074,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com // if we are only disabled by being underpowered, and this button doesn't care, well, fix it if (disabled - && BitTest(command->getOptions(), IGNORES_UNDERPOWERED) + && BitIsSet(command->getOptions(), IGNORES_UNDERPOWERED) && obj->getDisabledFlags().test(DISABLED_UNDERPOWERED) && obj->getDisabledFlags().count() == 1) { @@ -1102,7 +1102,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com } // if the command requires an upgrade and we don't have it we can't do it - if( BitTest( command->getOptions(), NEED_UPGRADE ) ) + if( BitIsSet( command->getOptions(), NEED_UPGRADE ) ) { const UpgradeTemplate *upgradeT = command->getUpgradeTemplate(); if (upgradeT) @@ -1122,7 +1122,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com } ProductionUpdateInterface *pu = obj->getProductionUpdateInterface(); - if( pu && pu->firstProduction() && BitTest( command->getOptions(), NOT_QUEUEABLE ) ) + if( pu && pu->firstProduction() && BitIsSet( command->getOptions(), NOT_QUEUEABLE ) ) { //This button is designated so that it is incapable of building this upgrade/object //when anything is in the production queue. @@ -1511,7 +1511,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com case GUI_COMMAND_STOP: { - if( !BitTest( command->getOptions(), OPTION_ONE ) ) + if( !BitIsSet( command->getOptions(), OPTION_ONE ) ) { return COMMAND_AVAILABLE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp index 8516d13547..d898043ffc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp @@ -188,7 +188,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, //@todo Kris -- Special case code so convoy trucks can detonate nuke trucks -- if other things need this, //rethink it. - if( obj && BitTest( commandButton->getOptions(), SINGLE_USE_COMMAND ) ) + if( obj && BitIsSet( commandButton->getOptions(), SINGLE_USE_COMMAND ) ) { /** @todo Added obj check because Single Use and Multi Select crash when used together, but with this check * they just won't work. When the "rethinking" occurs, this can get fixed. Right now it is unused. @@ -213,7 +213,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, TheAudio->addAudioEvent( &sound ); } - if( BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_TARGET ) ) + if( BitIsSet( commandButton->getOptions(), COMMAND_OPTION_NEED_TARGET ) ) { if (commandButton->getOptions() & USES_MINE_CLEARING_WEAPONSET) { @@ -725,7 +725,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, // Cancel GUI command mode. TheInGameUI->setGUICommand( NULL ); - if (BitTest(commandButton->getOptions(), NEED_TARGET_POS) == FALSE) { + if (BitIsSet(commandButton->getOptions(), NEED_TARGET_POS) == FALSE) { pickAndPlayUnitVoiceResponse( TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_EVACUATE ); TheMessageStream->appendMessage( GameMessage::MSG_EVACUATE ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp index 579ab8ba0c..598ecf0c50 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp @@ -128,7 +128,7 @@ void ControlBar::addCommonCommands( Drawable *draw, Bool firstDrawable ) command = commandSet->getCommandButton(i); // add if present and can be used in a multi select - if( command && BitTest( command->getOptions(), OK_FOR_MULTI_SELECT ) == TRUE ) + if( command && BitIsSet( command->getOptions(), OK_FOR_MULTI_SELECT ) == TRUE ) { // put it in the common command set @@ -387,7 +387,7 @@ void ControlBar::updateContextMultiSelect( void ) } //If button is a CHECK_LIKE, then update it's status now. - if( BitTest( command->getOptions(), CHECK_LIKE ) ) + if( BitIsSet( command->getOptions(), CHECK_LIKE ) ) { GadgetCheckLikeButtonSetVisualCheck( win, availability == COMMAND_ACTIVE ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp index 2cfe26dd28..2b1f9bd70c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp @@ -34,7 +34,7 @@ #include "GameClient/GameText.h" #include "GameNetwork/NetworkInterface.h" -char *DisconnectMenu::m_playerNameTextControlNames[] = { +const char *DisconnectMenu::m_playerNameTextControlNames[] = { "DisconnectScreen.wnd:StaticPlayer1Name", "DisconnectScreen.wnd:StaticPlayer2Name", "DisconnectScreen.wnd:StaticPlayer3Name", @@ -45,7 +45,7 @@ char *DisconnectMenu::m_playerNameTextControlNames[] = { NULL }; -char *DisconnectMenu::m_playerTimeoutTextControlNames[] = { +const char *DisconnectMenu::m_playerTimeoutTextControlNames[] = { "DisconnectScreen.wnd:StaticPlayer1Timeout", "DisconnectScreen.wnd:StaticPlayer2Timeout", "DisconnectScreen.wnd:StaticPlayer3Timeout", @@ -56,7 +56,7 @@ char *DisconnectMenu::m_playerTimeoutTextControlNames[] = { NULL }; -char *DisconnectMenu::m_playerVoteButtonControlNames[] = { +const char *DisconnectMenu::m_playerVoteButtonControlNames[] = { "DisconnectScreen.wnd:ButtonKickPlayer1", "DisconnectScreen.wnd:ButtonKickPlayer2", "DisconnectScreen.wnd:ButtonKickPlayer3", @@ -67,7 +67,7 @@ char *DisconnectMenu::m_playerVoteButtonControlNames[] = { NULL }; -char *DisconnectMenu::m_playerVoteCountControlNames[] = { +const char *DisconnectMenu::m_playerVoteCountControlNames[] = { "DisconnectScreen.wnd:StaticPlayer1Votes", "DisconnectScreen.wnd:StaticPlayer2Votes", "DisconnectScreen.wnd:StaticPlayer3Votes", @@ -78,9 +78,9 @@ char *DisconnectMenu::m_playerVoteCountControlNames[] = { NULL }; -char *DisconnectMenu::m_packetRouterTimeoutControlName = "DisconnectScreen.wnd:StaticPacketRouterTimeout"; -char *DisconnectMenu::m_packetRouterTimeoutLabelControlName = "DisconnectScreen.wnd:StaticPacketRouterTimeoutLabel"; -char *DisconnectMenu::m_textDisplayControlName = "DisconnectScreen.wnd:ListboxTextDisplay"; +const char *DisconnectMenu::m_packetRouterTimeoutControlName = "DisconnectScreen.wnd:StaticPacketRouterTimeout"; +const char *DisconnectMenu::m_packetRouterTimeoutLabelControlName = "DisconnectScreen.wnd:StaticPacketRouterTimeoutLabel"; +const char *DisconnectMenu::m_textDisplayControlName = "DisconnectScreen.wnd:ListboxTextDisplay"; static const Color chatNormalColor = GameMakeColor(255,0,0,255); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp index 9cfb96aa74..cd22e2b556 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp @@ -36,7 +36,7 @@ EstablishConnectionsMenu *TheEstablishConnectionsMenu = NULL; -char *EstablishConnectionsMenu::m_playerReadyControlNames[] = { +const char *EstablishConnectionsMenu::m_playerReadyControlNames[] = { "EstablishConnectionsScreen.wnd:ButtonAccept1", "EstablishConnectionsScreen.wnd:ButtonAccept2", "EstablishConnectionsScreen.wnd:ButtonAccept3", @@ -46,7 +46,7 @@ char *EstablishConnectionsMenu::m_playerReadyControlNames[] = { "EstablishConnectionsScreen.wnd:ButtonAccept7", NULL}; -char *EstablishConnectionsMenu::m_playerNameControlNames[] = { +const char *EstablishConnectionsMenu::m_playerNameControlNames[] = { "EstablishConnectionsScreen.wnd:StaticPlayer1Name", "EstablishConnectionsScreen.wnd:StaticPlayer2Name", "EstablishConnectionsScreen.wnd:StaticPlayer3Name", @@ -57,7 +57,7 @@ char *EstablishConnectionsMenu::m_playerNameControlNames[] = { NULL }; -char *EstablishConnectionsMenu::m_playerStatusControlNames[] = { +const char *EstablishConnectionsMenu::m_playerStatusControlNames[] = { "EstablishConnectionsScreen.wnd:StaticPlayer1Status", "EstablishConnectionsScreen.wnd:StaticPlayer2Status", "EstablishConnectionsScreen.wnd:StaticPlayer3Status", diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp index bbf91e3144..b15e2a1656 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp @@ -105,7 +105,7 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg, const CommandButton *command = TheInGameUI->getGUICommand(); if( command && (command->getCommandType() == GUI_COMMAND_SPECIAL_POWER || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT) - && BitTest( command->getOptions(), NEED_TARGET_POS ) ) + && BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) targeting = TRUE; if( targeting == FALSE ) @@ -178,7 +178,7 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg, const CommandButton *command = TheInGameUI->getGUICommand(); if( command && (command->getCommandType() == GUI_COMMAND_SPECIAL_POWER || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT) - && BitTest( command->getOptions(), NEED_TARGET_POS ) ) + && BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { Int index = TheMouse->getCursorIndex( command->getCursorName() ); @@ -276,7 +276,7 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg, const CommandButton *command = TheInGameUI->getGUICommand(); if( command && (command->getCommandType() == GUI_COMMAND_SPECIAL_POWER || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT) - && BitTest( command->getOptions(), NEED_TARGET_POS ) + && BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp index e9424f809c..fe52711cba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp @@ -184,7 +184,7 @@ void ControlBar::showBuildTooltipLayout( GameWindow *cmdButton ) if(!cmdButton) return; - if(BitTest(cmdButton->winGetStyle(), GWS_PUSH_BUTTON)) + if(BitIsSet(cmdButton->winGetStyle(), GWS_PUSH_BUTTON)) { const CommandButton *commandButton = (const CommandButton *)GadgetButtonGetData(cmdButton); @@ -219,7 +219,7 @@ void ControlBar::showBuildTooltipLayout( GameWindow *cmdButton ) else { // we're a generic window - if(!BitTest(cmdButton->winGetStyle(), GWS_USER_WINDOW) && !BitTest(cmdButton->winGetStyle(), GWS_STATIC_TEXT)) + if(!BitIsSet(cmdButton->winGetStyle(), GWS_USER_WINDOW) && !BitIsSet(cmdButton->winGetStyle(), GWS_STATIC_TEXT)) return; populateBuildTooltipLayout(NULL, cmdButton); } @@ -240,7 +240,7 @@ void ControlBar::repopulateBuildTooltipLayout( void ) { if(!prevWindow || !m_buildToolTipLayout) return; - if(!BitTest(prevWindow->winGetStyle(), GWS_PUSH_BUTTON)) + if(!BitIsSet(prevWindow->winGetStyle(), GWS_PUSH_BUTTON)) return; const CommandButton *commandButton = (const CommandButton *)GadgetButtonGetData(prevWindow); populateBuildTooltipLayout(commandButton); @@ -253,7 +253,7 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton, Player *player = ThePlayerList->getLocalPlayer(); UnicodeString name, cost, descrip; - UnicodeString requires = UnicodeString::TheEmptyString, requiresList; + UnicodeString requiresFormat = UnicodeString::TheEmptyString, requiresList; Bool firstRequirement = true; const ProductionPrerequisite *prereq; Bool fireScienceButton = false; @@ -425,17 +425,17 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton, if (firstRequirement) firstRequirement = false; else - requires.concat(L", "); + requiresFormat.concat(L", "); } - requires.concat(requiresList); + requiresFormat.concat(requiresList); } - if( !requires.isEmpty() ) + if( !requiresFormat.isEmpty() ) { UnicodeString requireFormat = TheGameText->fetch("CONTROLBAR:Requirements"); - requires.format(requireFormat.str(), requires.str()); + requiresFormat.format(requireFormat.str(), requiresFormat.str()); if(!descrip.isEmpty()) descrip.concat(L"\n"); - descrip.concat(requires); + descrip.concat(requiresFormat); } } @@ -514,8 +514,8 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton, { if( !descrip.isEmpty() ) descrip.concat(L"\n"); - requires.format( TheGameText->fetch( "CONTROLBAR:Requirements" ).str(), TheGameText->fetch( "CONTROLBAR:GeneralsPromotion" ).str() ); - descrip.concat( requires ); + requiresFormat.format( TheGameText->fetch( "CONTROLBAR:Requirements" ).str(), TheGameText->fetch( "CONTROLBAR:GeneralsPromotion" ).str() ); + descrip.concat( requiresFormat ); } } } @@ -543,17 +543,17 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton, if (firstRequirement) firstRequirement = false; else - requires.concat(L", "); + requiresFormat.concat(L", "); } - requires.concat(requiresList); + requiresFormat.concat(requiresList); } - if( !requires.isEmpty() ) + if( !requiresFormat.isEmpty() ) { UnicodeString requireFormat = TheGameText->fetch("CONTROLBAR:Requirements"); - requires.format(requireFormat.str(), requires.str()); + requiresFormat.format(requireFormat.str(), requiresFormat.str()); if(!descrip.isEmpty()) descrip.concat(L"\n"); - descrip.concat(requires); + descrip.concat(requiresFormat); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp index 2e947f721f..2d7f099f0a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp @@ -112,7 +112,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData ) textRegion.hi.y = origin.y + size.y; // get the right colors for drawing - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textSelectColor = window->winGetDisabledTextColor(); @@ -121,7 +121,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData ) textBorder = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetEnabledTextColor(); @@ -244,14 +244,14 @@ void IMECandidateMainDraw( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the right colors for drawing - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backColor = window->winGetDisabledColor( 0 ); backBorder = window->winGetDisabledBorderColor( 0 ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { backColor = window->winGetHiliteColor( 0 ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp index 7e4af6d426..8ecae7e714 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp @@ -163,7 +163,7 @@ WindowMsgHandledType InGamePopupMessageInput( GameWindow *window, UnsignedInt ms // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonOk, buttonOkID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp index 3b895017ca..7f928e2832 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp @@ -515,7 +515,7 @@ WindowMsgHandledType ChallengeMenuInput( GameWindow *window, UnsignedInt msg, Wi // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp index b46f74ced9..b1bc00c8c6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp @@ -176,7 +176,7 @@ WindowMsgHandledType CreditsMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheShell->pop(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp index 4909c1b6da..5e1189c58b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp @@ -182,7 +182,7 @@ WindowMsgHandledType DifficultySelectInput( GameWindow *window, UnsignedInt msg, // // send a simulated selected event to the parent window of the // // back/exit button // // -// if( BitTest( state, KEY_STATE_UP ) ) +// if( BitIsSet( state, KEY_STATE_UP ) ) // { // AsciiString buttonName( "SkirmishMapSelectMenu.wnd:ButtonBack" ); // NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp index 701030bc06..eb9b2c00ab 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp @@ -348,7 +348,7 @@ WindowMsgHandledType DownloadMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "DownloadMenu.wnd:ButtonCancel" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp index 3fcf009748..9923c809b4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp @@ -235,8 +235,8 @@ void GameInfoWindowInit( WindowLayout *layout, void *userData ) winSuperWeapons = TheWindowManager->winGetWindowFromId( parent, winSuperWeaponsID ); winFreeForAll = TheWindowManager->winGetWindowFromId( parent, winFreeForAllID ); - GadgetStaticTextSetText(staticTextGameName,UnicodeString.TheEmptyString); - GadgetStaticTextSetText(staticTextMapName,UnicodeString.TheEmptyString); + GadgetStaticTextSetText(staticTextGameName,UnicodeString::TheEmptyString); + GadgetStaticTextSetText(staticTextMapName,UnicodeString::TheEmptyString); GadgetListBoxReset(listBoxPlayers); } // end MapSelectMenuInit diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp index bbd4b8fe21..c4ba02ca9c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp @@ -497,7 +497,7 @@ WindowMsgHandledType KeyboardOptionsMenuInput( GameWindow *window, UnsignedInt m // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "KeyboardOptionsMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); @@ -826,7 +826,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_KPENTER: case KEY_ENTER: // Done with this edit - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( e->receivedUnichar == FALSE ) { @@ -845,7 +845,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_LCTRL: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { UnicodeString mod = ctrl; doKeyDown( e, mod ); @@ -856,7 +856,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg return MSG_HANDLED; } - if( BitTest(mData2, KEY_STATE_UP ) ) + if( BitIsSet(mData2, KEY_STATE_UP ) ) { UnicodeString mod = ctrl; doKeyUp( e, mod ); @@ -873,7 +873,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_RSHIFT: case KEY_LSHIFT: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { UnicodeString mod = shift; doKeyDown( e, mod ); @@ -885,7 +885,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg return MSG_HANDLED; } - if( BitTest( mData2, KEY_STATE_UP ) ) + if( BitIsSet( mData2, KEY_STATE_UP ) ) { UnicodeString mod = shift; doKeyUp(e, mod ); @@ -903,7 +903,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_LALT: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { UnicodeString mod = alt; doKeyDown( e, mod ); @@ -916,7 +916,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg return MSG_HANDLED; } - if( BitTest(mData2, KEY_STATE_UP ) ) + if( BitIsSet(mData2, KEY_STATE_UP ) ) { UnicodeString mod = alt; doKeyUp( e, mod ); @@ -960,7 +960,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_RIGHT: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; @@ -968,7 +968,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_UP: case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winPrevTab(); break; @@ -991,7 +991,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg case KEY_DEL: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { // if conCharPos != 0 this will fall through to next case. // it should be noted that conCharPos can only != 0 in Jap & Kor @@ -1018,7 +1018,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg /*default: { char ch = mData1; - if( ch && ( BitTest( mData2, KEY_STATE_DOWN ) ) ) + if( ch && ( BitIsSet( mData2, KEY_STATE_DOWN ) ) ) { // Constrain keys based on rules for entry box. if( e->numericalOnly ) @@ -1115,7 +1115,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg // ------------------------------------------------------------------------ case GWM_MOUSE_ENTERING: - if (BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -1130,7 +1130,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg // ------------------------------------------------------------------------ case GWM_MOUSE_LEAVING: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -1143,7 +1143,7 @@ WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, 0 ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index 92d48f5249..eec6089968 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -203,7 +203,8 @@ static void playerTooltip(GameWindow *window, UnsignedInt mouse) { Int idx = -1; - for (Int i=0; igetSuperweaponRestriction() != 0 ); Int itemCount = GadgetComboBoxGetLength(comboBoxStartingCash); - for ( Int index = 0; index < itemCount; index++ ) + Int index = 0; + for ( ; index < itemCount; index++ ) { Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == theGame->getStartingCash().countMoney() ) @@ -1090,7 +1092,7 @@ WindowMsgHandledType LanGameOptionsMenuInput( GameWindow *window, UnsignedInt ms // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp index a0dd09c189..d7aabafc7b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -642,7 +642,7 @@ WindowMsgHandledType LanLobbyMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp index 0db714949b..1e60028998 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp @@ -227,7 +227,7 @@ WindowMsgHandledType LanMapSelectMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "LanMapSelectMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp index e838ac6506..272ba1b806 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp @@ -197,7 +197,7 @@ enum SHOW_FRAMES_LIMIT = 20 }; -static showFade = FALSE; +static Int showFade = FALSE; static Int dropDown = DROPDOWN_NONE; static Int pendingDropDown = DROPDOWN_NONE; static AnimateWindowManager *localAnimateWindowManager = NULL; @@ -214,7 +214,7 @@ static Bool launchChallengeMenu = FALSE; static Bool dontAllowTransitions = FALSE; //Added by Saad -const /*Int TIME_OUT = 15,*/ CORNER = 10; +const Int /*TIME_OUT = 15,*/ CORNER = 10; void AcceptResolution(); void DeclineResolution(); GameWindow *resAcceptMenu = NULL; @@ -462,7 +462,8 @@ void MainMenuInit( WindowLayout *layout, void *userData ) startGame = FALSE; dropDown = DROPDOWN_NONE; pendingDropDown = DROPDOWN_NONE; - for(Int i = 0; i < DROPDOWN_COUNT; ++i) + Int i = 0; + for(; i < DROPDOWN_COUNT; ++i) dropDownWindows[i] = NULL; // get ids for our windows diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp index bb068a7ec5..91caaecfde 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp @@ -278,7 +278,7 @@ WindowMsgHandledType MapSelectMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "MapSelectMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp index 48492f0740..5459b3e1ee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp @@ -435,7 +435,7 @@ WindowMsgHandledType NetworkDirectConnectInput( GameWindow *window, UnsignedInt // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index a5bfec7e6a..a4c9c873f0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1585,7 +1585,8 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) AsciiString selectedAliasingMode = (*pref)["AntiAliasing"]; GadgetComboBoxReset(comboBoxAntiAliasing); AsciiString temp; - for (Int i=0; i < NUM_ALIASING_MODES; ++i) + Int i=0; + for (; i < NUM_ALIASING_MODES; ++i) { temp.format("GUI:AntiAliasing%d", i); str = TheGameText->fetch( temp ); @@ -1883,7 +1884,7 @@ WindowMsgHandledType OptionsMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "OptionsMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp index 8ef879ceb1..8ccc508cae 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp @@ -117,7 +117,7 @@ WindowMsgHandledType PopupCommunicatorInput( GameWindow *window, UnsignedInt msg // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp index 14307291a0..bdd7d13798 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp @@ -414,7 +414,7 @@ WindowMsgHandledType PopupHostGameInput( GameWindow *window, UnsignedInt msg, Wi // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonCancel, buttonCancelID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp index ff0bbb30e0..9d126da106 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp @@ -135,7 +135,7 @@ WindowMsgHandledType PopupJoinGameInput( GameWindow *window, UnsignedInt msg, Wi // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD); SetLobbyAttemptHostJoin( FALSE ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp index 1c57a852b3..f82164be3b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp @@ -291,7 +291,7 @@ WindowMsgHandledType PopupLadderSelectInput( GameWindow *window, UnsignedInt msg // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { switch (s_currentMode) { @@ -557,7 +557,8 @@ static void updateLadderDetails( Int selID, GameWindow *staticTextLadderName, Ga // factions AsciiStringList validFactions = info->validFactions; - for (AsciiStringListIterator it = validFactions.begin(); it != validFactions.end(); ++it) + AsciiStringListIterator it = validFactions.begin(); + for (; it != validFactions.end(); ++it) { AsciiString marker; marker.format("INI:Faction%s", it->str()); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 0fc76c0c30..dbf10ee773 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -321,88 +321,88 @@ void BattleHonorTooltip(GameWindow *window, return; } Real tooltipWidth = 1.5f; - if (BitTest(battleHonor, BATTLE_HONOR_NOT_GAINED)) + if (BitIsSet(battleHonor, BATTLE_HONOR_NOT_GAINED)) { - if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_USA)) + if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_USA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyUSADisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_CHINA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_CHINA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyChinaDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_GLA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_GLA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyGLADisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_BATTLE_TANK)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_BATTLE_TANK)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorBattleTankDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_AIR_WING)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_AIR_WING)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorAirWingDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_ENDURANCE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_ENDURANCE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorEnduranceDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_USA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_USA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignUSADisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_CHINA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_CHINA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignChinaDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_GLA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_GLA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignGLADisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_BLITZ10)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_BLITZ10)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorBlitzDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_FAIR_PLAY)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_FAIR_PLAY)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorFairPlayDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_APOCALYPSE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_APOCALYPSE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorApocalypseDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CHALLENGE_MODE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CHALLENGE_MODE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignChallengeDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_ULTIMATE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_ULTIMATE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorUltimateDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_GLOBAL_GENERAL)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_GLOBAL_GENERAL)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorGlobalGeneralDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CHALLENGE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CHALLENGE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorChallengeDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_STREAK)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_STREAK)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreakDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_STREAK_ONLINE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_STREAK_ONLINE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreakOnlineDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_DOMINATION)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_DOMINATION)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorDominationDisabled"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_DOMINATION_ONLINE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_DOMINATION_ONLINE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorDominationOnlineDisabled"), -1, NULL, tooltipWidth ); } else { - if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_USA)) + if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_USA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyUSA"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_CHINA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_CHINA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyChina"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_LOYALTY_GLA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_LOYALTY_GLA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorLoyaltyGLA"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_BATTLE_TANK)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_BATTLE_TANK)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorBattleTank"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_AIR_WING)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_AIR_WING)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorAirWing"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_ENDURANCE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_ENDURANCE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorEndurance"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_USA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_USA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignUSA"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_CHINA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_CHINA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignChina"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CAMPAIGN_GLA)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CAMPAIGN_GLA)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignGLA"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_BLITZ5)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_BLITZ5)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorBlitz5"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_BLITZ10)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_BLITZ10)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorBlitz10"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_FAIR_PLAY)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_FAIR_PLAY)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorFairPlay"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_APOCALYPSE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_APOCALYPSE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorApocalypse"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_OFFICERSCLUB)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_OFFICERSCLUB)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorOfficersClub"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CHALLENGE_MODE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CHALLENGE_MODE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorCampaignChallenge"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_ULTIMATE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_ULTIMATE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorUltimate"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_GLOBAL_GENERAL)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_GLOBAL_GENERAL)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorGlobalGeneral"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_CHALLENGE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_CHALLENGE)) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorChallenge"), -1, NULL, tooltipWidth ); - else if(BitTest(battleHonor, BATTLE_HONOR_STREAK)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_STREAK)) { if (extraValue >= 1000) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreak1000"), -1, NULL, tooltipWidth ); @@ -419,7 +419,7 @@ void BattleHonorTooltip(GameWindow *window, else TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreakDisabled"), -1, NULL, tooltipWidth ); } - else if(BitTest(battleHonor, BATTLE_HONOR_STREAK_ONLINE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_STREAK_ONLINE)) { if (extraValue >= 1000) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreak1000Online"), -1, NULL, tooltipWidth ); @@ -436,7 +436,7 @@ void BattleHonorTooltip(GameWindow *window, else TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorStreakOnlineDisabled"), -1, NULL, tooltipWidth ); } - else if(BitTest(battleHonor, BATTLE_HONOR_DOMINATION)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_DOMINATION)) { if (extraValue >= 10000) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorDomination10000"), -1, NULL, tooltipWidth ); @@ -449,7 +449,7 @@ void BattleHonorTooltip(GameWindow *window, else TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorDominationDisabled"), -1, NULL, tooltipWidth ); } - else if(BitTest(battleHonor, BATTLE_HONOR_DOMINATION_ONLINE)) + else if(BitIsSet(battleHonor, BATTLE_HONOR_DOMINATION_ONLINE)) { if (extraValue >= 10000) TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:BattleHonorDomination10000Online"), -1, NULL, tooltipWidth ); @@ -547,23 +547,23 @@ static void populateBattleHonors(const PSPlayerStats& stats, Int battleHonors, I InsertBattleHonor(list, TheMappedImageCollection->findImageByName("FairPlay"), isFairPlayer, BATTLE_HONOR_FAIR_PLAY, row, column); - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorAirWing"), BitTest(battleHonors, BATTLE_HONOR_AIR_WING), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorAirWing"), BitIsSet(battleHonors, BATTLE_HONOR_AIR_WING), BATTLE_HONOR_AIR_WING, row, column); - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorBattleTank"), BitTest(battleHonors, BATTLE_HONOR_BATTLE_TANK), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorBattleTank"), BitIsSet(battleHonors, BATTLE_HONOR_BATTLE_TANK), BATTLE_HONOR_BATTLE_TANK, row, column); - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Apocalypse"), BitTest(battleHonors, BATTLE_HONOR_APOCALYPSE), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Apocalypse"), BitIsSet(battleHonors, BATTLE_HONOR_APOCALYPSE), BATTLE_HONOR_APOCALYPSE, row, column); // create a spacer for row 2 and start the images on row 3 GadgetListBoxAddEntryImage(list, NULL, 2, 0, 10, 10, TRUE, GameMakeColor(255,255,255,255)); row = 3; - if (BitTest(battleHonors, BATTLE_HONOR_BLITZ5)) + if (BitIsSet(battleHonors, BATTLE_HONOR_BLITZ5)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorBlitz5"), TRUE, BATTLE_HONOR_BLITZ5, row, column); } - else if (BitTest(battleHonors, BATTLE_HONOR_BLITZ10)) + else if (BitIsSet(battleHonors, BATTLE_HONOR_BLITZ10)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorBlitz10"), TRUE, BATTLE_HONOR_BLITZ10, row, column); @@ -649,7 +649,7 @@ static void populateBattleHonors(const PSPlayerStats& stats, Int battleHonors, I } // TEST FOR GLOBAL GENERAL HONOR - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("GlobalGen"), BitTest(battleHonors, BATTLE_HONOR_GLOBAL_GENERAL), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("GlobalGen"), BitIsSet(battleHonors, BATTLE_HONOR_GLOBAL_GENERAL), BATTLE_HONOR_GLOBAL_GENERAL, row, column); /* @@ -666,50 +666,50 @@ static void populateBattleHonors(const PSPlayerStats& stats, Int battleHonors, I */ - //insertBattleHonor(list, TheMappedImageCollection->findImageByName("Endurance"), BitTest(battleHonors, BATTLE_HONOR_ENDURANCE), + //insertBattleHonor(list, TheMappedImageCollection->findImageByName("Endurance"), BitIsSet(battleHonors, BATTLE_HONOR_ENDURANCE), //BATTLE_HONOR_ENDURANCE, row, column); /* - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_USA"), BitTest(battleHonors, BATTLE_HONOR_CAMPAIGN_USA), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_USA"), BitIsSet(battleHonors, BATTLE_HONOR_CAMPAIGN_USA), BATTLE_HONOR_CAMPAIGN_USA, row, column); - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_China"), BitTest(battleHonors, BATTLE_HONOR_CAMPAIGN_CHINA), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_China"), BitIsSet(battleHonors, BATTLE_HONOR_CAMPAIGN_CHINA), BATTLE_HONOR_CAMPAIGN_CHINA, row, column); - InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_GLA"), BitTest(battleHonors, BATTLE_HONOR_CAMPAIGN_GLA), + InsertBattleHonor(list, TheMappedImageCollection->findImageByName("Campaign_GLA"), BitIsSet(battleHonors, BATTLE_HONOR_CAMPAIGN_GLA), BATTLE_HONOR_CAMPAIGN_GLA, row, column); */ /* - if(BitTest(challenge, BH_CHALLENGE_MASK_7)) + if(BitIsSet(challenge, BH_CHALLENGE_MASK_7)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge7"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_6)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_6)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge6"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_5)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_5)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge5"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_4)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_4)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge4"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_3)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_3)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge3"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_2)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_2)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge2"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_1)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_1)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge1"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); @@ -788,7 +788,7 @@ Int CalculateRank( const PSPlayerStats& stats ) } rankPoints += numGames * TheRankPointValues->m_disconnectMultiplier; - if(BitTest(stats.battleHonors, BATTLE_HONOR_CAMPAIGN_USA | BATTLE_HONOR_CAMPAIGN_CHINA |BATTLE_HONOR_CAMPAIGN_GLA)) + if(BitIsSet(stats.battleHonors, BATTLE_HONOR_CAMPAIGN_USA | BATTLE_HONOR_CAMPAIGN_CHINA |BATTLE_HONOR_CAMPAIGN_GLA)) { rankPoints += 1 * TheRankPointValues->m_completedSoloCampaigns; } @@ -1392,7 +1392,7 @@ WindowMsgHandledType GameSpyPlayerInfoOverlayInput( GameWindow *window, Unsigned // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonClose, buttonCloseID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp index c4588b0138..30e8c58580 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp @@ -215,7 +215,7 @@ WindowMsgHandledType PopupReplayInput( GameWindow *window, UnsignedInt msg, Wind // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { GameWindow *button = TheWindowManager->winGetWindowFromId( parent, buttonBackKey ); TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp index 20ecc4eb6b..437bc9cdcb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp @@ -327,7 +327,7 @@ WindowMsgHandledType SaveLoadMenuInput( GameWindow *window, UnsignedInt msg, Win // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { GameWindow *button = TheWindowManager->winGetWindowFromId( parent, buttonBackKey ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp index f58b17d570..f2cdd186e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp @@ -394,7 +394,7 @@ WindowMsgHandledType ReplayMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index e4600d2dc3..0fa6d09f85 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -481,7 +481,7 @@ WindowMsgHandledType ScoreScreenInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, @@ -1663,7 +1663,8 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); Bool sawAnyDisconnects = FALSE; Bool anyNonAI = FALSE; Bool anyAI = FALSE; - for (Int i=0; igetConstSlot(i); if (slot->isOccupied() && i != localSlotNum ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp index b762a6a8fe..d8a6e2aaf0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp @@ -153,7 +153,7 @@ WindowMsgHandledType SinglePlayerMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "SinglePlayerMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index b4fd6598e3..b9aac9e512 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -777,7 +777,8 @@ void positionStartSpots( AsciiString mapName, GameWindow *buttonMapStartPosition positionAdditionalImages(&mmd, mapWindow, TRUE); AsciiString waypointName; - for(Int i = 0; i < mmd.m_numPlayers && mmd.m_isMultiplayer; ++i ) + Int i = 0; + for(; i < mmd.m_numPlayers && mmd.m_isMultiplayer; ++i ) { waypointName.format("Player_%d_Start", i+1); // start pos waypoints are 1-based WaypointMap::iterator wmIt = mmd.m_waypoints.find(waypointName); @@ -843,7 +844,8 @@ void updateMapStartSpots( GameInfo *myGame, GameWindow *buttonMapStartPositions[ } MapMetaData mmd = it->second; - for(Int i = 0; i < MAX_SLOTS; ++i) + Int i = 0; + for(; i < MAX_SLOTS; ++i) { if ( buttonMapStartPositions[i] != NULL ) { @@ -1107,7 +1109,8 @@ void InitSkirmishGameGadgets( void ) windowMap->winSetTooltipFunc(MapSelectorTooltip); - for (Int i = 0; i < MAX_SLOTS; i++) + Int i = 0; + for (; i < MAX_SLOTS; i++) { AsciiString tmpString; tmpString.format("SkirmishGameOptionsMenu.wnd:ComboBoxPlayer%d", i); @@ -1277,7 +1280,8 @@ void updateSkirmishGameOptions( void ) GadgetCheckBoxSetChecked( checkBoxLimitSuperweapons, TheSkirmishGameInfo->getSuperweaponRestriction() != 0 ); Int itemCount = GadgetComboBoxGetLength(comboBoxStartingCash); - for ( Int index = 0; index < itemCount; index++ ) + Int index = 0; + for ( ; index < itemCount; index++ ) { Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == TheSkirmishGameInfo->getStartingCash().countMoney() ) @@ -1536,7 +1540,7 @@ WindowMsgHandledType SkirmishGameOptionsMenuInput( GameWindow *window, UnsignedI // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonExit, buttonExitID ); @@ -2115,37 +2119,37 @@ void populateSkirmishBattleHonors(void) */ /* - if(BitTest(challenge, BH_CHALLENGE_MASK_7)) + if(BitIsSet(challenge, BH_CHALLENGE_MASK_7)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge7"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_6)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_6)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge6"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_5)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_5)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge5"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_4)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_4)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge4"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_3)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_3)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge3"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_2)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_2)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge2"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); } - else if (BitTest(challenge, BH_CHALLENGE_MASK_1)) + else if (BitIsSet(challenge, BH_CHALLENGE_MASK_1)) { InsertBattleHonor(list, TheMappedImageCollection->findImageByName("HonorChallenge1"), TRUE, BATTLE_HONOR_CHALLENGE, row, column); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp index ece2158587..155fff0b76 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp @@ -366,7 +366,7 @@ WindowMsgHandledType SkirmishMapSelectMenuInput( GameWindow *window, UnsignedInt // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "SkirmishMapSelectMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index be7280dec1..ff9afd41fd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -177,7 +177,7 @@ void InitBuddyControls(Int type) buddyControls.listboxChatID = TheNameKeyGenerator->nameToKey( AsciiString( "WOLBuddyOverlay.wnd:ListboxBuddyChat" ) ); buddyControls.listboxBuddies = TheWindowManager->winGetWindowFromId( NULL, buddyControls.listboxBuddiesID ); buddyControls.listboxChat = TheWindowManager->winGetWindowFromId( NULL, buddyControls.listboxChatID); - GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString.TheEmptyString); + GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString::TheEmptyString); buddyControls.isInit = TRUE; break; case BUDDY_WINDOW_DIPLOMACY: @@ -187,7 +187,7 @@ void InitBuddyControls(Int type) buddyControls.listboxChatID = TheNameKeyGenerator->nameToKey( AsciiString( "Diplomacy.wnd:ListboxBuddyChat" ) ); buddyControls.listboxBuddies = TheWindowManager->winGetWindowFromId( NULL, buddyControls.listboxBuddiesID ); buddyControls.listboxChat = TheWindowManager->winGetWindowFromId( NULL, buddyControls.listboxChatID); - GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString.TheEmptyString); + GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString::TheEmptyString); buddyControls.isInit = TRUE; break; case BUDDY_WINDOW_WELCOME_SCREEN: @@ -754,7 +754,7 @@ void WOLBuddyOverlayInit( WindowLayout *layout, void *userData ) parentBuddies->winHide(FALSE); parentIgnore->winHide(TRUE); - //GadgetTextEntrySetText(textEntry, UnicodeString.TheEmptyString); + //GadgetTextEntrySetText(textEntry, UnicodeString::TheEmptyString); PopulateOldBuddyMessages(); @@ -824,7 +824,7 @@ WindowMsgHandledType WOLBuddyOverlayInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonHide, buttonHideID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp index a045c27f25..c4fe4c54e3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp @@ -136,7 +136,7 @@ WindowMsgHandledType WOLCustomScoreScreenInput( GameWindow *window, UnsignedInt // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonDisconnect, buttonDisconnectID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index 28bb0e1eac..0da8930603 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -140,7 +140,7 @@ void SendStatsToOtherPlayers(const GameInfo *game) // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// static Bool isShuttingDown = false; static Bool buttonPushed = false; -static char *nextScreen = NULL; +static const char *nextScreen = NULL; static Bool raiseMessageBoxes = false; static Bool launchGameNext = FALSE; @@ -838,7 +838,8 @@ static void StartPressed(void) mapDisplayName.format(L"%hs", myGame->getMap().str()); willTransfer = WouldMapTransfer(myGame->getMap()); } - for( int i = 0; i < MAX_SLOTS; i++ ) + int i = 0; + for( ; i < MAX_SLOTS; i++ ) { if ((myGame->getSlot(i)->isAccepted() == FALSE) && (myGame->getSlot(i)->isHuman() == TRUE)) { @@ -1023,7 +1024,8 @@ void WOLDisplayGameOptions( void ) GadgetCheckBoxSetChecked( checkBoxLimitSuperweapons, limitSuperweapons ); Int itemCount = GadgetComboBoxGetLength(comboBoxStartingCash); - for ( Int index = 0; index < itemCount; index++ ) + Int index = 0; + for ( ; index < itemCount; index++ ) { Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == theGame->getStartingCash().countMoney() ) @@ -2473,7 +2475,7 @@ WindowMsgHandledType WOLGameSetupMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); @@ -2582,7 +2584,7 @@ WindowMsgHandledType WOLGameSetupMenuSystem( GameWindow *window, UnsignedInt msg WindowMsgData mData1, WindowMsgData mData2 ) { UnicodeString txtInput; - static buttonCommunicatorID = NAMEKEY_INVALID; + static Int buttonCommunicatorID = NAMEKEY_INVALID; switch( msg ) { //------------------------------------------------------------------------------------------------- @@ -2690,7 +2692,7 @@ WindowMsgHandledType WOLGameSetupMenuSystem( GameWindow *window, UnsignedInt msg GameWindow *control = (GameWindow *)mData1; Int controlID = control->winGetWindowId(); - static buttonCommunicatorID = NAMEKEY("GameSpyGameOptionsMenu.wnd:ButtonCommunicator"); + static Int buttonCommunicatorID = NAMEKEY("GameSpyGameOptionsMenu.wnd:ButtonCommunicator"); if ( controlID == buttonBackID ) { savePlayerInfo(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp index 76e671af29..7ac57179ed 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp @@ -137,7 +137,7 @@ WindowMsgHandledType WOLLadderScreenInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index e342b60642..38d8555f0c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -89,7 +89,7 @@ static LogClass s_perfLog("Perf.txt"); // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// static Bool isShuttingDown = false; static Bool buttonPushed = false; -static char *nextScreen = NULL; +static const char *nextScreen = NULL; static Bool raiseMessageBoxes = false; static time_t gameListRefreshTime = 0; static const time_t gameListRefreshInterval = 10000; @@ -509,7 +509,8 @@ void PopulateLobbyPlayerListbox(void) std::set indicesToSelect; UnicodeString uStr; Int numSelected = 0; - for (Int i=0; inameToKey(AsciiString("WOLCustomLobby.wnd:ComboBoxGroupRooms")); comboLobbyGroupRooms = TheWindowManager->winGetWindowFromId(parent, comboLobbyGroupRoomsID); - GadgetTextEntrySetText(textEntryChat, UnicodeString.TheEmptyString); + GadgetTextEntrySetText(textEntryChat, UnicodeString::TheEmptyString); populateGroupRoomListbox(comboLobbyGroupRooms); @@ -1355,7 +1356,7 @@ WindowMsgHandledType WOLLobbyMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp index 42c14f6ac7..c3d35bd3e9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp @@ -83,7 +83,7 @@ static Bool useWebBrowserForTOS = FALSE; static Bool isShuttingDown = false; static Bool buttonPushed = false; -static char *nextScreen = NULL; +static const char *nextScreen = NULL; static const UnsignedInt loginTimeoutInMS = 10000; static UnsignedInt loginAttemptTime = 0; @@ -117,13 +117,13 @@ static AsciiString obfuscate( AsciiString in ) { char *buf = NEW char[in.getLength() + 1]; strcpy(buf, in.str()); - static const char *xor = "1337Munkee"; + static const char *xorWord = "1337Munkee"; char *c = buf; - const char *c2 = xor; + const char *c2 = xorWord; while (*c) { if (!*c2) - c2 = xor; + c2 = xorWord; if (*c != *c2) *c = *c++ ^ *c2++; else @@ -589,7 +589,7 @@ void WOLLoginMenuInit( WindowLayout *layout, void *userData ) #endif // ALLOW_NON_PROFILED_LOGIN // Read login names from registry... GadgetComboBoxReset(comboBoxEmail); - GadgetTextEntrySetText(textEntryPassword, UnicodeString.TheEmptyString); + GadgetTextEntrySetText(textEntryPassword, UnicodeString::TheEmptyString); // look for cached nicks to add AsciiString lastName; @@ -911,7 +911,7 @@ WindowMsgHandledType WOLLoginMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp index 7e140bbace..8d3dca851e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp @@ -253,7 +253,7 @@ WindowMsgHandledType WOLMapSelectMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { AsciiString buttonName( "WOLMapSelectMenu.wnd:ButtonBack" ); NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp index 5f93a32d7c..d2a4def76a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp @@ -125,7 +125,7 @@ WindowMsgHandledType WOLMessageWindowInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonCancel, buttonCancelID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp index 80ecc29554..574785c2ba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp @@ -141,7 +141,7 @@ WindowMsgHandledType WOLQMScoreScreenInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonDisconnect, buttonDisconnectID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index d119217f1f..51a149941f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -130,7 +130,7 @@ static GameWindow *comboBoxColor = NULL; static Bool isShuttingDown = false; static Bool buttonPushed = false; -static char *nextScreen = NULL; +static const char *nextScreen = NULL; static Bool raiseMessageBoxes = false; static Bool isInInit = FALSE; static const Image *selectedImage = NULL; @@ -1494,7 +1494,7 @@ WindowMsgHandledType WOLQuickMatchMenuInput( GameWindow *window, UnsignedInt msg // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { if(!buttonBack->winIsHidden()) TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp index e951b7ed93..693a8905de 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp @@ -131,7 +131,7 @@ WindowMsgHandledType WOLStatusMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonDisconnect, buttonDisconnectID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp index cdd0981ec7..c6f89e958b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp @@ -77,7 +77,7 @@ // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// static Bool isShuttingDown = FALSE; static Bool buttonPushed = FALSE; -static char *nextScreen = NULL; +static const char *nextScreen = NULL; // window ids ------------------------------------------------------------------------------ static NameKeyType parentWOLWelcomeID = NAMEKEY_INVALID; @@ -317,7 +317,7 @@ static float s_totalWinPercent = 0; static const char* FindNextNumber( const char* pStart ) { - char* pNum = strchr( pStart, '\n' ); //go to next line + const char* pNum = strchr( pStart, '\n' ); //go to next line if( !pNum ) return pStart; //error @@ -728,7 +728,7 @@ WindowMsgHandledType WOLWelcomeMenuInput( GameWindow *window, UnsignedInt msg, // send a simulated selected event to the parent window of the // back/exit button // - if( BitTest( state, KEY_STATE_UP ) ) + if( BitIsSet( state, KEY_STATE_UP ) ) { TheWindowManager->winSendSystemMsg( window, GBM_SELECTED, (WindowMsgData)buttonBack, buttonBackID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp index 3315e83e73..207f7f7533 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp @@ -83,7 +83,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -102,7 +102,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -137,7 +137,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case GWM_LEFT_UP: { - if( BitTest( instData->getState(), WIN_STATE_HILITED ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) == FALSE ) { // this up click was not meant for this button return MSG_IGNORED; @@ -165,7 +165,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case GWM_RIGHT_UP: { // Need to be specially marked to care about right mouse events - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { TheWindowManager->winSendSystemMsg( instData->getOwner(), GBM_SELECTED_RIGHT, (WindowMsgData)window, mData1 ); @@ -192,7 +192,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case KEY_SPACE: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { // Toggle the check state instData->m_state ^= WIN_STATE_SELECTED; @@ -212,7 +212,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case KEY_TAB: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winNextTab(window); break; @@ -223,7 +223,7 @@ WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg, case KEY_LEFT: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winPrevTab(window); break; @@ -351,7 +351,7 @@ void GadgetCheckBoxSetChecked( GameWindow *g, Bool isChecked) void GadgetCheckBoxToggle( GameWindow *g) { WinInstanceData *instData = g->winGetInstanceData(); - Bool isChecked = BitTest(instData->m_state, WIN_STATE_SELECTED); + Bool isChecked = BitIsSet(instData->m_state, WIN_STATE_SELECTED); if (isChecked) { BitClear(instData->m_state, WIN_STATE_SELECTED); @@ -372,5 +372,5 @@ void GadgetCheckBoxToggle( GameWindow *g) Bool GadgetCheckBoxIsChecked( GameWindow *g ) { WinInstanceData *instData = g->winGetInstanceData(); - return (BitTest(instData->m_state, WIN_STATE_SELECTED)); + return (BitIsSet(instData->m_state, WIN_STATE_SELECTED)); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp index c5cba897c0..1926b73633 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp @@ -106,7 +106,7 @@ WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg, case KEY_RIGHT: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winNextTab(window); break; @@ -114,7 +114,7 @@ WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg, case KEY_UP: case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winPrevTab(window); break; @@ -226,7 +226,7 @@ WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -246,7 +246,7 @@ WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK )) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK )) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -264,7 +264,7 @@ WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg, // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if (BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, @@ -471,7 +471,7 @@ WindowMsgHandledType GadgetComboBoxSystem( GameWindow *window, UnsignedInt msg, if ( comboData->listBox ) GadgetListBoxReset(comboData->listBox); if ( comboData->editBox ) - GadgetTextEntrySetText(comboData->editBox, UnicodeString.TheEmptyString ); + GadgetTextEntrySetText(comboData->editBox, UnicodeString::TheEmptyString ); comboData->entryCount = 0; //HideListBox(window); break; @@ -902,7 +902,7 @@ UnicodeString GadgetComboBoxGetText( GameWindow *comboBox ) return UnicodeString::TheEmptyString; // verify that this is a combo box - if( BitTest( comboBox->winGetStyle(), GWS_COMBO_BOX ) == FALSE ) + if( BitIsSet( comboBox->winGetStyle(), GWS_COMBO_BOX ) == FALSE ) return UnicodeString::TheEmptyString; return GadgetTextEntryGetText( GadgetComboBoxGetEditBox(comboBox) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp index c676ea0abd..7fe2a39554 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp @@ -89,7 +89,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -101,7 +101,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn } // end if - if(window->winGetChild() && BitTest(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) ) + if(window->winGetChild() && BitIsSet(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) ) { WinInstanceData *instDataChild = window->winGetChild()->winGetInstanceData(); BitSet(instDataChild->m_state, WIN_STATE_HILITED); @@ -115,7 +115,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK )) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK )) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -124,7 +124,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn (WindowMsgData)window, 0 ); } // end if - if(window->winGetChild() && BitTest(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) ) + if(window->winGetChild() && BitIsSet(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) ) { WinInstanceData *instDataChild = window->winGetChild()->winGetInstanceData(); BitClear(instDataChild->m_state, WIN_STATE_HILITED); @@ -137,7 +137,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, @@ -210,7 +210,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn // -------------------------------------------------------------------- case KEY_RIGHT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( s->position > s->minVal + 1 ) @@ -235,7 +235,7 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn // -------------------------------------------------------------------- case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( s->position < s->maxVal - 1 ) @@ -261,14 +261,14 @@ WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedIn case KEY_DOWN: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; // -------------------------------------------------------------------- case KEY_UP: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winPrevTab(); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index 0f0ef851d0..cb616a1ae0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -307,7 +307,7 @@ static void computeTotalHeight( GameWindow *window ) Int cellHeight = 0; if(list->listData[i].cell[j].cellType == LISTBOX_TEXT) { - if( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == TRUE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == TRUE ) { cellHeight = TheWindowManager->winFontHeight( instData->getFont() ); } @@ -498,7 +498,7 @@ static Int addEntry( UnicodeString *string, Int color, Int row, Int column, Game if( !listRow->cell[column].data ) listRow->cell[column].data = (void *) TheDisplayStringManager->newDisplayString(); displayString = (DisplayString *) listRow->cell[column].data; - if ( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == FALSE ) + if ( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == FALSE ) displayString->setWordWrap( width ); displayString->setText( *string ); @@ -570,7 +570,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case KEY_SPACE: { - if( BitTest( mData2, KEY_STATE_UP ) ) + if( BitIsSet( mData2, KEY_STATE_UP ) ) { doAudioFeedback(window); @@ -588,7 +588,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case KEY_DOWN: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( list->selectPos == -1 ) @@ -639,7 +639,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case KEY_UP: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( list->selectPos == -1 ) @@ -686,14 +686,14 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case KEY_RIGHT: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winNextTab(window); break; // -------------------------------------------------------------------- case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winPrevTab(window); break; @@ -701,7 +701,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, default: { Bool foundIt = false; - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { // set the position to start looking for the line of text with this character Int position = list->selectPos; @@ -716,7 +716,8 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, ListEntryCell *cell = NULL; // go through the columns until we find a column with text - for(Int j = 0; j < list->columns; ++j) + Int j = 0; + for(; j < list->columns; ++j) { cell = &list->listData[position].cell[j]; if(cell && cell->cellType == LISTBOX_TEXT && cell->data) @@ -923,7 +924,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -943,7 +944,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK )) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK )) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -960,7 +961,7 @@ WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg, // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if (BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, @@ -1003,7 +1004,7 @@ WindowMsgHandledType GadgetListBoxMultiInput( GameWindow *window, UnsignedInt ms // -------------------------------------------------------------------- case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; @@ -1201,7 +1202,7 @@ WindowMsgHandledType GadgetListBoxMultiInput( GameWindow *window, UnsignedInt ms case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -1221,7 +1222,7 @@ WindowMsgHandledType GadgetListBoxMultiInput( GameWindow *window, UnsignedInt ms case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK )) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK )) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -1238,7 +1239,7 @@ WindowMsgHandledType GadgetListBoxMultiInput( GameWindow *window, UnsignedInt ms // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if (BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, @@ -1290,7 +1291,7 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg, if(pos->x >= list->columns || pos->y >= list->listLength || list->listData[pos->y].cell[pos->x].cellType != LISTBOX_TEXT) { - tAndC->string = UnicodeString.TheEmptyString; + tAndC->string = UnicodeString::TheEmptyString; tAndC->color = 0; } else @@ -1633,7 +1634,8 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg, if( list->multiSelect ) { // forced selections override the entire selection list. - for (Int i=0; iendPos; ++i) + Int i=0; + for (; iendPos; ++i) { // don't select off the end if (list->listLength <= selectList[i]) @@ -1661,7 +1663,7 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg, list->selectPos = selectList[0]; GameWindow *parent = window->winGetParent(); - if( parent && BitTest( parent->winGetStyle(), GWS_COMBO_BOX ) ) + if( parent && BitIsSet( parent->winGetStyle(), GWS_COMBO_BOX ) ) { TheWindowManager->winSendSystemMsg( window->winGetOwner(), GLM_SELECTED, @@ -1716,7 +1718,8 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg, // the position mData1 contains // ListEntryCell *cells = NULL; - for (Int i = 0; i < (Int)mData1; i++) + Int i = 0; + for (; i < (Int)mData1; i++) { cells = list->listData[i].cell; @@ -2178,7 +2181,7 @@ UnicodeString GadgetListBoxGetTextAndColor( GameWindow *listbox, Color *color, I return UnicodeString::TheEmptyString; // verify that this is a list box - if( BitTest( listbox->winGetStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) + if( BitIsSet( listbox->winGetStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) return UnicodeString::TheEmptyString; TextAndColor tAndC; //UnicodeString result; @@ -2345,7 +2348,7 @@ void GadgetListboxCreateScrollbar( GameWindow *listbox ) winInstData.m_style = GWS_PUSH_BUTTON; // if listbox tracks, so will this sub control - if( BitTest( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); listData->upButton = @@ -2364,7 +2367,7 @@ void GadgetListboxCreateScrollbar( GameWindow *listbox ) winInstData.m_owner = listbox; // if listbox tracks, so will this sub control - if( BitTest( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); listData->downButton = @@ -2389,7 +2392,7 @@ void GadgetListboxCreateScrollbar( GameWindow *listbox ) winInstData.m_owner = listbox; // if listbox tracks, so will this sub control - if( BitTest( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); // intialize sData diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp index e18a06e3af..0dd85bc3e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp @@ -74,10 +74,10 @@ static Bool buttonTriggersOnMouseDown(GameWindow *window) { // Buttons with the on down status set trigger on mouse down. jba. [8/6/2003] - Bool onDown = BitTest( window->winGetStatus(), WIN_STATUS_ON_MOUSE_DOWN); + Bool onDown = BitIsSet( window->winGetStatus(), WIN_STATUS_ON_MOUSE_DOWN); // Checkboxes always trigger on mouse down. jba [8/6/2003] - if (BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE )) { + if (BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE )) { onDown = true; } return onDown; @@ -100,7 +100,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -111,7 +111,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, //TheWindowManager->winSetFocus( window ); } - if(window->winGetParent() && BitTest(window->winGetParent()->winGetStyle(),GWS_HORZ_SLIDER) ) + if(window->winGetParent() && BitIsSet(window->winGetParent()->winGetStyle(),GWS_HORZ_SLIDER) ) { WinInstanceData *instDataParent = window->winGetParent()->winGetInstanceData(); BitSet(instDataParent->m_state, WIN_STATE_HILITED); @@ -124,7 +124,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case GWM_MOUSE_LEAVING: { - if(BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if(BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); TheWindowManager->winSendSystemMsg( instData->getOwner(), @@ -137,11 +137,11 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, // if this is not a check-like button, clear any selected state when the // move leaves the window area // - if( BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) BitClear( instData->m_state, WIN_STATE_SELECTED ); //TheWindowManager->winSetFocus( NULL ); - if(window->winGetParent() && BitTest(window->winGetParent()->winGetStyle(),GWS_HORZ_SLIDER) ) + if(window->winGetParent() && BitIsSet(window->winGetParent()->winGetStyle(),GWS_HORZ_SLIDER) ) { WinInstanceData *instDataParent = window->winGetParent()->winGetInstanceData(); BitClear(instDataParent->m_state, WIN_STATE_HILITED); @@ -180,10 +180,10 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, // in that case instead of just turning it on like normal ... also note // that selected messages are sent immediately // - if( BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) { - if( BitTest( instData->m_state, WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->m_state, WIN_STATE_SELECTED ) ) BitClear( instData->m_state, WIN_STATE_SELECTED ); else BitSet( instData->m_state, WIN_STATE_SELECTED ); @@ -214,8 +214,8 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, // note check like selected messages aren't sent here ... they are sent // on the down press // - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) && - BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) && + BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { if (!buttonTriggersOnMouseDown(window)) { @@ -250,7 +250,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, buttonClick.setEventName("GUIClick"); - if( BitTest( instData->getStatus(), WIN_STATUS_RIGHT_CLICK ) ) + if( BitIsSet( instData->getStatus(), WIN_STATUS_RIGHT_CLICK ) ) { // Need to be specially marked to care about right mouse events if( TheAudio ) @@ -263,10 +263,10 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, // in that case instead of just turning it on like normal ... also note // that selected messages are sent immediately // - if( BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) { - if( BitTest( instData->m_state, WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->m_state, WIN_STATE_SELECTED ) ) BitClear( instData->m_state, WIN_STATE_SELECTED ); else BitSet( instData->m_state, WIN_STATE_SELECTED ); @@ -296,15 +296,15 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case GWM_RIGHT_UP: { - if( BitTest( instData->getStatus(), WIN_STATUS_RIGHT_CLICK ) ) + if( BitIsSet( instData->getStatus(), WIN_STATUS_RIGHT_CLICK ) ) { // // note check like selected messages aren't sent here ... they are sent // on the down press // - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) && - BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) && + BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { TheWindowManager->winSendSystemMsg( instData->getOwner(), GBM_SELECTED_RIGHT, @@ -342,15 +342,15 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case KEY_SPACE: { - if( BitTest( mData2, KEY_STATE_UP ) ) + if( BitIsSet( mData2, KEY_STATE_UP ) ) { // // note check like selected messages aren't sent here ... they are sent // on the down press // - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) && - BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) && + BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { TheWindowManager->winSendSystemMsg( instData->getOwner(), GBM_SELECTED, @@ -369,10 +369,10 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, // in that case instead of just turning it on like normal ... also note // that selected messages are sent immediately // - if( BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) { - if( BitTest( instData->m_state, WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->m_state, WIN_STATE_SELECTED ) ) BitClear( instData->m_state, WIN_STATE_SELECTED ); else BitSet( instData->m_state, WIN_STATE_SELECTED ); @@ -402,7 +402,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case KEY_TAB: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winNextTab(window); break; @@ -413,7 +413,7 @@ WindowMsgHandledType GadgetPushButtonInput( GameWindow *window, case KEY_LEFT: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) TheWindowManager->winPrevTab(window); break; @@ -516,7 +516,7 @@ void GadgetCheckLikeButtonSetVisualCheck( GameWindow *g, Bool checked ) return; // sanity, must be a check like button - if( BitTest( g->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) + if( BitIsSet( g->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { DEBUG_CRASH(( "GadgetCheckLikeButtonSetVisualCheck: Window is not 'CHECK-LIKE'\n" )); @@ -552,7 +552,7 @@ Bool GadgetCheckLikeButtonIsChecked( GameWindow *g ) return FALSE; // we just hold this "check like dual state thingie" using the selected state - return BitTest( instData->m_state, WIN_STATE_SELECTED ); + return BitIsSet( instData->m_state, WIN_STATE_SELECTED ); } // end GadgetCheckLikeButtonIsChecked diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp index b7987a8abb..e48e43cc68 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp @@ -76,7 +76,7 @@ static void doRadioUnselect( GameWindow *window, Int group, Int screen, // if this is a radio button we have something to consider, but we // will ignore the except window // - if( window != except && BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + if( window != except && BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) { RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData(); @@ -132,7 +132,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg case GWM_MOUSE_ENTERING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -152,7 +152,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg case GWM_MOUSE_LEAVING: { - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -188,7 +188,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg case GWM_LEFT_UP: { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) { RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData(); @@ -208,7 +208,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg BitSet( instData->m_state, WIN_STATE_SELECTED ); } // end if, not selected - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) == FALSE ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) == FALSE ) { // this up click was not meant for this button @@ -230,10 +230,10 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg // -------------------------------------------------------------------- case KEY_ENTER: case KEY_SPACE: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) { RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData(); @@ -264,7 +264,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg case KEY_TAB: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; @@ -275,7 +275,7 @@ WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg case KEY_LEFT: { - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winPrevTab(); break; @@ -324,7 +324,7 @@ WindowMsgHandledType GadgetRadioButtonSystem( GameWindow *window, UnsignedInt ms case GBM_SET_SELECTION: { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE ) { // do we want to send a selected message? diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp index 7e3a9c820b..262681a9af 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp @@ -87,13 +87,13 @@ WindowMsgHandledType GadgetStaticTextInput( GameWindow *window, UnsignedInt msg, case KEY_RIGHT: case KEY_TAB: // Just in case some fool sets static text as a tab stop - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; case KEY_UP: case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winPrevTab(); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp index 9d67b5dcf0..afbf396b51 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp @@ -315,7 +315,7 @@ void GadgetTabControlCreateSubPanes( GameWindow *tabControl )///< Create User Wi sprintf( buffer, "Pane %d", paneIndex ); instData->m_decoratedNameString = buffer; //set enabled status to that of Parent - tabData->subPanes[paneIndex]->winEnable( BitTest(tabControl->winGetStatus(), WIN_STATUS_ENABLED) ); + tabData->subPanes[paneIndex]->winEnable( BitIsSet(tabControl->winGetStatus(), WIN_STATUS_ENABLED) ); } else//this one exists, tabCount will control keeping extra panes perma-hidden { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp index 0baf1739f9..04824f1963 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp @@ -149,7 +149,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, } // ------------------------------------------------------------------------ case GWM_CHAR: - if ( BitTest( mData2, KEY_STATE_DOWN ) && BitTest( mData2, KEY_STATE_ALT | KEY_STATE_CONTROL ) ) + if ( BitIsSet( mData2, KEY_STATE_DOWN ) && BitIsSet( mData2, KEY_STATE_ALT | KEY_STATE_CONTROL ) ) { return MSG_IGNORED; // text extries shouldn't care about CTRL+* or ALT+* } @@ -161,7 +161,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, case KEY_KPENTER: case KEY_ENTER: // Done with this edit - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( e->receivedUnichar == FALSE ) { @@ -202,11 +202,11 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, case KEY_RIGHT: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { GameWindow *parent; parent = window->winGetParent(); - if(parent && !BitTest(parent->winGetStyle(), GWS_COMBO_BOX)) + if(parent && !BitIsSet(parent->winGetStyle(), GWS_COMBO_BOX)) parent = NULL; if(parent) TheWindowManager->winNextTab(parent); @@ -220,11 +220,11 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, case KEY_UP: case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { GameWindow *parent; parent = window->winGetParent(); - if(parent && !BitTest(parent->winGetStyle(), GWS_COMBO_BOX)) + if(parent && !BitIsSet(parent->winGetStyle(), GWS_COMBO_BOX)) parent = NULL; if(parent) TheWindowManager->winPrevTab(parent); @@ -236,7 +236,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, // -------------------------------------------------------------------- case KEY_BACKSPACE: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { // if conCharPos != 0 this will fall through to next case. // it should be noted that conCharPos can only != 0 in Jap & Kor @@ -270,7 +270,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, // ------------------------------------------------------------------------ case GWM_MOUSE_ENTERING: - if (BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -285,7 +285,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, // ------------------------------------------------------------------------ case GWM_MOUSE_LEAVING: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -298,7 +298,7 @@ WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg, // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, 0 ); @@ -577,7 +577,7 @@ UnicodeString GadgetTextEntryGetText( GameWindow *textentry ) return UnicodeString::TheEmptyString; // verify that this is a list box - if( BitTest( textentry->winGetStyle(), GWS_ENTRY_FIELD ) == FALSE ) + if( BitIsSet( textentry->winGetStyle(), GWS_ENTRY_FIELD ) == FALSE ) return UnicodeString::TheEmptyString; UnicodeString result; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp index b99c779b64..188742bcdb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp @@ -87,7 +87,7 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt // ------------------------------------------------------------------------ case GWM_MOUSE_ENTERING: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitSet( instData->m_state, WIN_STATE_HILITED ); @@ -103,7 +103,7 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt // ------------------------------------------------------------------------ case GWM_MOUSE_LEAVING: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) { BitClear( instData->m_state, WIN_STATE_HILITED ); @@ -117,7 +117,7 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt // ------------------------------------------------------------------------ case GWM_LEFT_DRAG: - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG, (WindowMsgData)window, @@ -191,7 +191,7 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt // -------------------------------------------------------------------- case KEY_UP: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( s->position < s->maxVal - 1) @@ -215,7 +215,7 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt // -------------------------------------------------------------------- case KEY_DOWN: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) { if( s->position > s->minVal + 1 ) @@ -237,14 +237,14 @@ WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt case KEY_RIGHT: case KEY_TAB: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winNextTab(); break; // -------------------------------------------------------------------- case KEY_LEFT: - if( BitTest( mData2, KEY_STATE_DOWN ) ) + if( BitIsSet( mData2, KEY_STATE_DOWN ) ) window->winPrevTab(); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp index f8b401fa95..6c673defee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp @@ -223,7 +223,7 @@ GameWindow *GameWindow::findPrevLeaf( void ) leaf = leaf->m_prev; while( leaf->m_child && - BitTest( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE ) + BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE ) { leaf = leaf->m_child; @@ -250,7 +250,7 @@ GameWindow *GameWindow::findPrevLeaf( void ) leaf = leaf->m_prev; while( leaf->m_child && - BitTest( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE ) + BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) == FALSE ) { leaf = leaf->m_child; @@ -291,7 +291,7 @@ GameWindow *GameWindow::findNextLeaf( void ) return leaf->m_next; for( leaf = leaf->m_next; leaf; leaf = leaf->m_child ) - if( leaf->m_child == NULL || BitTest( leaf->m_status, + if( leaf->m_child == NULL || BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) ) return leaf; @@ -309,7 +309,7 @@ GameWindow *GameWindow::findNextLeaf( void ) for( leaf = leaf->m_next; leaf; leaf = leaf->m_child ) if( leaf->m_child == NULL || - BitTest( leaf->m_status, WIN_STATUS_TAB_STOP ) ) + BitIsSet( leaf->m_status, WIN_STATUS_TAB_STOP ) ) return leaf; } // end if @@ -664,7 +664,7 @@ Int GameWindow::winEnable( Bool enable ) //============================================================================= Bool GameWindow::winGetEnabled( void ) { - return BitTest( m_status, WIN_STATUS_ENABLED ); + return BitIsSet( m_status, WIN_STATUS_ENABLED ); } // end winGetEnabled @@ -683,7 +683,7 @@ Int GameWindow::winHide( Bool hide ) // invisible then there's a good chance that the black border around // the game window needs redrawing // - if( !BitTest( m_status, WIN_STATUS_NO_FLUSH ) ) + if( !BitIsSet( m_status, WIN_STATUS_NO_FLUSH ) ) freeImages(); BitSet( m_status, WIN_STATUS_HIDDEN ); @@ -709,7 +709,7 @@ Int GameWindow::winHide( Bool hide ) Bool GameWindow::winIsHidden( void ) { - return BitTest( m_status, WIN_STATUS_HIDDEN ); + return BitIsSet( m_status, WIN_STATUS_HIDDEN ); } // end WinIsHidden @@ -853,13 +853,13 @@ void GameWindow::winSetFont( GameFont *font ) m_instData.m_font = font; // set font for other display strings in special gadget window controls - if( BitTest( m_instData.getStyle(), GWS_SCROLL_LISTBOX ) ) + if( BitIsSet( m_instData.getStyle(), GWS_SCROLL_LISTBOX ) ) GadgetListBoxSetFont( this, font ); - else if( BitTest( m_instData.getStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) ) GadgetComboBoxSetFont( this, font ); - else if( BitTest( m_instData.getStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( m_instData.getStyle(), GWS_ENTRY_FIELD ) ) GadgetTextEntrySetFont( this, font ); - else if( BitTest( m_instData.getStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( m_instData.getStyle(), GWS_STATIC_TEXT ) ) GadgetStaticTextSetFont( this, font ); else { @@ -885,7 +885,7 @@ void GameWindow::winSetEnabledTextColors( Color color, Color borderColor ) m_instData.m_enabledText.color = color; m_instData.m_enabledText.borderColor = borderColor; - if( BitTest( m_instData.getStyle(), GWS_COMBO_BOX ) ) + if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) ) GadgetComboBoxSetEnabledTextColors(this, color, borderColor ); @@ -900,7 +900,7 @@ void GameWindow::winSetDisabledTextColors( Color color, Color borderColor ) m_instData.m_disabledText.color = color; m_instData.m_disabledText.borderColor = borderColor; - if( BitTest( m_instData.getStyle(), GWS_COMBO_BOX ) ) + if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) ) GadgetComboBoxSetDisabledTextColors( this, color, borderColor ); } // end winSetDisabledTextColors @@ -914,7 +914,7 @@ void GameWindow::winSetHiliteTextColors( Color color, Color borderColor ) m_instData.m_hiliteText.color = color; m_instData.m_hiliteText.borderColor = borderColor; - if( BitTest( m_instData.getStyle(), GWS_COMBO_BOX ) ) + if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) ) GadgetComboBoxSetHiliteTextColors( this, color, borderColor ); } // end winSetHiliteTextColors @@ -928,7 +928,7 @@ void GameWindow::winSetIMECompositeTextColors( Color color, Color borderColor ) m_instData.m_imeCompositeText.color = color; m_instData.m_imeCompositeText.borderColor = borderColor; - if( BitTest( m_instData.getStyle(), GWS_COMBO_BOX ) ) + if( BitIsSet( m_instData.getStyle(), GWS_COMBO_BOX ) ) GadgetComboBoxSetIMECompositeTextColors( this, color, borderColor ); } // end winSetIMECompositeTextColors @@ -1377,7 +1377,7 @@ Int GameWindow::winSetCallbacks( GameWinInputFunc input, Int GameWindow::winDrawWindow( void ) { - if( BitTest( m_status, WIN_STATUS_HIDDEN ) == FALSE && m_draw ) + if( BitIsSet( m_status, WIN_STATUS_HIDDEN ) == FALSE && m_draw ) m_draw( this, &m_instData ); return WIN_ERR_OK; @@ -1413,8 +1413,8 @@ GameWindow *GameWindow::winPointInChild( Int x, Int y, Bool ignoreEnableCheck, B if( x >= origin.x && x <= origin.x + child->m_size.x && y >= origin.y && y <= origin.y + child->m_size.y ) { - Bool enabled = ignoreEnableCheck || BitTest( child->m_status, WIN_STATUS_ENABLED ); - Bool hidden = BitTest( child->m_status, WIN_STATUS_HIDDEN ); + Bool enabled = ignoreEnableCheck || BitIsSet( child->m_status, WIN_STATUS_ENABLED ); + Bool hidden = BitIsSet( child->m_status, WIN_STATUS_HIDDEN ); if( !hidden ) { if( enabled ) @@ -1468,7 +1468,7 @@ GameWindow *GameWindow::winPointInAnyChild( Int x, Int y, Bool ignoreHidden, Boo y >= origin.y && y <= origin.y + child->m_size.y ) { - if( !(ignoreHidden == TRUE && BitTest( child->m_status, WIN_STATUS_HIDDEN )) ) + if( !(ignoreHidden == TRUE && BitIsSet( child->m_status, WIN_STATUS_HIDDEN )) ) return child->winPointInChild( x, y, ignoreEnableCheck ); } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp index 46fc6bd167..6447cffb05 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp @@ -436,7 +436,7 @@ Bool GameWindowManager::isEnabled( GameWindow *win ) if( win == NULL ) return FALSE; - if( BitTest( win->m_status, WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( win->m_status, WIN_STATUS_ENABLED ) == FALSE ) { return FALSE; } @@ -444,7 +444,7 @@ Bool GameWindowManager::isEnabled( GameWindow *win ) while( win->m_parent ) { win = win->m_parent; - if( BitTest( win->m_status, WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( win->m_status, WIN_STATUS_ENABLED ) == FALSE ) { return FALSE; } @@ -464,7 +464,7 @@ Bool GameWindowManager::isHidden( GameWindow *win ) if( win == NULL ) return TRUE; - if( BitTest( win->m_status, WIN_STATUS_HIDDEN )) + if( BitIsSet( win->m_status, WIN_STATUS_HIDDEN )) { return TRUE; } @@ -472,7 +472,7 @@ Bool GameWindowManager::isHidden( GameWindow *win ) while( win->m_parent ) { win = win->m_parent; - if( BitTest( win->m_status, WIN_STATUS_HIDDEN )) + if( BitIsSet( win->m_status, WIN_STATUS_HIDDEN )) { return TRUE; } @@ -703,7 +703,7 @@ WindowMsgHandledType GameWindowManager::winSendSystemMsg( GameWindow *window, if( window == NULL) return MSG_IGNORED; - if( msg != GWM_DESTROY && BitTest( window->m_status, WIN_STATUS_DESTROYED ) ) + if( msg != GWM_DESTROY && BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) ) return MSG_IGNORED; return window->m_system( window, msg, mData1, mData2 ); @@ -722,7 +722,7 @@ WindowMsgHandledType GameWindowManager::winSendInputMsg( GameWindow *window, if( window == NULL ) return MSG_IGNORED; - if( msg != GWM_DESTROY && BitTest( window->m_status, WIN_STATUS_DESTROYED ) ) + if( msg != GWM_DESTROY && BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) ) return MSG_IGNORED; return window->m_input( window, msg, mData1, mData2 ); @@ -748,7 +748,7 @@ Int GameWindowManager::winSetFocus( GameWindow *window ) // if a window doesn't want keyboard focus don't give it if( window ) - if( BitTest( window->winGetStatus(), WIN_STATUS_NO_FOCUS) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_NO_FOCUS) ) return 0; // @@ -922,7 +922,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms BitClear( m_grabWindow->m_status, WIN_STATUS_ACTIVE ); if( m_grabWindow->winPointInWindow( mousePos->x, mousePos->y ) ) winSendInputMsg( m_grabWindow, GWM_LEFT_UP, packedMouseCoords, 0 ); - else if( BitTest( m_grabWindow->m_status, WIN_STATUS_DRAGABLE )) + else if( BitIsSet( m_grabWindow->m_status, WIN_STATUS_DRAGABLE )) { winSendInputMsg( m_grabWindow, GWM_LEFT_UP, packedMouseCoords, 0 ); } @@ -937,7 +937,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms case GWM_LEFT_DRAG: { - if( BitTest( m_grabWindow->m_status, WIN_STATUS_DRAGABLE ) ) + if( BitIsSet( m_grabWindow->m_status, WIN_STATUS_DRAGABLE ) ) { ICoord2D *mouseDelta = (ICoord2D *)data; dx = mouseDelta->x; @@ -1017,8 +1017,8 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms for( window = m_windowList; window; window = window->m_next ) { - if( BitTest( window->m_status, WIN_STATUS_ABOVE ) && - !BitTest( window->m_status, WIN_STATUS_HIDDEN ) && + if( BitIsSet( window->m_status, WIN_STATUS_ABOVE ) && + !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) && mousePos->x >= window->m_region.lo.x && mousePos->x <= window->m_region.hi.x && mousePos->y >= window->m_region.lo.y && @@ -1034,7 +1034,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms toolTipWindow = childWindow; } } - if( BitTest( window->m_status, WIN_STATUS_ENABLED ) ) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED ) ) { // determine which child window the mouse is in window = window->winPointInChild( mousePos->x, mousePos->y ); @@ -1052,7 +1052,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms for( window = m_windowList; window; window = window->m_next ) { - if( !BitTest( window->m_status, WIN_STATUS_ABOVE | + if( !BitIsSet( window->m_status, WIN_STATUS_ABOVE | WIN_STATUS_BELOW | WIN_STATUS_HIDDEN ) && mousePos->x >= window->m_region.lo.x && @@ -1070,7 +1070,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms toolTipWindow = childWindow; } } - if( BitTest( window->m_status, WIN_STATUS_ENABLED )) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )) { // determine which child window the mouse is in window = window->winPointInChild( mousePos->x, mousePos->y ); @@ -1087,8 +1087,8 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms for( window = m_windowList; window; window = window->m_next ) { - if( BitTest( window->m_status, WIN_STATUS_BELOW ) && - !BitTest( window->m_status, WIN_STATUS_HIDDEN ) && + if( BitIsSet( window->m_status, WIN_STATUS_BELOW ) && + !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) && mousePos->x >= window->m_region.lo.x && mousePos->x <= window->m_region.hi.x && mousePos->y >= window->m_region.lo.y && @@ -1104,7 +1104,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms toolTipWindow = childWindow; } } - if( BitTest( window->m_status, WIN_STATUS_ENABLED )) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )) { // determine which child window the mouse is in window = window->winPointInChild( mousePos->x, mousePos->y ); @@ -1117,9 +1117,9 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms } // end else, no modal head if( window ) - if( BitTest( window->m_status, WIN_STATUS_NO_INPUT ) ) + if( BitIsSet( window->m_status, WIN_STATUS_NO_INPUT ) ) { - if(window->winGetParent() && BitTest( window->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX )) + if(window->winGetParent() && BitIsSet( window->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX )) window = window->winGetParent(); else window = NULL; @@ -1207,7 +1207,7 @@ WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage ms Bool tooltipsOn = TRUE; if( tooltipsOn ) { -// if( toolTipWindow && toolTipWindow->winGetParent() && BitTest( toolTipWindow->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX )) +// if( toolTipWindow && toolTipWindow->winGetParent() && BitIsSet( toolTipWindow->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX )) // toolTipWindow = toolTipWindow->winGetParent(); if( toolTipWindow ) { @@ -1291,17 +1291,17 @@ Int GameWindowManager::drawWindow( GameWindow *window ) if( window == NULL ) return WIN_ERR_INVALID_WINDOW; - if( BitTest( window->m_status, WIN_STATUS_HIDDEN ) == FALSE ) + if( BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) == FALSE ) { - if( !BitTest( window->m_status, WIN_STATUS_SEE_THRU ) && window->m_draw ) + if( !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) && window->m_draw ) window->m_draw( window, &window->m_instData ); /// @todo visit list boxes and borders, this is stupid! // for list boxes only draw the borders BEFORE the children - if( BitTest( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) - if( BitTest( window->m_status, WIN_STATUS_BORDER ) == TRUE && - !BitTest( window->m_status, WIN_STATUS_SEE_THRU ) ) + if( BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + if( BitIsSet( window->m_status, WIN_STATUS_BORDER ) == TRUE && + !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) ) window->winDrawBorder(); // draw children in reverse order just like the window list @@ -1316,9 +1316,9 @@ Int GameWindowManager::drawWindow( GameWindow *window ) // draw the border for the window AFTER the window contents AND the // children contents have drawn // - if( !BitTest( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) - if( BitTest( window->m_status, WIN_STATUS_BORDER ) == TRUE && - !BitTest( window->m_status, WIN_STATUS_SEE_THRU ) ) + if( !BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + if( BitIsSet( window->m_status, WIN_STATUS_BORDER ) == TRUE && + !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) ) window->winDrawBorder(); } // end if @@ -1339,7 +1339,7 @@ void GameWindowManager::winRepaint( void ) { next = window->m_prev; - if( BitTest( window->m_status, WIN_STATUS_BELOW ) ) + if( BitIsSet( window->m_status, WIN_STATUS_BELOW ) ) drawWindow( window ); } @@ -1348,7 +1348,7 @@ void GameWindowManager::winRepaint( void ) { next = window->m_prev; - if (BitTest( window->m_status, WIN_STATUS_ABOVE | + if (BitIsSet( window->m_status, WIN_STATUS_ABOVE | WIN_STATUS_BELOW ) == FALSE) drawWindow( window ); } @@ -1358,7 +1358,7 @@ void GameWindowManager::winRepaint( void ) { next = window->m_prev; - if( BitTest( window->m_status, WIN_STATUS_ABOVE ) ) + if( BitIsSet( window->m_status, WIN_STATUS_ABOVE ) ) drawWindow( window ); } @@ -1475,7 +1475,7 @@ Int GameWindowManager::winDestroy( GameWindow *window ) DEBUG_ASSERTCRASH( window->winGetEditData() == NULL, ("winDestroy(): edit data should NOT be present!\n") ); - if( BitTest( window->m_status, WIN_STATUS_DESTROYED ) ) + if( BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) ) return WIN_ERR_OK; BitSet( window->m_status, WIN_STATUS_DESTROYED ); @@ -1849,7 +1849,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, GameWindow *button; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_PUSH_BUTTON ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) == FALSE ) { DEBUG_LOG(( "Cann't create button gadget, instance data not button type\n" )); @@ -1879,7 +1879,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, // assign draw function, the draw functions must actually be implemented // on the device level of the engine // - if( BitTest( button->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( button->winGetStatus(), WIN_STATUS_IMAGE ) ) button->winSetDrawFunc( getPushButtonImageDrawFunc() ); else button->winSetDrawFunc( getPushButtonDrawFunc() ); @@ -1917,7 +1917,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, GameWindow *checkbox; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_CHECK_BOX ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) == FALSE ) { DEBUG_LOG(( "Cann't create checkbox gadget, instance data not checkbox type\n" )); @@ -1947,7 +1947,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, // assign draw function, the draw functions must actually be implemented // on the device level of the engine // - if( BitTest( checkbox->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( checkbox->winGetStatus(), WIN_STATUS_IMAGE ) ) checkbox->winSetDrawFunc( getCheckBoxImageDrawFunc() ); else checkbox->winSetDrawFunc( getCheckBoxDrawFunc() ); @@ -1984,7 +1984,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, RadioButtonData *radioData; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_RADIO_BUTTON ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) == FALSE ) { DEBUG_LOG(( "Cann't create radioButton gadget, instance data not radioButton type\n" )); @@ -2019,7 +2019,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, // assign draw function, the draw functions must actually be implemented // on the device level of the engine // - if( BitTest( radioButton->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( radioButton->winGetStatus(), WIN_STATUS_IMAGE ) ) radioButton->winSetDrawFunc( getRadioButtonImageDrawFunc() ); else radioButton->winSetDrawFunc( getRadioButtonDrawFunc() ); @@ -2056,7 +2056,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, TabControlData *tabData; // we MUST have a tab control style window to do this - if( BitTest( instData->getStyle(), GWS_TAB_CONTROL ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_TAB_CONTROL ) == FALSE ) { DEBUG_LOG(( "Cann't create tabControl gadget, instance data not tabControl type\n" )); @@ -2095,7 +2095,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, // assign draw function, the draw functions must actually be implemented // on the device level of the engine // - if( BitTest( tabControl->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( tabControl->winGetStatus(), WIN_STATUS_IMAGE ) ) tabControl->winSetDrawFunc( getTabControlImageDrawFunc() ); else tabControl->winSetDrawFunc( getTabControlDrawFunc() ); @@ -2128,7 +2128,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, Bool title = FALSE; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) { DEBUG_LOG(( "Cann't create listbox gadget, instance data not listbox type\n" )); @@ -2166,7 +2166,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, title = TRUE; // Set up list box redraw callbacks - if( BitTest( listbox->winGetStatus(), WIN_STATUS_IMAGE )) + if( BitIsSet( listbox->winGetStatus(), WIN_STATUS_IMAGE )) listbox->winSetDrawFunc( getListBoxImageDrawFunc() ); else listbox->winSetDrawFunc( getListBoxDrawFunc() ); @@ -2278,7 +2278,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, // BitSet( status, WIN_STATUS_TAB_STOP ); - if( BitTest( instData->getStyle(), GWS_HORZ_SLIDER ) ) + if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) ) { slider = winCreate( parent, status, x, y, width, height, @@ -2286,13 +2286,13 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, // Set up horizontal slider callbacks slider->winSetInputFunc( GadgetHorizontalSliderInput ); - if( BitTest( slider->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( slider->winGetStatus(), WIN_STATUS_IMAGE ) ) slider->winSetDrawFunc( getHorizontalSliderImageDrawFunc() ); else slider->winSetDrawFunc( getHorizontalSliderDrawFunc() ); } // end if - else if ( BitTest( instData->getStyle(), GWS_VERT_SLIDER ) ) + else if ( BitIsSet( instData->getStyle(), GWS_VERT_SLIDER ) ) { slider = winCreate( parent, status, x, y, width, height, @@ -2301,7 +2301,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, // Set up vertical slider callbacks slider->winSetInputFunc( GadgetVerticalSliderInput ); - if( BitTest( slider->winGetStatus(), WIN_STATUS_IMAGE ) && !(parent && BitTest(parent->winGetStyle(), GWS_SCROLL_LISTBOX))) + if( BitIsSet( slider->winGetStatus(), WIN_STATUS_IMAGE ) && !(parent && BitIsSet(parent->winGetStyle(), GWS_SCROLL_LISTBOX))) slider->winSetDrawFunc( getVerticalSliderImageDrawFunc() ); else slider->winSetDrawFunc( getVerticalSliderDrawFunc() ); @@ -2342,10 +2342,10 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, buttonInstData.m_style = GWS_PUSH_BUTTON; // if slider tracks, so will this sub control - if( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) ) BitSet( buttonInstData.m_style, GWS_MOUSE_TRACK ); - if( BitTest( instData->getStyle(), GWS_HORZ_SLIDER ) ) + if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) ) button = gogoGadgetPushButton( slider, statusFlags, 0, HORIZONTAL_SLIDER_THUMB_POSITION, HORIZONTAL_SLIDER_THUMB_WIDTH, HORIZONTAL_SLIDER_THUMB_HEIGHT, &buttonInstData, NULL, TRUE ); else @@ -2356,7 +2356,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, if( sliderData->maxVal == sliderData->minVal ) sliderData->maxVal = sliderData->minVal + 1; - if( BitTest( instData->getStyle(), GWS_HORZ_SLIDER ) ) + if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) ) { sliderData->numTicks = (float)(width - HORIZONTAL_SLIDER_THUMB_WIDTH) / (float)(sliderData->maxVal - sliderData->minVal); @@ -2396,7 +2396,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, Bool title = FALSE; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_COMBO_BOX) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX) == FALSE ) { DEBUG_LOG(( "Cann't create ComboBox gadget, instance data not ComboBox type\n" )); @@ -2435,7 +2435,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, title = TRUE; // Set up list box redraw callbacks - if( BitTest( comboBox->winGetStatus(), WIN_STATUS_IMAGE )) + if( BitIsSet( comboBox->winGetStatus(), WIN_STATUS_IMAGE )) comboBox->winSetDrawFunc( getComboBoxImageDrawFunc() ); else comboBox->winSetDrawFunc( getComboBoxDrawFunc() ); @@ -2479,7 +2479,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, winInstData.m_style = GWS_PUSH_BUTTON; // if listbox tracks, so will this sub control - if( BitTest( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); comboBoxData->dropDownButton = @@ -2500,7 +2500,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, winInstData.m_owner = comboBox; winInstData.m_style |= GWS_ENTRY_FIELD; winInstData.m_textLabelString = "Entry"; - if( BitTest( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); if( comboBoxData->isEditable) { @@ -2528,7 +2528,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, winInstData.init(); winInstData.m_owner = comboBox; - if( BitTest( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) + if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) ) BitSet( winInstData.m_style, GWS_MOUSE_TRACK ); BitSet( winInstData.m_style, WIN_STATUS_HIDDEN ); winInstData.m_style |= GWS_SCROLL_LISTBOX; @@ -2600,7 +2600,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, GameWindow *progressBar; // we MUST have a push button style window to do this - if( BitTest( instData->getStyle(), GWS_PROGRESS_BAR ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) == FALSE ) { DEBUG_LOG(( "Cann't create progressBar gadget, instance data not progressBar type\n" )); @@ -2627,7 +2627,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, // assign draw function, the draw functions must actually be implemented // on the device level of the engine // - if( BitTest( progressBar->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( progressBar->winGetStatus(), WIN_STATUS_IMAGE ) ) progressBar->winSetDrawFunc( getProgressBarImageDrawFunc() ); else progressBar->winSetDrawFunc( getProgressBarDrawFunc() ); @@ -2662,7 +2662,7 @@ GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent, // Static Text can not be a Tab Stop BitClear( instData->m_style, GWS_TAB_STOP ); - if( BitTest( instData->getStyle(), GWS_STATIC_TEXT ) ) + if( BitIsSet( instData->getStyle(), GWS_STATIC_TEXT ) ) { textWin = winCreate( parent, status, x, y, width, height, GadgetStaticTextSystem, instData ); @@ -2681,7 +2681,7 @@ GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent, // assign callbacks textWin->winSetInputFunc( GadgetStaticTextInput ); - if( BitTest( textWin->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( textWin->winGetStatus(), WIN_STATUS_IMAGE ) ) textWin->winSetDrawFunc( getStaticTextImageDrawFunc() ); else textWin->winSetDrawFunc( getStaticTextDrawFunc() ); @@ -2693,7 +2693,7 @@ GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent, // allocate a display string for the tet data->text = TheDisplayStringManager->newDisplayString(); // set whether or not we center the wrapped text - data->text->setWordWrapCentered( BitTest( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); + data->text->setWordWrapCentered( BitIsSet( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); // Add the entry field data struct to the window's class data textWin->winSetUserData( data ); @@ -2728,7 +2728,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, GameWindow *entry; EntryData *data; - if( BitTest( instData->getStyle(), GWS_ENTRY_FIELD ) == FALSE ) + if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) == FALSE ) { DEBUG_LOG(( "Unable to create text entry, style not entry type\n" )); @@ -2754,7 +2754,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, // assign callbacks entry->winSetInputFunc( GadgetTextEntryInput ); - if( BitTest( entry->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( entry->winGetStatus(), WIN_STATUS_IMAGE ) ) entry->winSetDrawFunc( getTextEntryImageDrawFunc() ); else entry->winSetDrawFunc( getTextEntryDrawFunc() ); @@ -2927,7 +2927,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, return; // create images for the correct gadget type - if( BitTest( instData->getStyle(), GWS_PUSH_BUTTON ) ) + if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) ) { // enabled background @@ -2964,7 +2964,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder ); } // end if - else if( BitTest( instData->getStyle(), GWS_CHECK_BOX ) ) + else if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) ) { // enabled background @@ -3013,7 +3013,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder ); } // end else if - else if( BitTest( instData->getStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) ) { // enabled background @@ -3062,7 +3062,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder ); } // end else if - else if( BitTest( instData->getStyle(), GWS_HORZ_SLIDER ) ) + else if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) ) { // enabled @@ -3124,7 +3124,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, } // end if - else if( BitTest( instData->getStyle(), GWS_VERT_SLIDER ) ) + else if( BitIsSet( instData->getStyle(), GWS_VERT_SLIDER ) ) { // enabled GadgetSliderSetEnabledImageTop( gadget, winFindImage( "VSliderEnabledTopEnd" ) ); @@ -3184,7 +3184,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, GadgetSliderSetHiliteSelectedThumbBorderColor( gadget, GadgetSliderGetHiliteColor( gadget ) ); } // end else if - else if( BitTest( instData->getStyle(), GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) ) { ListboxData *listboxData = (ListboxData *)gadget->winGetUserData(); @@ -3291,7 +3291,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, } // end if } // end else if - else if( BitTest( instData->getStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX ) ) { // ComboBoxData *comboBoxData = (ComboBoxData *)gadget->winGetUserData(); @@ -3471,7 +3471,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, } // end if } } // end else if - else if( BitTest( instData->getStyle(), GWS_PROGRESS_BAR ) ) + else if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) ) { // enabled @@ -3517,7 +3517,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, GadgetProgressBarSetHiliteBarImageSmallCenter( gadget, winFindImage( "ProgressBarHiliteBarSmallRepeatingCenter" ) ); } // end else if - else if( BitTest( instData->getStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( instData->getStyle(), GWS_STATIC_TEXT ) ) { // enabled @@ -3542,7 +3542,7 @@ void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget, gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder ); } // end else if - else if( BitTest( instData->getStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) ) { // enabled @@ -3625,14 +3625,14 @@ GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEn for( window = m_windowList; window; window = window->m_next ) { - if( BitTest( window->m_status, WIN_STATUS_ABOVE ) && - !BitTest( window->m_status, WIN_STATUS_HIDDEN ) && + if( BitIsSet( window->m_status, WIN_STATUS_ABOVE ) && + !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) && x >= window->m_region.lo.x && x <= window->m_region.hi.x && y >= window->m_region.lo.y && y <= window->m_region.hi.y) { - if( BitTest( window->m_status, WIN_STATUS_ENABLED ) || ignoreEnabled ) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED ) || ignoreEnabled ) { // determine which child window the mouse is in window = window->winPointInChild( x, y, ignoreEnabled ); @@ -3646,7 +3646,7 @@ GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEn { for( window = m_windowList; window; window = window->m_next ) { - if( !BitTest( window->m_status, WIN_STATUS_ABOVE | + if( !BitIsSet( window->m_status, WIN_STATUS_ABOVE | WIN_STATUS_BELOW | WIN_STATUS_HIDDEN ) && x >= window->m_region.lo.x && @@ -3654,7 +3654,7 @@ GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEn y >= window->m_region.lo.y && y <= window->m_region.hi.y) { - if( BitTest( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled) { // determine which child window the mouse is in window = window->winPointInChild( x, y, ignoreEnabled ); @@ -3669,14 +3669,14 @@ GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEn { for( window = m_windowList; window; window = window->m_next ) { - if( BitTest( window->m_status, WIN_STATUS_BELOW ) && - !BitTest( window->m_status, WIN_STATUS_HIDDEN ) && + if( BitIsSet( window->m_status, WIN_STATUS_BELOW ) && + !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) && x >= window->m_region.lo.x && x <= window->m_region.hi.x && y >= window->m_region.lo.y && y <= window->m_region.hi.y) { - if( BitTest( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled) + if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled) { // determine which child window the mouse is in window = window->winPointInChild( x, y, ignoreEnabled ); @@ -3689,12 +3689,12 @@ GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEn if( window ) { - if( BitTest( window->m_status, WIN_STATUS_NO_INPUT )) + if( BitIsSet( window->m_status, WIN_STATUS_NO_INPUT )) { // this window does not accept input, discard window = NULL; } - else if( ignoreEnabled && !( BitTest( window->m_status, WIN_STATUS_ENABLED ) )) + else if( ignoreEnabled && !( BitIsSet( window->m_status, WIN_STATUS_ENABLED ) )) { window = NULL; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp index f1970609da..3954c0d15a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp @@ -99,8 +99,8 @@ enum struct LayoutScriptParse { - char *name; - Bool (*parse)( char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ); + const char *name; + Bool (*parse)( const char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ); }; @@ -110,8 +110,8 @@ struct LayoutScriptParse struct GameWindowParse { - char *name; - Bool (*parse)( char *token, WinInstanceData *, char *, void * ); + const char *name; + Bool (*parse)( const char *token, WinInstanceData *, char *, void * ); }; @@ -164,7 +164,7 @@ static GameWindow *windowStack[ WIN_STACK_DEPTH ]; static GameWindow **stackPtr; // for parsing -static char *seps = " =;\n\r\t"; +static const char *seps = " =;\n\r\t"; WinDrawData enabledDropDownButtonDrawData[ MAX_DRAW_DATA ]; ///< for combo boxes WinDrawData disabledDropDownButtonDrawData[ MAX_DRAW_DATA ]; ///< for combo boxes WinDrawData hiliteDropDownButtonDrawData[ MAX_DRAW_DATA ]; ///< for combo boxes @@ -481,7 +481,7 @@ static Bool parseDefaultFont( GameFont *font, File *inFile, char *buffer ) // parseTooltip =============================================================== /** Parse the tooltip field */ //============================================================================= -static Bool parseTooltip( char *token, WinInstanceData *instData, +static Bool parseTooltip( const char *token, WinInstanceData *instData, char *buffer, void *data ) { UnicodeString tooltip; @@ -499,13 +499,13 @@ static Bool parseTooltip( char *token, WinInstanceData *instData, * and adjust to make the screen rect coords relative to any parent * if present */ //============================================================================= -static Bool parseScreenRect( char *token, char *buffer, +static Bool parseScreenRect( const char *token, char *buffer, Int *x, Int *y, Int *width, Int *height ) { GameWindow *parent = peekWindow(); IRegion2D screenRegion; ICoord2D createRes; // creation resolution - char *seps = " ,:=\n\r\t"; + const char *seps = " ,:=\n\r\t"; char *c; c = strtok( NULL, seps ); // UPPERLEFT token @@ -574,7 +574,7 @@ static Bool parseScreenRect( char *token, char *buffer, // parseImageOffset =========================================================== /** Parse the image draw offset */ //============================================================================= -static Bool parseImageOffset( char *token, WinInstanceData *instData, +static Bool parseImageOffset( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c; @@ -592,12 +592,12 @@ static Bool parseImageOffset( char *token, WinInstanceData *instData, // parseFont ================================================================== /** Parse the font field */ //============================================================================= -static Bool parseFont( char *token, WinInstanceData *instData, +static Bool parseFont( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; - char *seps = " ,\n\r\t"; - char *stringSeps = ":,\n\r\t\""; + const char *seps = " ,\n\r\t"; + const char *stringSeps = ":,\n\r\t\""; char fontName[ 256 ]; Int fontSize; Int fontBold; @@ -639,12 +639,12 @@ static Bool parseFont( char *token, WinInstanceData *instData, // parseName ================================================================= /** Parse the NAME field */ //============================================================================= -static Bool parseName( char *token, WinInstanceData *instData, +static Bool parseName( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -666,7 +666,7 @@ static Bool parseName( char *token, WinInstanceData *instData, // parseStatus ================================================================ /** Parse the STATUS field */ //============================================================================= -static Bool parseStatus( char *token, WinInstanceData *instData, +static Bool parseStatus( const char *token, WinInstanceData *instData, char *buffer, void *data ) { @@ -680,7 +680,7 @@ static Bool parseStatus( char *token, WinInstanceData *instData, // parseStyle ================================================================= /** Parse the STYLE field */ //============================================================================= -static Bool parseStyle( char *token, WinInstanceData *instData, +static Bool parseStyle( const char *token, WinInstanceData *instData, char *buffer, void *data ) { @@ -694,12 +694,12 @@ static Bool parseStyle( char *token, WinInstanceData *instData, // parseSystemCallback ======================================================== /** Parse the system method callback for a window */ //============================================================================= -static Bool parseSystemCallback( char *token, WinInstanceData *instData, +static Bool parseSystemCallback( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -721,12 +721,12 @@ static Bool parseSystemCallback( char *token, WinInstanceData *instData, // parseInputCallback ========================================================= /** Parse the Input method callback for a window */ //============================================================================= -static Bool parseInputCallback( char *token, WinInstanceData *instData, +static Bool parseInputCallback( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -748,12 +748,12 @@ static Bool parseInputCallback( char *token, WinInstanceData *instData, // parseTooltipCallback ======================================================= /** Parse the Tooltip method callback for a window */ //============================================================================= -static Bool parseTooltipCallback( char *token, WinInstanceData *instData, +static Bool parseTooltipCallback( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -775,12 +775,12 @@ static Bool parseTooltipCallback( char *token, WinInstanceData *instData, // parseDrawCallback ========================================================== /** Parse the Draw method callback for a window */ //============================================================================= -static Bool parseDrawCallback( char *token, WinInstanceData *instData, +static Bool parseDrawCallback( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -802,12 +802,12 @@ static Bool parseDrawCallback( char *token, WinInstanceData *instData, // parseHeaderTemplate ========================================================== /** Parse the Draw method callback for a window */ //============================================================================= -static Bool parseHeaderTemplate( char *token, WinInstanceData *instData, +static Bool parseHeaderTemplate( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c, *ptr; -// char *seps = " ,\n\r\t"; - char *stringSeps = "\""; +// const char *seps = " ,\n\r\t"; + const char *stringSeps = "\""; // scan to the first " mark ptr = buffer; @@ -828,12 +828,12 @@ static Bool parseHeaderTemplate( char *token, WinInstanceData *instData, // parseListboxData =========================================================== /** Parse listbox data entry */ //============================================================================= -static Bool parseListboxData( char *token, WinInstanceData *instData, +static Bool parseListboxData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { ListboxData *listData = (ListboxData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "LENGTH" c = strtok( buffer, seps ); // label @@ -904,12 +904,12 @@ static Bool parseListboxData( char *token, WinInstanceData *instData, // parseComboBoxData =========================================================== /** Parse Combo Box data entry */ //============================================================================= -static Bool parseComboBoxData( char *token, WinInstanceData *instData, +static Bool parseComboBoxData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { ComboBoxData *comboData = (ComboBoxData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; c = strtok( buffer, seps ); // label c = strtok( NULL, seps ); // value @@ -938,12 +938,12 @@ static Bool parseComboBoxData( char *token, WinInstanceData *instData, // parseSliderData ============================================================ /** Parse slider data entry */ //============================================================================= -static Bool parseSliderData( char *token, WinInstanceData *instData, +static Bool parseSliderData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { SliderData *sliderData = (SliderData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "MINVALUE" c = strtok( buffer, seps ); // label @@ -962,12 +962,12 @@ static Bool parseSliderData( char *token, WinInstanceData *instData, // parseRadioButtonData ======================================================= /** Parse radio button data entry */ //============================================================================= -static Bool parseRadioButtonData( char *token, WinInstanceData *instData, +static Bool parseRadioButtonData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { RadioButtonData *radioData = (RadioButtonData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "GROUP" c = strtok( buffer, seps ); // label @@ -982,12 +982,12 @@ static Bool parseRadioButtonData( char *token, WinInstanceData *instData, // parseTooltipText =========================================================== /** Parse the TOOLTIPTEXT field */ //============================================================================= -static Bool parseTooltipText( char *token, WinInstanceData *instData, +static Bool parseTooltipText( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *ptr = buffer; char *c; - char *stringSeps = "\n\r\t\""; + const char *stringSeps = "\n\r\t\""; // scan to the first " mark while( *ptr != '"' ) @@ -1015,12 +1015,12 @@ static Bool parseTooltipText( char *token, WinInstanceData *instData, // parseTooltipDelay ======================================================= /** Parse the tooltip delay */ //============================================================================= -static Bool parseTooltipDelay( char *token, WinInstanceData *instData, +static Bool parseTooltipDelay( const char *token, WinInstanceData *instData, char *buffer, void *data ) { //RadioButtonData *radioData = (RadioButtonData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "getvalue" c = strtok( buffer, seps ); // value @@ -1034,12 +1034,12 @@ static Bool parseTooltipDelay( char *token, WinInstanceData *instData, // parseText ================================================================== /** Parse the TEXT field */ //============================================================================= -static Bool parseText( char *token, WinInstanceData *instData, +static Bool parseText( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *ptr = buffer; char *c; - char *stringSeps = "\n\r\t\""; + const char *stringSeps = "\n\r\t\""; // scan to the first " mark while( *ptr != '"' ) @@ -1065,11 +1065,11 @@ static Bool parseText( char *token, WinInstanceData *instData, /** Parse text color entries for enabled, disabled, and hilite with * drop shadow colors */ //============================================================================= -static Bool parseTextColor( char *token, WinInstanceData *instData, +static Bool parseTextColor( const char *token, WinInstanceData *instData, char *buffer, void *data ) { char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; UnsignedInt r, g, b, a; Int i, states = 3; TextDrawData *textData; @@ -1131,12 +1131,12 @@ static Bool parseTextColor( char *token, WinInstanceData *instData, // parseStaticTextData ======================================================== /** Parse static text data entry */ //============================================================================= -static Bool parseStaticTextData( char *token, WinInstanceData *instData, +static Bool parseStaticTextData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { TextData *textData = (TextData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "CENTERED" c = strtok( buffer, seps ); // label @@ -1157,12 +1157,12 @@ static Bool parseStaticTextData( char *token, WinInstanceData *instData, // parseTextEntryData ========================================================= /** Parse text entry data entry */ //============================================================================= -static Bool parseTextEntryData( char *token, WinInstanceData *instData, +static Bool parseTextEntryData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { EntryData *entryData = (EntryData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; // "MAXLEN" c = strtok( buffer, seps ); // label @@ -1196,12 +1196,12 @@ static Bool parseTextEntryData( char *token, WinInstanceData *instData, // parseTabControlData ========================================================= /** Parse tab control data entry */ //============================================================================= -static Bool parseTabControlData( char *token, WinInstanceData *instData, +static Bool parseTabControlData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { TabControlData *tabControlData = (TabControlData *)data; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; //TABORIENTATION c = strtok( buffer, seps ); // label @@ -1251,7 +1251,7 @@ static Bool parseTabControlData( char *token, WinInstanceData *instData, // parseDrawData ============================================================== /** Parse set of draw data elements */ //============================================================================= -static Bool parseDrawData( char *token, WinInstanceData *instData, +static Bool parseDrawData( const char *token, WinInstanceData *instData, char *buffer, void *data ) { Int i; @@ -1259,7 +1259,7 @@ static Bool parseDrawData( char *token, WinInstanceData *instData, WinDrawData *drawData; Bool first = TRUE; char *c; - char *seps = " :,\n\r\t"; + const char *seps = " :,\n\r\t"; for( i = 0; i < MAX_DRAW_DATA; i++ ) { @@ -1600,15 +1600,15 @@ static void setWindowText( GameWindow *window, AsciiString textLabel ) //Translate the text theText = TheGameText->fetch( (char *)textLabel.str()); // set the text in the window based on what it is - if( BitTest( window->winGetStyle(), GWS_PUSH_BUTTON ) ) + if( BitIsSet( window->winGetStyle(), GWS_PUSH_BUTTON ) ) GadgetButtonSetText( window, theText ); - else if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) GadgetRadioSetText( window, theText ); - else if( BitTest( window->winGetStyle(), GWS_CHECK_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_CHECK_BOX ) ) GadgetCheckBoxSetText( window, theText ); - else if( BitTest( window->winGetStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( window->winGetStyle(), GWS_STATIC_TEXT ) ) GadgetStaticTextSetText( window, theText ); - else if( BitTest( window->winGetStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( window->winGetStyle(), GWS_ENTRY_FIELD ) ) { entryText.translate(textLabel); GadgetTextEntrySetText( window, entryText ); @@ -2154,7 +2154,7 @@ static Bool parseChildWindows( GameWindow *window, //The gadget with children needs to delete its default created children in favor //of the ones from the script file. So kill them before reading. - if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) { GameWindow *nextWindow = NULL; for( GameWindow *myChild = window->winGetChild(); myChild; myChild = nextWindow ) @@ -2251,7 +2251,7 @@ static Bool parseChildWindows( GameWindow *window, } - if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) GadgetTabControlFixupSubPaneList( window );//all children created, so re-fill SubPane array with children return TRUE; @@ -2516,10 +2516,10 @@ static GameWindow *parseWindow( File *inFile, char *buffer ) //------------------------------------------------------------------------------------------------- /** Parse init for layout file */ //------------------------------------------------------------------------------------------------- -Bool parseInit( char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) +Bool parseInit( const char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) { char *c; - char *seps = " \n\r\t"; + const char *seps = " \n\r\t"; // get string c = strtok( buffer, seps ); @@ -2535,10 +2535,10 @@ Bool parseInit( char *token, char *buffer, UnsignedInt version, WindowLayoutInfo //------------------------------------------------------------------------------------------------- /** Parse update for layout file */ //------------------------------------------------------------------------------------------------- -Bool parseUpdate( char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) +Bool parseUpdate( const char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) { char *c; - char *seps = " \n\r\t"; + const char *seps = " \n\r\t"; // get string c = strtok( buffer, seps ); @@ -2554,10 +2554,10 @@ Bool parseUpdate( char *token, char *buffer, UnsignedInt version, WindowLayoutIn //------------------------------------------------------------------------------------------------- /** Parse shutdown for layout file */ //------------------------------------------------------------------------------------------------- -Bool parseShutdown( char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) +Bool parseShutdown( const char *token, char *buffer, UnsignedInt version, WindowLayoutInfo *info ) { char *c; - char *seps = " \n\r\t"; + const char *seps = " \n\r\t"; // get string c = strtok( buffer, seps ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp index 87fbb59237..16b5d35ad5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp @@ -2198,7 +2198,7 @@ static void drawTypeText( GameWindow *window, DisplayString *str) wordWrap = size.x - 10; text->setWordWrap(wordWrap); str->setWordWrap(wordWrap); - if( BitTest(window->winGetStatus(), WIN_STATUS_WRAP_CENTERED) ) + if( BitIsSet(window->winGetStatus(), WIN_STATUS_WRAP_CENTERED) ) { str->setWordWrapCentered(TRUE); text->setWordWrapCentered(TRUE); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 10b71906ee..a56dec0baf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -47,7 +47,6 @@ #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine -#include "Windows.h" #include "mbstring.h" #include "Common/Debug.h" diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index d62815a27e..91b2f6eb2f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -416,7 +416,8 @@ void SinglePlayerLoadScreen::init( GameInfo *game ) Mission *mission = TheCampaignManager->getCurrentMission(); AsciiString lineName; - for(Int i = 0; i < MAX_OBJECTIVE_LINES; ++i) + Int i = 0; + for(; i < MAX_OBJECTIVE_LINES; ++i) { lineName.format("SinglePlayerLoadScreen.wnd:StaticTextLine%d",i); m_objectiveLines[i] = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( lineName )); @@ -1388,7 +1389,8 @@ void MultiPlayerLoadScreen::init( GameInfo *game ) //DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); GameWindow *teamWin[MAX_SLOTS]; - for (Int i = 0; i < MAX_SLOTS; ++i) + Int i = 0; + for (; i < MAX_SLOTS; ++i) { teamWin[i] = NULL; } @@ -1640,7 +1642,8 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); GadgetStaticTextSetText( m_nameLocalGeneral, localName ); GameWindow *teamWin[MAX_SLOTS]; - for (Int i = 0; i < MAX_SLOTS; ++i) + Int i = 0; + for (; i < MAX_SLOTS; ++i) { teamWin[i] = NULL; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp index 2eef0bfead..fd79473f45 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp @@ -88,7 +88,7 @@ ProcessAnimateWindowSlideFromRight::ProcessAnimateWindowSlideFromRight( void ) ProcessAnimateWindowSlideFromRight::~ProcessAnimateWindowSlideFromRight( void ) { } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSlideFromRight::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromRight::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -106,7 +106,7 @@ void ProcessAnimateWindowSlideFromRight::initReverseAnimateWindow( AnimateWindow } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSlideFromRight::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromRight::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -151,7 +151,7 @@ void ProcessAnimateWindowSlideFromRight::initAnimateWindow( AnimateWindow *animW //----------------------------------------------------------------------------- -Bool ProcessAnimateWindowSlideFromRight::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromRight::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -199,7 +199,7 @@ Bool ProcessAnimateWindowSlideFromRight::updateAnimateWindow( AnimateWindow *ani return FALSE; } -Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -272,7 +272,7 @@ ProcessAnimateWindowSlideFromLeft::ProcessAnimateWindowSlideFromLeft( void ) ProcessAnimateWindowSlideFromLeft::~ProcessAnimateWindowSlideFromLeft( void ) { } -void ProcessAnimateWindowSlideFromLeft::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromLeft::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -288,7 +288,7 @@ void ProcessAnimateWindowSlideFromLeft::initReverseAnimateWindow( AnimateWindow } -void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -328,7 +328,7 @@ void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( AnimateWindow *animWi animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0); } -Bool ProcessAnimateWindowSlideFromLeft::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromLeft::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -377,7 +377,7 @@ Bool ProcessAnimateWindowSlideFromLeft::updateAnimateWindow( AnimateWindow *anim return FALSE; } -Bool ProcessAnimateWindowSlideFromLeft::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromLeft::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -450,7 +450,7 @@ ProcessAnimateWindowSlideFromTop::ProcessAnimateWindowSlideFromTop( void ) ProcessAnimateWindowSlideFromTop::~ProcessAnimateWindowSlideFromTop( void ) { } -void ProcessAnimateWindowSlideFromTop::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromTop::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -466,7 +466,7 @@ void ProcessAnimateWindowSlideFromTop::initReverseAnimateWindow( AnimateWindow * } -void ProcessAnimateWindowSlideFromTop::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromTop::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -506,7 +506,7 @@ void ProcessAnimateWindowSlideFromTop::initAnimateWindow( AnimateWindow *animWin animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0); } -Bool ProcessAnimateWindowSlideFromTop::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromTop::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -556,7 +556,7 @@ Bool ProcessAnimateWindowSlideFromTop::updateAnimateWindow( AnimateWindow *animW return FALSE; } -Bool ProcessAnimateWindowSlideFromTop::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromTop::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -629,7 +629,7 @@ ProcessAnimateWindowSlideFromBottom::ProcessAnimateWindowSlideFromBottom( void ) ProcessAnimateWindowSlideFromBottom::~ProcessAnimateWindowSlideFromBottom( void ) { } -void ProcessAnimateWindowSlideFromBottom::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromBottom::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -646,7 +646,7 @@ void ProcessAnimateWindowSlideFromBottom::initReverseAnimateWindow( AnimateWindo } -void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -686,7 +686,7 @@ void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( AnimateWindow *anim animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0); } -Bool ProcessAnimateWindowSlideFromBottom::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromBottom::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -736,7 +736,7 @@ Bool ProcessAnimateWindowSlideFromBottom::updateAnimateWindow( AnimateWindow *an return FALSE; } -Bool ProcessAnimateWindowSlideFromBottom::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromBottom::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -804,7 +804,7 @@ ProcessAnimateWindowSlideFromBottomTimed::ProcessAnimateWindowSlideFromBottomTim ProcessAnimateWindowSlideFromBottomTimed::~ProcessAnimateWindowSlideFromBottomTimed( void ) { } -void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -845,7 +845,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( Animate } -void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -886,7 +886,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( AnimateWindow animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now + delay, now + m_maxDuration + delay); } -Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -942,7 +942,7 @@ Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( AnimateWindo return FALSE; } -Bool ProcessAnimateWindowSlideFromBottomTimed::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromBottomTimed::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { return updateAnimateWindow(animWin); } @@ -962,7 +962,7 @@ ProcessAnimateWindowSpiral::ProcessAnimateWindowSpiral( void ) ProcessAnimateWindowSpiral::~ProcessAnimateWindowSpiral( void ) { } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSpiral::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSpiral::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -979,7 +979,7 @@ void ProcessAnimateWindowSpiral::initReverseAnimateWindow( AnimateWindow *animWi } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSpiral::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSpiral::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -1020,7 +1020,7 @@ void ProcessAnimateWindowSpiral::initAnimateWindow( AnimateWindow *animWin ) } //----------------------------------------------------------------------------- -Bool ProcessAnimateWindowSpiral::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSpiral::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -1074,7 +1074,7 @@ Bool ProcessAnimateWindowSpiral::updateAnimateWindow( AnimateWindow *animWin ) } //----------------------------------------------------------------------------- -Bool ProcessAnimateWindowSpiral::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSpiral::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -1143,7 +1143,7 @@ ProcessAnimateWindowSlideFromTopFast::ProcessAnimateWindowSlideFromTopFast( void ProcessAnimateWindowSlideFromTopFast::~ProcessAnimateWindowSlideFromTopFast( void ) { } -void ProcessAnimateWindowSlideFromTopFast::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromTopFast::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -1159,7 +1159,7 @@ void ProcessAnimateWindowSlideFromTopFast::initReverseAnimateWindow( AnimateWind } -void ProcessAnimateWindowSlideFromTopFast::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromTopFast::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -1202,7 +1202,7 @@ void ProcessAnimateWindowSlideFromTopFast::initAnimateWindow( AnimateWindow *ani animWin->setAnimData(startPos, endPos, curPos, restPos, vel, timeGetTime() + animWin->getDelay(), 0); } -Bool ProcessAnimateWindowSlideFromTopFast::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromTopFast::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -1252,7 +1252,7 @@ Bool ProcessAnimateWindowSlideFromTopFast::updateAnimateWindow( AnimateWindow *a return FALSE; } -Bool ProcessAnimateWindowSlideFromTopFast::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromTopFast::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -1328,7 +1328,7 @@ ProcessAnimateWindowSlideFromRightFast::ProcessAnimateWindowSlideFromRightFast( ProcessAnimateWindowSlideFromRightFast::~ProcessAnimateWindowSlideFromRightFast( void ) { } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSlideFromRightFast::initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay ) +void ProcessAnimateWindowSlideFromRightFast::initReverseAnimateWindow( wnd::AnimateWindow *animWin, UnsignedInt maxDelay ) { if(!animWin) { @@ -1363,7 +1363,7 @@ void ProcessAnimateWindowSlideFromRightFast::initReverseAnimateWindow( AnimateWi } //----------------------------------------------------------------------------- -void ProcessAnimateWindowSlideFromRightFast::initAnimateWindow( AnimateWindow *animWin ) +void ProcessAnimateWindowSlideFromRightFast::initAnimateWindow( wnd::AnimateWindow *animWin ) { ICoord2D restPos = {0,0}; ICoord2D startPos = {0,0}; @@ -1410,7 +1410,7 @@ void ProcessAnimateWindowSlideFromRightFast::initAnimateWindow( AnimateWindow *a //----------------------------------------------------------------------------- -Bool ProcessAnimateWindowSlideFromRightFast::updateAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromRightFast::updateAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) @@ -1458,7 +1458,7 @@ Bool ProcessAnimateWindowSlideFromRightFast::updateAnimateWindow( AnimateWindow return FALSE; } -Bool ProcessAnimateWindowSlideFromRightFast::reverseAnimateWindow( AnimateWindow *animWin ) +Bool ProcessAnimateWindowSlideFromRightFast::reverseAnimateWindow( wnd::AnimateWindow *animWin ) { if(!animWin) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index e6d7a8e017..21be7ea196 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -1120,7 +1120,8 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) GlobalMemoryStatus(&before); extern std::vector debrisModelNamesGlobalHack; - for (Int i=0; ipreloadModelAssets(debrisModelNamesGlobalHack[i]); } @@ -1147,7 +1148,7 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); - char *textureNames[] = { + const char *textureNames[] = { "ptspruce01.tga", "exrktflame.tga", "cvlimo3_d2.tga", diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 305ea9f554..1fa290fa39 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2257,7 +2257,7 @@ void InGameUI::createMouseoverHint( const GameMessage *msg ) } // check to see if it or any of its parents are opaque. If so, we can't select anything. - if (!BitTest( window->winGetStatus(), WIN_STATUS_SEE_THRU )) + if (!BitIsSet( window->winGetStatus(), WIN_STATUS_SEE_THRU )) { underWindow = true; break; @@ -2579,7 +2579,7 @@ void InGameUI::createCommandHint( const GameMessage *msg ) } // check to see if it or any of its parents are opaque. If so, we can't select anything. - if (!BitTest( window->winGetStatus(), WIN_STATUS_SEE_THRU )) + if (!BitIsSet( window->winGetStatus(), WIN_STATUS_SEE_THRU )) { underWindow = true; break; @@ -2774,7 +2774,7 @@ void InGameUI::createCommandHint( const GameMessage *msg ) m_pendingGUICommand->getSpecialPowerTemplate(), m_pendingGUICommand->getWeaponSlot()); } - else if( BitTest( m_pendingGUICommand->getOptions(), COMMAND_OPTION_NEED_TARGET ) ) + else if( BitIsSet( m_pendingGUICommand->getOptions(), COMMAND_OPTION_NEED_TARGET ) ) { Int index = TheMouse->getCursorIndex(m_pendingGUICommand->getCursorName()); if (index != Mouse::INVALID_MOUSE_CURSOR) @@ -2895,7 +2895,7 @@ void InGameUI::setGUICommand( const CommandButton *command ) if( command ) { - if( BitTest( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) == FALSE ) + if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) == FALSE ) { DEBUG_ASSERTCRASH( 0, ("setGUICommand: Command '%s' does not need additional user interaction\n", @@ -2918,7 +2918,7 @@ void InGameUI::setGUICommand( const CommandButton *command ) m_pendingGUICommand = command; // set the mouse cursor for commands that need a targeting or to normal with no command - if( command && BitTest( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) && !command->isContextCommand() ) + if( command && BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) && !command->isContextCommand() ) { setMouseCursor( Mouse::ARROW );// This occurs on the mouse-up of a panel button, so make an arrow // the mouseoverhint code will take care of the cursor context, once the mouse leaves the panel @@ -4438,8 +4438,8 @@ Bool InGameUI::canSelectedObjectsDoSpecialPower( const CommandButton *command, c //1) NO TARGET OR POS //2) COMMAND_OPTION_NEED_OBJECT_TARGET //3) NEED_TARGET_POS - Bool doAtPosition = BitTest( command->getOptions(), NEED_TARGET_POS ); - Bool doAtObject = BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ); + Bool doAtPosition = BitIsSet( command->getOptions(), NEED_TARGET_POS ); + Bool doAtObject = BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ); //Sanity checks if( doAtObject && !objectToInteractWith ) @@ -4562,8 +4562,8 @@ Bool InGameUI::canSelectedObjectsEffectivelyUseWeapon( const CommandButton *comm //1) NO TARGET OR POS //2) COMMAND_OPTION_NEED_OBJECT_TARGET //3) NEED_TARGET_POS - Bool doAtPosition = BitTest( command->getOptions(), NEED_TARGET_POS ); - Bool doAtObject = BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ); + Bool doAtPosition = BitIsSet( command->getOptions(), NEED_TARGET_POS ); + Bool doAtObject = BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ); //Sanity checks if( doAtObject && !objectToInteractWith ) @@ -5365,8 +5365,8 @@ void InGameUI::updateAndDrawWorldAnimations( void ) // the expire frame // if( TheGameLogic->getFrame() >= wad->m_expireFrame || - (BitTest( wad->m_options, WORLD_ANIM_PLAY_ONCE_AND_DESTROY ) && - BitTest( wad->m_anim->getStatus(), ANIM_2D_STATUS_COMPLETE )) ) + (BitIsSet( wad->m_options, WORLD_ANIM_PLAY_ONCE_AND_DESTROY ) && + BitIsSet( wad->m_anim->getStatus(), ANIM_2D_STATUS_COMPLETE )) ) { // delete this element and continue @@ -5397,7 +5397,7 @@ void InGameUI::updateAndDrawWorldAnimations( void ) } // end if // update translucency value - if( BitTest( wad->m_options, WORLD_ANIM_FADE_ON_EXPIRE ) ) + if( BitIsSet( wad->m_options, WORLD_ANIM_FADE_ON_EXPIRE ) ) { // see if we should be setting the translucency value diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index c0d68ce764..761ca5ef0e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -60,14 +60,14 @@ void Keyboard::createStreamMessages( void ) { // add message to stream - if( BitTest( key->state, KEY_STATE_DOWN ) ) + if( BitIsSet( key->state, KEY_STATE_DOWN ) ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_DOWN ); DEBUG_ASSERTCRASH( msg, ("Unable to append key down message to stream\n") ); } // end if - else if( BitTest( key->state, KEY_STATE_UP ) ) + else if( BitIsSet( key->state, KEY_STATE_UP ) ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_UP ); @@ -144,8 +144,8 @@ void Keyboard::updateKeys( void ) // prevent ALT-TAB from causing a TAB event if( m_keys[ index ].key == KEY_TAB ) { - if( BitTest( m_keyStatus[ KEY_LALT ].state, KEY_STATE_DOWN ) || - BitTest( m_keyStatus[ KEY_RALT ].state, KEY_STATE_DOWN ) ) + if( BitIsSet( m_keyStatus[ KEY_LALT ].state, KEY_STATE_DOWN ) || + BitIsSet( m_keyStatus[ KEY_RALT ].state, KEY_STATE_DOWN ) ) { m_keys[index].status = KeyboardIO::STATUS_USED; } @@ -216,7 +216,7 @@ Bool Keyboard::checkKeyRepeat( void ) for( key = 0; key < 256; key++ ) { - if( BitTest( m_keyStatus[ key ].state, KEY_STATE_DOWN ) ) + if( BitIsSet( m_keyStatus[ key ].state, KEY_STATE_DOWN ) ) { if( (m_inputFrame - m_keyStatus[ key ].sequence) > Keyboard::KEY_REPEAT_DELAY ) @@ -976,7 +976,7 @@ Bool Keyboard::isAlt() WideChar Keyboard::getPrintableKey( UnsignedByte key, Int state ) { if((key < 0 || key >=KEY_NAMES_COUNT) || ( state < 0 || state >= MAX_KEY_STATES)) - return L''; + return L'\0'; if(state == 0) return m_keyNames[key].stdKey; else if(state == 1) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp index 8392564d41..a69c8755ff 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp @@ -1088,7 +1088,7 @@ Int Mouse::getCursorIndex(const AsciiString& name) /** @todo This is silly to have to define these names from INI in the code ... * that should be changed (CBD) */ - static char *CursorININames[NUM_MOUSE_CURSORS] = + static const char *CursorININames[NUM_MOUSE_CURSORS] = { //"InvalidMouseCursor", // this entry is not actually a mouse cursor, but just a // reminder that it does exist diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp index 9dc7274a23..2cb9c05c9a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp @@ -159,14 +159,14 @@ void LanguageFilter::unHaxor(UnicodeString &word) { } // returning true means that there are more words in the file. -Bool LanguageFilter::readWord(File *file1, UnsignedShort *buf) { +Bool LanguageFilter::readWord(File *file1, WideChar *buf) { Int index = 0; Bool retval = TRUE; Int val = 0; - UnsignedShort c; + WideChar c; - val = file1->read(&c, sizeof(UnsignedShort)); + val = file1->read(&c, sizeof(WideChar)); if ((val == -1) || (val == 0)) { buf[index] = 0; return FALSE; @@ -175,7 +175,7 @@ Bool LanguageFilter::readWord(File *file1, UnsignedShort *buf) { while (buf[index] != L' ') { ++index; - val = file1->read(&c, sizeof(UnsignedShort)); + val = file1->read(&c, sizeof(WideChar)); if ((val == -1) || (val == 0)) { c = WEOF; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp index 052e47a85b..d849246a86 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp @@ -69,7 +69,7 @@ //------------------------------------------------------------------------------- // PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -static char *mapExtension = ".map"; +static const char *mapExtension = ".map"; static Int m_width = 0; ///< Height map width. static Int m_height = 0; ///< Height map height (y size of array). diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 6b0fcc6934..02fd3145c3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -1052,7 +1052,7 @@ GameMessage::Type CommandTranslator::issueSpecialPowerCommand( const CommandButt Drawable* sourceDraw = ignoreSelObj ? ignoreSelObj->getDrawable() : TheInGameUI->getFirstSelectedDrawable(); ObjectID specificSource = ignoreSelObj ? ignoreSelObj->getID() : INVALID_ID; - if( BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { // OBJECT BASED SPECIAL if (!command->isValidObjectTarget(sourceDraw, target)) @@ -1076,7 +1076,7 @@ GameMessage::Type CommandTranslator::issueSpecialPowerCommand( const CommandButt } } - else if( BitTest( command->getOptions(), NEED_TARGET_POS ) ) + else if( BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { //LOCATION BASED SPECIAL msgType = GameMessage::MSG_DO_SPECIAL_POWER_AT_LOCATION; @@ -1157,7 +1157,7 @@ GameMessage::Type CommandTranslator::issueCombatDropCommand( const CommandButton return GameMessage::MSG_INVALID; } - if( target != NULL && BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( target != NULL && BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { // OBJECT BASED SPECIAL @@ -1174,7 +1174,7 @@ GameMessage::Type CommandTranslator::issueCombatDropCommand( const CommandButton } return msgType; } - else if ( BitTest( command->getOptions(), NEED_TARGET_POS ) ) + else if ( BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { GameMessage::Type msgType = GameMessage::MSG_COMBATDROP_AT_LOCATION; if( commandType == DO_COMMAND ) @@ -1201,7 +1201,7 @@ GameMessage::Type CommandTranslator::issueFireWeaponCommand( const CommandButton return msgType; } - if( BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { //OBJECT BASED FIRE WEAPON if (!target || !target->getObject()) @@ -1210,7 +1210,7 @@ GameMessage::Type CommandTranslator::issueFireWeaponCommand( const CommandButton if (!command->isValidObjectTarget(TheInGameUI->getFirstSelectedDrawable(), target)) return msgType; - if( BitTest( command->getOptions(), ATTACK_OBJECTS_POSITION ) ) + if( BitIsSet( command->getOptions(), ATTACK_OBJECTS_POSITION ) ) { //Actually, you know what.... we want to attack the object's location instead. msgType = GameMessage::MSG_DO_WEAPON_AT_LOCATION; @@ -1246,7 +1246,7 @@ GameMessage::Type CommandTranslator::issueFireWeaponCommand( const CommandButton } } } - else if( BitTest( command->getOptions(), NEED_TARGET_POS ) ) + else if( BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { //LOCATION BASED FIRE WEAPON msgType = GameMessage::MSG_DO_WEAPON_AT_LOCATION; @@ -1505,7 +1505,7 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw, || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT)) { - if( obj && obj->isKindOf( KINDOF_SHRUBBERY ) && !BitTest( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) ) + if( obj && obj->isKindOf( KINDOF_SHRUBBERY ) && !BitIsSet( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) ) { //If our object is a shrubbery, and we don't allow targetting it... then null it out. //Nulling out the draw and obj pointer will force the remainder of this code to evaluate @@ -1514,7 +1514,7 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw, obj = NULL; } - if( obj && obj->isKindOf( KINDOF_MINE ) && !BitTest( command->getOptions(), ALLOW_MINE_TARGET ) ) + if( obj && obj->isKindOf( KINDOF_MINE ) && !BitIsSet( command->getOptions(), ALLOW_MINE_TARGET ) ) { //If our object is a mine, and we don't allow targetting it... then null it out. //Nulling out the draw and obj pointer will force the remainder of this code to evaluate @@ -1526,27 +1526,27 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw, //Kris: September 27, 2002 //Added relationship tests to make sure we're not attempting a context-command on a restricted relationship. //This case prevents rebels from using tranq darts on allies. - if( obj && BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( obj && BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { Relationship relationship = ThePlayerList->getLocalPlayer()->getRelationship( obj->getTeam() ); switch( relationship ) { case ALLIES: - if( !BitTest( command->getOptions(), NEED_TARGET_ALLY_OBJECT ) ) + if( !BitIsSet( command->getOptions(), NEED_TARGET_ALLY_OBJECT ) ) { draw = NULL; obj = NULL; } break; case ENEMIES: - if( !BitTest( command->getOptions(), NEED_TARGET_ENEMY_OBJECT ) ) + if( !BitIsSet( command->getOptions(), NEED_TARGET_ENEMY_OBJECT ) ) { draw = NULL; obj = NULL; } break; case NEUTRAL: - if( !BitTest( command->getOptions(), NEED_TARGET_NEUTRAL_OBJECT ) ) + if( !BitIsSet( command->getOptions(), NEED_TARGET_NEUTRAL_OBJECT ) ) { draw = NULL; obj = NULL; @@ -4054,7 +4054,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------------------- case GameMessage::MSG_META_DEMO_TOGGLE_BW_VIEW: { //We're not testing BW mode anymore, so use this message for toggling wireframe mode. - static mode=0; + static Int mode=0; if (mode == 0) { //First turn on wireframe TheTacticalView->set3DWireFrameMode(TRUE); @@ -5031,7 +5031,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage QueryPerformanceCounter((LARGE_INTEGER *)&startTime64); QueryPerformanceFrequency((LARGE_INTEGER *)&freq64); Int numberLookups = 10000; - for( Int testindex = 1; testindex < numberLookups; testindex++ ) + Int testindex = 1; + for( ; testindex < numberLookups; testindex++ ) { Object *objPtr = TheGameLogic->findObjectByID((ObjectID)testindex); objPtr++; @@ -5081,7 +5082,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage QueryPerformanceCounter((LARGE_INTEGER *)&startTime64); QueryPerformanceFrequency((LARGE_INTEGER *)&freq64); Int numberLookups = 10000; - for( Int testindex = 1; testindex < numberLookups; testindex++ ) + Int testindex = 1; + for( ; testindex < numberLookups; testindex++ ) { Drawable *drawPtr = TheGameClient->findDrawableByID((DrawableID)testindex); drawPtr++; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp index bdf1859f7b..a1d656d9e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -141,7 +141,7 @@ static CommandStatus doFireWeaponCommand( const CommandButton *command, const IC // create message and send to the logic GameMessage *msg; - if( BitTest( command->getOptions(), NEED_TARGET_POS ) ) + if( BitIsSet( command->getOptions(), NEED_TARGET_POS ) ) { Coord3D world; @@ -161,16 +161,16 @@ static CommandStatus doFireWeaponCommand( const CommandButton *command, const IC } // end if - else if( BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + else if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { // setup the pick type ... some commands allow us to target shrubbery PickType pickType = PICK_TYPE_SELECTABLE; - if( BitTest( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) == TRUE ) + if( BitIsSet( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) == TRUE ) pickType = (PickType)((Int)pickType | (Int)PICK_TYPE_SHRUBBERY); - if( BitTest( command->getOptions(), ALLOW_MINE_TARGET ) == TRUE ) + if( BitIsSet( command->getOptions(), ALLOW_MINE_TARGET ) == TRUE ) pickType = (PickType)((Int)pickType | (Int)PICK_TYPE_MINES); // get the target object under the cursor @@ -219,7 +219,7 @@ static CommandStatus doGuardCommand( const CommandButton *command, GuardMode gua GameMessage *msg = NULL; - if ( msg == NULL && BitTest( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if ( msg == NULL && BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { // get the target object under the cursor Object* target = validUnderCursor( mouse, command, PICK_TYPE_SELECTABLE ); @@ -235,7 +235,7 @@ static CommandStatus doGuardCommand( const CommandButton *command, GuardMode gua if( msg == NULL ) { Coord3D world; - if (BitTest( command->getOptions(), NEED_TARGET_POS )) + if (BitIsSet( command->getOptions(), NEED_TARGET_POS )) { // translate the mouse location into world coords TheTacticalView->screenToTerrain( mouse, &world ); @@ -416,7 +416,7 @@ GameMessageDisposition GUICommandTranslator::translateGameMessage(const GameMess //--------------------------------------------------------------------------------------- case GUI_COMMAND_EVACUATE: { - if (BitTest(command->getOptions(), NEED_TARGET_POS)) { + if (BitIsSet(command->getOptions(), NEED_TARGET_POS)) { Coord3D worldPos; TheTacticalView->screenToTerrain(&mouse, &worldPos); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp index 5b4e658d8f..3ac00d84b8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp @@ -171,9 +171,9 @@ Bool HotKeyManager::executeHotKey( const AsciiString& keyIn ) GameWindow *win = it->second.m_win; if( !win ) return FALSE; - if( !BitTest( win->winGetStatus(), WIN_STATUS_HIDDEN ) ) + if( !BitIsSet( win->winGetStatus(), WIN_STATUS_HIDDEN ) ) { - if( BitTest( win->winGetStatus(), WIN_STATUS_ENABLED ) ) + if( BitIsSet( win->winGetStatus(), WIN_STATUS_ENABLED ) ) { TheWindowManager->winSendSystemMsg( win->winGetParent(), GBM_SELECTED, (WindowMsgData)win, win->winGetWindowId() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp index ee18ed1849..ccd835bfc7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp @@ -28,8 +28,6 @@ #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine -#include "windows.h" - #include "Common/GameType.h" #include "Common/MessageStream.h" #include "Common/Player.h" @@ -174,7 +172,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage // get key and state from args UnsignedByte key = msg->getArgument( 0 )->integer; UnsignedByte state = msg->getArgument( 1 )->integer; - Bool isPressed = !(BitTest( state, KEY_STATE_UP )); + Bool isPressed = !(BitIsSet( state, KEY_STATE_UP )); if (TheShell && TheShell->isShellActive()) break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 82be60e109..2ef2f2bfa5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -168,7 +168,7 @@ Bool CanSelectDrawable( const Drawable *draw, Bool dragSelecting ) while (window) { // check to see if it or any of its parents are opaque. If so, we can't select anything. - if (!BitTest( window->winGetStatus(), WIN_STATUS_SEE_THRU )) + if (!BitIsSet( window->winGetStatus(), WIN_STATUS_SEE_THRU )) { return FALSE; } @@ -487,7 +487,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa // Single point. If there's a unit in there, double click will select all of them. if (region.height() == 0 && region.width() == 0) { - Bool selectAcrossMap = (BitTest(modifiers, KEY_STATE_ALT) ? TRUE : FALSE); + Bool selectAcrossMap = (BitIsSet(modifiers, KEY_STATE_ALT) ? TRUE : FALSE); // only allow things that are selectable. Also, we aren't allowed to Drawable *picked = TheTacticalView->pickDrawable( ®ion.lo, FALSE, PICK_TYPE_SELECTABLE); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp index 21afee1d15..06f705ac15 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp @@ -323,7 +323,7 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage // If we're in a movie, we want to be able to escape out of it if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) - && (BitTest( state, KEY_STATE_UP )) + && (BitIsSet( state, KEY_STATE_UP )) && TheDisplay->isMoviePlaying() && TheGlobalData->m_allowExitOutOfMovies == TRUE ) { @@ -333,7 +333,7 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage if(returnCode != WIN_INPUT_USED && (key == KEY_ESC) - && (BitTest( state, KEY_STATE_UP )) + && (BitIsSet( state, KEY_STATE_UP )) && (TheInGameUI && (TheInGameUI->getInputEnabled() == FALSE)) ) { returnCode = WIN_INPUT_USED; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp index e8b862d668..4a0d4eeb0f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp @@ -263,11 +263,11 @@ UnsignedInt getPickTypesForContext( Bool forceAttackMode ) const CommandButton *command = TheInGameUI->getGUICommand(); if (command != NULL) { - if (BitTest( command->getOptions(), ALLOW_MINE_TARGET)) { + if (BitIsSet( command->getOptions(), ALLOW_MINE_TARGET)) { types |= PICK_TYPE_MINES; } - if (BitTest( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) ) { + if (BitIsSet( command->getOptions(), ALLOW_SHRUBBERY_TARGET ) ) { types |= PICK_TYPE_SHRUBBERY; } } else { @@ -309,7 +309,7 @@ UnsignedInt getPickTypesForCurrentSelection( Bool forceAttackMode ) } // For efficiency. - if (BitTest(retVal, PICK_TYPE_MINES | PICK_TYPE_SHRUBBERY)) { + if (BitIsSet(retVal, PICK_TYPE_MINES | PICK_TYPE_SHRUBBERY)) { break; } } @@ -321,19 +321,19 @@ UnsignedInt getPickTypesForCurrentSelection( Bool forceAttackMode ) //------------------------------------------------------------------------------------------------- void translatePickTypesToKindof(UnsignedInt pickTypes, KindOfMaskType& outMask) { - if (BitTest(pickTypes, PICK_TYPE_SELECTABLE)) { + if (BitIsSet(pickTypes, PICK_TYPE_SELECTABLE)) { outMask.set(KINDOF_SELECTABLE); } - if (BitTest(pickTypes, PICK_TYPE_SHRUBBERY)) { + if (BitIsSet(pickTypes, PICK_TYPE_SHRUBBERY)) { outMask.set(KINDOF_SHRUBBERY); } - if (BitTest(pickTypes, PICK_TYPE_MINES)) { + if (BitIsSet(pickTypes, PICK_TYPE_MINES)) { outMask.set(KINDOF_MINE); } - if (BitTest(pickTypes, PICK_TYPE_FORCEATTACKABLE)) { + if (BitIsSet(pickTypes, PICK_TYPE_FORCEATTACKABLE)) { outMask.set(KINDOF_FORCEATTACKABLE); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 690c12cc70..7c4a8c0117 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -506,7 +506,7 @@ void Anim2D::tryNextFrame( void ) case ANIM_2D_PING_PONG_BACKWARDS: { - if( BitTest( m_status, ANIM_2D_STATUS_REVERSED ) ) + if( BitIsSet( m_status, ANIM_2D_STATUS_REVERSED ) ) { // // decrement frame, unless we're at frame 0 in which case we @@ -645,7 +645,7 @@ void Anim2D::draw( Int x, Int y ) // frame numbers for animation instances that are registered with a system as the // system will update them during its update phase // - if( m_collectionSystem == NULL && BitTest( m_status, ANIM_2D_STATUS_FROZEN ) == FALSE ) + if( m_collectionSystem == NULL && BitIsSet( m_status, ANIM_2D_STATUS_FROZEN ) == FALSE ) tryNextFrame(); } // end draw @@ -673,7 +673,7 @@ void Anim2D::draw( Int x, Int y, Int width, Int height ) // frame numbers for animation instances that are registered with a system as the // system will update them during its update phase // - if( m_collectionSystem == NULL && BitTest( m_status, ANIM_2D_STATUS_FROZEN ) == FALSE ) + if( m_collectionSystem == NULL && BitIsSet( m_status, ANIM_2D_STATUS_FROZEN ) == FALSE ) tryNextFrame(); } // end draw @@ -776,7 +776,7 @@ void Anim2DCollection::update( void ) { // try to update the frame - if( BitTest( anim->getStatus(), ANIM_2D_STATUS_FROZEN ) == FALSE ) + if( BitIsSet( anim->getStatus(), ANIM_2D_STATUS_FROZEN ) == FALSE ) anim->tryNextFrame(); } // end for, anim diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp index 99402ebadb..f7d3310c53 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/DebugDisplay.cpp @@ -195,7 +195,7 @@ void DebugDisplay::setLeftMargin( Int leftPos ) // DebugDisplay::printf //============================================================================ -void DebugDisplay::printf( Char *format, ...) +void DebugDisplay::printf( const Char *format, ...) { va_list args; int result; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Image.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Image.cpp index 99cd8239e0..e0986fd2ca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Image.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Image.cpp @@ -120,7 +120,7 @@ void Image::parseImageStatus( INI* ini, void *instance, void *store, const void* // (see ImagePacker tool for more details) // UnsignedInt *theStatusBits = (UnsignedInt *)store; - if( BitTest( *theStatusBits, IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) + if( BitIsSet( *theStatusBits, IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) { Image *theImage = (Image *)instance; ICoord2D imageSize; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index 4d07a7326f..351cd79157 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -291,7 +291,8 @@ Particle::Particle( ParticleSystem *system, const ParticleInfo *info ) m_sizeRateDamping = info->m_sizeRateDamping; // set up alpha - for( int i=0; im_alphaKey[i]; m_alpha = m_alphaKey[0].value; @@ -1087,7 +1088,8 @@ ParticleSystem::ParticleSystem( const ParticleSystemTemplate *sysTemplate, m_sizeRate = sysTemplate->m_sizeRate; m_sizeRateDamping = sysTemplate->m_sizeRateDamping; - for( int i=0; im_alphaKey[i]; for( i=0; im_angularRateZ; mergeInfo.m_angularDamping = info->m_angularDamping; - for( int i=0; im_alphaKey[i]; for( i=0; isetSeismicZVelocity( centerX - radius + x, centerY - radius + y, MIN( 9.0f, workspace[ x + workspaceWidth * y ]) ); delete [] workspace; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index 40300cf685..95a499c52b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -3007,7 +3007,7 @@ void AIGroup::setAttitude( AttitudeType tude ) */ AttitudeType AIGroup::getAttitude( void ) const { - return AI_PASSIVE; + return ATTITUDE_PASSIVE; } void AIGroup::setMineClearingDetail( Bool set ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 34d57dfaed..d91851c8f3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1201,7 +1201,7 @@ PathfindCell::~PathfindCell( void ) { if (m_info) PathfindCellInfo::releaseACellInfo(m_info); m_info = NULL; - static warn = true; + static Bool warn = true; if (warn) { warn = false; DEBUG_LOG( ("PathfindCell::~PathfindCell m_info Allocated.")); @@ -6513,7 +6513,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe worldToCell( to, &cell ); if (!checkDestination(obj, cell.x, cell.y, destinationLayer, radius, centerInCell)) { - return false; + return NULL; } // determine start cell ICoord2D startCellNdx; @@ -6806,7 +6806,8 @@ Path *Pathfinder::buildGroundPath(Bool isCrusher, const Coord3D *fromPos, Pathfi color.blue = 0; color.red = color.green = 1; Coord3D pos; - for( PathNode *node = path->getFirstNode(); node; node = node->getNext() ) + PathNode *node = path->getFirstNode(); + for( ; node; node = node->getNext() ) { // create objects to show path - they decay @@ -8999,7 +9000,8 @@ Path *Pathfinder::buildActualPath( const Object *obj, LocomotorSurfaceTypeMask a color.blue = 0; color.red = color.green = 1; Coord3D pos; - for( PathNode *node = path->getFirstNode(); node; node = node->getNext() ) + PathNode *node = path->getFirstNode(); + for( ; node; node = node->getNext() ) { // create objects to show path - they decay @@ -10195,7 +10197,7 @@ if (g_UT_startTiming) return false; Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, Path *pathToAvoid, Object *otherObj2, Path *pathToAvoid2) { - if (m_isMapReady == false) return false; // Should always be ok. + if (m_isMapReady == false) return NULL; // Should always be ok. #if defined _DEBUG || defined _INTERNAL Int startTimeMS = ::GetTickCount(); #endif @@ -10227,9 +10229,9 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, worldToCell(&startPos, &startCellNdx); PathfindCell *parentCell = getClippedCell( obj->getLayer(), obj->getPosition() ); if (parentCell == NULL) - return false; + return NULL; if (!obj->getAIUpdateInterface()) { - return false; // shouldn't happen, but can't move it without an ai. + return NULL; // shouldn't happen, but can't move it without an ai. } const LocomotorSet& locomotorSet = obj->getAIUpdateInterface()->getLocomotorSet(); @@ -10250,7 +10252,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, } if (!parentCell->allocateInfo(startCellNdx)) { - return false; + return NULL; } parentCell->startPathfind(NULL); @@ -10401,15 +10403,15 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet //worldToCell(obj->getPosition(), &startCellNdx); PathfindCell *parentCell = getClippedCell( obj->getLayer(), ¤tPosition); if (parentCell == NULL) - return false; + return NULL; if (!obj->getAIUpdateInterface()) { - return false; // shouldn't happen, but can't move it without an ai. + return NULL; // shouldn't happen, but can't move it without an ai. } m_isTunneling = false; if (!parentCell->allocateInfo(startCellNdx)) { - return false; + return NULL; } parentCell->startPathfind( NULL); @@ -10546,7 +10548,7 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet candidateGoal->releaseInfo(); } cleanOpenAndClosedLists(); - return false; + return NULL; } @@ -10583,7 +10585,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot AS_INT(victimPos->x), AS_INT(victimPos->y), AS_INT(victimPos->z))); } */ - if (m_isMapReady == false) return false; // Should always be ok. + if (m_isMapReady == false) return NULL; // Should always be ok. #if defined _DEBUG || defined _INTERNAL // Int startTimeMS = ::GetTickCount(); #endif @@ -10668,14 +10670,14 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot worldToCell(&objPos, &startCellNdx); PathfindCell *parentCell = getClippedCell( obj->getLayer(), &objPos ); if (parentCell == NULL) - return false; + return NULL; if (!obj->getAIUpdateInterface()) { - return false; // shouldn't happen, but can't move it without an ai. + return NULL; // shouldn't happen, but can't move it without an ai. } const PathfindCell *startCell = parentCell; if (!parentCell->allocateInfo(startCellNdx)) { - return false; + return NULL; } parentCell->startPathfind(NULL); @@ -10689,7 +10691,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot return NULL; if (!goalCell->allocateInfo(victimCellNdx)) { - return false; + return NULL; } // initialize "open" list to contain start cell @@ -10902,7 +10904,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot goalCell->releaseInfo(); } cleanOpenAndClosedLists(); - return false; + return NULL; } /** Find a short, valid path to a location that is safe from the repulsors. */ @@ -10910,7 +10912,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor const Coord3D *from, const Coord3D* repulsorPos1, const Coord3D* repulsorPos2, Real repulsorRadius) { //CRCDEBUG_LOG(("Pathfinder::findSafePath()\n")); - if (m_isMapReady == false) return false; // Should always be ok. + if (m_isMapReady == false) return NULL; // Should always be ok. #if defined _DEBUG || defined _INTERNAL // Int startTimeMS = ::GetTickCount(); #endif @@ -10936,12 +10938,12 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor worldToCell(obj->getPosition(), &startCellNdx); PathfindCell *parentCell = getClippedCell( obj->getLayer(), obj->getPosition() ); if (parentCell == NULL) - return false; + return NULL; if (!obj->getAIUpdateInterface()) { - return false; // shouldn't happen, but can't move it without an ai. + return NULL; // shouldn't happen, but can't move it without an ai. } if (!parentCell->allocateInfo(startCellNdx)) { - return false; + return NULL; } parentCell->startPathfind( NULL); @@ -11060,7 +11062,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor #endif m_isTunneling = false; cleanOpenAndClosedLists(); - return false; + return NULL; } //----------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp index 2279fc0308..19b6170ebf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp @@ -721,7 +721,7 @@ UpdateSleepTime TurretAI::updateTurretAI() if (m_didFire) { // if we fired, enable sweeping for a few frames. - const ENABLE_SWEEP_FRAME_COUNT = 3; + const Int ENABLE_SWEEP_FRAME_COUNT = 3; m_enableSweepUntil = now + ENABLE_SWEEP_FRAME_COUNT; m_continuousFireExpirationFrame = now + ENABLE_SWEEP_FRAME_COUNT;// so the recent firing will not interrupt the moving sound } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp index 1bd0ff34c0..45cf9f7ad3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp @@ -310,7 +310,8 @@ void PolygonTrigger::addPolygonTrigger(PolygonTrigger *pTrigger) void PolygonTrigger::removePolygonTrigger(PolygonTrigger *pTrigger) { PolygonTrigger *pPrev = NULL; - for (PolygonTrigger *pTrig=getFirstPolygonTrigger(); pTrig; pTrig = pTrig->getNext()) { + PolygonTrigger *pTrig=getFirstPolygonTrigger(); + for (; pTrig; pTrig = pTrig->getNext()) { if (pTrig==pTrigger) break; pPrev = pTrig; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index e5b62206b4..c18e65726f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -1185,7 +1185,7 @@ void TerrainLogic::enableWaterGrid( Bool enable ) // AsciiString strippedMapNameOnly; AsciiString strippedCompareMapNameOnly; - char *c; + const char *c; // create stripped map name c = strrchr( TheGlobalData->m_mapName.str(), '\\' ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp index ee6846fb0b..59c75a5fee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp @@ -166,8 +166,9 @@ ObjectID CountermeasuresBehavior::calculateCountermeasureToDivertTo( const Objec //Start at the end of the list and go towards the beginning. CountermeasuresVec::iterator it = m_counterMeasures.end(); + DEBUG_ASSERTCRASH(iteratorMax <= (Int)m_counterMeasures.size(), ("Unsafe size")); //end is actually the end so advance the iterator. - if( it ) + if( it != m_counterMeasures.begin() ) { --it; while( iteratorMax-- ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp index 54ac0a3bf8..cf51674a87 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp @@ -405,7 +405,7 @@ FlightDeckBehavior::FlightDeckInfo* FlightDeckBehavior::findPPI(ObjectID id) for (std::vector::iterator it = m_spaces.begin(); it != m_spaces.end(); ++it) { if (it->m_objectInSpace == id) - return it; + return &(*it); } return NULL; @@ -420,7 +420,7 @@ FlightDeckBehavior::FlightDeckInfo* FlightDeckBehavior::findEmptyPPI() for (std::vector::iterator it = m_spaces.begin(); it != m_spaces.end(); ++it) { if( it->m_objectInSpace == INVALID_ID ) - return it; + return &(*it); } return NULL; @@ -853,7 +853,8 @@ Bool FlightDeckBehavior::calcBestParkingAssignment( ObjectID id, Coord3D *pos, I //Find the runway the object is assigned to. Int runway = -1; Int myIndex = 0; - for( std::vector::iterator myIt = m_spaces.begin(); myIt != m_spaces.end(); myIt++, myIndex++ ) + std::vector::iterator myIt = m_spaces.begin(); + for( ; myIt != m_spaces.end(); myIt++, myIndex++ ) { if( myIt->m_objectInSpace == id ) { @@ -879,7 +880,7 @@ Bool FlightDeckBehavior::calcBestParkingAssignment( ObjectID id, Coord3D *pos, I //the back and keep looking at empty spaces until we find one with a plane blocking. Bool checkForPlaneInWay = FALSE; - std::vector::iterator bestIt = NULL; + std::vector::iterator bestIt = m_spaces.end(); Object *bestJet = NULL; Int bestIndex = 0, index = 0; for( std::vector::iterator thatIt = m_spaces.begin(); thatIt != m_spaces.end(); thatIt++, index++ ) @@ -888,7 +889,7 @@ Bool FlightDeckBehavior::calcBestParkingAssignment( ObjectID id, Coord3D *pos, I if( myIt == thatIt ) { //Done, don't look at my spot, nor spots behind me. - if( bestIt ) + if( bestIt != m_spaces.end() ) { myIt->m_objectInSpace = bestJet ? bestJet->getID() : INVALID_ID; bestIt->m_objectInSpace = id; @@ -940,7 +941,7 @@ Bool FlightDeckBehavior::calcBestParkingAssignment( ObjectID id, Coord3D *pos, I if( pos ) { pos->set( &myIt->m_prep ); //reset the original position. - bestIt = NULL; + bestIt = m_spaces.end(); } } } @@ -1193,7 +1194,8 @@ UpdateSleepTime FlightDeckBehavior::update() m_startedProductionFrame = FOREVER; } - for( std::vector::iterator it = m_spaces.begin(); it != m_spaces.end(); it++ ) + std::vector::iterator it = m_spaces.begin(); + for( ; it != m_spaces.end(); it++ ) { //Unassigned space?... so we can build a replacement. if( it->m_objectInSpace == INVALID_ID ) @@ -1354,7 +1356,7 @@ void FlightDeckBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitDoo return; } - newObj->setPosition( pCreationLocations->begin() ); + newObj->setPosition( &(*pCreationLocations)[0] ); newObj->setOrientation( m_runways[ ppi->m_runway ].m_startOrient ); TheAI->pathfinder()->addObjectToPathfindMap( newObj ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp index eef13a518f..dd0d2128e1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp @@ -497,7 +497,8 @@ void SlowDeathBehavior::onDie( const DamageInfo *damageInfo ) TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE); Int total = 0; - for (BehaviorModule** update = obj->getBehaviorModules(); *update; ++update) + BehaviorModule** update = obj->getBehaviorModules(); + for (; *update; ++update) { SlowDeathBehaviorInterface* sdu = (*update)->getSlowDeathBehaviorInterface(); if (sdu != NULL && sdu->isDieApplicable(damageInfo)) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp index 2bd186fc21..91fbf834c1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp @@ -1023,7 +1023,8 @@ void ActiveBody::createParticleSystems( const AsciiString &boneBaseName, // find the actual bone location to use and mark that bone index as used Int count = 0; - for( Int j = 0; j < numBones; j++ ) + Int j = 0; + for( ; j < numBones; j++ ) { // ignore bone positions that have already been used diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp index adce0978af..5125d58083 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp @@ -113,7 +113,8 @@ void UndeadBody::startSecondLife(DamageInfo *damageInfo) // Fire the Slow Death module. The fact that this is not the result of an onDie will cause the special behavior Int total = 0; - for( BehaviorModule** update = getObject()->getBehaviorModules(); *update; ++update ) + BehaviorModule** update = getObject()->getBehaviorModules(); + for( ; *update; ++update ) { SlowDeathBehaviorInterface* sdu = (*update)->getSlowDeathBehaviorInterface(); if (sdu != NULL && sdu->isDieApplicable(damageInfo) ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index 7a95086597..4b69792e68 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -2013,7 +2013,8 @@ void GarrisonContain::loadStationGarrisonPoints( void ) Coord3D tempBuffer[MAX_GARRISON_POINTS]; - for( int t = 0; t < MAX_GARRISON_POINTS; ++t ) + int t = 0; + for( ; t < MAX_GARRISON_POINTS; ++t ) tempBuffer[ t ] = *(structure->getPosition()); count = structure->getMultiLogicalBonePosition("STATION", modData->m_containMax, tempBuffer, NULL); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index 896941428d..29672148bc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -407,7 +407,7 @@ void TransportContain::onRemoving( Object *rider ) //There is no computer player check since Aggressive only means something for computer players anyway if( d->m_goAggressiveOnExit && rider->getAI() ) { - rider->getAI()->setAttitude( AI_AGGRESSIVE ); + rider->getAI()->setAttitude( ATTITUDE_AGGRESSIVE ); } if (getObject()->isEffectivelyDead()) { scatterToNearbyPosition(rider); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 6a590ff9a0..563437edce 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -989,7 +989,7 @@ void Locomotor::locoUpdate_moveTowardsPosition(Object* obj, const Coord3D& goalP // do not allow for invalid positions that the pathfinder cannot handle ... for airborne // objects we don't need the pathfinder so we'll ignore this // - if( BitTest( m_template->m_surfaces, LOCOMOTORSURFACE_AIR ) == false && + if( BitIsSet( m_template->m_surfaces, LOCOMOTORSURFACE_AIR ) == false && !TheAI->pathfinder()->validMovementTerrain(obj->getLayer(), this, obj->getPosition()) && !getFlag(ALLOW_INVALID_POSITION)) { @@ -1043,7 +1043,7 @@ void Locomotor::locoUpdate_moveTowardsPosition(Object* obj, const Coord3D& goalP { *blocked = false; } - if (treatAsAirborne && BitTest( m_template->m_surfaces, LOCOMOTORSURFACE_AIR ) ) + if (treatAsAirborne && BitIsSet( m_template->m_surfaces, LOCOMOTORSURFACE_AIR ) ) { // Airborne flying objects don't collide for now. jba. *blocked = false; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 0182d5695d..8ece312e90 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1872,7 +1872,7 @@ void Object::attemptDamage( DamageInfo *damageInfo ) damageInfo->in.m_damageType != DAMAGE_PENALTY && damageInfo->in.m_damageType != DAMAGE_HEALING && getControllingPlayer() && - !BitTest(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && + !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != NULL && getControllingPlayer() == ThePlayerList->getLocalPlayer() ) TheRadar->tryUnderAttackEvent( this ); @@ -3685,7 +3685,7 @@ void Object::updateObjValuesFromMapProperties(Dict* properties) } valInt = properties->getInt( TheKey_objectSoundAmbientLoopCount, &exists ); - if ( exists && BitTest( audioToModify->m_control, AC_LOOP ) ) + if ( exists && BitIsSet( audioToModify->m_control, AC_LOOP ) ) { audioToModify->overrideLoopCount( valInt ); infoModified = true; @@ -5453,7 +5453,7 @@ void Object::doCommandButton( const CommandButton *commandButton, CommandSourceT case GUI_COMMAND_FIRE_WEAPON: if( ai ) { - if( !BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) && !BitTest( commandButton->getOptions(), NEED_TARGET_POS ) ) + if( !BitIsSet( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) && !BitIsSet( commandButton->getOptions(), NEED_TARGET_POS ) ) { setWeaponLock( commandButton->getWeaponSlot(), LOCKED_TEMPORARILY ); //LOCATION BASED FIRE WEAPON @@ -5581,7 +5581,7 @@ void Object::doCommandButtonAtObject( const CommandButton *commandButton, Object case GUI_COMMAND_FIRE_WEAPON: if( ai ) { - if( BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) + if( BitIsSet( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET ) ) { //OBJECT BASED FIRE WEAPON if( !obj ) @@ -5596,7 +5596,7 @@ void Object::doCommandButtonAtObject( const CommandButton *commandButton, Object setWeaponLock( commandButton->getWeaponSlot(), LOCKED_TEMPORARILY ); - if( BitTest( commandButton->getOptions(), ATTACK_OBJECTS_POSITION ) ) + if( BitIsSet( commandButton->getOptions(), ATTACK_OBJECTS_POSITION ) ) { //Actually, you know what.... we want to attack the object's location instead. ai->aiAttackPosition( obj->getPosition(), commandButton->getMaxShotsToFire(), cmdSource ); @@ -5702,7 +5702,7 @@ void Object::doCommandButtonAtPosition( const CommandButton *commandButton, cons case GUI_COMMAND_FIRE_WEAPON: if( ai ) { - if( BitTest( commandButton->getOptions(), NEED_TARGET_POS ) ) + if( BitIsSet( commandButton->getOptions(), NEED_TARGET_POS ) ) { //LOCATION BASED FIRE WEAPON if( !pos ) @@ -5765,7 +5765,7 @@ void Object::doCommandButtonUsingWaypoints( const CommandButton *commandButton, if( commandButton ) { - if( !BitTest( commandButton->getOptions(), CAN_USE_WAYPOINTS ) ) + if( !BitIsSet( commandButton->getOptions(), CAN_USE_WAYPOINTS ) ) { //Our button doesn't support waypoints. DEBUG_CRASH( ("WARNING: Script doCommandButtonUsingWaypoints for button %s lacks CAN_USE_WAYPOINTS option. Doing nothing.", commandButton->getName().str()) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index a9459024f8..19e2848423 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1034,7 +1034,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget obj->goInvulnerable( m_invulnerableTime ); } - if( BitTest( m_disposition, INHERIT_VELOCITY ) && sourceObj ) + if( BitIsSet( m_disposition, INHERIT_VELOCITY ) && sourceObj ) { const PhysicsBehavior *sourcePhysics = sourceObj->getPhysics(); PhysicsBehavior *objectPhysics = obj->getPhysics(); @@ -1044,7 +1044,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } } - if( BitTest( m_disposition, LIKE_EXISTING ) ) + if( BitIsSet( m_disposition, LIKE_EXISTING ) ) { if (mtx) obj->setTransformMatrix(mtx); @@ -1082,7 +1082,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } - if( BitTest( m_disposition, ON_GROUND_ALIGNED ) ) + if( BitIsSet( m_disposition, ON_GROUND_ALIGNED ) ) { chunkPos.z = 99999.0f; PathfindLayerEnum layer = TheTerrainLogic->getHighestLayerForDestination(&chunkPos); @@ -1095,7 +1095,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget obj->setPosition(&chunkPos); } - if( BitTest( m_disposition, SEND_IT_OUT ) ) + if( BitIsSet( m_disposition, SEND_IT_OUT ) ) { obj->setOrientation(GameLogicRandomValueReal(0.0f, 2 * PI)); chunkPos.z = TheTerrainLogic->getGroundHeight( chunkPos.x, chunkPos.y ); @@ -1122,7 +1122,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } } - if( BitTest( m_disposition, SEND_IT_FLYING | SEND_IT_UP | RANDOM_FORCE ) ) + if( BitIsSet( m_disposition, SEND_IT_FLYING | SEND_IT_UP | RANDOM_FORCE ) ) { if (mtx) { @@ -1170,7 +1170,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget DUMPREAL(pitch); Coord3D force; - if( BitTest( m_disposition, SEND_IT_FLYING ) ) + if( BitIsSet( m_disposition, SEND_IT_FLYING ) ) { Real horizForce = 4.0f * m_dispositionIntensity; // 2 Real vertForce = 3.0f * m_dispositionIntensity; // 3 @@ -1181,7 +1181,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget DUMPREAL(vertForce); DUMPCOORD3D(&force); } - else if (BitTest(m_disposition, SEND_IT_UP) ) + else if (BitIsSet(m_disposition, SEND_IT_UP) ) { Real horizForce = 2.0f * m_dispositionIntensity; Real vertForce = 4.0f * m_dispositionIntensity; @@ -1218,7 +1218,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } } - if( BitTest( m_disposition, WHIRLING ) ) + if( BitIsSet( m_disposition, WHIRLING ) ) { PhysicsBehavior* objUp = obj->getPhysics(); if (objUp) @@ -1233,7 +1233,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget } } - if( BitTest( m_disposition, FLOATING ) ) + if( BitIsSet( m_disposition, FLOATING ) ) { static NameKeyType key = NAMEKEY( "FloatUpdate" ); FloatUpdate *floatUpdate = (FloatUpdate *)obj->findUpdateModule( key ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 2213038ca7..4d4b02168b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -337,6 +337,14 @@ inline Real maxReal(Real a, Real b) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms); +static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms); +static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms); +static void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms); static void projectCoord3D(Coord3D *coord, const Coord3D *unitDir, Real dist); static void flipCoord3D(Coord3D *coord); @@ -3756,7 +3764,7 @@ Bool PartitionManager::tryPosition( const Coord3D *center, { return FALSE; } - if( BitTest(options->flags, FPF_CLEAR_CELLS_ONLY) && cell->getType() != PathfindCell::CELL_CLEAR ) + if( BitIsSet(options->flags, FPF_CLEAR_CELLS_ONLY) && cell->getType() != PathfindCell::CELL_CLEAR ) return FALSE; } @@ -3765,7 +3773,7 @@ Bool PartitionManager::tryPosition( const Coord3D *center, // we don't usually find positions in the water unless we explicitly say that's OK, // or if the option is set we can only pick position underwater // - if( BitTest( options->flags, FPF_IGNORE_WATER ) == FALSE ) + if( BitIsSet( options->flags, FPF_IGNORE_WATER ) == FALSE ) { Bool isUnderwater = TheTerrainLogic->isUnderwater( pos.x, pos.y ); @@ -3773,7 +3781,7 @@ Bool PartitionManager::tryPosition( const Coord3D *center, // if we want water spots only and this is underwater it's no good, otherwise we want // the default behavior where underwater spots are invalid // - if( BitTest( options->flags, FPF_WATER_ONLY ) && (isUnderwater == FALSE || layer != LAYER_GROUND) ) + if( BitIsSet( options->flags, FPF_WATER_ONLY ) && (isUnderwater == FALSE || layer != LAYER_GROUND) ) return FALSE; else if( isUnderwater == TRUE && layer == LAYER_GROUND ) return FALSE; @@ -3781,7 +3789,7 @@ Bool PartitionManager::tryPosition( const Coord3D *center, } // end if // object checks - if( BitTest( options->flags, FPF_IGNORE_ALL_OBJECTS ) == FALSE ) + if( BitIsSet( options->flags, FPF_IGNORE_ALL_OBJECTS ) == FALSE ) { // @@ -3805,25 +3813,25 @@ Bool PartitionManager::tryPosition( const Coord3D *center, { // if this is an ally/neutral unit and we ignore those, do so - if( BitTest( options->flags, FPF_IGNORE_ALLY_OR_NEUTRAL_UNITS ) == TRUE && + if( BitIsSet( options->flags, FPF_IGNORE_ALLY_OR_NEUTRAL_UNITS ) == TRUE && options->relationshipObject->getRelationship( them ) != ENEMIES && (them->isKindOf( KINDOF_INFANTRY ) || them->isKindOf( KINDOF_VEHICLE )) ) continue; // if this is an ally/neutral structure and we ignore those, do so - if( BitTest( options->flags, FPF_IGNORE_ALLY_OR_NEUTRAL_STRUCTURES ) == TRUE && + if( BitIsSet( options->flags, FPF_IGNORE_ALLY_OR_NEUTRAL_STRUCTURES ) == TRUE && options->relationshipObject->getRelationship( them ) != ENEMIES && them->isKindOf( KINDOF_STRUCTURE ) ) continue; // if this is an enemy unit and we ignore those, do so - if( BitTest( options->flags, FPF_IGNORE_ENEMY_UNITS ) == TRUE && + if( BitIsSet( options->flags, FPF_IGNORE_ENEMY_UNITS ) == TRUE && options->relationshipObject->getRelationship( them ) == ENEMIES && (them->isKindOf( KINDOF_INFANTRY ) || them->isKindOf( KINDOF_VEHICLE )) ) continue; // if this is an enemy structure and we ignore those, do so - if( BitTest( options->flags, FPF_IGNORE_ENEMY_STRUCTURES ) == TRUE && + if( BitIsSet( options->flags, FPF_IGNORE_ENEMY_STRUCTURES ) == TRUE && options->relationshipObject->getRelationship( them ) == ENEMIES && them->isKindOf( KINDOF_STRUCTURE ) ) continue; @@ -3902,8 +3910,8 @@ Bool PartitionManager::findPositionAround( const Coord3D *center, return true; } // sanity, FPF_IGNORE_WATER and FPF_WATER_ONLY are mutually exclusive - DEBUG_ASSERTCRASH( !(BitTest( options->flags, FPF_IGNORE_WATER ) == TRUE && - BitTest( options->flags, FPF_WATER_ONLY ) == TRUE), + DEBUG_ASSERTCRASH( !(BitIsSet( options->flags, FPF_IGNORE_WATER ) == TRUE && + BitIsSet( options->flags, FPF_WATER_ONLY ) == TRUE), ("PartitionManager::findPositionAround - The options FPF_WATER_ONLY and FPF_IGNORE_WATER are mutually exclusive. You cannot use them together\n") ); // pick a random angle from the center location to start at @@ -3982,7 +3990,7 @@ void PartitionManager::doShroudReveal(Real centerX, Real centerY, Real radius, P // Object's Look is the one who knows about allies. Anyone can pask a player mask to me and all // of those players will have an active looker applied to a bunch of cells const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { circle.drawCircle(hLineAddLooker, (void*)currentIndex); } @@ -4047,7 +4055,7 @@ void PartitionManager::undoShroudReveal(Real centerX, Real centerY, Real radius, for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { circle.drawCircle(hLineRemoveLooker, (void*)currentIndex); } @@ -4086,7 +4094,7 @@ void PartitionManager::doShroudCover(Real centerX, Real centerY, Real radius, Pl // Object's Shroud is the one who knows about allies. Anyone can pask a player mask to me and all // of those players will have an active shrouder applied to a bunch of cells const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { circle.drawCircle(hLineAddShrouder, (void*)currentIndex); } @@ -4108,7 +4116,7 @@ void PartitionManager::undoShroudCover(Real centerX, Real centerY, Real radius, for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { circle.drawCircle(hLineRemoveShrouder, (void*)currentIndex); } @@ -4140,7 +4148,7 @@ void PartitionManager::doThreatAffect( Real centerX, Real centerY, Real radius, for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { parms.playerIndex = currentIndex; circle.drawCircle(hLineAddThreat, &parms); @@ -4173,7 +4181,7 @@ void PartitionManager::undoThreatAffect( Real centerX, Real centerY, Real radius for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { parms.playerIndex = currentIndex; circle.drawCircle(hLineRemoveThreat, &parms); @@ -4206,7 +4214,7 @@ void PartitionManager::doValueAffect( Real centerX, Real centerY, Real radius, U for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { parms.playerIndex = currentIndex; circle.drawCircle(hLineAddValue, &parms); @@ -4239,7 +4247,7 @@ void PartitionManager::undoValueAffect( Real centerX, Real centerY, Real radius, for( Int currentIndex = ThePlayerList->getPlayerCount() - 1; currentIndex >=0; currentIndex-- ) { const Player *currentPlayer = ThePlayerList->getNthPlayer( currentIndex ); - if( BitTest( playerMask, currentPlayer->getPlayerMask() ) ) + if( BitIsSet( playerMask, currentPlayer->getPlayerMask() ) ) { parms.playerIndex = currentIndex; circle.drawCircle(hLineRemoveValue, &parms); @@ -4764,7 +4772,7 @@ void PartitionManager::getMostValuableLocation( Int playerIndex, UnsignedInt whi Int cellValue = 0; for (Int player = 0; player < MAX_PLAYER_COUNT; ++player) { - if (BitTest(allPlayerMasks[player], playerMask)) { + if (BitIsSet(allPlayerMasks[player], playerMask)) { if (valType == VOT_CashValue) { cellValue += m_cells[i].getCashValue(player); } else { @@ -5580,7 +5588,7 @@ static int cellValueProc(PartitionCell* cell, void* userData) UnsignedInt val = 0; for (Int i = 0; i < MAX_PLAYER_COUNT; ++i) { - if (BitTest(parms->allowedPlayersMasks, parms->allPlayersMask[i])) { + if (BitIsSet(parms->allowedPlayersMasks, parms->allPlayersMask[i])) { if (parms->valueType == VOT_CashValue) { val += cell->getCashValue(i); } else { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index b1d318aa25..8e744bf8ac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -258,7 +258,7 @@ AIUpdateInterface::AIUpdateInterface( Thing *thing, const ModuleData* moduleData for (i = 0; i < MAX_TURRETS; i++) m_turretAI[i] = NULL; m_turretSyncFlag = TURRET_INVALID; - m_attitude = AI_NORMAL; + m_attitude = ATTITUDE_NORMAL; m_nextMoodCheckTime = 0; #ifdef ALLOW_DEMORALIZE m_demoralizedFramesLeft = 0; @@ -4336,11 +4336,11 @@ UnsignedInt AIUpdateInterface::getMoodMatrixValue( void ) const returnVal |= MM_Controller_AI; switch (getAttitude()) { - case AI_SLEEP: returnVal |= MM_Mood_Sleep; break; - case AI_PASSIVE: returnVal |= MM_Mood_Passive; break; - case AI_NORMAL: returnVal |= MM_Mood_Normal; break; - case AI_ALERT: returnVal |= MM_Mood_Alert; break; - case AI_AGGRESSIVE: returnVal |= MM_Mood_Aggressive; break; + case ATTITUDE_SLEEP: returnVal |= MM_Mood_Sleep; break; + case ATTITUDE_PASSIVE: returnVal |= MM_Mood_Passive; break; + case ATTITUDE_NORMAL: returnVal |= MM_Mood_Normal; break; + case ATTITUDE_ALERT: returnVal |= MM_Mood_Alert; break; + case ATTITUDE_AGGRESSIVE: returnVal |= MM_Mood_Aggressive; break; default: DEBUG_CRASH(("Unknown mood '%d' in getMoodMatrixValue. (Team '%s'). Using normal. (jkmcd)", getAttitude(), getObject()->getTeam()->getName().str() )); returnVal |= MM_Mood_Normal; @@ -4515,7 +4515,7 @@ Object* AIUpdateInterface::getNextMoodTarget( Bool calledByAI, Bool calledDuring } // srj sez: this should ignore calledDuringIdle, despite what the name of the bit implies. - if (isAttacking() && BitTest(d->m_autoAcquireEnemiesWhenIdle, AAS_Idle_Not_While_Attacking)) + if (isAttacking() && BitIsSet(d->m_autoAcquireEnemiesWhenIdle, AAS_Idle_Not_While_Attacking)) { return NULL; } @@ -4555,7 +4555,7 @@ Object* AIUpdateInterface::getNextMoodTarget( Bool calledByAI, Bool calledDuring } } - if (teamVictim && getAttitude()>=AI_NORMAL) + if (teamVictim && getAttitude()>=ATTITUDE_NORMAL) return teamVictim; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 8881d56fbf..5524fee16a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1832,7 +1832,7 @@ void DozerAIUpdate::privateRepair( Object *obj, CommandSourceType cmdSource ) // // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); - // if( BitTest( bridge->getStatusBits(), OBJECT_STATUS_UNDERGOING_REPAIR ) == TRUE ) + // if( BitIsSet( bridge->getStatusBits(), OBJECT_STATUS_UNDERGOING_REPAIR ) == TRUE ) // return; // //} // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp index 9a34363ab4..cf9886de26 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp @@ -549,7 +549,7 @@ class JetOrHeliTaxiState : public AIMoveOutOfTheWayState std::vector::const_iterator it; for( it = pTaxiLocations->begin(); it != pTaxiLocations->end(); it++ ) { - movePath->appendNode( it, LAYER_GROUND ); + movePath->appendNode( &(*it), LAYER_GROUND ); } } @@ -617,7 +617,7 @@ class JetOrHeliTaxiState : public AIMoveOutOfTheWayState firstNode = FALSE; continue; } - movePath->appendNode( it, LAYER_GROUND ); + movePath->appendNode( &(*it), LAYER_GROUND ); } movePath->appendNode( &ppinfo.runwayPrep, LAYER_GROUND ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp index f1c9d0677f..c920f68ad9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp @@ -107,8 +107,6 @@ RailroadBehavior::RailroadBehavior( Thing *thing, const ModuleData *moduleData ) { const RailroadBehaviorModuleData *modData = getRailroadBehaviorModuleData(); - m_carriageTemplateNameIterator = 0; - m_nextStationTask = DO_NOTHING; m_trailerID = INVALID_ID; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp index dc8a80a7ad..d30b276e83 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp @@ -273,15 +273,15 @@ Bool BattlePlanUpdate::initiateIntentToDoSpecialPower(const SpecialPowerTemplate } //Set the desired status based on the command button option! - if( BitTest( commandOptions, OPTION_ONE ) ) + if( BitIsSet( commandOptions, OPTION_ONE ) ) { m_desiredPlan = PLANSTATUS_BOMBARDMENT; } - else if( BitTest( commandOptions, OPTION_TWO ) ) + else if( BitIsSet( commandOptions, OPTION_TWO ) ) { m_desiredPlan = PLANSTATUS_HOLDTHELINE; } - else if( BitTest( commandOptions, OPTION_THREE ) ) + else if( BitIsSet( commandOptions, OPTION_THREE ) ) { m_desiredPlan = PLANSTATUS_SEARCHANDDESTROY; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp index 77d3bc49d9..b3571f6463 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp @@ -146,7 +146,8 @@ Bool DockUpdate::reserveApproachPosition( Object* docker, Coord3D *position, Int ObjectID dockerID = docker->getID(); - for( Int positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex ) + Int positionIndex = 0; + for( ; positionIndex < m_approachPositionOwners.size(); ++positionIndex ) { if( m_approachPositionOwners[positionIndex] == dockerID ) { @@ -583,7 +584,8 @@ void DockUpdate::xfer( Xfer *xfer ) Int vectorSize = m_approachPositions.size(); xfer->xferInt( &vectorSize ); m_approachPositions.resize(vectorSize); - for( Int vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) + Int vectorIndex = 0; + for( ; vectorIndex < vectorSize; ++vectorIndex ) { // Okay, this is cool. On save, the size and a bunch of coords will be written. // on load, vectorSize will be at 0 from the .size, but will then get set diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index af256a35ac..3af9ff3c43 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -281,7 +281,7 @@ Bool ParticleUplinkCannonUpdate::initiateIntentToDoSpecialPower(const SpecialPow // getObject()->getControllingPlayer()->getAcademyStats()->recordSpecialPowerUsed( specialPowerTemplate ); - if( !BitTest( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) + if( !BitIsSet( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) { //All human players have manual control and must "drive" the beam around! m_startAttackFrame = TheGameLogic->getFrame(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp index 524b3f2f31..d3fc7d7d31 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp @@ -71,7 +71,8 @@ void SpawnPointProductionExitUpdate::exitObjectViaDoor( Object *newObj, ExitDoor Object *creationObject = getObject(); if (creationObject) { - for( Int positionIndex = 0; positionIndex < m_spawnPointCount; positionIndex++ ) + Int positionIndex = 0; + for( ; positionIndex < m_spawnPointCount; positionIndex++ ) { if( m_spawnPointOccupier[positionIndex] == INVALID_ID ) break; @@ -149,7 +150,8 @@ void SpawnPointProductionExitUpdate::initializeBonePositions() return; Matrix3D boneTransforms[MAX_SPAWN_POINTS]; - for( Int matrixIndex = 0; matrixIndex < MAX_SPAWN_POINTS; matrixIndex++ ) + Int matrixIndex = 0; + for( ; matrixIndex < MAX_SPAWN_POINTS; matrixIndex++ ) boneTransforms[matrixIndex].Make_Identity(); // Get all the bones of the right name diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp index 62882cfed1..2d40598f6f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp @@ -573,7 +573,7 @@ Bool SpecialAbilityUpdate::isPowerCurrentlyInUse( const CommandButton *command ) { if( command->getSpecialPowerTemplate() && command->getSpecialPowerTemplate()->getSpecialPowerType() == SPECIAL_REMOTE_CHARGES ) { - if( !BitTest( command->getOptions(), CONTEXTMODE_COMMAND ) ) + if( !BitIsSet( command->getOptions(), CONTEXTMODE_COMMAND ) ) { //This is the detonate charge button. Treat it backwards saying it's in use when we don't have any special objects (charges). //That way, the button will be grayed out. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp index 3e827c1a62..ca856b58ad 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp @@ -154,7 +154,7 @@ Bool SpectreGunshipDeploymentUpdate::initiateIntentToDoSpecialPower(const Specia // getObject()->getControllingPlayer()->getAcademyStats()->recordSpecialPowerUsed( specialPowerTemplate ); - if( !BitTest( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) + if( !BitIsSet( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) { /******CHANGE*******/ m_initialTargetPosition.set( targetPos ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp index b4b3aabcab..8c745f0603 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp @@ -196,7 +196,7 @@ Bool SpectreGunshipUpdate::initiateIntentToDoSpecialPower(const SpecialPowerTemp return FALSE; } - if( !BitTest( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) + if( !BitIsSet( commandOptions, COMMAND_FIRED_BY_SCRIPT ) ) { m_initialTargetPosition.set( targetPos ); m_overrideTargetDestination.set( targetPos ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp index 38e7231cad..5e9ed3f1f0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp @@ -403,7 +403,8 @@ void StructureToppleUpdate::applyCrushingDamage(Real theta) Real jcos; Real jsin; // Coord3D target; - for (Real j = m_lastCrushedLocation; j < maxDistance; j += WEAPON_SPACING_PERPENDICULAR) { + Real j = m_lastCrushedLocation; + for (; j < maxDistance; j += WEAPON_SPACING_PERPENDICULAR) { jcos = j * Cos(toppleAngle); jsin = j * Sin(toppleAngle); doDamageLine(building, wt, jcos, jsin, facingWidth, toppleAngle); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp index bde5710e54..f37e0c29a8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp @@ -300,7 +300,7 @@ UpdateSleepTime ToppleUpdate::update() // Hit so either bounce or stop if too little remaining velocity. m_angularVelocity *= -d->m_bounceVelocityPercent; - if( BitTest( m_options, TOPPLE_OPTIONS_NO_BOUNCE ) == TRUE || + if( BitIsSet( m_options, TOPPLE_OPTIONS_NO_BOUNCE ) == TRUE || fabs(m_angularVelocity) < VELOCITY_BOUNCE_LIMIT ) { // too slow, just stop @@ -344,7 +344,7 @@ UpdateSleepTime ToppleUpdate::update() else if( fabs(m_angularVelocity) >= VELOCITY_BOUNCE_SOUND_LIMIT ) { // fast enough bounce to warrant the bounce fx - if( BitTest( m_options, TOPPLE_OPTIONS_NO_FX ) == FALSE ) + if( BitIsSet( m_options, TOPPLE_OPTIONS_NO_FX ) == FALSE ) FXList::doFXObj(d->m_bounceFX, obj); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 24d69f33df..8d921ee746 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1618,7 +1618,7 @@ void WeaponStore::update() if (curFrame >= ddi->m_delayDamageFrame) { // we never do projectile-detonation-damage via this code path. - const isProjectileDetonation = false; + const Bool isProjectileDetonation = false; ddi->m_delayedWeapon->dealDamageInternal(ddi->m_delaySourceID, ddi->m_delayIntendedVictimID, &ddi->m_delayDamagePos, ddi->m_bonus, isProjectileDetonation); ddi = m_weaponDDI.erase(ddi); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 65b8fd6ac4..fdc4613e73 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -2044,7 +2044,7 @@ void ScriptActions::doTeamHuntWithCommandButton(const AsciiString& teamName, con case GUI_COMMAND_SPECIAL_POWER: if( commandButton->getSpecialPowerTemplate() ) { - if (BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET )) + if (BitIsSet( commandButton->getOptions(), COMMAND_OPTION_NEED_OBJECT_TARGET )) { // OK, we can hunt with a power that targets an object. break; @@ -2575,7 +2575,8 @@ void ScriptActions::doDisplayCinematicText(const AsciiString& displayText, const char buf[256]; char *c; strcpy(buf, fontType.str()); - for( c = buf; c != '\0'; *c++ ) + // TheSuperHackers @fix xezon 16/03/2025 Fixes potential buffer overrun via prior c!='\0' test. + for( c = buf; *c != '\0'; c++ ) { if( *c != ' ' && *c++ != '-' ) fontName.concat(c); @@ -2583,12 +2584,12 @@ void ScriptActions::doDisplayCinematicText(const AsciiString& displayText, const break; } while( *c != ':' ) - *c++; - *c++; // eat through " - Size:" + c++; + c++; // eat through " - Size:" // get font size AsciiString fontSize = AsciiString::TheEmptyString; - for( ; *c != '\0'; *c++ ) + for( ; *c != '\0'; c++ ) { if( *c != '\0' && *c != ' ' ) { @@ -5252,7 +5253,8 @@ void ScriptActions::doMoveTeamTowardsNearest( const AsciiString& teamName, const //Get the first object (to use in the partition filter checks). Object *teamObj = NULL; - for (DLINK_ITERATOR iter = team->iterate_TeamMemberList(); !iter.done(); iter.advance()) + DLINK_ITERATOR iter = team->iterate_TeamMemberList(); + for (; !iter.done(); iter.advance()) { teamObj = iter.cur(); if( teamObj ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp index e9fb7de37a..845bfcb1b3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp @@ -91,7 +91,7 @@ namespace rts T sum(std::vector& vecOfValues ) { T retVal = 0; - std::vector::iterator it; + typename std::vector::iterator it; for (it = vecOfValues.begin(); it != vecOfValues.end(); ++it) { retVal += (*it); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index a01e6b8515..92743171fd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -81,7 +81,7 @@ static ScriptGroup *s_mtGroup = NULL; // These strings must be in the same order as they are in their definitions // (See SHELL_SCRIPT_HOOK_* ) // -char *TheShellHookNames[]= +const char *TheShellHookNames[]= { "ShellMainMenuCampaignPushed", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_SELECTED, "ShellMainMenuCampaignHighlighted", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_HIGHLIGHTED, @@ -1967,11 +1967,11 @@ AsciiString Parameter::getUiText(void) const case AI_MOOD: switch (m_int) { - case AI_SLEEP: uiText.format("Sleep"); break; - case AI_PASSIVE: uiText.format("Passive"); break; - case AI_NORMAL: uiText.format("Normal"); break; - case AI_ALERT: uiText.format("Alert"); break; - case AI_AGGRESSIVE: uiText.format("Aggressive"); break; + case ATTITUDE_SLEEP: uiText.format("Sleep"); break; + case ATTITUDE_PASSIVE: uiText.format("Passive"); break; + case ATTITUDE_NORMAL: uiText.format("Normal"); break; + case ATTITUDE_ALERT: uiText.format("Alert"); break; + case ATTITUDE_AGGRESSIVE: uiText.format("Aggressive"); break; default : DEBUG_CRASH(("Unknown AI Mood type.")); } break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 2e2719bde1..47c7275312 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -1788,7 +1788,8 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if (msg->getArgument(0)->boolean) { // transfer control to any living ally - for (Int i=0; igetPlayerCount(); ++i) + Int i=0; + for (; igetPlayerCount(); ++i) { if (i != msg->getPlayerIndex()) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index a9fcf3bd8d..e16bb43bc1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -75,7 +75,8 @@ ConnectionManager::~ConnectionManager(void) m_transport = NULL; } - for (Int i = 0; i < MAX_SLOTS; ++i) { + Int i = 0; + for (; i < MAX_SLOTS; ++i) { if (m_frameData[i] != NULL) { m_frameData[i]->deleteInstance(); m_frameData[i] = NULL; @@ -151,7 +152,8 @@ void ConnectionManager::init() // } // m_transport->reset(); - for (UnsignedInt i = 0; i < NUM_CONNECTIONS; ++i) { + UnsignedInt i = 0; + for (; i < NUM_CONNECTIONS; ++i) { m_connections[i] = NULL; } @@ -229,7 +231,8 @@ void ConnectionManager::reset() m_transport = NULL; } - for (Int i = 0; i < NUM_CONNECTIONS; ++i) { + Int i = 0; + for (; i < NUM_CONNECTIONS; ++i) { if (m_connections[i] != NULL) { m_connections[i]->deleteInstance(); m_connections[i] = NULL; @@ -1553,7 +1556,8 @@ Bool ConnectionManager::allCommandsReady(UnsignedInt frame, Bool justTesting /* Bool retval = TRUE; FrameDataReturnType frameRetVal; // retval = FALSE; // ****for testing purposes only!!!!!!**** - for (Int i = 0; (i < MAX_SLOTS) && retval; ++i) { + Int i = 0; + for (; (i < MAX_SLOTS) && retval; ++i) { if ((m_frameData[i] != NULL) && (m_frameData[i]->getIsQuitting() == FALSE)) { /* if (!(m_frameData[i]->allCommandsReady(frame, (frame != commandsReadyDebugSpewage) && (justTesting == FALSE)))) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp index 4918b61fb6..353e8fa0d0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp @@ -82,7 +82,8 @@ void DisconnectManager::init() { m_currentPacketRouterIndex = 0; m_timeOfDisconnectScreenOn = 0; - for (Int i = 0; i < MAX_SLOTS; ++i) { + Int i = 0; + for (; i < MAX_SLOTS; ++i) { for (Int j = 0; j < MAX_SLOTS; ++j) { m_playerVotes[i][j].vote = FALSE; m_playerVotes[i][j].frame = 0; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp index 5c2169f6fd..87d0ee08cf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -102,7 +102,8 @@ FirewallHelperClass::FirewallHelperClass(void) m_lastBehavior = FIREWALL_TYPE_UNKNOWN; m_sourcePortAllocationDelta = 0; m_lastSourcePortAllocationDelta = 0; - for (Int i = 0; i < MAX_SPARE_SOCKETS; ++i) { + Int i = 0; + for (; i < MAX_SPARE_SOCKETS; ++i) { m_spareSockets[i].port = 0; m_messages[i].length = 0; m_mangledPorts[i] = 0; @@ -446,7 +447,8 @@ UnsignedShort FirewallHelperClass::getManglerResponse(UnsignedShort packetID, In sockaddr_in addr; - for (Int i = 0; i < MAX_SPARE_SOCKETS; ++i) { + Int i = 0; + for (; i < MAX_SPARE_SOCKETS; ++i) { if (m_spareSockets[i].udp != NULL) { ManglerMessage *message = findEmptyMessage(); if (message == NULL) { @@ -909,7 +911,8 @@ Bool FirewallHelperClass::detectionTest3Update() { ** We should use a non-linear set of source ports so we can detect the NAT32 relative offset ** case. */ - for (Int i=0 ; im_networkFPSHistoryLength; ++i) { + Int i = 0; + for (; i < TheGlobalData->m_networkFPSHistoryLength; ++i) { m_fpsList[i] = 30.0; } m_fpsListIndex = 0; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index 5515394ed8..a1f2da82d6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -192,7 +192,8 @@ void PopulateColorComboBox(Int comboBox, GameWindow *comboArray[], GameInfo *myG UnicodeString colorName; std::vector availableColors; - for (Int i = 0; i < numColors; i++) + Int i = 0; + for (; i < numColors; i++) availableColors.push_back(true); for (i = 0; i < MAX_SLOTS; i++) @@ -337,8 +338,9 @@ void PopulateStartingCashComboBox(GameWindow *comboBox, GameInfo *myGame) const MultiplayerStartingMoneyList & startingCashMap = TheMultiplayerSettings->getStartingMoneyList(); Int currentSelectionIndex = -1; - - for ( MultiplayerStartingMoneyList::const_iterator it = startingCashMap.begin(); it != startingCashMap.end(); it++ ) + + MultiplayerStartingMoneyList::const_iterator it = startingCashMap.begin(); + for ( ; it != startingCashMap.end(); it++ ) { Int newIndex = GadgetComboBoxAddEntry(comboBox, formatMoneyForStartingCashComboBox( *it ), comboBox->winGetEnabled() ? comboBox->winGetEnabledTextColor() : comboBox->winGetDisabledTextColor()); @@ -437,14 +439,14 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], //Color In the little accepted boxes if(slot->isAccepted()) { - if(BitTest(buttonAccept[i]->winGetStatus(), WIN_STATUS_IMAGE )) + if(BitIsSet(buttonAccept[i]->winGetStatus(), WIN_STATUS_IMAGE )) buttonAccept[i]->winEnable(TRUE); else GadgetButtonSetEnabledColor(buttonAccept[i], acceptTrueColor ); } else { - if(BitTest(buttonAccept[i]->winGetStatus(), WIN_STATUS_IMAGE )) + if(BitIsSet(buttonAccept[i]->winGetStatus(), WIN_STATUS_IMAGE )) buttonAccept[i]->winEnable(FALSE); else GadgetButtonSetEnabledColor(buttonAccept[i], acceptFalseColor ); @@ -469,7 +471,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], comboPlayer[i]->winEnable( FALSE ); } //if( i == myGame->getLocalSlotNum()) - if((comboColor[i] != NULL) && BitTest(comboColor[i]->winGetStatus(), WIN_STATUS_ENABLED)) + if((comboColor[i] != NULL) && BitIsSet(comboColor[i]->winGetStatus(), WIN_STATUS_ENABLED)) PopulateColorComboBox(i, comboColor, myGame, myGame->getConstSlot(i)->getPlayerTemplate() == PLAYERTEMPLATE_OBSERVER); Int max, idx; if (comboColor[i] != NULL) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index e1d757227a..5596f6f260 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -770,7 +770,8 @@ void GameInfo::adjustSlotsForMap() Int numPlayerSlots = 0; // first get the number of occupied slots. - for (Int i = 0; i < MAX_SLOTS; ++i) + Int i = 0; + for (; i < MAX_SLOTS; ++i) { GameSlot *tempSlot = getSlot(i); if (tempSlot->isOccupied()) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index bcba368a0b..db219c7900 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -473,7 +473,7 @@ static void clearBuddyGames(void) struct GameSortStruct { - bool operator()(GameSpyStagingRoom *g1, GameSpyStagingRoom *g2) + bool operator()(GameSpyStagingRoom *g1, GameSpyStagingRoom *g2) const { // sort CRC mismatches to the bottom Bool g1Good = (g1->getExeCRC() != TheGlobalData->m_exeCRC || g1->getIniCRC() != TheGlobalData->m_iniCRC); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp index 17e6aa75e9..431a9b26ee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp @@ -717,7 +717,8 @@ void HTTPThinkWrapper( void ) { if (s_asyncDNSLookupInProgress) { - Int ret = asyncGethostbyname("servserv.generals.ea.com"); + Char hostname[] = "servserv.generals.ea.com"; + Int ret = asyncGethostbyname(hostname); switch(ret) { case LOOKUP_FAILED: @@ -774,7 +775,8 @@ void StartPatchCheck( void ) TheGameText->fetch("GUI:CheckingForPatches"), CancelPatchCheckCallbackAndReopenDropdown); s_asyncDNSLookupInProgress = TRUE; - Int ret = asyncGethostbyname("servserv.generals.ea.com"); + Char hostname[] = "servserv.generals.ea.com"; + Int ret = asyncGethostbyname(hostname); switch(ret) { case LOOKUP_FAILED: diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 40a8cdf7b5..601c6ecd18 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -1831,7 +1831,8 @@ void PeerThreadClass::handleQMMatch(PEER peer, Int mapIndex, Int seed, m_qmStatus = QM_MATCHED; peerLeaveRoom(peer, GroupRoom, ""); - for (Int i=0; igetIP(i) == playerIP) { @@ -138,8 +138,8 @@ void LANAPI::OnHasMap( UnsignedInt playerIP, Bool status ) { if( AmIHost() ) { - - for (Int i = 0; i < MAX_SLOTS; i++) + Int i = 0; + for (; i < MAX_SLOTS; i++) { if (m_currentGame->getIP(i) == playerIP) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp index 36765359ae..e29851a459 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp @@ -245,7 +245,7 @@ void LANDisplayGameList( GameWindow *gameListbox, LANGameInfo *gameList ) AsciiString GenerateGameOptionsString( void ) { if(!TheLAN->GetMyGame() || !TheLAN->GetMyGame()->amIHost()) - return AsciiString.TheEmptyString; + return AsciiString::TheEmptyString; return GameInfoToAsciiString(TheLAN->GetMyGame()); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp index 49b57c8c1b..3cbd24fd7e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp @@ -480,7 +480,8 @@ void NAT::establishConnectionPaths() { // determine how many nodes we have. m_numNodes = 0; - for (Int i = 0; i < MAX_SLOTS; ++i) { + Int i = 0; + for (; i < MAX_SLOTS; ++i) { if (m_slotList[i] != NULL) { if (m_slotList[i]->isHuman()) { DEBUG_LOG(("NAT::establishConnectionPaths - slot %d is %ls\n", i, m_slotList[i]->getName().str())); @@ -659,7 +660,8 @@ void NAT::doThisConnectionRound() { // clear out the states from the last round. m_targetNodeNumber = -1; - for (Int i = 0; i < MAX_SLOTS; ++i) { + Int i = 0; + for (; i < MAX_SLOTS; ++i) { setConnectionState(i, NATCONNECTIONSTATE_NOSTATE); } @@ -1305,7 +1307,8 @@ void NAT::setConnectionState(Int nodeNumber, NATConnectionState state) { // find the menu slot of the target node. Int slotIndex = m_connectionNodes[m_targetNodeNumber].m_slotIndex; Int slot = 0; - for (Int i = 0; i < MAX_SLOTS; ++i) { + Int i = 0; + for (; i < MAX_SLOTS; ++i) { if (m_slotList[i] != NULL) { if (m_slotList[i]->isHuman()) { if (i != m_connectionNodes[m_localNodeNumber].m_slotIndex) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp index 43dc4f80a1..4c62863685 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp @@ -158,7 +158,7 @@ NetPacketList NetPacket::ConstructBigCommandPacketList(NetCommandRef *ref) { if (!DoesCommandRequireACommandID(msg->getNetCommandType())) { DEBUG_CRASH(("Trying to wrap a command that doesn't have a unique command ID")); - return NULL; + return NetPacketList(); } UnsignedInt bufferSize = GetBufferSizeNeededForCommand(msg); // need to implement. I have a drinking problem. @@ -5219,7 +5219,8 @@ NetCommandMsg * NetPacket::readGameMessage(UnsignedByte *data, Int &i) // Get the types and the number of arguments of those types. Int totalArgCount = 0; GameMessageParser *parser = newInstance(GameMessageParser)(); - for (Int j = 0; j < numArgTypes; ++j) { + Int j = 0; + for (; j < numArgTypes; ++j) { UnsignedByte type = (UnsignedByte)ARGUMENTDATATYPE_UNKNOWN; memcpy(&type, data + i, sizeof(type)); i += sizeof(type); @@ -5560,12 +5561,12 @@ NetCommandMsg * NetPacket::readPacketRouterAckMessage(UnsignedByte *data, Int &i NetCommandMsg * NetPacket::readDisconnectChatMessage(UnsignedByte *data, Int &i) { NetDisconnectChatCommandMsg *msg = newInstance(NetDisconnectChatCommandMsg); - UnsignedShort text[256]; + WideChar text[256]; UnsignedByte length; memcpy(&length, data + i, sizeof(UnsignedByte)); ++i; - memcpy(text, data + i, length * sizeof(UnsignedShort)); - i += length * sizeof(UnsignedShort); + memcpy(text, data + i, length * sizeof(WideChar)); + i += length * sizeof(WideChar); text[length] = 0; UnicodeString unitext; @@ -5583,13 +5584,13 @@ NetCommandMsg * NetPacket::readDisconnectChatMessage(UnsignedByte *data, Int &i) NetCommandMsg * NetPacket::readChatMessage(UnsignedByte *data, Int &i) { NetChatCommandMsg *msg = newInstance(NetChatCommandMsg); - UnsignedShort text[256]; + WideChar text[256]; UnsignedByte length; Int playerMask; memcpy(&length, data + i, sizeof(UnsignedByte)); ++i; - memcpy(text, data + i, length * sizeof(UnsignedShort)); - i += length * sizeof(UnsignedShort); + memcpy(text, data + i, length * sizeof(WideChar)); + i += length * sizeof(WideChar); text[length] = 0; memcpy(&playerMask, data + i, sizeof(Int)); i += sizeof(Int); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp index 182ccb276f..42ac86732b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -131,7 +131,8 @@ Bool Transport::init( UnsignedInt ip, UnsignedShort port ) } // ------- Clear buffers -------- - for (int i=0; i 0, ("Negative reference count")); --mRefCount; diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DBufferManager.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DBufferManager.h index 4eb9593638..fdb0a22042 100644 --- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DBufferManager.h +++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DBufferManager.h @@ -135,8 +135,8 @@ class W3DBufferManager void releaseSlot(W3DIndexBufferSlot *vbSlot); /// CameraShakerList; }; diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameLogic/W3DGhostObject.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameLogic/W3DGhostObject.h index 3d18e7d695..34efb3f3a7 100644 --- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameLogic/W3DGhostObject.h +++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameLogic/W3DGhostObject.h @@ -80,8 +80,8 @@ class W3DGhostObjectManager : public GhostObjectManager virtual void removeGhostObject(GhostObject *mod); virtual void setLocalPlayerIndex(int index); virtual void updateOrphanedObjects(int *playerIndexList, int numNonLocalPlayers); - virtual void W3DGhostObjectManager::releasePartitionData(void); - virtual void W3DGhostObjectManager::restorePartitionData(void); + virtual void releasePartitionData(void); + virtual void restorePartitionData(void); protected: virtual void crc( Xfer *xfer ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 3cf959eaa7..f5fd7a7eeb 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -504,7 +504,7 @@ void MilesAudioManager::stopAudio( AudioAffect which ) std::list::iterator it; PlayingAudio *playing = NULL; - if (BitTest(which, AudioAffect_Sound)) { + if (BitIsSet(which, AudioAffect_Sound)) { for (it = m_playingSounds.begin(); it != m_playingSounds.end(); ++it) { playing = *it; if (playing) { @@ -515,7 +515,7 @@ void MilesAudioManager::stopAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Sound3D)) { + if (BitIsSet(which, AudioAffect_Sound3D)) { for (it = m_playing3DSounds.begin(); it != m_playing3DSounds.end(); ++it) { playing = *it; if (playing) { @@ -526,16 +526,16 @@ void MilesAudioManager::stopAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Speech | AudioAffect_Music)) { + if (BitIsSet(which, AudioAffect_Speech | AudioAffect_Music)) { for (it = m_playingStreams.begin(); it != m_playingStreams.end(); ++it) { playing = *it; if (playing) { if (playing->m_audioEventRTS->getAudioEventInfo()->m_soundType == AT_Music) { - if (!BitTest(which, AudioAffect_Music)) { + if (!BitIsSet(which, AudioAffect_Music)) { continue; } } else { - if (!BitTest(which, AudioAffect_Speech)) { + if (!BitIsSet(which, AudioAffect_Speech)) { continue; } } @@ -553,7 +553,7 @@ void MilesAudioManager::pauseAudio( AudioAffect which ) std::list::iterator it; PlayingAudio *playing = NULL; - if (BitTest(which, AudioAffect_Sound)) { + if (BitIsSet(which, AudioAffect_Sound)) { for (it = m_playingSounds.begin(); it != m_playingSounds.end(); ++it) { playing = *it; if (playing) { @@ -562,7 +562,7 @@ void MilesAudioManager::pauseAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Sound3D)) { + if (BitIsSet(which, AudioAffect_Sound3D)) { for (it = m_playing3DSounds.begin(); it != m_playing3DSounds.end(); ++it) { playing = *it; if (playing) { @@ -571,16 +571,16 @@ void MilesAudioManager::pauseAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Speech | AudioAffect_Music)) { + if (BitIsSet(which, AudioAffect_Speech | AudioAffect_Music)) { for (it = m_playingStreams.begin(); it != m_playingStreams.end(); ++it) { playing = *it; if (playing) { if (playing->m_audioEventRTS->getAudioEventInfo()->m_soundType == AT_Music) { - if (!BitTest(which, AudioAffect_Music)) { + if (!BitIsSet(which, AudioAffect_Music)) { continue; } } else { - if (!BitTest(which, AudioAffect_Speech)) { + if (!BitIsSet(which, AudioAffect_Speech)) { continue; } } @@ -614,7 +614,7 @@ void MilesAudioManager::resumeAudio( AudioAffect which ) std::list::iterator it; PlayingAudio *playing = NULL; - if (BitTest(which, AudioAffect_Sound)) { + if (BitIsSet(which, AudioAffect_Sound)) { for (it = m_playingSounds.begin(); it != m_playingSounds.end(); ++it) { playing = *it; if (playing) { @@ -623,7 +623,7 @@ void MilesAudioManager::resumeAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Sound3D)) { + if (BitIsSet(which, AudioAffect_Sound3D)) { for (it = m_playing3DSounds.begin(); it != m_playing3DSounds.end(); ++it) { playing = *it; if (playing) { @@ -632,16 +632,16 @@ void MilesAudioManager::resumeAudio( AudioAffect which ) } } - if (BitTest(which, AudioAffect_Speech | AudioAffect_Music)) { + if (BitIsSet(which, AudioAffect_Speech | AudioAffect_Music)) { for (it = m_playingStreams.begin(); it != m_playingStreams.end(); ++it) { playing = *it; if (playing) { if (playing->m_audioEventRTS->getAudioEventInfo()->m_soundType == AT_Music) { - if (!BitTest(which, AudioAffect_Music)) { + if (!BitIsSet(which, AudioAffect_Music)) { continue; } } else { - if (!BitTest(which, AudioAffect_Speech)) { + if (!BitIsSet(which, AudioAffect_Speech)) { continue; } } @@ -2330,7 +2330,7 @@ void MilesAudioManager::processPlayingList( void ) { Real volForConsideration = getEffectiveVolume(playing->m_audioEventRTS); volForConsideration /= (m_sound3DVolume > 0.0f ? m_soundVolume : 1.0f); - Bool playAnyways = BitTest( playing->m_audioEventRTS->getAudioEventInfo()->m_type, ST_GLOBAL) || playing->m_audioEventRTS->getAudioEventInfo()->m_priority == AP_CRITICAL; + Bool playAnyways = BitIsSet( playing->m_audioEventRTS->getAudioEventInfo()->m_type, ST_GLOBAL) || playing->m_audioEventRTS->getAudioEventInfo()->m_priority == AP_CRITICAL; if( volForConsideration < m_audioSettings->m_minVolume && !playAnyways ) { // don't want to get an additional callback for this sample diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp index e6dce9d571..4047921201 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp @@ -1671,7 +1671,8 @@ void BaseHeightMapRenderObjClass::updateShorelineTiles(Int minX, Int minY, Int m } //First remove any existing extra blend tiles within this partial region - for (Int j=0; j> 16; if (x >= minX && x < maxX && @@ -2699,7 +2700,8 @@ void BaseHeightMapRenderObjClass::renderShoreLinesSorted(CameraClass *pCamera) //Loop over visible terrain and extract all the tiles that need shoreline blend if (m_shoreLineSortInfosXMajor) //map is wider than taller. { - for (Int x=drawStartX; xmatchesMode(false, false) && !c_it->matchesMode(night, snowy)) continue; @@ -3448,7 +3449,8 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( Int posCount = 0; Int endIndex = (startIndex == 0) ? 0 : 99; char buffer[256]; - for (Int i = startIndex; i <= endIndex; ++i) + Int i = startIndex; + for (; i <= endIndex; ++i) { if (i == 0) strcpy(buffer, boneNamePrefix); @@ -3604,7 +3606,8 @@ Int W3DModelDraw::getCurrentBonePositions( Int posCount = 0; Int endIndex = (startIndex == 0) ? 0 : 99; char buffer[256]; - for (Int i = startIndex; i <= endIndex; ++i) + Int i = startIndex; + for (; i <= endIndex; ++i) { if (i == 0) strcpy(buffer, boneNamePrefix); @@ -4303,7 +4306,8 @@ void W3DModelDrawModuleData::xfer( Xfer *x ) x->xferInt(&(bone->boneIndex)); x->xferUser(&(bone->mtx), sizeof(Matrix3D)); } - for (Int i=0; ixferInt(&(info->m_turrets[i].m_turretAngleBone)); x->xferInt(&(info->m_turrets[i].m_turretPitchBone)); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp index 03c76ed566..cd6a02a26d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp @@ -99,7 +99,7 @@ void W3DRightHUDDraw( GameWindow *window, WinInstanceData *instData ) { // draw the default stuff - if( BitTest(window->winGetStatus(), WIN_STATUS_IMAGE )) + if( BitIsSet(window->winGetStatus(), WIN_STATUS_IMAGE )) W3DGameWinDefaultDraw( window, instData ); } // end W3DRightHUDDraw @@ -465,7 +465,7 @@ void W3DPowerDrawA( GameWindow *window, WinInstanceData *instData ) void W3DCommandBarGridDraw( GameWindow *window, WinInstanceData *instData ) { - if( BitTest(window->winGetStatus(), WIN_STATUS_IMAGE )) + if( BitIsSet(window->winGetStatus(), WIN_STATUS_IMAGE )) { W3DGameWinDefaultDraw( window, instData ); return; @@ -744,7 +744,7 @@ void W3DDrawMapPreview( GameWindow *window, WinInstanceData *instData) } // end else - if(!BitTest(window->winGetStatus(), WIN_STATUS_IMAGE) || !window->winGetEnabledImage(0)) + if(!BitIsSet(window->winGetStatus(), WIN_STATUS_IMAGE) || !window->winGetEnabledImage(0)) TheDisplay->drawFillRect(ul.x, ul.y, lr.x -ul.x, lr.y-ul.y, lineColor); else TheDisplay->drawImage(window->winGetEnabledImage(0) , ul.x, ul.y, lr.x, lr.y ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp index 30464c897f..d896161694 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp @@ -576,10 +576,10 @@ void W3DMainMenuButtonDropShadowDraw( GameWindow *window, // get pointer to image we want to draw depending on our state, // see GadgetPushButton.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftDisabledSelectedImage( window ); rightImage = GadgetButtonGetRightDisabledSelectedImage( window ); @@ -595,10 +595,10 @@ void W3DMainMenuButtonDropShadowDraw( GameWindow *window, } } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftHiliteSelectedImage( window ); rightImage = GadgetButtonGetRightHiliteSelectedImage( window ); @@ -617,7 +617,7 @@ void W3DMainMenuButtonDropShadowDraw( GameWindow *window, else { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftEnabledSelectedImage( window ); rightImage = GadgetButtonGetRightEnabledSelectedImage( window ); @@ -794,15 +794,15 @@ static void drawText( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // set whether or not we center the wrapped text - text->setWordWrapCentered( BitTest( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); + text->setWordWrapCentered( BitIsSet( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); text->setWordWrap(size.x); // get the right text color - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textColor = window->winGetDisabledTextColor(); dropColor = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetHiliteTextColor(); dropColor = window->winGetHiliteTextBorderColor(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DCheckBox.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DCheckBox.cpp index 71ad3d111c..d5fce06d0d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DCheckBox.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DCheckBox.cpp @@ -82,12 +82,12 @@ static void drawCheckBoxText( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the right text color - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textColor = window->winGetDisabledTextColor(); dropColor = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetHiliteTextColor(); dropColor = window->winGetHiliteTextBorderColor(); @@ -143,7 +143,7 @@ void W3DGadgetCheckBoxDraw( GameWindow *window, WinInstanceData *instData ) // get the colors we should be using to draw, see GadgetCheckBox.h // draw appropriate state, see GadgetCheckBox.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { // disabled background @@ -151,7 +151,7 @@ void W3DGadgetCheckBoxDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetCheckBoxGetDisabledBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetCheckBoxGetDisabledCheckedBoxColor( window ); boxBorder = GadgetCheckBoxGetDisabledCheckedBoxBorderColor( window ); @@ -163,7 +163,7 @@ void W3DGadgetCheckBoxDraw( GameWindow *window, WinInstanceData *instData ) } } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { // hilited background @@ -171,7 +171,7 @@ void W3DGadgetCheckBoxDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetCheckBoxGetHiliteBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetCheckBoxGetHiliteCheckedBoxColor( window ); boxBorder = GadgetCheckBoxGetHiliteCheckedBoxBorderColor( window ); @@ -191,7 +191,7 @@ void W3DGadgetCheckBoxDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetCheckBoxGetEnabledBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetCheckBoxGetEnabledCheckedBoxColor( window ); boxBorder = GadgetCheckBoxGetEnabledCheckedBoxBorderColor( window ); @@ -271,27 +271,27 @@ void W3DGadgetCheckBoxImageDraw( GameWindow *window, WinInstanceData *instData ) // get the colors we should be using to draw, see GadgetCheckBoxButton.h // draw appropriate state, see GadgetCheckBoxButton.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { // disabled background // backgroundImage = GadgetCheckBoxGetDisabledImage( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) boxImage = GadgetCheckBoxGetDisabledCheckedBoxImage( window ); else boxImage = GadgetCheckBoxGetDisabledUncheckedBoxImage( window ); } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { // hilited background // backgroundImage = GadgetCheckBoxGetHiliteImage( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) boxImage = GadgetCheckBoxGetHiliteCheckedBoxImage( window ); else boxImage = GadgetCheckBoxGetHiliteUncheckedBoxImage( window ); @@ -304,7 +304,7 @@ void W3DGadgetCheckBoxImageDraw( GameWindow *window, WinInstanceData *instData ) // backgroundImage = GadgetCheckBoxGetEnabledImage( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) boxImage = GadgetCheckBoxGetEnabledCheckedBoxImage( window ); else boxImage = GadgetCheckBoxGetEnabledUncheckedBoxImage( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DComboBox.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DComboBox.cpp index 4cc8e8bb2d..d92c56abeb 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DComboBox.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DComboBox.cpp @@ -96,14 +96,14 @@ void W3DGadgetComboBoxDraw( GameWindow *window, WinInstanceData *instData ) height = size.y; // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { background = GadgetComboBoxGetDisabledColor( window ); border = GadgetComboBoxGetDisabledBorderColor( window ); titleColor = window->winGetDisabledTextColor(); titleBorder = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { background = GadgetComboBoxGetHiliteColor( window ); border = GadgetComboBoxGetHiliteBorderColor( window ); @@ -168,13 +168,13 @@ void W3DGadgetComboBoxImageDraw( GameWindow *window, WinInstanceData *instData ) height = size.y; // get the image - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { image = GadgetComboBoxGetDisabledImage( window ); titleColor = window->winGetDisabledTextColor(); titleBorder = window->winGetDisabledTextBorderColor(); } - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { image = GadgetComboBoxGetHiliteImage( window ); titleColor = window->winGetHiliteTextColor(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DHorizontalSlider.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DHorizontalSlider.cpp index ad2eecffe5..2ed8d69146 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DHorizontalSlider.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DHorizontalSlider.cpp @@ -87,14 +87,14 @@ void W3DGadgetHorizontalSliderDraw( GameWindow *window, WinInstanceData *instDat window->winGetSize( &size.x, &size.y ); // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backBorder = GadgetSliderGetDisabledBorderColor( window ); backColor = GadgetSliderGetDisabledColor( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { backBorder = GadgetSliderGetHiliteBorderColor( window ); @@ -183,7 +183,7 @@ void W3DGadgetHorizontalSliderImageDraw( GameWindow *window, origin.x += blankness/2; Int i; - if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { ICoord2D backgroundStart, backgroundEnd; backgroundStart.y = origin.y + highlightOffset.y; @@ -249,7 +249,7 @@ void W3DGadgetHorizontalSliderImageDrawB( GameWindow *window, tmp.format(L"\ns= %d <--> %d, numTicks=%g, pos = %d", s->minVal, s->maxVal, s->numTicks, s->position); tooltip.concat(tmp); - if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { highlightSquare = GadgetSliderGetHiliteImageLeft( window ); ICoord2D backgroundStart, backgroundEnd; @@ -309,7 +309,7 @@ void W3DGadgetHorizontalSliderImageDrawB( GameWindow *window, instData->setTooltipText(tooltip); -// if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) +// if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) // { // progressArrow = GadgetSliderGetHiliteImageRight( window ); // if(!progressArrow) @@ -351,7 +351,7 @@ void W3DGadgetHorizontalSliderImageDrawA( GameWindow *window, yOffset = instData->m_imageOffset.y; // get the right images - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { leftImageRight = leftImageLeft = GadgetSliderGetDisabledImageLeft( window ); @@ -360,7 +360,7 @@ void W3DGadgetHorizontalSliderImageDrawA( GameWindow *window, // smallCenterImageRight = smallCenterImageLeft = GadgetSliderGetDisabledImageSmallCenter( window ); } // end if, disabled - else //if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else //if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { leftImageLeft = GadgetSliderGetHiliteImageLeft( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DListBox.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DListBox.cpp index 9e010ed562..5406f5c8e9 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DListBox.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DListBox.cpp @@ -262,7 +262,7 @@ static void drawListBoxText( GameWindow *window, WinInstanceData *instData, { const Image *left, *right, *center, *smallCenter; - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { left = GadgetListBoxGetDisabledSelectedItemImageLeft( window ); @@ -271,7 +271,7 @@ static void drawListBoxText( GameWindow *window, WinInstanceData *instData, smallCenter = GadgetListBoxGetDisabledSelectedItemImageSmallCenter( window ); } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { left = GadgetListBoxGetHiliteSelectedItemImageLeft( window ); @@ -315,12 +315,12 @@ static void drawListBoxText( GameWindow *window, WinInstanceData *instData, Color selectColor = WIN_COLOR_UNDEFINED, selectBorder = WIN_COLOR_UNDEFINED; - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { selectColor = GadgetListBoxGetDisabledSelectedItemColor( window ); selectBorder = GadgetListBoxGetDisabledSelectedItemBorderColor( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { selectColor = GadgetListBoxGetHiliteSelectedItemColor( window ); selectBorder = GadgetListBoxGetHiliteSelectedItemBorderColor( window ); @@ -412,7 +412,7 @@ static void drawListBoxText( GameWindow *window, WinInstanceData *instData, { textColor = cells[j].color; string = (DisplayString *)cells[j].data; - if( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == TRUE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == TRUE ) { string->setWordWrap(0); // make sure the font of the text is the same as the windows @@ -515,14 +515,14 @@ void W3DGadgetListBoxDraw( GameWindow *window, WinInstanceData *instData ) height = size.y; // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { background = GadgetListBoxGetDisabledColor( window ); border = GadgetListBoxGetDisabledBorderColor( window ); titleColor = window->winGetDisabledTextColor(); titleBorder = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { background = GadgetListBoxGetHiliteColor( window ); border = GadgetListBoxGetHiliteBorderColor( window ); @@ -612,13 +612,13 @@ void W3DGadgetListBoxImageDraw( GameWindow *window, WinInstanceData *instData ) } // end if // get the image - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { image = GadgetListBoxGetDisabledImage( window ); titleColor = window->winGetDisabledTextColor(); titleBorder = window->winGetDisabledTextBorderColor(); } - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { image = GadgetListBoxGetHiliteImage( window ); titleColor = window->winGetHiliteTextColor(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp index 52263367cb..f871e31ed1 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp @@ -83,14 +83,14 @@ void W3DGadgetProgressBarDraw( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the right colors to use - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backColor = GadgetProgressBarGetDisabledColor( window ); backBorder = GadgetProgressBarGetDisabledBorderColor( window ); barColor = GadgetProgressBarGetDisabledBarColor( window ); barBorder = GadgetProgressBarGetDisabledBarBorderColor( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { backColor = GadgetProgressBarGetHiliteColor( window ); backBorder = GadgetProgressBarGetHiliteBorderColor( window ); @@ -242,7 +242,7 @@ void W3DGadgetProgressBarImageDraw( GameWindow *window, WinInstanceData *instDat yOffset = instData->m_imageOffset.y; // get the right images to use - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backLeft = GadgetProgressBarGetDisabledImageLeft( window ); @@ -255,7 +255,7 @@ void W3DGadgetProgressBarImageDraw( GameWindow *window, WinInstanceData *instDat //barSmallCenter = GadgetProgressBarGetDisabledBarImageSmallCenter( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { backLeft = GadgetProgressBarGetHiliteImageLeft( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DPushButton.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DPushButton.cpp index 51e898f857..824d99c11e 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DPushButton.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DPushButton.cpp @@ -99,15 +99,15 @@ static void drawButtonText( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // set whether or not we center the wrapped text - text->setWordWrapCentered( BitTest( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); + text->setWordWrapCentered( BitIsSet( instData->getStatus(), WIN_STATUS_WRAP_CENTERED )); text->setWordWrap(size.x); // get the right text color - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textColor = window->winGetDisabledTextColor(); dropColor = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetHiliteTextColor(); dropColor = window->winGetHiliteTextBorderColor(); @@ -126,7 +126,7 @@ static void drawButtonText( GameWindow *window, WinInstanceData *instData ) text->getSize( &width, &height ); // where to draw - if( BitTest( window->winGetStatus(), WIN_STATUS_SHORTCUT_BUTTON ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_SHORTCUT_BUTTON ) ) { // Oh god... this is a total hack for shortcut buttons to handle rendering text top left corner... textPos.x = origin.x + 2; @@ -163,10 +163,10 @@ void W3DGadgetPushButtonDraw( GameWindow *window, WinInstanceData *instData ) // get pointer to image we want to draw depending on our state, // see GadgetPushButton.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { color = GadgetButtonGetDisabledSelectedColor( window ); border = GadgetButtonGetDisabledSelectedBorderColor( window ); @@ -178,10 +178,10 @@ void W3DGadgetPushButtonDraw( GameWindow *window, WinInstanceData *instData ) } } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { color = GadgetButtonGetHiliteSelectedColor( window ); border = GadgetButtonGetHiliteSelectedBorderColor( window ); @@ -196,7 +196,7 @@ void W3DGadgetPushButtonDraw( GameWindow *window, WinInstanceData *instData ) else { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { color = GadgetButtonGetEnabledSelectedColor( window ); border = GadgetButtonGetEnabledSelectedBorderColor( window ); @@ -291,7 +291,7 @@ void W3DGadgetPushButtonImageDraw( GameWindow *window, // then we'll call the 3 picture drawing code if( GadgetButtonGetMiddleEnabledImage( window ) ) { - if( BitTest( instData->getState(), WIN_STATUS_USE_OVERLAY_STATES ) ) + if( BitIsSet( instData->getState(), WIN_STATUS_USE_OVERLAY_STATES ) ) { ICoord2D size, start; // get window position @@ -327,23 +327,23 @@ void W3DGadgetPushButtonImageDrawOne( GameWindow *window, // image = GadgetButtonGetEnabledImage( window ); - if( !BitTest( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) + if( !BitIsSet( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) { //Certain buttons have the option to specify specific images for //altered states. If they do, then we won't render the auto-overlay versions. - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) image = GadgetButtonGetDisabledSelectedImage( window ); else image = GadgetButtonGetDisabledImage( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) image = GadgetButtonGetHiliteSelectedImage( window ); else image = GadgetButtonGetHiliteImage( window ); @@ -352,7 +352,7 @@ void W3DGadgetPushButtonImageDrawOne( GameWindow *window, else { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) image = GadgetButtonGetHiliteSelectedImage( window ); } // end else, enabled only } @@ -378,16 +378,16 @@ void W3DGadgetPushButtonImageDrawOne( GameWindow *window, Display::DrawImageMode drawMode=Display::DRAW_IMAGE_ALPHA; Int colorMultiplier = 0xffffffff; - if(BitTest( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) + if(BitIsSet( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) { //we're using a new drawing system which does "grayscale" disabled buttons using original color artwork. - if( !BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) ) + if( !BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) ) { - if( !BitTest( window->winGetStatus(), WIN_STATUS_NOT_READY ) ) + if( !BitIsSet( window->winGetStatus(), WIN_STATUS_NOT_READY ) ) { //The button is disabled -- but if the button isn't "ready", we don't want to do this because //we want to show the button in color with just the clock overlay. - if( !BitTest( window->winGetStatus(), WIN_STATUS_ALWAYS_COLOR ) ) + if( !BitIsSet( window->winGetStatus(), WIN_STATUS_ALWAYS_COLOR ) ) { drawMode=Display::DRAW_IMAGE_GRAYSCALE; } @@ -449,25 +449,25 @@ void W3DGadgetPushButtonImageDrawOne( GameWindow *window, //Now render overlays that pertain to the correct state. - if( BitTest( window->winGetStatus(), WIN_STATUS_FLASHING ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_FLASHING ) ) { //Handle cameo flashing (let the flashing stack with overlay states) static const Image *hilitedOverlayIcon = TheMappedImageCollection->findImageByName( "Cameo_push" ); TheDisplay->drawImage( hilitedOverlayIcon, start.x, start.y, start.x + size.x, start.y + size.y ); } - if( BitTest( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_USE_OVERLAY_STATES ) ) { image = NULL; static const Image *pushedOverlayIcon = TheMappedImageCollection->findImageByName( "Cameo_push" ); static const Image *hilitedOverlayIcon = TheMappedImageCollection->findImageByName( "Cameo_hilited" ); if( pushedOverlayIcon && hilitedOverlayIcon ) { - if(BitTest(window->winGetStatus(), WIN_STATUS_ENABLED)) + if(BitIsSet(window->winGetStatus(), WIN_STATUS_ENABLED)) { - if (BitTest( instData->getState(), WIN_STATE_HILITED )) + if (BitIsSet( instData->getState(), WIN_STATE_HILITED )) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { //The button is hilited and pushed TheDisplay->drawImage( pushedOverlayIcon, start.x, start.y, start.x + size.x, start.y + size.y ); @@ -478,7 +478,7 @@ void W3DGadgetPushButtonImageDrawOne( GameWindow *window, TheDisplay->drawImage( hilitedOverlayIcon, start.x, start.y, start.x + size.x, start.y + size.y ); } } - else if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { //The button appears to be pushed -- CHECK_LIKE buttons that are on. TheDisplay->drawImage( pushedOverlayIcon, start.x, start.y, start.x + size.x, start.y + size.y ); @@ -510,10 +510,10 @@ void W3DGadgetPushButtonImageDrawThree(GameWindow *window, WinInstanceData *inst // get pointer to image we want to draw depending on our state, // see GadgetPushButton.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftDisabledSelectedImage( window ); rightImage = GadgetButtonGetRightDisabledSelectedImage( window ); @@ -529,10 +529,10 @@ void W3DGadgetPushButtonImageDrawThree(GameWindow *window, WinInstanceData *inst } } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftHiliteSelectedImage( window ); rightImage = GadgetButtonGetRightHiliteSelectedImage( window ); @@ -551,7 +551,7 @@ void W3DGadgetPushButtonImageDrawThree(GameWindow *window, WinInstanceData *inst else { - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { leftImage = GadgetButtonGetLeftEnabledSelectedImage( window ); rightImage = GadgetButtonGetRightEnabledSelectedImage( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DRadioButton.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DRadioButton.cpp index ed2d77259d..9c695b86d4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DRadioButton.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DRadioButton.cpp @@ -82,12 +82,12 @@ static void drawRadioButtonText( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the right text color - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textColor = window->winGetDisabledTextColor(); dropColor = window->winGetDisabledTextBorderColor(); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetHiliteTextColor(); dropColor = window->winGetHiliteTextBorderColor(); @@ -143,7 +143,7 @@ void W3DGadgetRadioButtonDraw( GameWindow *window, WinInstanceData *instData ) // get the colors we should be using to draw, see GadgetRadioButton.h // draw appropriate state, see GadgetRadioButton.h for info // - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { // disabled background @@ -151,7 +151,7 @@ void W3DGadgetRadioButtonDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetRadioGetDisabledBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetRadioGetDisabledCheckedBoxColor( window ); boxBorder = GadgetRadioGetDisabledCheckedBoxBorderColor( window ); @@ -163,7 +163,7 @@ void W3DGadgetRadioButtonDraw( GameWindow *window, WinInstanceData *instData ) } } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { // hilited background @@ -171,7 +171,7 @@ void W3DGadgetRadioButtonDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetRadioGetHiliteBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetRadioGetHiliteCheckedBoxColor( window ); boxBorder = GadgetRadioGetHiliteCheckedBoxBorderColor( window ); @@ -191,7 +191,7 @@ void W3DGadgetRadioButtonDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetRadioGetEnabledBorderColor( window ); // check box - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { boxColor = GadgetRadioGetEnabledCheckedBoxColor( window ); boxBorder = GadgetRadioGetEnabledCheckedBoxBorderColor( window ); @@ -280,7 +280,7 @@ void W3DGadgetRadioButtonImageDraw( GameWindow *window, xOffset = instData->m_imageOffset.x; yOffset = instData->m_imageOffset.y; - if( BitTest( instData->getState(), WIN_STATE_SELECTED ) ) + if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) ) { //backgroundImage = GadgetRadioGetEnabledCheckedBoxImage( window ); leftImage = GadgetRadioGetSelectedImage( window ); @@ -288,7 +288,7 @@ void W3DGadgetRadioButtonImageDraw( GameWindow *window, rightImage = GadgetRadioGetSelectedCheckedBoxImage( window ); } - else if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + else if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { // disabled background leftImage = GadgetRadioGetDisabledImage( window ); @@ -296,7 +296,7 @@ void W3DGadgetRadioButtonImageDraw( GameWindow *window, rightImage = GadgetRadioGetDisabledCheckedBoxImage( window ); } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { // hilited background leftImage = GadgetRadioGetHiliteImage( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DStaticText.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DStaticText.cpp index 800ee688fc..e46adac0e4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DStaticText.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DStaticText.cpp @@ -100,11 +100,11 @@ static void drawStaticTextText( GameWindow *window, WinInstanceData *instData, //if(wordWrap == 89) // wordWrap = 95; text->setWordWrap(wordWrap); - if( BitTest(window->winGetStatus(), WIN_STATUS_WRAP_CENTERED) ) + if( BitIsSet(window->winGetStatus(), WIN_STATUS_WRAP_CENTERED) ) text->setWordWrapCentered(TRUE); else text->setWordWrapCentered(FALSE); - if( BitTest( window->winGetStatus(), WIN_STATUS_HOTKEY_TEXT ) && TheGlobalData) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_HOTKEY_TEXT ) && TheGlobalData) text->setUseHotkey(TRUE, TheGlobalData->m_hotKeyTextColor); else text->setUseHotkey(FALSE, 0); @@ -163,7 +163,7 @@ void W3DGadgetStaticTextDraw( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the colors we will use - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backColor = GadgetStaticTextGetDisabledColor( window ); @@ -230,7 +230,7 @@ void W3DGadgetStaticTextImageDraw( GameWindow *window, WinInstanceData *instData window->winGetSize( &size.x, &size.y ); // get the colors we will use - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { image = GadgetStaticTextGetDisabledImage( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTabControl.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTabControl.cpp index a6897ecd10..1cfc3928fc 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTabControl.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTabControl.cpp @@ -83,8 +83,8 @@ void W3DGadgetTabControlDraw( GameWindow *tabControl, WinInstanceData *instData W3DGameWinDefaultDraw(tabControl, instData);//draw the background - if( BitTest( tabControl->winGetStatus(), WIN_STATUS_BORDER ) == TRUE && - !BitTest( tabControl->winGetStatus(), WIN_STATUS_SEE_THRU ) ) + if( BitIsSet( tabControl->winGetStatus(), WIN_STATUS_BORDER ) == TRUE && + !BitIsSet( tabControl->winGetStatus(), WIN_STATUS_SEE_THRU ) ) {//draw border if desired tabControl->winDrawBorder(); } @@ -394,8 +394,8 @@ void W3DGadgetTabControlImageDraw( GameWindow *tabControl, W3DGameWinDefaultDraw(tabControl, instData);//draw the background - if( BitTest( tabControl->winGetStatus(), WIN_STATUS_BORDER ) == TRUE && - !BitTest( tabControl->winGetStatus(), WIN_STATUS_SEE_THRU ) ) + if( BitIsSet( tabControl->winGetStatus(), WIN_STATUS_BORDER ) == TRUE && + !BitIsSet( tabControl->winGetStatus(), WIN_STATUS_SEE_THRU ) ) {//draw border if desired tabControl->winDrawBorder(); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp index 4ce3c3fee5..bb6c082756 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DTextEntry.cpp @@ -200,7 +200,7 @@ static void drawTextEntryText( GameWindow *window, WinInstanceData *instData, // draw blinking cursor GameWindow *parent; parent = window->winGetParent(); - if(parent && !BitTest(parent->winGetStyle(), GWS_COMBO_BOX)) + if(parent && !BitIsSet(parent->winGetStyle(), GWS_COMBO_BOX)) parent = NULL; if( (window == TheWindowManager->winGetFocus() || (parent && parent == TheWindowManager->winGetFocus())) && ((drawCnt++ >> 3) & 0x1) ) @@ -233,7 +233,7 @@ void W3DGadgetTextEntryDraw( GameWindow *window, WinInstanceData *instData ) window->winGetSize( &size.x, &size.y ); // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { compositeColor = window->winGetDisabledTextColor(); @@ -244,7 +244,7 @@ void W3DGadgetTextEntryDraw( GameWindow *window, WinInstanceData *instData ) backBorder = GadgetTextEntryGetDisabledBorderColor( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { compositeColor = window->winGetIMECompositeTextColor(); @@ -300,7 +300,7 @@ void W3DGadgetTextEntryDraw( GameWindow *window, WinInstanceData *instData ) width = size.x - (2 * startOffset); start.x = origin.x + startOffset; // offset a little bit into the entry - if( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) start.y = size.y / 2 - fontHeight / 2; else start.y = origin.y + startOffset; // offset a little bit into the entry @@ -338,7 +338,7 @@ void W3DGadgetTextEntryImageDraw( GameWindow *window, WinInstanceData *instData yOffset = instData->m_imageOffset.y; // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { textColor = window->winGetDisabledTextColor(); @@ -351,7 +351,7 @@ void W3DGadgetTextEntryImageDraw( GameWindow *window, WinInstanceData *instData smallCenterImage = GadgetTextEntryGetDisabledImageSmallCenter( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { textColor = window->winGetHiliteTextColor(); @@ -454,7 +454,7 @@ void W3DGadgetTextEntryImageDraw( GameWindow *window, WinInstanceData *instData width = size.x - (2 * startOffset); start.x = origin.x + startOffset; // offset a little bit into the entry - if( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) start.y = size.y / 2 - fontHeight / 2; else start.y = origin.y + startOffset; // offset a little bit into the entry diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp index 39441b3298..228d92a201 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DVerticalSlider.cpp @@ -83,14 +83,14 @@ void W3DGadgetVerticalSliderDraw( GameWindow *window, window->winGetSize( &size.x, &size.y ); // get the right colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { backBorder = GadgetSliderGetDisabledBorderColor( window ); backColor = GadgetSliderGetDisabledColor( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { backBorder = GadgetSliderGetHiliteBorderColor( window ); @@ -153,7 +153,7 @@ void W3DGadgetVerticalSliderImageDraw( GameWindow *window, yOffset = instData->m_imageOffset.y; // get the right images - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { topImage = GadgetSliderGetDisabledImageTop( window ); @@ -162,7 +162,7 @@ void W3DGadgetVerticalSliderImageDraw( GameWindow *window, smallCenterImage = GadgetSliderGetDisabledImageSmallCenter( window ); } // end if, disabled - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { topImage = GadgetSliderGetHiliteImageTop( window ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp index 38a3ca23f2..410a93e12b 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameWindow.cpp @@ -308,14 +308,14 @@ void W3DGameWinDefaultDraw( GameWindow *window, WinInstanceData *instData ) w3dWindow->winGetSize( &size.x, &size.y ); // image drawing vs color drawing - if( BitTest( window->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_IMAGE ) ) { const Image *image; // get image - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) image = window->winGetDisabledImage( 0 ); - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) image = window->winGetHiliteImage( 0 ); else image = window->winGetEnabledImage( 0 ); @@ -338,14 +338,14 @@ void W3DGameWinDefaultDraw( GameWindow *window, WinInstanceData *instData ) Color color, borderColor; // get colors - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) == FALSE ) { color = window->winGetDisabledColor( 0 ); borderColor = window->winGetDisabledBorderColor( 0 ); } // end if - else if( BitTest( instData->getState(), WIN_STATE_HILITED ) ) + else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) ) { color = window->winGetHiliteColor( 0 ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp index 55d5fe4ab1..edb2afa863 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp @@ -62,7 +62,8 @@ W3DBufferManager::W3DBufferManager(void) m_numEmptyIndexSlotsAllocated=0; m_numEmptyIndexBuffersAllocated=0; - for (Int i=0; iSetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorld.Transpose()); + Matrix4x4 mWorldTransposed = mWorld.Transpose(); + m_pDev->SetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorldTransposed); W3DBufferManager::W3DVertexBufferSlot *vbSlot=m_shadowVolumeVB[lightIndex][ meshIndex ]; if (!vbSlot) @@ -1522,8 +1523,8 @@ void W3DVolumetricShadow::RenderDynamicMeshVolume(Int meshIndex, Int lightIndex, m_pDev->SetIndices(shadowIndexBufferD3D,nShadowStartBatchVertex); Matrix4x4 mWorld(*meshXform); - - m_pDev->SetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorld.Transpose()); + Matrix4x4 mWorldTransposed = mWorld.Transpose(); + m_pDev->SetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorldTransposed); if (shadowVertexBufferD3D != lastActiveVertexBuffer) { m_pDev->SetStreamSource(0,shadowVertexBufferD3D,sizeof(SHADOW_DYNAMIC_VOLUME_VERTEX)); @@ -1677,8 +1678,8 @@ void W3DVolumetricShadow::RenderMeshVolumeBounds(Int meshIndex, Int lightIndex, //todo: replace this with mesh transform Matrix4x4 mWorld(1); //identity since boxes are pre-transformed to world space. - - m_pDev->SetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorld.Transpose()); + Matrix4x4 mWorldTransposed = mWorld.Transpose(); + m_pDev->SetTransform(D3DTS_WORLD,(_D3DMATRIX *)&mWorldTransposed); m_pDev->SetStreamSource(0,shadowVertexBufferD3D,sizeof(SHADOW_DYNAMIC_VOLUME_VERTEX)); m_pDev->SetVertexShader(SHADOW_DYNAMIC_VOLUME_FVF); @@ -2524,7 +2525,7 @@ void W3DVolumetricShadow::buildSilhouette(Int meshIndex, Vector3 *lightPosObject // ignore neighbors that are marked as processed as those // onces have already detected edges if present // - if( BitTest( otherNeighbor->status, POLY_PROCESSED ) ) + if( BitIsSet( otherNeighbor->status, POLY_PROCESSED ) ) continue; // for j } // end if @@ -2537,7 +2538,7 @@ void W3DVolumetricShadow::buildSilhouette(Int meshIndex, Vector3 *lightPosObject // if we have no neighbor we just record the fact that we have // real model end edges to add after this inner j loop; // - if( BitTest( polyNeighbor->status, POLY_VISIBLE ) ) + if( BitIsSet( polyNeighbor->status, POLY_VISIBLE ) ) { // check for no neighbor edges @@ -2547,7 +2548,7 @@ void W3DVolumetricShadow::buildSilhouette(Int meshIndex, Vector3 *lightPosObject visibleNeighborless = TRUE; } // end if - else if( BitTest( otherNeighbor->status, POLY_VISIBLE ) == FALSE ) + else if( BitIsSet( otherNeighbor->status, POLY_VISIBLE ) == FALSE ) { // "we" are visible and "they" are not @@ -2557,7 +2558,7 @@ void W3DVolumetricShadow::buildSilhouette(Int meshIndex, Vector3 *lightPosObject } // end if else if( otherNeighbor != NULL && - BitTest( otherNeighbor->status, POLY_VISIBLE ) ) + BitIsSet( otherNeighbor->status, POLY_VISIBLE ) ) { // "they" are visible and "we" are not diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index 436361f5ba..53b7171272 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -440,7 +440,8 @@ static void remapTexture16Bit(Int dx, Int dy, Int pitch, SurfaceClass::SurfaceDe Vector3 rgb,v_color((float)((color>>16)&0xff)/255.0f/255.0f,(float)((color>>8)&0xff)/255.0f/255.0f,(float)(color&0xff)/255.0f/255.0f); //Generate a new color gradient palette based on reference color - for (Int y=0; y>16)&0xff)/255.0f/255.0f,(float)((color>>8)&0xff)/255.0f/255.0f,(float)(color&0xff)/255.0f/255.0f); //Generate a new color gradient palette based on reference color - for (Int y=0; ygetModelConditionFlags(); - const numEntriesPerLine = 4; + const int numEntriesPerLine = 4; int lineCount = 0; for( int i = 0; i < MODELCONDITION_COUNT; i++ ) @@ -1557,7 +1557,7 @@ void W3DDisplay::drawCurrentDebugDisplay( void ) if ( m_debugDisplay && m_debugDisplayCallback ) { m_debugDisplay->reset(); - m_debugDisplayCallback( m_debugDisplay, m_debugDisplayUserData ); + m_debugDisplayCallback( m_debugDisplay, m_debugDisplayUserData, NULL ); } } } // end drawCurrentDebugDisplay @@ -2666,7 +2666,7 @@ void W3DDisplay::drawImage( const Image *image, Int startX, Int startY, } // if we have raw texture data we will use it, otherwise we are referencing filenames - if( BitTest( image->getStatus(), IMAGE_STATUS_RAW_TEXTURE ) ) + if( BitIsSet( image->getStatus(), IMAGE_STATUS_RAW_TEXTURE ) ) m_2DRender->Set_Texture( (TextureClass *)(image->getRawTextureData()) ); else m_2DRender->Set_Texture( image->getFilename().str() ); @@ -2688,7 +2688,7 @@ void W3DDisplay::drawImage( const Image *image, Int startX, Int startY, RectClass clipped_rect; RectClass clipped_uv_rect; - if( BitTest( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) + if( BitIsSet( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) { @@ -2756,7 +2756,7 @@ void W3DDisplay::drawImage( const Image *image, Int startX, Int startY, } // if rotated 90 degrees clockwise we have to adjust the uv coords - if( BitTest( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) + if( BitIsSet( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) { m_2DRender->Add_Tri( Vector2( screen_rect.Left, screen_rect.Top ), diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp index 7e9cb2aee2..b932dcd72a 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp @@ -66,7 +66,7 @@ static class MouseThreadClass : public ThreadClass { public: - MouseThreadClass::MouseThreadClass() : ThreadClass() {} + MouseThreadClass() : ThreadClass() {} void Thread_Function(); @@ -244,7 +244,8 @@ void W3DMouse::initD3DAssets(void) void W3DMouse::freeD3DAssets(void) { //free pointers to texture surfaces. - for (Int i=0; iGet_User_Data())->m_drawable; Object *object=draw->getObject(); @@ -1387,17 +1390,17 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo) //a color index. Render all objects using the same color index at once. //We render potential occludees first because this allows them to z-sort correctly //when they are behind an occluder. - for (i=0; iGet_User_Data())->m_drawable; + draw = ((DrawableInfo *)playerObjects[k][0]->Get_User_Data())->m_drawable; Object *object=draw->getObject(); Int color=object->getControllingPlayer()->getPlayerColor(); @@ -1407,13 +1410,13 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo) visiblePlayerColors[numVisiblePlayerColors++]=DX8Wrapper::Convert_Color(rgb,0.5f); } - Int thisPlayerColorIndex=playerColorIndex[i]; + Int thisPlayerColorIndex=playerColorIndex[k]; //Store this object's color index into bits 3-6 of stencil buffer DX8Wrapper::Set_DX8_Render_State(D3DRS_STENCILREF, thisPlayerColorIndex<<3); //Render all of this player's objects for which we care when they are occluded. - RenderObjClass **renderList=&playerObjects[i][0]; + RenderObjClass **renderList=&playerObjects[k][0]; for (Int j=0; jGet_User_Data()); @@ -1443,7 +1446,7 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo) //but need to render here so that they don't interfere with building occlusion. DX8Wrapper::Set_DX8_Render_State(D3DRS_STENCILENABLE, FALSE ); //these objects are not stored in stencil RenderObjClass **nonOccluderOrOccludeeList=m_nonOccludersOrOccludees; - for (i=0; ishutdown(); } @@ -3009,7 +3010,7 @@ ChipsetType W3DShaderManager::getChipset( void ) //============================================================================= /** Loads and creates a D3D pixel or vertex shader.*/ //============================================================================= -HRESULT W3DShaderManager::LoadAndCreateD3DShader(char* strFilePath, const DWORD* pDeclaration, DWORD Usage, Bool ShaderType, DWORD* pHandle) +HRESULT W3DShaderManager::LoadAndCreateD3DShader(const char* strFilePath, const DWORD* pDeclaration, DWORD Usage, Bool ShaderType, DWORD* pHandle) { if (getChipset() < DC_GENERIC_PIXEL_SHADER_1_1) return E_FAIL; //don't allow loading any shaders if hardware can't handle it. diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp index 36f81b2713..5de468ed6e 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp @@ -103,7 +103,8 @@ class TestSeismicFilter : public SeismicSimulationFilterBase for ( Real *t = workspace; t < workspaceEnd; ++t ) *t = 0.0f;// clear the workspace - for (Int x = 0; x < radius; ++x) + Int x = 0; + for (; x < radius; ++x) { for (Int y = 0; y < radius; ++y) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index 744bb5b1aa..bf54772e28 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -1906,7 +1906,7 @@ void W3DTreeBuffer::updateTopplingTree(TTree *tree) // Hit so either bounce or stop if too little remaining velocity. tree->m_angularVelocity *= -d->m_bounceVelocityPercent; - if( BitTest( tree->m_options, W3D_TOPPLE_OPTIONS_NO_BOUNCE ) == TRUE || + if( BitIsSet( tree->m_options, W3D_TOPPLE_OPTIONS_NO_BOUNCE ) == TRUE || fabs(tree->m_angularVelocity) < VELOCITY_BOUNCE_LIMIT ) { // too slow, just stop @@ -1919,7 +1919,7 @@ void W3DTreeBuffer::updateTopplingTree(TTree *tree) else if( fabs(tree->m_angularVelocity) >= VELOCITY_BOUNCE_SOUND_LIMIT ) { // fast enough bounce to warrant the bounce fx - if( BitTest( tree->m_options, W3D_TOPPLE_OPTIONS_NO_FX ) == FALSE ) { + if( BitIsSet( tree->m_options, W3D_TOPPLE_OPTIONS_NO_FX ) == FALSE ) { Vector3 loc(0, 0, 3*TREE_RADIUS_APPROX); // Kinda towards the top of the tree. jba. [7/11/2003] Vector3 xloc; tree->m_mtx.Transform_Vector(tree->m_mtx, loc, &xloc); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index 840a06a9d5..49e4dbfe5a 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -2222,7 +2222,7 @@ Drawable *W3DView::pickDrawable( const ICoord2D *screen, Bool forceAttack, PickT while (window) { // check to see if it or any of its parents are opaque. If so, we can't select anything. - if (!BitTest( window->winGetStatus(), WIN_STATUS_SEE_THRU )) + if (!BitIsSet( window->winGetStatus(), WIN_STATUS_SEE_THRU )) return NULL; window = window->winGetParent(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp index 0b12816e8b..045412b7ad 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp @@ -39,7 +39,7 @@ W3DWebBrowser::W3DWebBrowser() : WebBrowser() { } -Bool W3DWebBrowser::createBrowserWindow(char *tag, GameWindow *win) +Bool W3DWebBrowser::createBrowserWindow(const char *tag, GameWindow *win) { WinInstanceData *winData = win->winGetInstanceData(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index 9ef315b823..e8e11ce125 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -912,7 +912,7 @@ void WaterRenderObjClass::ReAcquireResources(void) if (W3DShaderManager::getChipset() >= DC_GENERIC_PIXEL_SHADER_1_1) { ID3DXBuffer *compiledShader; - char *shader = + const char *shader = "ps.1.1\n \ tex t0 \n\ tex t1 \n\ @@ -1265,7 +1265,7 @@ void WaterRenderObjClass::update( void ) { // only pay attention to mesh points that are in motion - if( BitTest( pData->status, WaterRenderObjClass::IN_MOTION ) ) + if( BitIsSet( pData->status, WaterRenderObjClass::IN_MOTION ) ) { // DAMPENING to slow the changes down diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp index d3d8a219c8..ba60368641 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp @@ -104,8 +104,8 @@ struct waveInfo Real m_initialHeightWidthFraction; //fraction of initial width to use as the initial height. Int m_timeToCompress; //time for back of wave to continue moving forward after front starts retreating. Int m_secondWaveTimeOffset; //time for second wave to start. Should always be half of first wave's TotalMs. - char *m_textureName; //name of texture to use on wave. - char *m_waveTypeName; //name of this wave type. + const char *m_textureName; //name of texture to use on wave. + const char *m_waveTypeName; //name of this wave type. }; waveInfo waveTypeInfo[WaveTypeMax]= @@ -178,7 +178,7 @@ Int WaterTracksObj::freeWaterTracksResources(void) * the specified texture. */ //============================================================================= -void WaterTracksObj::init( Real width, Real length, Vector2 &start, Vector2 &end, Char *texturename, Int waveTimeOffset) +void WaterTracksObj::init( Real width, Real length, const Vector2 &start, const Vector2 &end, const Char *texturename, Int waveTimeOffset) { freeWaterTracksResources(); //free old resources used by this track @@ -250,7 +250,7 @@ void WaterTracksObj::init( Real width, Real length, Vector2 &start, Vector2 &end * defines the maximum distance the wave will reach. */ //============================================================================= -void WaterTracksObj::init( Real width, Vector2 &start, Vector2 &end, Char *texturename) +void WaterTracksObj::init( Real width, const Vector2 &start, const Vector2 &end, const Char *texturename) { freeWaterTracksResources(); //free old resources used by this track m_boundingSphere.Init(Vector3(0,0,0),400); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFile.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFile.cpp index f20797a239..9eb8ca5fe7 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFile.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFile.cpp @@ -66,7 +66,7 @@ File* Win32BIGFile::openFile( const Char *filename, Int access ) RAMFile *ramFile = NULL; - if (BitTest(access, File::STREAMING)) + if (BitIsSet(access, File::STREAMING)) ramFile = newInstance( StreamingArchiveFile ); else ramFile = newInstance( RAMFile ); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32OSDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32OSDisplay.cpp index cc78d01824..6b56daa648 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32OSDisplay.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32OSDisplay.cpp @@ -50,40 +50,40 @@ static void RTSFlagsToOSFlags(UnsignedInt buttonFlags, UnsignedInt otherFlags, U { outWindowsFlags = 0; - if (BitTest(buttonFlags, OSDBT_OK)) { + if (BitIsSet(buttonFlags, OSDBT_OK)) { outWindowsFlags |= MB_OK; } - if (BitTest(buttonFlags, OSDBT_CANCEL)) { + if (BitIsSet(buttonFlags, OSDBT_CANCEL)) { outWindowsFlags |= MB_OKCANCEL; } //----------------------------------------------------------------------------------------------- - if (BitTest(otherFlags, OSDOF_SYSTEMMODAL)) { + if (BitIsSet(otherFlags, OSDOF_SYSTEMMODAL)) { outWindowsFlags |= MB_SYSTEMMODAL; } - if (BitTest(otherFlags, OSDOF_APPLICATIONMODAL)) { + if (BitIsSet(otherFlags, OSDOF_APPLICATIONMODAL)) { outWindowsFlags |= MB_APPLMODAL; } - if (BitTest(otherFlags, OSDOF_TASKMODAL)) { + if (BitIsSet(otherFlags, OSDOF_TASKMODAL)) { outWindowsFlags |= MB_TASKMODAL; } - if (BitTest(otherFlags, OSDOF_EXCLAMATIONICON)) { + if (BitIsSet(otherFlags, OSDOF_EXCLAMATIONICON)) { outWindowsFlags |= MB_ICONEXCLAMATION; } - if (BitTest(otherFlags, OSDOF_INFORMATIONICON)) { + if (BitIsSet(otherFlags, OSDOF_INFORMATIONICON)) { outWindowsFlags |= MB_ICONINFORMATION; } - if (BitTest(otherFlags, OSDOF_ERRORICON)) { + if (BitIsSet(otherFlags, OSDOF_ERRORICON)) { outWindowsFlags |= MB_ICONERROR; } - if (BitTest(otherFlags, OSDOF_STOPICON)) { + if (BitIsSet(otherFlags, OSDOF_STOPICON)) { outWindowsFlags |= MB_ICONSTOP; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp index 9f07e7abef..a3f95d7641 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp @@ -45,7 +45,7 @@ enum { KEYBOARD_BUFFER_SIZE = 256 }; struct ErrorLookup { HRESULT error; - char *string; + const char *string; }; static ErrorLookup errorLookup[] = { @@ -420,6 +420,6 @@ void DirectInputKeyboard::update( void ) Bool DirectInputKeyboard::getCapsState( void ) { - return BitTest( GetKeyState( VK_CAPITAL ), 0X01); + return BitIsSet( GetKeyState( VK_CAPITAL ), 0X01); } // end getCapsState diff --git a/GeneralsMD/Code/Libraries/CMakeLists.txt b/GeneralsMD/Code/Libraries/CMakeLists.txt index df1a1e3ba3..1658bfbb9e 100644 --- a/GeneralsMD/Code/Libraries/CMakeLists.txt +++ b/GeneralsMD/Code/Libraries/CMakeLists.txt @@ -8,4 +8,5 @@ add_subdirectory(Source/profile) add_subdirectory(Source/debug) add_subdirectory(Source/EABrowserDispatch) +add_subdirectory(Source/EABrowserEngine) add_subdirectory(Source/Compression) diff --git a/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h b/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h index 63ccc97a61..1f0eda6f70 100644 --- a/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h +++ b/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h @@ -169,7 +169,8 @@ inline Real deg2rad(Real rad) { return rad * (PI/180); } //----------------------------------------------------------------------------- // For twiddling bits //----------------------------------------------------------------------------- -#define BitTest( x, i ) ( ( (x) & (i) ) != 0 ) +// TheSuperHackers @compile xezon 17/03/2025 Renames BitTest to BitIsSet to prevent conflict with BitTest macro from winnt.h +#define BitIsSet( x, i ) ( ( (x) & (i) ) != 0 ) #define BitSet( x, i ) ( (x) |= (i) ) #define BitClear( x, i ) ( (x ) &= ~(i) ) #define BitToggle( x, i ) ( (x) ^= (i) ) @@ -403,7 +404,7 @@ struct Coord3D z == r.z); } - Bool operator==( const Coord3D &r ) + Bool operator==( const Coord3D &r ) const { return (x == r.x && y == r.y && diff --git a/GeneralsMD/Code/Libraries/Source/EABrowserEngine/BrowserEngine.idl b/GeneralsMD/Code/Libraries/Source/EABrowserEngine/BrowserEngine.idl new file mode 100644 index 0000000000..312a07d03c --- /dev/null +++ b/GeneralsMD/Code/Libraries/Source/EABrowserEngine/BrowserEngine.idl @@ -0,0 +1,150 @@ +// Generated .IDL file (by the OLE/COM Object Viewer) +// +// typelib filename: + +[ + uuid(6EE45698-21BA-420D-AD40-1B547699BEFB), + version(1.0) +] +library BROWSERENGINELib +{ + // TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046} + importlib("stdole2.tlb"); + + // Forward declare all types defined in this typelib + interface IFEBrowserEngine2; + interface IFEBrowserInstance2; + + [ + uuid(2B2CC8B0-2DC0-48C6-B6FD-C07820A6477E) + ] + coclass FEBrowserEngine2 { + [default] interface IFEBrowserEngine2; + }; + + [ + odl, + uuid(EE883B17-0778-4B18-A12B-E44C0D298412), + dual, + oleautomation + ] + interface IFEBrowserEngine2 : IDispatch { + [id(0x60020000)] + HRESULT Initialize(long* d3d_device); + [id(0x60020001)] + HRESULT Shutdown(); + [id(0x60020002)] + HRESULT CreateBrowser( + BSTR browsername, + BSTR url, + long parentwindow, + int x, + int y, + int w, + int h, + long option_bitmask, + IDispatch* gameinterface); + [id(0x60020003)] + HRESULT DestroyBrowser(BSTR browsername); + [id(0x60020004)] + HRESULT Navigate( + BSTR browsername, + BSTR url); + [id(0x60020005)] + HRESULT GetHWND( + BSTR browsername, + [out, retval] long* hwnd); + [id(0x60020006)] + HRESULT IsOpen( + BSTR browsername, + [out, retval] long* IsOpen); + [id(0x60020007)] + HRESULT D3DRender(int backbufferindex); + [id(0x60020008)] + HRESULT D3DUpdate(); + [id(0x60020009)] + HRESULT GetUpdateRate( + [in] BSTR browsername, + [out, retval] long* pVal); + [id(0x6002000a)] + HRESULT SetUpdateRate( + [in] BSTR browsername, + [in] long pVal); + [id(0x6002000b), propget] + HRESULT BadPageURL([out, retval] BSTR* pRate); + [id(0x6002000b), propput] + HRESULT BadPageURL([in] BSTR pRate); + [id(0x6002000d), propget] + HRESULT LoadingPageURL([out, retval] BSTR* pRate); + [id(0x6002000d), propput] + HRESULT LoadingPageURL([in] BSTR pRate); + [id(0x6002000f), propget] + HRESULT MouseFileName([out, retval] BSTR* pRate); + [id(0x6002000f), propput] + HRESULT MouseFileName([in] BSTR pRate); + [id(0x60020011), propget] + HRESULT MouseBusyFileName([out, retval] BSTR* pRate); + [id(0x60020011), propput] + HRESULT MouseBusyFileName([in] BSTR pRate); + }; + + [ + uuid(812A58AA-39E8-476E-BEED-00D79B76940B) + ] + coclass FEBrowserInstance2 { + [default] interface IFEBrowserInstance2; + }; + + [ + odl, + uuid(A6759E9F-2CA1-4A04-AF23-1658673E30B5), + dual, + oleautomation + ] + interface IFEBrowserInstance2 : IDispatch { + [id(0x60020000)] + HRESULT Navigate(BSTR url); + [id(0x60020001)] + HRESULT RequestURL( + [in] VARIANT requesttype, + [in] BSTR url, + [in] BSTR formdata, + [in] BSTR extradata, + [in] VARIANT callback, + [out, retval] VARIANT* result); + [id(0x60020002)] + HRESULT CloseBrowser(); + [id(0x60020003), propget] + HRESULT EngineVersion([out, retval] VARIANT* pVal); + [id(0x60020004), propget] + HRESULT gameinterface([out, retval] IDispatch** pVal); + [id(0x60020005), propget] + HRESULT CommandLineArgs([out, retval] VARIANT* pVal); + [id(0x60020006), propget] + HRESULT IsReleaseBuild([out, retval] long* pVal); + [id(0x60020007), propget] + HRESULT InstallFolder([out, retval] BSTR* pVal); + [id(0x60020008), propget] + HRESULT hwnd([out, retval] long* pHwnd); + [id(0x60020009), propget] + HRESULT UpdateRate([out, retval] long* pRate); + [id(0x60020009), propput] + HRESULT UpdateRate([in] long pRate); + [id(0x6002000b), propget] + HRESULT Name([out, retval] BSTR* pVal); + [id(0x6002000c), propget] + HRESULT SysInfo_OS([out, retval] BSTR* pVal); + [id(0x6002000d), propget] + HRESULT SysInfo_RAM([out, retval] long* pVal); + [id(0x6002000e), propget] + HRESULT SysInfo_CPUType([out, retval] BSTR* pVal); + [id(0x6002000f), propget] + HRESULT SysInfo_CPUSpeed([out, retval] long* pVal); + [id(0x60020010), propget] + HRESULT SysInfo_XRes([out, retval] long* pVal); + [id(0x60020011), propget] + HRESULT SysInfo_YRes([out, retval] long* pVal); + [id(0x60020012), propget] + HRESULT SysInfo_VideoAdapter([out, retval] BSTR* pVal); + }; +}; diff --git a/GeneralsMD/Code/Libraries/Source/EABrowserEngine/CMakeLists.txt b/GeneralsMD/Code/Libraries/Source/EABrowserEngine/CMakeLists.txt new file mode 100644 index 0000000000..169a33a9df --- /dev/null +++ b/GeneralsMD/Code/Libraries/Source/EABrowserEngine/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(z_browserengine INTERFACE) + +if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") + add_custom_command( + OUTPUT BrowserEngine_i.c BrowserEngine.h + COMMAND midl.exe "${CMAKE_CURRENT_LIST_DIR}\\BrowserEngine.idl" /header BrowserEngine.h + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserEngine.idl" + VERBATIM + ) + add_library(z_browserenginewin STATIC BrowserEngine_i.c) + set_target_properties(z_browserenginewin PROPERTIES OUTPUT_NAME browserenginewin) + target_link_libraries(z_browserengine INTERFACE z_browserenginewin) +endif() + +target_include_directories(z_browserengine INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/..) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt index d612d7720a..c4512a806d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt @@ -240,6 +240,13 @@ set_target_properties(z_ww3d2 PROPERTIES OUTPUT_NAME ww3d2) target_sources(z_ww3d2 PRIVATE ${WW3D2_SRC}) +if (NOT IS_VS6_BUILD) + target_link_libraries(z_ww3d2 PUBLIC + comsuppw + ) +endif() + target_link_libraries(z_ww3d2 PRIVATE + z_browserengine z_wwcommon ) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp index bb6bb104b2..8ffa568aa8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp @@ -114,7 +114,8 @@ Build_List_From_String // // Determine how many entries there will be in the list // - for (const char *entry = buffer; + const char *entry = buffer; + for (; (entry != NULL) && (entry[1] != 0); entry = ::strstr (entry, delimiter)) { @@ -157,7 +158,7 @@ Build_List_From_String // Copy this entry into its own string // StringClass entry_string = entry; - char *delim_start = ::strstr (entry_string, delimiter); + char *delim_start = ::strstr (entry_string.Peek_Buffer(), delimiter); if (delim_start != NULL) { delim_start[0] = 0; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index 513e544010..d87bf79702 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -540,7 +540,8 @@ void WW3DAssetManager::Free_Assets_With_Exclusion_List(const DynamicVectorClass< exclude_array.Set_Growth_Step(DEFAULT_EXCLUDE_ARRAY_SIZE); // iterate the array of prototypes saving each one that should be excluded from deletion - for (int i=0; iReport_Load_On_Demand_RObj(name); char filename [MAX_PATH]; - char *mesh_name = ::strchr (name, '.'); + const char *mesh_name = ::strchr (name, '.'); if (mesh_name != NULL) { ::lstrcpyn (filename, name, ((int)mesh_name) - ((int)name) + 1); ::lstrcat (filename, ".w3d"); @@ -989,7 +990,7 @@ HAnimClass * WW3DAssetManager::Get_HAnim(const char * name) AssetStatusClass::Peek_Instance()->Report_Load_On_Demand_HAnim(name); char filename[ MAX_PATH ]; - char *animname = strchr( name, '.'); + const char *animname = strchr( name, '.'); if (animname != NULL) { sprintf( filename, "%s.w3d", animname+1); } else { diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h index e67df393d5..c6234d95e2 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/collect.h @@ -64,7 +64,7 @@ class CollectionClass : public CompositeRenderObjClass CollectionClass(void); CollectionClass(const CollectionDefClass & def); CollectionClass(const CollectionClass & src); - CollectionClass & CollectionClass::operator = (const CollectionClass &); + CollectionClass & operator = (const CollectionClass &); virtual ~CollectionClass(void); virtual RenderObjClass * Clone(void) const; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp index 0c10ccc088..c6ef1e81d8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp @@ -684,7 +684,8 @@ void DazzleRenderObjClass::Init_Type(const DazzleInitClass& i) if (i.type>=type_count) { unsigned new_count=i.type+1; DazzleTypeClass** new_types=W3DNEWARRAY DazzleTypeClass*[new_count]; - for (unsigned a=0;a=lensflare_count) { unsigned new_count=i.type+1; LensflareTypeClass** new_lensflares=W3DNEWARRAY LensflareTypeClass*[new_count]; - for (unsigned a=0;a16) { // If surface is bigger than one block (8 or 16 bytes)... diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp index 300db6e146..f95767bde5 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/distlod.cpp @@ -108,7 +108,8 @@ RenderObjClass * DistLODPrototypeClass::Create(void) int count = dist->Get_Num_Sub_Objects(); RenderObjClass ** robj = W3DNEWARRAY RenderObjClass * [count]; - for (int i=0; iGet_Sub_Object(i); WWASSERT(robj[count - 1 - i] != NULL); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h index 48d2acda22..7a2b56cbad 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dllist.h @@ -73,6 +73,8 @@ class DLListClass template class DLDestroyListClass : public DLListClass { + using DLListClass::Head; + public: virtual ~DLDestroyListClass() { diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index 627e94dbc0..905e3e95b4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -261,7 +261,8 @@ void DX8TextureCategoryClass::Remove_Polygon_Renderer(DX8PolygonRendererClass* p void DX8FVFCategoryContainer::Remove_Texture_Category(DX8TextureCategoryClass* tex_category) { - for (unsigned pass=0;passGet_Texture_Name() : "NULL")); + SNAPSHOT_SAY(("Set_Texture(%d,%s)\n",i,Peek_Texture(i) ? Peek_Texture(i)->Get_Texture_Name().Peek_Buffer() : "NULL")); DX8Wrapper::Set_Texture(i,Peek_Texture(i)); } @@ -2097,7 +2098,8 @@ void DX8MeshRendererClass::Register_Mesh_Type(MeshModelClass* mmc) /* ** Search for an existing FVF Category Container that matches this mesh */ - for (int i=0;iPeek_Head(); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.h index bebed60396..9e56b66ce9 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.h @@ -158,7 +158,7 @@ class DX8FVFCategoryContainer : public MultiListObjectClass bool AnyDelayedPassesToRender; void Generate_Texture_Categories(Vertex_Split_Table& split_table,unsigned vertex_offset); - void DX8FVFCategoryContainer::Insert_To_Texture_Category( + void Insert_To_Texture_Category( Vertex_Split_Table& split_table, TextureClass** textures, VertexMaterialClass* mat, diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp index 9e6687b7fd..fb1b92b724 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp @@ -36,12 +36,25 @@ #if ENABLE_EMBEDDED_BROWSER +#if defined(_MSC_VER) && _MSC_VER < 1300 + // Import the Browser Type Library // BGC, the path for the dll file is pretty odd, no? // I'll leave it like this till I can figure out a // better way. #import "..\..\..\..\..\run\BrowserEngine.DLL" no_namespace +#else + +#include +#include + +#include "EABrowserEngine/BrowserEngine.h" + +typedef _com_ptr_t<_com_IIID> IFEBrowserEngine2Ptr; + +#endif + static IFEBrowserEngine2Ptr pBrowser = 0; HWND DX8WebBrowser::hWnd = 0; @@ -219,7 +232,12 @@ void DX8WebBrowser::DestroyBrowser(const char* browsername) bool DX8WebBrowser::Is_Browser_Open(const char* browsername) { if(pBrowser == 0) return false; +#if defined(_MSC_VER) && _MSC_VER < 1300 return (pBrowser->IsOpen(_bstr_t(browsername)) != 0); +#else + long isOpen; + return (pBrowser->IsOpen(_bstr_t(browsername), &isOpen) != 0); +#endif } // ****************************************************************************************** diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 61983ce7f1..4b9589eff1 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -803,7 +803,8 @@ void DX8Wrapper::Enumerate_Devices() bool DX8Wrapper::Set_Any_Render_Device(void) { // Then fullscreen - for (int dev_number = 0; dev_number < _RenderDeviceNameTable.Count(); dev_number++) { + int dev_number = 0; + for (; dev_number < _RenderDeviceNameTable.Count(); dev_number++) { if (Set_Render_Device(dev_number,-1,-1,-1,0,false)) { return true; } @@ -1458,7 +1459,8 @@ bool DX8Wrapper::Find_Color_And_Z_Mode(int resx,int resy,int bitdepth,D3DFORMAT bool found = false; unsigned int mode = 0; - for (int format_index=0; format_index < format_count; format_index++) { + int format_index=0; + for (; format_index < format_count; format_index++) { found |= Find_Color_Mode(format_table[format_index],resx,resy,&mode); if (found) break; } @@ -2244,11 +2246,12 @@ void DX8Wrapper::Apply_Render_State_Changes() } unsigned mask=TEXTURE0_CHANGED; - for (int i=0;iGet_Max_Textures_Per_Pass();++i,mask<<=1) + int i=0; + for (;iGet_Max_Textures_Per_Pass();++i,mask<<=1) { if (render_state_changed&mask) { - SNAPSHOT_SAY(("DX8 - apply texture %d (%s)\n",i,render_state.Textures[i] ? render_state.Textures[i]->Get_Full_Path() : "NULL")); + SNAPSHOT_SAY(("DX8 - apply texture %d (%s)\n",i,render_state.Textures[i] ? render_state.Textures[i]->Get_Full_Path().Peek_Buffer() : "NULL")); if (render_state.Textures[i]) { @@ -2282,7 +2285,7 @@ void DX8Wrapper::Apply_Render_State_Changes() #ifdef MESH_RENDER_SNAPSHOT_ENABLED if ( WW3D::Is_Snapshot_Activated() ) { D3DLIGHT8 * light = &(render_state.Lights[index]); - static char * _light_types[] = { "Unknown", "Point","Spot", "Directional" }; + static const char * _light_types[] = { "Unknown", "Point","Spot", "Directional" }; WWASSERT((light->Type >= 0) && (light->Type <= 3)); SNAPSHOT_SAY((" type = %s amb = %4.2f,%4.2f,%4.2f diff = %4.2f,%4.2f,%4.2f spec = %4.2f, %4.2f, %4.2f\n", @@ -3085,7 +3088,8 @@ void DX8Wrapper::Set_Light_Environment(LightEnvironmentClass* light_env) } D3DLIGHT8 light; - for (int l=0;lVertex_Material_Count(); lp ++) { + int lp = 0, found = 0; + for (; lp < Peek_Material_Info()->Vertex_Material_Count(); lp ++) { VertexMaterialClass *mat = Peek_Material_Info()->Get_Vertex_Material(lp); if (material == mat) { VertexMaterialIdx[pass] = lp; - found = true; + found = 1; mat->Release_Ref(); break; } @@ -776,11 +777,12 @@ int DynamicMeshClass::Set_Texture(TextureClass *texture, bool dont_search, int p // list. if we are not supposed to search the list for it then just add // it. if (!dont_search) { - for (int lp = 0, found = 0; lp < Peek_Material_Info()->Texture_Count(); lp ++) { + int lp = 0, found = 0; + for (; lp < Peek_Material_Info()->Texture_Count(); lp ++) { TextureClass *tex = Peek_Material_Info()->Get_Texture(lp); if (texture == tex) { TextureIdx[pass] = lp; - found = true; + found = 1; tex->Release_Ref(); break; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp index 336fae0130..1c24bad33f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/formconv.cpp @@ -205,7 +205,8 @@ WW3DZFormat D3DFormat_To_WW3DZFormat(D3DFORMAT d3d_format) */ void Init_D3D_To_WW3_Conversion() { - for (int i=0;i & excl // File that this anim came from should be the name after the '.' // Anims are named in the format: . const char * anim_name = anim->Get_Name(); - char * filename = strchr(anim_name,'.'); + const char * filename = strchr(anim_name,'.'); if (filename != NULL) { exclusion_list.Add(StringClass(filename+1)); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp index a39747cf4f..6d03386dd6 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hmorphanim.cpp @@ -252,7 +252,8 @@ static int Build_List_From_String // // Determine how many entries there will be in the list // - for (const char *entry = buffer; + const char *entry = buffer; + for (; (entry != NULL) && (entry[1] != 0); entry = ::strstr (entry, delimiter)) { @@ -295,7 +296,7 @@ static int Build_List_From_String // Copy this entry into its own string // StringClass entry_string = entry; - char *delim_start = ::strstr (entry_string, delimiter); + char *delim_start = ::strstr (entry_string.Peek_Buffer(), delimiter); if (delim_start != NULL) { delim_start[0] = 0; } @@ -489,7 +490,7 @@ void HMorphAnimClass::Set_Name(const char * name) // Try to find the separator (a period) // StringClass full_name = name; - char *separator = ::strchr (full_name, '.'); + char *separator = ::strchr (full_name.Peek_Buffer(), '.'); if (separator != NULL) { // diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp index 689c6f164d..8e9f2b8fa6 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htree.cpp @@ -808,7 +808,8 @@ void HTreeClass::Combo_Update float weight_total = 0; int wcount = 0; - for ( int anim_num = 0; anim_num < anim->Get_Num_Anims(); anim_num++ ) { + int anim_num = 0; + for ( ; anim_num < anim->Get_Num_Anims(); anim_num++ ) { HAnimClass *motion = anim->Get_Motion( anim_num ); @@ -1077,7 +1078,7 @@ HTreeClass * HTreeClass::Alter_Avatar_HTree( const HTreeClass *tree, Vector3 &sc // being stretched out on the Y-axis instead of the Z-axis like the rest of the bodies. Hence, the list of pivots // below are ones that I will special case and scale them based on the Z-axis scaling factor instead of the Y-axis // scaling factor. - char * flip_list[] = { " RIGHTFOREARM", " RIGHTHAND", " LEFTFOREARM", " LEFTHAND", "RIGHTINDEX", "RIGHTFINGERS", "RIGHTTHUMB", "LEFTINDEX", "LEFTFINGERS", "LEFTTHUMB", 0 }; + const char * flip_list[] = { " RIGHTFOREARM", " RIGHTHAND", " LEFTFOREARM", " LEFTHAND", "RIGHTINDEX", "RIGHTFINGERS", "RIGHTTHUMB", "LEFTINDEX", "LEFTFINGERS", "LEFTTHUMB", 0 }; // Clone the new tree with the tree that is passed in HTreeClass * new_tree = new HTreeClass( *tree ); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp index bea4284d04..44f218e2dc 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp @@ -149,7 +149,8 @@ void HTreeManagerClass::Free_All_Trees_With_Exclusion_List(const W3DExclusionLis // or copying it to the new tail index if it is excluded. int new_tail = 0; - for (int treeidx=0; treeidx < MAX_TREES; treeidx++) { + int treeidx=0; + for (; treeidx < MAX_TREES; treeidx++) { if (TreePtr[treeidx] != NULL) { if (exclusion_list.Is_Excluded(TreePtr[treeidx])) { diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h index 8de8b62d70..efc8a81738 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/intersec.h @@ -173,7 +173,7 @@ class IntersectionClass // this copy routine is used when the model coords are needed to be copied along with the other information. - inline void IntersectionClass::Copy_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source) { + inline void Copy_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source) { Destination->ModelMatrix = Source->ModelMatrix; Destination->ModelLocation = Source->ModelLocation; Copy_Partial_Results(Destination, Source); @@ -181,7 +181,7 @@ class IntersectionClass } - inline void IntersectionClass::Copy_Results(IntersectionResultClass *Source) { + inline void Copy_Results(IntersectionResultClass *Source) { Copy_Results(&Result, Source); } @@ -190,7 +190,7 @@ class IntersectionClass // otherwise the results are copied into the request structure. // This does not copy the matrix or location members; it is intended to be used during poly testing // where these values are identical between results, or as a completion function for Copy_Results() - inline void IntersectionClass::Copy_Partial_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source) + inline void Copy_Partial_Results(IntersectionResultClass *Destination, IntersectionResultClass *Source) { Destination->IntersectedPolygon = Source->IntersectedPolygon; Destination->Intersection = Source->Intersection; @@ -225,7 +225,7 @@ class IntersectionClass // this will only set the result's range if intersection occurs; it is intended to be used as a first pass intersection test // before intersecting the mesh polygons itself. // Note: Does NOT do Max_Distance testing - inline bool IntersectionClass::Intersect_Sphere_Quick(SphereClass &Sphere, IntersectionResultClass *FinalResult) + inline bool Intersect_Sphere_Quick(SphereClass &Sphere, IntersectionResultClass *FinalResult) { // make a unit vector from the ray origin to the sphere center Vector3 sphere_vector(Sphere.Center - *RayLocation); @@ -243,7 +243,7 @@ class IntersectionClass // this will find the intersection with the sphere and the intersection normal if needed. - inline bool IntersectionClass::Intersect_Sphere(SphereClass &Sphere, IntersectionResultClass *FinalResult) + inline bool Intersect_Sphere(SphereClass &Sphere, IntersectionResultClass *FinalResult) { if(!Intersect_Sphere_Quick(Sphere, FinalResult)) return false; @@ -363,14 +363,14 @@ class IntersectionClass ** Designed for use with _Intersect_Triangles_Z. */ //static inline void _Intersect_Lines_Z(Vector3 &A, Vector3 &B, Vector2 &UVStart, Vector2 &UVEnd, Vector3 &C, Vector3 &D, Vector3 ClippedPoints[6], Vector2 ClippedUV[6], int &DestIndex); - static inline bool IntersectionClass::In_Front_Of_Line + static inline bool In_Front_Of_Line ( const Vector3 & p, // point to test const Vector3 & e0, // point on edge const Vector3 & de // direction of edge ); - static inline float IntersectionClass::Intersect_Lines + static inline float Intersect_Lines ( const Vector3 & p0, // start of line segment const Vector3 & p1, // end of line segment @@ -378,7 +378,7 @@ class IntersectionClass const Vector3 & de // direction of clipping edge ); - static inline int IntersectionClass::Clip_Triangle_To_LineXY( + static inline int Clip_Triangle_To_LineXY( int incount, Vector3 * InPoints, Vector2 * InUVs, diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/lightenvironment.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/lightenvironment.cpp index 5c473c5edc..1ff112cb2c 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/lightenvironment.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/lightenvironment.cpp @@ -52,8 +52,10 @@ const float DIFFUSE_TO_AMBIENT_FRACTION = 1.0f; /* ** Static variables */ -static _LightingLODCutoff = 0.5f; -static _LightingLODCutoff2 = 0.5f * 0.5f; +// TheSuperHackers @fix xezon 13/03/2025 Set integer type as per the original. +// TODO: Investigate if it should be a float. +static int _LightingLODCutoff = 0.5f; +static int _LightingLODCutoff2 = 0.5f * 0.5f; /************************************************************************************************ diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.cpp index 48a4b1f78c..b6b3945ea8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.cpp @@ -1040,7 +1040,7 @@ BumpEnvTextureMapperClass::BumpEnvTextureMapperClass(float rad_per_sec, float sc { } -BumpEnvTextureMapperClass::BumpEnvTextureMapperClass(INIClass &ini, char *section, unsigned int stage) : +BumpEnvTextureMapperClass::BumpEnvTextureMapperClass(INIClass &ini, const char *section, unsigned int stage) : LinearOffsetTextureMapperClass(ini, section, stage), LastUsedSyncTime(WW3D::Get_Sync_Time()), CurrentAngle(0.0f) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.h index 3d48e25c87..06401a9573 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.h @@ -515,7 +515,7 @@ class BumpEnvTextureMapperClass : public LinearOffsetTextureMapperClass public: BumpEnvTextureMapperClass(float rad_per_sec, float scale_factor, const Vector2 & offset_per_sec, const Vector2 & start_offset, bool clamp_fix, const Vector2 &scale, unsigned int stage); - BumpEnvTextureMapperClass(INIClass &ini, char *section, unsigned int stage); + BumpEnvTextureMapperClass(INIClass &ini, const char *section, unsigned int stage); BumpEnvTextureMapperClass(const BumpEnvTextureMapperClass & src); virtual int Mapper_ID(void) const { return MAPPER_ID_BUMPENV;} diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp index 75d301db04..eff58da5a7 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp @@ -184,7 +184,7 @@ class VertexArrayClass delete[] HashTable; } - void VertexArrayClass::Set_Bounds(const Vector3 & minv,const Vector3 & maxv) + void Set_Bounds(const Vector3 & minv,const Vector3 & maxv) { Extent = (maxv - minv) / 2.0f; Center = (maxv + minv) / 2.0f; @@ -296,7 +296,8 @@ class VertexArrayClass } // colors, and material id's must match for all passes - for (int pass=0; pass < MeshBuilderClass::MAX_PASSES; pass++) { + int pass=0; + for (; pass < MeshBuilderClass::MAX_PASSES; pass++) { if (v0.DiffuseColor[pass] != v1.DiffuseColor[pass]) return 0; if (v0.SpecularColor[pass] != v1.SpecularColor[pass]) return 0; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp index e12d248f40..3cd652ffc5 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp @@ -2110,7 +2110,8 @@ void MeshGeometryClass::get_deformed_screenspace_vertices(Vector4 *dst_vert,cons Matrix4x4 tm = prj * htree->Get_Transform(idx); // Count equal matrices (the vertices should be pre-sorted by matrices they use) - for (int cnt = vi; cnt < vertex_count; cnt++) if (idx!=bonelink[cnt]) break; + int cnt = vi; + for (; cnt < vertex_count; cnt++) if (idx!=bonelink[cnt]) break; // Transform to screenspace (x,y,z,w) VectorProcessorClass::Transform( diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp index fb6695a44e..5130b0520c 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp @@ -647,7 +647,8 @@ void MeshMatDescClass::Post_Load_Process(bool lighting_enabled,MeshModelClass * ** Pre-multiply the vertex color arrays. */ bool set_lighting_to_false=true; - for (int pass=0; passVertexMaterialIdx = -1; } else { unsigned long crc = vmat->Get_CRC(); - for (int vi=0; viTextureIdx = -1; } else { - for (int ti=0; tiGet_Texture_Name(),tex->Get_Texture_Name()) == 0) break; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp index 5519d3e685..1c503431c0 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/metalmap.cpp @@ -95,7 +95,8 @@ MetalMapManagerClass::MetalMapManagerClass(INIClass &ini) : // Determine how many metals are in this file char section[255]; - for (int lp = 0; ; lp++) { + int lp = 0; + for (; ; lp++) { sprintf(section, "Metal%02d", lp); if (!ini.Find_Section(section)) { break; // NAK - Mar 8, 2000: changed to a break to fix off by one error in lp diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/motchan.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/motchan.cpp index 72e4285a06..3d13904e66 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/motchan.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/motchan.cpp @@ -1280,7 +1280,8 @@ return; float value_min=FLT_MAX; float value_max=-FLT_MAX; int count=datasize/sizeof(float); - for (int i=0;i100000.0f) value=0.0f; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_buf.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_buf.cpp index 934ddb0afa..f8edab3d7c 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_buf.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_buf.cpp @@ -1476,7 +1476,8 @@ void ParticleBufferClass::Reset_Colors(ParticlePropertyStruct &new_prop // keytime of MaxAge or larger. (If all keyframes below MaxAge, color is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int ckey = 0; ckey < new_props.NumKeyFrames; ckey++) { + unsigned int ckey = 0; + for (; ckey < new_props.NumKeyFrames; ckey++) { ui_current_key_time = (unsigned int)(new_props.KeyTimes[ckey] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; @@ -1635,7 +1636,8 @@ void ParticleBufferClass::Reset_Opacity(ParticlePropertyStruct &new_props // keytime of MaxAge or larger. (If all keyframes below MaxAge, alpha is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int akey = 0; akey < new_props.NumKeyFrames; akey++) { + unsigned int akey = 0; + for (; akey < new_props.NumKeyFrames; akey++) { ui_current_key_time = (unsigned int)(new_props.KeyTimes[akey] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; @@ -1791,7 +1793,8 @@ void ParticleBufferClass::Reset_Size(ParticlePropertyStruct &new_props) // keytime of MaxAge or larger. (If all keyframes below MaxAge, size is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int skey = 0; skey < new_props.NumKeyFrames; skey++) { + unsigned int skey = 0; + for (; skey < new_props.NumKeyFrames; skey++) { ui_current_key_time = (unsigned int)(new_props.KeyTimes[skey] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; @@ -1960,7 +1963,8 @@ void ParticleBufferClass::Reset_Rotations(ParticlePropertyStruct &new_pro // keytime of MaxAge or larger. (If all keyframes below MaxAge, the value is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int key = 0; key < new_props.NumKeyFrames; key++) { + unsigned int key = 0; + for (; key < new_props.NumKeyFrames; key++) { ui_current_key_time = (unsigned int)(new_props.KeyTimes[key] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; @@ -2174,7 +2178,8 @@ void ParticleBufferClass::Reset_Frames(ParticlePropertyStruct &new_props) // keytime of MaxAge or larger. (If all keyframes below MaxAge, the value is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int key = 0; key < new_props.NumKeyFrames; key++) { + unsigned int key = 0; + for (; key < new_props.NumKeyFrames; key++) { ui_current_key_time = (unsigned int)(new_props.KeyTimes[key] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; @@ -2321,7 +2326,8 @@ void ParticleBufferClass::Reset_Blur_Times(ParticlePropertyStruct &new_bl // keytime of MaxAge or larger. (If all keyframes below MaxAge, the value is // constant during the last segment between last keyframe and MaxAge). ui_previous_key_time = 0; - for (unsigned int key = 0; key < new_blur_times.NumKeyFrames; key++) { + unsigned int key = 0; + for (; key < new_blur_times.NumKeyFrames; key++) { ui_current_key_time = (unsigned int)(new_blur_times.KeyTimes[key] * 1000.0f); WWASSERT(ui_current_key_time > ui_previous_key_time); if (ui_current_key_time >= MaxAge) break; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index fc4260697f..a915b7f963 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -86,7 +86,7 @@ #include "rinfo.h" #include "camera.h" #include "dx8fvf.h" -#include "D3DXMath.h" +#include "D3DX8Math.h" #include "sortingrenderer.h" // Upgraded to DX8 2/2/01 HY @@ -1041,9 +1041,9 @@ void PointGroupClass::Update_Arrays( if (VertexLoc.Length() < total_vnum) { // Resize arrays (2x guardband to prevent frequent reallocations). - VertexLoc.Resize(total_vnum * 2, false); - VertexUV.Resize(total_vnum * 2, false); - VertexDiffuse.Resize(total_vnum * 2, false); + VertexLoc.Resize(total_vnum * 2, NULL); + VertexUV.Resize(total_vnum * 2, NULL); + VertexDiffuse.Resize(total_vnum * 2, NULL); } int vert, i, j; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h index 6d0d7ab948..861cb92868 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/prim_anim.h @@ -160,6 +160,10 @@ class PrimitiveAnimationChannelClass template class LERPAnimationChannelClass : public PrimitiveAnimationChannelClass { + using PrimitiveAnimationChannelClass::m_Data; + using PrimitiveAnimationChannelClass::m_LastIndex; + using PrimitiveAnimationChannelClass::KeyClass; + public: ///////////////////////////////////////////////////////// @@ -182,7 +186,7 @@ int PrimitiveAnimationChannelClass::Get_Key_Count (void) const // Set_Key_Value ///////////////////////////////////////////////////////// template -const PrimitiveAnimationChannelClass::KeyClass &PrimitiveAnimationChannelClass::Get_Key (int index) const +typename const PrimitiveAnimationChannelClass::KeyClass &PrimitiveAnimationChannelClass::Get_Key (int index) const { return m_Data[index]; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp index b255848dc4..cb8310806d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp @@ -1720,8 +1720,8 @@ FontCharsClass::Grow_Unicode_Array (WCHAR ch) return ; } - uint16 first_index = min( FirstUnicodeChar, ch ); - uint16 last_index = max( LastUnicodeChar, ch ); + uint16 first_index = min( FirstUnicodeChar, static_cast(ch) ); + uint16 last_index = max( LastUnicodeChar, static_cast(ch) ); uint16 count = (last_index - first_index) + 1; // diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp index 039d0f0cec..70c334500d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.cpp @@ -119,7 +119,7 @@ Filename_From_Asset_Name (const char *asset_name) // // Do we need to strip off the model's suffix? // - char *suffix = ::strchr (filename, '.'); + char *suffix = ::strchr (filename.Peek_Buffer(), '.'); if (suffix != NULL) { suffix[0] = 0; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h index 8654b87cc1..2bc90c2455 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/rendobj.h @@ -238,7 +238,7 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL RenderObjClass(void); RenderObjClass(const RenderObjClass & src); - RenderObjClass & RenderObjClass::operator = (const RenderObjClass &); + RenderObjClass & operator = (const RenderObjClass &); virtual ~RenderObjClass(void) { if (RenderHook) delete RenderHook; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h index 6440bf531c..31ba57092e 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/segline.h @@ -58,7 +58,7 @@ class SegmentedLineClass : public RenderObjClass SegmentedLineClass(void); SegmentedLineClass(const SegmentedLineClass & src); - SegmentedLineClass & SegmentedLineClass::operator = (const SegmentedLineClass &that); + SegmentedLineClass & operator = (const SegmentedLineClass &that); virtual ~SegmentedLineClass(void); void Reset_Line(void); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp index b0c6f1c089..fcca783682 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp @@ -1591,7 +1591,8 @@ void SphereMeshClass::Generate(float radius, int slices, int stacks) fans = W3DNEWARRAY int[fan_size * fan_ct]; // Do Fan #1 - for (int ct = 0; ct < fan_size; ct++) { + int ct = 0; + for (; ct < fan_size; ct++) { fans[ct] = ct; } //fans[ct] = 1; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h index 751f18cd48..7b8e1472dd 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/streak.h @@ -64,7 +64,7 @@ class StreakLineClass : public RenderObjClass StreakLineClass(void); StreakLineClass(const StreakLineClass & src); - StreakLineClass & StreakLineClass::operator = (const StreakLineClass &that); + StreakLineClass & operator = (const StreakLineClass &that); // virtual ~StreakLineClass(void); void Reset_Line(void); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp index 9fa5883477..b1d2db960a 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/stripoptimizer.cpp @@ -161,7 +161,8 @@ void StripOptimizerClass::Optimize_Strip_Order (int* strips, int strip_count) int** ss = W3DNEWARRAY int*[strip_count]; // pointers to beginning of strips int* s = strips; - for (int i = 0; i < strip_count; i++) + int i = 0; + for (; i < strip_count; i++) { ss[i] = s; int len = *s++; // read len @@ -245,7 +246,8 @@ void StripOptimizerClass::Optimize_Triangle_Order (int *tris, int triangle_count WWASSERT(tris); Tri** t = W3DNEWARRAY Tri*[triangle_count]; - for (int i = 0; i < triangle_count; i++) + int i = 0; + for (; i < triangle_count; i++) { t[i] = (Tri*)(tris + i*3); } @@ -706,7 +708,8 @@ inline TriangleQueue::TriangleQueue (Triangle* tris, int N) inline Vector3i Stripify::getTriangleNodeConnectivityWeights (const TriangleQueue& queue, const Triangle& tri) { int weight[3]; - for (int i = 0; i < 3; i++) + int i = 0; + for (; i < 3; i++) { weight[i] = queue.getVertexConnectivity(tri.m_vertices[i]); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturefilter.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturefilter.cpp index e8c2d47255..3d2ebe11d8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturefilter.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturefilter.cpp @@ -147,7 +147,8 @@ void TextureFilterClass::_Init_Filters(TextureFilterMode filter_type) #endif // For stages above zero, set best filter to the same as the stage zero, except if anisotropic - for (int i=1;i ThumbnailManagerClass(const char* thumbnail_filename, const char* mix_file_name); ~ThumbnailManagerClass(); - void ThumbnailManagerClass::Remove_From_Hash(ThumbnailClass* thumb); - void ThumbnailManagerClass::Insert_To_Hash(ThumbnailClass* thumb); - ThumbnailClass* ThumbnailManagerClass::Get_From_Hash(const StringClass& name); + void Remove_From_Hash(ThumbnailClass* thumb); + void Insert_To_Hash(ThumbnailClass* thumb); + ThumbnailClass* Get_From_Hash(const StringClass& name); void Create_Thumbnails(); static void Update_Thumbnail_File(const char* mix_file_name, bool display_message_box); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.h index c9dcd0d4fa..15d7c3484d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.h @@ -271,7 +271,7 @@ class VertexMaterialClass : public W3DMPO, public RefCountClass ** Apply the render states corresponding to a NULL vetex material to D3D */ static void Apply_Null(void); - unsigned long VertexMaterialClass::Compute_CRC(void) const; + unsigned long Compute_CRC(void) const; static VertexMaterialClass *Presets[PRESET_COUNT]; }; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h index 927a0cafa7..2cb849cb29 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h @@ -148,6 +148,10 @@ struct AUDIO_CALLBACK_STRUCT template class AudioCallbackListClass : public SimpleDynVecClass< AUDIO_CALLBACK_STRUCT > { + using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::Vector; + using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::ActiveCount; + using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::Delete; + public: ///////////////////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.h index c7bfb7912a..e677a77ee4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.h @@ -510,8 +510,8 @@ class WWAudioClass : string_id (0), buffer (NULL) {} _CACHE_ENTRY_STRUCT &operator= (const _CACHE_ENTRY_STRUCT &src) { string_id = ::strdup (src.string_id); REF_PTR_SET (buffer, src.buffer); return *this; } - operator== (const _CACHE_ENTRY_STRUCT &src) { return false; } - operator!= (const _CACHE_ENTRY_STRUCT &src) { return true; } + bool operator== (const _CACHE_ENTRY_STRUCT &src) { return false; } + bool operator!= (const _CACHE_ENTRY_STRUCT &src) { return true; } } CACHE_ENTRY_STRUCT; @@ -526,8 +526,8 @@ class WWAudioClass _LOGICAL_TYPE_STRUCT (int _id, LPCTSTR name) : display_name (name), id (_id) {} - operator== (const _LOGICAL_TYPE_STRUCT &src) { return false; } - operator!= (const _LOGICAL_TYPE_STRUCT &src) { return true; } + bool operator== (const _LOGICAL_TYPE_STRUCT &src) { return false; } + bool operator!= (const _LOGICAL_TYPE_STRUCT &src) { return true; } } LOGICAL_TYPE_STRUCT; ////////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp index defb026016..88e542f168 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp @@ -95,7 +95,7 @@ static unsigned FreeCount; ** Name for each memory category. I'm padding the array with some "undefined" strings in case ** someone forgets to set the name when adding a new category. */ -static char * _MemoryCategoryNames[] = +static const char * _MemoryCategoryNames[] = { "UNKNOWN", "Geometry", diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/FTP.CPP b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/FTP.CPP index 5fd8e05db7..0d0381d36f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/FTP.CPP +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/FTP.CPP @@ -33,7 +33,6 @@ #include #include "assert.h" #include "ftp.h" -#include "winsock.h" #include #include #include diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/registry.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/registry.cpp index 266470fcd2..d3f7bc9e89 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/registry.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWDownload/registry.cpp @@ -79,8 +79,9 @@ bool setStringInRegistry( HKEY root, std::string path, std::string key, std::str unsigned long type; unsigned long returnValue; int size; + char lpClass[] = "REG_NONE"; - if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, "REG_NONE", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) + if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) { type = REG_SZ; size = val.length()+1; @@ -97,8 +98,9 @@ bool setUnsignedIntInRegistry( HKEY root, std::string path, std::string key, uns unsigned long type; unsigned long returnValue; int size; + char lpClass[] = "REG_NONE"; - if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, "REG_NONE", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) + if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &handle, NULL )) == ERROR_SUCCESS) { type = REG_DWORD; size = 4; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Except.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Except.cpp index 37f3fd64cf..f79b41b204 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Except.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Except.cpp @@ -434,7 +434,8 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info) /* ** Match the exception type with the error string and print it out */ - for (int i=0 ; _codes[i] != 0xffffffff ; i++) { + int i=0; + for (; _codes[i] != 0xffffffff ; i++) { if (_codes[i] == e_info->ExceptionRecord->ExceptionCode) { DebugString("Exception Handler: Found exception description\n"); break; @@ -611,8 +612,10 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info) Add_Txt(scrap); sprintf(scrap, " Data Selector: %08x\r\n", context->FloatSave.DataSelector); Add_Txt(scrap); +#if !defined(WOW64_SIZE_OF_80387_REGISTERS) sprintf(scrap, " Cr0NpxState: %08x\r\n", context->FloatSave.Cr0NpxState); Add_Txt(scrap); +#endif for (int fp=0 ; fp #ifdef __BORLANDC__ NodeElement const * IndexClass::Search_For_Node(INDEX const & id) const #else -IndexClass::NodeElement const * IndexClass::Search_For_Node(INDEX const & id) const +typename IndexClass::NodeElement const * IndexClass::Search_For_Node(INDEX const & id) const #endif { /* diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Point.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Point.h index e8059033b4..a6577f5624 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Point.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Point.h @@ -129,6 +129,10 @@ template class TPoint3D : public TPoint2D { typedef TPoint2D BASECLASS; + public: + using BASECLASS::X; + using BASECLASS::Y; + public: TPoint3D(void) {} // Default constructor does nothing by design. TPoint3D(T x, T y, T z) : TPoint2D(x, y), Z(z) {} diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/RAWFILE.H b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/RAWFILE.H index 3f17667420..34ac8712b0 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/RAWFILE.H +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/RAWFILE.H @@ -164,30 +164,4 @@ class RawFileClass : public FileClass unsigned short Time; }; - -/*********************************************************************************************** - * RawFileClass::File_Name -- Returns with the filename associate with the file object. * - * * - * Use this routine to determine what filename is associated with this file object. If no * - * filename has yet been assigned, then this routing will return NULL. * - * * - * INPUT: none * - * * - * OUTPUT: Returns with a pointer to the file name associated with this file object or NULL * - * if one doesn't exist. * - * * - * WARNINGS: none * - * * - * HISTORY: * - * 10/18/1994 JLB : Created. * - * 11/25/2001 Jani: Note that this is virtual function and thus can't be inlined. Is there a * - * reason for it to be virtual? * - *=============================================================================================*/ -inline char const * RawFileClass::File_Name(void) const -{ - return(Filename); -} - - - #endif diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Vector.H b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Vector.H index af9892e767..4e331d2a18 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Vector.H +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/Vector.H @@ -486,6 +486,13 @@ bool VectorClass::Resize(int newsize, T const * array) template class DynamicVectorClass : public VectorClass { + protected: + using VectorClass::IsAllocated; + using VectorClass::Vector; + using VectorClass::VectorMax; + public: + using VectorClass::Length; + public: DynamicVectorClass(unsigned size=0, T const * array=0); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/always.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/always.h index 6a60faa6da..139d343235 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/always.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/always.h @@ -90,11 +90,13 @@ extern void* __cdecl operator new[] (size_t nSize, const char *, int); extern void __cdecl operator delete[] (void *, const char *, int); +#if defined(_MSC_VER) && _MSC_VER < 1300 // additional overloads for 'placement new' //inline void* __cdecl operator new (size_t s, void *p) { return p; } //inline void __cdecl operator delete (void *, void *p) { } inline void* __cdecl operator new[] (size_t s, void *p) { return p; } inline void __cdecl operator delete[] (void *, void *p) { } +#endif #endif diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.cpp index 3dc2e275b5..855738ac65 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.cpp @@ -159,7 +159,7 @@ const char *ArgvClass::Find_Again(const char *arg) * 06/17/1999 SKB : Created. * * 07/15/2001 SKB : Put file arguements in the correct order they were included. * *=============================================================================================*/ -int ArgvClass::Init(char *lpCmdLine, char *fileprefix) +int ArgvClass::Init(char *lpCmdLine, const char *fileprefix) { // Get pointer to command line. char *ptr = lpCmdLine; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.h index 5deb73626f..8fe1ce4bac 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/argv.h @@ -67,7 +67,7 @@ class ArgvClass // As passed into WinMain. // Should be called before any objects are created. // This can be called multible times. - static int Init(char *lpCmdLine, char *fileprefix = "@"); + static int Init(char *lpCmdLine, const char *fileprefix = "@"); static bool Load_File(const char *fname); static void Free(); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/cpudetect.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/cpudetect.cpp index db0f058e98..75e6692dd0 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/cpudetect.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/cpudetect.cpp @@ -1129,7 +1129,7 @@ void CPUDetectClass::Init_Compact_Log() static class CPUDetectInitClass { public: - CPUDetectInitClass::CPUDetectInitClass() + CPUDetectInitClass() { CPUDetectClass::Init_CPUID_Instruction(); // We pretty much need CPUID, but let's not crash if it doesn't exist. diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/gcd_lcm.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/gcd_lcm.h index d605b39af8..5c1349ffc2 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/gcd_lcm.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/gcd_lcm.h @@ -38,6 +38,7 @@ #endif // _MSC_VER >= 1000 #ifndef GCD_LCM_H +#define GCD_LCM_H #include "always.h" @@ -49,4 +50,4 @@ unsigned int Greatest_Common_Divisor(unsigned int a, unsigned int b); // positive integers are divisors. unsigned int Least_Common_Multiple(unsigned int a, unsigned int b); -#endif \ No newline at end of file +#endif // GCD_LCM_H diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/ini.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/ini.cpp index 6cb94930d0..b33ca830cb 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/ini.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/ini.cpp @@ -471,9 +471,10 @@ int INIClass::Load(Straw & ffile) if (!strlen(buffer)) continue; strtrim(divider); + char space[] = " "; if (!strlen(divider)) { if (KeepBlankEntries) - divider = " "; + divider = space; else continue; } @@ -537,9 +538,10 @@ int INIClass::Load(Straw & ffile) if (!strlen(buffer)) continue; strtrim(divider); + char space[] = " "; if (!strlen(divider)) { if (KeepBlankEntries) - divider = " "; + divider = space; else continue; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/inisup.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/inisup.h index 4250bdac34..2625553a0a 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/inisup.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/inisup.h @@ -82,7 +82,7 @@ struct INISection : public Node { private: INISection(INISection const & rvalue); - INISection operator = (INISection const & rvalue); + INISection& operator = (INISection const & rvalue); }; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mixfile.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mixfile.cpp index 071830b05e..79334f50fc 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mixfile.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/mixfile.cpp @@ -334,7 +334,8 @@ MixFileFactoryClass::Flush_Changes (void) // // Add all the remaining files from our file set // - for (int index = 0; index < FilenameList.Count (); index ++) { + int index = 0; + for (; index < FilenameList.Count (); index ++) { StringClass &filename = FilenameList[index]; // @@ -438,7 +439,8 @@ bool MixFileFactoryClass::Build_Ordered_Filename_List (DynamicVectorClass local_file_info; local_file_info.Resize( name_list.Count()); - for (int i = 0; i < name_list.Count(); ++i) { + int i = 0; + for (; i < name_list.Count(); ++i) { // Here, we have to assume that the names in the list are in CRC order, just like FileInfo is. FileOffsetStruct temp; temp.Filename = name_list[i]; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/multilist.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/multilist.h index 4e1a023465..f0e3aebaa9 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/multilist.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/multilist.h @@ -294,6 +294,11 @@ class MultiListClass : public GenericMultiListClass template class MultiListIterator : public GenericMultiListIterator { +protected: + using GenericMultiListIterator::CurNode; +public: + using GenericMultiListIterator::First; + public: MultiListIterator(MultiListClass *list) : GenericMultiListIterator(list) {} @@ -487,6 +492,12 @@ class RefMultiListIterator : public GenericMultiListIterator template class PriorityMultiListIterator : public MultiListIterator { +protected: + using MultiListIterator::CurNode; +public: + using MultiListIterator::First; + using MultiListIterator::Remove_Current_Object; + public: PriorityMultiListIterator(MultiListClass *list) : OriginalHead (NULL), diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/rawfile.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/rawfile.cpp index 0d49d88fc5..bdfc6d4ef3 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/rawfile.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/rawfile.cpp @@ -293,6 +293,29 @@ void RawFileClass::Reset(void) Filename = ""; } +/*********************************************************************************************** + * RawFileClass::File_Name -- Returns with the filename associate with the file object. * + * * + * Use this routine to determine what filename is associated with this file object. If no * + * filename has yet been assigned, then this routing will return NULL. * + * * + * INPUT: none * + * * + * OUTPUT: Returns with a pointer to the file name associated with this file object or NULL * + * if one doesn't exist. * + * * + * WARNINGS: none * + * * + * HISTORY: * + * 10/18/1994 JLB : Created. * + * 11/25/2001 Jani: Note that this is virtual function and thus can't be inlined. Is there a * + * reason for it to be virtual? * + *=============================================================================================*/ +char const * RawFileClass::File_Name(void) const +{ + return(Filename); +} + /*********************************************************************************************** * RawFileClass::Set_Name -- Manually sets the name for a file object. * * * diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.cpp index 52f616adb0..39dd095ef0 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.cpp @@ -87,7 +87,7 @@ RefCountClass * RefCountClass::Add_Active_Ref(RefCountClass *obj) * HISTORY: * * 3/16/98 GTH : Created. * *=============================================================================================*/ -RefCountClass * RefCountClass::Set_Ref_Owner(RefCountClass *obj,char * file,int line) +RefCountClass * RefCountClass::Set_Ref_Owner(RefCountClass *obj,const char * file,int line) { // static RefCountClass *hunt = (RefCountClass *)0x06558890; static RefCountClass *hunt = (RefCountClass *)0x0; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.h index 6c86e3a94f..65a04269a9 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/refcount.h @@ -55,7 +55,7 @@ class RefCountClass; struct ActiveRefStruct { - char * File; + const char * File; int Line; }; @@ -235,7 +235,7 @@ class RefCountClass /* ** Updates the owner file/line for the given ref obj in the active ref list */ - static RefCountClass * Set_Ref_Owner(RefCountClass *obj,char * file,int line); + static RefCountClass * Set_Ref_Owner(RefCountClass *obj,const char * file,int line); /* ** Remove the ref obj from the active ref list diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/sha.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/sha.cpp index b6c10ed602..b89c9200c8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/sha.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/sha.cpp @@ -39,7 +39,11 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "sha.h" +#ifdef USING_STLPORT #include +#else +#include +#endif #include diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/simplevec.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/simplevec.h index 69aa279d13..064d84e713 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/simplevec.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/simplevec.h @@ -254,6 +254,11 @@ inline bool SimpleVecClass::Uninitialised_Grow(int newsize) */ template class SimpleDynVecClass : public SimpleVecClass { +protected: + using SimpleVecClass::Vector; + using SimpleVecClass::VectorMax; + using SimpleVecClass::Length; + public: SimpleDynVecClass(int size = 0); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/timer.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/timer.h index b38e0ad499..d54a90a319 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/timer.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWLib/timer.h @@ -202,7 +202,11 @@ inline int BasicTimerClass::operator () (void) const ** class instead. */ template -class TTimerClass : public BasicTimerClass { +class TTimerClass : public BasicTimerClass +{ + using BasicTimerClass::Started; + using BasicTimerClass::Timer; + public: // Constructor allows assignment as if class was integral 'long' type. TTimerClass(int set=0); @@ -427,7 +431,11 @@ inline bool TTimerClass::Is_Active(void) const ** were an integral "magic" long that automatically counts down toward zero. */ template -class CDTimerClass : public BasicTimerClass { +class CDTimerClass : public BasicTimerClass +{ + using BasicTimerClass::Started; + using BasicTimerClass::Timer; + public: // Constructor allows assignment as if class was integral 'long' type. CDTimerClass(int set=0); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/v3_rnd.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/v3_rnd.h index 5cf11bf2bd..d34ba6d00a 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/v3_rnd.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/v3_rnd.h @@ -129,7 +129,7 @@ class Vector3SolidBoxRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidBoxRandomizer & Vector3SolidBoxRandomizer::operator = (const Vector3SolidBoxRandomizer &that) { that; return *this; } + Vector3SolidBoxRandomizer & operator = (const Vector3SolidBoxRandomizer &that) { that; return *this; } Vector3 Extents; }; @@ -160,7 +160,7 @@ class Vector3SolidSphereRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidSphereRandomizer & Vector3SolidSphereRandomizer::operator = (const Vector3SolidSphereRandomizer &that) { that; return *this; } + Vector3SolidSphereRandomizer & operator = (const Vector3SolidSphereRandomizer &that) { that; return *this; } float Radius; }; @@ -191,7 +191,7 @@ class Vector3HollowSphereRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3HollowSphereRandomizer & Vector3HollowSphereRandomizer::operator = (const Vector3HollowSphereRandomizer &that) { that; return *this; } + Vector3HollowSphereRandomizer & operator = (const Vector3HollowSphereRandomizer &that) { that; return *this; } float Radius; }; @@ -223,7 +223,7 @@ class Vector3SolidCylinderRandomizer : public Vector3Randomizer { private: // Derived classes should have a private dummy assignment operator to block usage - Vector3SolidCylinderRandomizer & Vector3SolidCylinderRandomizer::operator = (const Vector3SolidCylinderRandomizer &that) { that; return *this; } + Vector3SolidCylinderRandomizer & operator = (const Vector3SolidCylinderRandomizer &that) { that; return *this; } float Extent; float Radius; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/wwmath.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/wwmath.cpp index c61c7d4e44..0b55a21349 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/wwmath.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/wwmath.cpp @@ -52,7 +52,8 @@ void WWMath::Init(void) { LookupTableMgrClass::Init(); - for (int a=0;a { + using DynamicVectorClass::Vector; + public: ///////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h index 44807dcaa4..14a12d57d8 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWSaveLoad/persistfactory.h @@ -50,8 +50,7 @@ #include "chunkio.h" #include "wwdebug.h" #include "saveload.h" - -class PersistClass; +#include "persist.h" /* ** PersistFactoryClass diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/Wwutil/miscutil.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/Wwutil/miscutil.cpp index 17445fc774..6cf13d74a4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/Wwutil/miscutil.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/Wwutil/miscutil.cpp @@ -47,7 +47,7 @@ LPCSTR cMiscUtil::Get_Text_Time(void) // Note: BoundsChecker reports 2 memory leaks in ctime here. // - long time_now = ::time(NULL); + time_t time_now = ::time(NULL); char * time_str = ::ctime(&time_now); time_str[::strlen(time_str) - 1] = 0; // remove \n return time_str; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdhwshader.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdhwshader.cpp index 49987baf58..eb5b00499a 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdhwshader.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdhwshader.cpp @@ -66,7 +66,7 @@ void ShdHWShader::Shell_Run(char* cmd) if (!found) { - char* shader_path="\\shaders\\"; + const char* shader_path="\\shaders\\"; ::GetCurrentDirectory(_MAX_PATH,work_dir); strcat(work_dir,shader_path); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdlegacyw3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdlegacyw3d.cpp index 5136870934..c0799a4340 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdlegacyw3d.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdlegacyw3d.cpp @@ -506,7 +506,7 @@ void Shd6LegacyW3DClass::Apply_Instance(int cur_pass, RenderInfoClass& rinfo) DX8Wrapper::Set_Material(Materials[cur_pass]); for (int stage=0;stageGet_Full_Path() : "NULL")); + SNAPSHOT_SAY(("legacyshader:DX8Wrapper::Set_Texture(%d,%s)\n",stage,Textures[cur_pass][stage] ? Textures[cur_pass][stage]->Get_Full_Path().Peek_Buffer() : "NULL")); DX8Wrapper::Set_Texture(stage, Textures[cur_pass][stage]); } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdmesh.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdmesh.cpp index 70556fa305..f19aeb6a1e 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdmesh.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/wwshade/shdmesh.cpp @@ -604,7 +604,8 @@ WW3DErrorType ShdMeshClass::Load_W3D(ChunkLoadClass& cload) // next are the sub meshes Free(); SubMeshes.Resize(hdr.NumSubMeshes); - for (int i=0;inext) + Debug::IOFactoryListEntry *cur=dbg.firstIOFactory; + for (;cur;cur=cur->next) if (!strcmp(argv[0],cur->ioID)) break; if (!cur) @@ -357,7 +358,8 @@ bool DebugCmdInterfaceDebug::Execute(class Debug& dbg, const char *cmd, // must fixup lastPatternEntry now if (dbg.firstPatternEntry) { - for (Debug::PatternListEntry *cur=dbg.firstPatternEntry;cur->next;cur=cur->next); + Debug::PatternListEntry *cur=dbg.firstPatternEntry; + for (;cur->next;cur=cur->next); dbg.lastPatternEntry=cur; } else diff --git a/GeneralsMD/Code/Libraries/Source/debug/debug_cmd.h b/GeneralsMD/Code/Libraries/Source/debug/debug_cmd.h index f4f523923f..6f9d113981 100644 --- a/GeneralsMD/Code/Libraries/Source/debug/debug_cmd.h +++ b/GeneralsMD/Code/Libraries/Source/debug/debug_cmd.h @@ -51,7 +51,7 @@ class DebugCmdInterface { // no copy/assign op - DebugCmdInterface(const &DebugCmdInterface); + DebugCmdInterface(const DebugCmdInterface&); DebugCmdInterface& operator=(const DebugCmdInterface&); protected: diff --git a/GeneralsMD/Code/Libraries/Source/debug/debug_debug.cpp b/GeneralsMD/Code/Libraries/Source/debug/debug_debug.cpp index 1949e8cbf0..c55f3689b6 100644 --- a/GeneralsMD/Code/Libraries/Source/debug/debug_debug.cpp +++ b/GeneralsMD/Code/Libraries/Source/debug/debug_debug.cpp @@ -222,7 +222,7 @@ void Debug::StaticExit(void) } } -Debug& Debug::operator<<(RepeatChar &c) +Debug& Debug::operator<<(RepeatChar c) { if (c.m_count>=10) { @@ -878,7 +878,8 @@ Debug& Debug::operator<<(const MemDump &dump) // items const unsigned char *curByte=cur; - for (unsigned k=0;knext) + KnownLogGroupList *cur=firstLogGroup; + for (;cur;cur=cur->next) { if (!strcmp(cur->nameGroup,fileOrGroup)) { diff --git a/GeneralsMD/Code/Libraries/Source/debug/debug_debug.h b/GeneralsMD/Code/Libraries/Source/debug/debug_debug.h index 532f21dd06..bedbf1b5ab 100644 --- a/GeneralsMD/Code/Libraries/Source/debug/debug_debug.h +++ b/GeneralsMD/Code/Libraries/Source/debug/debug_debug.h @@ -207,7 +207,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); class Hex {}; /// \internal Performs actual switch to hexadecimal format. - Debug& operator<<(Hex &) + Debug& operator<<(const Hex) { SetPrefixAndRadix("0x",16); return *this; @@ -219,7 +219,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); class Dec {}; /// \internal Performs actuals switch to decimal format - Debug& operator<<(Dec &) + Debug& operator<<(const Dec) { SetPrefixAndRadix("",10); return *this; @@ -231,7 +231,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); class Bin {}; /// \internal Performs actuals switch to binary format - Debug& operator<<(Bin &) + Debug& operator<<(const Bin) { SetPrefixAndRadix("%",2); return *this; @@ -253,7 +253,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); }; /// \internal Performs actuals width switch - Debug& operator<<(Width &w) + Debug& operator<<(const Width w) { m_width=w.m_width; return *this; @@ -275,7 +275,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); }; /// \internal Performs actuals setting of fill char - Debug& operator<<(FillChar &c) + Debug& operator<<(const FillChar c) { m_fillChar=c.m_fill; return *this; @@ -298,7 +298,7 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); }; /// \internal Performs actuals repeating of char - Debug& operator<<(RepeatChar &c); + Debug& operator<<(RepeatChar c); /** \brief Old printf style formatting. diff --git a/GeneralsMD/Code/Libraries/Source/debug/debug_except.cpp b/GeneralsMD/Code/Libraries/Source/debug/debug_except.cpp index 4872bf9943..17fd2a1602 100644 --- a/GeneralsMD/Code/Libraries/Source/debug/debug_except.cpp +++ b/GeneralsMD/Code/Libraries/Source/debug/debug_except.cpp @@ -158,7 +158,10 @@ void DebugExceptionhandler::LogFPURegisters(Debug &dbg, struct _EXCEPTION_POINTE << " ErrSel: " << Debug::Width(8) << flt.ErrorSelector << "\n" << "DataOfs: " << Debug::Width(8) << flt.DataOffset << " DataSel: " << Debug::Width(8) << flt.DataSelector << "\n" - << "Cr0NpxState: " << Debug::Width(8) << flt.Cr0NpxState << "\n"; +#if !defined(WOW64_SIZE_OF_80387_REGISTERS) + << "Cr0NpxState: " << Debug::Width(8) << flt.Cr0NpxState << "\n" +#endif + ; for (unsigned k=0;knext) + SplitListEntry *cur=m_firstSplit; + for (;cur;cur=cur->next) { if (!(cur->stringTypes&(1<name,fn); - for (StreamListEntry *stream=m_firstStream;stream;stream=stream->next) + StreamListEntry *stream=m_firstStream; + for (;stream;stream=stream->next) if (!strcmp(stream->stream->GetFilename(),fn)) break; if (!stream) @@ -526,7 +528,8 @@ void DebugIOFlat::Execute(class Debug& dbg, const char *cmd, bool structuredCmd, // must fixup m_lastSplitPtr now if (m_firstSplit) { - for (SplitListEntry *cur=m_firstSplit;cur->next;cur=cur->next); + SplitListEntry *cur=m_firstSplit; + for (;cur->next;cur=cur->next); m_firstSplit=cur; } else diff --git a/GeneralsMD/Code/Libraries/Source/debug/debug_stack.cpp b/GeneralsMD/Code/Libraries/Source/debug/debug_stack.cpp index 2d1112ce82..808131b2aa 100644 --- a/GeneralsMD/Code/Libraries/Source/debug/debug_stack.cpp +++ b/GeneralsMD/Code/Libraries/Source/debug/debug_stack.cpp @@ -86,7 +86,8 @@ static void InitDbghelp(void) // Get function addresses unsigned *funcptr=gDbg.funcPtr; - for (unsigned k=0;DebughelpFunctionNames[k];++k,++funcptr) + unsigned k=0; + for (;DebughelpFunctionNames[k];++k,++funcptr) { *funcptr=(unsigned)GetProcAddress(g_dbghelp,DebughelpFunctionNames[k]); if (!*funcptr) diff --git a/GeneralsMD/Code/Libraries/Source/profile/profile.cpp b/GeneralsMD/Code/Libraries/Source/profile/profile.cpp index fa2b8aa774..edc5d126ae 100644 --- a/GeneralsMD/Code/Libraries/Source/profile/profile.cpp +++ b/GeneralsMD/Code/Libraries/Source/profile/profile.cpp @@ -165,7 +165,8 @@ void Profile::StartRange(const char *range) range="frame"; // known name? - for (unsigned k=0;knext;cur=cur->next); + Profile::PatternListEntry *cur=Profile::firstPatternEntry; + for (;cur->next;cur=cur->next); Profile::lastPatternEntry=cur; } else diff --git a/GeneralsMD/Code/Libraries/Source/profile/profile_highlevel.cpp b/GeneralsMD/Code/Libraries/Source/profile/profile_highlevel.cpp index cae1f7e6d2..08c5b510b6 100644 --- a/GeneralsMD/Code/Libraries/Source/profile/profile_highlevel.cpp +++ b/GeneralsMD/Code/Libraries/Source/profile/profile_highlevel.cpp @@ -217,7 +217,8 @@ int ProfileId::FrameStart(void) { ProfileFastCS::Lock lock(cs); - for (unsigned i=0;iGetNext()); + ProfileId *cur=ProfileId::GetFirst(); + for (;cur&&index--;cur=cur->GetNext()); id.m_idPtr=cur; return cur!=NULL; } diff --git a/GeneralsMD/Code/Libraries/Source/profile/profile_result.cpp b/GeneralsMD/Code/Libraries/Source/profile/profile_result.cpp index 7c1fca759f..1687fbc7e5 100644 --- a/GeneralsMD/Code/Libraries/Source/profile/profile_result.cpp +++ b/GeneralsMD/Code/Libraries/Source/profile/profile_result.cpp @@ -48,7 +48,8 @@ void ProfileResultFileCSV::WriteThread(ProfileFuncLevel::Thread &thread) // CSV file header fprintf(f,"Function\tFile\tCall count\tPTT (all)\tGTT (all)\tPT/C (all)\tGT/C (all)\tCaller (all)"); - for (unsigned k=0;knext) + FoldHelper *cur=fold; + for (;cur;cur=cur->next) if (!strcmp(source,cur->source)) { if (cur->numIdnext) { - for (FoldHelper *cur2=fold;cur2;cur2=cur2->next) + FoldHelper *cur2=fold; + for (;cur2;cur2=cur2->next) cur2->mark=false; for (k=0;knumId;k++) diff --git a/GeneralsMD/Code/Main/CMakeLists.txt b/GeneralsMD/Code/Main/CMakeLists.txt index 18ffc506f7..bb2849d140 100644 --- a/GeneralsMD/Code/Main/CMakeLists.txt +++ b/GeneralsMD/Code/Main/CMakeLists.txt @@ -1,5 +1,11 @@ add_executable(z_generals WIN32) -set_target_properties(z_generals PROPERTIES OUTPUT_NAME generals) + +# Use a binary name that doesn't conflict with original game. +if("${CMAKE_SYSTEM}" MATCHES "Windows") + set_target_properties(z_generals PROPERTIES OUTPUT_NAME generalszh) +else() + set_target_properties(z_generals PROPERTIES OUTPUT_NAME generalszh) +endif() target_link_libraries(z_generals PRIVATE binkstub diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index c07319742b..a92c03cd9a 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -83,7 +83,7 @@ DWORD TheMessageTime = 0; ///< For getting the time that a message was posted fr const Char *g_strFile = "data\\Generals.str"; const Char *g_csfFile = "data\\%s\\Generals.csf"; -char *gAppPrefix = ""; /// So WB can have a different debug log file name. +const char *gAppPrefix = ""; /// So WB can have a different debug log file name. static HANDLE GeneralsMutex = NULL; #define GENERALS_GUID "685EAFF2-3216-4265-B047-251C5F4B82F3" @@ -812,7 +812,7 @@ static char* strtrim(char* buffer) return buffer; } -char *nextParam(char *newSource, char *seps) +char *nextParam(char *newSource, const char *seps) { static char *source = NULL; if (newSource) @@ -966,7 +966,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // check both localized directory and root dir char filePath[_MAX_PATH]; - char *fileName = "Install_Final.bmp"; + const char *fileName = "Install_Final.bmp"; static const char *localizedPathFormat = "Data/%s/"; sprintf(filePath,localizedPathFormat, GetRegistryLanguage().str()); strcat( filePath, fileName ); diff --git a/GeneralsMD/Code/Tools/Autorun/autorun.cpp b/GeneralsMD/Code/Tools/Autorun/autorun.cpp index f5637a8ea6..e713f1feee 100644 --- a/GeneralsMD/Code/Tools/Autorun/autorun.cpp +++ b/GeneralsMD/Code/Tools/Autorun/autorun.cpp @@ -313,7 +313,7 @@ HINSTANCE ApplicationHInstance; ///< main application instance const char *g_strFile = "Autorun.str"; const char *g_csfFile = "Autorun.csf"; -char *gAppPrefix = "ar_"; // prefix to the debug log. +const char *gAppPrefix = "ar_"; // prefix to the debug log. int FlickerPositions[ NUM_FLICKER_POSITIONS ][2]; diff --git a/GeneralsMD/Code/Tools/Compress/CMakeLists.txt b/GeneralsMD/Code/Tools/Compress/CMakeLists.txt index d770d60590..527b6d5175 100644 --- a/GeneralsMD/Code/Tools/Compress/CMakeLists.txt +++ b/GeneralsMD/Code/Tools/Compress/CMakeLists.txt @@ -16,7 +16,7 @@ target_link_libraries(z_compress PRIVATE ) if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") - if(MSVC_VERSION LESS 1300) # VS6 + if(IS_VS6_BUILD) target_compile_definitions(z_compress PRIVATE vsnprintf=_vsnprintf) endif() target_link_options(z_compress PRIVATE /subsystem:console) diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/ListboxProperties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/ListboxProperties.cpp index fbc10ef1a7..e5d8ac8380 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/ListboxProperties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/ListboxProperties.cpp @@ -953,7 +953,7 @@ HWND InitListboxPropertiesDialog( GameWindow *window ) } // WordWrap Check Box - if( BitTest( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) ) CheckDlgButton( dialog, CHECK_NO_WORDWRAP, BST_CHECKED ); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/PushButtonProperties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/PushButtonProperties.cpp index dbae2860e5..4f97e00cf5 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/PushButtonProperties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/PushButtonProperties.cpp @@ -255,7 +255,7 @@ HWND InitPushButtonPropertiesDialog( GameWindow *window ) // initialize the dialog with values from the window // - if( BitTest( window->winGetStatus(), WIN_STATUS_RIGHT_CLICK ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_RIGHT_CLICK ) ) CheckDlgButton( dialog, CHECK_RIGHT_CLICK, BST_CHECKED ); return dialog; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/RadioButtonProperties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/RadioButtonProperties.cpp index e00dee9366..92d98c512e 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/RadioButtonProperties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/RadioButtonProperties.cpp @@ -240,7 +240,7 @@ static void loadExistingGroupsCombo( HWND combo, GameWindow *window ) return; // if this is a radio button get the group - if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) { RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData(); char buffer[ 64 ]; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/SliderProperties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/SliderProperties.cpp index 35ab194fa2..7980d2e10f 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/SliderProperties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/SliderProperties.cpp @@ -106,7 +106,7 @@ static LRESULT CALLBACK sliderPropertiesCallback( HWND hWndDialog, Bool vert = FALSE; if( window ) - vert = BitTest( window->winGetStyle(), GWS_VERT_SLIDER ); + vert = BitIsSet( window->winGetStyle(), GWS_VERT_SLIDER ); // // using the current colors in the base of the slider, assign a @@ -158,7 +158,7 @@ static LRESULT CALLBACK sliderPropertiesCallback( HWND hWndDialog, if( window ) { ImageAndColorInfo *info; - Bool vert = BitTest( window->winGetStyle(), GWS_VERT_SLIDER ); + Bool vert = BitIsSet( window->winGetStyle(), GWS_VERT_SLIDER ); // save the common properties if( SaveCommonDialogProperties( hWndDialog, window ) == FALSE ) @@ -367,7 +367,7 @@ HWND InitSliderPropertiesDialog( GameWindow *window ) // const Image *image; Color color, borderColor; - Bool vert = BitTest( window->winGetStyle(), GWS_VERT_SLIDER ); + Bool vert = BitIsSet( window->winGetStyle(), GWS_VERT_SLIDER ); // -------------------------------------------------------------------------- if( vert ) diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/EditWindow.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/EditWindow.cpp index 90fb394660..c5957504d1 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/EditWindow.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/EditWindow.cpp @@ -554,7 +554,7 @@ void EditWindow::mouseEvent( UnsignedInt windowsMessage, { Int x = LOWORD( lParam ); Int y = HIWORD( lParam ); - Bool controlDown = BitTest( GetKeyState( VK_CONTROL ), 0x1000 ); + Bool controlDown = BitIsSet( GetKeyState( VK_CONTROL ), 0x1000 ); ICoord2D mouse; // setup mouse in nice struct @@ -1121,7 +1121,7 @@ void EditWindow::drawSeeThruOutlines( GameWindow *windowList, Color c ) return; // draw outline for this window - if( BitTest( windowList->winGetStatus(), WIN_STATUS_SEE_THRU ) ) + if( BitIsSet( windowList->winGetStatus(), WIN_STATUS_SEE_THRU ) ) { ICoord2D pos; ICoord2D size; @@ -1165,12 +1165,12 @@ void EditWindow::drawHiddenOutlines( GameWindow *windowList, Color c ) while( parent ) { - if( BitTest( parent->winGetStatus(), WIN_STATUS_HIDDEN ) ) + if( BitIsSet( parent->winGetStatus(), WIN_STATUS_HIDDEN ) ) hidden = TRUE; parent = parent->winGetParent(); } // end while - if( BitTest( windowList->winGetStatus(), WIN_STATUS_HIDDEN ) ) + if( BitIsSet( windowList->winGetStatus(), WIN_STATUS_HIDDEN ) ) hidden = TRUE; if( hidden ) { @@ -1693,7 +1693,7 @@ void EditWindow::drawImage( const Image *image, } // if rotated 90 degrees clockwise we have to adjust the uv coords - if( BitTest( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) + if( BitIsSet( image->getStatus(), IMAGE_STATUS_ROTATED_90_CLOCKWISE ) ) { m_2DRender->Add_Tri( Vector2( screen_rect.Left, screen_rect.Top ), diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp index 6c5d00870d..bdcc76a48f 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp @@ -1161,7 +1161,7 @@ static GameWindow *pointInChild( Int x, Int y , GameWindow *win) child->winGetSize(&tempX,&tempY); if( x >= origin.x && x <= origin.x + tempX && y >= origin.y && y <= origin.y + tempY && - BitTest( child->winGetStatus(), WIN_STATUS_HIDDEN ) == FALSE) + BitIsSet( child->winGetStatus(), WIN_STATUS_HIDDEN ) == FALSE) return child->winPointInChild( x, y ); } // end for child @@ -1204,7 +1204,7 @@ static GameWindow *pointInAnyChild( Int x, Int y, Bool ignoreHidden, GameWindow y >= origin.y && y <= origin.y + tempY ) { - if( !(ignoreHidden == TRUE && BitTest( child->winGetStatus(), WIN_STATUS_HIDDEN )) ) + if( !(ignoreHidden == TRUE && BitIsSet( child->winGetStatus(), WIN_STATUS_HIDDEN )) ) return pointInChild( x, y , child); } // end if @@ -1262,7 +1262,7 @@ GameWindow *GUIEdit::getWindowAtPos( Int x, Int y ) if( parent ) { - if( BitTest( parent->winGetStyle(), GWS_VERT_SLIDER | + if( BitIsSet( parent->winGetStyle(), GWS_VERT_SLIDER | GWS_HORZ_SLIDER | GWS_SCROLL_LISTBOX | GWS_COMBO_BOX | @@ -1280,22 +1280,22 @@ GameWindow *GUIEdit::getWindowAtPos( Int x, Int y ) // a slider, therefore in that situation only we want to return the // parent of the slider // - if( BitTest( parent->winGetStyle(), GWS_HORZ_SLIDER | + if( BitIsSet( parent->winGetStyle(), GWS_HORZ_SLIDER | GWS_VERT_SLIDER ) ) { GameWindow *grandParent = parent->winGetParent(); - if( grandParent && BitTest( grandParent->winGetStyle(), + if( grandParent && BitIsSet( grandParent->winGetStyle(), GWS_SCROLL_LISTBOX ) ) pick = grandParent; } // end if //must check to see of the parent of a scroll box is a combo box - if(BitTest(pick->winGetStyle(), GWS_SCROLL_LISTBOX)) + if(BitIsSet(pick->winGetStyle(), GWS_SCROLL_LISTBOX)) { GameWindow *grandParent = pick->winGetParent(); - if( grandParent && BitTest( grandParent->winGetStyle(), GWS_COMBO_BOX)) + if( grandParent && BitIsSet( grandParent->winGetStyle(), GWS_COMBO_BOX)) pick = grandParent; } } // end if @@ -4551,7 +4551,7 @@ Bool GUIEdit::windowIsGadget( GameWindow *window ) if( window == NULL ) return FALSE; - return BitTest( window->winGetStyle(), GWS_GADGET_WINDOW ); + return BitIsSet( window->winGetStyle(), GWS_GADGET_WINDOW ); } // end windowIsGadget diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEditWindowManager.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEditWindowManager.cpp index df44327939..905de3fd8a 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEditWindowManager.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEditWindowManager.cpp @@ -814,7 +814,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, source->winGetSize( &size.x, &size.y ); // create a new window or gadget of the appropriate type - if( BitTest( style, GWS_PUSH_BUTTON ) ) + if( BitIsSet( style, GWS_PUSH_BUTTON ) ) { duplicate = @@ -829,7 +829,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end if - else if( BitTest( style, GWS_RADIO_BUTTON ) ) + else if( BitIsSet( style, GWS_RADIO_BUTTON ) ) { RadioButtonData *radioData = (RadioButtonData *)source->winGetUserData(); RadioButtonData radioDataCopy; @@ -850,7 +850,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end else if - else if( BitTest( style, GWS_CHECK_BOX ) ) + else if( BitIsSet( style, GWS_CHECK_BOX ) ) { duplicate = @@ -865,7 +865,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end else if - else if( BitTest( style, GWS_HORZ_SLIDER | GWS_VERT_SLIDER ) ) + else if( BitIsSet( style, GWS_HORZ_SLIDER | GWS_VERT_SLIDER ) ) { SliderData *sliderData = (SliderData *)source->winGetUserData(); SliderData sliderDataCopy; @@ -918,7 +918,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, } // end if } // end else if - else if( BitTest( style, GWS_COMBO_BOX ) ) + else if( BitIsSet( style, GWS_COMBO_BOX ) ) { ComboBoxData *comboData = (ComboBoxData *)source->winGetUserData(); ComboBoxData comboDataCopy; @@ -1106,7 +1106,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, } // end if } // end else if - else if( BitTest( style, GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( style, GWS_SCROLL_LISTBOX ) ) { ListboxData *listData = (ListboxData *)source->winGetUserData(); ListboxData listDataCopy; @@ -1256,7 +1256,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, } // end if } // end else if - else if( BitTest( style, GWS_ENTRY_FIELD ) ) + else if( BitIsSet( style, GWS_ENTRY_FIELD ) ) { EntryData *entryData = (EntryData *)source->winGetUserData(); EntryData entryDataCopy; @@ -1281,7 +1281,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end else if - else if( BitTest( style, GWS_STATIC_TEXT ) ) + else if( BitIsSet( style, GWS_STATIC_TEXT ) ) { TextData *textData = (TextData *)source->winGetUserData(); TextData textDataCopy; @@ -1301,7 +1301,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end else if - else if( BitTest( style, GWS_PROGRESS_BAR ) ) + else if( BitIsSet( style, GWS_PROGRESS_BAR ) ) { duplicate = @@ -1316,7 +1316,7 @@ GameWindow *GUIEditWindowManager::duplicateWindow( GameWindow *source, FALSE ); } // end else if - else if( BitTest( style, GWS_USER_WINDOW ) ) + else if( BitIsSet( style, GWS_USER_WINDOW ) ) { // create plain ol generic window diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp index 643f7d9f69..0be0eda1f1 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp @@ -857,31 +857,31 @@ char *HierarchyView::getWindowTreeName( GameWindow *window ) // no name available, construct one based on type Int style = window->winGetStyle(); - if( BitTest( style, GWS_PUSH_BUTTON ) ) + if( BitIsSet( style, GWS_PUSH_BUTTON ) ) strcpy( buffer, "Button" ); - else if( BitTest( style, GWS_RADIO_BUTTON ) ) + else if( BitIsSet( style, GWS_RADIO_BUTTON ) ) strcpy( buffer, "Radio Button" ); - else if( BitTest( style, GWS_TAB_CONTROL ) ) + else if( BitIsSet( style, GWS_TAB_CONTROL ) ) strcpy( buffer, "Tab Control" ); - else if( BitTest( style, GWS_CHECK_BOX ) ) + else if( BitIsSet( style, GWS_CHECK_BOX ) ) strcpy( buffer, "Check Box" ); - else if( BitTest( style, GWS_HORZ_SLIDER ) ) + else if( BitIsSet( style, GWS_HORZ_SLIDER ) ) strcpy( buffer, "Horizontal Slider" ); - else if( BitTest( style, GWS_VERT_SLIDER ) ) + else if( BitIsSet( style, GWS_VERT_SLIDER ) ) strcpy( buffer, "Vertical Slider" ); - else if( BitTest( style, GWS_STATIC_TEXT ) ) + else if( BitIsSet( style, GWS_STATIC_TEXT ) ) strcpy( buffer, "Static Text" ); - else if( BitTest( style, GWS_ENTRY_FIELD ) ) + else if( BitIsSet( style, GWS_ENTRY_FIELD ) ) strcpy( buffer, "Text Entry" ); - else if( BitTest( style, GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( style, GWS_SCROLL_LISTBOX ) ) strcpy( buffer, "Listbox" ); - else if( BitTest( style, GWS_PROGRESS_BAR ) ) + else if( BitIsSet( style, GWS_PROGRESS_BAR ) ) strcpy( buffer, "Progress Bar" ); - else if( BitTest( style, GWS_USER_WINDOW ) ) + else if( BitIsSet( style, GWS_USER_WINDOW ) ) strcpy( buffer, "User Window" ); - else if( BitTest( style, GWS_TAB_PANE ) ) + else if( BitIsSet( style, GWS_TAB_PANE ) ) strcpy( buffer, "Tab Pane" ); - else if( BitTest( style, GWS_COMBO_BOX ) ) + else if( BitIsSet( style, GWS_COMBO_BOX ) ) strcpy( buffer, "Combo Box" ); else strcpy( buffer, "Undefined" ); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp index c5280155f2..5a2d171ad1 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp @@ -448,7 +448,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) // apply changes to this window ImageAndColorInfo *info; - if( BitTest( root->winGetStyle(), GWS_PUSH_BUTTON ) ) + if( BitIsSet( root->winGetStyle(), GWS_PUSH_BUTTON ) ) { info = GetStateInfo( BUTTON_ENABLED ); @@ -479,7 +479,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetButtonSetHiliteSelectedBorderColor( root, info->borderColor ); } // end if - else if( BitTest( root->winGetStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( root->winGetStyle(), GWS_RADIO_BUTTON ) ) { info = GetStateInfo( RADIO_ENABLED ); @@ -522,7 +522,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetRadioSetHiliteCheckedBoxBorderColor( root, info->borderColor ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_CHECK_BOX ) ) + else if( BitIsSet( root->winGetStyle(), GWS_CHECK_BOX ) ) { info = GetStateInfo( CHECK_BOX_ENABLED ); @@ -565,7 +565,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetCheckBoxSetHiliteCheckedBoxBorderColor( root, info->borderColor ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_VERT_SLIDER ) ) + else if( BitIsSet( root->winGetStyle(), GWS_VERT_SLIDER ) ) { info = GetStateInfo( VSLIDER_ENABLED_TOP ); @@ -629,7 +629,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetSliderSetHiliteSelectedThumbBorderColor( root, info->borderColor ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_HORZ_SLIDER ) ) + else if( BitIsSet( root->winGetStyle(), GWS_HORZ_SLIDER ) ) { info = GetStateInfo( HSLIDER_ENABLED_LEFT ); @@ -693,7 +693,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetSliderSetHiliteSelectedThumbBorderColor( root, info->borderColor ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( root->winGetStyle(), GWS_SCROLL_LISTBOX ) ) { info = GetStateInfo( LISTBOX_ENABLED ); @@ -874,7 +874,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) } // end if } // end else if - else if( BitTest( root->winGetStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( root->winGetStyle(), GWS_COMBO_BOX ) ) { info = GetStateInfo( COMBOBOX_ENABLED ); GadgetListBoxSetEnabledImage( root, info->image ); @@ -1170,7 +1170,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) } // end if }// end if (combo listbox) }// end if - else if( BitTest( root->winGetStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( root->winGetStyle(), GWS_ENTRY_FIELD ) ) { info = GetStateInfo( TEXT_ENTRY_ENABLED_LEFT ); @@ -1207,7 +1207,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetTextEntrySetHiliteImageSmallCenter( root, info->image ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( root->winGetStyle(), GWS_STATIC_TEXT ) ) { info = GetStateInfo( STATIC_TEXT_ENABLED ); @@ -1226,7 +1226,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetStaticTextSetHiliteBorderColor( root, info->borderColor ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_PROGRESS_BAR ) ) + else if( BitIsSet( root->winGetStyle(), GWS_PROGRESS_BAR ) ) { info = GetStateInfo( PROGRESS_BAR_ENABLED_LEFT ); @@ -1293,7 +1293,7 @@ void LayoutScheme::applyPropertyTablesToWindow( GameWindow *root ) GadgetProgressBarSetHiliteBarImageSmallCenter( root, info->image ); } // end else if - else if( BitTest( root->winGetStyle(), GWS_TAB_CONTROL ) ) + else if( BitIsSet( root->winGetStyle(), GWS_TAB_CONTROL ) ) { info = GetStateInfo( TC_TAB_0_ENABLED ); GadgetTabControlSetEnabledImageTabZero( root, info->image ); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp index dc52faa456..12b2fdeb0f 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp @@ -405,25 +405,25 @@ void InitPropertiesDialog( GameWindow *window, Int x, Int y ) ClientToScreen( TheEditWindow->getWindowHandle(), &screen ); // bring up the right dialog - if( BitTest( window->winGetStyle(), GWS_PUSH_BUTTON ) ) + if( BitIsSet( window->winGetStyle(), GWS_PUSH_BUTTON ) ) dialog = InitPushButtonPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) dialog = InitRadioButtonPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + else if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) dialog = InitTabControlPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_CHECK_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_CHECK_BOX ) ) dialog = InitCheckBoxPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) dialog = InitListboxPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_PROGRESS_BAR ) ) + else if( BitIsSet( window->winGetStyle(), GWS_PROGRESS_BAR ) ) dialog = InitProgressBarPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( window->winGetStyle(), GWS_STATIC_TEXT ) ) dialog = InitStaticTextPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( window->winGetStyle(), GWS_ENTRY_FIELD ) ) dialog = InitTextEntryPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_ALL_SLIDER ) ) + else if( BitIsSet( window->winGetStyle(), GWS_ALL_SLIDER ) ) dialog = InitSliderPropertiesDialog( window ); - else if( BitTest( window->winGetStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_COMBO_BOX ) ) dialog = InitComboBoxPropertiesDialog( window ); else dialog = InitUserWinPropertiesDialog( window ); @@ -709,15 +709,15 @@ static void saveTextLabel( HWND edit, GameWindow *window ) text = TheGameText->fetch( (char *)instData->m_textLabelString.str()); //TheWindowManager->winTextLabelToText( instData->m_textLabelString ); UnsignedInt style = window->winGetStyle(); - if( BitTest( style, GWS_PUSH_BUTTON ) ) + if( BitIsSet( style, GWS_PUSH_BUTTON ) ) GadgetButtonSetText( window, text ); - else if( BitTest( style, GWS_CHECK_BOX ) ) + else if( BitIsSet( style, GWS_CHECK_BOX ) ) GadgetCheckBoxSetText( window, text ); - else if( BitTest( style, GWS_RADIO_BUTTON ) ) + else if( BitIsSet( style, GWS_RADIO_BUTTON ) ) GadgetRadioSetText( window, text ); - else if( BitTest( style, GWS_STATIC_TEXT ) ) + else if( BitIsSet( style, GWS_STATIC_TEXT ) ) GadgetStaticTextSetText( window, text ); - else if( BitTest( style, GWS_ENTRY_FIELD ) ) + else if( BitIsSet( style, GWS_ENTRY_FIELD ) ) GadgetTextEntrySetText( window, text ); else window->winSetText( text ); @@ -777,7 +777,7 @@ void LoadStateCombo( UnsignedInt style, HWND comboBox ) for( entry = imageAndColorTable; entry->stateName; entry++ ) { - if( BitTest( entry->windowType, style ) ) + if( BitIsSet( entry->windowType, style ) ) { // add string @@ -807,25 +807,25 @@ void CommonDialogInitialize( GameWindow *window, HWND dialog ) instData = window->winGetInstanceData(); // populate common properties - if( BitTest( window->winGetStatus(), WIN_STATUS_ENABLED ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_ENABLED ) ) CheckDlgButton( dialog, CHECK_ENABLED, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_DRAGABLE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_DRAGABLE ) ) CheckDlgButton( dialog, CHECK_DRAGABLE, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_HIDDEN ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_HIDDEN ) ) CheckDlgButton( dialog, CHECK_HIDDEN, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_NO_INPUT ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_NO_INPUT ) ) CheckDlgButton( dialog, CHECK_NO_INPUT, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_NO_FOCUS ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_NO_FOCUS ) ) CheckDlgButton( dialog, CHECK_NO_FOCUS, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_BORDER ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_BORDER ) ) CheckDlgButton( dialog, CHECK_BORDER, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_IMAGE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_IMAGE ) ) CheckDlgButton( dialog, CHECK_IMAGE, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_SEE_THRU ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_SEE_THRU ) ) CheckDlgButton( dialog, CHECK_SEE_THRU, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_WRAP_CENTERED ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_WRAP_CENTERED ) ) CheckDlgButton( dialog, CHECK_WRAP_CENTERED, BST_CHECKED ); - if( BitTest( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) + if( BitIsSet( window->winGetStatus(), WIN_STATUS_CHECK_LIKE ) ) CheckDlgButton( dialog, CHECK_CHECK_LIKE, BST_CHECKED ); // @@ -958,27 +958,27 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) if( useImages ) { - if( BitTest( style, GWS_PUSH_BUTTON ) ) + if( BitIsSet( style, GWS_PUSH_BUTTON ) ) window->winSetDrawFunc( TheWindowManager->getPushButtonImageDrawFunc() ); - else if( BitTest( style, GWS_RADIO_BUTTON ) ) + else if( BitIsSet( style, GWS_RADIO_BUTTON ) ) window->winSetDrawFunc( TheWindowManager->getRadioButtonImageDrawFunc() ); - else if( BitTest( style, GWS_TAB_CONTROL ) ) + else if( BitIsSet( style, GWS_TAB_CONTROL ) ) window->winSetDrawFunc( TheWindowManager->getTabControlImageDrawFunc() ); - else if( BitTest( style, GWS_CHECK_BOX ) ) + else if( BitIsSet( style, GWS_CHECK_BOX ) ) window->winSetDrawFunc( TheWindowManager->getCheckBoxImageDrawFunc() ); - else if( BitTest( style, GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( style, GWS_SCROLL_LISTBOX ) ) window->winSetDrawFunc( TheWindowManager->getListBoxImageDrawFunc() ); - else if( BitTest( style, GWS_COMBO_BOX ) ) + else if( BitIsSet( style, GWS_COMBO_BOX ) ) window->winSetDrawFunc( TheWindowManager->getComboBoxImageDrawFunc() ); - else if( BitTest( style, GWS_PROGRESS_BAR ) ) + else if( BitIsSet( style, GWS_PROGRESS_BAR ) ) window->winSetDrawFunc( TheWindowManager->getProgressBarImageDrawFunc() ); - else if( BitTest( style, GWS_HORZ_SLIDER ) ) + else if( BitIsSet( style, GWS_HORZ_SLIDER ) ) window->winSetDrawFunc( TheWindowManager->getHorizontalSliderImageDrawFunc() ); - else if( BitTest( style, GWS_VERT_SLIDER ) ) + else if( BitIsSet( style, GWS_VERT_SLIDER ) ) window->winSetDrawFunc( TheWindowManager->getVerticalSliderImageDrawFunc() ); - else if( BitTest( style, GWS_STATIC_TEXT ) ) + else if( BitIsSet( style, GWS_STATIC_TEXT ) ) window->winSetDrawFunc( TheWindowManager->getStaticTextImageDrawFunc() ); - else if( BitTest( style, GWS_ENTRY_FIELD ) ) + else if( BitIsSet( style, GWS_ENTRY_FIELD ) ) window->winSetDrawFunc( TheWindowManager->getTextEntryImageDrawFunc() ); else { @@ -996,27 +996,27 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) else { - if( BitTest( style, GWS_PUSH_BUTTON ) ) + if( BitIsSet( style, GWS_PUSH_BUTTON ) ) window->winSetDrawFunc( TheWindowManager->getPushButtonDrawFunc() ); - else if( BitTest( style, GWS_RADIO_BUTTON ) ) + else if( BitIsSet( style, GWS_RADIO_BUTTON ) ) window->winSetDrawFunc( TheWindowManager->getRadioButtonDrawFunc() ); - else if( BitTest( style, GWS_TAB_CONTROL ) ) + else if( BitIsSet( style, GWS_TAB_CONTROL ) ) window->winSetDrawFunc( TheWindowManager->getTabControlDrawFunc() ); - else if( BitTest( style, GWS_CHECK_BOX ) ) + else if( BitIsSet( style, GWS_CHECK_BOX ) ) window->winSetDrawFunc( TheWindowManager->getCheckBoxDrawFunc() ); - else if( BitTest( style, GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( style, GWS_SCROLL_LISTBOX ) ) window->winSetDrawFunc( TheWindowManager->getListBoxDrawFunc() ); - else if( BitTest( style, GWS_COMBO_BOX ) ) + else if( BitIsSet( style, GWS_COMBO_BOX ) ) window->winSetDrawFunc( TheWindowManager->getComboBoxDrawFunc() ); - else if( BitTest( style, GWS_PROGRESS_BAR ) ) + else if( BitIsSet( style, GWS_PROGRESS_BAR ) ) window->winSetDrawFunc( TheWindowManager->getProgressBarDrawFunc() ); - else if( BitTest( style, GWS_HORZ_SLIDER ) ) + else if( BitIsSet( style, GWS_HORZ_SLIDER ) ) window->winSetDrawFunc( TheWindowManager->getHorizontalSliderDrawFunc() ); - else if( BitTest( style, GWS_VERT_SLIDER ) ) + else if( BitIsSet( style, GWS_VERT_SLIDER ) ) window->winSetDrawFunc( TheWindowManager->getVerticalSliderDrawFunc() ); - else if( BitTest( style, GWS_STATIC_TEXT ) ) + else if( BitIsSet( style, GWS_STATIC_TEXT ) ) window->winSetDrawFunc( TheWindowManager->getStaticTextDrawFunc() ); - else if( BitTest( style, GWS_ENTRY_FIELD ) ) + else if( BitIsSet( style, GWS_ENTRY_FIELD ) ) window->winSetDrawFunc( TheWindowManager->getTextEntryDrawFunc() ); else { @@ -1119,7 +1119,7 @@ Bool SaveCommonDialogProperties( HWND dialog, GameWindow *window ) // or not // if( TheEditor->windowIsGadget( window ) ) - adjustGadgetDrawMethods( BitTest( window->winGetStatus(), WIN_STATUS_IMAGE ), + adjustGadgetDrawMethods( BitIsSet( window->winGetStatus(), WIN_STATUS_IMAGE ), window ); // save colors diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp index 8a9f2a6bc8..0ad0dbe7a3 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp @@ -127,29 +127,29 @@ static Bool saveType( GameWindow *window, FILE *fp, Int dataIndent ) { char *type; - if( BitTest( window->winGetStyle(), GWS_PUSH_BUTTON ) ) + if( BitIsSet( window->winGetStyle(), GWS_PUSH_BUTTON ) ) type = "PUSHBUTTON"; - else if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) type = "RADIOBUTTON"; - else if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + else if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) type = "TABCONTROL"; - else if( BitTest( window->winGetStyle(), GWS_TAB_PANE ) ) + else if( BitIsSet( window->winGetStyle(), GWS_TAB_PANE ) ) type = "TABPANE"; - else if( BitTest( window->winGetStyle(), GWS_CHECK_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_CHECK_BOX ) ) type = "CHECKBOX"; - else if( BitTest( window->winGetStyle(), GWS_VERT_SLIDER ) ) + else if( BitIsSet( window->winGetStyle(), GWS_VERT_SLIDER ) ) type = "VERTSLIDER"; - else if( BitTest( window->winGetStyle(), GWS_HORZ_SLIDER ) ) + else if( BitIsSet( window->winGetStyle(), GWS_HORZ_SLIDER ) ) type = "HORZSLIDER"; - else if( BitTest( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) type = "SCROLLLISTBOX"; - else if( BitTest( window->winGetStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_COMBO_BOX ) ) type = "COMBOBOX"; - else if( BitTest( window->winGetStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( window->winGetStyle(), GWS_ENTRY_FIELD ) ) type = "ENTRYFIELD"; - else if( BitTest( window->winGetStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( window->winGetStyle(), GWS_STATIC_TEXT ) ) type = "STATICTEXT"; - else if( BitTest( window->winGetStyle(), GWS_PROGRESS_BAR ) ) + else if( BitIsSet( window->winGetStyle(), GWS_PROGRESS_BAR ) ) type = "PROGRESSBAR"; else type = "USER"; @@ -225,7 +225,7 @@ static Bool saveStatus( GameWindow *window, FILE *fp, Int dataIndent ) { bit = 1 << i; - if( BitTest( window->winGetStatus(), bit ) ) + if( BitIsSet( window->winGetStatus(), bit ) ) { // if this is an additional bit add a + @@ -269,7 +269,7 @@ static Bool saveStyle( GameWindow *window, FILE *fp, Int dataIndent ) { bit = 1 << i; - if( BitTest( window->winGetStyle(), bit ) ) + if( BitIsSet( window->winGetStyle(), bit ) ) { // if this is an additional bit add a + @@ -964,20 +964,20 @@ static Bool saveTabControlData( GameWindow *window, FILE *fp, Int dataIndent ) static Bool saveGadgetData( GameWindow *window, FILE *fp, Int dataIndent ) { - if( BitTest( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) + if( BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) ) return saveListboxData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_COMBO_BOX ) ) + else if( BitIsSet( window->winGetStyle(), GWS_COMBO_BOX ) ) return saveComboBoxData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + else if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) return saveRadioButtonData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_VERT_SLIDER | + else if( BitIsSet( window->winGetStyle(), GWS_VERT_SLIDER | GWS_HORZ_SLIDER ) ) return saveSliderData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_STATIC_TEXT ) ) + else if( BitIsSet( window->winGetStyle(), GWS_STATIC_TEXT ) ) return saveStaticTextData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_ENTRY_FIELD ) ) + else if( BitIsSet( window->winGetStyle(), GWS_ENTRY_FIELD ) ) return saveTextEntryData( window, fp, dataIndent ); - else if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + else if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) return saveTabControlData( window, fp, dataIndent ); return TRUE; @@ -1021,7 +1021,7 @@ static Bool saveWindow( FILE *fp, GameWindow *window, Int indent ) saveDrawData( "DISABLEDDRAWDATA", window, fp, dataIndent ); saveDrawData( "HILITEDRAWDATA", window, fp, dataIndent ); - if( BitTest( window->winGetStyle(), GWS_TAB_CONTROL ) ) + if( BitIsSet( window->winGetStyle(), GWS_TAB_CONTROL ) ) {//Seems cleaner to put this before the children list since this Gadget needs both saveGadgetData( window, fp, dataIndent ); } @@ -1031,7 +1031,7 @@ static Bool saveWindow( FILE *fp, GameWindow *window, Int indent ) // themselves, only generic stuff, except for the Tab Control again, which // is the gadget with children exception // - if( (TheEditor->windowIsGadget( window ) == FALSE) || BitTest(window->winGetStyle(), GWS_TAB_CONTROL) ) + if( (TheEditor->windowIsGadget( window ) == FALSE) || BitIsSet(window->winGetStyle(), GWS_TAB_CONTROL) ) { child = window->winGetChild(); @@ -1158,7 +1158,7 @@ void GUIEdit::updateRadioScreenIdentifiers( GameWindow *window, Int screenID ) return; // is this a radio button - if( BitTest( window->winGetStyle(), GWS_RADIO_BUTTON ) ) + if( BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) ) { RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData(); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp index 4a86a6e535..8f0101bb26 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp @@ -72,7 +72,7 @@ static char *szWindowClass = "GUIEdit"; HINSTANCE ApplicationHInstance; ///< main application instance HWND ApplicationHWnd; ///< main application HWnd Win32Mouse *TheWin32Mouse = NULL; ///< for Win32 mouse -char *gAppPrefix = "ge_"; /// So GuiEdit can have a different debug log file name if we need it +const char *gAppPrefix = "ge_"; /// So GuiEdit can have a different debug log file name if we need it const Char *g_strFile = "data\\Generals.str"; const Char *g_csfFile = "data\\%s\\Generals.csf"; @@ -484,7 +484,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, { Int virtualKey = wParam; // Int keyData = lParam; - Bool controlDown = BitTest( GetKeyState( VK_CONTROL ), 0x1000 ); + Bool controlDown = BitIsSet( GetKeyState( VK_CONTROL ), 0x1000 ); switch( virtualKey ) { diff --git a/GeneralsMD/Code/Tools/ImagePacker/Source/ImagePacker.cpp b/GeneralsMD/Code/Tools/ImagePacker/Source/ImagePacker.cpp index 3b358ab2cc..413d618761 100644 --- a/GeneralsMD/Code/Tools/ImagePacker/Source/ImagePacker.cpp +++ b/GeneralsMD/Code/Tools/ImagePacker/Source/ImagePacker.cpp @@ -54,7 +54,7 @@ #include "WindowProc.h" // DEFINES //////////////////////////////////////////////////////////////////// -char *gAppPrefix = "ip_"; // So IP can have a different debug log file name if we need it. +const char *gAppPrefix = "ip_"; // So IP can have a different debug log file name if we need it. // PRIVATE TYPES ////////////////////////////////////////////////////////////// @@ -225,7 +225,7 @@ Bool ImagePacker::packImages( void ) image = m_imageList[ i ]; // ignore images that we cannot process - if( BitTest( image->m_status, ImageInfo::CANTPROCESS) ) + if( BitIsSet( image->m_status, ImageInfo::CANTPROCESS) ) continue; // try to put image on each page @@ -899,7 +899,7 @@ Bool ImagePacker::generateINIFile( void ) { // ignore texture pages that generated errors - if( BitTest( page->m_status, TexturePage::PAGE_ERROR ) ) + if( BitIsSet( page->m_status, TexturePage::PAGE_ERROR ) ) continue; // go through each image on this page @@ -922,7 +922,7 @@ Bool ImagePacker::generateINIFile( void ) image->m_pagePos.lo.x, image->m_pagePos.lo.y, image->m_pagePos.hi.x + 1, image->m_pagePos.hi.y + 1 ); fprintf( fp, " Status = %s\n", - BitTest( image->m_status, ImageInfo::ROTATED90C ) ? + BitIsSet( image->m_status, ImageInfo::ROTATED90C ) ? "ROTATED_90_CLOCKWISE" : "NONE" ); fprintf( fp, "End\n\n" ); @@ -961,7 +961,7 @@ Bool ImagePacker::getSettingsFromDialog( HWND dialog ) size = GetDlgItemInt( dialog, EDIT_WIDTH, NULL, FALSE ); for( val = size; val; val >>= 1 ) - if( BitTest( val, 0x1 ) ) + if( BitIsSet( val, 0x1 ) ) bitCount++; // diff --git a/GeneralsMD/Code/Tools/ImagePacker/Source/TexturePage.cpp b/GeneralsMD/Code/Tools/ImagePacker/Source/TexturePage.cpp index 0c2341ed1e..ad0d5343a3 100644 --- a/GeneralsMD/Code/Tools/ImagePacker/Source/TexturePage.cpp +++ b/GeneralsMD/Code/Tools/ImagePacker/Source/TexturePage.cpp @@ -93,7 +93,7 @@ void TexturePage::extendToRowIfOpen( char *src, // a border to extend into // if( srcY < imageHeight / 2 && - (srcY != 0 || BitTest( fitBits, ImageInfo::FIT_YBORDER_TOP )) ) + (srcY != 0 || BitIsSet( fitBits, ImageInfo::FIT_YBORDER_TOP )) ) { // try to extend pixel "up" if that pixel is "open" @@ -103,7 +103,7 @@ void TexturePage::extendToRowIfOpen( char *src, } // end if else if( srcY >= imageHeight / 2 && (srcY != imageHeight - 1 || - BitTest( fitBits, ImageInfo::FIT_YBORDER_BOTTOM )) ) + BitIsSet( fitBits, ImageInfo::FIT_YBORDER_BOTTOM )) ) { // try to extend pixel "down" if that pixel is "open" @@ -238,7 +238,7 @@ void TexturePage::extendImageEdges( Byte *destBuffer, // account whether or not the destination image was rotated or not // Int imageWidth, imageHeight; - if( BitTest( image->m_status, ImageInfo::ROTATED90C ) ) + if( BitIsSet( image->m_status, ImageInfo::ROTATED90C ) ) { imageWidth = image->m_size.y; @@ -319,7 +319,7 @@ void TexturePage::extendImageEdges( Byte *destBuffer, // extended into when we detect an edge change moving across x // if( currPixel == TRUE && x == imageWidth - 1 && - BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) ) + BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) ) { // @@ -367,7 +367,7 @@ void TexturePage::extendImageEdges( Byte *destBuffer, // pixel to the position of previous pixel. Note this is not allowed // when we're at the left edge and we DON'T have a border to copy into // - if( x != 0 || BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) ) + if( x != 0 || BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) ) { // extend our current pixel to the previous location @@ -430,26 +430,26 @@ void TexturePage::extendImageEdges( Byte *destBuffer, // top left corner if( x == 0 && y == 0 && - BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) && - BitTest( image->m_fitBits, ImageInfo::FIT_YBORDER_TOP ) ) + BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) && + BitIsSet( image->m_fitBits, ImageInfo::FIT_YBORDER_TOP ) ) dst = (ptr + (destWidth * destBPP)) - destBPP; // top right corner else if( x == imageWidth - 1 && y == 0 && - BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) && - BitTest( image->m_fitBits, ImageInfo::FIT_YBORDER_TOP ) ) + BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) && + BitIsSet( image->m_fitBits, ImageInfo::FIT_YBORDER_TOP ) ) dst = (ptr + (destWidth * destBPP)) + destBPP; // bottom right corner else if( x == imageWidth - 1 && y == imageHeight - 1 && - BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) && - BitTest( image->m_fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) + BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_RIGHT ) && + BitIsSet( image->m_fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) dst = (ptr - (destWidth * destBPP)) + destBPP; // bottom left corner else if( x == 0 && y == imageHeight - 1 && - BitTest( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) && - BitTest( image->m_fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) + BitIsSet( image->m_fitBits, ImageInfo::FIT_XBORDER_LEFT ) && + BitIsSet( image->m_fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) dst = (ptr - (destWidth * destBPP)) - destBPP; // copy the pixel at 'ptr' to 'dst' for the diagonal extend @@ -546,7 +546,7 @@ Bool TexturePage::addImageData( Byte *destBuffer, Int count; Int x, y; - if( BitTest( image->m_status, ImageInfo::ROTATED90C ) == FALSE ) + if( BitIsSet( image->m_status, ImageInfo::ROTATED90C ) == FALSE ) { // @@ -669,7 +669,7 @@ Bool TexturePage::addImageData( Byte *destBuffer, // the image we just copied into the texture page and "bleed" the edges outward // and if a border is present, into the border // - if( BitTest( TheImagePacker->getGapMethod(), + if( BitIsSet( TheImagePacker->getGapMethod(), ImagePacker::GAP_METHOD_EXTEND_RGB ) ) extendImageEdges( destBuffer, destWidth, @@ -906,9 +906,9 @@ Bool TexturePage::addImage( ImageInfo *image ) // get our options for fitting Bool useGutter, useRGBExtend; - useGutter = BitTest( TheImagePacker->getGapMethod(), + useGutter = BitIsSet( TheImagePacker->getGapMethod(), ImagePacker::GAP_METHOD_GUTTER ); - useRGBExtend = BitTest( TheImagePacker->getGapMethod(), + useRGBExtend = BitIsSet( TheImagePacker->getGapMethod(), ImagePacker::GAP_METHOD_EXTEND_RGB ); // @@ -1136,17 +1136,17 @@ Bool TexturePage::addImage( ImageInfo *image ) // on the texture page // image->m_pagePos = region; - if( BitTest( fitBits, ImageInfo::FIT_XBORDER_LEFT ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_XBORDER_LEFT ) ) image->m_pagePos.lo.x++; - if( BitTest( fitBits, ImageInfo::FIT_YBORDER_TOP ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_YBORDER_TOP ) ) image->m_pagePos.lo.y++; - if( BitTest( fitBits, ImageInfo::FIT_XBORDER_RIGHT ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_XBORDER_RIGHT ) ) image->m_pagePos.hi.x--; - if( BitTest( fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_YBORDER_BOTTOM ) ) image->m_pagePos.hi.y--; - if( BitTest( fitBits, ImageInfo::FIT_XGUTTER ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_XGUTTER ) ) image->m_pagePos.hi.x -= xGutter; - if( BitTest( fitBits, ImageInfo::FIT_YGUTTER ) ) + if( BitIsSet( fitBits, ImageInfo::FIT_YGUTTER ) ) image->m_pagePos.hi.y -= yGutter; // link this image to the texture page diff --git a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImageErrorProc.cpp b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImageErrorProc.cpp index dff6b7ffd1..dbb08c6053 100644 --- a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImageErrorProc.cpp +++ b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImageErrorProc.cpp @@ -105,12 +105,12 @@ BOOL CALLBACK ImageErrorProc( HWND hWndDialog, UINT message, continue; // if image can't be processed find out why - if( BitTest( image->m_status, ImageInfo::CANTPROCESS ) ) + if( BitIsSet( image->m_status, ImageInfo::CANTPROCESS ) ) { - if( BitTest( image->m_status, ImageInfo::TOOBIG ) ) + if( BitIsSet( image->m_status, ImageInfo::TOOBIG ) ) sprintf( reason, "Too Big" ); - else if( BitTest( image->m_status, ImageInfo::INVALIDCOLORDEPTH ) ) + else if( BitIsSet( image->m_status, ImageInfo::INVALIDCOLORDEPTH ) ) sprintf( reason, "Unsupported Color Depth" ); else sprintf( reason, "Unknown Reason" ); diff --git a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImagePackerProc.cpp b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImagePackerProc.cpp index b728496a5a..d5d08e4a14 100644 --- a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImagePackerProc.cpp +++ b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/ImagePackerProc.cpp @@ -147,9 +147,9 @@ BOOL CALLBACK ImagePackerProc( HWND hWndDialog, UINT message, // set option checks for gap method UnsignedInt gapOptions = TheImagePacker->getGapMethod(); - if( BitTest( gapOptions, ImagePacker::GAP_METHOD_EXTEND_RGB ) ) + if( BitIsSet( gapOptions, ImagePacker::GAP_METHOD_EXTEND_RGB ) ) CheckDlgButton( hWndDialog, CHECK_GAP_EXTEND_RGB, BST_CHECKED ); - if( BitTest( gapOptions, ImagePacker::GAP_METHOD_GUTTER ) ) + if( BitIsSet( gapOptions, ImagePacker::GAP_METHOD_GUTTER ) ) CheckDlgButton( hWndDialog, CHECK_GAP_GUTTER, BST_CHECKED ); return TRUE; diff --git a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/PageErrorProc.cpp b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/PageErrorProc.cpp index 72f3e13f0b..0cd195bd72 100644 --- a/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/PageErrorProc.cpp +++ b/GeneralsMD/Code/Tools/ImagePacker/Source/Window Procedures/PageErrorProc.cpp @@ -98,16 +98,16 @@ BOOL CALLBACK PageErrorProc( HWND hWndDialog, UINT message, { // if image can't be processed find out why - if( BitTest( page->m_status, TexturePage::PAGE_ERROR ) ) + if( BitIsSet( page->m_status, TexturePage::PAGE_ERROR ) ) { - if( BitTest( page->m_status, TexturePage::CANT_ALLOCATE_PACKED_IMAGE ) ) + if( BitIsSet( page->m_status, TexturePage::CANT_ALLOCATE_PACKED_IMAGE ) ) sprintf( reason, "Can't allocate image memory" ); - else if( BitTest( page->m_status, TexturePage::CANT_ADD_IMAGE_DATA ) ) + else if( BitIsSet( page->m_status, TexturePage::CANT_ADD_IMAGE_DATA ) ) sprintf( reason, "Can't add image(s) data" ); - else if( BitTest( page->m_status, TexturePage::NO_TEXTURE_DATA ) ) + else if( BitIsSet( page->m_status, TexturePage::NO_TEXTURE_DATA ) ) sprintf( reason, "No texture data to write" ); - else if( BitTest( page->m_status, TexturePage::ERROR_DURING_SAVE ) ) + else if( BitIsSet( page->m_status, TexturePage::ERROR_DURING_SAVE ) ) sprintf( reason, "Error writing texture file" ); else sprintf( reason, "Unknown Reason" ); diff --git a/GeneralsMD/Code/Tools/MapCacheBuilder/Source/WinMain.cpp b/GeneralsMD/Code/Tools/MapCacheBuilder/Source/WinMain.cpp index 4d00045fb7..7f12789641 100644 --- a/GeneralsMD/Code/Tools/MapCacheBuilder/Source/WinMain.cpp +++ b/GeneralsMD/Code/Tools/MapCacheBuilder/Source/WinMain.cpp @@ -134,7 +134,7 @@ HINSTANCE ApplicationHInstance = NULL; ///< our application instance /// just to satisfy the game libraries we link to HWND ApplicationHWnd = NULL; -char *gAppPrefix = "MC_"; +const char *gAppPrefix = "MC_"; // Where are the default string files? const Char *g_strFile = "data\\Generals.str"; diff --git a/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP b/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP index 8581d90d19..b0cfa33e37 100644 --- a/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP +++ b/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP @@ -34,7 +34,7 @@ HINSTANCE ApplicationHInstance = NULL; ///< our application instance HWND ApplicationHWnd = NULL; const char *g_strFile = "data\\Generals.str"; const char *g_csfFile = "data\\%s\\Generals.csf"; -char *gAppPrefix = "patchget_"; // prefix to the debug log. +const char *gAppPrefix = "patchget_"; // prefix to the debug log. HINSTANCE Global_instance; diff --git a/GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt b/GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt index 2686664eed..78b064ab92 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt +++ b/GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt @@ -229,7 +229,7 @@ if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") target_link_options(z_worldbuilder PRIVATE /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libc.lib) target_compile_definitions(z_worldbuilder PRIVATE _AFXDLL) target_sources(z_worldbuilder PRIVATE res/WorldBuilder.rc) - set_target_properties(z_worldbuilder PROPERTIES OUTPUT_NAME WorldBuilder) + set_target_properties(z_worldbuilder PROPERTIES OUTPUT_NAME WorldBuilderZH) else() - set_target_properties(z_worldbuilder PROPERTIES OUTPUT_NAME worldbuilder) + set_target_properties(z_worldbuilder PROPERTIES OUTPUT_NAME worldbuilderzh) endif() diff --git a/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainMaterial.h b/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainMaterial.h index 80161c645f..2dcf063ef4 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainMaterial.h +++ b/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainMaterial.h @@ -85,7 +85,7 @@ class TerrainMaterial : public COptionsPanel, public PopupSliderOwner protected: void addTerrain(char *pPath, Int terrainNdx, HTREEITEM parent); - HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel); + HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel); void updateLabel(void); public: diff --git a/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainModal.h b/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainModal.h index 4bff433ec6..bb5c83289f 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainModal.h +++ b/GeneralsMD/Code/Tools/WorldBuilder/include/TerrainModal.h @@ -70,7 +70,7 @@ class TerrainModal : public CDialog protected: void addTerrain(char *pPath, Int terrainNdx, HTREEITEM parent); - HTREEITEM findOrAdd(HTREEITEM parent, char *pLabel); + HTREEITEM findOrAdd(HTREEITEM parent, const char *pLabel); void updateLabel(void); void updateTextures(void); Bool setTerrainTreeViewSelection(HTREEITEM parent, Int selection); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/EditParameter.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/EditParameter.cpp index 799160c1e1..b60bd66024 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/EditParameter.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/EditParameter.cpp @@ -1899,7 +1899,7 @@ BOOL EditParameter::OnInitDialog() pList->InsertString(-1, "Normal"); pList->InsertString(-1, "Alert"); pList->InsertString(-1, "Agressive"); - pList->SetCurSel(m_parameter->getInt() - AI_SLEEP); + pList->SetCurSel(m_parameter->getInt() - ATTITUDE_SLEEP); showList = true; break; @@ -2257,7 +2257,7 @@ void EditParameter::OnOK() m_parameter->friend_setInt(pList->GetCurSel() + Parameter::REL_ENEMY); break; case Parameter::AI_MOOD: - m_parameter->friend_setInt(pList->GetCurSel() + AI_SLEEP); + m_parameter->friend_setInt(pList->GetCurSel() + ATTITUDE_SLEEP); break; case Parameter::SKIRMISH_WAYPOINT_PATH: { CString cstr; diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/TeamBehavior.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/TeamBehavior.cpp index 97c6d53f4c..fba6ddc7fb 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/TeamBehavior.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/TeamBehavior.cpp @@ -153,7 +153,7 @@ BOOL TeamBehavior::OnInitDialog() pWnd->SetWindowText(description.str()); CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_ENEMY_INTERACTIONS); - pCombo->SetCurSel(m_teamDict->getInt(TheKey_teamAggressiveness, &exists) - AI_SLEEP); + pCombo->SetCurSel(m_teamDict->getInt(TheKey_teamAggressiveness, &exists) - ATTITUDE_SLEEP); return FALSE; // return TRUE unless you set the focus to a control @@ -247,7 +247,7 @@ void TeamBehavior::OnSelchangeEnemyInteractions() CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_ENEMY_INTERACTIONS); Int mode = pCombo->GetCurSel(); if (mode >= 0) { - m_teamDict->setInt(TheKey_teamAggressiveness, mode + AI_SLEEP); + m_teamDict->setInt(TheKey_teamAggressiveness, mode + ATTITUDE_SLEEP); } } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainMaterial.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainMaterial.cpp index 7391b3c0ab..ad5fbde940 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainMaterial.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainMaterial.cpp @@ -241,7 +241,7 @@ BOOL TerrainMaterial::OnInitDialog() /** Locate the child item in tree item parent with name pLabel. If not found, add it. Either way, return child. */ -HTREEITEM TerrainMaterial::findOrAdd(HTREEITEM parent, char *pLabel) +HTREEITEM TerrainMaterial::findOrAdd(HTREEITEM parent, const char *pLabel) { TVINSERTSTRUCT ins; char buffer[_MAX_PATH]; @@ -265,7 +265,7 @@ HTREEITEM TerrainMaterial::findOrAdd(HTREEITEM parent, char *pLabel) ins.hInsertAfter = TVI_LAST; ins.item.mask = TVIF_PARAM|TVIF_TEXT; ins.item.lParam = -1; - ins.item.pszText = pLabel; + ins.item.pszText = const_cast(pLabel); ins.item.cchTextMax = strlen(pLabel); child = m_terrainTreeView.InsertItem(&ins); return(child); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainModal.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainModal.cpp index 5a3544565c..80d3163d1a 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainModal.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/TerrainModal.cpp @@ -113,7 +113,7 @@ BOOL TerrainModal::OnInitDialog() /** Locate the child item in tree item parent with name pLabel. If not found, add it. Either way, return child. */ -HTREEITEM TerrainModal::findOrAdd(HTREEITEM parent, char *pLabel) +HTREEITEM TerrainModal::findOrAdd(HTREEITEM parent, const char *pLabel) { TVINSERTSTRUCT ins; char buffer[_MAX_PATH]; @@ -137,7 +137,7 @@ HTREEITEM TerrainModal::findOrAdd(HTREEITEM parent, char *pLabel) ins.hInsertAfter = TVI_LAST; ins.item.mask = TVIF_PARAM|TVIF_TEXT; ins.item.lParam = -1; - ins.item.pszText = pLabel; + ins.item.pszText = const_cast(pLabel); ins.item.cchTextMax = strlen(pLabel); child = m_terrainTreeView.InsertItem(&ins); return(child); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 5a63817c41..6cf3997303 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -103,7 +103,7 @@ void initSubsystem(SUBSYSTEM*& sysref, SUBSYSTEM* sys, const char* path1 = NULL, #define OPEN_FILE_DIR "OpenDirectory" Win32Mouse *TheWin32Mouse = NULL; -char *gAppPrefix = "wb_"; /// So WB can have a different debug log file name. +const char *gAppPrefix = "wb_"; /// So WB can have a different debug log file name. const Char *g_strFile = "data\\Generals.str"; const Char *g_csfFile = "data\\%s\\Generals.csf"; diff --git a/cmake/stlport.cmake b/cmake/stlport.cmake index dcb28500d7..6c74d372eb 100644 --- a/cmake/stlport.cmake +++ b/cmake/stlport.cmake @@ -1,7 +1,14 @@ -FetchContent_Declare( - stlport - GIT_REPOSITORY https://github.com/TheSuperHackers/stlport-4.5.3.git - GIT_TAG 501824065f5b1eab77ca7f53ed3a227acf965eb1 -) +if (MSVC AND MSVC_VERSION LESS 1300) + # Use stlport for VS6 builds + FetchContent_Declare( + stlport + GIT_REPOSITORY https://github.com/TheSuperHackers/stlport-4.5.3.git + GIT_TAG 501824065f5b1eab77ca7f53ed3a227acf965eb1 + ) -FetchContent_MakeAvailable(stlport) + FetchContent_MakeAvailable(stlport) + target_compile_definitions(stlport INTERFACE USING_STLPORT=1) +else() + # Do not use stlport + add_library(stlport INTERFACE) +endif()