Do a bit of comment cleanup.

This commit is contained in:
Bill Currie 2010-10-11 21:11:33 +09:00
parent a9987467ec
commit 9daf527afd
17 changed files with 93 additions and 311 deletions

View file

@ -271,14 +271,14 @@ MakeCampt (vec3_t in, campt_t * pt)
vec3_t temp;
float scale;
// transform the points
// transform the points
VectorSubtract (in, r_origin, temp);
pt->trans[0] = DotProduct (temp, r_matrix[0]);
pt->trans[1] = DotProduct (temp, r_matrix[1]);
pt->trans[2] = DotProduct (temp, r_matrix[2]);
// check clip flags
// check clip flags
if (pt->trans[2] < 1)
pt->clipflags = CLIP_FRONT;
else
@ -409,9 +409,7 @@ drawSolid
{
unsigned char *planes[5];
//
// draw it
//
// draw it
VectorCopy (origin, r_origin);
VectorCopy (matrix[0], r_matrix[0]);
VectorCopy (matrix[1], r_matrix[1]);
@ -427,14 +425,10 @@ drawSolid
REN_BeginCamera ();
REN_ClearBuffers ();
//
// render the setbrushes
//
// render the setbrushes
[map_i makeAllPerform: @selector (CameraRenderSelf)];
//
// display the output
//
// display the output
[[self window] setBackingType: NSBackingStoreRetained];
planes[0] = (unsigned char *) imagebuffer;
@ -707,15 +701,11 @@ viewDrag:
NSEvent *event = 0;
NSPoint newpt;
//
// modal event loop using instance drawing
//
// modal event loop using instance drawing
goto drawentry;
while ([event type] != NSRightMouseUp) {
//
// calculate new point
//
newpt = [event locationInWindow];
newpt = [self convertPoint: newpt fromView: NULL];
@ -780,31 +770,24 @@ mouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
//
// bare click to select a texture
//
// bare click to select a texture
if (flags == 0) {
[map_i getTextureRay: p1 : p2];
return;
}
//
// 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 : NO];
return;
}
//
// 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;
}
//
// 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");
@ -815,9 +798,8 @@ mouseDown
[quakeed_i updateAll];
return;
}
//
// 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");
@ -853,9 +835,7 @@ rightMouseDown
& (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask
| NSCommandKeyMask);
//
// click = drag camera
//
// click = drag camera
if (flags == 0) {
Sys_Printf ("looking\n");
[self viewDrag: &pt];

View file

@ -91,7 +91,7 @@ XYClick
new[1] = [xyview_i snapToGrid: pt.y];
new[2] = [map_i currentMinZ];
// see if a point is allready there
// see if a point is allready there
for (i = 0; i < num; i++) {
if (new[0] == pos[i][0] && new[1] == pos[i][1]) {
if (pos[i][2] == [map_i currentMinZ])

View file

@ -71,9 +71,6 @@ JDC
//
// ===============================================
//
// Write a { } block out to a FILE*
//
- (id) writeBlockTo: (FILE *)fp
{
char *data;
@ -85,9 +82,6 @@ JDC
return self;
}
//
// Write a single { } block out
//
- (id) writeFile: (const char *)path
{
FILE *fp;
@ -112,9 +106,7 @@ JDC
//
// ===============================================
//
// Change a keyword's string
//
- (id) changeStringFor: (const char *)key to: (const char *)value
{
PL_D_AddObject (plist, key, PL_NewString (value));
@ -130,9 +122,7 @@ JDC
return 0;
}
//
// Search for keyword, return the string *
//
- (const char *) getStringFor: (const char *)name
{
plitem_t *item;
@ -144,17 +134,13 @@ JDC
return "";
}
//
// Search for keyword, return the value
//
- (unsigned int) getValueFor: (const char *)name
{
return atol ([self getStringFor: name]);
}
//
// Return # of units in keyword's value
//
- (int) getValueUnits: (const char *)key
{
plitem_t *item;

View file

@ -5,9 +5,8 @@
#include "THING+NSArray.m"
@implementation DictList
//
// Read in variable # of objects from FILE *
//
- (id) initListFromFile: (FILE *)fp
{
id d;
@ -24,9 +23,7 @@
return self;
}
//
// Write out list file
//
- (id) writeListFile: (const char *)filename
{
FILE *fp;
@ -47,9 +44,7 @@
return self;
}
//
// Find the keyword in all the Dict objects
//
- (id) findDictKeyword: (const char *)key
{
NSUInteger i;

View file

@ -25,7 +25,7 @@ vec3_t bad_maxs = {8, 8, 8};
id new;
texturedef_t td;
// get class
// get class
new = [entity_classes_i classForName: [self valueForQKey: "classname"]];
if (new) {
v = [new mins];
@ -349,7 +349,7 @@ int nument;
nument++;
// get class
// get class
spawn = [self valueForQKey: "classname"];
eclass = [entity_classes_i classForName: spawn];

View file

@ -90,11 +90,11 @@ parse_vector (script_t * script, vec3_t vec)
while (Script_TokenAvailable (script, 0))
Script_GetToken (script, 0);
// find the length until close comment
// find the length until close comment
for (t = script->p; t[0] && !(t[0] == '*' && t[1] == '/'); t++)
;
// copy the comment block out
// copy the comment block out
len = t - text;
comments = malloc (len + 1);
memcpy (comments, text, len);

View file

@ -82,18 +82,14 @@ InspectorControl *inspcontrol_i;
[self setCurrentInspector: i_project];
}
//
// Sent by the PopUpList in the Inspector
// Each cell in the PopUpList must have the correct tag
//
- (IBAction) changeInspector: sender
{
[self setCurrentInspector: [sender selectedTag]];
}
//
// Change to specific Inspector
//
- (void) setCurrentInspector: (insp_e)which
{
id newView;

View file

@ -756,7 +756,7 @@ sel_identity (void)
Sys_Printf ("can't modify spawned entities\n");
return self;
}
// find an origin to apply the transformation to
// find an origin to apply the transformation to
sb_mins[0] = sb_mins[1] = sb_mins[2] = 99999;
sb_maxs[0] = sb_maxs[1] = sb_maxs[2] = -99999;
[self makeSelectedPerform: @selector (addToBBox)];
@ -764,7 +764,7 @@ sel_identity (void)
sel_org[1] = [xyview_i snapToGrid: (sb_mins[1] + sb_maxs[1]) / 2];
sel_org[2] = [xyview_i snapToGrid: (sb_mins[2] + sb_maxs[2]) / 2];
// do it!
// do it!
[self makeSelectedPerform: @selector (transform)];
[quakeed_i updateAll];

View file

@ -49,9 +49,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return self;
}
//
// Read in at start of program
//
- (id) readDefaults
{
[self setProjectPath: [prefs stringForKey: @"ProjectPath"]];
@ -90,13 +88,11 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return projectpath;
}
//
// ===============================================
// BSP sound stuff
// ===============================================
//
// Set the BSP sound using an OpenPanel
//
- (id) setBspSound: sender
{
id panel;
@ -124,18 +120,14 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return self;
}
//
// Play the BSP sound
//
- (id) playBspSound
{
[bspSound_i play];
return self;
}
//
// Set the bspSound path
//
- (id) setBspSoundPath: (NSString *)path
{
@ -165,9 +157,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
// Show BSP Output management
// ===============================================
//
// Set the state
//
- (id) setShowBSP: (int)state
{
showBSP = state;
@ -177,9 +167,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return self;
}
//
// Get the state
//
- (int) getShowBSP
{
return showBSP;
@ -189,9 +177,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
// "Offset Brush ..." management
// ===============================================
//
// Set the state
//
- (id) setBrushOffset: (int)state
{
brushOffset = state;
@ -200,9 +186,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return self;
}
//
// Get the state
//
- (int) getBrushOffset
{
return brushOffset;
@ -234,7 +218,6 @@ WriteNumericDefault (id prefs, NSString *name, float value)
// ===============================================
//
// Set the state
//
- (id) setXlight: (float)value
{
xlight = value;
@ -268,9 +251,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
return self;
}
//
// Get the state
//
- (float) getXlight
{
return [xlight_i floatValue];

View file

@ -86,9 +86,7 @@ id project_i;
return self;
}
//
// Init Project Settings fields
//
- (id) initProjSettings
{
[pis_basepath_i setStringValue: path_basepath];
@ -101,9 +99,7 @@ id project_i;
return self;
}
//
// Add text to the BSP Output window
//
- (id) addToOutput: (const char *)string
{
int end;
@ -151,10 +147,8 @@ id project_i;
return self;
}
//
// Fill the QuakeEd Maps or wads browser
// (Delegate method - delegated in Interface Builder)
//
- (void) browser: sender createRowsForColumn: (int)column inMatrix: matrix
{
id cell;
@ -183,9 +177,7 @@ id project_i;
}
}
//
// Clicked on a map name or description!
//
- (id) clickedOnMap: sender
{
id matrix;
@ -223,7 +215,7 @@ id project_i;
Sys_Printf ("loading %s\n", wf);
// set the row in the settings inspector wad browser
// set the row in the settings inspector wad browser
c = PL_A_NumObjects (wadList);
for (i = 0; i < c; i++) {
name = PL_String (PL_ObjectAtIndex (wadList, i));
@ -233,7 +225,7 @@ id project_i;
}
}
// update the texture inspector
// update the texture inspector
[texturepalette_i initPaletteFromWadfile: wf];
[[map_i objectAtIndex: 0] setKey: "wad" toValue: wf];
// [inspcontrol_i changeInspectorTo:i_textures];
@ -243,9 +235,7 @@ id project_i;
return self;
}
//
// Clicked on a wad name
//
- (id) clickedOnWad: sender
{
id matrix;
@ -261,9 +251,7 @@ id project_i;
return self;
}
//
// Read in the <name>.QE_Project file
//
- (id) parseProjectFile
{
NSString *path;
@ -285,9 +273,7 @@ id project_i;
return self;
}
//
// Loads and parses a project file
//
- (id) openProjectFile: (NSString *)path
{
FILE *fp;
@ -317,9 +303,7 @@ id project_i;
return path_projectinfo;
}
//
// Open a project file
//
- (id) openProject
{
id openpanel;
@ -364,9 +348,7 @@ id project_i;
return path_progdir;
}
//
// Return the WAD name for cmd-8
//
- (const char *) getWAD8
{
if (!path_wad8[0])
@ -375,9 +357,7 @@ id project_i;
return path_wad8;
}
//
// Return the WAD name for cmd-9
//
- (const char *) getWAD9
{
if (!path_wad9[0])
@ -386,9 +366,7 @@ id project_i;
return path_wad9;
}
//
// Return the WAD name for cmd-0
//
- (const char *) getWAD0
{
if (!path_wad0[0])
@ -397,9 +375,7 @@ id project_i;
return path_wad0;
}
//
// Return the FULLVIS cmd string
//
- (const char *) getFullVisCmd
{
if (!string_fullvis[0])
@ -408,9 +384,7 @@ id project_i;
return string_fullvis;
}
//
// Return the FASTVIS cmd string
//
- (const char *) getFastVisCmd
{
if (!string_fastvis[0])
@ -419,9 +393,7 @@ id project_i;
return string_fastvis;
}
//
// Return the NOVIS cmd string
//
- (const char *) getNoVisCmd
{
if (!string_novis[0])
@ -430,9 +402,7 @@ id project_i;
return string_novis;
}
//
// Return the RELIGHT cmd string
//
- (const char *) getRelightCmd
{
if (!string_relight[0])
@ -441,9 +411,7 @@ id project_i;
return string_relight;
}
//
// Return the LEAKTEST cmd string
//
- (const char *) getLeaktestCmd
{
if (!string_leaktest[0])

View file

@ -130,7 +130,7 @@ Every five minutes, save a modified map
*/
- (void) AutoSave
{
// automatic backup
// automatic backup
if (autodirty) {
autodirty = NO;
#define FN_AUTOSAVE "/qcache/AutoSaveMap.map"
@ -317,8 +317,8 @@ instance draw the brush after each flush
[cameraview_i lockFocus];
linestart (0, 0, 0);
[map_i makeSelectedPerform: @selector (CameraDrawSelf)];
[clipper_i cameraDrawSelf];
lineflush ();
[clipper_i cameraDrawSelf];
[cameraview_i unlockFocus];
[xyview_i lockFocus];
@ -387,8 +387,6 @@ App delegate methods
[self enableFlushWindow];
[self flushWindow];
// NSPing ();
return self;
}
@ -442,11 +440,9 @@ App delegate methods
[self makeKeyAndOrderFront: self];
// [self doOpen: "/raid/quake/id1_/maps/amlev1.map"]; // DEBUG
[map_i newMap];
Sys_Printf ("ready.\n");
// malloc_debug(-1); // DEBUG
}
- (id) appWillTerminate: sender
@ -575,8 +571,7 @@ applyRegion:
{
id b;
// get the bounds of the current selection
// get the bounds of the current selection
if ([map_i numSelected] != 1) {
Sys_Printf ("must have a single brush selected\n");
return self;
@ -586,7 +581,7 @@ applyRegion:
[b getMins: region_min maxs: region_max];
[b remove];
// turn region on
// turn region on
[regionbutton_i setIntValue: 1];
[self applyRegion: self];
@ -597,7 +592,7 @@ applyRegion:
{
NSRect bounds;
// get xy size
// get xy size
bounds = [[xyview_i superview] bounds];
region_min[0] = bounds.origin.x;
@ -607,16 +602,14 @@ applyRegion:
region_max[1] = bounds.origin.y + bounds.size.height;
region_max[2] = 99999;
// turn region on
// turn region on
[regionbutton_i setIntValue: 1];
[self applyRegion: self];
return self;
}
//
// UI querie for other objects
//
- (BOOL) showCoordinates
{
return [show_coordinates_i intValue];
@ -672,9 +665,8 @@ saveBSP
NSBeep ();
return self;
}
//
// turn off the filters so all entities get saved
//
// turn off the filters so all entities get saved
oldLightFilter = [filter_light_i intValue];
oldPathFilter = [filter_path_i intValue];
[filter_light_i setIntValue: 0];
@ -696,9 +688,7 @@ saveBSP
[filter_path_i setIntValue: oldPathFilter];
[self applyRegion: self];
//
// write the command to the bsp host
//
// write the command to the bsp host
destdir = [project_i getFinalMapDirectory];
bsppath = [destdir stringByAppendingPathComponent:
@ -841,7 +831,7 @@ save:
{
NSString *backup;
// force a name change if using tempname
// force a name change if using tempname
if (![filename compare: FN_TEMPSAVE])
return [self saveAs: self];
dirty = autodirty = NO;
@ -891,9 +881,7 @@ saveAs
===============================================================================
*/
//
// AJR - added this for Project info
//
- (NSString *) currentFilename
{
return filename;
@ -924,9 +912,7 @@ keyDown
NSString *chars = [theEvent characters];
unichar c = ([chars length] == 1) ? [chars characterAtIndex: 0] : '\0';
//
// function keys
//
// function keys
switch (c) {
case NSF2FunctionKey:
[cameraview_i setDrawMode: dr_wire];
@ -1016,9 +1002,7 @@ keyDown
[map_i cloneSelection: self];
break;
//
// move selection keys
//
// move selection keys
case '2':
VectorCopy (vec3_origin, sb_translate);
sb_translate[1] = -[xyview_i gridsize];

View file

@ -1610,7 +1610,7 @@ Set the regioned flag based on if the object is containted in region_min/max
int i;
const char *name;
// filter away entities
// filter away entities
if (parent != [map_i objectAtIndex: 0]) {
if (filter_entities) {
regioned = YES;
@ -1708,7 +1708,7 @@ id sb_newowner;
[parent removeObject: self];
parent = sb_newowner;
// hack to allow them to be copied to another map
// hack to allow them to be copied to another map
if ([parent respondsToSelector: @selector (valueForQKey:)]) {
eclass = [entity_classes_i classForName: [parent valueForQKey: "classname"]];
c = [eclass drawColor];
@ -1724,7 +1724,7 @@ vec3_t sb_translate;
{
int i, j;
// move the planes
// move the planes
for (i = 0; i < numfaces; i++) {
for (j = 0; j < 3; j++)
VectorAdd (faces[i].planepts[j], sb_translate, faces[i].planepts[j]);
@ -1770,7 +1770,7 @@ vec3_t sb_mins, sb_maxs;
{
selected = NO;
// the last selected brush determines
// the last selected brush determines
if (invalid)
printf ("WARNING: deselected invalid brush\n");
[map_i setCurrentMinZ: bmins[2]];
@ -1779,7 +1779,7 @@ vec3_t sb_mins, sb_maxs;
- (void) remove
{
// the last selected brush determines
// the last selected brush determines
if (!invalid) {
[map_i setCurrentMinZ: bmins[2]];
[map_i setCurrentMaxZ: bmaxs[2]];
@ -1902,7 +1902,7 @@ id carve_in, carve_out;
numfaces++;
[self calcWindings];
// remove any degenerate faces
// remove any degenerate faces
return [self removeIfInvalid];
}

View file

@ -470,15 +470,13 @@ TEX_ForName (const char *name)
return self;
}
//
// Set the selected texture
//
- (id) setSelectedTexture: (int)which
{
texpal_t *t;
NSRect r;
// wipe the fields
// wipe the fields
[self clearTexinfo: self];
if (which != selectedTexture) {
@ -503,18 +501,14 @@ TEX_ForName (const char *name)
return self;
}
//
// Return the selected texture index
//
- (int) getSelectedTexture
{
return selectedTexture;
}
//
// Return the original tex_ index of the selected texture
// so the texture info can be indexed from tex_images, etc.
//
- (int) getSelectedTexIndex
{
texpal_t *t;
@ -525,9 +519,7 @@ TEX_ForName (const char *name)
return t->index;
}
//
// Return the name of the selected texture
//
- (const char *) getSelTextureName
{
texpal_t *t;
@ -538,9 +530,7 @@ TEX_ForName (const char *name)
return t->name;
}
//
// Set selected texture by texture name
//
- (id) setTextureByName: (const char *)name
{
texpal_t *t;
@ -568,9 +558,7 @@ TEX_ForName (const char *name)
//
// ===================================================
//
// Search for texture named in searchField
//
- (id) searchForTexture: sender
{
int i;
@ -614,9 +602,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Set texture def from outside TexturePalette
//
- (id) setTextureDef: (texturedef_t *)td
{
[self setTextureByName: td->texture];
@ -632,9 +618,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Return the current texture def to passed *
//
- (id) getTextureDef: (texturedef_t *)td
{
if (selectedTexture == -1) {
@ -656,9 +640,7 @@ TEX_ForName (const char *name)
// ============================================================================
//
// Change value in a field
//
- (id) changeField: (id)
field by: (int)amount
{
@ -673,9 +655,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Inc/Dec the XShift field
//
- (id) incXShift: sender
{
[self changeField: field_Xshift_i by: 8];
@ -688,9 +668,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Inc/Dec the YShift field
//
- (id) incYShift: sender
{
[self changeField: field_Yshift_i by: 8];
@ -703,9 +681,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Inc/Dec the Rotate field
//
- (id) incRotate: sender
{
[self changeField: field_Rotate_i by: 90];
@ -718,9 +694,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Inc/Dec the Xscale field
//
- (id) incXScale: sender
{
[field_Xscale_i setIntValue: 1];
@ -735,9 +709,7 @@ TEX_ForName (const char *name)
return self;
}
//
// Inc/Dec the Yscale field
//
- (id) incYScale: sender
{
[field_Yscale_i setIntValue: 1];
@ -754,10 +726,8 @@ TEX_ForName (const char *name)
// ============================================================================
//
// Search for texture in entire palette
// Return index of texturedef, or -1 if unsuccessful
//
- (int) searchForTextureInPalette: (const char *)texture
{
int i;
@ -777,9 +747,7 @@ TEX_ForName (const char *name)
return -1;
};
//
// Scan thru map & display only textures that are in map
//
- (id) onlyShowMapTextures: sender
{
int max;

View file

@ -29,9 +29,7 @@ id things_i;
[flags_i deselectAllCells];
}
//
// Load the TEXT object with the entity comment
//
- (id) loadEntityComment: (id)obj
{
[entity_comment_i selectAll: self];
@ -85,9 +83,7 @@ id things_i;
return [[entity_classes_i objectAtIndex: lastSelected] classname];
}
//
// Flush entity classes & reload them!
//
- (id) reloadEntityClasses: sender
{
EntityClass *ent;
@ -179,9 +175,7 @@ id things_i;
return self;
}
//
// Clicked in the Keypair view - set as selected
//
- (id) setSelectedKey: (epair_t *)ep;
{
[keyInput_i setStringValue: [NSString stringWithCString: ep->key]];
@ -199,9 +193,7 @@ id things_i;
return self;
}
//
// Action methods
//
- (id) addPair: sender
{
@ -237,9 +229,7 @@ id things_i;
return self;
}
//
// Set the key/value fields to "angle <button value>"
//
- (id) setAngle: sender
{
NSString *value;
@ -289,10 +279,8 @@ id things_i;
return self;
}
//
// Fill the Entity browser
// (Delegate method - delegated in Interface Builder)
//
- (void) browser: sender
createRowsForColumn: (int)column
inMatrix: matrix

View file

@ -67,9 +67,7 @@ initWithFrame:
xy_viewnormal[2] = -1;
xy_viewdist = -1024;
//
// initialize the pop up menus
//
// initialize the pop up menus
scalebutton_i = [[NSPopUpButton alloc] init];
[scalebutton_i setTarget: self];
[scalebutton_i setAction: @selector (scaleMenuTarget:)];
@ -97,9 +95,7 @@ initWithFrame:
[gridbutton_i sizeToFit];
[gridbutton_i selectItemAtIndex: 4];
//
// initialize the scroll view
//
// initialize the scroll view
scrollview_i = [[PopScrollView alloc] initWithFrame: frameRect
button1: scalebutton_i
button2: gridbutton_i];
@ -107,9 +103,7 @@ initWithFrame:
[scrollview_i setAutoresizingMask: (NSViewWidthSizable |
NSViewHeightSizable)];
//
// link objects together
//
// link objects together
[scrollview_i setDocumentView: self];
return scrollview_i;
}
@ -313,9 +307,7 @@ zoomIn
NSRect visrect;
NSPoint ofs, new;
//
// set the popup
//
// set the popup
itemlist = [scalebutton_i itemArray];
numrows = [itemlist count];
@ -325,9 +317,7 @@ zoomIn
return NULL;
[scalebutton_i selectItemAtIndex: selected];
//
// zoom the view
//
// zoom the view
visrect = [[self superview] bounds];
ofs.x = constant->x - visrect.origin.x;
ofs.y = constant->y - visrect.origin.y;
@ -353,9 +343,7 @@ zoomOut
NSRect visrect;
NSPoint ofs, new;
//
// set the popup
//
// set the popup
itemlist = [scalebutton_i itemArray];
selectedItem = [scalebutton_i selectedItem];
@ -365,9 +353,7 @@ zoomOut
[scalebutton_i selectItemAtIndex: selected];
//
// zoom the view
//
// zoom the view
visrect = [[self superview] bounds];
ofs.x = constant->x - visrect.origin.x;
ofs.y = constant->y - visrect.origin.y;
@ -549,12 +535,10 @@ Rect is in global world (unscaled) coordinates
[path removeAllPoints];
[path setLineWidth: 0.15];
//
// grid
//
// can't just divide by grid size because of negetive coordinate
// truncating direction
//
// grid
//
// can't just divide by grid size because of negetive coordinate
// truncating direction
if (gridsize >= 4 / scale) {
y = floor (bottom / gridsize);
stopy = floor (top / gridsize);
@ -607,9 +591,7 @@ Rect is in global world (unscaled) coordinates
[path stroke];
}
//
// tiles
//
// tiles
// for text
[[NSColor colorWithCalibratedWhite: 0.0 / 16.0 alpha: 1.0] set];
@ -798,7 +780,6 @@ drawSolid
NSDrawBitmap (visRect, r_width, r_height, 8, 3, 32, r_width * 4, NO, NO,
NSCalibratedRGBColorSpace, planes);
// NSPing ();
[[self window] setBackingType: NSBackingStoreBuffered];
[self unlockFocus];
@ -1140,7 +1121,7 @@ ControlCallback (float dx, float dy)
pt = [theEvent locationInWindow];
pt = [self convertPoint: pt fromView: NULL];
// if the XY point is inside the brush, make the point on top
// if the XY point is inside the brush, make the point on top
p1[0] = pt.x;
p1[1] = pt.y;
VectorCopy (p1, p2);

View file

@ -44,9 +44,7 @@ initWithFrame:
zview_i = self;
scale = 1;
//
// initialize the pop up menus
//
// initialize the pop up menus
zscalebutton_i = [[NSPopUpButton alloc] init];
[zscalebutton_i setTarget: self];
[zscalebutton_i setAction: @selector (scaleMenuTarget:)];
@ -60,7 +58,7 @@ initWithFrame:
[zscalebutton_i addItemWithTitle: @"300%"];
[zscalebutton_i selectItemAtIndex: 4];
// initialize the scroll view
// initialize the scroll view
zscrollview_i = [[ZScrollView alloc]
initWithFrame: frameRect
button1: zscalebutton_i];
@ -299,9 +297,7 @@ Rect is in global world (unscaled) coordinates
bottom = rect.origin.y - 1;
top = rect.origin.y + rect.size.height + 2;
//
// grid
//
// grid
// can't just divide by grid size because of negetive coordinate
// truncating direction
@ -330,9 +326,7 @@ Rect is in global world (unscaled) coordinates
[path stroke];
}
//
// half tiles
//
// half tiles
y = floor (bottom / 32);
stopy = floor (top / 32);
@ -354,9 +348,7 @@ Rect is in global world (unscaled) coordinates
set];
[path stroke];
//
// tiles
//
// tiles
y = floor (bottom / 64);
stopy = floor (top / 64);
@ -388,9 +380,7 @@ Rect is in global world (unscaled) coordinates
[[NSColor colorWithCalibratedWhite: 10.0 / 16.0 alpha: 1.0] set];
[path stroke];
//
// origin
//
// origin
[[NSColor colorWithCalibratedWhite: 4.0 / 16.0 alpha: 1.0] set];
[path removeAllPoints];
[path setLineWidth: 5];
@ -426,25 +416,25 @@ drawSelf
minheight = 999999;
maxheight = -999999;
// allways draw the entire bar
// allways draw the entire bar
// visRect =[self visibleRect];
rect = [self visibleRect];
[quakeed_i zNoRestore: rect];
// erase window
// erase window
NSEraseRect (rect);
// draw grid
// draw grid
[self drawGrid: rect];
// draw zplane
// draw zplane
// [self drawZplane]; FIXME zplane doesn't do anything yet
// draw all entities
// draw all entities
[map_i makeUnselectedPerform: @selector (ZDrawSelf)];
// possibly resize the view
// possibly resize the view
[self newRealBounds];
}
@ -667,34 +657,29 @@ 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: p1: NO];
return;
}
//
// alt click = set entire brush texture
//
// alt click = set entire brush texture
if (flags == NSAlternateKeyMask) {
[map_i setTextureRay: p1: p1: YES];
return;
}
//
// control click = position view
//
// control click = position view
if (flags == NSControlKeyMask) {
[cameraview_i setZOrigin: pt.y];
[quakeed_i updateAll];
[cameraview_i ZmouseDown: &pt flags: [theEvent modifierFlags]];
return;
}
//
// bare click to drag icons or new brush drag
//
// bare click to drag icons or new brush drag
if (flags == 0) {
// check eye
// check eye
if ([cameraview_i ZmouseDown: &pt flags: [theEvent modifierFlags]])
return;
if ([map_i numSelected]) {
@ -729,9 +714,7 @@ rightMouseDown
[theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask |
NSAlternateKeyMask | NSCommandKeyMask);
//
// click = scroll view
//
// click = scroll view
if (flags == 0)
[self scrollDragFrom: theEvent];
Sys_Printf ("bad flags for click\n");

View file

@ -141,7 +141,7 @@ REN_DrawSpan (int y)
x2 = r_width;
ofs = y * r_width + x1;
// this should be specialized for 1.0 / 0.5 / 0.75 light levels
// this should be specialized for 1.0 / 0.5 / 0.75 light levels
for (x = x1; x < x2; x++) {
if (r_zbuffer[ofs] <= zfrac) {
scale = 1 / zfrac;
@ -213,7 +213,7 @@ REN_DrawFlatSpan (int y)
ofs = y * r_width + x1;
// this should be specialized for 1.0 / 0.5 / 0.75 light levels
// this should be specialized for 1.0 / 0.5 / 0.75 light levels
for (x = x1; x < x2; x++) {
if (r_zbuffer[ofs] <= zfrac) {
r_zbuffer[ofs] = zfrac;
@ -241,9 +241,7 @@ REN_RasterizeFace (winding_t * w)
int count;
int numvertex;
//
// find top vertex
//
// find top vertex
numvertex = w->numpoints;
top = 0x7fffffff;
bot = 0x80000000;
@ -267,9 +265,7 @@ REN_RasterizeFace (winding_t * w)
if (top < 0 || bot > r_height || top > bot)
return; // shouldn't have to have this...
//
// render a trapezoid
//
// render a trapezoid
y = top;
while (y < bot) {
@ -407,9 +403,7 @@ REN_RasterizeFaceLinear (winding_t * w)
int count;
int numvertex;
//
// find top vertex
//
// find top vertex
numvertex = w->numpoints;
top = 0x7fffffff;
bot = 0x80000000;
@ -430,9 +424,7 @@ REN_RasterizeFaceLinear (winding_t * w)
if (top < 0 || bot > r_height || top > bot)
return; // shouldn't have to have this...
//
// render a trapezoid
//
// render a trapezoid
y = top;
while (y < bot) {
@ -564,15 +556,11 @@ REN_DrawCameraFace (face_t * idpol)
r_face = idpol;
//
// back face cull
//
// back face cull
if (DotProduct (r_origin, idpol->plane.normal) <= idpol->plane.dist)
return;
//
// transform in 3D (FIXME: clip first, then transform)
//
// transform in 3D (FIXME: clip first, then transform)
in = idpol->w;
numvertex = in->numpoints;
@ -589,18 +577,14 @@ REN_DrawCameraFace (face_t * idpol)
w->points[i][4] = in->points[i][4];
}
//
// 3D clip
//
// 3D clip
for (i = 0; i < 4; i++) {
w = ClipWinding (w, &rfrustum[i]);
if (!w)
return;
}
//
// project to 2D
//
// project to 2D
for (i = 0; i < w->numpoints; i++) {
scale = r_width_2 / w->points[i][2];
w->points[i][0] = r_width_2 + scale * w->points[i][0];
@ -608,9 +592,7 @@ REN_DrawCameraFace (face_t * idpol)
w->points[i][2] = scale;
}
//
// draw it
//
// draw it
REN_SetTexture (idpol);
REN_RasterizeFace (w);
@ -636,15 +618,11 @@ REN_DrawXYFace (face_t * idpol)
w = idpol->w;
r_face = idpol;
//
// back (and side) face cull
//
// back (and side) face cull
if (DotProduct (idpol->plane.normal, xy_viewnormal) > -VECTOR_EPSILON)
return;
//
// transform
//
// transform
in = idpol->w;
numvertex = in->numpoints;
@ -661,18 +639,14 @@ REN_DrawXYFace (face_t * idpol)
w->points[i][4] = in->points[i][4];
}
//
// clip
//
// clip
for (i = 0; i < 4; i++) {
w = ClipWinding (w, &rfrustum[i]);
if (!w)
return;
}
//
// project to 2D
//
// project to 2D
for (i = 0; i < w->numpoints; i++) {
dest = w->points[i];
if (dest[0] < 0)
@ -701,9 +675,7 @@ REN_DrawXYFace (face_t * idpol)
REN_SetTexture (idpol);
//
// draw it
//
// draw it
REN_RasterizeFaceLinear (w);
free (w);
}