mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
12ab283c22
And fix an error in floatview. The z-transform program is so I can test out my math and eventually develop some hopefully interesting sound generators.
28 lines
591 B
R
28 lines
591 B
R
#include <string.h>
|
|
#include "ruamoko/qwaq/debugger/views/floatview.h"
|
|
|
|
@implementation FloatView
|
|
|
|
-initWithDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
|
|
{
|
|
if (!(self = [super initWithDef:def type:type])) {
|
|
return nil;
|
|
}
|
|
self.data = (float *)(data + def.offset);
|
|
return self;
|
|
}
|
|
|
|
+(FloatView *)withDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
|
|
{
|
|
return [[[self alloc] initWithDef:def in:data type:type] autorelease];
|
|
}
|
|
|
|
-draw
|
|
{
|
|
[super draw];
|
|
string val = sprintf ("%.9g", data[0]);
|
|
[self mvprintf:{0, 0}, "%*.*s", xlen, xlen, val];
|
|
return self;
|
|
}
|
|
|
|
@end
|