()
| 45 | * ================= |
| 46 | */ |
| 47 | static void PrepRefresh() { |
| 48 | String mapname; |
| 49 | int i; |
| 50 | String name; |
| 51 | float rotate; |
| 52 | float[] axis = new float[3]; |
| 53 | |
| 54 | if ((i = ClientGlobals.cl.configstrings[Defines.CS_MODELS + 1].length()) == 0) |
| 55 | return; // no map loaded |
| 56 | |
| 57 | SCR.AddDirtyPoint(0, 0); |
| 58 | SCR.AddDirtyPoint(ClientGlobals.viddef.getWidth() - 1, ClientGlobals.viddef.getHeight() - 1); |
| 59 | |
| 60 | // let the render dll load the map |
| 61 | mapname = ClientGlobals.cl.configstrings[Defines.CS_MODELS + 1].substring(5, |
| 62 | i - 4); // skip "maps/" |
| 63 | // cut off ".bsp" |
| 64 | |
| 65 | // register models, pics, and skins |
| 66 | Com.Printf("Map: " + mapname + "\r"); |
| 67 | SCR.UpdateScreen(); |
| 68 | ClientGlobals.re.BeginRegistration(mapname); |
| 69 | Com.Printf(" \r"); |
| 70 | |
| 71 | // precache status bar pics |
| 72 | Com.Printf("pics\r"); |
| 73 | SCR.UpdateScreen(); |
| 74 | SCR.TouchPics(); |
| 75 | Com.Printf(" \r"); |
| 76 | |
| 77 | CL_tent.RegisterTEntModels(); |
| 78 | |
| 79 | num_cl_weaponmodels = 1; |
| 80 | cl_weaponmodels[0] = "weapon.md2"; |
| 81 | |
| 82 | for (i = 1; i < Defines.MAX_MODELS |
| 83 | && ClientGlobals.cl.configstrings[Defines.CS_MODELS + i].length() != 0; i++) { |
| 84 | name = new String(ClientGlobals.cl.configstrings[Defines.CS_MODELS + i]); |
| 85 | if (name.length() > 37) |
| 86 | name = name.substring(0, 36); |
| 87 | |
| 88 | if (name.charAt(0) != '*') |
| 89 | Com.Printf(name + "\r"); |
| 90 | |
| 91 | SCR.UpdateScreen(); |
| 92 | CL.SendKeyEvents(); // pump message loop |
| 93 | if (name.charAt(0) == '#') { |
| 94 | // special player weapon model |
| 95 | if (num_cl_weaponmodels < Defines.MAX_CLIENTWEAPONMODELS) { |
| 96 | cl_weaponmodels[num_cl_weaponmodels] = ClientGlobals.cl.configstrings[Defines.CS_MODELS |
| 97 | + i].substring(1); |
| 98 | num_cl_weaponmodels++; |
| 99 | } |
| 100 | } else { |
| 101 | ClientGlobals.cl.model_draw[i] = ClientGlobals.re |
| 102 | .RegisterModel(ClientGlobals.cl.configstrings[Defines.CS_MODELS |
| 103 | + i]); |
| 104 | if (name.charAt(0) == '*') |
no test coverage detected