Fixes for building with QF.

This commit is contained in:
Bill Currie 2010-09-12 08:43:55 +09:00
parent 9ec5310ed7
commit 44942df87f
6 changed files with 44 additions and 50 deletions

View file

@ -1,3 +1,4 @@
#include "QF/sys.h"
#include "Preferences.h" #include "Preferences.h"
#include "Map.h" #include "Map.h"
@ -341,7 +342,7 @@ Grab all the current UI state
*/ */
-UIChanged:sender -UIChanged:sender
{ {
qprintf ("defaults updated"); Sys_Printf ("defaults updated");
[self setProjectPath:(char *)[startproject_i stringValue]]; [self setProjectPath:(char *)[startproject_i stringValue]];
[self setBspSoundPath:(char *)[bspSoundField_i stringValue]]; [self setBspSoundPath:(char *)[bspSoundField_i stringValue]];

View file

@ -260,7 +260,7 @@ t in:(id) obj
int i, c; int i, c;
char *name; char *name;
qprintf ("loading %s", wf); Sys_Printf ("loading %s", wf);
// set the row in the settings inspector wad browser // set the row in the settings inspector wad browser
c =[wadList count]; c =[wadList count];

View file

@ -5,6 +5,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include "QF/quakeio.h" #include "QF/quakeio.h"
#include "QF/sys.h"
#include "QuakeEd.h" #include "QuakeEd.h"
#include "Clipper.h" #include "Clipper.h"
@ -387,7 +388,7 @@ App delegate methods
//[self doOpen: "/raid/quake/id1_/maps/amlev1.map"]; // DEBUG //[self doOpen: "/raid/quake/id1_/maps/amlev1.map"]; // DEBUG
[map_i newMap]; [map_i newMap];
qprintf ("ready."); Sys_Printf ("ready.");
//malloc_debug(-1); // DEBUG //malloc_debug(-1); // DEBUG
@ -415,14 +416,14 @@ App delegate methods
b =[map_i selectedBrush]; b =[map_i selectedBrush];
if (!b) { if (!b) {
qprintf ("nothing selected"); Sys_Printf ("nothing selected");
return self; return self;
} }
td =[b texturedef]; td =[b texturedef];
qprintf (td->texture); Sys_Printf (td->texture);
return self; return self;
} else } else
qprintf ("Unknown command\n"); Sys_Printf ("Unknown command\n");
return self; return self;
} }
@ -529,7 +530,7 @@ applyRegion:
// get the bounds of the current selection // get the bounds of the current selection
if ([map_i numSelected] != 1) { if ([map_i numSelected] != 1) {
qprintf ("must have a single brush selected"); Sys_Printf ("must have a single brush selected");
return self; return self;
} }
@ -759,7 +760,7 @@ Called by open or the project panel
[self setTitleWithRepresentedFilename: [NSString stringWithCString:fname]]; [self setTitleWithRepresentedFilename: [NSString stringWithCString:fname]];
[self updateAll]; [self updateAll];
qprintf ("%s loaded\n", fname); Sys_Printf ("%s loaded\n", fname);
return self; return self;
} }
@ -892,23 +893,23 @@ keyDown
switch ([theEvent keyCode]) { switch ([theEvent keyCode]) {
case 60: // F2 case 60: // F2
[cameraview_i setDrawMode:dr_wire]; [cameraview_i setDrawMode:dr_wire];
qprintf ("wire draw mode"); Sys_Printf ("wire draw mode");
return self; return self;
case 61: // F3 case 61: // F3
[cameraview_i setDrawMode:dr_flat]; [cameraview_i setDrawMode:dr_flat];
qprintf ("flat draw mode"); Sys_Printf ("flat draw mode");
return self; return self;
case 62: // F4 case 62: // F4
[cameraview_i setDrawMode:dr_texture]; [cameraview_i setDrawMode:dr_texture];
qprintf ("texture draw mode"); Sys_Printf ("texture draw mode");
return self; return self;
case 63: // F5 case 63: // F5
[xyview_i setDrawMode:dr_wire]; [xyview_i setDrawMode:dr_wire];
qprintf ("wire draw mode"); Sys_Printf ("wire draw mode");
return self; return self;
case 64: // F6 case 64: // F6
qprintf ("texture draw mode"); Sys_Printf ("texture draw mode");
return self; return self;
case 66: // F8 case 66: // F8
@ -969,7 +970,7 @@ keyDown
case 13: // enter case 13: // enter
[clipper_i carve]; [clipper_i carve];
[self updateAll]; [self updateAll];
qprintf ("carved brush"); Sys_Printf ("carved brush");
break; break;
case ' ': case ' ':
@ -1020,7 +1021,7 @@ keyDown
break; break;
default: default:
qprintf ("undefined keypress"); Sys_Printf ("undefined keypress");
NopSound (); NopSound ();
break; break;
} }

View file

@ -179,7 +179,7 @@ TEX_InitFromWad (char *path)
QFile *file; QFile *file;
size_t size; size_t size;
start = I_FloatTime (); start = Sys_DoubleTime ();
strcpy (newpath,[preferences_i getProjectPath]); strcpy (newpath,[preferences_i getProjectPath]);
strcat (newpath, "/"); strcat (newpath, "/");
@ -228,9 +228,9 @@ TEX_InitFromWad (char *path)
free (wadfile); free (wadfile);
stop = I_FloatTime (); stop = Sys_DoubleTime ();
qprintf ("loaded %s (%5.1f)", local, stop - start); Sys_Printf ("loaded %s (%5.1f)", local, stop - start);
} }
/* /*
@ -422,7 +422,7 @@ TEX_ForName (char *name)
(takeCurrentTexture)]; (takeCurrentTexture)];
[quakeed_i updateAll]; [quakeed_i updateAll];
} else } else
qprintf ("can't modify spawned entities"); Sys_Printf ("can't modify spawned entities");
} }
[quakeed_i makeFirstResponder:quakeed_i]; [quakeed_i makeFirstResponder:quakeed_i];
return self; return self;

View file

@ -1,3 +1,5 @@
#include "QF/sys.h"
#include "XYView.h" #include "XYView.h"
#include "ZView.h" #include "ZView.h"
#include "CameraView.h" #include "CameraView.h"
@ -790,7 +792,7 @@ NSRect xy_draw_rect;
static float drawtime; // static to shut up compiler warning static float drawtime; // static to shut up compiler warning
if (timedrawing) if (timedrawing)
drawtime = I_FloatTime (); drawtime = Sys_DoubleTime ();
xy_draw_rect = rects; xy_draw_rect = rects;
newrect.origin.x = newrect.origin.y = 99999; newrect.origin.x = newrect.origin.y = 99999;
@ -808,7 +810,7 @@ NSRect xy_draw_rect;
if (timedrawing) { if (timedrawing) {
// NSPing (); // NSPing ();
drawtime = I_FloatTime () - drawtime; drawtime = Sys_DoubleTime () - drawtime;
printf ("CameraView drawtime: %5.3f\n", drawtime); printf ("CameraView drawtime: %5.3f\n", drawtime);
} }
@ -905,10 +907,9 @@ DragCallback (float dx, float dy)
-selectionDragFrom:(NSEvent *) theEvent -selectionDragFrom:(NSEvent *) theEvent
{ {
qprintf ("dragging selection"); Sys_Printf ("dragging selection");
[self dragFrom: theEvent useGrid: YES callback:DragCallback]; [self dragFrom: theEvent useGrid: YES callback:DragCallback];
[quakeed_i updateAll]; [quakeed_i updateAll];
qprintf ("");
return self; return self;
} }
@ -937,9 +938,8 @@ ScrollCallback (float dx, float dy)
-scrollDragFrom:(NSEvent *) theEvent -scrollDragFrom:(NSEvent *) theEvent
{ {
qprintf ("scrolling view"); Sys_Printf ("scrolling view");
[self dragFrom: theEvent useGrid: YES callback:ScrollCallback]; [self dragFrom: theEvent useGrid: YES callback:ScrollCallback];
qprintf ("");
return self; return self;
} }
@ -973,7 +973,7 @@ DirectionCallback (float dx, float dy)
{ {
NSPoint pt; NSPoint pt;
qprintf ("changing camera direction"); Sys_Printf ("changing camera direction");
pt =[theEvent locationInWindow]; pt =[theEvent locationInWindow];
pt =[self convertPoint: pt fromView:NULL]; pt =[self convertPoint: pt fromView:NULL];
@ -984,7 +984,6 @@ DirectionCallback (float dx, float dy)
DirectionCallback (0, 0); DirectionCallback (0, 0);
[self dragFrom: theEvent useGrid: NO callback:DirectionCallback]; [self dragFrom: theEvent useGrid: NO callback:DirectionCallback];
qprintf ("");
return self; return self;
} }
@ -1023,7 +1022,7 @@ NewCallback (float dx, float dy)
texturedef_t td; texturedef_t td;
NSPoint pt; NSPoint pt;
qprintf ("sizing new brush"); Sys_Printf ("sizing new brush");
pt =[theEvent locationInWindow]; pt =[theEvent locationInWindow];
pt =[self convertPoint: pt fromView:NULL]; pt =[self convertPoint: pt fromView:NULL];
@ -1050,7 +1049,6 @@ NewCallback (float dx, float dy)
[newbrush removeIfInvalid]; [newbrush removeIfInvalid];
[quakeed_i updateCamera]; [quakeed_i updateCamera];
qprintf ("");
return self; return self;
} }
@ -1090,7 +1088,7 @@ ControlCallback (float dx, float dy)
if (!numcontrolpoints) if (!numcontrolpoints)
return NO; return NO;
qprintf ("dragging brush plane"); Sys_Printf ("dragging brush plane");
pt =[theEvent locationInWindow]; pt =[theEvent locationInWindow];
pt =[self convertPoint: pt fromView:NULL]; pt =[self convertPoint: pt fromView:NULL];
@ -1101,7 +1099,6 @@ ControlCallback (float dx, float dy)
[quakeed_i updateAll]; [quakeed_i updateAll];
qprintf ("");
return YES; return YES;
} }
@ -1144,7 +1141,7 @@ ControlCallback (float dx, float dy)
if (!numcontrolpoints) if (!numcontrolpoints)
return NO; return NO;
qprintf ("dragging brush plane"); Sys_Printf ("dragging brush plane");
pt =[theEvent locationInWindow]; pt =[theEvent locationInWindow];
pt =[self convertPoint: pt fromView:NULL]; pt =[self convertPoint: pt fromView:NULL];
@ -1154,7 +1151,6 @@ ControlCallback (float dx, float dy)
[br removeIfInvalid]; [br removeIfInvalid];
[quakeed_i updateAll]; [quakeed_i updateAll];
qprintf ("");
return YES; return YES;
} }
@ -1212,7 +1208,7 @@ mouseDown
if (flags == 0) { if (flags == 0) {
// if double click, position Z checker // if double click, position Z checker
if ([theEvent clickCount] > 1) { if ([theEvent clickCount] > 1) {
qprintf ("positioned Z checker"); Sys_Printf ("positioned Z checker");
[zview_i setPoint:&pt]; [zview_i setPoint:&pt];
[quakeed_i newinstance]; [quakeed_i newinstance];
[quakeed_i updateZ]; [quakeed_i updateZ];
@ -1241,7 +1237,7 @@ mouseDown
return[self selectionDragFrom:theEvent]; return[self selectionDragFrom:theEvent];
if ([map_i numSelected]) { if ([map_i numSelected]) {
qprintf ("missed"); Sys_Printf ("missed");
return self; return self;
} }
@ -1255,7 +1251,6 @@ mouseDown
[quakeed_i newinstance]; [quakeed_i newinstance];
[cameraview_i display]; [cameraview_i display];
[cameraview_i XYmouseDown: &pt flags:[theEvent modifierFlags]]; [cameraview_i XYmouseDown: &pt flags:[theEvent modifierFlags]];
qprintf ("");
return self; return self;
} }
// //
@ -1266,11 +1261,10 @@ mouseDown
[self shearDragFrom:theEvent]; [self shearDragFrom:theEvent];
return self; return self;
qprintf ("moving Z checker"); Sys_Printf ("moving Z checker");
[zview_i setXYOrigin:&pt]; [zview_i setXYOrigin:&pt];
[quakeed_i updateAll]; [quakeed_i updateAll];
[zview_i XYmouseDown:&pt]; [zview_i XYmouseDown:&pt];
qprintf ("");
return self; return self;
} }
// //
@ -1278,7 +1272,7 @@ mouseDown
// //
if (flags == NSAlternateKeyMask) { if (flags == NSAlternateKeyMask) {
if (drawmode != dr_texture) { if (drawmode != dr_texture) {
qprintf ("No texture setting except in texture mode!\n"); Sys_Printf ("No texture setting except in texture mode!\n");
NopSound (); NopSound ();
return self; return self;
} }
@ -1291,7 +1285,7 @@ mouseDown
// //
if (flags == (NSControlKeyMask | NSAlternateKeyMask)) { if (flags == (NSControlKeyMask | NSAlternateKeyMask)) {
if (drawmode != dr_texture) { if (drawmode != dr_texture) {
qprintf ("No texture setting except in texture mode!\n"); Sys_Printf ("No texture setting except in texture mode!\n");
NopSound (); NopSound ();
return self; return self;
} }
@ -1300,7 +1294,7 @@ mouseDown
return self; return self;
} }
qprintf ("bad flags for click"); Sys_Printf ("bad flags for click");
NopSound (); NopSound ();
return self; return self;
} }
@ -1334,7 +1328,7 @@ rightMouseDown
return[self directionDragFrom:theEvent]; return[self directionDragFrom:theEvent];
} }
qprintf ("bad flags for click"); Sys_Printf ("bad flags for click");
NopSound (); NopSound ();
return self; return self;

View file

@ -1,3 +1,4 @@
#include "QF/sys.h"
#include "ZView.h" #include "ZView.h"
#include "ZScrollView.h" #include "ZScrollView.h"
@ -587,10 +588,9 @@ ZDragCallback (float dy)
-selectionDragFrom:(NSEvent *) theEvent -selectionDragFrom:(NSEvent *) theEvent
{ {
qprintf ("dragging selection"); Sys_Printf ("dragging selection");
[self dragFrom: theEvent useGrid: YES callback:ZDragCallback]; [self dragFrom: theEvent useGrid: YES callback:ZDragCallback];
[quakeed_i updateCamera]; [quakeed_i updateCamera];
qprintf ("");
return self; return self;
} }
@ -618,9 +618,8 @@ ZScrollCallback (float dy)
-scrollDragFrom:(NSEvent *) theEvent -scrollDragFrom:(NSEvent *) theEvent
{ {
qprintf ("scrolling view"); Sys_Printf ("scrolling view");
[self dragFrom: theEvent useGrid: YES callback:ZScrollCallback]; [self dragFrom: theEvent useGrid: YES callback:ZScrollCallback];
qprintf ("");
return self; return self;
} }
@ -657,7 +656,7 @@ ZControlCallback (float dy)
if (!numcontrolpoints) if (!numcontrolpoints)
return NO; return NO;
qprintf ("dragging brush plane"); Sys_Printf ("dragging brush plane");
pt =[theEvent locationInWindow]; pt =[theEvent locationInWindow];
pt =[self convertPoint: pt fromView:NULL]; pt =[self convertPoint: pt fromView:NULL];
@ -667,7 +666,6 @@ ZControlCallback (float dy)
[[map_i selectedBrush] removeIfInvalid]; [[map_i selectedBrush] removeIfInvalid];
[quakeed_i updateCamera]; [quakeed_i updateCamera];
qprintf ("");
return YES; return YES;
} }
@ -739,7 +737,7 @@ mouseDown
} }
qprintf ("bad flags for click"); Sys_Printf ("bad flags for click");
NopSound (); NopSound ();
return; return;
} }
@ -769,7 +767,7 @@ rightMouseDown
[self scrollDragFrom:theEvent]; [self scrollDragFrom:theEvent];
} }
qprintf ("bad flags for click"); Sys_Printf ("bad flags for click");
NopSound (); NopSound ();
} }