From: Carsten W. <ca...@us...> - 2007-04-16 22:08:07
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19259/src/jake2/qcommon Modified Files: CM.java Log Message: clean up Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CM.java 15 Apr 2007 20:12:33 -0000 1.13 --- CM.java 16 Apr 2007 22:08:04 -0000 1.14 *************** *** 20,26 **** // Created on 02.01.2004 by RST. - - // $Id$ - package jake2.qcommon; --- 20,23 ---- *************** *** 587,599 **** public static void CMod_LoadLeafBrushes(lump_t l) { Com.DPrintf("CMod_LoadLeafBrushes()\n"); - int i; - int out[]; - short in[]; - int count; if ((l.filelen % 2) != 0) Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size"); ! count = l.filelen / 2; Com.DPrintf(" numbrushes=" + count + "\n"); --- 584,592 ---- public static void CMod_LoadLeafBrushes(lump_t l) { Com.DPrintf("CMod_LoadLeafBrushes()\n"); if ((l.filelen % 2) != 0) Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size"); ! int count = l.filelen / 2; Com.DPrintf(" numbrushes=" + count + "\n"); *************** *** 606,610 **** Com.Error(Defines.ERR_DROP, "Map has too many leafbrushes"); ! out = map_leafbrushes; numleafbrushes = count; --- 599,603 ---- Com.Error(Defines.ERR_DROP, "Map has too many leafbrushes"); ! int[] out = map_leafbrushes; numleafbrushes = count; *************** *** 616,620 **** } ! for (i = 0; i < count; i++) { out[i] = bb.getShort(); if (debugloadmap) { --- 609,613 ---- } ! for (int i = 0; i < count; i++) { out[i] = bb.getShort(); if (debugloadmap) { *************** *** 757,761 **** public static void CMod_LoadVisibility(lump_t l) { Com.DPrintf("CMod_LoadVisibility()\n"); - int i; numvisibility = l.filelen; --- 750,753 ---- *************** *** 795,804 **** /** Returns the model with a given id "*" + <number> */ public static cmodel_t InlineModel(String name) { - int num; - if (name == null || name.charAt(0) != '*') Com.Error(Defines.ERR_DROP, "CM_InlineModel: bad name"); ! num = Lib.atoi(name.substring(1)); if (num < 1 || num >= numcmodels) --- 787,794 ---- /** Returns the model with a given id "*" + <number> */ public static cmodel_t InlineModel(String name) { if (name == null || name.charAt(0) != '*') Com.Error(Defines.ERR_DROP, "CM_InlineModel: bad name"); ! int num = Lib.atoi(name.substring(1)); if (num < 1 || num >= numcmodels) *************** *** 850,858 **** */ public static void CM_InitBoxHull() { - int i; - int side; - cnode_t c; - cplane_t p; - cbrushside_t s; box_headnode = numnodes; //rst: still room for 6 brushes left? --- 840,843 ---- *************** *** 885,889 **** map_leafbrushes[numleafbrushes] = numbrushes; ! for (i = 0; i < 6; i++) { side = i & 1; --- 870,879 ---- map_leafbrushes[numleafbrushes] = numbrushes; ! int side; ! cnode_t c; ! cplane_t p; ! cbrushside_t s; ! ! for (int i = 0; i < 6; i++) { side = i & 1; *************** *** 1790,1810 **** */ public static boolean CM_HeadnodeVisible(int nodenum, byte visbits[]) { - int leafnum; - int cluster; - cnode_t node; - if (nodenum < 0) { ! leafnum = -1 - nodenum; ! cluster = map_leafs[leafnum].cluster; ! if (cluster == -1) ! return false; ! if (0 != (visbits[cluster >>> 3] & (1 << (cluster & 7)))) ! return true; return false; } ! node = map_nodes[nodenum]; ! if (CM_HeadnodeVisible(node.children[0], visbits)) ! return true; return CM_HeadnodeVisible(node.children[1], visbits); } --- 1780,1796 ---- */ public static boolean CM_HeadnodeVisible(int nodenum, byte visbits[]) { if (nodenum < 0) { ! int leafnum = -1 - nodenum; ! int cluster = map_leafs[leafnum].cluster; ! if (cluster == -1) return false; ! ! if (0 != (visbits[cluster >>> 3] & (1 << (cluster & 7)))) return true; ! return false; } ! cnode_t node = map_nodes[nodenum]; ! if (CM_HeadnodeVisible(node.children[0], visbits)) return true; ! return CM_HeadnodeVisible(node.children[1], visbits); } |