home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d111
/
amyload
/
newdata.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-15
|
2KB
|
69 lines
#include <intuition/intuition.h>
#include <devices/load.h>
#include "execdef.h"
#include "intuidef.h"
#include "loadrecord.h"
#include "windownode.h"
#include "windowinfo.h"
#include "NewData.proto"
#include "ScrollWindow.proto"
#include "NewScale.proto"
#include "RedrawWindow.proto"
#include "DrawDataLine.proto"
extern MinList windowList;
void
NewData(newloadvalue)
loadval *newloadvalue;
{
WindowNode *node;
Bool new_scale;
LoadRecord *record;
LoadDataValue newvalue;
for (node = (WindowNode *)windowList.mlh_Head;
node->node.mln_Succ;
node = (WindowNode *)node->node.mln_Succ)
{
new_scale = FALSE;
for (record = (LoadRecord *)WINDOWINFO(node->window)->loadrecords.mlh_Head;
record->node.mln_Succ;
record = (LoadRecord *)record->node.mln_Succ)
{
if (record->next_data == record->end_data)
ScrollWindow(node->window);
switch (record->type)
{
case CPU:
newvalue = newloadvalue->lv_cpu;
break;
case BLITTER:
newvalue = newloadvalue->lv_blitter;
break;
case CHIPMEM:
newvalue = newloadvalue->lv_chip;
break;
case FASTMEM:
newvalue = newloadvalue->lv_fast;
break;
case ALLMEM:
newvalue = newloadvalue->lv_chip + newloadvalue->lv_fast;
break;
}
*(record->next_data++) = newvalue;
if (record->scale && newvalue > *record->max_data)
{
record->max_data = record->next_data - 1;
new_scale = NewScale(WINDOWINFO(node->window), record, newvalue) || new_scale;
}
if (!new_scale)
DrawDataLine(node->window, record, (short)(record->next_data - 1 - record->start_data), newvalue);
}
if (new_scale)
RedrawWindow(node->window);
}
}