shithub: wipeout

Download patch

ref: ba2222775a406a10a60b1c055378968a3eb5a8f7
parent: 13d1463112e7088e4d289d536d913c48b3962ab9
author: Dominic Szablewski <dominic@phoboslab.org>
date: Tue Aug 15 13:48:43 EDT 2023

Whitespace

--- a/src/input.h
+++ b/src/input.h
@@ -102,7 +102,7 @@
 	INPUT_KEY_KP_0 = 98,
 	INPUT_KEY_KP_PERIOD = 99,
 
- 	INPUT_KEY_LCTRL = 100,
+	INPUT_KEY_LCTRL = 100,
 	INPUT_KEY_LSHIFT = 101,
 	INPUT_KEY_LALT = 102,
 	INPUT_KEY_LGUI = 103,
--- a/src/platform_sdl.c
+++ b/src/platform_sdl.c
@@ -34,12 +34,12 @@
 
 uint8_t platform_sdl_axis_map[] = {
 	[SDL_CONTROLLER_AXIS_LEFTX] = INPUT_GAMEPAD_L_STICK_LEFT,
-    [SDL_CONTROLLER_AXIS_LEFTY] = INPUT_GAMEPAD_L_STICK_UP,
-    [SDL_CONTROLLER_AXIS_RIGHTX] = INPUT_GAMEPAD_R_STICK_LEFT,
-    [SDL_CONTROLLER_AXIS_RIGHTY] = INPUT_GAMEPAD_R_STICK_UP,
-    [SDL_CONTROLLER_AXIS_TRIGGERLEFT] = INPUT_GAMEPAD_L_TRIGGER,
-    [SDL_CONTROLLER_AXIS_TRIGGERRIGHT] = INPUT_GAMEPAD_R_TRIGGER,
-    [SDL_CONTROLLER_AXIS_MAX] = INPUT_INVALID
+	[SDL_CONTROLLER_AXIS_LEFTY] = INPUT_GAMEPAD_L_STICK_UP,
+	[SDL_CONTROLLER_AXIS_RIGHTX] = INPUT_GAMEPAD_R_STICK_LEFT,
+	[SDL_CONTROLLER_AXIS_RIGHTY] = INPUT_GAMEPAD_R_STICK_UP,
+	[SDL_CONTROLLER_AXIS_TRIGGERLEFT] = INPUT_GAMEPAD_L_TRIGGER,
+	[SDL_CONTROLLER_AXIS_TRIGGERRIGHT] = INPUT_GAMEPAD_R_TRIGGER,
+	[SDL_CONTROLLER_AXIS_MAX] = INPUT_INVALID
 };
 
 
@@ -219,11 +219,11 @@
 	SDL_GLContext platform_gl;
 
 	void platform_video_init() {
-                #if defined(USE_GLES2)
-                SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-                SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
-                SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
-                #endif
+		#if defined(USE_GLES2)
+			SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
+			SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
+			SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+		#endif
 
 		platform_gl = SDL_GL_CreateContext(window);
 		SDL_GL_SetSwapInterval(1);
--- a/src/types.c
+++ b/src/types.c
@@ -53,11 +53,11 @@
 
 void mat4_set_yaw_pitch_roll(mat4_t *mat, vec3_t rot) {
 	float sx = sin( rot.x);
-    float sy = sin(-rot.y);
-    float sz = sin(-rot.z);
-    float cx = cos( rot.x);
-    float cy = cos(-rot.y);
-    float cz = cos(-rot.z);
+	float sy = sin(-rot.y);
+	float sz = sin(-rot.z);
+	float cx = cos( rot.x);
+	float cy = cos(-rot.y);
+	float cz = cos(-rot.z);
 
 	mat->cols[0][0] = cy * cz + sx * sy * sz;
 	mat->cols[1][0] = cz * sx * sy - cy * sz;
@@ -72,11 +72,11 @@
 
 void mat4_set_roll_pitch_yaw(mat4_t *mat, vec3_t rot) {
 	float sx = sin( rot.x);
-    float sy = sin(-rot.y);
-    float sz = sin(-rot.z);
-    float cx = cos( rot.x);
-    float cy = cos(-rot.y);
-    float cz = cos(-rot.z);
+	float sy = sin(-rot.y);
+	float sz = sin(-rot.z);
+	float cx = cos( rot.x);
+	float cy = cos(-rot.y);
+	float cz = cos(-rot.z);
 
 	mat->cols[0][0] = cy * cz - sx * sy * sz;
 	mat->cols[1][0] = -cx * sz;
--- a/src/utils.c
+++ b/src/utils.c
@@ -14,8 +14,8 @@
 
 
 bool file_exists(char *path) {
-  struct stat s;   
-  return (stat(path, &s) == 0);
+	struct stat s;
+	return (stat(path, &s) == 0);
 }
 
 uint8_t *file_load(char *path, uint32_t *bytes_read) {
@@ -50,7 +50,7 @@
 	if (fwrite(bytes, 1, len, f) != len) {
 		die("Could not write file file %s", path);
 	}
-   
+	
 	fclose(f);
 	return len;
 }
--- a/src/wasm-index.html
+++ b/src/wasm-index.html
@@ -151,13 +151,13 @@
 				ev.preventDefault();
 
 				// Hide select-version, show loader
-  				document.getElementById('select-version').style.display = 'none';
-  				document.getElementById('loading').style.display = 'block';
+				document.getElementById('select-version').style.display = 'none';
+				document.getElementById('loading').style.display = 'block';
 
-  				// Load the requested script
-  				var s = document.createElement('script');
-  				s.setAttribute('src', src);
-  				document.head.appendChild(s);
+				// Load the requested script
+				var s = document.createElement('script');
+				s.setAttribute('src', src);
+				document.head.appendChild(s);
 
 				// Attemp to unlock Audio :(
 				var audioCtx = new AudioContext();
--- a/src/wipeout/image.c
+++ b/src/wipeout/image.c
@@ -51,8 +51,8 @@
 	uint16_t *palette = NULL;
 
 	if (
-	    type == TIM_TYPE_PALETTED_4_BPP ||
-	    type == TIM_TYPE_PALETTED_8_BPP
+		type == TIM_TYPE_PALETTED_4_BPP ||
+		type == TIM_TYPE_PALETTED_8_BPP
 	) {
 		uint32_t header_length = get_i32_le(bytes, &p);
 		uint16_t palette_x = get_i16_le(bytes, &p);