/* * CL_view.java * Copyright (C) 2004 * * $Id: CL_view.java,v 1.2 2004-07-08 20:24:29 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.client; import java.util.StringTokenizer; import jake2.qcommon.CM; import jake2.qcommon.Com; import jake2.qcommon.xcommand_t; import jake2.sys.Sys; import jake2.util.Vargs; public class CL_view extends CL_input { static int num_cl_weaponmodels; static String[] cl_weaponmodels = new String[MAX_CLIENTWEAPONMODELS]; /* ================= CL_PrepRefresh Call before entering a new level, or after changing dlls ================= */ private static xcommand_t prepRefreshCallback = new xcommand_t() { public void execute() { PrepRefresh2(); } }; static void PrepRefresh() { re.updateScreen(prepRefreshCallback); } static void PrepRefresh2() { String mapname; int i; String name; float rotate; float[] axis = new float[3]; if ((i=cl.configstrings[CS_MODELS+1].length()) == 0) return; // no map loaded SCR.AddDirtyPoint(0, 0); SCR.AddDirtyPoint(viddef.width-1, viddef.height-1); // let the render dll load the map mapname = cl.configstrings[CS_MODELS+1].substring(5, i - 4); // skip "maps/" // cut off ".bsp" // register models, pics, and skins Com.Printf("Map: " + mapname + "\r"); SCR.UpdateScreen2(); re.BeginRegistration(mapname); Com.Printf(" \r"); // precache status bar pics Com.Printf("pics\r"); SCR.UpdateScreen2(); SCR.TouchPics(); Com.Printf(" \r"); CL.RegisterTEntModels(); num_cl_weaponmodels = 1; cl_weaponmodels[0] = "weapon.md2"; for (i=1 ; i 37) name = name.substring(0, 36); /* if (name.charAt(0) != '*') Com.Printf("name" + "\r"); */ SCR.UpdateScreen2(); Sys.SendKeyEvents(); // pump message loop if (name.charAt(0) == '#') { // special player weapon model if (num_cl_weaponmodels < MAX_CLIENTWEAPONMODELS) { cl_weaponmodels[num_cl_weaponmodels] = cl.configstrings[CS_MODELS+i].substring(1); num_cl_weaponmodels++; } } else { cl.model_draw[i] = re.RegisterModel(cl.configstrings[CS_MODELS+i]); if (name.charAt(0) == '*') cl.model_clip[i] = CM.InlineModel(cl.configstrings[CS_MODELS+i]); else cl.model_clip[i] = null; } if (name.charAt(0) != '*') Com.Printf(" \r"); } Com.Printf("images\r"); SCR.UpdateScreen2(); for (i=1 ; i 0 ; i++) { cl.image_precache[i] = re.RegisterPic(cl.configstrings[CS_IMAGES+i]); Sys.SendKeyEvents(); // pump message loop } Com.Printf(" \r"); for (i=0 ; i 30) ping = 30; SCR.DebugGraph (ping, 0xd0); } }