From cbed4624faeb4b192f908b1a2a66b7f3744fb32a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 29 Nov 2013 13:24:38 +0100 Subject: [PATCH 1/4] - added a user-settable factor for earthquake intensity. Value can be between 0 (no shaking) and 1 (normal shaking.) --- src/r_utility.cpp | 13 +++++++++---- wadsrc/static/menudef.txt | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 606cca840..356bfe741 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -89,6 +89,11 @@ CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE) CVAR (Int, r_clearbuffer, 0, 0) CVAR (Bool, r_drawvoxels, true, 0) CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites? +CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +{ + if (self < 0.f) self = 0.f; + else if (self > 1.f) self = 1.f; +} DCanvas *RenderTarget; // [RH] canvas to render to @@ -837,10 +842,10 @@ void R_SetupFrame (AActor *actor) int intensity = DEarthquake::StaticGetQuakeIntensity (camera); if (intensity != 0) { - viewx += ((pr_torchflicker() % (intensity<<2)) - -(intensity<<1))< Date: Fri, 29 Nov 2013 14:41:03 -0500 Subject: [PATCH 2/4] - Get as many files as possible as dependencies for pk3 building. (Kind of feels like CMake changes the behavior of depending on directories every now and then, but maybe it's just me.) --- CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f07d3ada..a257cceab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,20 @@ else(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) set( NO_GENERATOR_EXPRESSIONS ON ) endif(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) +# Function to get a recursive list of files, but also get the directory names +# as well unlike GLOB_RECURSE +function( glob_recurse_with_directories OUTVAR DIR ) + file( GLOB CHILDREN ${DIR}/* ) + foreach( CHILD ${CHILDREN} ) + if( IS_DIRECTORY ${CHILD} ) + set( TEMP_LIST "" ) + glob_recurse_with_directories( TEMP_LIST ${CHILD} ) + set( ${OUTVAR} ${${OUTVAR}} ${TEMP_LIST} ) + endif( IS_DIRECTORY ${CHILD} ) + endforeach( CHILD ${CHILDREN} ) + set( ${OUTVAR} ${${OUTVAR}} ${CHILDREN} PARENT_SCOPE ) +endfunction( glob_recurse_with_directories ) + # Simplify pk3 building, add_pk3(filename srcdirectory) function( add_pk3 PK3_NAME PK3_DIR ) get_target_property(ZIPDIR_EXE zipdir LOCATION) @@ -23,15 +37,18 @@ function( add_pk3 PK3_NAME PK3_DIR ) set( PK3_TARGET "pk3" ) endif( ${PK3_TARGET} STREQUAL "zdoom_pk3" ) + # Get as many files as we can to depend on. + glob_recurse_with_directories( PK3_DEPENDS ${PK3_DIR} ) + if( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} $/${PK3_NAME} - DEPENDS zipdir ${PK3_DIR} ) + DEPENDS zipdir ${PK3_DIR} ${PK3_DEPENDS} ) else( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} - DEPENDS zipdir ${PK3_DIR} ) + DEPENDS zipdir ${PK3_DIR} ${PK3_DEPENDS} ) endif( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) add_custom_target( ${PK3_TARGET} ALL From c04a800e2b855d05283759ef1b21c50c61157c85 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 29 Nov 2013 17:10:29 -0500 Subject: [PATCH 3/4] - When doing OLDSTYLE builds we can use the RUNTIME_OUTPUT_DIRECTORY_ properties to force the output location properly. --- src/CMakeLists.txt | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 972e187db..4e1152294 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1098,16 +1098,23 @@ if( NOT ZDOOM_OUTPUT_OLDSTYLE OR NO_GENERATOR_EXPRESSIONS ) # Linux distributions are slow to adopt 2.6. :( set_target_properties( zdoom PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ZDOOM_OUTPUT_DIR} ) set_target_properties( zdoom PROPERTIES OUTPUT_NAME ${ZDOOM_EXE_NAME} ) +else( NOT ZDOOM_OUTPUT_OLDSTYLE OR NO_GENERATOR_EXPRESSIONS ) + set_target_properties( zdoom PROPERTIES + RUNTIME_OUTPUT_NAME ${ZDOOM_EXE_NAME} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${ZDOOM_OUTPUT_DIR} + RUNTIME_OUTPUT_NAME_DEBUG ${ZDOOM_EXE_NAME}d + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${ZDOOM_OUTPUT_DIR} + RUNTIME_OUTPUT_NAME_MINSIZEREL ${ZDOOM_EXE_NAME}msr + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${ZDOOM_OUTPUT_DIR} + RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${ZDOOM_EXE_NAME}rd + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${ZDOOM_OUTPUT_DIR} + ) endif( NOT ZDOOM_OUTPUT_OLDSTYLE OR NO_GENERATOR_EXPRESSIONS ) if( MSVC ) option( ZDOOM_GENERATE_MAPFILE "Generate .map file for debugging." OFF ) if( ZDOOM_GENERATE_MAPFILE ) - if( NOT MSVC80 ) - set_target_properties(zdoom PROPERTIES LINK_FLAGS "/MANIFEST:NO /DELAYLOAD:\"fmodex${X64}.dll\" /MAP:\"$(TargetDir)${ZDOOM_EXE_NAME}.map\"") - else( NOT MSVC80 ) # 2005 doesn't support naming the map file. - set_target_properties(zdoom PROPERTIES LINK_FLAGS "/MANIFEST:NO /DELAYLOAD:\"fmodex${X64}.dll\" /MAP") - endif( NOT MSVC80 ) + set_target_properties(zdoom PROPERTIES LINK_FLAGS "/MANIFEST:NO /DELAYLOAD:\"fmodex${X64}.dll\" /MAP") else( ZDOOM_GENERATE_MAPFILE ) set_target_properties(zdoom PROPERTIES LINK_FLAGS "/MANIFEST:NO /DELAYLOAD:\"fmodex${X64}.dll\"") endif( ZDOOM_GENERATE_MAPFILE ) @@ -1120,26 +1127,6 @@ if( MSVC ) create_default_target_launcher( zdoom WORKING_DIRECTORY ${ZDOOM_OUTPUT_DIR} ) endif( MSVC ) -if( ZDOOM_OUTPUT_OLDSTYLE AND NOT NO_GENERATOR_EXPRESSIONS ) - set_target_properties( zdoom PROPERTIES - RUNTIME_OUTPUT_NAME ${ZDOOM_EXE_NAME} - RUNTIME_OUTPUT_NAME_DEBUG ${ZDOOM_EXE_NAME}d - RUNTIME_OUTPUT_NAME_MINSIZEREL ${ZDOOM_EXE_NAME}msr - RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${ZDOOM_EXE_NAME}rd - ) - - if( ZDOOM_GENERATE_MAPFILE ) - add_custom_command(TARGET zdoom POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${ZDOOM_OUTPUT_DIR}/$ - COMMAND ${CMAKE_COMMAND} -E copy_if_different $/${ZDOOM_EXE_NAME}.map ${ZDOOM_OUTPUT_DIR}/$.map - COMMENT "Copying to output directory..." ) - else( ZDOOM_GENERATE_MAPFILE ) - add_custom_command(TARGET zdoom POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${ZDOOM_OUTPUT_DIR}/$ - COMMENT "Copying to output directory..." ) - endif( ZDOOM_GENERATE_MAPFILE ) -endif( ZDOOM_OUTPUT_OLDSTYLE AND NOT NO_GENERATOR_EXPRESSIONS ) - if( NOT WIN32 ) FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${ZDOOM_OUTPUT_DIR}/${ZDOOM_EXE_NAME} ]; then ln -sf ${CMAKE_CURRENT_BINARY_DIR}/${ZDOOM_EXE_NAME} ${ZDOOM_OUTPUT_DIR}/${ZDOOM_EXE_NAME}; fi" ) add_custom_command( TARGET zdoom POST_BUILD From 974619d5be66c39f44e4bcf90d48ce31e2123838 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 29 Nov 2013 17:13:34 -0500 Subject: [PATCH 4/4] - According to Graf, we should just let zipdir determine if the pk3 needs updating. --- CMakeLists.txt | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a257cceab..fca2e59b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,20 +13,6 @@ else(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) set( NO_GENERATOR_EXPRESSIONS ON ) endif(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) -# Function to get a recursive list of files, but also get the directory names -# as well unlike GLOB_RECURSE -function( glob_recurse_with_directories OUTVAR DIR ) - file( GLOB CHILDREN ${DIR}/* ) - foreach( CHILD ${CHILDREN} ) - if( IS_DIRECTORY ${CHILD} ) - set( TEMP_LIST "" ) - glob_recurse_with_directories( TEMP_LIST ${CHILD} ) - set( ${OUTVAR} ${${OUTVAR}} ${TEMP_LIST} ) - endif( IS_DIRECTORY ${CHILD} ) - endforeach( CHILD ${CHILDREN} ) - set( ${OUTVAR} ${${OUTVAR}} ${CHILDREN} PARENT_SCOPE ) -endfunction( glob_recurse_with_directories ) - # Simplify pk3 building, add_pk3(filename srcdirectory) function( add_pk3 PK3_NAME PK3_DIR ) get_target_property(ZIPDIR_EXE zipdir LOCATION) @@ -37,21 +23,21 @@ function( add_pk3 PK3_NAME PK3_DIR ) set( PK3_TARGET "pk3" ) endif( ${PK3_TARGET} STREQUAL "zdoom_pk3" ) - # Get as many files as we can to depend on. - glob_recurse_with_directories( PK3_DEPENDS ${PK3_DIR} ) - if( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} $/${PK3_NAME} - DEPENDS zipdir ${PK3_DIR} ${PK3_DEPENDS} ) + DEPENDS zipdir ) else( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} - DEPENDS zipdir ${PK3_DIR} ${PK3_DEPENDS} ) + DEPENDS zipdir ) endif( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE ) + # Touch the zipdir executable here so that the pk3s are forced to rebuild + # each time since their dependecy has "changed." add_custom_target( ${PK3_TARGET} ALL + COMMAND ${CMAKE_COMMAND} -E touch ${ZIPDIR_EXE} DEPENDS ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ) endfunction( add_pk3 )