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
cb8978fb
Commit
cb8978fb
authored
9 years ago
by
est31
Browse files
Options
Downloads
Patches
Plain Diff
Settings: pass name to callbacks by reference
Spare some copies.
parent
4ece2b9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/clouds.cpp
+1
-1
1 addition, 1 deletion
src/clouds.cpp
src/fontengine.cpp
+2
-1
2 additions, 1 deletion
src/fontengine.cpp
src/game.cpp
+1
-1
1 addition, 1 deletion
src/game.cpp
src/settings.h
+1
-1
1 addition, 1 deletion
src/settings.h
with
5 additions
and
4 deletions
src/clouds.cpp
+
1
−
1
View file @
cb8978fb
...
@@ -30,7 +30,7 @@ class Clouds;
...
@@ -30,7 +30,7 @@ class Clouds;
Clouds
*
g_menuclouds
=
NULL
;
Clouds
*
g_menuclouds
=
NULL
;
irr
::
scene
::
ISceneManager
*
g_menucloudsmgr
=
NULL
;
irr
::
scene
::
ISceneManager
*
g_menucloudsmgr
=
NULL
;
static
void
cloud_3d_setting_changed
(
const
std
::
string
settingname
,
void
*
data
)
static
void
cloud_3d_setting_changed
(
const
std
::
string
&
settingname
,
void
*
data
)
{
{
((
Clouds
*
)
data
)
->
readSettings
();
((
Clouds
*
)
data
)
->
readSettings
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/fontengine.cpp
+
2
−
1
View file @
cb8978fb
...
@@ -35,7 +35,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -35,7 +35,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
FontEngine
*
g_fontengine
=
NULL
;
FontEngine
*
g_fontengine
=
NULL
;
/** callback to be used on change of font size setting */
/** callback to be used on change of font size setting */
static
void
font_setting_changed
(
const
std
::
string
,
void
*
userdata
)
{
static
void
font_setting_changed
(
const
std
::
string
&
name
,
void
*
userdata
)
{
g_fontengine
->
readSettings
();
g_fontengine
->
readSettings
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/game.cpp
+
1
−
1
View file @
cb8978fb
...
@@ -806,7 +806,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
...
@@ -806,7 +806,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
m_fogEnabled
=
g_settings
->
getBool
(
"enable_fog"
);
m_fogEnabled
=
g_settings
->
getBool
(
"enable_fog"
);
}
}
static
void
SettingsCallback
(
const
std
::
string
name
,
void
*
userdata
)
static
void
SettingsCallback
(
const
std
::
string
&
name
,
void
*
userdata
)
{
{
reinterpret_cast
<
GameGlobalShaderConstantSetter
*>
(
userdata
)
->
onSettingsChange
(
name
);
reinterpret_cast
<
GameGlobalShaderConstantSetter
*>
(
userdata
)
->
onSettingsChange
(
name
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/settings.h
+
1
−
1
View file @
cb8978fb
...
@@ -36,7 +36,7 @@ extern Settings *g_settings;
...
@@ -36,7 +36,7 @@ extern Settings *g_settings;
extern
std
::
string
g_settings_path
;
extern
std
::
string
g_settings_path
;
/** function type to register a changed callback */
/** function type to register a changed callback */
typedef
void
(
*
setting_changed_callback
)(
const
std
::
string
,
void
*
);
typedef
void
(
*
setting_changed_callback
)(
const
std
::
string
&
name
,
void
*
data
);
enum
ValueType
{
enum
ValueType
{
VALUETYPE_STRING
,
VALUETYPE_STRING
,
...
...
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