[comp.sys.amiga.programmer] AreaFill under 2.0?

bneal@umaxc.weeg.uiowa.edu (Brian Neal) (06/25/91)

 spence@cbmvax.commodore.com (Spencer Shanson) writes:

>> bneal@umaxc.weeg.uiowa.edu (Brian Neal) writes:
>>Hello All,
>>	I have a program that I wrote that draws a lot of triangles via
>>AreaMove/Draw/End calls.  This program worked fine on my Amiga 500.  When
>>I got my A3000 I thought I would recompile it to take advantage of the
>>math chip.  But now it doesn't draw anything!  I am pretty sure the
>>bug is taking place in the Area calls, as if I replace them by Move and
>>Draw I get a correct wire frame picture.  Has something changed in order
>>to use these calls?   I have 2.03 and am using Aztec C 5.0d.
>>

>The Area..() functions should not be affected by the type of maths chip.
>Could you post some source code that shows the problem? It needn't be the
>whole program, just a snippet of relevant code.

>>	Also, AreaMove & AreaDraw are returning 0 (no error).  
>>According to the 1.3 RKMs AreaEnd also returns a value, but why does Manx's 
>>functions.h have AreaEnd prototyped as returning void?
>>Any advice is greatly appreciated.
>>
>>Brian

>Spencer Shanson - Amiga Software Engineer     | email: spence@commodore.COM
>                                              | or uunet!cbmvax!spence

Okay, here is a code snippet:
-------------------------------------------------------------------------
 
/* Here are the relevant declarations...  */
 
#define AREA_WORDS 8
 
struct AreaInfo myAreaInfo;         /*  used for Area filling  */
struct TmpRas   myTmpRas;
WORD area_array[AREA_WORDS];        /*  Space to store points for Area   */
PLANEPTR workspace = NULL;          /*  operations (5 bytes per vertex). */
                                    /*  We have 3 vertex triangles.      */
 
/* Here are the initializations...*/
 
if (!(workspace = (PLANEPTR) AllocRaster(320L, 200L)))
{
   return (NO_AREA);
}
InitTmpRas(&myTmpRas, (char *) workspace, (LONG) RASSIZE(320, 200));
win -> RPort -> TmpRas = &myTmpRas;
 
InitArea(&myAreaInfo, &area_array[0], (LONG) (AREA_WORDS * 2 / 5));
win -> RPort -> AreaInfo = &myAreaInfo;
 
/*  Here is an example of how I use the Area...() calls  */
 
SetAPen(rp, (LONG) shade1);
AreaMove(rp, (LONG) rx, (LONG) ry);
AreaDraw(rp, (LONG) rx1, (LONG) ry1);
AreaDraw(rp, (LONG) rx2, (LONG) ry2);
AreaEnd(rp);

-----------------------------------------------------------------------------
I am stumped.  These things have changed since the program was last
working correctly:
	compiled on Aztec 5.0a	-  now using 5.0d
	ran on A500		-  now on A3000
	OS 1.3			-  now 2.03


Thanks for your help.

Brian

spence@cbmvax.commodore.com (Spencer Shanson) (06/26/91)

OK - you are coercing a lot of values to LONGs that should be either WORDS
or BYTES. Take another look at the Autodocs for the correct coercion, and
try that.

-- 
---------------------------------------------------------------------------
Spencer Shanson - Amiga Software Engineer     | email: spence@commodore.COM
                                              | or uunet!cbmvax!spence
All opinions expressed are my own, and do not | Bix: sshanson
(necessarily) represent those of Commodore.   | "Copper? I hardly even
                                              | know her!"