Commit 55797ab7 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix for undefined variable error

Maestro was using Wimp_ReadSysInfo 2 as a proxy for finding the current eigenfactors, but in builds supporting alpha blending this can now be non-numeric.
The CASE statement only has a palette of 4 known combinations, so "A2" failed to set the sprite block variable.
Even the sprite extension was purely numeric, the same fault would occur in (for example) EX2 EY1 mode for the same reason.

Changed to read the eigenfactors from OS_ReadModeVariable.
Tested on a Risc PC, now loads successfully.

Version 1.99. Tagged as 'Maestro-1_99'
parent 6de087bb
/* (1.98)
/* (1.99)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.98
#define Module_MajorVersion_CMHG 1.99
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 May 2013
#define Module_Date_CMHG 18 Dec 2013
#define Module_MajorVersion "1.98"
#define Module_Version 198
#define Module_MajorVersion "1.99"
#define Module_Version 199
#define Module_MinorVersion ""
#define Module_Date "12 May 2013"
#define Module_Date "18 Dec 2013"
#define Module_ApplicationDate "12-May-13"
#define Module_ApplicationDate "18-Dec-13"
#define Module_ComponentName "Maestro"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Maestro"
#define Module_FullVersion "1.98"
#define Module_HelpVersion "1.98 (12 May 2013)"
#define Module_LibraryVersionInfo "1:98"
#define Module_FullVersion "1.99"
#define Module_HelpVersion "1.99 (18 Dec 2013)"
#define Module_LibraryVersionInfo "1:99"
......@@ -2941,17 +2941,6 @@ C_MenuItemfg = 7
C_MenuItembg = 0
ENDPROC
REM Returns the current mode class i.e. 22, 23 or 24.
DEF FNcurrent_mode_class
LOCAL rzero%
SYS "XWimp_ReadSysInfo", 2 TO rzero%
= ((rzero%?0 - 48) * 10) + (rzero%?1 - 48)
DEF PROCgetmodeinfo(new)
LOCAL S_Rows%, S_Columns%
......@@ -3000,28 +2989,30 @@ DEF PROCset_sprites (printer)
REM does allow for manual insertion of scale factors if
REM necessary.
LOCAL mode_class%
LOCAL mode_class%,xeig%,yeig%
IF printer THEN
mode_class% = 22
ELSE
mode_class% = FNcurrent_mode_class
SYS"OS_ReadModeVariable",-1,4 TO ,,xeig%
SYS"OS_ReadModeVariable",-1,5 TO ,,yeig%
mode_class% = ((1<<xeig%) * 10) + (1<<yeig%)
ENDIF
CASE mode_class% OF
WHEN 24,12:
WHEN 48,24,12:
REM Rectangular pixel mode
REM Always use block 1 here. It may contain hi-res sprites
REM but in that case, they're the only ones available.
SprBlk% = SprBlk1%
wimp_sprite_scaling% = TRUE
WHEN 22, 23:
wimp_sprite_scaling% = TRUE
OTHERWISE:
REM Square pixel mode
REM If we have two pools, go for ths hi-res one else fall back
REM on the lo-res ones
......@@ -3030,6 +3021,7 @@ DEF PROCset_sprites (printer)
ELSE
SprBlk% = SprBlk1%
ENDIF
wimp_sprite_scaling% = TRUE
ENDCASE
......
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