Commit e02a347c authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix flickery drags. Tweak translucent drop shadows.

Detail:
  s/Drag - When moving the dragged sprite, avoid plotting over the top of its old location in order to prevent flicker caused by overdraw. This flicker wasn't so apparent with the older translucent or hatched sprite plotting, but is a lot more noticeable with ABGR sprites.
  s/StartUp - Use 50% alpha for the ABGR sprite in true colour modes, to match hatching & non-drop shadow variants. Also make the drop shadow completely invisible when behind the sprite - better than having it there but making it almost completely imperceptible in order to try and hide the fact that it always looks a bit funny
Admin:
  Tested on Iyonix


Version 0.19. Tagged as 'DragASprit-0_19'
parent 745647d1
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.18"
Module_Version SETA 18
Module_MajorVersion SETS "0.19"
Module_Version SETA 19
Module_MinorVersion SETS ""
Module_Date SETS "03 Jul 2014"
Module_ApplicationDate SETS "03-Jul-14"
Module_Date SETS "05 Jul 2014"
Module_ApplicationDate SETS "05-Jul-14"
Module_ComponentName SETS "DragASprit"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/DragASprit"
Module_FullVersion SETS "0.18"
Module_HelpVersion SETS "0.18 (03 Jul 2014)"
Module_FullVersion SETS "0.19"
Module_HelpVersion SETS "0.19 (05 Jul 2014)"
END
/* (0.18)
/* (0.19)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.18
#define Module_MajorVersion_CMHG 0.19
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Jul 2014
#define Module_Date_CMHG 05 Jul 2014
#define Module_MajorVersion "0.18"
#define Module_Version 18
#define Module_MajorVersion "0.19"
#define Module_Version 19
#define Module_MinorVersion ""
#define Module_Date "03 Jul 2014"
#define Module_Date "05 Jul 2014"
#define Module_ApplicationDate "03-Jul-14"
#define Module_ApplicationDate "05-Jul-14"
#define Module_ComponentName "DragASprit"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/DragASprit"
#define Module_FullVersion "0.18"
#define Module_HelpVersion "0.18 (03 Jul 2014)"
#define Module_LibraryVersionInfo "0:18"
#define Module_FullVersion "0.19"
#define Module_HelpVersion "0.19 (05 Jul 2014)"
#define Module_LibraryVersionInfo "0:19"
......@@ -118,7 +118,7 @@ TranslucentPlot ROUT
; Swap bg0 and bg1
;
Move
Entry "r0-r7" , 8*4
Entry "r0-r8" , 8*4
; If first action is move then it must be plot instead
LDRB lr, FirstMoveIsPlot
......@@ -203,13 +203,58 @@ Move
BVS %FT95
; Plot fg
; We clip around the old position to avoid flicker caused by overdraw
BL GetGWindow
Push "r0-r3"
; Check if src and dest overlap
ADD r0, sp, #16
LDMIA r0, {r0-r7}
CMP r4, r2
CMPLT r5, r3
CMPLT r0, r6
CMPLT r1, r7
BGE %FT15 ; No overlap, skip clipping
; Draw top/bottom portion
MOV r6, r5 ; r6 = bg0 bottom
; r7 = bg0 top
MOV r8, r3 ; r8 = fg top
LDMIA sp, {r0-r3} ; get gwindow
CMP r8, r7
BEQ %FT10
MOVGT r1, r7 ; gwindow bottom = bg0 top
SUBLT r3, r6, #1 ; gwindow top = bg0 bottom
BL SetGWindow
LDR r1, fgsa
ADRL r2, fg_name
ADD r14, sp, #0*4
ADD r14, sp, #16
LDMIA r14, {r3,r4}
MOV r5, #8
BL TranslucentPlot
BVS %FT95
; Set alternate vertical clip ready for drawing left/right portion
LDMIA sp, {r0-r3}
CMP r8, r7
SUBGT r3, r7, #1 ; gwindow top = bg0 top
MOVLT r1, r6 ; gwindow bottom = bg0 bottom
10
; Draw left/right portion
LDR r6, [sp, #16+16+0] ; r6 = bg0 left
LDR r7, [sp, #16+16+8] ; r7 = bg0 right
LDR r8, [sp, #16+8] ; r8 = fg right
CMP r8, r7
BEQ %FT20
MOVGT r0, r7 ; gwindow left = bg0 right
SUBLT r2, r6, #1 ; gwindow right = bg0 left
BL SetGWindow
15
LDR r1, fgsa
ADRL r2, fg_name
ADD r14, sp, #16
LDMIA r14, {r3,r4}
MOV r5, #8
BL TranslucentPlot
20
Pull "r0-r3"
BL SetGWindow
; Plot bg0 to screen (bg0 at src)
......
......@@ -73,7 +73,8 @@ DS_DropShadowDistance * 8 ; OS units
DS_TranslucencyValue * 128 ; i.e. 50%, as per hatching
DS_TranslucencyValue_256 * 104 ; Use a value of about 40% in 256 colour modes. With the default RISC OS 5 Wimp theme sprites this greatly helps file icons to retain their colour when dragged over window & desktop backgrounds.
DS_DropShadowAlpha * 96
DS_DropShadowFGAlpha * 160
DS_DropShadowFGAlpha * 128
DS_DropShadowFGAlpha_256 * 160
MACRO
$label TestAFlag $reg, $what, $iswhat, $workreg
......@@ -926,6 +927,7 @@ outw # 4
outh # 4
outdata # 4
dropbuf # 4
fgalpha # 4
scale_block2 # 16
tx_block2 # 16
GTDS_frame_size * :INDEX: @
......@@ -949,6 +951,15 @@ GTDS_frame_size * :INDEX: @
STR r5, inxeig
STR r2, inyeig
; Decide on the alpha value to use for the foreground sprite
MOV r0, #-1
MOV r1, #VduExt_Log2BPP
SWI XOS_ReadModeVariable
CMP r2, #3
MOVLE r2, #DS_DropShadowFGAlpha_256
MOVGT r2, #DS_DropShadowFGAlpha
STR r2, fgalpha
; Read eigen values for current mode
MOV r0, #-1
BL PixToOSUnitFactors
......@@ -1135,14 +1146,13 @@ GTDS_frame_size * :INDEX: @
LDRB r4, [r0, #3]
CMP r4, #128
ADDGE r4, r4, #1
; Make drop shadow less intense when viewed through foreground
ADD lr, r4, r4, LSR #2
RSB lr, lr, #512
; Make drop shadow invisible when viewed through foreground
RSB lr, r4, #256
MUL r3, lr, r3
MOV r3, r3, LSR #9
MOV r3, r3, LSR #8
TEQ r4, #0
; Adjust foreground alpha
MOVNE lr, #DS_DropShadowFGAlpha
LDRNE lr, fgalpha
MULNE r4, lr, r4
MOVNES r4, r4, LSR #8
BEQ %FT50
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment