A bit more code cleanup.

This commit is contained in:
Bill Currie 2010-09-26 22:45:26 +09:00
parent 1e6cdb4bb8
commit 9cc66c3de1
6 changed files with 25 additions and 52 deletions

View File

@ -585,28 +585,18 @@ modalMoveLoop
vec3_t originbase;
NSEvent *event = 0;
NSPoint newpt;
// NSPoint brushpt;
vec3_t delta;
// id ent;
int i;
// vec3_t temp;
Sys_Printf ("moving camera position\n");
VectorCopy (origin, originbase);
//
// modal event loop using instance drawing
//
// modal event loop using instance drawing
goto drawentry;
while ([event type] != NSLeftMouseUp &&[event type] != NSRightMouseUp) {
//
// calculate new point
//
newpt =[event locationInWindow];
newpt =[converter convertPoint: newpt fromView: NULL];
@ -618,10 +608,12 @@ modalMoveLoop
origin[i] = originbase[i] + movemod[i] * delta[i];
#if 0 // FIXME
//
// if command is down, look towards brush or entity
//
if (event->flags & NS_SHIFTMASK) {
NSPoint brushpt;
id ent;
vec3_t temp;
ent =[quakemap_i selectedEntity];
if (ent) {
[ent origin: temp];
@ -635,9 +627,7 @@ modalMoveLoop
#endif
drawentry:
//
// instance draw new frame
//
[quakeed_i newinstance];
[self display];
event = [NSApp nextEventMatchingMask: NSLeftMouseUpMask

View File

@ -168,7 +168,6 @@ id project_i;
-initProject
{
[self parseProjectFile];
Sys_Printf ("%p\n", projectInfo);
if (projectInfo == NULL)
return self;
[self initVars];

View File

@ -13,7 +13,6 @@
-(void)sendEvent:(NSEvent *) evt;
{
if ([evt type] == NSApplicationDefined) {
Sys_Printf ("QuakeEdApp sendEvent\n");
[quakeed_i applicationDefined: evt];
} else {
[super sendEvent:evt];

View File

@ -1180,7 +1180,7 @@ ZDrawSelf
if (selected) {
[[NSColor redColor] set];
NSFrameRect (NSMakeRect (1, bmins[2], 24, bmaxs[2] - bmins[2] + 1));
NSFrameRect (NSMakeRect (1, bmins[2], 24, bmaxs[2] - bmins[2]));
}
[zview_i getPoint: &p];

View File

@ -1214,23 +1214,20 @@ mouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
//
// shift click to select / deselect a brush from the world
//
// shift click to select / deselect a brush from the world
if (flags == NSShiftKeyMask) {
[map_i selectRay: p1: p2:YES];
return self;
}
//
// cmd-shift click to set a target/targetname entity connection
//
// cmd-shift click to set a target/targetname entity connection
if (flags == (NSShiftKeyMask | NSCommandKeyMask)) {
[map_i entityConnect: p1:p2];
return self;
}
//
// bare click to either drag selection, or rubber band a new brush
//
// bare click to either drag selection, or rubber band a new brush
if (flags == 0) {
// if double click, position Z checker
if ([theEvent clickCount] > 1) {
@ -1268,9 +1265,8 @@ mouseDown
return[self newBrushDragFrom:theEvent];
}
//
// control click = position and drag camera
//
// control click = position and drag camera
if (flags == NSControlKeyMask) {
[cameraview_i setXYOrigin:&pt];
[quakeed_i newinstance];
@ -1278,11 +1274,10 @@ mouseDown
[cameraview_i XYmouseDown: &pt flags:[theEvent modifierFlags]];
return self;
}
//
// command click = drag Z checker
//
// command click = drag Z checker
if (flags == NSCommandKeyMask) {
// check single plane dragging
// check single plane dragging
[self shearDragFrom:theEvent];
return self;
@ -1292,9 +1287,8 @@ mouseDown
[zview_i XYmouseDown:&pt];
return self;
}
//
// alt click = set entire brush texture
//
// alt click = set entire brush texture
if (flags == NSAlternateKeyMask) {
if (drawmode != dr_texture) {
Sys_Printf ("No texture setting except in texture mode!\n");
@ -1305,9 +1299,8 @@ mouseDown
[quakeed_i updateAll];
return self;
}
//
// ctrl-alt click = set single face texture
//
// ctrl-alt click = set single face texture
if (flags == (NSControlKeyMask | NSAlternateKeyMask)) {
if (drawmode != dr_texture) {
Sys_Printf ("No texture setting except in texture mode!\n");

View File

@ -789,15 +789,11 @@ modalMoveLoop
VectorCopy (origin, originbase);
//
// modal event loop using instance drawing
//
// modal event loop using instance drawing
goto drawentry;
while ([event type] != NSLeftMouseUp) {
//
// calculate new point
//
newpt =[event locationInWindow];
newpt =[converter convertPoint: newpt fromView:NULL];
@ -809,10 +805,8 @@ modalMoveLoop
origin[i] = originbase[i] + movemod[i] * delta[i];
drawentry:
//
drawentry:
// instance draw new frame
//
[quakeed_i newinstance];
[self display];
@ -823,10 +817,8 @@ modalMoveLoop
inMode: NSEventTrackingRunLoopMode dequeue:YES];
}
//
// draw the brush back into the window buffer
//
// [xyview_i display];
// draw the brush back into the window buffer
// [xyview_i display];
return self;
}