File diff r24938:c6d347f5a77a → r24939:f00f6879a003
src/video/sdl2_v.cpp
Show inline comments
 
@@ -367,17 +367,17 @@ static uint ConvertSdlKeycodeIntoMy(SDL_
 
	SDL_Scancode sc = SDL_GetScancodeFromKey(kc);
 
	if (sc == SDL_SCANCODE_GRAVE) key = WKC_BACKQUOTE;
 

	
 
	return key;
 
}
 

	
 
int VideoDriver_SDL_Base::PollEvent()
 
bool VideoDriver_SDL_Base::PollEvent()
 
{
 
	SDL_Event ev;
 

	
 
	if (!SDL_PollEvent(&ev)) return -2;
 
	if (!SDL_PollEvent(&ev)) return false;
 

	
 
	switch (ev.type) {
 
		case SDL_MOUSEMOTION:
 
#ifdef __EMSCRIPTEN__
 
			if (_cursor_new_in_window) {
 
				/* The cursor just moved into the window; this means we don't
 
@@ -513,13 +513,14 @@ int VideoDriver_SDL_Base::PollEvent()
 
				UndrawMouseCursor();
 
				_cursor.in_window = false;
 
			}
 
			break;
 
		}
 
	}
 
	return -1;
 

	
 
	return true;
 
}
 

	
 
static const char *InitializeSDL()
 
{
 
	/* Explicitly disable hardware acceleration. Enabling this causes
 
	 * UpdateWindowSurface() to update the window's texture instead of
 
@@ -626,13 +627,12 @@ void VideoDriver_SDL_Base::InputLoop()
 
}
 

	
 
void VideoDriver_SDL_Base::LoopOnce()
 
{
 
	InteractiveRandom(); // randomness
 

	
 
	while (PollEvent() == -1) {}
 
	if (_exit_game) {
 
#ifdef __EMSCRIPTEN__
 
		/* Emscripten is event-driven, and as such the main loop is inside
 
		 * the browser. So if _exit_game goes true, the main loop ends (the
 
		 * cancel call), but we still have to call the cleanup that is
 
		 * normally done at the end of the main loop for non-Emscripten.