Commit e9196548 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix sprite plotting with SpriteExtend 1.43 and later.

In numerous places where a sprite area isn't strictly necessary !Draw was passing in a bogus area address of 0xFF, this is now rejected by SpriteExtend.
Changed to use define UNUSED_SA and set this to an address which is at least in the application slot and word aligned.
Tested briefly - sprites now appear again.

Version 1.19. Tagged as 'Draw-1_19'
parent 85b7f9f4
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.18"
Module_Version SETA 118
Module_MajorVersion SETS "1.19"
Module_Version SETA 119
Module_MinorVersion SETS ""
Module_Date SETS "30 May 2011"
Module_ApplicationDate SETS "30-May-11"
Module_Date SETS "10 Jul 2011"
Module_ApplicationDate SETS "10-Jul-11"
Module_ComponentName SETS "Draw"
Module_ComponentPath SETS "castle/RiscOS/Sources/Apps/Draw"
Module_FullVersion SETS "1.18"
Module_HelpVersion SETS "1.18 (30 May 2011)"
Module_FullVersion SETS "1.19"
Module_HelpVersion SETS "1.19 (10 Jul 2011)"
END
/* (1.18)
/* (1.19)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.18
#define Module_MajorVersion_CMHG 1.19
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 May 2011
#define Module_Date_CMHG 10 Jul 2011
#define Module_MajorVersion "1.18"
#define Module_Version 118
#define Module_MajorVersion "1.19"
#define Module_Version 119
#define Module_MinorVersion ""
#define Module_Date "30 May 2011"
#define Module_Date "10 Jul 2011"
#define Module_ApplicationDate "30-May-11"
#define Module_ApplicationDate "10-Jul-11"
#define Module_ComponentName "Draw"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Draw"
#define Module_FullVersion "1.18"
#define Module_HelpVersion "1.18 (30 May 2011)"
#define Module_LibraryVersionInfo "1:18"
#define Module_FullVersion "1.19"
#define Module_HelpVersion "1.19 (10 Jul 2011)"
#define Module_LibraryVersionInfo "1:19"
......@@ -739,7 +739,7 @@ static os_error *do_objsprite (draw_objptr hdrptr, draw_objcoord *org)
return err;
}
sprite_readsize ((sprite_area *) 0xFF, &id, &info);
sprite_readsize (UNUSED_SA, &id, &info);
factors.xmag = (int) (((double) hdrptr.spritep->bbox.x1 -
(double) hdrptr.spritep->bbox.x0) *
......@@ -766,7 +766,7 @@ static os_error *do_objsprite (draw_objptr hdrptr, draw_objcoord *org)
#endif
return sprite_put_scaled
((sprite_area*) 0xFF, /* this op needs no area */
(UNUSED_SA, /* this op needs no area */
&id, /* address of sprite */
8 | 1 << 5 | 1 << 6, /* GcolAction=STORE thro mask, wide entries, dithered*/
scaleS (org->x, hdrptr.spritep->bbox.x0),
......@@ -883,8 +883,8 @@ static os_error *do_objtrfmsprite (draw_objptr hdrptr, draw_objcoord *org)
pixtrans [12], pixtrans [13], pixtrans [14], pixtrans [15]);
#endif
return sprite_put_trans /*osspriteop_put_sprite_scaled*/
((sprite_area *) 0xFF, /*this op needs no spArea*/
return sprite_put_trans /*osspriteop_put_sprite_transformed*/
(UNUSED_SA, /*this op needs no spArea*/
&id, /*pass address of sprite*/
8 | 1 << 5 | 1 << 6, /*GcolAction=STORE thro mask, wide entries, dithered*/
NULL, /*no box - put whole sprite*/
......
......@@ -580,9 +580,9 @@ static BOOL fetch_spritefile (diagrec *diag, char *name, int filelen,
id.s.addr = &hdrptr.spritep->sprite;
(void) sprite_readsize
((sprite_area *) 0xFF, /*this op needs no spArea*/
&id, /*pass address of sprite*/
&info /*result block*/);
(UNUSED_SA, /*this op needs no spArea*/
&id, /*pass address of sprite*/
&info /*result block*/);
/*Generate sprite box, on mouse position*/
hdrptr.spritep->bbox.x0 = pt->x;
......
......@@ -1201,7 +1201,7 @@ static void bound_trfmsprite (draw_objptr hdrptr)
id.tag = sprite_id_addr;
id.s.addr = &hdrptr.trfmspritep->sprite;
sprite_readsize ((sprite_area *) 0xFF, &id, &info);
sprite_readsize (UNUSED_SA, &id, &info);
/*Convert to Draw units*/
mode = hdrptr.trfmspritep->sprite.mode;
......
......@@ -2984,7 +2984,7 @@ static os_error *Make_Rotatable (diagrec *diag, int hdroff,
id.tag = sprite_id_addr;
id.s.addr = &hdrptr.trfmspritep->sprite;
sprite_readsize ((sprite_area *) 0xFF, &id, &info);
sprite_readsize (UNUSED_SA, &id, &info);
mode = hdrptr.trfmspritep->sprite.mode;
width = info.width << bbc_modevar (mode, bbc_XEigFactor) + 8;
height = info.height << bbc_modevar (mode, bbc_YEigFactor) + 8;
......
......@@ -876,12 +876,12 @@ static void scale_sprite (draw_objptr hdrptr, scale_typ *scale)
if (scale->xscale < 0)
{ hdrptr.spritep->bbox.x0 = 2*scale->org.x - hdrptr.spritep->bbox.x1;
sprite_flip_y ((sprite_area*)0xFF, &id);
sprite_flip_y (UNUSED_SA, &id);
}
if (scale->yscale < 0)
{ hdrptr.spritep->bbox.y0 = 2*scale->org.y - hdrptr.spritep->bbox.y1;
sprite_flip_x ((sprite_area*)0xFF, &id);
sprite_flip_x (UNUSED_SA, &id);
}
scale_coord_abs (scale, &hdrptr.spritep->bbox.x0);
......
......@@ -30,23 +30,22 @@
/* RELEASE VALUES */
#define VALIDATEFILES 1
#define REJECTUNKNOWNOBJECTS 0
#define ALLOWCTRLKEYS 0
#define ALLOW_DFILES 0
#define ALLOWCURSORKEYS 1
#define HOLLOWBLOB 1
#define VALIDATEFILES 1
#define REJECTUNKNOWNOBJECTS 0
#define ALLOWCTRLKEYS 0
#define ALLOW_DFILES 0
#define ALLOWCURSORKEYS 1
#define HOLLOWBLOB 1
#define REJECTUNKNOWNFILETYPES 1 /*Changed to 1. JRC 1 Feb 1990*/
#define USEHEAP 0 /*no need any more*/
#define FREEZE_STACK 0
#define USEHEAP 0 /*no need any more*/
#define FREEZE_STACK 0
#if TRACE
#define CATCH_SIGNALS 1
#define CATCH_SIGNALS 1
#else
#define CATCH_SIGNALS 1
#define CATCH_SIGNALS 1
#endif
#define USE_TRUE_COLOURS 1
#define HIGH_RES_LINES 0 /*Do this if for some reason bboxes must match
exactly. Not done now <= too expensive.*/
#define USE_TRUE_COLOURS 1
#define HIGH_RES_LINES 0 /*Do this if for some reason bboxes must match exactly. Not done now <= too expensive.*/
#if USEHEAP
/* Dynamic memory allocation */
......@@ -124,9 +123,10 @@ int draw_fontToOS(int xx);
/* Colour used for work area background */
#define Window_WORKBG 0
#define FILENAMEMAX 256 /* max 255 char + null */
#define TITLEBUFMAX 256 /* max 255 char + null (in case of future modes) */
#define UNTITLED msgs_lookup("DrawUn")
#define FILENAMEMAX 256 /* max 255 char + null */
#define TITLEBUFMAX 256 /* max 255 char + null (in case of future modes) */
#define UNTITLED msgs_lookup("DrawUn")
#define UNUSED_SA (sprite_area *)0x8000 /* Vaguely valid address */
#define grabW 16 /* Width and height of grab boxes */
#define grabH 16
......
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