Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27365/src/jake2/client Modified Files: Tag: render-refactoring client_state_t.java Menu.java CL_inv.java SCR.java VID.java CL.java Key.java M.java Log Message: merge with current HEAD Index: M.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/M.java,v retrieving revision 1.6 retrieving revision 1.6.12.1 diff -C2 -d -r1.6 -r1.6.12.1 *** M.java 7 Oct 2004 14:13:07 -0000 1.6 --- M.java 25 Dec 2005 18:11:24 -0000 1.6.12.1 *************** *** 50,54 **** } ! // if the hull point one-quarter unit down is solid the entity is on // ground point[0] = ent.s.origin[0]; --- 50,54 ---- } ! // if the hull point one-quarter unit down is solid the entity is on // ground point[0] = ent.s.origin[0]; *************** *** 65,72 **** } ! // ent.groundentity = trace.ent; ! // ent.groundentity_linkcount = trace.ent.linkcount; ! // if (!trace.startsolid && !trace.allsolid) ! // VectorCopy (trace.endpos, ent.s.origin); if (!trace.startsolid && !trace.allsolid) { Math3D.VectorCopy(trace.endpos, ent.s.origin); --- 65,72 ---- } ! // ent.groundentity = trace.ent; ! // ent.groundentity_linkcount = trace.ent.linkcount; ! // if (!trace.startsolid && !trace.allsolid) ! // VectorCopy (trace.endpos, ent.s.origin); if (!trace.startsolid && !trace.allsolid) { Math3D.VectorCopy(trace.endpos, ent.s.origin); *************** *** 145,150 **** /* ! * =============== M_ChangeYaw ! * * =============== *///ok --- 145,150 ---- /* ! * =============== ! * M_ChangeYaw * =============== *///ok *************** *** 182,187 **** /* ! * ====================== M_MoveToGoal ====================== ! */// ok public static void M_MoveToGoal(edict_t ent, float dist) { edict_t goal = ent.goalentity; --- 182,189 ---- /* ! * ====================== ! * M_MoveToGoal ! * ====================== ! */ public static void M_MoveToGoal(edict_t ent, float dist) { edict_t goal = ent.goalentity; *************** *** 204,208 **** /* ! * =============== M_walkmove =============== */ public static boolean M_walkmove(edict_t ent, float yaw, float dist) { --- 206,212 ---- /* ! * =============== ! * M_walkmove ! * =============== */ public static boolean M_walkmove(edict_t ent, float yaw, float dist) { *************** *** 268,272 **** if (dmg > 15) dmg = 15; ! GameUtil.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, dmg, 0, --- 272,276 ---- if (dmg > 15) dmg = 15; ! GameCombat.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, dmg, 0, *************** *** 285,289 **** if (dmg > 15) dmg = 15; ! GameUtil.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, dmg, 0, --- 289,293 ---- if (dmg > 15) dmg = 15; ! GameCombat.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, dmg, 0, *************** *** 309,313 **** if (ent.damage_debounce_time < GameBase.level.time) { ent.damage_debounce_time = GameBase.level.time + 0.2f; ! GameUtil.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, 10 * ent.waterlevel, --- 313,317 ---- if (ent.damage_debounce_time < GameBase.level.time) { ent.damage_debounce_time = GameBase.level.time + 0.2f; ! GameCombat.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, 10 * ent.waterlevel, *************** *** 319,323 **** if (ent.damage_debounce_time < GameBase.level.time) { ent.damage_debounce_time = GameBase.level.time + 1; ! GameUtil.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, 4 * ent.waterlevel, --- 323,327 ---- if (ent.damage_debounce_time < GameBase.level.time) { ent.damage_debounce_time = GameBase.level.time + 1; ! GameCombat.T_Damage(ent, GameBase.g_edicts[0], GameBase.g_edicts[0], Globals.vec3_origin, ent.s.origin, Globals.vec3_origin, 4 * ent.waterlevel, *************** *** 353,356 **** --- 357,361 ---- public static EntThinkAdapter M_droptofloor = new EntThinkAdapter() { + public String getID() { return "m_drop_to_floor";} public boolean think(edict_t ent) { float[] end = { 0, 0, 0 }; *************** *** 449,527 **** } - public static void M_ReactToDamage(edict_t targ, edict_t attacker) { - if ((null != attacker.client) - && 0 != (attacker.svflags & Defines.SVF_MONSTER)) - return; - - if (attacker == targ || attacker == targ.enemy) - return; - - // if we are a good guy monster and our attacker is a player - // or another good guy, do not get mad at them - if (0 != (targ.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) { - if (attacker.client != null - || (attacker.monsterinfo.aiflags & Defines.AI_GOOD_GUY) != 0) - return; - } - - // we now know that we are not both good guys - - // if attacker is a client, get mad at them because he's good and we're - // not - if (attacker.client != null) { - targ.monsterinfo.aiflags &= ~Defines.AI_SOUND_TARGET; - - // this can only happen in coop (both new and old enemies are - // clients) - // only switch if can't see the current enemy - if (targ.enemy != null && targ.enemy.client != null) { - if (GameUtil.visible(targ, targ.enemy)) { - targ.oldenemy = attacker; - return; - } - targ.oldenemy = targ.enemy; - } - targ.enemy = attacker; - if (0 == (targ.monsterinfo.aiflags & Defines.AI_DUCKED)) - GameUtil.FoundTarget(targ); - return; - } - - // it's the same base (walk/swim/fly) type and a different classname and - // it's not a tank - // (they spray too much), get mad at them - if (((targ.flags & (Defines.FL_FLY | Defines.FL_SWIM)) == (attacker.flags & (Defines.FL_FLY | Defines.FL_SWIM))) - && (!(targ.classname.equals(attacker.classname))) - && (!(attacker.classname.equals("monster_tank"))) - && (!(attacker.classname.equals("monster_supertank"))) - && (!(attacker.classname.equals("monster_makron"))) - && (!(attacker.classname.equals("monster_jorg")))) { - if (targ.enemy != null && targ.enemy.client != null) - targ.oldenemy = targ.enemy; - targ.enemy = attacker; - if (0 == (targ.monsterinfo.aiflags & Defines.AI_DUCKED)) - GameUtil.FoundTarget(targ); - } - // if they *meant* to shoot us, then shoot back - else if (attacker.enemy == targ) { - if (targ.enemy != null && targ.enemy.client != null) - targ.oldenemy = targ.enemy; - targ.enemy = attacker; - if (0 == (targ.monsterinfo.aiflags & Defines.AI_DUCKED)) - GameUtil.FoundTarget(targ); - } - // otherwise get mad at whoever they are mad at (help our buddy) unless - // it is us! - else if (attacker.enemy != null && attacker.enemy != targ) { - if (targ.enemy != null && targ.enemy.client != null) - targ.oldenemy = targ.enemy; - targ.enemy = attacker.enemy; - if (0 == (targ.monsterinfo.aiflags & Defines.AI_DUCKED)) - GameUtil.FoundTarget(targ); - } - } - /** Stops the Flies. */ public static EntThinkAdapter M_FliesOff = new EntThinkAdapter() { public boolean think(edict_t self) { self.s.effects &= ~Defines.EF_FLIES; --- 454,460 ---- } /** Stops the Flies. */ public static EntThinkAdapter M_FliesOff = new EntThinkAdapter() { + public String getID() { return "m_fliesoff";} public boolean think(edict_t self) { self.s.effects &= ~Defines.EF_FLIES; *************** *** 533,536 **** --- 466,470 ---- /** Starts the Flies as setting the animation flag in the entity. */ public static EntThinkAdapter M_FliesOn = new EntThinkAdapter() { + public String getID() { return "m_flies_on";} public boolean think(edict_t self) { if (self.waterlevel != 0) *************** *** 547,550 **** --- 481,485 ---- /** Adds some flies after a random time */ public static EntThinkAdapter M_FlyCheck = new EntThinkAdapter() { + public String getID() { return "m_fly_check";} public boolean think(edict_t self) { Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** Menu.java 1 Jul 2005 14:20:50 -0000 1.19 --- Menu.java 25 Dec 2005 18:11:22 -0000 1.19.2.1 *************** *** 4104,4109 **** if (s_pmi[s_player_model_box.curvalue].skindisplaynames != null) { - int maxframe = 29; - //memset(entity, 0, sizeof(entity)); entity.clear(); --- 4104,4107 ---- *************** *** 4162,4166 **** if (key == K_ESCAPE) { - //char scratch[1024]; String scratch; --- 4160,4163 ---- Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** CL.java 1 Jul 2005 14:20:48 -0000 1.23 --- CL.java 25 Dec 2005 18:11:24 -0000 1.23.2.1 *************** *** 57,65 **** public static final int PLAYER_MULT = 5; - /* - * ================== CL_FixCvarCheats - * - * ================== - */ public static class cheatvar_t { String name; --- 57,60 ---- *************** *** 90,97 **** static int numcheatvars; ! /* ! * ==================== CL_Stop_f * ! * stop recording a demo ==================== */ static xcommand_t Stop_f = new xcommand_t() { --- 85,92 ---- static int numcheatvars; ! /** ! * Stop_f * ! * Stop recording a demo. */ static xcommand_t Stop_f = new xcommand_t() { *************** *** 118,130 **** }; - /* - * ==================== CL_Record_f - * - * record <demoname> - * - * Begins recording a demo from the current position ==================== - */ static entity_state_t nullstate = new entity_state_t(null); static xcommand_t Record_f = new xcommand_t() { public void execute() { --- 113,124 ---- }; static entity_state_t nullstate = new entity_state_t(null); + /** + * Record_f + * + * record <demoname> + * Begins recording a demo from the current position. + */ static xcommand_t Record_f = new xcommand_t() { public void execute() { *************** *** 234,239 **** }; ! /* ! * ================== CL_ForwardToServer_f ================== */ static xcommand_t ForwardToServer_f = new xcommand_t() { --- 228,233 ---- }; ! /** ! * ForwardToServer_f */ static xcommand_t ForwardToServer_f = new xcommand_t() { *************** *** 254,259 **** }; ! /* ! * ================== CL_Pause_f ================== */ static xcommand_t Pause_f = new xcommand_t() { --- 248,253 ---- }; ! /** ! * Pause_f */ static xcommand_t Pause_f = new xcommand_t() { *************** *** 271,276 **** }; ! /* ! * ================== CL_Quit_f ================== */ static xcommand_t Quit_f = new xcommand_t() { --- 265,270 ---- }; ! /** ! * Quit_f */ static xcommand_t Quit_f = new xcommand_t() { *************** *** 281,288 **** }; ! /* ! * ================ CL_Connect_f ! * ! * ================ */ static xcommand_t Connect_f = new xcommand_t() { --- 275,280 ---- }; ! /** ! * Connect_f */ static xcommand_t Connect_f = new xcommand_t() { *************** *** 316,376 **** }; ! /* ! * ===================== CL_Rcon_f * * Send the rest of the command line over as an unconnected command. - * ===================== */ static xcommand_t Rcon_f = new xcommand_t() { public void execute() { - StringBuffer message = new StringBuffer(1024); - int i; - netadr_t to = new netadr_t(); ! if (Globals.rcon_client_password.string == null) { ! Com ! .Printf("You must set 'rcon_password' before\nissuing an rcon command.\n"); return; } ! message.append((char) 255); ! message.append((char) 255); ! message.append((char) 255); ! message.append((char) 255); ! NET.Config(true); // allow remote ! //strcat (message, "rcon "); ! message.append("rcon "); ! //strcat (message, rcon_client_password.string); message.append(Globals.rcon_client_password.string); - //strcat (message, " "); message.append(" "); ! for (i = 1; i < Cmd.Argc(); i++) { ! //strcat (message, Cmd.Argv(i)); message.append(Cmd.Argv(i)); - //strcat (message, " "); message.append(" "); } if (Globals.cls.state >= Defines.ca_connected) to = Globals.cls.netchan.remote_address; else { if (Globals.rcon_address.string.length() == 0) { ! Com ! .Printf("You must either be connected,\nor set the 'rcon_address' cvar\nto issue rcon commands\n"); ! return; } NET.StringToAdr(Globals.rcon_address.string, to); ! if (to.port == 0) ! //to.port = BigShort (PORT_SERVER); ! to.port = Defines.PORT_SERVER; } message.append('\0'); String b = message.toString(); ! NET.SendPacket(Defines.NS_CLIENT, b.length(), b.getBytes(), to); } }; --- 308,359 ---- }; ! /** ! * Rcon_f * * Send the rest of the command line over as an unconnected command. */ static xcommand_t Rcon_f = new xcommand_t() { public void execute() { ! if (Globals.rcon_client_password.string.length() == 0) { ! Com.Printf("You must set 'rcon_password' before\nissuing an rcon command.\n"); return; } ! StringBuffer message = new StringBuffer(1024); ! // connection less packet ! message.append('\u00ff'); ! message.append('\u00ff'); ! message.append('\u00ff'); ! message.append('\u00ff'); ! // allow remote ! NET.Config(true); ! message.append("rcon "); message.append(Globals.rcon_client_password.string); message.append(" "); ! for (int i = 1; i < Cmd.Argc(); i++) { message.append(Cmd.Argv(i)); message.append(" "); } + netadr_t to = new netadr_t(); + if (Globals.cls.state >= Defines.ca_connected) to = Globals.cls.netchan.remote_address; else { if (Globals.rcon_address.string.length() == 0) { ! Com.Printf("You must either be connected,\nor set the 'rcon_address' cvar\nto issue rcon commands\n"); return; } NET.StringToAdr(Globals.rcon_address.string, to); ! if (to.port == 0) to.port = Defines.PORT_SERVER; } message.append('\0'); String b = message.toString(); ! NET.SendPacket(Defines.NS_CLIENT, b.length(), Lib.stringToBytes(b), to); } }; *************** *** 382,390 **** }; ! /* ! * ================= CL_Changing_f * ! * Just sent as a hint to the client that they should drop to full console ! * ================= */ static xcommand_t Changing_f = new xcommand_t() { --- 365,372 ---- }; ! /** ! * Changing_f * ! * Just sent as a hint to the client that they should drop to full console. */ static xcommand_t Changing_f = new xcommand_t() { *************** *** 404,411 **** }; ! /* ! * ================= CL_Reconnect_f * ! * The server is changing levels ================= */ static xcommand_t Reconnect_f = new xcommand_t() { --- 386,393 ---- }; ! /** ! * Reconnect_f * ! * The server is changing levels. */ static xcommand_t Reconnect_f = new xcommand_t() { *************** *** 440,445 **** }; ! /* ! * ================= CL_PingServers_f ================= */ static xcommand_t PingServers_f = new xcommand_t() { --- 422,427 ---- }; ! /** ! * PingServers_f */ static xcommand_t PingServers_f = new xcommand_t() { *************** *** 499,506 **** }; ! /* ! * ================= CL_Skins_f * ! * Load or download any custom player skins and models ================= */ static xcommand_t Skins_f = new xcommand_t() { --- 481,488 ---- }; ! /** ! * Skins_f * ! * Load or download any custom player skins and models. */ static xcommand_t Skins_f = new xcommand_t() { *************** *** 521,526 **** }; ! /* ! * ============== CL_Userinfo_f ============== */ static xcommand_t Userinfo_f = new xcommand_t() { --- 503,508 ---- }; ! /** ! * Userinfo_f */ static xcommand_t Userinfo_f = new xcommand_t() { *************** *** 531,539 **** }; ! /* ! * ================= CL_Snd_Restart_f * * Restart the sound subsystem so it can pick up new parameters and flush ! * all sounds ================= */ static xcommand_t Snd_Restart_f = new xcommand_t() { --- 513,521 ---- }; ! /** ! * Snd_Restart_f * * Restart the sound subsystem so it can pick up new parameters and flush ! * all sounds. */ static xcommand_t Snd_Restart_f = new xcommand_t() { *************** *** 553,568 **** static String env_suf[] = { "rt", "bk", "lf", "ft", "up", "dn" }; ! /* ! * ================= CL_Precache_f ! * * The server will send this command right before allowing the client into ! * the server ================= */ static xcommand_t Precache_f = new xcommand_t() { public void execute() { ! /* ! * Yet another hack to let old demos work the old precache sequence ! */ ! if (Cmd.Argc() < 2) { --- 535,545 ---- static String env_suf[] = { "rt", "bk", "lf", "ft", "up", "dn" }; ! /** * The server will send this command right before allowing the client into ! * the server. */ static xcommand_t Precache_f = new xcommand_t() { public void execute() { ! // Yet another hack to let old demos work the old precache sequence. if (Cmd.Argc() < 2) { *************** *** 571,575 **** CM.CM_LoadMap(Globals.cl.configstrings[Defines.CS_MODELS + 1], true, iw); ! int mapchecksum = iw[0]; CL_parse.RegisterSounds(); CL_view.PrepRefresh(); --- 548,552 ---- CM.CM_LoadMap(Globals.cl.configstrings[Defines.CS_MODELS + 1], true, iw); ! CL_parse.RegisterSounds(); CL_view.PrepRefresh(); *************** *** 586,612 **** }; - /* - * ================== CL_Frame - * - * ================== - */ private static int extratime; // ============================================================================ ! /* ! * =============== CL_Shutdown * * FIXME: this is a callback from Sys_Quit and Com_Error. It would be better * to run quit through here before the final handoff to the sys code. - * =============== */ static boolean isdown = false; ! /* ! * ==================== CL_WriteDemoMessage * * Dumps the current net message, prefixed by the length - * ==================== */ static void WriteDemoMessage() { --- 563,582 ---- }; private static int extratime; // ============================================================================ ! /** ! * Shutdown * * FIXME: this is a callback from Sys_Quit and Com_Error. It would be better * to run quit through here before the final handoff to the sys code. */ static boolean isdown = false; ! /** ! * WriteDemoMessage * * Dumps the current net message, prefixed by the length */ static void WriteDemoMessage() { *************** *** 624,632 **** } ! /* ! * ======================= CL_SendConnectPacket * * We have gotten a challenge from the server, so try and connect. - * ====================== */ static void SendConnectPacket() { --- 594,601 ---- } ! /** ! * SendConnectPacket * * We have gotten a challenge from the server, so try and connect. */ static void SendConnectPacket() { *************** *** 651,658 **** } ! /* ! * ================= CL_CheckForResend * ! * Resend a connect message if the last one has timed out ================= */ static void CheckForResend() { --- 620,627 ---- } ! /** ! * CheckForResend * ! * Resend a connect message if the last one has timed out. */ static void CheckForResend() { *************** *** 683,691 **** } if (adr.port == 0) - // adr.port = BigShort(PORT_SERVER); adr.port = Defines.PORT_SERVER; ! Globals.cls.connect_time = Globals.cls.realtime; // for retransmit ! // requests Com.Printf("Connecting to " + Globals.cls.servername + "...\n"); --- 652,659 ---- } if (adr.port == 0) adr.port = Defines.PORT_SERVER; ! // for retransmit requests ! Globals.cls.connect_time = Globals.cls.realtime; Com.Printf("Connecting to " + Globals.cls.servername + "...\n"); *************** *** 694,703 **** } ! /* ! * ===================== CL_ClearState * - * ===================== */ - static void ClearState() { S.StopAllSounds(); --- 662,669 ---- } ! /** ! * ClearState * */ static void ClearState() { S.StopAllSounds(); *************** *** 715,726 **** } ! /* ! * ===================== CL_Disconnect * * Goes from a connected state to full screen console state Sends a * disconnect message to the server This is also called on Com_Error, so it ! * shouldn't cause any errors ===================== */ - static void Disconnect() { --- 681,691 ---- } ! /** ! * Disconnect * * Goes from a connected state to full screen console state Sends a * disconnect message to the server This is also called on Com_Error, so it ! * shouldn't cause any errors. */ static void Disconnect() { *************** *** 742,746 **** Math3D.VectorClear(Globals.cl.refdef.blend); ! //re.CinematicSetPalette(null); Menu.ForceMenuOff(); --- 707,712 ---- Math3D.VectorClear(Globals.cl.refdef.blend); ! ! Globals.re.CinematicSetPalette(null); Menu.ForceMenuOff(); *************** *** 748,752 **** Globals.cls.connect_time = 0; ! // SCR.StopCinematic(); if (Globals.cls.demorecording) --- 714,718 ---- Globals.cls.connect_time = 0; ! SCR.StopCinematic(); if (Globals.cls.demorecording) *************** *** 755,761 **** // send a disconnect message to the server fin = (char) Defines.clc_stringcmd + "disconnect"; ! Netchan.Transmit(Globals.cls.netchan, fin.length(), fin.getBytes()); ! Netchan.Transmit(Globals.cls.netchan, fin.length(), fin.getBytes()); ! Netchan.Transmit(Globals.cls.netchan, fin.length(), fin.getBytes()); ClearState(); --- 721,727 ---- // send a disconnect message to the server fin = (char) Defines.clc_stringcmd + "disconnect"; ! Netchan.Transmit(Globals.cls.netchan, fin.length(), Lib.stringToBytes(fin)); ! Netchan.Transmit(Globals.cls.netchan, fin.length(), Lib.stringToBytes(fin)); ! Netchan.Transmit(Globals.cls.netchan, fin.length(), Lib.stringToBytes(fin)); ClearState(); *************** *** 765,770 **** Lib.fclose(Globals.cls.download); Globals.cls.download = null; - // fclose(cls.download); - // cls.download = NULL; } --- 731,734 ---- *************** *** 772,779 **** } ! /* ! * ================= CL_ParseStatusMessage * ! * Handle a reply from a ping ================= */ static void ParseStatusMessage() { --- 736,743 ---- } ! /** ! * ParseStatusMessage * ! * Handle a reply from a ping. */ static void ParseStatusMessage() { *************** *** 786,793 **** } ! /* ! * ================= CL_ConnectionlessPacket * ! * Responses to broadcasts, etc ================= */ static void ConnectionlessPacket() { --- 750,757 ---- } ! /** ! * ConnectionlessPacket * ! * Responses to broadcasts, etc */ static void ConnectionlessPacket() { *************** *** 840,844 **** if (c.equals("print")) { s = MSG.ReadString(Globals.net_message); ! Com.Printf(s); return; } --- 804,809 ---- if (c.equals("print")) { s = MSG.ReadString(Globals.net_message); ! if (s.length() > 0) ! Com.Printf(s); return; } *************** *** 868,873 **** ! /* ! * ================= CL_ReadPackets ================= */ static void ReadPackets() { --- 833,838 ---- ! /** ! * ReadPackets */ static void ReadPackets() { *************** *** 928,933 **** // ============================================================================= ! /* ! * ============== CL_FixUpGender_f ============== */ static void FixUpGender() { --- 893,898 ---- // ============================================================================= ! /** ! * FixUpGender_f */ static void FixUpGender() { *************** *** 1272,1277 **** } ! /* ! * ================= CL_InitLocal ================= */ public static void InitLocal() { --- 1237,1242 ---- } ! /** ! * InitLocal */ public static void InitLocal() { *************** *** 1422,1429 **** } ! /* ! * =============== CL_WriteConfiguration * ! * Writes key bindings and archived cvars to config.cfg =============== */ public static void WriteConfiguration() { --- 1387,1394 ---- } ! /** ! * WriteConfiguration * ! * Writes key bindings and archived cvars to config.cfg. */ public static void WriteConfiguration() { *************** *** 1455,1458 **** --- 1420,1426 ---- } + /** + * FixCvarCheats + */ public static void FixCvarCheats() { int i; *************** *** 1483,1492 **** } ! // ============================================================================ ! /* ! * ================== CL_SendCommand ! * ! * ================== */ public static void SendCommand() { --- 1451,1458 ---- } ! // ============================================================= ! /** ! * SendCommand */ public static void SendCommand() { *************** *** 1512,1515 **** --- 1478,1484 ---- // private static int lasttimecalled; + /** + * Frame + */ public static void Frame(int msec) { *************** *** 1573,1577 **** CL_fx.RunDLights(); CL_fx.RunLightStyles(); ! SCR.RunConsole(); --- 1542,1546 ---- CL_fx.RunDLights(); CL_fx.RunLightStyles(); ! SCR.RunCinematic(); SCR.RunConsole(); *************** *** 1586,1589 **** --- 1555,1561 ---- } + /** + * Shutdown + */ public static void Shutdown() { *************** *** 1602,1606 **** /** ! * initialize client subsystem */ public static void Init() { --- 1574,1578 ---- /** ! * Initialize client subsystem. */ public static void Init() { Index: Key.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Key.java,v retrieving revision 1.11 retrieving revision 1.11.4.1 diff -C2 -d -r1.11 -r1.11.4.1 *** Key.java 7 Jun 2005 12:57:21 -0000 1.11 --- Key.java 25 Dec 2005 18:11:24 -0000 1.11.4.1 *************** *** 705,709 **** key_lines[edit_line][1] = '/'; ! byte[] bytes = s.getBytes(); System.arraycopy(bytes, 0, key_lines[edit_line], 2, bytes.length); key_linepos = bytes.length + 2; --- 705,709 ---- key_lines[edit_line][1] = '/'; ! byte[] bytes = Lib.stringToBytes(s); System.arraycopy(bytes, 0, key_lines[edit_line], 2, bytes.length); key_linepos = bytes.length + 2; Index: client_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/client_state_t.java,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** client_state_t.java 26 Oct 2004 18:18:19 -0000 1.4 --- client_state_t.java 25 Dec 2005 18:11:22 -0000 1.4.8.1 *************** *** 32,35 **** --- 32,36 ---- import java.io.RandomAccessFile; + import java.nio.ByteBuffer; public class client_state_t { *************** *** 107,111 **** // non-gameserver infornamtion // FIXME: move this cinematic stuff into the cin_t structure ! RandomAccessFile cinematic_file; int cinematictime; // cls.realtime for first cinematic frame --- 108,112 ---- // non-gameserver infornamtion // FIXME: move this cinematic stuff into the cin_t structure ! ByteBuffer cinematic_file; int cinematictime; // cls.realtime for first cinematic frame Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** SCR.java 1 Jul 2005 14:20:52 -0000 1.15 --- SCR.java 25 Dec 2005 18:11:24 -0000 1.15.2.1 *************** *** 33,36 **** --- 33,37 ---- import jake2.qcommon.*; import jake2.sound.S; + import jake2.sys.Sys; import jake2.sys.Timer; import jake2.util.Lib; *************** *** 38,42 **** --- 39,47 ---- import java.awt.Dimension; + import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.util.Arrays; /** *************** *** 1369,1379 **** */ - // typedef struct - // { - // byte *data; - // int count; - // } cblock_t; - // - private static class cinematics_t { boolean restart_sound; --- 1374,1377 ---- *************** *** 1473,1504 **** /** ! * TODO StopCinematic */ static void StopCinematic() { ! cl.cinematictime = 0; // done ! cin.pic = null; ! cin.pic_pending = null; ! if (cl.cinematicpalette_active) { ! re.CinematicSetPalette(null); ! cl.cinematicpalette_active = false; } - // if (cl.cinematic_file) - // { - // fclose (cl.cinematic_file); - // cl.cinematic_file = NULL; - // } - // if (cin.hnodes1) - // { - // Z_Free (cin.hnodes1); - // cin.hnodes1 = NULL; - // } - // - // // switch back down to 11 khz sound if necessary - // if (cin.restart_sound) - // { - // cin.restart_sound = false; - // CL_Snd_Restart_f (); - // } - // } --- 1471,1497 ---- /** ! * StopCinematic */ static void StopCinematic() { ! if (cin.restart_sound) { ! // done ! cl.cinematictime = 0; ! cin.pic = null; ! cin.pic_pending = null; ! if (cl.cinematicpalette_active) { ! re.CinematicSetPalette(null); ! cl.cinematicpalette_active = false; ! } ! if (cl.cinematic_file != null) { ! // free the mapped byte buffer ! cl.cinematic_file = null; ! } ! if (cin.hnodes1 != null) { ! cin.hnodes1 = null; ! } ! ! S.disableStreaming(); ! cin.restart_sound = false; } } *************** *** 1516,1799 **** // ========================================================================== ! // /* ! // ================== ! // SmallestNode1 ! // ================== ! // */ ! // int SmallestNode1 (int numhnodes) ! // { ! // int i; ! // int best, bestnode; ! // ! // best = 99999999; ! // bestnode = -1; ! // for (i=0 ; i<numhnodes ; i++) ! // { ! // if (cin.h_used[i]) ! // continue; ! // if (!cin.h_count[i]) ! // continue; ! // if (cin.h_count[i] < best) ! // { ! // best = cin.h_count[i]; ! // bestnode = i; ! // } ! // } ! // ! // if (bestnode == -1) ! // return -1; ! // ! // cin.h_used[bestnode] = true; ! // return bestnode; ! // } ! // ! // ! // /* ! // ================== ! // Huff1TableInit ! // ! // Reads the 64k counts table and initializes the node trees ! // ================== ! // */ ! // void Huff1TableInit (void) ! // { ! // int prev; ! // int j; ! // int *node, *nodebase; ! // byte counts[256]; ! // int numhnodes; ! // ! // cin.hnodes1 = Z_Malloc (256*256*2*4); ! // memset (cin.hnodes1, 0, 256*256*2*4); ! // ! // for (prev=0 ; prev<256 ; prev++) ! // { ! // memset (cin.h_count,0,sizeof(cin.h_count)); ! // memset (cin.h_used,0,sizeof(cin.h_used)); ! // ! // // read a row of counts ! // FS_Read (counts, sizeof(counts), cl.cinematic_file); ! // for (j=0 ; j<256 ; j++) ! // cin.h_count[j] = counts[j]; ! // ! // // build the nodes ! // numhnodes = 256; ! // nodebase = cin.hnodes1 + prev*256*2; ! // ! // while (numhnodes != 511) ! // { ! // node = nodebase + (numhnodes-256)*2; ! // ! // // pick two lowest counts ! // node[0] = SmallestNode1 (numhnodes); ! // if (node[0] == -1) ! // break; // no more ! // ! // node[1] = SmallestNode1 (numhnodes); ! // if (node[1] == -1) ! // break; ! // ! // cin.h_count[numhnodes] = cin.h_count[node[0]] + cin.h_count[node[1]]; ! // numhnodes++; ! // } ! // ! // cin.numhnodes1[prev] = numhnodes-1; ! // } ! // } ! // ! // /* ! // ================== ! // Huff1Decompress ! // ================== ! // */ ! // cblock_t Huff1Decompress (cblock_t in) ! // { ! // byte *input; ! // byte *out_p; ! // int nodenum; ! // int count; ! // cblock_t out; ! // int inbyte; ! // int *hnodes, *hnodesbase; ! //// int i; ! // ! // // get decompressed count ! // count = in.data[0] + (in.data[1]<<8) + (in.data[2]<<16) + ! // (in.data[3]<<24); ! // input = in.data + 4; ! // out_p = out.data = Z_Malloc (count); ! // ! // // read bits ! // ! // hnodesbase = cin.hnodes1 - 256*2; // nodes 0-255 aren't stored ! // ! // hnodes = hnodesbase; ! // nodenum = cin.numhnodes1[0]; ! // while (count) ! // { ! // inbyte = *input++; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // //----------- ! // if (nodenum < 256) ! // { ! // hnodes = hnodesbase + (nodenum<<9); ! // *out_p++ = nodenum; ! // if (!--count) ! // break; ! // nodenum = cin.numhnodes1[nodenum]; ! // } ! // nodenum = hnodes[nodenum*2 + (inbyte&1)]; ! // inbyte >>=1; ! // } ! // ! // if (input - in.data != in.count && input - in.data != in.count+1) ! // { ! // Com_Printf ("Decompression overread by %i", (input - in.data) - ! // in.count); ! // } ! // out.count = out_p - out.data; ! // ! // return out; ! // } ! // /** ! * TODO ReadNextFrame */ static byte[] ReadNextFrame() { ! // TODO implement video frame loading ! return null; ! // int r; ! // int command; ! // byte samples[22050/14*4]; ! // byte compressed[0x20000]; ! // int size; ! // byte *pic; ! // cblock_t in, huf1; ! // int start, end, count; ! // ! // // read the next frame ! // r = fread (&command, 4, 1, cl.cinematic_file); ! // if (r == 0) // we'll give it one more chance ! // r = fread (&command, 4, 1, cl.cinematic_file); ! // ! // if (r != 1) ! // return NULL; ! // command = LittleLong(command); ! // if (command == 2) ! // return NULL; // last frame marker ! // ! // if (command == 1) ! // { // read palette ! // FS_Read (cl.cinematicpalette, sizeof(cl.cinematicpalette), ! // cl.cinematic_file); ! // cl.cinematicpalette_active=0; // dubious.... exposes an edge case ! // } ! // ! // // decompress the next frame ! // FS_Read (&size, 4, cl.cinematic_file); ! // size = LittleLong(size); ! // if (size > sizeof(compressed) || size < 1) ! // Com_Error (ERR_DROP, "Bad compressed frame size"); ! // FS_Read (compressed, size, cl.cinematic_file); ! // ! // // read sound ! // start = cl.cinematicframe*cin.s_rate/14; ! // end = (cl.cinematicframe+1)*cin.s_rate/14; ! // count = end - start; ! // ! // FS_Read (samples, count*cin.s_width*cin.s_channels, cl.cinematic_file); ! // ! // S_RawSamples (count, cin.s_rate, cin.s_width, cin.s_channels, samples); ! // ! // in.data = compressed; ! // in.count = size; ! // ! // huf1 = Huff1Decompress (in); ! // ! // pic = huf1.data; ! // ! // cl.cinematicframe++; ! // ! // return pic; } ! // ! // /** * RunCinematic --- 1509,1743 ---- // ========================================================================== ! /** ! * SmallestNode1 ! * ! */ ! private static int SmallestNode1(int numhnodes) { ! ! int best = 99999999; ! int bestnode = -1; ! for (int i = 0; i < numhnodes; i++) { ! if (cin.h_used[i] != 0) ! continue; ! if (cin.h_count[i] == 0) ! continue; ! if (cin.h_count[i] < best) { ! best = cin.h_count[i]; ! bestnode = i; ! } ! } ! ! if (bestnode == -1) ! return -1; ! ! cin.h_used[bestnode] = 1; // true ! return bestnode; ! } ! /** ! * Huff1TableInit ! * ! * Reads the 64k counts table and initializes the node trees. ! * ! */ ! private static void Huff1TableInit() { ! int[] node; ! byte[] counts = new byte[256]; ! int numhnodes; ! ! cin.hnodes1 = new int[256 * 256 * 2]; ! Arrays.fill(cin.hnodes1, 0); ! ! for (int prev = 0; prev < 256; prev++) { ! Arrays.fill(cin.h_count, 0); ! Arrays.fill(cin.h_used, 0); ! ! // read a row of counts ! cl.cinematic_file.get(counts); ! for (int j = 0; j < 256; j++) ! cin.h_count[j] = counts[j] & 0xFF; ! ! // build the nodes ! numhnodes = 256; ! int nodebase = 0 + prev * 256 * 2; ! int index = 0; ! node = cin.hnodes1; ! while (numhnodes != 511) { ! index = nodebase + (numhnodes - 256) * 2; ! ! // pick two lowest counts ! node[index] = SmallestNode1(numhnodes); ! if (node[index] == -1) ! break; // no more ! ! node[index + 1] = SmallestNode1(numhnodes); ! if (node[index + 1] == -1) ! break; ! ! cin.h_count[numhnodes] = cin.h_count[node[index]] + cin.h_count[node[index + 1]]; ! numhnodes++; ! } ! ! cin.numhnodes1[prev] = numhnodes - 1; ! } ! } ! ! /** ! * Huff1Decompress ! * ! */ ! private static byte[] Huff1Decompress(byte[] in, int size) { ! // get decompressed count ! int count = (in[0] & 0xFF) | ((in[1] & 0xFF)<< 8) | ((in[2] & 0xFF) << 16) | ((in[3] & 0xFF) << 24); ! // used as index for in[]; ! int input = 4; ! byte[] out = new byte[count]; ! // used as index for out[]; ! int out_p = 0; ! ! // read bits ! ! int hnodesbase = -256 * 2; // nodes 0-255 aren't stored ! int index = hnodesbase; ! int[] hnodes = cin.hnodes1; ! int nodenum = cin.numhnodes1[0]; ! int inbyte; ! while (count != 0) { ! inbyte = in[input++] & 0xFF; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! ! if (nodenum < 256) { ! index = hnodesbase + (nodenum << 9); ! out[out_p++] = (byte) nodenum; ! if (--count == 0) ! break; ! nodenum = cin.numhnodes1[nodenum]; ! } ! nodenum = hnodes[index + nodenum * 2 + (inbyte & 1)]; ! inbyte >>= 1; ! } ! ! if (input != size && input != size + 1) { ! Com.Printf("Decompression overread by " + (input - size)); ! } ! ! return out; ! } ! ! private static byte[] compressed = new byte[0x20000]; ! ! /** ! * ReadNextFrame */ static byte[] ReadNextFrame() { ! ! ByteBuffer file = cl.cinematic_file; ! ! // read the next frame ! int command = file.getInt(); ! ! if (command == 2) { ! // last frame marker ! return null; ! } ! ! if (command == 1) { ! // read palette ! file.get(cl.cinematicpalette); ! // dubious.... exposes an edge case ! cl.cinematicpalette_active = false; ! } ! // decompress the next frame ! int size = file.getInt(); ! if (size > compressed.length || size < 1) ! Com.Error(ERR_DROP, "Bad compressed frame size:" + size); ! ! file.get(compressed, 0, size); ! ! // read sound ! int start = cl.cinematicframe * cin.s_rate / 14; ! int end = (cl.cinematicframe + 1) * cin.s_rate / 14; ! int count = end - start; ! ! S.RawSamples(count, cin.s_rate, cin.s_width, cin.s_channels, file.slice()); ! // skip the sound samples ! file.position(file.position() + count * cin.s_width * cin.s_channels); ! ! byte[] pic = Huff1Decompress(compressed, size); ! cl.cinematicframe++; ! ! return pic; } ! /** * RunCinematic *************** *** 1805,1833 **** } ! if (cl.cinematicframe == -1) ! return; // static image ! ! if (cls.key_dest != key_game) ! { // pause if menu or console is up ! cl.cinematictime = cls.realtime - cl.cinematicframe*1000/14; return; } - int frame = (int)((cls.realtime - cl.cinematictime) * 14.0f/1000); if (frame <= cl.cinematicframe) return; ! ! if (frame > cl.cinematicframe+1) ! { ! Com.Println("Dropped frame: " + frame + " > " + (cl.cinematicframe+1)); ! cl.cinematictime = cls.realtime - cl.cinematicframe*1000/14; } cin.pic = cin.pic_pending; cin.pic_pending = ReadNextFrame(); ! if (cin.pic_pending == null) ! { StopCinematic(); FinishCinematic(); ! cl.cinematictime = 1; // hack to get the black screen behind loading BeginLoadingPlaque(); cl.cinematictime = 0; --- 1749,1782 ---- } ! if (cl.cinematicframe == -1) { ! // static image ! return; ! } ! ! if (cls.key_dest != key_game) { ! // pause if menu or console is up ! cl.cinematictime = cls.realtime - cl.cinematicframe * 1000 / 14; return; } + + int frame = (int) ((cls.realtime - cl.cinematictime) * 14.0f / 1000); if (frame <= cl.cinematicframe) return; ! ! if (frame > cl.cinematicframe + 1) { ! Com.Println("Dropped frame: " + frame + " > " ! + (cl.cinematicframe + 1)); ! cl.cinematictime = cls.realtime - cl.cinematicframe * 1000 / 14; } + cin.pic = cin.pic_pending; cin.pic_pending = ReadNextFrame(); ! ! if (cin.pic_pending == null) { StopCinematic(); FinishCinematic(); ! // hack to get the black screen behind loading ! cl.cinematictime = 1; BeginLoadingPlaque(); cl.cinematictime = 0; *************** *** 1868,1880 **** /** ! * TODO PlayCinematic */ static void PlayCinematic(String arg) { ! // int width, height; ! // byte *palette; ! // char name[MAX_OSPATH], *dot; ! // int old_khz; ! // ! // // make sure CD isn't playing music //CDAudio.Stop(); --- 1817,1825 ---- /** ! * PlayCinematic */ static void PlayCinematic(String arg) { ! ! // make sure CD isn't playing music //CDAudio.Stop(); *************** *** 1894,1939 **** return; } ! // ! // Com_sprintf (name, sizeof(name), "video/%s", arg); ! // FS_FOpenFile (name, &cl.cinematic_file); ! // if (!cl.cinematic_file) ! // { ! // Com_Error (ERR_DROP, "Cinematic %s not found.\n", name); ! FinishCinematic(); ! cl.cinematictime = 0; // done ! return; ! // } ! // ! // SCR_EndLoadingPlaque (); ! // ! // cls.state = ca_active; ! // ! // FS_Read (&width, 4, cl.cinematic_file); ! // FS_Read (&height, 4, cl.cinematic_file); ! // cin.width = LittleLong(width); ! // cin.height = LittleLong(height); ! // ! // FS_Read (&cin.s_rate, 4, cl.cinematic_file); ! // cin.s_rate = LittleLong(cin.s_rate); ! // FS_Read (&cin.s_width, 4, cl.cinematic_file); ! // cin.s_width = LittleLong(cin.s_width); ! // FS_Read (&cin.s_channels, 4, cl.cinematic_file); ! // cin.s_channels = LittleLong(cin.s_channels); ! // ! // Huff1TableInit (); ! // ! // // switch up to 22 khz sound if necessary ! // old_khz = Cvar_VariableValue ("s_khz"); ! // if (old_khz != cin.s_rate/1000) ! // { ! // cin.restart_sound = true; ! // Cvar_SetValue ("s_khz", cin.s_rate/1000); ! // CL_Snd_Restart_f (); ! // Cvar_SetValue ("s_khz", old_khz); ! // } ! // ! // cl.cinematicframe = 0; ! // cin.pic = SCR_ReadNextFrame (); ! // cl.cinematictime = Sys_Milliseconds (); } } \ No newline at end of file --- 1839,1871 ---- return; } ! ! String name = "video/" + arg; ! cl.cinematic_file = FS.LoadMappedFile(name); ! if (cl.cinematic_file == null) { ! //Com.Error(ERR_DROP, "Cinematic " + name + " not found.\n"); ! FinishCinematic(); ! // done ! cl.cinematictime = 0; ! return; ! } ! ! EndLoadingPlaque(); ! ! cls.state = ca_active; ! ! cl.cinematic_file.order(ByteOrder.LITTLE_ENDIAN); ! ByteBuffer file = cl.cinematic_file; ! cin.width = file.getInt(); ! cin.height = file.getInt(); ! cin.s_rate = file.getInt(); ! cin.s_width = file.getInt(); ! cin.s_channels = file.getInt(); ! ! Huff1TableInit(); ! ! cin.restart_sound = true; ! cl.cinematicframe = 0; ! cin.pic = ReadNextFrame(); ! cl.cinematictime = Timer.Milliseconds(); } } \ No newline at end of file Index: CL_inv.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_inv.java,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** CL_inv.java 22 Sep 2004 19:22:08 -0000 1.2 --- CL_inv.java 25 Dec 2005 18:11:22 -0000 1.2.12.1 *************** *** 32,35 **** --- 32,36 ---- import jake2.qcommon.Com; import jake2.qcommon.MSG; + import jake2.util.Lib; import jake2.util.Vargs; *************** *** 59,68 **** } ! static void SetStringHighBit(String s) { ! byte[] b = s.getBytes(); for (int i = 0; i < b.length; i++) { b[i] = (byte) (b[i] | 128); } ! s = new String(b); } --- 60,69 ---- } ! static String getHighBitString(String s) { ! byte[] b = Lib.stringToBytes(s); for (int i = 0; i < b.length; i++) { b[i] = (byte) (b[i] | 128); } ! return Lib.bytesToString(b); } *************** *** 132,136 **** Globals.cl.configstrings[Defines.CS_ITEMS + item])); if (item != selected) ! SetStringHighBit(string); else // draw a blinky cursor by the selected item { --- 133,137 ---- Globals.cl.configstrings[Defines.CS_ITEMS + item])); if (item != selected) ! string = getHighBitString(string); else // draw a blinky cursor by the selected item { |