fix flyspeed
and a compiler optimisation error (for clang >= 4, O3 may be reactivated in the makefile)
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ ifeq ($(ACDEBUG),yes)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring clang,$(CXX)))
|
||||
CXXFLAGS= -O3 -fomit-frame-pointer
|
||||
CXXFLAGS= -O2 -fomit-frame-pointer
|
||||
override CXXFLAGS+= -Wall -fsigned-char
|
||||
else
|
||||
CXXFLAGS= -O3 -fomit-frame-pointer
|
||||
|
||||
@@ -457,7 +457,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
|
||||
|
||||
float chspeed = (pl->onfloor || pl->onladder || !pl->crouchedinair) ? 0.4f : 1.0f;
|
||||
|
||||
const bool crouching = pl->crouching || pl->eyeheight < pl->maxeyeheight;
|
||||
const bool crouching = pl->crouching || (pl->eyeheight < pl->maxeyeheight && pl->eyeheight > 1.1f);
|
||||
const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(crouching && pl->state != CS_EDITING ? chspeed : 1.0f)*(pl==player1 && isfly ? flyspeed : 1.0f);
|
||||
const float friction = water ? 20.0f : (pl->onfloor || isfly ? 6.0f : (pl->onladder ? 1.5f : 30.0f));
|
||||
const float fpsfric = max(friction/curtime*20.0f, 1.0f);
|
||||
|
||||
@@ -180,7 +180,9 @@ struct vertmodel : model
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__clang__) && !defined(__ICL) && __GNUC__ >= 4 && __GNUC_MINOR__ > 4
|
||||
__attribute__((optimize(2)))
|
||||
__attribute__((optimize(2)))
|
||||
#elif defined(__clang__) && __clang_major__ >= 4
|
||||
__attribute__((optnone))
|
||||
#endif
|
||||
dyncacheentry *gendynverts(animstate &as, anpos &cur, anpos *prev, float ai_t)
|
||||
{
|
||||
@@ -294,7 +296,9 @@ __attribute__((optimize(2)))
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__clang__) && !defined(__ICL) && __GNUC__ >= 4 && __GNUC_MINOR__ > 4
|
||||
__attribute__((optimize(2)))
|
||||
__attribute__((optimize(2)))
|
||||
#elif defined(__clang__) && __clang_major__ >= 4
|
||||
__attribute__((optnone))
|
||||
#endif
|
||||
shadowcacheentry *genshadowvolume(animstate &as, anpos &cur, anpos *prev, float ai_t, vec *buf)
|
||||
{
|
||||
@@ -357,7 +361,9 @@ __attribute__((optimize(2)))
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__clang__) && !defined(__ICL) && __GNUC__ >= 4 && __GNUC_MINOR__ > 4
|
||||
__attribute__((optimize(2)))
|
||||
__attribute__((optimize(2)))
|
||||
#elif defined(__clang__) && __clang_major__ >= 4
|
||||
__attribute__((optnone))
|
||||
#endif
|
||||
lightcacheentry *lightvertexes(animstate &as, anpos &cur, anpos *prev, float ai_t, vec *buf)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user