quakeforge/ruamoko/qwaq/debugger/intview.r
Bill Currie 0e7c7640f4 [qwaq] Right-justify def value display
Now that *printf("%*.*s") works :)
2020-04-01 19:57:24 +09:00

28 lines
554 B
R

#include <string.h>
#include "debugger/intview.h"
@implementation IntView
-initWithType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data
{
if (!(self = [super initWithType:type])) {
return nil;
}
self.data = (int *)(data + offset);
return self;
}
+(IntView *)withType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data
{
return [[[self alloc] initWithType:type at:offset in:data] autorelease];
}
-draw
{
[super draw];
string val = sprintf ("%d", data[0]);
[self mvprintf:{0, 0}, "%*.*s", xlen, xlen, val];
return self;
}
@end