mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
A bit more code cleanup.
This commit is contained in:
parent
1e6cdb4bb8
commit
9cc66c3de1
6 changed files with 25 additions and 52 deletions
|
@ -585,28 +585,18 @@ modalMoveLoop
|
||||||
vec3_t originbase;
|
vec3_t originbase;
|
||||||
NSEvent *event = 0;
|
NSEvent *event = 0;
|
||||||
NSPoint newpt;
|
NSPoint newpt;
|
||||||
|
|
||||||
// NSPoint brushpt;
|
|
||||||
vec3_t delta;
|
vec3_t delta;
|
||||||
|
|
||||||
// id ent;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// vec3_t temp;
|
|
||||||
|
|
||||||
Sys_Printf ("moving camera position\n");
|
Sys_Printf ("moving camera position\n");
|
||||||
|
|
||||||
VectorCopy (origin, originbase);
|
VectorCopy (origin, originbase);
|
||||||
|
|
||||||
//
|
// modal event loop using instance drawing
|
||||||
// modal event loop using instance drawing
|
|
||||||
//
|
|
||||||
goto drawentry;
|
goto drawentry;
|
||||||
|
|
||||||
while ([event type] != NSLeftMouseUp &&[event type] != NSRightMouseUp) {
|
while ([event type] != NSLeftMouseUp &&[event type] != NSRightMouseUp) {
|
||||||
//
|
|
||||||
// calculate new point
|
// calculate new point
|
||||||
//
|
|
||||||
newpt =[event locationInWindow];
|
newpt =[event locationInWindow];
|
||||||
newpt =[converter convertPoint: newpt fromView: NULL];
|
newpt =[converter convertPoint: newpt fromView: NULL];
|
||||||
|
|
||||||
|
@ -618,10 +608,12 @@ modalMoveLoop
|
||||||
origin[i] = originbase[i] + movemod[i] * delta[i];
|
origin[i] = originbase[i] + movemod[i] * delta[i];
|
||||||
|
|
||||||
#if 0 // FIXME
|
#if 0 // FIXME
|
||||||
//
|
|
||||||
// if command is down, look towards brush or entity
|
// if command is down, look towards brush or entity
|
||||||
//
|
|
||||||
if (event->flags & NS_SHIFTMASK) {
|
if (event->flags & NS_SHIFTMASK) {
|
||||||
|
NSPoint brushpt;
|
||||||
|
id ent;
|
||||||
|
vec3_t temp;
|
||||||
|
|
||||||
ent =[quakemap_i selectedEntity];
|
ent =[quakemap_i selectedEntity];
|
||||||
if (ent) {
|
if (ent) {
|
||||||
[ent origin: temp];
|
[ent origin: temp];
|
||||||
|
@ -635,9 +627,7 @@ modalMoveLoop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
drawentry:
|
drawentry:
|
||||||
//
|
|
||||||
// instance draw new frame
|
// instance draw new frame
|
||||||
//
|
|
||||||
[quakeed_i newinstance];
|
[quakeed_i newinstance];
|
||||||
[self display];
|
[self display];
|
||||||
event = [NSApp nextEventMatchingMask: NSLeftMouseUpMask
|
event = [NSApp nextEventMatchingMask: NSLeftMouseUpMask
|
||||||
|
|
|
@ -168,7 +168,6 @@ id project_i;
|
||||||
-initProject
|
-initProject
|
||||||
{
|
{
|
||||||
[self parseProjectFile];
|
[self parseProjectFile];
|
||||||
Sys_Printf ("%p\n", projectInfo);
|
|
||||||
if (projectInfo == NULL)
|
if (projectInfo == NULL)
|
||||||
return self;
|
return self;
|
||||||
[self initVars];
|
[self initVars];
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
-(void)sendEvent:(NSEvent *) evt;
|
-(void)sendEvent:(NSEvent *) evt;
|
||||||
{
|
{
|
||||||
if ([evt type] == NSApplicationDefined) {
|
if ([evt type] == NSApplicationDefined) {
|
||||||
Sys_Printf ("QuakeEdApp sendEvent\n");
|
|
||||||
[quakeed_i applicationDefined: evt];
|
[quakeed_i applicationDefined: evt];
|
||||||
} else {
|
} else {
|
||||||
[super sendEvent:evt];
|
[super sendEvent:evt];
|
||||||
|
|
|
@ -1180,7 +1180,7 @@ ZDrawSelf
|
||||||
|
|
||||||
if (selected) {
|
if (selected) {
|
||||||
[[NSColor redColor] set];
|
[[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];
|
[zview_i getPoint: &p];
|
||||||
|
|
|
@ -1214,23 +1214,20 @@ mouseDown
|
||||||
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
|
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
|
||||||
NSAlternateKeyMask | NSCommandKeyMask);
|
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) {
|
if (flags == NSShiftKeyMask) {
|
||||||
[map_i selectRay: p1: p2:YES];
|
[map_i selectRay: p1: p2:YES];
|
||||||
return self;
|
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)) {
|
if (flags == (NSShiftKeyMask | NSCommandKeyMask)) {
|
||||||
[map_i entityConnect: p1:p2];
|
[map_i entityConnect: p1:p2];
|
||||||
return self;
|
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 (flags == 0) {
|
||||||
// if double click, position Z checker
|
// if double click, position Z checker
|
||||||
if ([theEvent clickCount] > 1) {
|
if ([theEvent clickCount] > 1) {
|
||||||
|
@ -1268,9 +1265,8 @@ mouseDown
|
||||||
|
|
||||||
return[self newBrushDragFrom:theEvent];
|
return[self newBrushDragFrom:theEvent];
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// control click = position and drag camera
|
// control click = position and drag camera
|
||||||
//
|
|
||||||
if (flags == NSControlKeyMask) {
|
if (flags == NSControlKeyMask) {
|
||||||
[cameraview_i setXYOrigin:&pt];
|
[cameraview_i setXYOrigin:&pt];
|
||||||
[quakeed_i newinstance];
|
[quakeed_i newinstance];
|
||||||
|
@ -1278,11 +1274,10 @@ mouseDown
|
||||||
[cameraview_i XYmouseDown: &pt flags:[theEvent modifierFlags]];
|
[cameraview_i XYmouseDown: &pt flags:[theEvent modifierFlags]];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// command click = drag Z checker
|
// command click = drag Z checker
|
||||||
//
|
|
||||||
if (flags == NSCommandKeyMask) {
|
if (flags == NSCommandKeyMask) {
|
||||||
// check single plane dragging
|
// check single plane dragging
|
||||||
[self shearDragFrom:theEvent];
|
[self shearDragFrom:theEvent];
|
||||||
return self;
|
return self;
|
||||||
|
|
||||||
|
@ -1292,9 +1287,8 @@ mouseDown
|
||||||
[zview_i XYmouseDown:&pt];
|
[zview_i XYmouseDown:&pt];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// alt click = set entire brush texture
|
// alt click = set entire brush texture
|
||||||
//
|
|
||||||
if (flags == NSAlternateKeyMask) {
|
if (flags == NSAlternateKeyMask) {
|
||||||
if (drawmode != dr_texture) {
|
if (drawmode != dr_texture) {
|
||||||
Sys_Printf ("No texture setting except in texture mode!\n");
|
Sys_Printf ("No texture setting except in texture mode!\n");
|
||||||
|
@ -1305,9 +1299,8 @@ mouseDown
|
||||||
[quakeed_i updateAll];
|
[quakeed_i updateAll];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// ctrl-alt click = set single face texture
|
// ctrl-alt click = set single face texture
|
||||||
//
|
|
||||||
if (flags == (NSControlKeyMask | NSAlternateKeyMask)) {
|
if (flags == (NSControlKeyMask | NSAlternateKeyMask)) {
|
||||||
if (drawmode != dr_texture) {
|
if (drawmode != dr_texture) {
|
||||||
Sys_Printf ("No texture setting except in texture mode!\n");
|
Sys_Printf ("No texture setting except in texture mode!\n");
|
||||||
|
|
|
@ -789,15 +789,11 @@ modalMoveLoop
|
||||||
|
|
||||||
VectorCopy (origin, originbase);
|
VectorCopy (origin, originbase);
|
||||||
|
|
||||||
//
|
// modal event loop using instance drawing
|
||||||
// modal event loop using instance drawing
|
|
||||||
//
|
|
||||||
goto drawentry;
|
goto drawentry;
|
||||||
|
|
||||||
while ([event type] != NSLeftMouseUp) {
|
while ([event type] != NSLeftMouseUp) {
|
||||||
//
|
|
||||||
// calculate new point
|
// calculate new point
|
||||||
//
|
|
||||||
newpt =[event locationInWindow];
|
newpt =[event locationInWindow];
|
||||||
newpt =[converter convertPoint: newpt fromView:NULL];
|
newpt =[converter convertPoint: newpt fromView:NULL];
|
||||||
|
|
||||||
|
@ -809,10 +805,8 @@ modalMoveLoop
|
||||||
origin[i] = originbase[i] + movemod[i] * delta[i];
|
origin[i] = originbase[i] + movemod[i] * delta[i];
|
||||||
|
|
||||||
|
|
||||||
drawentry:
|
drawentry:
|
||||||
//
|
|
||||||
// instance draw new frame
|
// instance draw new frame
|
||||||
//
|
|
||||||
[quakeed_i newinstance];
|
[quakeed_i newinstance];
|
||||||
[self display];
|
[self display];
|
||||||
|
|
||||||
|
@ -823,10 +817,8 @@ modalMoveLoop
|
||||||
inMode: NSEventTrackingRunLoopMode dequeue:YES];
|
inMode: NSEventTrackingRunLoopMode dequeue:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// draw the brush back into the window buffer
|
||||||
// draw the brush back into the window buffer
|
// [xyview_i display];
|
||||||
//
|
|
||||||
// [xyview_i display];
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue