Cube  Diff

Differences From Artifact [923fa1d88f]:

To Artifact [11936c1b8d]:


87
88
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
116
117
118
119
120
121
122
123



124
125
126
127
128
129
130
131
132
133
134
135









136
87
88
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
116
117
118
119
120



121
122
123
124
125
126









127
128
129
130
131
132
133
134
135
136







-
+

















-
-
-
+
+
+






-
-
-
+
+
+



-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+

rendermodel(OFString *mdl, int frame, int range, int tex, float rad,
    OFVector3D position, float yaw, float pitch, bool teammate, float scale,
    float speed, int snap, int basetime)
{
	MD2 *m = loadmodel(mdl);

	if (isoccluded(Player.player1.origin.x, Player.player1.origin.y,
	        position.x - rad, position.z - rad, rad * 2))
	    position.x - rad, position.z - rad, rad * 2))
		return;

	delayedload(m);

	int xs, ys;
	glBindTexture(GL_TEXTURE_2D,
	    tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum);

	int ix = (int)position.x;
	int iy = (int)position.z;
	OFColor *light = OFColor.white;

	if (!OUTBORD(ix, iy)) {
		struct sqr *s = S(ix, iy);
		float ll = 256.0f; // 0.96f;
		float of = 0.0f;   // 0.1f;
		light = [OFColor colorWithRed: s->r / ll + of
		                        green: s->g / ll + of
		                         blue: s->b / ll + of
		                        alpha: 1];
					green: s->g / ll + of
					 blue: s->b / ll + of
					alpha: 1.0f];
	}

	if (teammate) {
		float red, green, blue;
		[light getRed: &red green: &green blue: &blue alpha: NULL];
		light = [OFColor colorWithRed: red * 0.6f
		                        green: green * 0.7f
		                         blue: blue * 1.2f
		                        alpha: 1];
					green: green * 0.7f
					 blue: blue * 1.2f
					alpha: 1.0f];
	}

	[m renderWithLight: light
	             frame: frame
	             range: range
	          position: position
	               yaw: yaw
	             pitch: pitch
	             scale: scale
	             speed: speed
	              snap: snap
	          basetime: basetime];
		     frame: frame
		     range: range
		  position: position
		       yaw: yaw
		     pitch: pitch
		     scale: scale
		     speed: speed
		      snap: snap
		  basetime: basetime];
}