Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
49756aa7
Commit
49756aa7
authored
May 14, 2021
by
Deucе
👌🏾
Browse files
Use lround(), not roundl().
Also, include math.h
parent
eb5fed99
Pipeline
#2190
passed with stage
in 7 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/conio/sdl_con.c
src/conio/sdl_con.c
+5
-4
No files found.
src/conio/sdl_con.c
View file @
49756aa7
#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
/* NULL */
...
...
@@ -567,8 +568,8 @@ static void setup_surfaces_locked(void)
cols
=
cvstat
.
cols
;
rows
=
cvstat
.
rows
;
vmultiplier
=
cvstat
.
vmultiplier
;
idealh
=
round
l
((
long
double
)
cvstat
.
winwidth
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
idealmh
=
round
l
((
long
double
)
cvstat
.
scrnwidth
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
idealh
=
l
round
((
long
double
)
cvstat
.
winwidth
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
idealmh
=
l
round
((
long
double
)
cvstat
.
scrnwidth
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
internal_scaling
=
true
;
sdl
.
SetHint
(
SDL_HINT_RENDER_SCALE_QUALITY
,
"0"
);
...
...
@@ -1100,8 +1101,8 @@ void sdl_video_event_thread(void *data)
dst
.
w
=
cvstat
.
winwidth
;
dst
.
h
=
cvstat
.
winheight
;
// Get correct aspect ratio for dst...
idealw
=
round
l
((
long
double
)
dst
.
h
*
cvstat
.
scale_numerator
/
cvstat
.
scale_denominator
*
cvstat
.
scrnwidth
/
cvstat
.
scrnheight
);
idealh
=
round
l
((
long
double
)
dst
.
w
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
idealw
=
l
round
((
long
double
)
dst
.
h
*
cvstat
.
scale_numerator
/
cvstat
.
scale_denominator
*
cvstat
.
scrnwidth
/
cvstat
.
scrnheight
);
idealh
=
l
round
((
long
double
)
dst
.
w
*
cvstat
.
scale_denominator
/
cvstat
.
scale_numerator
*
cvstat
.
scrnheight
/
cvstat
.
scrnwidth
);
if
(
idealw
<
cvstat
.
winwidth
)
{
dst
.
x
=
(
cvstat
.
winwidth
-
idealw
)
/
2
;
dst
.
w
=
idealw
;
...
...
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