mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-21 02:38:14 +00:00
Use C++ style comments consistently in SDL source code
Implemented using this script: find . -type f -exec sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' {} \; git checkout \ core/linux/SDL_evdev_kbd_default_keymap.h \ events/imKStoUCS.* \ hidapi \ joystick/controller_type.c \ joystick/controller_type.h \ joystick/hidapi/steam/controller_constants.h \ joystick/hidapi/steam/controller_structs.h \ joystick/SDL_gamepad_db.h \ libm \ render/*/*Shader*.h \ render/vitagxm/SDL_render_vita_gxm_shaders.h \ render/metal/SDL_shaders_metal_*.h \ stdlib/SDL_malloc.c \ stdlib/SDL_qsort.c \ stdlib/SDL_strtokr.c \ test/ \ video/directx/SDL_d3d12_xbox_cmacros.h \ video/directx/d3d12.h \ video/directx/d3d12sdklayers.h \ video/khronos \ video/x11/edid-parse.c \ video/x11/xsettings-client.* \ video/yuv2rgb sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' hidapi/SDL_hidapi.c
This commit is contained in:
@@ -33,12 +33,12 @@ int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo
|
||||
const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XBGR8888;
|
||||
int w, h;
|
||||
|
||||
/* Free the old framebuffer surface */
|
||||
// Free the old framebuffer surface
|
||||
SDL_WindowData *data = window->internal;
|
||||
surface = data->surface;
|
||||
SDL_DestroySurface(surface);
|
||||
|
||||
/* Create a new one */
|
||||
// Create a new one
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
|
||||
surface = SDL_CreateSurface(w, h, surface_format);
|
||||
@@ -46,7 +46,7 @@ int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Save the info and return! */
|
||||
// Save the info and return!
|
||||
data->surface = surface;
|
||||
*format = surface_format;
|
||||
*pixels = surface->pixels;
|
||||
@@ -64,9 +64,9 @@ int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo
|
||||
return SDL_SetError("Couldn't find framebuffer surface for window");
|
||||
}
|
||||
|
||||
/* Send the data to the display */
|
||||
// Send the data to the display
|
||||
|
||||
/* *INDENT-OFF* */ /* clang-format off */
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
MAIN_THREAD_EM_ASM({
|
||||
var w = $0;
|
||||
var h = $1;
|
||||
@@ -140,10 +140,10 @@ int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo
|
||||
|
||||
SDL3.ctx.putImageData(SDL3.image, 0, 0);
|
||||
}, surface->w, surface->h, surface->pixels, data->canvas_id);
|
||||
/* *INDENT-ON* */ /* clang-format on */
|
||||
/* *INDENT-ON* */ // clang-format on
|
||||
|
||||
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
|
||||
/* give back control to browser for screen refresh */
|
||||
// give back control to browser for screen refresh
|
||||
emscripten_sleep(0);
|
||||
}
|
||||
|
||||
@@ -158,4 +158,4 @@ void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *win
|
||||
data->surface = NULL;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */
|
||||
#endif // SDL_VIDEO_DRIVER_EMSCRIPTEN
|
||||
|
Reference in New Issue
Block a user