Merge branch 'terencehill/eraseable_functions'
authorterencehill <piuntn@gmail.com>
Sat, 1 Jul 2017 12:10:08 +0000 (14:10 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 1 Jul 2017 12:10:08 +0000 (14:10 +0200)
69 files changed:
.tx/merge-base
bal-wep-overkill.cfg
common.pl.po
defaultXonotic.cfg
effects-high.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/notify.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qh
qcsrc/client/shownames.qc
qcsrc/client/view.qc
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigames.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/itemstime/itemstime.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/net_linked.qh
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/physics/movetypes/toss.qc
qcsrc/common/physics/player.qh
qcsrc/common/playerstats.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/util.qh
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/lib/counting.qh
qcsrc/lib/csqcmodel/cl_model.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/csqcmodel/net.qh [new file with mode: 0644]
qcsrc/lib/csqcmodel/sv_model.qc
qcsrc/lib/cvar.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/vector.qh
qcsrc/menu/draw.qh
qcsrc/server/bot/default/scripting.qh
qcsrc/server/compat/_mod.inc
qcsrc/server/compat/_mod.qh
qcsrc/server/compat/quake2.qc [new file with mode: 0644]
qcsrc/server/compat/quake2.qh [new file with mode: 0644]
qcsrc/server/compat/quake3.qc
qcsrc/server/round_handler.qc

index 92b03d7f725e6db9d9440eb1f7e7262535522c70..bae0563ae3bdda5d17f733d3f5910c1af6df7d76 100644 (file)
@@ -1 +1 @@
-Sun Jun 18 07:23:51 CEST 2017
+Thu Jun 29 07:24:55 CEST 2017
index f423417f83b854c752b8640871580c9142886b78..9cfffed10b02114e478653d4ea7ea117ad744c0e 100644 (file)
@@ -32,7 +32,7 @@ set g_balance_blaster_weaponstartoverride -1
 set g_balance_blaster_weaponthrowable 0
 // }}}
 // {{{ #2: Shotgun
-set g_balance_shotgun_primary_ammo 6.25
+set g_balance_shotgun_primary_ammo 3
 set g_balance_shotgun_primary_animtime 0.65
 set g_balance_shotgun_primary_bullets 10
 set g_balance_shotgun_primary_damage 17
@@ -40,7 +40,7 @@ set g_balance_shotgun_primary_force 80
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_primary_spread 0.07
-set g_balance_shotgun_reload_ammo 50
+set g_balance_shotgun_reload_ammo 24
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_animtime 1.15
index bee24ccf8ce97887993878c880e637ed827fc2da..a1c9eb46f8f9f5d13e0f2dbd22b549b49e70c004 100644 (file)
@@ -19,8 +19,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-03-30 07:23+0200\n"
-"PO-Revision-Date: 2017-04-05 18:45+0000\n"
-"Last-Translator: Kriss Chr <kriss7475@gmail.com>\n"
+"PO-Revision-Date: 2017-06-28 19:15+0000\n"
+"Last-Translator: Amadeusz Sławiński <amade@asmblr.net>\n"
 "Language-Team: Polish (http://www.transifex.com/team-xonotic/xonotic/"
 "language/pl/)\n"
 "Language: pl\n"
@@ -9236,7 +9236,7 @@ msgid ""
 "^1ERROR: Texture compression is required but not supported.\n"
 "^1Expect visual problems.\n"
 msgstr ""
-"^1BŁĄÐ:: Kompresja z tekstury jest wymagana, ale nie wspomagana.\n"
+"^1BŁĄD:: Kompresja z tekstury jest wymagana, ale nie wspomagana.\n"
 "^1Oczekuj problemów wizualnych.\n"
 
 #: qcsrc/menu/xonotic/util.qc:780
index 625c5736b17a43cb2ad85e53f8565a90d240fd27..f2a6a201237ff547f7c6b245444c8d5a7cd8f4e8 100644 (file)
@@ -229,6 +229,7 @@ seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound"
 seta cl_hitsound_nom_damage 25 "damage amount at which hitsound bases pitch off"
 
 seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
+seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen"
 seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
 seta cl_eventchase_distance 140 "final camera distance"
 seta cl_eventchase_generator_distance 400 "final camera distance while viewing generator explosion"
index a514ce5cb67d9f2eb563ff8d4220d3a510ee61f7..48c8253a3a2146538f1a9dfa6cc388f76b616ba4 100644 (file)
@@ -5,7 +5,7 @@ cl_particles 1
 cl_particles_quality 1.0
 cl_damageeffect 1
 cl_spawn_point_particles 1
-cl_playerdetailreduction 4.0
+cl_playerdetailreduction 4
 gl_flashblend 0
 gl_picmip -1
 mod_q3bsp_nolightmaps 0
index 5ebdeaeec999de16665fbadd76f228d2edd9ffd3..95726571679ae6e985e0391b10f43c8a8af6a63e 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.86 0.35 0"
 seta hud_progressbar_vehicles_ammo1_color "0.77 0.67 0"
 seta hud_progressbar_vehicles_ammo2_color "0.86 0.35 0"
 
-seta _hud_panelorder "17 15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.005000"
@@ -179,7 +179,7 @@ seta hud_panel_racetimer_bg_padding ""
 
 seta hud_panel_vote_pos "0.740000 0.690000"
 seta hud_panel_vote_size "0.190000 0.090000"
-seta hud_panel_vote_bg " "
+seta hud_panel_vote_bg "border_default"
 seta hud_panel_vote_bg_color ""
 seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
@@ -201,7 +201,7 @@ seta hud_panel_modicons_freezetag_layout "1"
 
 seta hud_panel_pressedkeys_pos "0.445000 0.710000"
 seta hud_panel_pressedkeys_size "0.110000 0.090000"
-seta hud_panel_pressedkeys_bg " "
+seta hud_panel_pressedkeys_bg "border_default"
 seta hud_panel_pressedkeys_bg_color ""
 seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
index 8f64ddebb6e943040a0c8458f64ecc02a22f4a2b..3f4fe39fabf84f5ca284a92daa19b42a20fefc30 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0"
 seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0"
 
-seta _hud_panelorder "17 15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index 31926d2f5ab9d906dfbf79f26d2e5d9e8441ebfe..609ab766de832baf1f9824963913af9994403639 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0"
 seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0"
 
-seta _hud_panelorder "17 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index 380b65814864325977cb29475ce31d896ed71dd0..b7a7d20ab2d69e566c2dec5bdcaa8bebd5d60d55 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0"
 seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0"
 
-seta _hud_panelorder "17 15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index 96b4f508f50c1a193ad5dca91664274a96b6d781..ce818681191a21abeec552cf46522a092028e9d9 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0"
 seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0"
 
-seta _hud_panelorder "17 15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index ae786574f3bfcbd6a59ed889927f4d333617deb0..4159b01c7ddcc1fa0107dc399a29512f554ef460 100644 (file)
@@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0"
 seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0"
 
-seta _hud_panelorder "17 15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 18 23 19 20 21 22 23 24 "
+seta _hud_panelorder "17 15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 18 23 19 20 21 22 24 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
index 193b7ef7cae691955478d714797e2b41206e9dd9..d95958392bb9626e2cadba13cd6edf88394bdb98 100644 (file)
@@ -413,6 +413,7 @@ float autocvar_cl_hitsound_nom_damage = 25;
 float autocvar_cl_hitsound_antispam_time;
 int autocvar_cl_eventchase_death = 1;
 float autocvar_cl_eventchase_distance = 140;
+bool autocvar_cl_eventchase_frozen = false;
 float autocvar_cl_eventchase_speed = 1.3;
 vector autocvar_cl_eventchase_maxs = '12 12 8';
 vector autocvar_cl_eventchase_mins = '-12 -12 -8';
index fd46288c6779420d09f9d9e62d9b032c7ef16696..f6469a58b429dbbb1c7bff6f0b1702f4f6d45273 100644 (file)
@@ -109,10 +109,7 @@ vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspe
                rows = ceil(item_count/columns);
        }
 
-       if(vertical)
-               return eX * best_rows + eY * best_columns;
-       else
-               return eX * best_columns + eY * best_rows;
+       return (vertical) ? vec2(best_rows, best_columns) : vec2(best_columns, best_rows);
 }
 
 /*
index 444b33ec445db4e0cc82e3d459b7c7b0cc32bdb7..8eaef9068c3bb4f2e64abe72d136544e22773867 100644 (file)
@@ -11,12 +11,12 @@ REGISTRY(hud_panels, BITS(6))
 #define hud_panels_from(i) _hud_panels_from(i, NULL)
 REGISTER_REGISTRY(hud_panels)
 
-#define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \
+#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
        void draw_func(); \
        REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \
                this.panel_id = this.m_id; \
                this.panel_draw = draw_func; \
-               this.panel_name = #name; \
+               this.panel_name = strzone(strtolower(#id)); \
                this.panel_configflags = configflags; \
                this.panel_showflags = showflags; \
        }
@@ -31,7 +31,7 @@ REGISTER_REGISTRY(hud_panels)
                        panel.current_panel_bg, \
                        HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \
                        panel_bg_color, panel_bg_alpha, \
-                       HUD_Scale('1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) \
+                       HUD_Scale('1 1 0' * BORDER_MULTIPLIER * panel_bg_border) \
                ); \
 } MACRO_END
 
@@ -81,7 +81,7 @@ float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomrigh
 entity highlightedPanel;
 float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
 
-const float BORDER_MULTIPLIER = 0.25;
+const float BORDER_MULTIPLIER = 4;
 float scoreboard_bottom;
 int weapon_accuracy[Weapons_MAX];
 
@@ -206,31 +206,31 @@ int prev_p_health, prev_p_armor;
 
 void HUD_ItemsTime();
 
-REGISTER_HUD_PANEL(WEAPONS,         HUD_Weapons,        weapons,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // WEAPONS
-REGISTER_HUD_PANEL(AMMO,            HUD_Ammo,           ammo,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // AMMO
-REGISTER_HUD_PANEL(POWERUPS,        HUD_Powerups,       powerups,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // POWERUPS
-REGISTER_HUD_PANEL(HEALTHARMOR,     HUD_HealthArmor,    healtharmor,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // HEALTHARMOR
-REGISTER_HUD_PANEL(NOTIFY,          HUD_Notify,         notify,         PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // NOTIFY
-REGISTER_HUD_PANEL(TIMER,           HUD_Timer,          timer,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // TIMER
-REGISTER_HUD_PANEL(RADAR,           HUD_Radar,          radar,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RADAR
-REGISTER_HUD_PANEL(SCORE,           HUD_Score,          score,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // SCORE
-REGISTER_HUD_PANEL(RACETIMER,       HUD_RaceTimer,      racetimer,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RACETIMER
-REGISTER_HUD_PANEL(VOTE,            HUD_Vote,           vote,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE
-REGISTER_HUD_PANEL(MODICONS,        HUD_ModIcons,       modicons,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // MODICONS
-REGISTER_HUD_PANEL(PRESSEDKEYS,     HUD_PressedKeys,    pressedkeys,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PRESSEDKEYS
-REGISTER_HUD_PANEL(CHAT,            HUD_Chat,           chat,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT
-REGISTER_HUD_PANEL(ENGINEINFO,      HUD_EngineInfo,     engineinfo,     PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO
-REGISTER_HUD_PANEL(INFOMESSAGES,    HUD_InfoMessages,   infomessages,   PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // INFOMESSAGES
-REGISTER_HUD_PANEL(PHYSICS,         HUD_Physics,        physics,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PHYSICS
-REGISTER_HUD_PANEL(CENTERPRINT,     HUD_CenterPrint,    centerprint,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // CENTERPRINT
-REGISTER_HUD_PANEL(MINIGAME_BOARD,  HUD_MinigameBoard,  minigameboard,  PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_BOARD
-REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_STATUS
-REGISTER_HUD_PANEL(MINIGAME_HELP,   HUD_MinigameHelp,   minigamehelp,   PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_HELP
-REGISTER_HUD_PANEL(MINIGAME_MENU,   HUD_MinigameMenu,   minigamemenu,   PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAME_MENU
-REGISTER_HUD_PANEL(MAPVOTE,         MapVote_Draw,       mapvote,        PANEL_CONFIG_NO                          ,                                             PANEL_SHOW_MAPVOTE                     ) // MAPVOTE
-REGISTER_HUD_PANEL(ITEMSTIME,       HUD_ItemsTime,      itemstime,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // ITEMSTIME
-REGISTER_HUD_PANEL(QUICKMENU,       HUD_QuickMenu,      quickmenu,      PANEL_CONFIG_MAIN                        , PANEL_SHOW_MAINGAME                                                                ) // QUICKMENU
-REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
+REGISTER_HUD_PANEL(WEAPONS,         HUD_Weapons,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // WEAPONS
+REGISTER_HUD_PANEL(AMMO,            HUD_Ammo,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // AMMO
+REGISTER_HUD_PANEL(POWERUPS,        HUD_Powerups,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // POWERUPS
+REGISTER_HUD_PANEL(HEALTHARMOR,     HUD_HealthArmor,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // HEALTHARMOR
+REGISTER_HUD_PANEL(NOTIFY,          HUD_Notify,         PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // NOTIFY
+REGISTER_HUD_PANEL(TIMER,           HUD_Timer,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // TIMER
+REGISTER_HUD_PANEL(RADAR,           HUD_Radar,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RADAR
+REGISTER_HUD_PANEL(SCORE,           HUD_Score,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // SCORE
+REGISTER_HUD_PANEL(RACETIMER,       HUD_RaceTimer,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RACETIMER
+REGISTER_HUD_PANEL(VOTE,            HUD_Vote,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE
+REGISTER_HUD_PANEL(MODICONS,        HUD_ModIcons,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // MODICONS
+REGISTER_HUD_PANEL(PRESSEDKEYS,     HUD_PressedKeys,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PRESSEDKEYS
+REGISTER_HUD_PANEL(CHAT,            HUD_Chat,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT
+REGISTER_HUD_PANEL(ENGINEINFO,      HUD_EngineInfo,     PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO
+REGISTER_HUD_PANEL(INFOMESSAGES,    HUD_InfoMessages,   PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // INFOMESSAGES
+REGISTER_HUD_PANEL(PHYSICS,         HUD_Physics,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PHYSICS
+REGISTER_HUD_PANEL(CENTERPRINT,     HUD_CenterPrint,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // CENTERPRINT
+REGISTER_HUD_PANEL(MINIGAMEBOARD,   HUD_MinigameBoard,  PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMEBOARD
+REGISTER_HUD_PANEL(MINIGAMESTATUS,  HUD_MinigameStatus, PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMESTATUS
+REGISTER_HUD_PANEL(MINIGAMEHELP,    HUD_MinigameHelp,   PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMEHELP
+REGISTER_HUD_PANEL(MINIGAMEMENU,    HUD_MinigameMenu,   PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAMEMENU
+REGISTER_HUD_PANEL(MAPVOTE,         MapVote_Draw,       PANEL_CONFIG_NO                          ,                                             PANEL_SHOW_MAPVOTE                     ) // MAPVOTE
+REGISTER_HUD_PANEL(ITEMSTIME,       HUD_ItemsTime,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // ITEMSTIME
+REGISTER_HUD_PANEL(QUICKMENU,       HUD_QuickMenu,      PANEL_CONFIG_MAIN                        , PANEL_SHOW_MAINGAME                                                                ) // QUICKMENU
+REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
 // always add new panels to the end of list
 
 // Because calling lots of functions in QC apparently cuts fps in half on many machines:
@@ -356,7 +356,7 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
                new_size.x = max_panel_width; \
                new_size.y = panel_size.y * (new_size.x / panel_size.x); \
        } \
-       vector new_pos = eX * (panel_bg_border + 0.5 * max_panel_width) + eY * 0.5 * vid_conheight - 0.5 * new_size; \
+       vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \
        panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
        panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
 } MACRO_END
index 4897ba55176d6e4e47fa8ec5b9e508467c0199d3..073b2d0f7df3874fce2808f679f762b64b50342a 100644 (file)
@@ -5,12 +5,13 @@
 
 #define HUD_Write(s) fputs(fh, s)
 #define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
-#define HUD_Write_PanelCvar(cvar_suf) HUD_Write_Cvar(strcat("hud_panel_", panel.panel_name, cvar_suf))
+#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
 // Save the config
 void HUD_Panel_ExportCfg(string cfgname)
 {
        float fh;
        string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
+       string str = "";
        fh = fopen(filename, FILE_WRITE);
        if(fh >= 0)
        {
@@ -71,157 +72,162 @@ void HUD_Panel_ExportCfg(string cfgname)
                        HUD_Write_PanelCvar("_bg_padding");
                        switch(panel) {
                                case HUD_PANEL_WEAPONS:
-                                       HUD_Write_PanelCvar("_accuracy");
-                                       HUD_Write_PanelCvar("_label");
-                                       HUD_Write_PanelCvar("_label_scale");
-                                       HUD_Write_PanelCvar("_complainbubble");
-                                       HUD_Write_PanelCvar("_complainbubble_padding");
-                                       HUD_Write_PanelCvar("_complainbubble_time");
-                                       HUD_Write_PanelCvar("_complainbubble_fadetime");
-                                       HUD_Write_PanelCvar("_complainbubble_color_outofammo");
-                                       HUD_Write_PanelCvar("_complainbubble_color_donthave");
-                                       HUD_Write_PanelCvar("_complainbubble_color_unavailable");
-                                       HUD_Write_PanelCvar("_ammo");
-                                       HUD_Write_PanelCvar("_ammo_color");
-                                       HUD_Write_PanelCvar("_ammo_alpha");
-                                       HUD_Write_PanelCvar("_aspect");
-                                       HUD_Write_PanelCvar("_timeout");
-                                       HUD_Write_PanelCvar("_timeout_effect");
-                                       HUD_Write_PanelCvar("_timeout_fadebgmin");
-                                       HUD_Write_PanelCvar("_timeout_fadefgmin");
-                                       HUD_Write_PanelCvar("_timeout_speed_in");
-                                       HUD_Write_PanelCvar("_timeout_speed_out");
-                                       HUD_Write_PanelCvar("_onlyowned");
-                                       HUD_Write_PanelCvar("_noncurrent_alpha");
-                                       HUD_Write_PanelCvar("_noncurrent_scale");
+                                       HUD_Write_Cvar("hud_panel_weapons_accuracy");
+                                       HUD_Write_Cvar("hud_panel_weapons_label");
+                                       HUD_Write_Cvar("hud_panel_weapons_label_scale");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_time");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave");
+                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable");
+                                       HUD_Write_Cvar("hud_panel_weapons_ammo");
+                                       HUD_Write_Cvar("hud_panel_weapons_ammo_color");
+                                       HUD_Write_Cvar("hud_panel_weapons_ammo_alpha");
+                                       HUD_Write_Cvar("hud_panel_weapons_aspect");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout_effect");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
+                                       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
+                                       HUD_Write_Cvar("hud_panel_weapons_onlyowned");
+                                       HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
+                                       HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
+                                       HUD_Write_Cvar("hud_panel_weapons_selection_radius");
+                                       HUD_Write_Cvar("hud_panel_weapons_selection_speed");
                                        break;
                                case HUD_PANEL_AMMO:
-                                       HUD_Write_PanelCvar("_onlycurrent");
-                                       HUD_Write_PanelCvar("_noncurrent_alpha");
-                                       HUD_Write_PanelCvar("_noncurrent_scale");
-                                       HUD_Write_PanelCvar("_iconalign");
-                                       HUD_Write_PanelCvar("_progressbar");
-                                       HUD_Write_PanelCvar("_progressbar_name");
-                                       HUD_Write_PanelCvar("_progressbar_xoffset");
-                                       HUD_Write_PanelCvar("_text");
+                                       HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
+                                       HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
+                                       HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
+                                       HUD_Write_Cvar("hud_panel_ammo_iconalign");
+                                       HUD_Write_Cvar("hud_panel_ammo_progressbar");
+                                       HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
+                                       HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
+                                       HUD_Write_Cvar("hud_panel_ammo_text");
                                        break;
                                case HUD_PANEL_POWERUPS:
-                                       HUD_Write_PanelCvar("_iconalign");
-                                       HUD_Write_PanelCvar("_baralign");
-                                       HUD_Write_PanelCvar("_progressbar");
-                                       HUD_Write_PanelCvar("_text");
+                                       HUD_Write_Cvar("hud_panel_powerups_iconalign");
+                                       HUD_Write_Cvar("hud_panel_powerups_baralign");
+                                       HUD_Write_Cvar("hud_panel_powerups_progressbar");
+                                       HUD_Write_Cvar("hud_panel_powerups_text");
                                        break;
                                case HUD_PANEL_HEALTHARMOR:
-                                       HUD_Write_PanelCvar("_flip");
-                                       HUD_Write_PanelCvar("_iconalign");
-                                       HUD_Write_PanelCvar("_baralign");
-                                       HUD_Write_PanelCvar("_progressbar");
-                                       HUD_Write_PanelCvar("_progressbar_health");
-                                       HUD_Write_PanelCvar("_progressbar_armor");
-                                       HUD_Write_PanelCvar("_progressbar_gfx");
-                                       HUD_Write_PanelCvar("_progressbar_gfx_smooth");
-                                       HUD_Write_PanelCvar("_combined");
-                                       HUD_Write_PanelCvar("_text");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_combined");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_flip");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_iconalign");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_baralign");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth");
+                                       HUD_Write_Cvar("hud_panel_healtharmor_text");
                                        break;
                                case HUD_PANEL_NOTIFY:
-                                       HUD_Write_PanelCvar("_flip");
-                                       HUD_Write_PanelCvar("_fontsize");
-                                       HUD_Write_PanelCvar("_time");
-                                       HUD_Write_PanelCvar("_fadetime");
-                                       HUD_Write_PanelCvar("_icon_aspect");
+                                       HUD_Write_Cvar("hud_panel_notify_flip");
+                                       HUD_Write_Cvar("hud_panel_notify_fontsize");
+                                       HUD_Write_Cvar("hud_panel_notify_time");
+                                       HUD_Write_Cvar("hud_panel_notify_fadetime");
+                                       HUD_Write_Cvar("hud_panel_notify_icon_aspect");
                                        break;
                                case HUD_PANEL_TIMER:
                                        break;
                                case HUD_PANEL_RADAR:
-                                       HUD_Write_PanelCvar("_foreground_alpha");
-                                       HUD_Write_PanelCvar("_rotation");
-                                       HUD_Write_PanelCvar("_zoommode");
-                                       HUD_Write_PanelCvar("_scale");
-                                       HUD_Write_PanelCvar("_maximized_scale");
-                                       HUD_Write_PanelCvar("_maximized_size");
-                                       HUD_Write_PanelCvar("_maximized_rotation");
-                                       HUD_Write_PanelCvar("_maximized_zoommode");
+                                       HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
+                                       HUD_Write_Cvar("hud_panel_radar_rotation");
+                                       HUD_Write_Cvar("hud_panel_radar_zoommode");
+                                       HUD_Write_Cvar("hud_panel_radar_scale");
+                                       HUD_Write_Cvar("hud_panel_radar_maximized_scale");
+                                       HUD_Write_Cvar("hud_panel_radar_maximized_size");
+                                       HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
+                                       HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
                                        break;
                                case HUD_PANEL_SCORE:
-                                       HUD_Write_PanelCvar("_rankings");
+                                       HUD_Write_Cvar("hud_panel_score_rankings");
                                        break;
                                case HUD_PANEL_VOTE:
-                                       HUD_Write_PanelCvar("_alreadyvoted_alpha");
+                                       HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha");
                                        break;
                                case HUD_PANEL_MODICONS:
-                                       HUD_Write_PanelCvar("_ca_layout");
-                                       HUD_Write_PanelCvar("_dom_layout");
-                                       HUD_Write_PanelCvar("_freezetag_layout");
+                                       HUD_Write_Cvar("hud_panel_modicons_ca_layout");
+                                       HUD_Write_Cvar("hud_panel_modicons_dom_layout");
+                                       HUD_Write_Cvar("hud_panel_modicons_freezetag_layout");
                                        break;
                                case HUD_PANEL_PRESSEDKEYS:
-                                       HUD_Write_PanelCvar("_aspect");
-                                       HUD_Write_PanelCvar("_attack");
+                                       HUD_Write_Cvar("hud_panel_pressedkeys_aspect");
+                                       HUD_Write_Cvar("hud_panel_pressedkeys_attack");
                                        break;
                                case HUD_PANEL_ENGINEINFO:
-                                       HUD_Write_PanelCvar("_framecounter_time");
-                                       HUD_Write_PanelCvar("_framecounter_decimals");
+                                       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time");
+                                       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals");
                                        break;
                                case HUD_PANEL_INFOMESSAGES:
-                                       HUD_Write_PanelCvar("_flip");
+                                       HUD_Write_Cvar("hud_panel_infomessages_flip");
                                        break;
                                case HUD_PANEL_PHYSICS:
-                                       HUD_Write_PanelCvar("_speed_unit_show");
-                                       HUD_Write_PanelCvar("_speed_max");
-                                       HUD_Write_PanelCvar("_speed_vertical");
-                                       HUD_Write_PanelCvar("_topspeed");
-                                       HUD_Write_PanelCvar("_topspeed_time");
-                                       HUD_Write_PanelCvar("_acceleration_max");
-                                       HUD_Write_PanelCvar("_acceleration_vertical");
-                                       HUD_Write_PanelCvar("_flip");
-                                       HUD_Write_PanelCvar("_baralign");
-                                       HUD_Write_PanelCvar("_progressbar");
-                                       HUD_Write_PanelCvar("_acceleration_progressbar_mode");
-                                       HUD_Write_PanelCvar("_acceleration_progressbar_scale");
-                                       HUD_Write_PanelCvar("_acceleration_progressbar_nonlinear");
-                                       HUD_Write_PanelCvar("_text");
-                                       HUD_Write_PanelCvar("_text_scale");
+                                       HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
+                                       HUD_Write_Cvar("hud_panel_physics_speed_max");
+                                       HUD_Write_Cvar("hud_panel_physics_speed_vertical");
+                                       HUD_Write_Cvar("hud_panel_physics_topspeed");
+                                       HUD_Write_Cvar("hud_panel_physics_topspeed_time");
+                                       HUD_Write_Cvar("hud_panel_physics_acceleration_max");
+                                       HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
+                                       HUD_Write_Cvar("hud_panel_physics_flip");
+                                       HUD_Write_Cvar("hud_panel_physics_baralign");
+                                       HUD_Write_Cvar("hud_panel_physics_progressbar");
+                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
+                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
+                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
+                                       HUD_Write_Cvar("hud_panel_physics_text");
+                                       HUD_Write_Cvar("hud_panel_physics_text_scale");
                                        break;
                                case HUD_PANEL_CENTERPRINT:
-                                       HUD_Write_PanelCvar("_align");
-                                       HUD_Write_PanelCvar("_flip");
-                                       HUD_Write_PanelCvar("_fontscale");
-                                       HUD_Write_PanelCvar("_time");
-                                       HUD_Write_PanelCvar("_fade_in");
-                                       HUD_Write_PanelCvar("_fade_out");
-                                       HUD_Write_PanelCvar("_fade_subsequent");
-                                       HUD_Write_PanelCvar("_fade_subsequent_passone");
-                                       HUD_Write_PanelCvar("_fade_subsequent_passone_minalpha");
-                                       HUD_Write_PanelCvar("_fade_subsequent_passtwo");
-                                       HUD_Write_PanelCvar("_fade_subsequent_passtwo_minalpha");
-                                       HUD_Write_PanelCvar("_fade_subsequent_minfontsize");
-                                       HUD_Write_PanelCvar("_fade_minfontsize");
+                                       HUD_Write_Cvar("hud_panel_centerprint_align");
+                                       HUD_Write_Cvar("hud_panel_centerprint_flip");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fontscale");
+                                       HUD_Write_Cvar("hud_panel_centerprint_time");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_in");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_out");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize");
+                                       HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize");
                                        break;
                                case HUD_PANEL_ITEMSTIME:
-                                       HUD_Write_PanelCvar("_iconalign");
-                                       HUD_Write_PanelCvar("_progressbar");
-                                       HUD_Write_PanelCvar("_progressbar_name");
-                                       HUD_Write_PanelCvar("_progressbar_reduced");
-                                       HUD_Write_PanelCvar("_text");
-                                       HUD_Write_PanelCvar("_ratio");
-                                       HUD_Write_PanelCvar("_dynamicsize");
+                                       HUD_Write_Cvar("hud_panel_itemstime_iconalign");
+                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar");
+                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar_name");
+                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced");
+                                       HUD_Write_Cvar("hud_panel_itemstime_text");
+                                       HUD_Write_Cvar("hud_panel_itemstime_ratio");
+                                       HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
+                                       break;
+                               case HUD_PANEL_MAPVOTE:
+                                       HUD_Write_Cvar("hud_panel_mapvote_highlight_border");
                                        break;
                                case HUD_PANEL_QUICKMENU:
-                                       HUD_Write_PanelCvar("_align");
+                                       HUD_Write_Cvar("hud_panel_quickmenu_align");
                                        break;
                                case HUD_PANEL_SCOREBOARD:
-                                       HUD_Write_PanelCvar("_fadeinspeed");
-                                       HUD_Write_PanelCvar("_fadeoutspeed");
-                                       HUD_Write_PanelCvar("_respawntime_decimals");
-                                       HUD_Write_PanelCvar("_table_bg_alpha");
-                                       HUD_Write_PanelCvar("_table_bg_scale");
-                                       HUD_Write_PanelCvar("_table_fg_alpha");
-                                       HUD_Write_PanelCvar("_table_fg_alpha_self");
-                                       HUD_Write_PanelCvar("_table_highlight");
-                                       HUD_Write_PanelCvar("_table_highlight_alpha");
-                                       HUD_Write_PanelCvar("_table_highlight_alpha_self");
-                                       HUD_Write_PanelCvar("_bg_teams_color_team");
-                                       HUD_Write_PanelCvar("_accuracy_doublerows");
-                                       HUD_Write_PanelCvar("_accuracy_nocolors");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
+                                       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
                                        break;
                        }
                        HUD_Write("\n");
@@ -1229,11 +1235,11 @@ void HUD_Configure_DrawGrid()
                hud_configure_realGridSize.y = hud_configure_gridSize.y * vid_conheight;
                vector s;
                // x-axis
-               s = eX + eY * vid_conheight;
+               s = vec2(1, vid_conheight);
                for(i = 1; i < 1/hud_configure_gridSize.x; ++i)
                        drawfill(eX * i * hud_configure_realGridSize.x, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
                // y-axis
-               s = eY + eX * vid_conwidth;
+               s = vec2(vid_conwidth, 1);
                for(i = 1; i < 1/hud_configure_gridSize.y; ++i)
                        drawfill(eY * i * hud_configure_realGridSize.y, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
        }
@@ -1285,11 +1291,13 @@ const string hlBorder = "gfx/hud/default/border_highlighted";
 const string hlBorder2 = "gfx/hud/default/border_highlighted2";
 void HUD_Panel_HlBorder(float myBorder, vector color, float theAlpha)
 {
-       drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * theAlpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size.x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size.y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size.x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size.y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size.x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size.y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
+       vector pos = panel_pos - vec2(myBorder, myBorder);
+       drawfill(pos, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * theAlpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(pos, hlBorder, '8 1 0' * hlBorderSize, vec2(panel_size.x + 2 * myBorder, hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(pos + eY * (panel_size.y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, vec2(panel_size.x + 2 * myBorder, hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL);
+       pos.y += hlBorderSize;
+       drawpic_tiled(pos, hlBorder2, '1 8 0' * hlBorderSize, vec2(hlBorderSize, panel_size.y + 2 * myBorder - 2 * hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(pos + eX * (panel_size.x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, vec2(hlBorderSize, panel_size.y + 2 * myBorder - 2 * hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL);
 }
 
 void HUD_Configure_PostDraw()
index 94545ac4bff69ea3511cb20866973709d190895a..7bae78cb6c5ab38385ea6a0b1cbdbc338be2a732 100644 (file)
@@ -150,7 +150,7 @@ void HUD_Ammo()
 
        rows = HUD_GetRowCount(total_ammo_count, mySize, 3);
        columns = ceil((total_ammo_count)/rows);
-       ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+       ammo_size = vec2(mySize.x / columns, mySize.y / rows);
 
        vector offset = '0 0 0';
        float newSize;
@@ -207,7 +207,7 @@ void HUD_Ammo()
                {
                        ammotype = GetAmmoFieldFromNum(i);
                        DrawAmmoItem(
-                               pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y),
+                               pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)),
                                ammo_size,
                                ammotype,
                                (wep.ammo_field == ammotype),
@@ -229,7 +229,7 @@ void HUD_Ammo()
 
                float f = bound(0, nade_statuschange_elapsedtime*2, 1);
 
-               DrawAmmoNades(pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f);
+               DrawAmmoNades(pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f);
        }
 
        draw_endBoldFont();
index f67cbffbd04d176160d072b1e6bddcbfe3e045b0..3c13fd9c2bdfe2d8724c37194796821e0f6bf675 100644 (file)
@@ -161,16 +161,16 @@ void HUD_CenterPrint ()
                if (hud_panel_radar_bottom >= 0.96 * vid_conheight)
                        return;
 
-               panel_pos = eY * hud_panel_radar_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
-               panel_size_y = min(panel_size_y, vid_conheight - hud_panel_radar_bottom);
+               panel_pos.x = 0.5 * (vid_conwidth - panel_size.x);
+               panel_pos.y = hud_panel_radar_bottom;
+               panel_size.y = min(panel_size.y, vid_conheight - hud_panel_radar_bottom);
        }
        else if(!autocvar__hud_configure && scoreboard_fade_alpha)
        {
                // move the panel below the scoreboard
                if (scoreboard_bottom >= 0.96 * vid_conheight)
                        return;
-               vector target_pos;
-               target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size.x);
+               vector target_pos = vec2(0.5 * (vid_conwidth - panel_size.x), scoreboard_bottom);
                if(target_pos.y > panel_pos.y)
                {
                        panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
index 69fced5320091bc933b715bb6de8d6b59e69173c..5e2bfd3a5505374d29473888d3c82e610e44b4b1 100644 (file)
@@ -110,7 +110,7 @@ void HUD_HealthArmor()
                        DrawNumIcon(pos, mySize, hp, biggercount, 0, iconalign, HUD_Get_Num_Color(hp, maxtotal), 1);
 
                if(fuel)
-                       HUD_Panel_DrawProgressBar(pos, eX * mySize.x + eY * 0.2 * mySize.y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawProgressBar(pos, vec2(mySize.x, 0.2 * mySize.y), "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
        }
        else
        {
index b736dced60671a8025936d95b3c01dc844dabb6f..c3e91d3e9c7070838a2973d180f353459dbf69c0 100644 (file)
@@ -38,8 +38,8 @@ void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int
 
        if(layout)
        {
-               drawpic_aspect_skin(myPos, pic, eX * 0.7 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(myPos + eX * 0.7 * mySize.x, ftos(stat), eX * 0.3 * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(myPos, pic, vec2(0.7 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring_aspect(myPos + eX * 0.7 * mySize.x, ftos(stat), vec2(0.3 * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
        }
        else
                drawstring_aspect(myPos, ftos(stat), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -63,11 +63,12 @@ void HUD_Mod_CA(vector myPos, vector mySize)
 
        int i;
        float row = 0, column = 0;
-       vector pos, itemSize;
-       itemSize = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+       vector pos = '0 0 0', itemSize;
+       itemSize = vec2(mySize.x / columns, mySize.y / rows);
        for(i=0; i<team_count; ++i)
        {
-               pos = myPos + eX * column * itemSize.x + eY * row * itemSize.y;
+               pos.x = myPos.x + column * itemSize.x;
+               pos.y = myPos.y + row * itemSize.y;
 
                DrawCAItem(pos, itemSize, aspect_ratio, layout, i);
 
@@ -320,7 +321,7 @@ void HUD_Mod_KH(vector pos, vector mySize)
        if(all_keys == 4 && mySize.x * 0.5 < mySize.y && mySize.y * 0.5 < mySize.x)
        {
                // Quadratic arrangement
-               slot_size = eX * mySize.x * 0.5 + eY * mySize.y * 0.5;
+               slot_size = vec2(mySize.x * 0.5, mySize.y * 0.5);
                KH_SLOTS[0] = pos;
                KH_SLOTS[1] = pos + eX * slot_size.x;
                KH_SLOTS[2] = pos + eY * slot_size.y;
@@ -331,14 +332,14 @@ void HUD_Mod_KH(vector pos, vector mySize)
                if(mySize.x > mySize.y)
                {
                        // Horizontal arrangement
-                       slot_size = eX * mySize.x / all_keys + eY * mySize.y;
+                       slot_size = vec2(mySize.x / all_keys, mySize.y);
                        for(i = 0; i < all_keys; ++i)
                                KH_SLOTS[i] = pos + eX * slot_size.x * i;
                }
                else
                {
                        // Vertical arrangement
-                       slot_size = eX * mySize.x + eY * mySize.y / all_keys;
+                       slot_size = vec2(mySize.x, mySize.y / all_keys);
                        for(i = 0; i < all_keys; ++i)
                                KH_SLOTS[i] = pos + eY * slot_size.y * i;
                }
@@ -432,10 +433,10 @@ void HUD_Mod_Keepaway(vector pos, vector mySize)
 
        if(mySize.x > mySize.y) {
                kaball_pos = pos + eX * 0.25 * mySize.x;
-               kaball_size = eX * 0.5 * mySize.x + eY * mySize.y;
+               kaball_size = vec2(0.5 * mySize.x, mySize.y);
        } else {
                kaball_pos = pos + eY * 0.25 * mySize.y;
-               kaball_size = eY * 0.5 * mySize.y + eX * mySize.x;
+               kaball_size = vec2(mySize.x, 0.5 * mySize.y);
        }
 
        float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
@@ -445,7 +446,7 @@ void HUD_Mod_Keepaway(vector pos, vector mySize)
                drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
 
        if(kaball)
-               drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(pos, "keepawayball_carrying", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
 }
 
 
@@ -548,15 +549,19 @@ void HUD_Mod_Race(vector pos, vector mySize)
        if(mySize.x > mySize.y) {
                // text on left side
                squareSize = min(mySize.y, mySize.x/2);
-               textPos = pos + eX * 0.5 * max(0, mySize.x/2 - squareSize) + eY * 0.5 * (mySize.y - squareSize);
-               medalPos = pos + eX * 0.5 * max(0, mySize.x/2 - squareSize) + eX * 0.5 * mySize.x + eY * 0.5 * (mySize.y - squareSize);
+               vector ofs = vec2(0.5 * max(0, mySize.x/2 - squareSize), 0.5 * (mySize.y - squareSize));
+               textPos = pos + ofs;
+               ofs.y += 0.5 * mySize.x;
+               medalPos = pos + ofs;
        } else {
                // text on top
                squareSize = min(mySize.x, mySize.y/2);
-               textPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eX * 0.5 * (mySize.x - squareSize);
-               medalPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eY * 0.5 * mySize.y + eX * 0.5 * (mySize.x - squareSize);
+               vector ofs = vec2(0.5 * (mySize.x - squareSize), 0.5 * max(0, mySize.y/2 - squareSize));
+               textPos = pos + ofs;
+               ofs.y += 0.5 * mySize.y;
+               medalPos = pos + ofs;
        }
-       vector textSize = eX * squareSize + eY * 0.25 * squareSize;
+       vector textSize = vec2(squareSize, 0.25 * squareSize);
 
        race_showTime(_("Personal best"), textPos, eY * 0.25 * squareSize, t, textSize, time - crecordtime_change_time);
 
@@ -665,9 +670,9 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, in
                //draw the text
                color *= 0.5 + pps_ratio * (1 - 0.5); // half saturated color at min, full saturated at max
                if (layout == 2) // average pps
-                       drawstring_aspect(myPos + eX * mySize.y, ftos_decimals(stat, 2), eX * (2/3) * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(myPos + eX * mySize.y, ftos_decimals(stat, 2), vec2((2/3) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
                else // percentage of average pps
-                       drawstring_aspect(myPos + eX * mySize.y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), eX * (2/3) * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(myPos + eX * mySize.y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), vec2((2/3) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 
        //draw the icon
@@ -694,10 +699,10 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
        int i;
        float row = 0, column = 0;
        vector pos, itemSize;
-       itemSize = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+       itemSize = vec2(mySize.x / columns, mySize.y / rows);
        for(i=0; i<team_count; ++i)
        {
-               pos = myPos + eX * column * itemSize.x + eY * row * itemSize.y;
+               pos = myPos + vec2(column * itemSize.x, row * itemSize.y);
 
                DrawDomItem(pos, itemSize, aspect_ratio, layout, i);
 
index fda57026f742826def39e7f8b393499097697f2f..910113f4e083fd877ab5d31250b82ff2e678ba86 100644 (file)
@@ -83,7 +83,7 @@ void HUD_Notify()
        float name_maxwidth = panel_width_half - icon_width_half - size.x * NOTIFY_ICON_MARGIN;
 
        vector font_size = '0.5 0.5 0' * entry_height * autocvar_hud_panel_notify_fontsize;
-       vector icon_size = (eX * icon_aspect + eY) * entry_height;
+       vector icon_size = vec2(icon_aspect, 1) * entry_height;
        vector icon_left = eX * (panel_width_half - icon_width_half);
        vector attacker_right = eX * name_maxwidth;
        vector victim_left = eX * (size.x - name_maxwidth);
index 076ce918f14723dcde2e755308a3f4379fb885e0..608e48ce39856cabc5c3d1ee575ad29869b521dd 100644 (file)
@@ -167,7 +167,7 @@ void HUD_Powerups()
 
        // Draw items from linked list
        vector itemPos = pos;
-       vector itemSize = eX * (size.x / columns) + eY * (size.y / rows);
+       vector itemSize = vec2(size.x / columns, size.y / rows);
        vector textColor = '1 1 1';
 
        int fullSeconds = 0;
@@ -178,7 +178,7 @@ void HUD_Powerups()
        draw_beginBoldFont();
        for(entity item = powerupItems; item.count; item = item.chain)
        {
-               itemPos = eX * (pos.x + column * itemSize.x) + eY * (pos.y + row * itemSize.y);
+               itemPos = vec2(pos.x + column * itemSize.x, pos.y + row * itemSize.y);
 
                // Draw progressbar
                if(autocvar_hud_panel_powerups_progressbar)
index abb9ccef9aa56910fae3fd52fb1b3e5699e512ab..c659648d2eb9568948c1b58096254805a0b85baa 100644 (file)
@@ -49,8 +49,7 @@ void HUD_PressedKeys()
                mySize = newSize;
        }
 
-       vector keysize;
-       keysize = eX * mySize.x * (1/3.0) + eY * mySize.y * (1/(3.0 - !autocvar_hud_panel_pressedkeys_attack));
+       vector keysize = vec2(mySize.x / 3, mySize.y / (3 - !autocvar_hud_panel_pressedkeys_attack));
        int pressedkeys = STAT(PRESSED_KEYS);
 
        if(autocvar_hud_panel_pressedkeys_attack)
index 0940b0261587ba7faf051205365770b385ea5a0d..f17f3045941741796ed400629350a020f8020a8e 100644 (file)
@@ -528,7 +528,7 @@ void QuickMenu_Mouse()
                                color = '1 1 0.3';
                        else
                                color = '1 1 1';
-                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, color, .2, DRAWFLAG_NORMAL);
+                       drawfill(panel_pos, vec2(panel_size.x, fontsize.y), color, .2, DRAWFLAG_NORMAL);
 
                        if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
                                QuickMenu_Page_ActiveEntry((entry_num < QUICKMENU_MAXLINES - 1) ? entry_num + 1 : 0);
@@ -552,7 +552,7 @@ void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector font
                        pic = strcat("gfx/hud/default/", option);
                vector option_size = '1 1 0' * fontsize.y * 0.8;
                desc_width -= option_size.x;
-               drawpic(pos + eX * desc_width + eY * (fontsize.y - option_size.y) / 2, pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
+               drawpic(pos + vec2(desc_width, (fontsize.y - option_size.y) / 2), pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
                desc_width -= fontsize.x / 4;
        }
        entry = textShortenToWidth(desc, desc_width, fontsize, stringwidth_colors);
@@ -682,7 +682,7 @@ void HUD_QuickMenu()
 
                if(QuickMenu_Page_ActivatedEntry_Time && time < QuickMenu_Page_ActivatedEntry_Time
                        && QuickMenu_Page_ActivatedEntry == i)
-                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
+                       drawfill(panel_pos, vec2(panel_size.x, fontsize.y), '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
 
                panel_pos.y += fontsize.y;
        }
@@ -740,12 +740,19 @@ void HUD_QuickMenu()
 
 // useful to Translate a string inside the Command
 #define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
-       if(prvm_language == "en") \
-               QUICKMENU_ENTRY(title, sprintf(command, text)) \
-       else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
-               QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
-       else \
-               QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
+       if(prvm_language == "en") { \
+               tc_title = title; \
+               tc_cmd = sprintf(command, text); \
+       } \
+       else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) { \
+               tc_title = strcat("(en)", title); \
+               tc_cmd = sprintf(command, text); \
+       } \
+       else { \
+               tc_title = strcat("(", prvm_language, ")", title); \
+               tc_cmd = sprintf(command, translated_text); \
+       } \
+       QUICKMENU_ENTRY(tc_title, tc_cmd) \
 }
 
 void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
@@ -781,6 +788,9 @@ void QuickMenu_Default(string target_submenu)
        if(target_submenu != "")
                QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
 
+       string tc_title;
+       string tc_cmd;
+
        QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
                QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
                QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
index 5efbd00ceb99ccda756c6747bdf12d7e7c6fb953..2f54e2a37981bfa42c166fbe8ea18f1d7a5b7c42 100644 (file)
@@ -120,17 +120,21 @@ void HUD_RaceTimer ()
 
        float a, t;
        string s, forcetime;
+       vector str_pos;
 
        if(autocvar__hud_configure)
        {
                s = "0:13:37";
                draw_beginBoldFont();
-               drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.60 0.60 0' * mySize.y), s, '0.60 0.60 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(s, false, '1 1 0' * 0.6 * mySize.y));
+               drawstring(str_pos, s, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                draw_endBoldFont();
                s = _("^1Intermediate 1 (+15.42)");
-               drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.20 * mySize.y) + eY * 0.60 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+               str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
+               drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
                s = sprintf(_("^1PENALTY: %.1f (%s)"), 2, "missing a checkpoint");
-               drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.20 * mySize.y) + eY * 0.80 * mySize.y, s, '1 1 0' * 0.20 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+               str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.8 * mySize.y);
+               drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
        }
        else if(race_checkpointtime)
        {
@@ -155,15 +159,14 @@ void HUD_RaceTimer ()
                        {
                                a = bound(0, 2 - ((race_laptime + TIME_DECODE(race_nextbesttime)) - (time + TIME_DECODE(race_penaltyaccumulator))), 1);
                                if(a > 0) // next one?
-                               {
                                        s = MakeRaceString(race_nextcheckpoint, (time + TIME_DECODE(race_penaltyaccumulator)) - race_laptime, TIME_DECODE(race_nextbesttime), 0, race_nextbestname);
-                               }
                        }
                }
 
                if(s != "" && a > 0)
                {
-                       drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
+                       drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
                if(race_penaltytime)
@@ -172,7 +175,8 @@ void HUD_RaceTimer ()
                        if(a > 0)
                        {
                                s = sprintf(_("^1PENALTY: %.1f (%s)"), race_penaltytime * 0.1, race_penaltyreason);
-                               drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.8 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.8 * mySize.y);
+                               drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                        }
                }
 
@@ -181,7 +185,8 @@ void HUD_RaceTimer ()
                if(forcetime != "")
                {
                        a = bound(0, (time - race_checkpointtime) / 0.5, 1);
-                       drawstring_expanding(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(forcetime, false, '1 1 0' * 0.6 * mySize.y), forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a);
+                       str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(forcetime, false, '1 1 0' * 0.6 * mySize.y));
+                       drawstring_expanding(str_pos, forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a);
                }
                else
                        a = 1;
@@ -189,7 +194,8 @@ void HUD_RaceTimer ()
                if(race_laptime && race_checkpoint != 255)
                {
                        s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
-                       drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.6 0.6 0' * mySize.y), s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(s, false, '0.6 0.6 0' * mySize.y));
+                       drawstring(str_pos, s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
                draw_endBoldFont();
@@ -200,13 +206,15 @@ void HUD_RaceTimer ()
                {
                        a = bound(0, 2 - (time - race_mycheckpointtime), 1);
                        s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -(race_mycheckpointenemy == ""), race_mycheckpointlapsdelta, race_mycheckpointenemy);
-                       drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
+                       drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
                if(race_othercheckpointtime && race_othercheckpointenemy != "")
                {
                        a = bound(0, 2 - (time - race_othercheckpointtime), 1);
                        s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -(race_othercheckpointenemy == ""), race_othercheckpointlapsdelta, race_othercheckpointenemy);
-                       drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
+                       drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
                if(race_penaltytime && !race_penaltyaccumulator)
@@ -219,7 +227,8 @@ void HUD_RaceTimer ()
                                        s = sprintf(_("^1PENALTY: %.1f (%s)"), (t - time) * 0.1, race_penaltyreason);
                                else
                                        s = sprintf(_("^2PENALTY: %.1f (%s)"), 0, race_penaltyreason);
-                               drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
+                               drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                        }
                }
        }
index 972e4effbee9db71c90b4228e177e5a1eb4f8108..24be15432d12f18e5d6766d01533f96bf7940bab 100644 (file)
@@ -35,8 +35,8 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                        players_per_team = max(2, ceil((entries - 1) / team_count));
                        for(i=0; i<team_count; ++i) {
                                if (i == floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
-                                       HUD_Panel_DrawHighlight(pos + eX * score_size * i, eX * score_size + eY * fontsize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize.y, Team_ColorRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       HUD_Panel_DrawHighlight(pos + eX * score_size * i, vec2(score_size, fontsize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), vec2(score_size, fontsize.y), Team_ColorRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        first_pl = 1;
                        pos.y += fontsize.y;
@@ -50,7 +50,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                        if (i == entries-1 && autocvar_hud_panel_score_rankings == 1)
                        {
                                rgb = '1 1 0';
-                               drawfill(pos, eX * mySize.x + eY * fontsize.y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawfill(pos, vec2(mySize.x, fontsize.y), rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                s = entcs_GetName(player_localnum);
                                score = 7;
                        }
@@ -83,8 +83,8 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                                continue;
 
                        if (tm.team == myteam)
-                               drawfill(pos + eX * score_size * i, eX * score_size + eY * fontsize.y, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores(ts_primary))), eX * score_size + eY * fontsize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawfill(pos + eX * score_size * i, vec2(score_size, fontsize.y), '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores(ts_primary))), vec2(score_size, fontsize.y), Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        ++i;
                }
                first_pl = 1;
@@ -190,12 +190,12 @@ void HUD_Score()
                                distribution_color = '1 0 0';
                                sign = "+";
                        }
-                       drawstring_aspect(pos + eX * 0.75 * mySize.x, strcat(sign, distrtimer), eX * 0.25 * mySize.x + eY * (1/3) * mySize.y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * 0.75 * mySize.x, strcat(sign, distrtimer), vec2(0.25 * mySize.x, (1/3) * mySize.y), distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                // race record display
                if (distribution <= 0)
-                       HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(pos, timer, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawHighlight(pos, vec2(0.75 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring_aspect(pos, timer, vec2(0.75 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                draw_endBoldFont();
        } else if (!teamplay) { // non-teamgames
                if ((spectatee_status == -1 && !autocvar__hud_configure) || autocvar_hud_panel_score_rankings)
@@ -238,7 +238,7 @@ void HUD_Score()
                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize.x + eY * mySize.y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(pos + eX * 0.75 * mySize.x, distribution_str, eX * 0.25 * mySize.x + eY * (1/3) * mySize.y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring_aspect(pos + eX * 0.75 * mySize.x, distribution_str, vec2(0.25 * mySize.x, (1/3) * mySize.y), distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                draw_endBoldFont();
        } else { // teamgames
                float row, column, rows = 0, columns = 0;
@@ -253,7 +253,7 @@ void HUD_Score()
                {
                        rows = HUD_GetRowCount(team_count, mySize, 3);
                        columns = ceil(team_count/rows);
-                       score_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+                       score_size = vec2(mySize.x / columns, mySize.y / rows);
 
                        float newSize;
                        if(score_size.x/score_size.y > 3)
@@ -272,7 +272,7 @@ void HUD_Score()
                        }
                }
                else
-                       score_size = eX * mySize.x*(1/4) + eY * mySize.y*(1/3);
+                       score_size = vec2(mySize.x / 4, mySize.y / 3);
 
                float max_fragcount;
                max_fragcount = -99;
@@ -293,7 +293,7 @@ void HUD_Score()
 
                        if (spectatee_status == -1)
                        {
-                               score_pos = pos + eX * column * (score_size.x + offset.x) + eY * row * (score_size.y + offset.y);
+                               score_pos = pos + vec2(column * (score_size.x + offset.x), row * (score_size.y + offset.y));
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -306,12 +306,12 @@ void HUD_Score()
                        }
                        else if(tm.team == myteam) {
                                if (max_fragcount == score)
-                                       HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize.x + eY * mySize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       HUD_Panel_DrawHighlight(pos, vec2(0.75 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos, ftos(score), vec2(0.75 * mySize.x, mySize.y), Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        } else {
                                if (max_fragcount == score)
-                                       HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       HUD_Panel_DrawHighlight(pos + vec2(0.75 * mySize.x, (1/3) * rows * mySize.y), score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + vec2(0.75 * mySize.x, (1/3) * rows * mySize.y), ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                                ++rows;
                        }
                }
index b8c9a3ea1579cae0e226eff1dc647572dd099c5b..e6e5f36495c79f90c23356f41737c48c8190f4b8 100644 (file)
@@ -725,10 +725,11 @@ string Scoreboard_FixColumnWidth(int i, string str)
                        sbt_fixcolumnwidth_iconlen = f;
        }
 
-       sbt_fixcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect
-
        if(sbt_fixcolumnwidth_iconlen != 0)
+       {
+               sbt_fixcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect
                sbt_fixcolumnwidth_marginlen = stringwidth(" ", false, hud_fontsize);
+       }
        else
                sbt_fixcolumnwidth_marginlen = 0;
 
@@ -823,7 +824,7 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
        bool is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR);
 
        vector h_pos = item_pos;
-       vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25;
+       vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25);
        // alternated rows highlighting
        if(is_self)
                drawfill(h_pos, h_size, rgb, sbt_highlight_alpha_self, DRAWFLAG_NORMAL);
@@ -863,11 +864,11 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
 
                tmp.x = sbt_field_size[i] + hud_fontsize.x;
                if(sbt_field_icon0 != "")
-                       drawpic(pos - tmp, sbt_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                       drawpic(pos - tmp, sbt_field_icon0, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
                if(sbt_field_icon1 != "")
-                       drawpic(pos - tmp, sbt_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                       drawpic(pos - tmp, sbt_field_icon1, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
                if(sbt_field_icon2 != "")
-                       drawpic(pos - tmp, sbt_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                       drawpic(pos - tmp, sbt_field_icon2, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL);
        }
 
        if(sbt_field[i] == SP_SEPARATOR)
@@ -897,11 +898,11 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
 
                        tmp.x = sbt_field_size[i];
                        if(sbt_field_icon0 != "")
-                               drawpic(pos - tmp, sbt_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                               drawpic(pos - tmp, sbt_field_icon0, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
                        if(sbt_field_icon1 != "")
-                               drawpic(pos - tmp, sbt_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                               drawpic(pos - tmp, sbt_field_icon1, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL);
                        if(sbt_field_icon2 != "")
-                               drawpic(pos - tmp, sbt_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL);
+                               drawpic(pos - tmp, sbt_field_icon2, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL);
                        pos.x -= sbt_field_size[i] + hud_fontsize.x;
                }
        }
@@ -914,7 +915,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
 {
        int i = 0;
        vector h_pos = item_pos;
-       vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25;
+       vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25);
 
        bool complete = (this_team == NUM_SPECTATOR);
 
@@ -1006,7 +1007,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
                pos.x += column_width;
                pos.x += hud_fontsize.x;
        }
-       return eX * item_pos.x + eY * (item_pos.y + i * hud_fontsize.y * 1.25);
+       return vec2(item_pos.x, item_pos.y + i * hud_fontsize.y * 1.25);
 }
 
 vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
@@ -1048,7 +1049,7 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
        }
 
        pos = panel_pos;
-       vector tmp = eX * panel_size.x + eY * 1.25 * hud_fontsize.y;
+       vector tmp = vec2(panel_size.x, 1.25 * hud_fontsize.y);
 
        // rounded header
        if (sbt_bg_alpha)
@@ -1185,11 +1186,11 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                // column highlighting
                for (int i = 0; i < columnns; ++i)
                        if ((i % 2) == 0)
-                               drawfill(pos + eX * weapon_width * rows * i, eY * height * rows + eX * weapon_width * rows, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL);
+                               drawfill(pos + eX * weapon_width * rows * i, vec2(weapon_width * rows, height * rows), '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL);
 
                // row highlighting
                for (int i = 0; i < rows; ++i)
-                       drawfill(pos + eY * weapon_height + eY * height * i, eX * tmp.x + eY * hud_fontsize.y, rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL);
+                       drawfill(pos + eY * (weapon_height + height * i), vec2(tmp.x, hud_fontsize.y), rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL);
        }
 
        average_accuracy = 0;
@@ -1220,7 +1221,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                        weapon_alpha = 0.2 * sbt_fg_alpha;
 
                // weapon icon
-               drawpic_aspect_skin(tmpos, it.model2, eX * weapon_width + eY * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(tmpos, it.model2, vec2(weapon_width, weapon_height), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
                // the accuracy
                if (weapon_stats >= 0) {
                        weapons_with_stats += 1;
@@ -1235,7 +1236,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
                        if(!autocvar_hud_panel_scoreboard_accuracy_nocolors)
                                rgb = Accuracy_GetColor(weapon_stats);
 
-                       drawstring(tmpos + eX * padding + eY * weapon_height, s, hud_fontsize, rgb, sbt_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring(tmpos + vec2(padding, weapon_height), s, hud_fontsize, rgb, sbt_fg_alpha, DRAWFLAG_NORMAL);
                }
                tmpos.x += weapon_width * rows;
                pos.x += weapon_width * rows;
@@ -1373,7 +1374,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
 
        float ranksize = 3 * hud_fontsize.x;
        float timesize = 5 * hud_fontsize.x;
-       vector columnsize = eX * (ranksize + timesize + namesize + hud_fontsize.x) + eY * 1.25 * hud_fontsize.y;
+       vector columnsize = vec2(ranksize + timesize + namesize + hud_fontsize.x, 1.25 * hud_fontsize.y);
        int columns = max(1, floor((panel_size.x - 2 * panel_bg_padding) / columnsize.x));
        columns = min(columns, RANKINGS_RECEIVED_CNT);
 
@@ -1402,7 +1403,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
        if (sbt_bg_alpha)
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, panel_size, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL);
 
-       vector text_ofs = eX * 0.5 * hud_fontsize.x + eY * (1.25 - 1) / 2 * hud_fontsize.y; // center text vertically
+       vector text_ofs = vec2(0.5 * hud_fontsize.x, (1.25 - 1) / 2 * hud_fontsize.y); // center text vertically
        string str = "";
        int column = 0, j = 0;
        for(i = 0; i < RANKINGS_RECEIVED_CNT; ++i)
@@ -1509,6 +1510,7 @@ void Scoreboard_Draw()
        vector pos = panel_pos;
        entity pl, tm;
        string str;
+       vector str_pos;
 
        // Heading
        vector sb_heading_fontsize;
@@ -1543,12 +1545,14 @@ void Scoreboard_Draw()
                        draw_beginBoldFont();
                        vector rgb = Team_ColorRGB(tm.team);
                        str = ftos(tm.(teamscores(ts_primary)));
-                       drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       str_pos = pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5);
+                       drawstring(str_pos, str, hud_fontsize * 1.5, rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
 
                        if(ts_primary != ts_secondary)
                        {
                                str = ftos(tm.(teamscores(ts_secondary)));
-                               drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize) + eY * hud_fontsize.y * 1.5, str, hud_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               str_pos = pos + team_score_baseoffset - vec2(stringwidth(str, false, hud_fontsize), hud_fontsize.y * 1.5);
+                               drawstring(str_pos, str, hud_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        draw_endBoldFont();
                        if(autocvar_hud_panel_scoreboard_bg_teams_color_team > 0)
index d974bee4bd3dca9fbf8b8307a0354d86b3fd211d..22f1678b6f034d1174028e97b5325c35c66a8809 100644 (file)
@@ -74,8 +74,8 @@ void HUD_Vote()
 
        if(uid2name_dialog)
        {
-               panel_pos = eX * 0.3 * vid_conwidth + eY * 0.1 * vid_conheight;
-               panel_size = eX * 0.4 * vid_conwidth + eY * 0.3 * vid_conheight;
+               panel_pos = vec2(0.3 * vid_conwidth, 0.1 * vid_conheight);
+               panel_size = vec2(0.4 * vid_conwidth, 0.3 * vid_conheight);
        }
 
        vector pos, mySize;
@@ -115,20 +115,20 @@ void HUD_Vote()
        s = _("A vote has been called for:");
        if(uid2name_dialog)
                s = _("Allow servers to store and display your name?");
-       drawstring_aspect(pos, s, eX * mySize.x + eY * (2/8) * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawstring_aspect(pos, s, vec2(mySize.x, (2/8) * mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        s = textShortenToWidth(ColorTranslateRGB(vote_called_vote), mySize.x, '1 1 0' * mySize.y * (1/8), stringwidth_colors);
        if(autocvar__hud_configure)
                s = _("^1Configure the HUD");
-       drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, eX * mySize.x + eY * (1.75/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, vec2(mySize.x, (1.75/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
 
        // print the yes/no counts
        s = sprintf("^2%s ^7(%d)", getcommandkey_forcename(_("Yes"), "vyes"), vote_yescount);
-       drawcolorcodedstring_aspect(pos + eY * (4/8) * mySize.y, s, eX * 0.5 * mySize.x + eY * (1.5/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawcolorcodedstring_aspect(pos + eY * (4/8) * mySize.y, s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
        s = sprintf("^1%s ^7(%d)", getcommandkey_forcename(_("No"), "vno"), vote_nocount);
-       drawcolorcodedstring_aspect(pos + eX * 0.5 * mySize.x + eY * (4/8) * mySize.y, s, eX * 0.5 * mySize.x + eY * (1.5/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawcolorcodedstring_aspect(pos + vec2(0.5 * mySize.x, (4/8) * mySize.y), s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
 
        pos.y += (5/8) * mySize.y;
-       vector tmp_size = eX * mySize.x + eY * (3/8) * mySize.y;
+       vector tmp_size = vec2(mySize.x, (3/8) * mySize.y);
        // draw the progress bar backgrounds
        drawpic_skin(pos, "voteprogress_back", tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
index 69fd82c9e0d9d79a71890c6e6c3d88f82c334ecb..b4997467ee6a5547980a5c918dd9eaafec585a17 100644 (file)
@@ -407,7 +407,7 @@ void HUD_Weapons()
                }
 
                // figure out the drawing position of weapon
-               weapon_pos = (panel_pos + eX * column * weapon_size.x + eY * row * weapon_size.y);
+               weapon_pos = panel_pos + vec2(column * weapon_size.x, row * weapon_size.y);
 
                // update position of the currently selected weapon
                if(it == panel_switchweapon)
index a098bd7f9e3d02e3d4a5743248e6f3b2cadec466..c53943221107e129673cb40c09d8153c04211d52 100644 (file)
@@ -31,7 +31,7 @@
 
 void draw_cursor(vector pos, vector ofs, string img, vector col, float a)
 {
-       ofs = eX * (ofs.x * SIZE_CURSOR.x) + eY * (ofs.y * SIZE_CURSOR.y);
+       ofs = vec2(ofs.x * SIZE_CURSOR.x, ofs.y * SIZE_CURSOR.y);
        drawpic(pos - ofs, strcat(draw_currentSkin, img), SIZE_CURSOR, col, a, DRAWFLAG_NORMAL);
 }
 
index 7b07b680057196bb325bda90f4d4dd03fd8866a3..29728dfde6d07cd781c19ae75d199b038c1c1a85 100644 (file)
@@ -398,7 +398,7 @@ void MapVote_Draw()
 
        // higher than the image itself ratio for mapvote items to reserve space for long map names
        int item_aspect = (gametypevote) ? 3/1 : 5/3;
-       vector table_size = HUD_GetTableSize_BestItemAR(mv_num_maps, eX * (xmax - xmin) + eY * (ymax - ymin), item_aspect);
+       vector table_size = HUD_GetTableSize_BestItemAR(mv_num_maps, vec2(xmax - xmin, ymax - ymin), item_aspect);
        mv_columns = table_size.x;
        rows = table_size.y;
 
index cbb0e071dfb87f8eca4e210be493db8e69d95bc1..f23a3976b55c6fcaba36a0ec2d5301f80ab0ba8f 100644 (file)
@@ -45,8 +45,8 @@ float cvar_or(string cv, float v);
 vector project_3d_to_2d(vector vec);
 
 vector drawfontscale;
-#define draw_beginBoldFont()    MACRO_BEGIN { drawfont = FONT_USER + 2; } MACRO_END
-#define draw_endBoldFont()      MACRO_BEGIN { drawfont = FONT_USER + 1; } MACRO_END
+#define draw_beginBoldFont() drawfont = FONT_USER + 2
+#define draw_endBoldFont() drawfont = FONT_USER + 1
 
 float expandingbox_sizefactor_from_fadelerp(float fadelerp);
 
index 6920a98d197b9ce595298a0d454dd20accdb7839..ceaf0a6748741c424e0985bcd83f9dac9219591d 100644 (file)
@@ -74,7 +74,7 @@ void Draw_ShowNames(entity this)
                        vector eo = project_3d_to_2d(it.origin);
                        if (eo.z < 0 || eo.x < 0 || eo.y < 0 || eo.x > vid_conwidth || eo.y > vid_conheight) continue;
                        eo.z = 0;
-                       if (vdist(((eX * o.x + eY * o.y) - eo), <, autocvar_hud_shownames_antioverlap_distance)
+                       if (vdist((vec2(o) - eo), <, autocvar_hud_shownames_antioverlap_distance)
                            && vlen2(it.origin - view_origin) < vlen2(this.origin - view_origin))
                        {
                                overlap = 1;
@@ -135,8 +135,8 @@ void Draw_ShowNames(entity this)
        if (o.z >= 0)
        {
                o.z = 0;
-               vector mySize = (eX * autocvar_hud_shownames_aspect + eY) * autocvar_hud_shownames_fontsize;
-               vector myPos = o - '0.5 0 0' * mySize.x - '0 1 0' * mySize.y;
+               vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
+               vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
                // size scaling
                mySize.x *= resize;
                mySize.y *= resize;
@@ -147,17 +147,17 @@ void Draw_ShowNames(entity this)
                float namewidth = mySize.x;
                if (autocvar_hud_shownames_status && this.sameteam)
                {
-                       vector v = namepos + '0 1 0' * autocvar_hud_shownames_fontsize * resize;
-                       vector s = eX * 0.5 * mySize.x + eY * resize * autocvar_hud_shownames_statusbar_height;
+                       vector pos = namepos + eY * autocvar_hud_shownames_fontsize * resize;
+                       vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
                        if (this.healthvalue > 0)
                        {
-                               HUD_Panel_DrawProgressBar(v, s, "nametag_statusbar",
+                               HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar",
                                        this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a,
                                        DRAWFLAG_NORMAL);
                        }
                        if (this.armorvalue > 0)
                        {
-                               HUD_Panel_DrawProgressBar(v + eX * 0.5 * mySize.x, s, "nametag_statusbar",
+                               HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar",
                                        this.armorvalue / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
                                        DRAWFLAG_NORMAL);
                        }
index 8a70dcd610d3f9f64b4cf37c291a86f85944ee5f..75afcfccb1691869a863bab13166837ee142f32c 100644 (file)
@@ -62,10 +62,9 @@ float autocvar_cl_leanmodel_highpass = 0.2;
 float autocvar_cl_leanmodel_lowpass = 0.05;
 
 #define avg_factor(avg_time) (1 - exp(-frametime / max(0.001, avg_time)))
-#define lowpass(value, frac, ref_store, ret) MACRO_BEGIN \
-{ \
-       ret = ref_store = ref_store * (1 - frac) + (value) * frac; \
-} MACRO_END
+
+#define lowpass(value, frac, ref_store, ret) \
+       ret = ref_store = ref_store * (1 - frac) + (value) * frac;
 
 #define lowpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \
 { \
@@ -770,6 +769,8 @@ bool WantEventchase(entity this)
                        return true;
                if(MUTATOR_CALLHOOK(WantEventchase, this))
                        return true;
+               if(autocvar_cl_eventchase_frozen && STAT(FROZEN))
+                       return true;
                if(autocvar_cl_eventchase_death && (STAT(HEALTH) <= 0))
                {
                        if(autocvar_cl_eventchase_death == 2)
@@ -1200,7 +1201,7 @@ void HUD_Crosshair(entity this)
                                        }
 
                                        ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
-                                       ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
+                                       ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue);
                                        ring_inner_image = "gfx/crosshair_ring_inner.tga";
 
                                        // draw the outer ring to show the current charge of the weapon
@@ -1360,29 +1361,33 @@ void HUD_Draw(entity this)
        if(!intermission)
        if (MUTATOR_CALLHOOK(HUD_Draw_overlay))
        {
-               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE);
+               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE);
        }
        else if(STAT(FROZEN))
        {
-               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((STAT(REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * STAT(REVIVE_PROGRESS)) + ('0 1 1' * STAT(REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               vector col = '0.25 0.90 1';
+               if(STAT(REVIVE_PROGRESS))
+                       col += vec3(STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS));
+               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
        }
 
        HUD_Scale_Enable();
        if(!intermission)
        if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
        {
-               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * STAT(NADE_TIMER)) - ('0 1 1' * STAT(NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+               vector col = '0.25 0.90 1' + vec3(STAT(NADE_TIMER), -STAT(NADE_TIMER), -STAT(NADE_TIMER));
+               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
        }
        else if(STAT(CAPTURE_PROGRESS))
        {
-               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
        }
        else if(STAT(REVIVE_PROGRESS))
        {
-               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
        }
        HUD_Scale_Disable();
 
@@ -2085,7 +2090,7 @@ void CSQC_UpdateView(entity this, float w, float h)
                contentavgalpha = contentavgalpha * (1 - contentalpha_temp) + incontent * contentalpha_temp;
 
                if(contentavgalpha)
-                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);
+                       drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);
 
                if(autocvar_hud_postprocessing)
                {
@@ -2161,13 +2166,13 @@ void CSQC_UpdateView(entity this, float w, float h)
                        if(autocvar_cl_gentle_damage == 2)
                        {
                                if(myhealth_flash < pain_threshold) // only randomize when the flash is gone
-                                       myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
+                                       myhealth_gentlergb = randomvec();
                        }
                        else
                                myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color);
 
                        if(myhealth_flash_temp > 0)
-                               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
+                               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
                }
                else if(myhealth_flash_temp > 0)
                        drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
index c95bd62ae956831253121d0c977fcd4693431d6a..9e96756ba52de4feb7709164226599e2a8d1632f 100644 (file)
@@ -68,7 +68,7 @@
 
 // add hook function calls here
 #define CSQCPLAYER_HOOK_POSTCAMERASETUP() \
-       CSQCPlayer_SetViewLocation()
+       viewloc_SetViewLocation()
 
 // force updates of player entities this frequently (per second) even if unchanged
 #ifndef CSQCPLAYER_FORCE_UPDATES
index d72efd137862c62b44949759c9ce043bbdd1d74e..223a81f7c4d4dfb6039a3ea6b2189b0df864dfd0 100644 (file)
@@ -841,7 +841,7 @@ void ons_camSetup(entity this)
        float best_trace_fraction = 0;
        while(ang.y < 360)
        {
-               dir = eX * cos(ang.y * DEG2RAD) + eY * sin(ang.y * DEG2RAD);
+               dir = vec2(cos(ang.y * DEG2RAD), sin(ang.y * DEG2RAD));
                dir *= 500;
                traceline(this.origin, this.origin - dir, MOVE_WORLDONLY, this);
                if(trace_fraction > best_trace_fraction)
index 42f8c514e9bf0166a53bbfdc7c0cad5ccec2f5d9..2e5b30c61cbfae9f5ef5935e4aa4a100e78dd515 100644 (file)
@@ -8,7 +8,7 @@ void minigame_hud_simpleboard(vector pos, vector mySize, string board_texture)
                                        panel.current_panel_bg,
                                        mySize + '1 1 0' * 2 * panel_bg_border,
                                        panel_bg_color, panel_bg_alpha,
-                                        '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));
+                                       '1 1 0' * BORDER_MULTIPLIER * panel_bg_border);
        drawpic(pos, board_texture, mySize, '1 1 1', panel_bg_alpha, DRAWFLAG_NORMAL);
 }
 
index 1a6d4ff52272e39e4204c9e892545e6688536f63..5b0ee3c5b5d8606ecec15f5b57e57734778bfd59 100644 (file)
@@ -427,7 +427,7 @@ void HUD_MinigameMenu_Open()
 // Handles mouse input on to minigame menu panel
 void HUD_MinigameMenu_MouseInput()
 {
-       panel = HUD_PANEL(MINIGAME_MENU);
+       panel = HUD_PANEL(MINIGAMEMENU);
 
        HUD_Panel_LoadCvars();
 
@@ -575,7 +575,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
        {
                mousepos_x = nPrimary;
                mousepos_y = nSecondary;
-               if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
+               if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) )
                        active_minigame.minigame_event(active_minigame,"mouse_moved",mousepos);
                return true;
 
@@ -613,7 +613,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
                        string action = bInputType == 0 ? "pressed" : "released";
                        if ( nPrimary >= K_MOUSE1 && nPrimary <= K_MOUSE16 )
                        {
-                               if ( HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
+                               if ( HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) )
                                        device = "mouse";
                        }
                        else
@@ -629,7 +629,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
                if ( bInputType == 0 )
                {
                        if ( nPrimary == K_MOUSE1 && HUD_MinigameMenu_activeitem &&
-                               HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) )
+                               HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) )
                        {
                                HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem);
                                return true;
@@ -685,7 +685,7 @@ void HUD_Minigame_Mouse()
        if (!autocvar_hud_cursormode)
                update_mousepos();
 
-       if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) )
+       if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) )
                HUD_MinigameMenu_MouseInput();
 
        draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha);
index dd57fb5c66886c846458d3991ce1eef96f1707c2..55d41617da9c387a0146cb01c53a190751295089 100644 (file)
@@ -95,8 +95,8 @@ void pong_add_score(entity minigame, int team_thrower, int team_receiver, int de
 // get point in the box nearest to the given one (2D)
 vector box_nearest(vector box_min, vector box_max, vector p)
 {
-       return eX * ( p_x > box_max_x  ? box_max_x  : ( p_x < box_min_x ? box_min_x : p_x ) )
-               + eY * ( p_y > box_max_y  ? box_max_y  : ( p_y < box_min_y ? box_min_y : p_y ) );
+       return vec2( p.x > box_max.x  ? box_max.x  : ( p.x < box_min.x ? box_min.x : p.x ),
+               p.y > box_max.y  ? box_max.y  : ( p.y < box_min.y ? box_min.y : p.y ) );
 }
 
 void pong_paddle_bounce(entity ball, int pteam)
@@ -293,8 +293,8 @@ void pong_paddle_think(entity this)
 vector pong_team_to_box_halfsize(int nteam, float length, float width)
 {
        if ( nteam > 2 )
-               return eY*width/2 + eX*length/2;
-       return eX*width/2 + eY*length/2;
+               return vec2(length/2, width/2);
+       return vec2(width/2, length/2);
 }
 
 vector pong_team_to_paddlepos(int nteam)
index 227f3d9c63e42813798ecaf699a43ccebd55f5b1..6d14b258281f973a916b346ca9540776d75f7549 100644 (file)
@@ -26,8 +26,8 @@ int minigame_tile_number(string id)
 // Get relative position of the center of a given tile
 vector minigame_tile_pos(string id, int rows, int columns)
 {
-       return eX*(minigame_tile_letter(id)+0.5)/columns +
-              eY - eY*(minigame_tile_number(id)+0.5)/rows;
+       return vec2((minigame_tile_letter(id) + 0.5) / columns,
+               (1 - (minigame_tile_number(id) + 0.5) / rows));
 }
 
 // Get a tile name from indices
index f38d39d61867ef56ec625271f7a330012b6a74e2..b80875e36ff8bb74bd0753006966a4095377c4ce 100644 (file)
@@ -3,7 +3,7 @@
 string BUFF_NAME(int i)
 {
     Buff b = Buffs_from(i);
-    return sprintf("%s%s", rgb_to_hexcolor(b.m_color), b.m_prettyName);
+    return strcat(rgb_to_hexcolor(b.m_color), b.m_prettyName);
 }
 
 entity buff_FirstFromFlags(int _buffs)
index 3ffeb93711d55fdea88d8af452fa4d991b0add21..472fc646dbd9858615d6b25c80156073ad7d09d9 100644 (file)
@@ -238,7 +238,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon,
         if (autocvar_hud_panel_itemstime_progressbar_reduced)
         {
             p_pos = numpos;
-            p_size = eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y;
+            p_size = vec2(((ar - 1)/ar) * mySize.x, mySize.y);
         }
         else
         {
@@ -251,9 +251,9 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon,
     if(autocvar_hud_panel_itemstime_text)
     {
         if(t > 0)
-            drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+            drawstring_aspect(numpos, ftos(t), vec2(((ar - 1)/ar) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
         else if(precache_pic("gfx/hud/default/checkmark")) // COMPAT: check if this image exists, as 0.8.1 clients lack it
-            drawpic_aspect_skin(numpos, "checkmark", eX * (ar - 1) * mySize_y + eY * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL);
+            drawpic_aspect_skin(numpos, "checkmark", vec2((ar - 1) * mySize.y, mySize.y), '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL);
         else // legacy code, if the image is missing just center the icon
             picpos.x = myPos.x + mySize.x / 2 - mySize.y / 2;
     }
@@ -332,7 +332,7 @@ void HUD_ItemsTime()
     rows = HUD_GetRowCount(count, mySize, ar);
     columns = ceil(count/rows);
 
-    vector itemstime_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+    vector itemstime_size = vec2(mySize.x / columns, mySize.y / rows);
 
     vector offset = '0 0 0';
     float newSize;
@@ -420,7 +420,7 @@ LABEL(iteration)
             if (!(Item_ItemsTime_GetTime(id) > time))
                 continue;
 
-        DrawItemsTimeItem(pos + eX * column * (itemstime_size.x + offset.x) + eY * row * (itemstime_size.y + offset.y), itemstime_size, ar, icon, item_time, item_available, f);
+        DrawItemsTimeItem(pos + vec2(column * (itemstime_size.x + offset.x), row * (itemstime_size.y + offset.y)), itemstime_size, ar, icon, item_time, item_available, f);
         ++row;
         if (row >= rows)
         {
index da244ea1f78176de8cbb44d5b9d5d4e4e3bed267..052a132b93b1aea01e8bf0924947c9c31b253700 100644 (file)
@@ -133,7 +133,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
                DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor);
 
                if(autocvar_hud_panel_ammo_text)
-                       drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(textPos, ftos(bonusNades), vec2((2/3) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                if(draw_expanding)
                        drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
index 9cd2094a68852b59b4775090bdf40ea124701543..de8cf8f92d9bb9095fe82f9e68147fe0631ca13e 100644 (file)
@@ -40,8 +40,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED)
 REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY)
 REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS)
 
-REGISTER_NET_LINKED(ENT_CLIENT_MODEL)
-
 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE)
 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA)
 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED)
@@ -53,3 +51,5 @@ REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE)
 REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT)
 REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT)
 REGISTER_NET_LINKED(ENT_CLIENT_WALL)
+
+#include <lib/csqcmodel/net.qh>
index 407a703cfc03c4c7aea711a0e4be505a42c58de7..995c65b4d322061a7f00d0b5f0899a4480af02a4 100644 (file)
@@ -1,16 +1,4 @@
 #include "movetypes.qh"
-#include "../player.qh"
-
-#if defined(CSQC)
-       #include <client/defs.qh>
-       #include <common/stats.qh>
-       #include <common/util.qh>
-       #include <lib/csqcmodel/common.qh>
-       #include <common/t_items.qh>
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include <server/autocvars.qh>
-#endif
 
 #ifdef SVQC
 void set_movetype(entity this, int mt)
@@ -48,7 +36,7 @@ void _Movetype_WallFriction(entity this, vector stepnormal)  // SV_WallFriction
 vector planes[MAX_CLIP_PLANES];
 int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight) // SV_FlyMove
 {
-       int blocked = 0, bumpcount;
+       int blocked = 0;
        int i, j, numplanes = 0;
        float time_left = dt, grav = 0;
        vector push;
@@ -73,7 +61,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
 
        original_velocity = primal_velocity = restore_velocity = this.velocity;
 
-       for(bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++)
+       for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++)
        {
                if(this.velocity == '0 0 0')
                        break;
@@ -138,7 +126,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                                break;
                        }
                        float trace2_fraction = trace_fraction;
-                       steppush = '0 0 1' * (org_z - this.origin_z);
+                       steppush = '0 0 1' * (org.z - this.origin_z);
                        _Movetype_PushEntity(this, steppush, true);
                        if(trace_startsolid)
                        {
@@ -147,7 +135,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                        }
 
                        // accept the new position if it made some progress...
-                       if(fabs(this.origin_x - org_x) >= 0.03125 || fabs(this.origin_y - org_y) >= 0.03125)
+                       if(fabs(this.origin_x - org.x) >= 0.03125 || fabs(this.origin_y - org.y) >= 0.03125)
                        {
                                trace_endpos = this.origin;
                                time_left *= 1 - trace2_fraction;
index d26de7b964983d6c702c752fa20869ae35016a7f..712817386037581064666a4e9cd7ce5faca8590f 100644 (file)
@@ -7,6 +7,13 @@
 #define SET_ONSLICK(s)                                         ((s).flags |= FL_ONSLICK)
 #define UNSET_ONSLICK(s)                                       ((s).flags &= ~FL_ONSLICK)
 
+#define GAMEPLAYFIX_DOWNTRACEONGROUND(s)    STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s)
+#define GAMEPLAYFIX_EASIERWATERJUMP(s)      STAT(GAMEPLAYFIX_EASIERWATERJUMP, s)
+#define GAMEPLAYFIX_STEPDOWN(s)             STAT(GAMEPLAYFIX_STEPDOWN, s)
+#define GAMEPLAYFIX_STEPMULTIPLETIMES(s)    STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s)
+#define GAMEPLAYFIX_UNSTICKPLAYERS(s)       STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s)
+#define GAMEPLAYFIX_WATERTRANSITION(s)                 STAT(GAMEPLAYFIX_WATERTRANSITION, s)
+
 #ifdef CSQC
 .float bouncestop;
 .float bouncefactor;
index 498852135b40fd0607ee78d1b86daff703e48ac5..71e7fa9d08c9032e14abe5bb9bdcd10824b84121 100644 (file)
@@ -1,5 +1,4 @@
 #include "toss.qh"
-#include "../player.qh"
 
 void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
 {
index 571d3c6cb4a009c864174bbc27997fc69f6dbf7a..7c093c15d81eb061ac95ae6089c1ece0748c67b9 100644 (file)
@@ -29,14 +29,18 @@ float AdjustAirAccelQW(float accelqw, float factor);
 
 bool IsFlying(entity a);
 
-#define BUFFS_STAT(s)                       STAT(BUFFS, s)
+#define PHYS_PL_MAX(s)                                         STAT(PL_MAX, s)
+#define PHYS_PL_MIN(s)                                         STAT(PL_MIN, s)
+#define PHYS_PL_CROUCH_MAX(s)                          STAT(PL_CROUCH_MAX, s)
+#define PHYS_PL_CROUCH_MIN(s)                          STAT(PL_CROUCH_MIN, s)
+
+#define PHYS_PL_VIEWOFS(s)                                     STAT(PL_VIEW_OFS, s)
+#define PHYS_PL_CROUCH_VIEWOFS(s)                      STAT(PL_CROUCH_VIEW_OFS, s)
 
-#define GAMEPLAYFIX_DOWNTRACEONGROUND(s)    STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s)
-#define GAMEPLAYFIX_EASIERWATERJUMP(s)      STAT(GAMEPLAYFIX_EASIERWATERJUMP, s)
-#define GAMEPLAYFIX_STEPDOWN(s)             STAT(GAMEPLAYFIX_STEPDOWN, s)
-#define GAMEPLAYFIX_STEPMULTIPLETIMES(s)    STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s)
-#define GAMEPLAYFIX_UNSTICKPLAYERS(s)       STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s)
-#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s)
+#define PHYS_VIEWHEIGHT(s)                                     STAT(VIEWHEIGHT, s)
+#define PHYS_HEALTH(s)                                         STAT(HEALTH, s)
+
+#define BUFFS_STAT(s)                       STAT(BUFFS, s)
 
 #define PHYS_ACCELERATE(s)                  STAT(MOVEVARS_ACCELERATE, s)
 #define PHYS_AIRACCELERATE(s)               STAT(MOVEVARS_AIRACCELERATE, s)
index 7f31e20d311746958f80082fababa2a9e01ab253..2342af6d978abb79c1d29e2d648e0c192ee294d0 100644 (file)
@@ -260,7 +260,15 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that
 // this... is a hack, a temporary one until we get a proper duel gametype
 string PlayerStats_GetGametype()
 {
-       return ((IS_GAMETYPE(DEATHMATCH) && autocvar_g_maxplayers == 2) ? "duel" : GetGametype());
+       if(IS_GAMETYPE(DEATHMATCH) && autocvar_g_maxplayers == 2)
+       {
+               // probably duel, but let's make sure
+               int plcount = 0;
+               FOREACH_CLIENT(IS_PLAYER(it), ++plcount);
+               if(plcount <= 2)
+                       return "duel";
+       }
+       return GetGametype();
 }
 
 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
index 2746eabfc3fa048f681dd0ce0030075a6bdec8c3..811115b68071f36e358f2faa6d664b6a801f585d 100644 (file)
@@ -63,6 +63,8 @@ void Item_SetAlpha(entity this)
                this.colormod = this.glowmod = autocvar_cl_weapon_stay_color;
                this.alpha = autocvar_cl_weapon_stay_alpha;
        }
+
+       this.drawmask = ((this.alpha <= 0) ? 0 : MASK_NORMAL);
 }
 
 void ItemDraw(entity this)
@@ -127,9 +129,7 @@ void Item_PreDraw(entity this)
 {
        if(warpzone_warpzones_exist)
        {
-               // just incase warpzones were initialized last, reset these
-               //this.alpha = 1; // alpha is already set by the draw function
-               this.drawmask = MASK_NORMAL;
+               setpredraw(this, func_null); // no need to keep running this
                return;
        }
        float alph;
@@ -145,8 +145,8 @@ void Item_PreDraw(entity this)
                this.alpha = alph;
        if(alph <= 0)
                this.drawmask = 0;
-       else
-               this.drawmask = MASK_NORMAL;
+       //else
+               //this.drawmask = MASK_NORMAL; // reset by the setalpha function
 }
 
 void ItemRemove(entity this)
@@ -213,7 +213,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
 
         this.fade_end = ReadShort();
         this.fade_start = ReadShort();
-        if(this.fade_start && !autocvar_cl_items_nofade)
+        if(!warpzone_warpzones_exist && this.fade_start && !autocvar_cl_items_nofade)
                setpredraw(this, Item_PreDraw);
 
         if(this.mdl)
@@ -227,14 +227,14 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
             string _fn2 = substring(_fn, 0 , strlen(_fn) -4);
             this.draw = ItemDrawSimple;
 
-            if(fexists(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix));
+            if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".dpm")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".dpm"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".iqm")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".iqm"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl"));
             else
             {
                 this.draw = ItemDraw;
index 81a61019080174099569de31bfb87670605c3ea1..79c2feb4eab85b8115a0ddcd00270a26323d7c81 100644 (file)
@@ -271,7 +271,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float
                this.takedamage = DAMAGE_NO;
                this.event_damage = func_null;
 
-               if(IS_CLIENT(attacker) && this.classname == "func_assault_destructible")
+               if(IS_CLIENT(attacker)) //&& this.classname == "func_assault_destructible")
                {
                        this.owner = attacker;
                        this.realowner = attacker;
index d8c0d67faab7d4e066da95f61d4e522e74a7521e..da86bf22ea63eccf1c7a408c815bb2d049e7f6ad 100644 (file)
@@ -150,16 +150,6 @@ vector healtharmor_applydamage(float a, float armorblock, int deathtype, float d
 
 string getcurrentmod();
 
-#ifdef GAMEQC
-#ifdef CSQC
-int ReadInt24_t();
-#else
-void WriteInt24_t(float dest, float val);
-void WriteInt48_t(float dest, vector val);
-void WriteInt72_t(float dest, vector val);
-#endif
-#endif
-
 float float2range11(float f);
 float float2range01(float f);
 
index 367bab6afb26c5aba16179d96fae28096b765827..513af5209d670cac485f046342922c5e003c0bf3 100644 (file)
@@ -90,15 +90,11 @@ vector solve_cubic_pq(float p, float q)
                // cos(a)
                // cos(a + 2pi/3)
                // cos(a + 4pi/3)
-               return
-                       u *
-                       (
-                               '1 0 0' * cos(a + 2.0/3.0*M_PI)
-                               +
-                               '0 1 0' * cos(a + 4.0/3.0*M_PI)
-                               +
-                               '0 0 1' * cos(a)
-                       );
+               return u * vec3(
+                       cos(a + 2.0/3.0*M_PI),
+                       cos(a + 4.0/3.0*M_PI),
+                       cos(a)
+               );
        }
        else if(D == 0)
        {
@@ -107,17 +103,15 @@ vector solve_cubic_pq(float p, float q)
                        return '0 0 0';
                u = 3*q/p;
                v = -u/2;
-               if(u >= v)
-                       return '1 1 0' * v + '0 0 1' * u;
-               else
-                       return '0 1 1' * v + '1 0 0' * u;
+               return (u >= v) ? vec3(v, v, u) : vec3(u, v, v);
        }
        else
        {
                // cardano
-               u = cbrt(-q/2.0 + sqrt(D));
-               v = cbrt(-q/2.0 - sqrt(D));
-               return '1 1 1' * (u + v);
+               //u = cbrt(-q/2.0 + sqrt(D));
+               //v = cbrt(-q/2.0 - sqrt(D));
+               a = cbrt(-q/2.0 + sqrt(D)) + cbrt(-q/2.0 - sqrt(D));
+               return vec3(a, a, a);
        }
 }
 vector solve_cubic_abcd(float a, float b, float c, float d)
@@ -137,11 +131,7 @@ vector solve_cubic_abcd(float a, float b, float c, float d)
 
 vector findperpendicular(vector v)
 {
-       vector p;
-       p.x = v.z;
-       p.y = -v.x;
-       p.z = v.y;
-       return normalize(cliptoplane(p, v));
+       return normalize(cliptoplane(vec3(v.z, -v.x, v.y), v));
 }
 
 #ifdef SVQC
index 652534b7a28d05e47fbf21668a16170967db440b..ef3c4dc83ccfeb798396159ea4c2d3beba3226c8 100644 (file)
@@ -157,7 +157,7 @@ void W_Tuba_NoteOff(entity this)
        if (actor.(weaponentity).tuba_note == this)
        {
                actor.(weaponentity).tuba_lastnotes_last = (actor.(weaponentity).tuba_lastnotes_last + 1) % MAX_TUBANOTES;
-               actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = eX * this.spawnshieldtime + eY * time + eZ * this.cnt;
+               actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = vec3(this.spawnshieldtime, time, this.cnt);
                actor.(weaponentity).tuba_note = NULL;
                actor.(weaponentity).tuba_lastnotes_cnt = bound(0, actor.(weaponentity).tuba_lastnotes_cnt + 1, MAX_TUBANOTES);
 
index 11c06822edfd73767f86dc721219ce552429554f..12ec4a9b61dc7f09a4fff6c80a735022c558ae70 100644 (file)
@@ -166,42 +166,37 @@ string process_time(float outputtype, float seconds)
 
                        if (tmp_minutes)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_minutes(tmp_minutes),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_hours)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_hours(tmp_hours),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_days)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_weeks)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_weeks(tmp_weeks),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_years)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_years(tmp_years),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        return output;
@@ -217,9 +212,8 @@ string process_time(float outputtype, float seconds)
                        if (tmp_days)
                        {
                                output = sprintf(
-                                       "%s%s",
                                        count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        return output;
index e4e1d536aa85eb84175ec0e3350d3f14678f86ba..05aba388c4b7c27a49d13cdb160a75afc559a43b 100644 (file)
 #include "cl_player.qh"
 #include "common.qh"
 #include "interpolate.qh"
-#include <client/defs.qh>
-#include <common/animdecide.qh>
 #include <common/csqcmodel_settings.qh>
-#include <common/util.qh>
 
 float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1;
 float autocvar_cl_nolerp = 0;
index 9e26e70fb7424ff07d3fbf79747bffe218c1dd4f..faefdcad4316b6dc4a034432aba9e811eebf9526 100644 (file)
 #include "cl_model.qh"
 #include "common.qh"
 #include "interpolate.qh"
-#include <client/defs.qh>
-#include <client/main.qh>
-#include <common/constants.qh>
-#include <common/net_linked.qh>
-#include <common/physics/player.qh>
-#include <common/stats.qh>
-#include <common/triggers/trigger/viewloc.qh>
-#include <common/util.qh>
-#include <common/viewloc.qh>
 
 float autocvar_cl_movement_errorcompensation = 0;
 bool autocvar_cl_movement_intermissionrunning = false;
@@ -109,15 +100,15 @@ void CSQCPlayer_SetMinsMaxs(entity this)
 {
        if (IS_DUCKED(this) || !this.isplayermodel)
        {
-               this.mins = STAT(PL_CROUCH_MIN, this);
-               this.maxs = STAT(PL_CROUCH_MAX, this);
-               this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this);
+               this.mins = PHYS_PL_CROUCH_MIN(this);
+               this.maxs = PHYS_PL_CROUCH_MAX(this);
+               this.view_ofs = PHYS_PL_CROUCH_VIEWOFS(this);
        }
        else
        {
-               this.mins = STAT(PL_MIN, this);
-               this.maxs = STAT(PL_MAX, this);
-               this.view_ofs = STAT(PL_VIEW_OFS, this);
+               this.mins = PHYS_PL_MIN(this);
+               this.maxs = PHYS_PL_MAX(this);
+               this.view_ofs = PHYS_PL_VIEWOFS(this);
        }
 }
 
@@ -216,18 +207,13 @@ bool CSQCPlayer_IsLocalPlayer(entity this)
        return (this == csqcplayer);
 }
 
-void CSQCPlayer_SetViewLocation()
-{
-       viewloc_SetViewLocation();
-}
-
 /** Called once per CSQC_UpdateView() */
 void CSQCPlayer_SetCamera()
 {
        const vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
-       const float vh = STAT(VIEWHEIGHT);
-       const vector pl_viewofs = STAT(PL_VIEW_OFS);
-       const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS);
+       const float vh = PHYS_VIEWHEIGHT(NULL);
+       const vector pl_viewofs = PHYS_PL_VIEWOFS(NULL);
+       const vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL);
        const entity e = csqcplayer;
        if (e)
        {
@@ -303,7 +289,7 @@ void CSQCPlayer_SetCamera()
                if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
                if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
                // note: these two only work in WIP2, but are harmless in WIP1
-               if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) refdefflags |= REFDEFFLAG_DEAD;
+               if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
                if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
                V_CalcRefdef(view, refdefflags);
        }
diff --git a/qcsrc/lib/csqcmodel/net.qh b/qcsrc/lib/csqcmodel/net.qh
new file mode 100644 (file)
index 0000000..43ad1b9
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+REGISTER_NET_LINKED(ENT_CLIENT_MODEL)
index dd8d5d33aaee2a8f479cd6edcc34f9047adf6730..0ff4389944c03dcda8f0756cb0dba5d21d43fef5 100644 (file)
 #include "sv_model.qh"
 
 #include "common.qh"
-#include <common/animdecide.qh>
-#include <common/constants.qh>
-#include <common/net_linked.qh>
-#include <common/util.qh>
-#include <server/constants.qh>
-#include <server/defs.qh>
 
 // generic CSQC model code
 
index d52f25cdd28ac680b97be35b9311e855e553a0e7..f322753c0af92d9d5eda78b9e57497633777b052 100644 (file)
@@ -80,6 +80,12 @@ const noref vector default_vector = '0 0 0';
 #define repr_cvar_string(x) (x)
 #define repr_cvar_vector(x) (sprintf("%v", x))
 
+//pseudo prototypes:
+// void AUTOCVAR(<cvar_name>, <qc_var_type>, default_cvar_value, string desc)
+// void AUTOCVAR_SAVE(<cvar_name>, <qc_var_type>, default_cvar_value, string desc)
+//  where default_cvar_value has type <qc_var_type>
+//  e.g.: AUTOCVAR(mycvar, float, 2.5, "cvar description")
+
 #define __AUTOCVAR(file, archive, var, type, desc, default) \
        [[accumulate]] void RegisterCvars(void(string, string, string, bool, string) f) \
        { \
index e8aeaecae61f968bedd1f5ac640d7dce2e677b05..e0605c93840599e8f928f359ce1f6b02cccd7016 100644 (file)
@@ -134,6 +134,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, loddistance1) \
                FIELD_SCALAR(fld, lodmodel1) \
                FIELD_SCALAR(fld, ltime) \
+               FIELD_SCALAR(fld, map) \
                FIELD_SCALAR(fld, mdl) \
                FIELD_SCALAR(fld, message2) \
                FIELD_SCALAR(fld, message) \
@@ -168,6 +169,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, spawnmob) \
                FIELD_SCALAR(fld, speed) \
                FIELD_SCALAR(fld, strength) \
+               FIELD_SCALAR(fld, style) \
                FIELD_SCALAR(fld, target2) \
                FIELD_SCALAR(fld, target3) \
                FIELD_SCALAR(fld, target4) \
@@ -184,10 +186,13 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, warpzone_fadeend) \
                FIELD_SCALAR(fld, warpzone_fadestart) \
                FIELD_SCALAR(fld, weapon) \
+               FIELD_SCALAR(fld, worldtype) \
                FIELD_VEC(fld, absmax) \
                FIELD_VEC(fld, absmin) \
                FIELD_VEC(fld, angles) \
                FIELD_VEC(fld, avelocity) \
+               FIELD_VEC(fld, color) \
+               FIELD_VEC(fld, mangle) \
                FIELD_VEC(fld, maxs) \
                FIELD_VEC(fld, maxs) \
                FIELD_VEC(fld, mins) \
index 5d2b795f4515f6915141cc7ff0c5758ebda26dd9..746a43d089015eec6eed881b76ea86df8eb10d87 100644 (file)
@@ -100,6 +100,10 @@ float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { ret
        up = v_up; \
 } MACRO_END
 
+//pseudo prototypes:
+// vector vec2(vector v); // returns a vector with just the x and y components of the given vector
+// vector vec2(float x, float y); // returns a vector with the given x and y components
+
 noref vector _vec2;
 #define vec2(...) EVAL(OVERLOAD(vec2, __VA_ARGS__))
 #define vec2_1(v) (_vec2 = (v), _vec2.z = 0, _vec2)
@@ -112,10 +116,7 @@ noref vector _vec3;
 vector Rotate(vector v, float a)
 {
        float a_sin = sin(a), a_cos = cos(a);
-       vector r = '0 0 0';
-       r.x =      v.x * a_cos + v.y * a_sin;
-       r.y = -1 * v.x * a_sin + v.y * a_cos;
-       return r;
+       return vec2(v.x * a_cos + v.y * a_sin, -v.x * a_sin + v.y * a_cos);
 }
 
 noref vector _yinvert;
@@ -177,10 +178,10 @@ vector vec_epsilon(vector this, float eps)
                vector m1 = box.mins + box.origin;
                vector m2 = box.maxs + box.origin;
 
-               vector ret;
-               ret.x = bound(m1.x, org.x, m2.x);
-               ret.y = bound(m1.y, org.y, m2.y);
-               ret.z = bound(m1.z, org.z, m2.z);
-               return ret;
+               return vec3(
+                       bound(m1.x, org.x, m2.x),
+                       bound(m1.y, org.y, m2.y),
+                       bound(m1.z, org.z, m2.z)
+               );
        }
 #endif
index b12534f7d73756d49d5a2703f036562a4bf76d85..69178cb03eedb522c29a0597b22c9f09303133cb 100644 (file)
@@ -9,8 +9,8 @@ vector draw_scale;
 float draw_alpha;
 
 void draw_reset(float cw, float ch, float ox, float oy);
-#define draw_beginBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 3; } MACRO_END
-#define draw_endBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 0; } MACRO_END
+#define draw_beginBoldFont() drawfont = FONT_USER + 3
+#define draw_endBoldFont() drawfont = FONT_USER
 void draw_setMousePointer(string pic, vector theSize, vector theOffset);
 void draw_drawMousePointer(vector where);
 
index b3f0e90fa38d3129b9d94a94e8381967fe4178af..cb5bf625f6cb0c37a71f445e33683f4cbfa70239 100644 (file)
@@ -34,9 +34,9 @@ const int BOT_CMD_BARRIER             = 20;
 const int BOT_CMD_CONSOLE              = 21;
 const int BOT_CMD_SOUND                = 22;
 const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
-const int BOT_CMD_WHILE                = 24;   // TODO: Not implemented yet
-const int BOT_CMD_WEND                         = 25;   // TODO: Not implemented yet
-const int BOT_CMD_CHASE                = 26;   // TODO: Not implemented yet
+//const int BOT_CMD_WHILE              = 24;   // TODO: Not implemented yet
+//const int BOT_CMD_WEND                       = 25;   // TODO: Not implemented yet
+//const int BOT_CMD_CHASE              = 26;   // TODO: Not implemented yet
 
 const int BOT_CMD_COUNTER              = 24;   // Update this value if you add/remove a command
 
index 69d031eaf3601869a1f0a9ff49dab5cebb1d54e3..daf9e940f786ae65711e7204fe1225735199812f 100644 (file)
@@ -1,5 +1,6 @@
 // generated file; do not modify
 #include <server/compat/halflife.qc>
 #include <server/compat/quake.qc>
+#include <server/compat/quake2.qc>
 #include <server/compat/quake3.qc>
 #include <server/compat/wop.qc>
index bd658580e1153205d993190223a5f85f3152c3b8..c1614764dbec90da610fc399ba5ec5d29769274f 100644 (file)
@@ -1,5 +1,6 @@
 // generated file; do not modify
 #include <server/compat/halflife.qh>
 #include <server/compat/quake.qh>
+#include <server/compat/quake2.qh>
 #include <server/compat/quake3.qh>
 #include <server/compat/wop.qh>
diff --git a/qcsrc/server/compat/quake2.qc b/qcsrc/server/compat/quake2.qc
new file mode 100644 (file)
index 0000000..df99f15
--- /dev/null
@@ -0,0 +1,15 @@
+#include "quake2.qh"
+
+spawnfunc(item_armor_medium);
+
+spawnfunc(item_invincible);
+
+
+//***********************
+//QUAKE 2 ENTITIES - So people can play quake2 maps with the xonotic weapons
+//***********************
+spawnfunc(item_armor_jacket) {spawnfunc_item_armor_medium(this);}
+
+spawnfunc(item_invulnerability) {spawnfunc_item_invincible(this);}
+
+// rest of the quake 2 entities are handled by q1 and q3 compat
diff --git a/qcsrc/server/compat/quake2.qh b/qcsrc/server/compat/quake2.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
index 8815aceac1c95f88cb87bb697257beef0afd9a1c..905523bfba33696632d096af7bbfb96efe4ba0d2 100644 (file)
@@ -5,6 +5,7 @@
 spawnfunc(weapon_crylink);
 spawnfunc(weapon_electro);
 spawnfunc(weapon_hagar);
+spawnfunc(weapon_hook);
 spawnfunc(weapon_machinegun);
 spawnfunc(weapon_vortex);
 spawnfunc(weapon_minelayer);
@@ -60,6 +61,9 @@ spawnfunc(ammo_slugs)          { spawnfunc_item_cells(this);          }
 spawnfunc(weapon_bfg)          { spawnfunc_weapon_crylink(this);      }
 spawnfunc(ammo_bfg)            { spawnfunc_item_cells(this);          }
 
+// grappling hook -> hook
+spawnfunc(weapon_grapplinghook) { spawnfunc_weapon_hook(this);        }
+
 // RL -> RL
 spawnfunc(ammo_rockets)        { spawnfunc_item_rockets(this);        }
 
index 786635af07e4b145383f91ea9d2d325b8670a3d1..16564cd39b7c7175187e659bcb119fc7ba27cca0 100644 (file)
@@ -76,7 +76,7 @@ void round_handler_Init(float the_delay, float the_count, float the_round_timeli
 }
 
 // NOTE: this is only needed because if round_handler spawns at time 1
-// gamestarttime isn't initialized yet
+// game_starttime isn't initialized yet
 void round_handler_FirstThink(entity this)
 {
        round_starttime = max(time, game_starttime) + this.count;