From cbe0a34f0b54a3362f78fb105541e5eb74c33797 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Jul 2016 10:15:13 +0300 Subject: [PATCH 1/4] Fixed usages of abs() function with double arguments Clang no longer issues "warning: using integer absolute value function 'abs' when argument is of floating point type" --- src/p_map.cpp | 2 +- src/r_things.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 106c93152..110ae5235 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1566,7 +1566,7 @@ bool P_CheckPosition(AActor *thing, const DVector2 &pos, FCheckPosition &tm, boo tm.floorpic = *rover->top.texture; tm.floorterrain = rover->model->GetTerrain(rover->top.isceiling); } - if (ff_bottom < tm.ceilingz && abs(delta1) >= abs(delta2)) + if (ff_bottom < tm.ceilingz && fabs(delta1) >= fabs(delta2)) { tm.ceilingz = ff_bottom; tm.ceilingpic = *rover->bottom.texture; diff --git a/src/r_things.cpp b/src/r_things.cpp index 248e50c18..aad8fb501 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -916,7 +916,7 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor // too far off the side? // if it's a voxel, it can be further off the side if ((voxel == NULL && (fabs(tx / 64) > fabs(tz))) || - (voxel != NULL && (fabs(tx / 128) > abs(tz)))) + (voxel != NULL && (fabs(tx / 128) > fabs(tz)))) { return; } From bd3fd22ac9ccfb2c977a50f63b5d634dad677e3b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Jul 2016 16:21:48 +0300 Subject: [PATCH 2/4] Do not use unicode characters in macOS console window The same characters as in stdout are now used to draw bars in console window on macOS All messages are treated as in ISO Latin 1 encoding and bars looked like garbage output --- src/posix/cocoa/st_console.mm | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/posix/cocoa/st_console.mm b/src/posix/cocoa/st_console.mm index e38a5cc85..b037fe6dd 100644 --- a/src/posix/cocoa/st_console.mm +++ b/src/posix/cocoa/st_console.mm @@ -248,9 +248,6 @@ void FConsoleWindow::AddText(const char* message) AddText(color, buffer); } -#define CHECK_BUFFER_SPACE \ - if (pos >= sizeof buffer - 3) { reset = true; continue; } - if (TEXTCOLOR_ESCAPE == *message) { const BYTE* colorID = reinterpret_cast(message) + 1; @@ -268,42 +265,20 @@ void FConsoleWindow::AddText(const char* message) message += 2; } - else if (0x1d == *message) // Opening bar character + else if (0x1d == *message || 0x1f == *message) // Opening and closing bar characters { - CHECK_BUFFER_SPACE; - - // Insert BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT - buffer[pos++] = '\xe2'; - buffer[pos++] = '\x95'; - buffer[pos++] = '\xbc'; + buffer[pos++] = '-'; ++message; } else if (0x1e == *message) // Middle bar character { - CHECK_BUFFER_SPACE; - - // Insert BOX DRAWINGS HEAVY HORIZONTAL - buffer[pos++] = '\xe2'; - buffer[pos++] = '\x94'; - buffer[pos++] = '\x81'; - ++message; - } - else if (0x1f == *message) // Closing bar character - { - CHECK_BUFFER_SPACE; - - // Insert BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT - buffer[pos++] = '\xe2'; - buffer[pos++] = '\x95'; - buffer[pos++] = '\xbe'; + buffer[pos++] = '='; ++message; } else { buffer[pos++] = *message++; } - -#undef CHECK_BUFFER_SPACE } if (0 != pos) From c0d3eb997aca79f69ffe04950fcb258d09c19abe Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 30 Jul 2016 23:50:14 +0200 Subject: [PATCH 3/4] Fixed: the instant weapon switch flag didn't work anymore --- src/p_pspr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 48ead3699..9f1233609 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -237,8 +237,7 @@ DPSprite *player_t::GetPSprite(PSPLayers layer) pspr->y = WEAPONTOP; } - pspr->oldx = pspr->x; - pspr->oldy = pspr->y; + pspr->firstTic = true; } return pspr; From 8068792f4b54f7d906cebba3acda21d517b6c33b Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sun, 31 Jul 2016 00:03:17 +0200 Subject: [PATCH 4/4] Fixed: A_RadiusGive had an incorrect definition --- wadsrc/static/actors/actor.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 23ac3d19c..fa8932050 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -244,7 +244,7 @@ ACTOR Actor native //: Thinker native state A_JumpIfInTargetInventory(class itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT); native bool A_GiveToTarget(class itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT); native bool A_TakeFromTarget(class itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT); - native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", int mindist = 0, int limit = 0); + native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", float mindist = 0, int limit = 0); native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT); native void A_CountdownArg(int argnum, state targstate = ""); action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);