diff options
author | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
commit | ac66e3e28f35c6939d3af68d1f0e26eb9b34e377 (patch) | |
tree | a82679a91beaee405777f0f3c5e3c45814f1ea5d /settings_gui.c | |
parent | f432314fa907d4f3ee63537d399bad64a35033bd (diff) | |
download | openttd-ac66e3e28f35c6939d3af68d1f0e26eb9b34e377.tar.xz |
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
Diffstat (limited to 'settings_gui.c')
-rw-r--r-- | settings_gui.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/settings_gui.c b/settings_gui.c index fc6c00462..a2ef471cf 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -1019,16 +1019,16 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e) /** Network-safe changing of patch-settings. * @param p1 various bitstuffed elements - * - p1 = (bit 0- 7) - the patches type (page) that is being changed (construction, network, ai) (p1 & 0xFF) - * - p2 = (bit 8-15) - the actual patch (entry) being set inside the category ((p1>>8) & 0xFF) + * - p1 = (bit 0- 7) - the patches type (page) that is being changed (construction, network, ai) + * - p2 = (bit 8-15) - the actual patch (entry) being set inside the category * @param p2 the new value for the patch * @todo check that the new value is a valid one. Awful lot of work, but since only * the server is allowed to do this, we trust it on this one :) */ int32 CmdChangePatchSetting(int x, int y, uint32 flags, uint32 p1, uint32 p2) { - byte pcat = p1 & 0xFF; - byte pel = (p1 >> 8) & 0xFF; + byte pcat = GB(p1, 0, 8); + byte pel = GB(p1, 8, 8); if (pcat >= lengthof(_patches_page)) return CMD_ERROR; if (pel >= _patches_page[pcat].num) return CMD_ERROR; |