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

Fix logic which decides whether to plot sprites using the Kernel or...

Fix logic which decides whether to plot sprites using the Kernel or SpriteExtend to take into account the new sprite modes

Detail:
  s/Wimp01 - Add NColour mode variable to the list of variables cached for the current screen mode. Add modeflags & ncolour to the sprite & tool sprite variables.
  s/Wimp04, s/Wimp10 - Update cachespritedata and cachetoolspritedata to look at the modeflags, ncolour and alpha mask flag when deciding if sprite_needsfactors should be set or not (i.e. whether the code ultimately uses OS_SpriteOp 52 or 34). This should allow the Wimp to correctly detect if a sprite can safely be rendered by the Kernel or not (except for double pixel vs. non-double pixel - but presumably nobody's using double pixel mode sprites for icons/tool sprites, otherwise it would be fixed by now?)
  s/Wimp04 - Add an extra safety check to icon text rendering after a crash was seen when calling Wimp_PlotIcon outside of a redraw loop
Admin:
  Tested on BB-xM
  Fixes problem reported on forums with 32bpp, alpha-masked sm!Netsurf icon vanishing from filer when viewed in 32bpp modes
  https://www.riscosopen.org/forum/forums/3/topics/309?page=4#posts-25995


Version 5.33. Tagged as 'Wimp-5_33'
parent a9c3b548
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.32"
Module_Version SETA 532
Module_MajorVersion SETS "5.33"
Module_Version SETA 533
Module_MinorVersion SETS ""
Module_Date SETS "08 Sep 2013"
Module_ApplicationDate SETS "08-Sep-13"
Module_Date SETS "07 Oct 2013"
Module_ApplicationDate SETS "07-Oct-13"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.32"
Module_HelpVersion SETS "5.32 (08 Sep 2013)"
Module_FullVersion SETS "5.33"
Module_HelpVersion SETS "5.33 (07 Oct 2013)"
END
/* (5.32)
/* (5.33)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.32
#define Module_MajorVersion_CMHG 5.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 08 Sep 2013
#define Module_Date_CMHG 07 Oct 2013
#define Module_MajorVersion "5.32"
#define Module_Version 532
#define Module_MajorVersion "5.33"
#define Module_Version 533
#define Module_MinorVersion ""
#define Module_Date "08 Sep 2013"
#define Module_Date "07 Oct 2013"
#define Module_ApplicationDate "08-Sep-13"
#define Module_ApplicationDate "07-Oct-13"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.32"
#define Module_HelpVersion "5.32 (08 Sep 2013)"
#define Module_LibraryVersionInfo "5:32"
#define Module_FullVersion "5.33"
#define Module_HelpVersion "5.33 (07 Oct 2013)"
#define Module_LibraryVersionInfo "5:33"
......@@ -731,6 +731,7 @@ scry1 # 4
textxsize # 4 ; converted to OS units
textysize # 4
modeflags # 4
ncolour # 4
rotatecounter # 4 ; modified rotdotdash routine
......@@ -1212,10 +1213,14 @@ sprite_lastmode # 4
sprite_log2bpp # 4 ; for mode-independent sprite plotting
sprite_log2px # 4
sprite_log2py # 4
sprite_modeflags # 4
sprite_ncolour # 4
tsprite_lastmode # 4
tsprite_log2bpp # 4 ; for mode-independent toolsprite plotting
tsprite_log2px # 4
tsprite_log2py # 4
tsprite_modeflags # 4
tsprite_ncolour # 4
ALIGNHASH 16
sprite_factors # 16
tsprite_factors # 16
......@@ -4796,6 +4801,7 @@ vduinput2
DCD VduExt_TCharSpaceX
DCD VduExt_TCharSpaceY
DCD VduExt_ModeFlags ; for checking for hi-res mono modes
DCD VduExt_NColour
DCD -1
......
......@@ -2019,6 +2019,8 @@ icontext TraceL font
LDR R0, redrawhandle
Trace menuw, "icontext: painting icon for handle ", X, R0
CMP R0, #nullptr
BEQ icontext_pushfontstring
BIC R0, R0, #3 ; get the real pointer
LDR R0, [R0, #w_taskhandle]
; R0 = handle of the task that owns this window (-1 for menus)
......@@ -3360,12 +3362,33 @@ cachespritedata
MOVVC R1,#VduExt_YEigFactor
SWIVC XOS_ReadModeVariable
STRVC R2,sprite_log2py ; get the Y scaling factor (pixels => OS units)
MOVVC R1,#VduExt_ModeFlags
SWIVC XOS_ReadModeVariable
STRVC R2,sprite_modeflags ; get the mode flags
MOVVC R1,#VduExt_NColour
SWIVC XOS_ReadModeVariable
STRVC R2,sprite_ncolour ; get the ncolour
Pull "R2,R3-R4",VS
BVS %FT92
LDR R1,sprite_log2bpp
LDR R6,log2bpp
TEQ R1,R6 ; any special translating?
MOV LR,#ModeFlag_DataFormat_Mask
TEQ R6,#3
ORRNE LR,LR,#ModeFlag_64k ; try and avoid false positives on 64K flag caused by 8bpp full palette flag.
LDRNE R1,sprite_ncolour
LDRNE R5,ncolour
TEQNE R1,R5 ; ncolour differs? (only check if not 8bpp to try and avoid 63/255 false positives)
LDREQ R1,modeflags
LDREQ R2,sprite_modeflags
ANDEQ R2,R2,LR
ANDEQ R1,R1,LR
TEQEQ R1,R2 ; any colour space conversion or alpha blending needed?
LDREQ R1,sprite_lastmode
TSTEQ R1,#&80000000 ; does it have an alpha mask?
LDR R1,sprite_log2bpp
TEQEQ R1,R6 ; bpp differs?
LDR R0,sprite_log2px
LDR R5,log2px
TEQEQ R0,R5
......
......@@ -3263,15 +3263,36 @@ cachetoolspritedata
MOVVC R1,#VduExt_YEigFactor
SWIVC XOS_ReadModeVariable
STRVC R2,tsprite_log2py ; get the Y scaling factor (pixels => OS units)
MOVVC R1,#VduExt_ModeFlags
SWIVC XOS_ReadModeVariable
STRVC R2,tsprite_modeflags ; get the mode flags
MOVVC R1,#VduExt_NColour
SWIVC XOS_ReadModeVariable
STRVC R2,tsprite_ncolour ; get the ncolour
[ ToolTables
BLVC mastertoactive ; remap any custom translation tables
]
Pull "R2,R3-R4",VS
BVS %FT92
LDR R1,tsprite_log2bpp
LDR R6,log2bpp
TEQ R1,R6 ; any special translating?
MOV LR,#ModeFlag_DataFormat_Mask
TEQ R6,#3
ORRNE LR,LR,#ModeFlag_64k ; try and avoid false positives on 64K flag caused by 8bpp full palette flag.
LDRNE R1,tsprite_ncolour
LDRNE R5,ncolour
TEQNE R1,R5 ; ncolour differs? (only check if not 8bpp to try and avoid 63/255 false positives)
LDREQ R1,modeflags
LDREQ R2,tsprite_modeflags
ANDEQ R2,R2,LR
ANDEQ R1,R1,LR
TEQEQ R1,R2 ; any colour space conversion or alpha blending needed?
LDREQ R1,tsprite_lastmode
TSTEQ R1,#&80000000 ; does it have an alpha mask?
LDR R1,tsprite_log2bpp
TEQEQ R1,R6 ; bpp differs?
LDR R0,tsprite_log2px
LDR R5,log2px
TEQEQ R0,R5
......
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