swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***event raised for warning...in Heatbugs


From: bleydorf
Subject: ***event raised for warning...in Heatbugs
Date: Fri, 08 Aug 1997 13:54:06 -0400

All,
I have been trying to implement an additional space called "HappySpace"
which is similar to heatspace, except that instead of heat it shows
happiness values.  I think I have a pretty close estimation of how to do
this, but when I run, I get an "warning" and the Happyspace window is
all Black.
The warning is:
***event rasied for warning: Resource Availability 
Problem allocating color #0000d6 substituting white 
***execution continuing

I might get it several times...
I think I know what it is but I wanted to run it by you guys and see if
I could be right...Could it be that Linux can't display more than 64
colors?  Im running Redhat 4.1, with X386free XWindows.  My video card
is 4 meg.  If this sounds right, can anyone tell me how to change the
color settings in Redhat Linux 4.1?

But, if you think it might be something in the code, the critical code
snipets follow:

In ObserverSwarm.m

I add to the colormap:
for (i=0;i<20;i++)
[colormap setColor: i+66 ToRed: 0 Green: 0 Blue: (double)i /19.0];

//since colormap (0 - 63) is reds, (64) is green, and (65) is white, 
//I planned to have (66-86) be blues.

**********Possible Problem area*********:

In:
[happyDisplay setDisplayMappingM: ???? C: ?????];  I think C: should be
66, but I've tried all sorts of things in M: including (with reasoning):

M = 1 - Since there are 20 shades of Blue, and only 20 possible
happyValues (I converted them to integers, in heatbug.m)  It would be a
1 to 1 relationship.  Unlike Reds, which converts 32768 to 64 shades.

M = 1638 - if you divide 32768(total number of colors?) / 64(total
number of reds wanted) = 512(number in the other setDisplayMappingM:C:),
so 32768/20 = 1638.4.

Others which seem less clear why I tried them... 0, 2, 100, 50, 512.

In buildActions:

I added: (after the other displayActions...)
[displayActions createActionTo: happyDisplay message: M:(display)];
[displayActions createActionTo: happyRaster message: M:(drawSelf)];

The rest of the code for creation of the Happy Window, etc, is exactly
like heatSpace stuff.

Anyone have any ideas?

Thanks,
Brad.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]