[MIRROR] View Variables Update (2) (#11149)

Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-07-05 19:08:25 -07:00
committed by GitHub
parent d4c88eacdd
commit 76310c6448
137 changed files with 6803 additions and 2316 deletions

View File

@@ -13,10 +13,6 @@ list(-1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,1, 1,1,1,0)
list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0,0,0)
*/
/// Does nothing.
/proc/color_matrix_identity()
return list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, 0,0,0,0)
/**
* Adds/subtracts overall lightness.
* 0 is identity, 1 makes everything white, -1 makes everything black.
@@ -41,7 +37,7 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
*/
/proc/color_matrix_saturation_percent(percent)
if(percent == 0)
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
percent = clamp(percent, -100, 100)
if(percent > 0)
percent *= 3
@@ -85,7 +81,7 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
10.0)
percent = clamp(percent, -100, 100)
if(percent == 0)
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
var/x = 0
if (percent < 0)
@@ -127,7 +123,7 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
*/
/proc/color_matrix_rotation(angle)
if(angle == 0)
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
angle = clamp(angle, -180, 180)
var/cos = cos(angle)
var/sin = sin(angle)
@@ -185,9 +181,9 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
*/
/proc/color_matrix_add(list/A, list/B)
if(!istype(A) || !istype(B))
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
if(A.len != 20 || B.len != 20)
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
var/list/output = list()
output.len = 20
for(var/value in 1 to 20)
@@ -199,9 +195,9 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
*/
/proc/color_matrix_multiply(list/A, list/B)
if(!istype(A) || !istype(B))
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
if(A.len != 20 || B.len != 20)
return color_matrix_identity()
return COLOR_MATRIX_IDENTITY
var/list/output = list()
output.len = 20
var/x = 1