Cube  Diff

Differences From Artifact [0c686b4d39]:

To Artifact [f6d88ed878]:


94
95
96
97
98
99
100
101

102
103
104
105
106
107
108
109
110
111

112
113
114
115
116
117
118
	if (!sinit) {
		loopi(MAXSPHERES)
		{
			spheres[i].next = sempty;
			sempty = &spheres[i];
		}
		sinit = true;
	};

	if (sempty) {
		sphere *p = sempty;
		sempty = p->next;
		p->o = o;
		p->max = max;
		p->size = 1;
		p->type = type;
		p->next = slist;
		slist = p;
	};

}

void
renderspheres(int time)
{
	glDepthMask(GL_FALSE);
	glEnable(GL_BLEND);







<
>









<
>







94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
	if (!sinit) {
		loopi(MAXSPHERES)
		{
			spheres[i].next = sempty;
			sempty = &spheres[i];
		}
		sinit = true;

	}
	if (sempty) {
		sphere *p = sempty;
		sempty = p->next;
		p->o = o;
		p->max = max;
		p->size = 1;
		p->type = type;
		p->next = slist;
		slist = p;

	}
}

void
renderspheres(int time)
{
	glDepthMask(GL_FALSE);
	glEnable(GL_BLEND);
135
136
137
138
139
140
141
142
143


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
		if (p->size > p->max) {
			*pp = p->next;
			p->next = sempty;
			sempty = p;
		} else {
			p->size += time / 100.0f;
			pp = &p->next;
		};
	};



	glDisable(GL_BLEND);
	glDepthMask(GL_TRUE);
}

string closeent;
OFString *entnames[] = {
    @"none?",
    @"light",
    @"playerstart",
    @"shells",
    @"bullets",
    @"rockets",
    @"riflerounds",
    @"health",
    @"healthboost",
    @"greenarmour",
    @"yellowarmour",
    @"quaddamage",
    @"teleport",
    @"teledest",
    @"mapmodel",
    @"monster",
    @"trigger",
    @"jumppad",
    @"?",
    @"?",
    @"?",
    @"?",
    @"?",
};

void
renderents() // show sparkly thingies for map entities in edit mode
{
	closeent[0] = 0;
	if (!editmode)







<
<
>
>







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







135
136
137
138
139
140
141


142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
		if (p->size > p->max) {
			*pp = p->next;
			p->next = sempty;
			sempty = p;
		} else {
			p->size += time / 100.0f;
			pp = &p->next;


		}
	}

	glDisable(GL_BLEND);
	glDepthMask(GL_TRUE);
}

string closeent;
OFString *entnames[] = {
	@"none?",
	@"light",
	@"playerstart",
	@"shells",
	@"bullets",
	@"rockets",
	@"riflerounds",
	@"health",
	@"healthboost",
	@"greenarmour",
	@"yellowarmour",
	@"quaddamage",
	@"teleport",
	@"teledest",
	@"mapmodel",
	@"monster",
	@"trigger",
	@"jumppad",
	@"?",
	@"?",
	@"?",
	@"?",
	@"?",
};

void
renderents() // show sparkly thingies for map entities in edit mode
{
	closeent[0] = 0;
	if (!editmode)
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{
	@autoreleasepool {
		static OFString *lastsky = @"";

		if ([lastsky isEqual:basename])
			return;

		static const OFString *side[] = {
		    @"ft", @"bk", @"lf", @"rt", @"dn", @"up"};
		int texnum = 14;
		loopi(6)
		{
			OFString *path =
			    [OFString stringWithFormat:@"packages/%@_%@.jpg",
			              basename, side[i]];








|
|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{
	@autoreleasepool {
		static OFString *lastsky = @"";

		if ([lastsky isEqual:basename])
			return;

		static const OFString *side[] = { @"ft", @"bk", @"lf", @"rt",
			@"dn", @"up" };
		int texnum = 14;
		loopi(6)
		{
			OFString *path =
			    [OFString stringWithFormat:@"packages/%@_%@.jpg",
			              basename, side[i]];

332
333
334
335
336
337
338
339

340
341
342
343
344
345
346
	readmatrices();
	if (editmode) {
		if (cursordepth == 1.0f)
			worldpos = player1->o;
		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
		cursorupdate();
		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
	};


	glDisable(GL_DEPTH_TEST);
	invertperspective();
	glPushMatrix();
	glOrtho(0, VIRTW, VIRTH, 0, -1, 1);
	glEnable(GL_BLEND);








<
>







332
333
334
335
336
337
338

339
340
341
342
343
344
345
346
	readmatrices();
	if (editmode) {
		if (cursordepth == 1.0f)
			worldpos = player1->o;
		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
		cursorupdate();
		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

	}

	glDisable(GL_DEPTH_TEST);
	invertperspective();
	glPushMatrix();
	glOrtho(0, VIRTW, VIRTH, 0, -1, 1);
	glEnable(GL_BLEND);

438
439
440
441
442
443
444
445

446
447
448
449
450
451
452
453
454
			drawicon(
			    (float)(player1->armourtype * 64), 0, 620, 1650);
		int g = player1->gunselect;
		int r = 64;
		if (g > 2) {
			g -= 3;
			r = 128;
		};

		drawicon((float)(g * 64), (float)r, 1220, 1650);
		glPopMatrix();
	}

	glDepthMask(GL_TRUE);
	glDisable(GL_BLEND);
	glDisable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
}







<
>









438
439
440
441
442
443
444

445
446
447
448
449
450
451
452
453
454
			drawicon(
			    (float)(player1->armourtype * 64), 0, 620, 1650);
		int g = player1->gunselect;
		int r = 64;
		if (g > 2) {
			g -= 3;
			r = 128;

		}
		drawicon((float)(g * 64), (float)r, 1220, 1650);
		glPopMatrix();
	}

	glDepthMask(GL_TRUE);
	glDisable(GL_BLEND);
	glDisable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
}