Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
3253b6bd
Commit
3253b6bd
authored
8 years ago
by
lhofhansl
Committed by
Loïc Blot
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Don't use day light sky unless noclip and free_move are enabled
parent
2ff054d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/game.cpp
+18
-5
18 additions, 5 deletions
src/game.cpp
with
18 additions
and
5 deletions
src/game.cpp
+
18
−
5
View file @
3253b6bd
...
...
@@ -1741,6 +1741,8 @@ class Game {
bool
m_cache_enable_joysticks
;
bool
m_cache_enable_particles
;
bool
m_cache_enable_fog
;
bool
m_cache_enable_noclip
;
bool
m_cache_enable_free_move
;
f32
m_cache_mouse_sensitivity
;
f32
m_cache_joystick_frustum_sensitivity
;
f32
m_repeat_right_click_time
;
...
...
@@ -1790,6 +1792,10 @@ Game::Game() :
&
settingChangedCallback
,
this
);
g_settings
->
registerChangedCallback
(
"repeat_rightclick_time"
,
&
settingChangedCallback
,
this
);
g_settings
->
registerChangedCallback
(
"noclip"
,
&
settingChangedCallback
,
this
);
g_settings
->
registerChangedCallback
(
"free_move"
,
&
settingChangedCallback
,
this
);
readSettings
();
...
...
@@ -2959,12 +2965,14 @@ void Game::toggleFreeMove(float *statustext_time)
static
const
wchar_t
*
msg
[]
=
{
L"free_move disabled"
,
L"free_move enabled"
};
bool
free_move
=
!
g_settings
->
getBool
(
"free_move"
);
g_settings
->
set
(
"free_move"
,
bool_to_cstr
(
free_move
));
*
statustext_time
=
0
;
statustext
=
msg
[
free_move
];
if
(
free_move
&&
!
client
->
checkPrivilege
(
"fly"
))
if
(
free_move
&&
!
client
->
checkPrivilege
(
"fly"
))
{
statustext
+=
L" (note: no 'fly' privilege)"
;
}
else
{
g_settings
->
set
(
"free_move"
,
bool_to_cstr
(
free_move
));
}
}
...
...
@@ -2999,13 +3007,15 @@ void Game::toggleNoClip(float *statustext_time)
{
static
const
wchar_t
*
msg
[]
=
{
L"noclip disabled"
,
L"noclip enabled"
};
bool
noclip
=
!
g_settings
->
getBool
(
"noclip"
);
g_settings
->
set
(
"noclip"
,
bool_to_cstr
(
noclip
));
*
statustext_time
=
0
;
statustext
=
msg
[
noclip
];
if
(
noclip
&&
!
client
->
checkPrivilege
(
"noclip"
))
if
(
noclip
&&
!
client
->
checkPrivilege
(
"noclip"
))
{
statustext
+=
L" (note: no 'noclip' privilege)"
;
}
else
{
g_settings
->
set
(
"noclip"
,
bool_to_cstr
(
noclip
));
}
}
void
Game
::
toggleCinematic
(
float
*
statustext_time
)
...
...
@@ -4097,7 +4107,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats,
float
direct_brightness
;
bool
sunlight_seen
;
if
(
g_settings
->
getBool
(
"
free_move
"
)
)
{
if
(
m_cache_enable_noclip
&&
m_cache_enable_
free_move
)
{
direct_brightness
=
time_brightness
;
sunlight_seen
=
true
;
}
else
{
...
...
@@ -4534,6 +4544,9 @@ void Game::readSettings()
m_cache_joystick_frustum_sensitivity
=
g_settings
->
getFloat
(
"joystick_frustum_sensitivity"
);
m_repeat_right_click_time
=
g_settings
->
getFloat
(
"repeat_rightclick_time"
);
m_cache_enable_noclip
=
g_settings
->
getBool
(
"noclip"
);
m_cache_enable_free_move
=
g_settings
->
getBool
(
"free_move"
);
m_cache_mouse_sensitivity
=
rangelim
(
m_cache_mouse_sensitivity
,
0.001
,
100.0
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment