Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
retro8
Commits
68bd5c32
Commit
68bd5c32
authored
Jan 08, 2020
by
Jack
Browse files
bumped version
parent
14355a48
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/io/stegano.cpp
View file @
68bd5c32
...
...
@@ -68,7 +68,7 @@ void Stegano::load(const PngData& data, Machine& m)
/* skip 2 null*/
o
+=
2
;
compressedLength
=
std
::
min
(
32769ULL
-
RAW_DATA_LENGTH
,
compressedLength
);
compressedLength
=
std
::
min
(
size_t
(
32769ULL
-
RAW_DATA_LENGTH
)
,
compressedLength
);
const
std
::
string
lookup
=
"
\n
0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
;
std
::
string
code
;
...
...
@@ -95,7 +95,7 @@ void Stegano::load(const PngData& data, Machine& m)
else
{
uint8_t
vn
=
assembleByte
(
d
[
o
+
i
+
1
]);
auto
offset
=
((
v
-
0x3c
)
<<
4
)
+
(
vn
&
0xf
);
auto
length
=
(
vn
>>
4
)
+
2
;
...
...
@@ -124,7 +124,7 @@ void Stegano::load(const std::string& path, Machine& m)
#if DEBUGGER
fileName
=
path
.
substr
(
0
,
path
.
length
()
-
4
)
+
".p8"
;
#endif
SDL_Surface
*
surface
=
IMG_Load
(
path
.
c_str
());
if
(
!
surface
)
...
...
@@ -138,4 +138,4 @@ void Stegano::load(const std::string& path, Machine& m)
assert
(
surface
->
format
->
BytesPerPixel
==
4
);
load
(
pngData
,
m
);
SDL_FreeSurface
(
surface
);
}
\ No newline at end of file
}
src/views/menu_view.cpp
View file @
68bd5c32
...
...
@@ -34,18 +34,18 @@ std::vector<MenuEntry>::const_iterator selected;
enum
{
RESUME
=
0
,
HELP
,
OPTIONS
,
RESET
,
EXIT
,
SHOW_FPS
=
0
,
SCALER
,
SOUND
,
MUSIC
,
BACK
};
MenuView
::
MenuView
(
ViewManager
*
gvm
)
:
_gvm
(
gvm
)
{
{
static_assert
(
SCALER
==
1
,
"must be 1"
);
mainMenu
[
RESUME
].
lambda
=
[
this
]()
{
_gvm
->
backToGame
();
};
mainMenu
[
OPTIONS
].
lambda
=
[
this
]()
{
menu
=
&
optionsMenu
;
selected
=
menu
->
begin
();
};
mainMenu
[
EXIT
].
lambda
=
[
this
]()
{
_gvm
->
exit
();
};
...
...
@@ -63,7 +63,7 @@ MenuView::MenuView(ViewManager* gvm) : _gvm(gvm)
_gvm
->
gameView
()
->
setScaler
(
Scaler
::
FIRST
);
updateLabels
();
};
optionsMenu
[
SOUND
].
lambda
=
[
this
]()
{
bool
v
=
!
machine
.
sound
().
isSoundEnabled
();
machine
.
sound
().
toggleSound
(
v
);
...
...
@@ -152,7 +152,7 @@ void MenuView::render()
constexpr
int32_t
H
=
240
;
auto
renderer
=
_gvm
->
renderer
();
SDL_SetRenderDrawColor
(
renderer
,
0
,
0
,
0
,
255
);
SDL_RenderClear
(
renderer
);
...
...
@@ -162,18 +162,18 @@ void MenuView::render()
_gvm
->
text
(
"retro8"
,
W
/
2
+
2
,
20
+
2
,
{
0
,
22
,
120
},
TextAlign
::
CENTER
,
4.0
f
);
_gvm
->
text
(
"retro8"
,
W
/
2
,
20
,
{
0
,
47
,
255
},
TextAlign
::
CENTER
,
4.0
f
);
_gvm
->
text
(
"v0.1"
,
W
/
2
+
_gvm
->
textWidth
(
"retro8"
,
4.0
)
/
2
+
3
,
34
,
{
0
,
47
,
255
},
TextAlign
::
LEFT
,
2.0
f
);
_gvm
->
text
(
"v0.1
b
"
,
W
/
2
+
_gvm
->
textWidth
(
"retro8"
,
4.0
)
/
2
+
3
,
34
,
{
0
,
47
,
255
},
TextAlign
::
LEFT
,
2.0
f
);
retro8
::
point_t
menuBase
=
{
W
/
2
,
90
};
for
(
auto
it
=
menu
->
begin
();
it
!=
menu
->
end
();
++
it
)
{
SDL_Color
color
=
it
==
selected
?
SDL_Color
{
255
,
255
,
0
}
:
SDL_Color
{
255
,
255
,
255
};
if
(
it
!=
selected
&&
!
it
->
lambda
)
color
=
{
160
,
160
,
160
};
_gvm
->
text
(
it
->
caption
,
menuBase
.
x
,
menuBase
.
y
,
color
,
TextAlign
::
CENTER
,
2.0
f
);
menuBase
.
y
+=
16
;
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment