Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
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
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
6d073e18
Commit
6d073e18
authored
3 months ago
by
Alam Ed Arias
Browse files
Options
Downloads
Patches
Plain Diff
Emscripten: get timing info and use 640x400 video mode
parent
f6945297
Branches
Branches containing commit
No related tags found
1 merge request
!2658
WASM port
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdl/i_video.c
+34
-0
34 additions, 0 deletions
src/sdl/i_video.c
with
34 additions
and
0 deletions
src/sdl/i_video.c
+
34
−
0
View file @
6d073e18
...
...
@@ -479,6 +479,35 @@ static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText)
CONS_Printf
(
"%s"
,
M_GetText
(
" Colorkey RLE acceleration blit
\n
"
));
}
static
void
TimingInfo
(
void
)
{
#ifdef __EMSCRIPTEN__
int
mode
=
-
1
,
value
=
-
1
;
emscripten_get_main_loop_timing
(
&
mode
,
&
value
);
CONS_Printf
(
"
\x82
"
"Currect Timing Mode
\n
"
);
if
(
mode
==
-
1
)
{
CONS_Printf
(
" Unknown
\n
"
);
}
else
if
(
mode
==
EM_TIMING_SETTIMEOUT
)
{
CONS_Printf
(
" everty %d ms
\n
"
,
value
);
}
else
if
(
mode
==
EM_TIMING_RAF
)
{
CONS_Printf
(
" every %d vsync
\n
"
,
value
);
}
else
if
(
mode
==
EM_TIMING_SETIMMEDIATE
)
{
CONS_Printf
(
" Unknown value %d
\n
"
,
value
);
}
else
{
CONS_Printf
(
" Unknown mode %d
\n
"
,
mode
);
}
#endif
}
static
void
VID_Command_Info_f
(
void
)
{
#if 0
...
...
@@ -526,6 +555,7 @@ static void VID_Command_Info_f (void)
SurfaceInfo
(
bufSurface
,
M_GetText
(
"Current Engine Mode"
));
SurfaceInfo
(
vidSurface
,
M_GetText
(
"Current Video Mode"
));
#endif
TimingInfo
();
}
static
void
VID_Command_ModeList_f
(
void
)
...
...
@@ -1836,7 +1866,11 @@ void I_StartupGraphics(void)
I_ShutdownTTF
();
#endif
#ifdef __EMSCRIPTEN__
VID_SetMode
(
VID_GetModeForSize
(
BASEVIDWIDTH
*
2
,
BASEVIDHEIGHT
*
2
));
#else
VID_SetMode
(
VID_GetModeForSize
(
BASEVIDWIDTH
,
BASEVIDHEIGHT
));
#endif
if
(
M_CheckParm
(
"-nomousegrab"
))
mousegrabok
=
SDL_FALSE
;
...
...
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