Bad use of BitmapFillStyle and FormCanvas>>fillRectangle:fillStyle:?

ken at kencausey.com ken at kencausey.com
Wed Apr 21 21:29:57 UTC 2004


I'm getting a primitive failure as shown below on attempting to
FormCanvas>>fillRectangle:fillStyle: with a BitmapFillStyle filled from
a BMP file with 32x32x32 data. Created via

BitmapFillStyle fromForm: (Form fromBMPFileNamed:
'data/textures/32x32/graynoisefloor.bmp')

Can anyone explain what I'm doing wrong?  I would be happy to send
someone the BMP if it helps.

Thanks,

Ken

P.S. general tips on debugging primitive failures would also be welcome.
 Anything simpler than digging out gdb?


21 April 2004 4:25:03 pm

VM: unix - a SmalltalkImage
Image: Squeak3.7alpha [latest update: #5816]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/ken/projects/game
Trusted Dir /home/ken/projects/game/secure
Untrusted Dir /home/ken/projects/game/untrusted

BalloonEngine(Object)>>error:
	Receiver: a BalloonEngine
	Arguments and temporary variables: 
		aString: 	'Error: a primitive has failed'
	Receiver's instance variables: 
		workBuffer: 	a BalloonBuffer
		span: 	a Bitmap of length 2048
		bitBlt: 	a GrafPort
		forms: 	#(Form(32x32x32))
		clipRect: 	262 at 0 corner: 644 at 600
		destOffset: 	-1377 at -2007
		externals: 	an OrderedCollection()
		aaLevel: 	1
		edgeTransform: 	nil
		colorTransform: 	nil
		deferred: 	false
		postFlushNeeded: 	true

[] in WorldState>>displayWorldSafely: {[:err :rcvr |  errCtx :=
thisContext.  [errCtx := errCtx sender.  [errCtx no...]}
	Arguments and temporary variables: 
		aWorld: 	a PasteUpMorph(1622) [world]
		err: 	'Error: a primitive has failed'
		rcvr: 	a BalloonEngine
		errCtx: 	[] in SectorMorph>>drawOn: {[:tile | tile class = Rectangle  
ifTrue: [aCanvas fillRectangle: tile fillS...]}...etc...
		errMorph: 	a SectorMorph<Y2: Hall>(391)

BlockContext>>valueWithPossibleArgs:
	Receiver: [] in WorldState>>displayWorldSafely: {[:err :rcvr |  errCtx
:= thisContext.  [errCtx := errCtx sender.  [errCtx no...]}...etc...
	Arguments and temporary variables: 
		anArray: 	#('Error: a primitive has failed' a BalloonEngine)
	Receiver's instance variables: 
		sender: 	BlockContext>>valueWithPossibleArgs:
		pc: 	113
		stackp: 	0
		nargs: 	2
		startpc: 	66
		home: 	WorldState>>displayWorldSafely:

[] in BlockContext>>ifError: {[:ex | errorHandlerBlock
valueWithPossibleArgs: {ex description. ex receiver}]}
	Arguments and temporary variables: 
		errorHandlerBlock: 	[] in WorldState>>displayWorldSafely: {[:err :rcvr
|  errCtx := thisContext.  [errCtx := errCtx sender.  [errCtx
no...]}...etc...
		ex: 	Error: a primitive has failed


--- The full stack ---
BalloonEngine(Object)>>error:
[] in WorldState>>displayWorldSafely: {[:err :rcvr |  errCtx :=
thisContext.  [errCtx := errCtx sender.  [errCtx no...]}
BlockContext>>valueWithPossibleArgs:
[] in BlockContext>>ifError: {[:ex | errorHandlerBlock
valueWithPossibleArgs: {ex description. ex receiver}]}
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BlockContext>>valueWithPossibleArgs:
[] in MethodContext(ContextPart)>>handleSignal: {[(self tempAt: 2)  
valueWithPossibleArgs: {exception}]}
BlockContext>>ensure:
MethodContext(ContextPart)>>handleSignal:
Error(Exception)>>signal
Error(Exception)>>signal:
BalloonEngine(Object)>>error:
BalloonEngine(Object)>>primitiveFailed
BalloonEngine>>primAddBitmapFill:colormap:tile:from:along:normal:xIndex:
BalloonEngine>>registerFill:
BalloonEngine>>registerFills:
BalloonEngine>>registerFill:and:
BalloonEngine>>drawRectangle:fill:borderWidth:borderColor:transform:
BalloonCanvas>>drawRectangle:color:borderWidth:borderColor:
BalloonCanvas>>fillRectangle:fillStyle:
FormCanvas>>balloonFillRectangle:fillStyle:
FormCanvas>>fillRectangle:fillStyle:
[] in SectorMorph>>drawOn: {[:tile | tile class = Rectangle   ifTrue:
[aCanvas fillRectangle: tile fillS...]}
OrderedCollection>>do:
SectorMorph>>drawOn:
FormCanvas(Canvas)>>draw:
FormCanvas(Canvas)>>drawMorph:
[] in SectorMorph(Morph)>>fullDrawOn: {[(aCanvas isVisible: self bounds)
  ifTrue: [aCanvas drawMorph: self].  self...]}
FormCanvas>>roundCornersOf:in:during:
FormCanvas(Canvas)>>roundCornersOf:during:
SectorMorph(Morph)>>fullDrawOn:
SectorMorph>>fullDrawOn:
FormCanvas(Canvas)>>fullDraw:
FormCanvas(Canvas)>>fullDrawMorph:
[] in MovementTestMorph(TransformMorph)>>drawSubmorphsOn: {[:m |
myCanvas fullDrawMorph: m]}
Array(SequenceableCollection)>>reverseDo:
[] in MovementTestMorph(TransformMorph)>>drawSubmorphsOn: {[:myCanvas |
submorphs   reverseDo: [:m | myCanvas fullDrawMorph: m]]}
FormCanvas>>transformBy:clippingTo:during:smoothing:
MovementTestMorph(TransformMorph)>>drawSubmorphsOn:
[] in MovementTestMorph(Morph)>>fullDrawOn: {[(aCanvas isVisible: self
bounds)   ifTrue: [aCanvas drawMorph: self].  self...]}
FormCanvas>>roundCornersOf:in:during:
FormCanvas(Canvas)>>roundCornersOf:during:
MovementTestMorph(Morph)>>fullDrawOn:
MovementTestMorph>>fullDrawOn:
...etc...



More information about the Squeak-dev mailing list