|
|
@@ -81,6 +81,41 @@ BEGIN: Diffuse3x3
|
|
|
PACK_RGBA: colorImage, redImage, greenImage, blueImage, visibilityMap
|
|
|
END:
|
|
|
|
|
|
+BEGIN: FocusableDiffuse3x3
|
|
|
+ INPUT: FixedPoint, width
|
|
|
+ INPUT: FixedPoint, height
|
|
|
+ INPUT: FixedPoint, red
|
|
|
+ INPUT: FixedPoint, green
|
|
|
+ INPUT: FixedPoint, blue
|
|
|
+ INPUT: FixedPoint, sourceLeft
|
|
|
+ INPUT: FixedPoint, sourceTop
|
|
|
+ INPUT: FixedPoint, sourceWidth
|
|
|
+ INPUT: FixedPoint, sourceHeight
|
|
|
+ INPUT: FixedPoint, focusOffsetX
|
|
|
+ INPUT: FixedPoint, focusOffsetY
|
|
|
+ INPUT: FixedPoint, focused
|
|
|
+ INPUT: FixedPoint, preserved
|
|
|
+ INPUT: ImageRgbaU8, atlas
|
|
|
+ OUTPUT: ImageRgbaU8, colorImage
|
|
|
+ # Select image using the focused state.
|
|
|
+ MUL: sourceOffsetX<FixedPoint>, focused, focusOffsetX
|
|
|
+ MUL: sourceOffsetY<FixedPoint>, focused, focusOffsetY
|
|
|
+ ADD: adjustedSourceLeft<FixedPoint>, sourceLeft, sourceOffsetX
|
|
|
+ ADD: adjustedSourceTop<FixedPoint>, sourceTop, sourceOffsetY
|
|
|
+ # Scale by 1 / 255 so that 255 represents full intensity in atlas.
|
|
|
+ MUL: normRed<FixedPoint>, red, 0.00392156862745
|
|
|
+ MUL: normGreen<FixedPoint>, green, 0.00392156862745
|
|
|
+ MUL: normBlue<FixedPoint>, blue, 0.00392156862745
|
|
|
+ # Resize source region from the atlas.
|
|
|
+ CALL: Resize3x3, rescaledImage<ImageRgbaU8>, width, height, preserved, atlas, adjustedSourceLeft, adjustedSourceTop, sourceWidth, sourceHeight
|
|
|
+ GET_RED: diffuseMap<ImageU8>, rescaledImage
|
|
|
+ GET_ALPHA: visibilityMap<ImageU8>, rescaledImage
|
|
|
+ MUL: redImage<ImageU8>, diffuseMap, normRed
|
|
|
+ MUL: greenImage<ImageU8>, diffuseMap, normGreen
|
|
|
+ MUL: blueImage<ImageU8>, diffuseMap, normBlue
|
|
|
+ PACK_RGBA: colorImage, redImage, greenImage, blueImage, visibilityMap
|
|
|
+END:
|
|
|
+
|
|
|
BEGIN: DiffuseSpecular3x3
|
|
|
INPUT: FixedPoint, width
|
|
|
INPUT: FixedPoint, height
|
|
|
@@ -124,14 +159,17 @@ BEGIN: PressableDiffuseSpecular3x3
|
|
|
INPUT: FixedPoint, sourceWidth
|
|
|
INPUT: FixedPoint, sourceHeight
|
|
|
INPUT: FixedPoint, pressOffsetX
|
|
|
+ INPUT: FixedPoint, pressOffsetY
|
|
|
INPUT: FixedPoint, preserved
|
|
|
INPUT: ImageRgbaU8, atlas
|
|
|
OUTPUT: ImageRgbaU8, colorImage
|
|
|
# Select image using the pressed state.
|
|
|
MUL: sourceOffsetX<FixedPoint>, pressed, pressOffsetX
|
|
|
+ MUL: sourceOffsetY<FixedPoint>, pressed, pressOffsetY
|
|
|
ADD: adjustedSourceLeft<FixedPoint>, sourceLeft, sourceOffsetX
|
|
|
+ ADD: adjustedSourceTop<FixedPoint>, sourceTop, sourceOffsetY
|
|
|
# Rescale the source region to fit width and height, while applying the diffuse color and adding white shine.
|
|
|
- CALL: DiffuseSpecular3x3, colorImage, width, height, red, green, blue, adjustedSourceLeft, sourceTop, sourceWidth, sourceHeight, preserved, atlas
|
|
|
+ CALL: DiffuseSpecular3x3, colorImage, width, height, red, green, blue, adjustedSourceLeft, adjustedSourceTop, sourceWidth, sourceHeight, preserved, atlas
|
|
|
END:
|
|
|
|
|
|
BEGIN: DiffuseSpecular1x1
|
|
|
@@ -177,14 +215,17 @@ BEGIN: PressableDiffuseSpecular1x1
|
|
|
INPUT: FixedPoint, sourceWidth
|
|
|
INPUT: FixedPoint, sourceHeight
|
|
|
INPUT: FixedPoint, pressOffsetX
|
|
|
+ INPUT: FixedPoint, pressOffsetY
|
|
|
INPUT: FixedPoint, preserved
|
|
|
INPUT: ImageRgbaU8, atlas
|
|
|
OUTPUT: ImageRgbaU8, colorImage
|
|
|
# Select image using the pressed state.
|
|
|
MUL: sourceOffsetX<FixedPoint>, pressed, pressOffsetX
|
|
|
+ MUL: sourceOffsetY<FixedPoint>, pressed, pressOffsetY
|
|
|
ADD: adjustedSourceLeft<FixedPoint>, sourceLeft, sourceOffsetX
|
|
|
+ ADD: adjustedSourceTop<FixedPoint>, sourceTop, sourceOffsetY
|
|
|
# Rescale the source region to fit width and height, while applying the diffuse color and adding white shine.
|
|
|
- CALL: DiffuseSpecular1x1, colorImage, width, height, red, green, blue, adjustedSourceLeft, sourceTop, sourceWidth, sourceHeight, preserved, atlas
|
|
|
+ CALL: DiffuseSpecular1x1, colorImage, width, height, red, green, blue, adjustedSourceLeft, adjustedSourceTop, sourceWidth, sourceHeight, preserved, atlas
|
|
|
END:
|
|
|
|
|
|
BEGIN: ListBox
|
|
|
@@ -216,3 +257,16 @@ BEGIN: VerticalScrollList
|
|
|
FADE_LINEAR: visImage, 0, 0, 128, width, 0, 0
|
|
|
PACK_RGBA: colorImage, 0, 0, 0, visImage
|
|
|
END:
|
|
|
+
|
|
|
+BEGIN: HorizontalScrollList
|
|
|
+ INPUT: FixedPoint, width
|
|
|
+ INPUT: FixedPoint, height
|
|
|
+ INPUT: FixedPoint, red
|
|
|
+ INPUT: FixedPoint, green
|
|
|
+ INPUT: FixedPoint, blue
|
|
|
+ OUTPUT: ImageRgbaU8, colorImage
|
|
|
+ CREATE: visImage<ImageU8>, width, height
|
|
|
+ CREATE: lumaImage<ImageU8>, width, height
|
|
|
+ FADE_LINEAR: visImage, 0, 0, 128, 0, height, 0
|
|
|
+ PACK_RGBA: colorImage, 0, 0, 0, visImage
|
|
|
+END:
|