Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Onuralp SEZER
Game Library
Commits
0d2d261a
Commit
0d2d261a
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
code cleanup
parent
287cc28e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fggl/scenes/menu.cpp
+8
-9
8 additions, 9 deletions
fggl/scenes/menu.cpp
include/fggl/data/assimp/module.hpp
+1
-1
1 addition, 1 deletion
include/fggl/data/assimp/module.hpp
include/fggl/scenes/menu.hpp
+3
-3
3 additions, 3 deletions
include/fggl/scenes/menu.hpp
with
12 additions
and
13 deletions
fggl/scenes/menu.cpp
+
8
−
9
View file @
0d2d261a
...
...
@@ -61,24 +61,23 @@ namespace fggl::scenes {
}
void
BasicMenu
::
add
(
const
std
::
string
&
name
,
callback
c
b
)
{
m_items
[
name
]
=
c
b
;
void
BasicMenu
::
add
(
const
std
::
string
&
name
,
c
onst
C
allback
&
c
allback
)
{
m_items
[
name
]
=
c
allback
;
const
math
::
vec2
btnSize
{
150.0
f
,
30.0
f
};
const
math
::
vec2
btnSize
{
150.0
F
,
30.0
F
};
const
float
spacing
=
5
;
const
float
padX
=
50.0
f
;
const
float
padY
=
50.0
f
;
const
float
padX
=
50.0
F
;
const
float
padY
=
50.0
F
;
// figure out the position based off the old logic
// FIXME should be the container's job
math
::
vec2
pos
{
1920.0
f
-
(
padX
+
btnSize
.
x
),
padY
};
auto
btnIdx
=
m_items
.
size
()
-
1
;
pos
.
y
+=
(
btnIdx
*
(
btnSize
.
y
+
spacing
));
math
::
vec2
pos
{
1920.0
F
-
(
padX
+
btnSize
.
x
),
padY
};
pos
.
y
+=
(
(
m_items
.
size
()
-
1.0
F
)
*
(
btnSize
.
y
+
spacing
));
// build the button
auto
btn
=
std
::
make_unique
<
gui
::
Button
>
(
pos
,
btnSize
);
btn
->
label
(
name
);
btn
->
addCallback
(
c
b
);
btn
->
addCallback
(
c
allback
);
m_canvas
.
add
(
std
::
move
(
btn
));
}
...
...
This diff is collapsed.
Click to expand it.
include/fggl/data/assimp/module.hpp
+
1
−
1
View file @
0d2d261a
...
...
@@ -43,7 +43,7 @@ namespace fggl::data::models {
// new style loaders (textures)
bool
load_tex_stb
(
const
std
::
filesystem
::
path
&
filePath
,
assets
::
MemoryBlock
&
block
);
static
assets
::
AssetTypeID
is_tex_stb
(
const
std
::
filesystem
::
path
&
filePath
);
assets
::
AssetTypeID
is_tex_stb
(
const
std
::
filesystem
::
path
&
filePath
);
// new style loaders (models)
assets
::
AssetTypeID
is_model_assimp
(
const
std
::
filesystem
::
path
&
filePath
);
...
...
This diff is collapsed.
Click to expand it.
include/fggl/scenes/menu.hpp
+
3
−
3
View file @
0d2d261a
...
...
@@ -26,7 +26,7 @@
namespace
fggl
::
scenes
{
using
c
allback
=
std
::
function
<
void
(
void
)
>
;
using
C
allback
=
std
::
function
<
void
(
void
)
>
;
class
BasicMenu
:
public
AppState
{
public:
...
...
@@ -38,11 +38,11 @@ namespace fggl::scenes {
void
activate
()
override
;
void
deactivate
()
override
;
void
add
(
const
std
::
string
&
label
,
callback
cb
);
void
add
(
const
std
::
string
&
label
,
c
onst
C
allback
&
/*cb*/
);
private:
input
::
Input
*
m_inputs
;
std
::
map
<
const
std
::
string
,
c
allback
>
m_items
;
std
::
map
<
const
std
::
string
,
C
allback
>
m_items
;
// menu state
std
::
string
m_active
;
...
...
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