diff options
author | Carsten Weisse <[email protected]> | 2008-03-02 14:56:23 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2008-03-02 14:56:23 +0000 |
commit | 78d0a1f33aaca5d734122371c43fd51ff43ad3fd (patch) | |
tree | eb01e518130289d77dbdb3331042c5da399cc15a /test | |
parent | adaf8e215e6dfff3435d59867661b4cd8946569f (diff) |
use getters and setters of modified viddef_t
Diffstat (limited to 'test')
-rw-r--r-- | test/jake2/render/DancingQueens.java | 10 | ||||
-rw-r--r-- | test/jake2/render/DebugCulling.java | 14 | ||||
-rw-r--r-- | test/jake2/render/TestMap.java | 17 | ||||
-rw-r--r-- | test/jake2/render/TestRenderer.java | 57 |
4 files changed, 41 insertions, 57 deletions
diff --git a/test/jake2/render/DancingQueens.java b/test/jake2/render/DancingQueens.java index 2ba220a..4097d21 100644 --- a/test/jake2/render/DancingQueens.java +++ b/test/jake2/render/DancingQueens.java @@ -2,7 +2,7 @@ * DancingQueens.java * Copyright (C) 2003 * - * $Id: DancingQueens.java,v 1.12 2007-03-20 18:57:16 cawe Exp $ + * $Id: DancingQueens.java,v 1.13 2008-03-02 14:56:21 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -100,7 +100,7 @@ public class DancingQueens { Globals.cls.state = Defines.ca_active; viddef = Globals.viddef; - fov_y = Math3D.CalcFov(fov_x, viddef.width, viddef.height); + fov_y = Math3D.CalcFov(fov_x, viddef.getWidth(), viddef.getHeight()); } float fps = 0.0f; @@ -119,7 +119,7 @@ public class DancingQueens { testModel(); - drawString(10, viddef.height - 16, text); + drawString(10, viddef.getHeight() - 16, text); re.EndFrame(); framecount++; @@ -162,8 +162,8 @@ public class DancingQueens { refdef.x = 0; refdef.y = 0; - refdef.width = viddef.width; - refdef.height = viddef.height; + refdef.width = viddef.getWidth(); + refdef.height = viddef.getHeight(); refdef.fov_x = fov_x; refdef.fov_y = fov_y; refdef.time = 1.0f * 0.001f; diff --git a/test/jake2/render/DebugCulling.java b/test/jake2/render/DebugCulling.java index 6312ad6..1731f67 100644 --- a/test/jake2/render/DebugCulling.java +++ b/test/jake2/render/DebugCulling.java @@ -63,7 +63,7 @@ public class DebugCulling void init() { - Qcommon.Init(new String[] { "$Id: DebugCulling.java,v 1.5 2007-02-27 14:00:35 cawe Exp $" }); + Qcommon.Init(new String[] { "$Id: DebugCulling.java,v 1.6 2008-03-02 14:56:21 cawe Exp $" }); // sehr wichtig !!! VID.Shutdown(); @@ -102,8 +102,8 @@ public class DebugCulling switch (currentState) { case 0 : - re.DrawStretchPic(0, 0, viddef.width, viddef.height, "conback"); - re.DrawPic(viddef.width / 2 - 50, viddef.height / 2, "loading"); + re.DrawStretchPic(0, 0, viddef.getWidth(), viddef.getHeight(), "conback"); + re.DrawPic(viddef.getWidth() / 2 - 50, viddef.getHeight() / 2, "loading"); currentState = 1; break; case 1 : @@ -124,7 +124,7 @@ public class DebugCulling testMap(); - drawString(10, viddef.height - 16, text); + drawString(10, viddef.getHeight() - 16, text); } re.EndFrame(); @@ -133,8 +133,6 @@ public class DebugCulling // =================================================================== - private float yaw = 0; - private float fov_x = 90; private refdef_t refdef; @@ -147,8 +145,8 @@ public class DebugCulling refdef.x = 0; refdef.y = 0; - refdef.width = viddef.width; - refdef.height = viddef.height; + refdef.width = viddef.getWidth(); + refdef.height = viddef.getHeight(); refdef.fov_x = fov_x; refdef.fov_y = CalcFov(fov_x, refdef.width -10, refdef.height-10); refdef.vieworg = new float[] {0, 0, 0}; diff --git a/test/jake2/render/TestMap.java b/test/jake2/render/TestMap.java index 0a0c3c5..f9a78ce 100644 --- a/test/jake2/render/TestMap.java +++ b/test/jake2/render/TestMap.java @@ -143,8 +143,8 @@ public class TestMap switch (currentState) { case 0 : - re.DrawStretchPic(0, 0, viddef.width, viddef.height, "conback"); - re.DrawPic(viddef.width / 2 - 50, viddef.height / 2, "loading"); + re.DrawStretchPic(0, 0, viddef.getWidth(), viddef.getHeight(), "conback"); + re.DrawPic(viddef.getWidth() / 2 - 50, viddef.getHeight() / 2, "loading"); currentState = 1; break; case 1 : @@ -163,7 +163,7 @@ public class TestMap testMap(); - drawString(10, viddef.height - 16, text); + drawString(10, viddef.getHeight() - 16, text); } re.EndFrame(); @@ -234,8 +234,6 @@ public class TestMap } }; - private float yaw = 0; - private float fov_x = 90; private refdef_t refdef; @@ -254,8 +252,8 @@ public class TestMap refdef.x = 0; refdef.y = 0; - refdef.width = viddef.width; - refdef.height = viddef.height; + refdef.width = viddef.getWidth(); + refdef.height = viddef.getHeight(); refdef.fov_x = (Globals.fov == null) ? this.fov_x : Globals.fov.value; refdef.fov_x = this.fov_x; refdef.fov_y = Math3D.CalcFov(refdef.fov_x, refdef.width, refdef.height); @@ -366,11 +364,6 @@ public class TestMap } private LinkedList active_particles = new LinkedList(); - private boolean explode = false; - private float[] target; - - private boolean initParticles = true; - private void animateParticles() { cparticle_t p; diff --git a/test/jake2/render/TestRenderer.java b/test/jake2/render/TestRenderer.java index 1106fb8..46426eb 100644 --- a/test/jake2/render/TestRenderer.java +++ b/test/jake2/render/TestRenderer.java @@ -2,7 +2,7 @@ * TestRenderer.java * Copyright (C) 2003 * - * $Id: TestRenderer.java,v 1.8 2006-11-21 01:59:41 cawe Exp $ + * $Id: TestRenderer.java,v 1.9 2008-03-02 14:56:21 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -109,7 +109,7 @@ public class TestRenderer { void updateScreen() { re.BeginFrame(0.0f); viddef = Globals.viddef; - re.DrawStretchPic(0, 0, viddef.width, viddef.height, "conback"); + re.DrawStretchPic(0, 0, viddef.getWidth(), viddef.getHeight(), "conback"); if (framecount % 500 == 0) { long time = System.currentTimeMillis(); @@ -119,13 +119,13 @@ public class TestRenderer { String text = ((int)(fps +0.5f)) + " fps"; for (int i = 0; i < text.length(); i++) { - re.DrawChar(10 + 8 * i, viddef.height / 2, (int) text.charAt(i)); + re.DrawChar(10 + 8 * i, viddef.getHeight() / 2, (int) text.charAt(i)); } Dimension wal = new Dimension(); re.DrawGetPicSize(wal, "/textures/e1u1/basemap.wal"); - re.DrawPic(0, viddef.height - wal.height, "/textures/e1u1/basemap.wal"); + re.DrawPic(0, viddef.getHeight() - wal.height, "/textures/e1u1/basemap.wal"); switch (testnr) { case 0: @@ -172,8 +172,8 @@ public class TestRenderer { refdef_t refdef = new refdef_t(); - refdef.x = viddef.width / 2; - refdef.y = viddef.height / 2 - 72; + refdef.x = viddef.getWidth() / 2; + refdef.y = viddef.getHeight() / 2 - 72; refdef.width = 144 * 2; refdef.height = 168 * 2; refdef.fov_x = 40; @@ -181,7 +181,6 @@ public class TestRenderer { .CalcFov(refdef.fov_x, refdef.width, refdef.height); refdef.time = 1.0f * 0.001f; - int maxframe = 29; entity_t entity = new entity_t(); String modelName = "players/female/tris.md2"; @@ -223,8 +222,8 @@ public class TestRenderer { // Menu_Draw(& s_player_config_menu); - M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.width) - 8), - (int) ((viddef.height / 2) * (240.0F / viddef.height) - 77), + M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.getWidth()) - 8), + (int) ((viddef.getHeight() / 2) * (240.0F / viddef.getHeight()) - 77), refdef.width / 8, refdef.height / 8); refdef.height += 4; @@ -249,10 +248,10 @@ public class TestRenderer { if (loading) { - re.DrawPic(viddef.width / 2 - 50, viddef.height / 2, "loading"); + re.DrawPic(viddef.getWidth() / 2 - 50, viddef.getHeight() / 2, "loading"); String name = sprites[spriteCount]; - drawString(viddef.width / 2 - 50, viddef.height / 2 + 50, name); + drawString(viddef.getWidth() / 2 - 50, viddef.getHeight() / 2 + 50, name); re.RegisterModel(name); loading = ++spriteCount < sprites.length; @@ -261,8 +260,8 @@ public class TestRenderer { refdef_t refdef = new refdef_t(); - refdef.x = viddef.width / 2; - refdef.y = viddef.height / 2 - 72; + refdef.x = viddef.getWidth() / 2; + refdef.y = viddef.getHeight() / 2 - 72; refdef.width = 144 * 2; refdef.height = 168 * 2; refdef.fov_x = 40; @@ -270,7 +269,6 @@ public class TestRenderer { .CalcFov(refdef.fov_x, refdef.width, refdef.height); refdef.time = 1.0f * 0.001f; - int maxframe = 29; entity_t entity = new entity_t(); String modelName = sprites[(framecount / 30) % sprites.length]; @@ -294,8 +292,8 @@ public class TestRenderer { refdef.lightstyles = null; refdef.rdflags = Defines.RDF_NOWORLDMODEL; - M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.width) - 8), - (int) ((viddef.height / 2) * (240.0F / viddef.height) - 77), + M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.getWidth()) - 8), + (int) ((viddef.getHeight() / 2) * (240.0F / viddef.getHeight()) - 77), refdef.width / 8, refdef.height / 8); refdef.height += 4; @@ -307,8 +305,8 @@ public class TestRenderer { refdef_t refdef = new refdef_t(); - refdef.x = viddef.width / 2; - refdef.y = viddef.height / 2 - 72; + refdef.x = viddef.getWidth() / 2; + refdef.y = viddef.getHeight() / 2 - 72; refdef.width = 144 * 2; refdef.height = 168 * 2; refdef.fov_x = 40; @@ -316,7 +314,6 @@ public class TestRenderer { .CalcFov(refdef.fov_x, refdef.width, refdef.height); refdef.time = 1.0f * 0.001f; - int maxframe = 29; entity_t entity = new entity_t(); drawString(refdef.x, refdef.y - 20, "Beam Test"); @@ -350,8 +347,8 @@ public class TestRenderer { refdef.lightstyles = null; refdef.rdflags = Defines.RDF_NOWORLDMODEL; - M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.width) - 8), - (int) ((viddef.height / 2) * (240.0F / viddef.height) - 77), + M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.getWidth()) - 8), + (int) ((viddef.getHeight() / 2) * (240.0F / viddef.getHeight()) - 77), refdef.width / 8, refdef.height / 8); refdef.height += 4; @@ -364,8 +361,6 @@ public class TestRenderer { private float[] target; - private boolean initParticles = true; - private void testParticles() { r_numparticles = 0; @@ -383,8 +378,8 @@ public class TestRenderer { } refdef_t refdef = new refdef_t(); - refdef.x = viddef.width / 2; - refdef.y = viddef.height / 2 - 72; + refdef.x = viddef.getWidth() / 2; + refdef.y = viddef.getHeight() / 2 - 72; refdef.width = 400; refdef.height = 400; refdef.fov_x = 50; @@ -405,8 +400,8 @@ public class TestRenderer { refdef.lightstyles = null; refdef.rdflags = Defines.RDF_NOWORLDMODEL; - M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.width) - 8), - (int) ((viddef.height / 2) * (240.0F / viddef.height) - 77), + M_DrawTextBox((int) ((refdef.x) * (320.0F / viddef.getWidth()) - 8), + (int) ((viddef.getHeight() / 2) * (240.0F / viddef.getHeight()) - 77), refdef.width / 8, refdef.height / 8); refdef.height += 4; @@ -464,18 +459,16 @@ public class TestRenderer { * and will be centered on higher res screens. ================ */ private void M_DrawCharacter(int cx, int cy, int num) { - re.DrawChar(cx + ((viddef.width - 320) >> 1), cy - + ((viddef.height - 240) >> 1), num); + re.DrawChar(cx + ((viddef.getWidth() - 320) >> 1), cy + + ((viddef.getHeight() - 240) >> 1), num); } long endtime; private void Explosion(float[] org) { - float[] dir = { 0, 0, 0 }; - int i; cparticle_t p; - for (i = 0; i < 256; i++) { + for (int i = 0; i < 256; i++) { p = new cparticle_t(); p.time = time() * 1.0f; |