Cube  Diff

Differences From Artifact [e6c4962238]:

To Artifact [ace19c9caa]:


89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115







-
+











-
+







	int type;
	struct sphere *next;
};
static struct sphere spheres[MAXSPHERES], *slist = NULL, *sempty = NULL;
bool sinit = false;

void
newsphere(const OFVector3D *o, float max, int type)
newsphere(OFVector3D o, float max, int type)
{
	if (!sinit) {
		for (int i = 0; i < MAXSPHERES; i++) {
			spheres[i].next = sempty;
			sempty = &spheres[i];
		}
		sinit = true;
	}
	if (sempty) {
		struct sphere *p = sempty;
		sempty = p->next;
		p->o = *o;
		p->o = o;
		p->max = max;
		p->size = 1;
		p->type = type;
		p->next = slist;
		slist = p;
	}
}
185
186
187
188
189
190
191
192
193

194
195
196
197
198
199
200
185
186
187
188
189
190
191


192
193
194
195
196
197
198
199







-
-
+







	if (!editmode)
		return;

	for (Entity *e in ents) {
		if (e.type == NOTUSED)
			continue;

		OFVector3D v = OFMakeVector3D(e.x, e.y, e.z);
		particle_splash(2, 2, 40, &v);
		particle_splash(2, 2, 40, OFMakeVector3D(e.x, e.y, e.z));
	}

	int e = closestent();
	if (e >= 0) {
		Entity *c = ents[e];
		closeent =
		    [OFString stringWithFormat:@"closest entity = %@ (%d, %d, "
268
269
270
271
272
273
274
275

276
277
278
279
280
281
282
267
268
269
270
271
272
273

274
275
276
277
278
279
280
281







-
+







	gluUnProject(w / 2, h / 2, depthcorrect(cursordepth), mm, pm, viewport,
	    &worldx, &worldz, &worldy);
	worldpos.x = (float)worldx;
	worldpos.y = (float)worldy;
	worldpos.z = (float)worldz;
	OFVector3D r = OFMakeVector3D(mm[0], mm[4], mm[8]);
	OFVector3D u = OFMakeVector3D(mm[1], mm[5], mm[9]);
	setorient(&r, &u);
	setorient(r, u);
}

void
drawicon(float tx, float ty, int x, int y)
{
	glBindTexture(GL_TEXTURE_2D, 5);
	glBegin(GL_QUADS);