MCPcopy Create free account
hub / github.com/demoth/jake2 / testMap

Method testMap

fullgame/src/test/java/jake2/fullgame/TestMap.java:199–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 float[] vup = {0, 0, 0};
198
199 private void testMap()
200 {
201
202 if ( refdef == null ) {
203 refdef = new refdef_t();
204
205 refdef.x = 0;
206 refdef.y = 0;
207 refdef.width = viddef.getWidth();
208 refdef.height = viddef.getHeight();
209 refdef.fov_x = (ClientGlobals.fov == null) ? this.fov_x : ClientGlobals.fov.value;
210 refdef.fov_x = this.fov_x;
211 refdef.fov_y = Math3D.CalcFov(refdef.fov_x, refdef.width, refdef.height);
212 refdef.vieworg = new float[] {140, -140, 50};
213 refdef.viewangles = new float[] {0, 0, 0};
214
215 refdef.blend = new float[] { 0.0f, 0.0f, 0.0f, 0.0f };
216
217 refdef.areabits = null; // draw all
218// refdef.areabits = new byte[Defines.MAX_MAP_AREAS / 8];
219// Arrays.fill(refdef.areabits, (byte) 0xFF);
220
221 // load a monster
222 ent = new entity_t();
223
224 model_t weapon = re.RegisterModel("models/monsters/soldier/tris.md2");
225 image_t weaponSkin = re.RegisterSkin("models/monsters/soldier/skin.pcx");
226
227 ent.model = weapon;
228 ent.skin = weaponSkin;
229 ent.origin = new float[] { -60, 80, 25 };
230 Math3D.VectorCopy(ent.origin, ent.oldorigin);
231 ent.angles = new float[] { 0, 300, 0 };
232
233 refdef.entities = new entity_t[] {ent};
234 refdef.num_entities = refdef.entities.length;
235
236 lightstyle_t light = new lightstyle_t();
237 light.rgb = new float[] {1.0f, 1.0f, 1.0f};
238 light.white = 3.0f;
239
240 refdef.lightstyles = new lightstyle_t[Defines.MAX_LIGHTSTYLES];
241 for (int i = 0; i < Defines.MAX_LIGHTSTYLES; i++) {
242 refdef.lightstyles[i] = new lightstyle_t();
243 refdef.lightstyles[i].rgb = new float[] {1.0f, 1.0f, 1.0f};
244 refdef.lightstyles[i].white = 3.0f; // r + g + b
245 }
246
247 refdef.viewangles[1] = 130;
248 // set the start time
249 refdef.time = time() * 0.001f;
250 }
251
252 refdef.viewangles[0] += KBD.my * 0.1f;
253 refdef.viewangles[1] -= KBD.mx * 0.1f; // 90 + 180 * (float)Math.sin(time() * 0.0001f);
254
255 float dt = time() * 0.001f - refdef.time;
256

Callers 1

updateScreenMethod · 0.95

Calls 15

CalcFovMethod · 0.95
VectorCopyMethod · 0.95
timeMethod · 0.95
AngleVectorsMethod · 0.95
VectorMAMethod · 0.95
VectorSubtractMethod · 0.95
VectorLengthMethod · 0.95
RailTrailMethod · 0.95
VectorNormalizeMethod · 0.95
vectoanglesMethod · 0.95
animateParticlesMethod · 0.95
getWidthMethod · 0.80

Tested by

no test coverage detected