Merge branch 'master' into powerslave

This commit is contained in:
Christoph Oelckers 2019-12-13 20:43:23 +01:00
commit 052ed5fff7
338 changed files with 20918 additions and 39961 deletions

View file

@ -1,18 +1,44 @@
# Game Controller DB for SDL in 2.0.9 format
# Game Controller DB for SDL in 2.0.10 format
# Source: https://github.com/gabomdq/SDL_GameControllerDB
# Windows
03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows,
03000000c82d00002038000000000000,8bitdo,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d000011ab000000000000,8BitDo F30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows,
03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00015900000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00065280000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
03000000102800000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00003028000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000351000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00006228000000000000,8BitDo SN30 GP,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
03000000c82d00000031000000000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
03000000a00500003232000000000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
030000008f0e00001200000000000000,Acme GA-02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
03000000fa190000f0ff000000000000,Acteck AGJ-3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
@ -21,6 +47,7 @@
030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000d62000001d57000000000000,Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000869800002400000000007801,Astro C40 TR,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
03000000d6200000e557000000000000,Batarang,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows,
030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
@ -38,6 +65,7 @@
0300000066f700000500000000000000,BrutalLegendTest,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
03000000d81d00000b00000000000000,BUFFALO BSGP1601 Series ,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows,
03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
030000005e040000a102000000000000,Controller (Xbox 360 Wireless Receiver for Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
030000005e040000ff02000000000000,Controller (Xbox One For Windows) - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
@ -50,6 +78,7 @@
030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
03000000341a00000108000000000000,EXEQ RF USB Gamepad 8206,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
@ -83,6 +112,7 @@
030000000d0f00004900000000000000,Hatsune Miku Sho Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000d81400000862000000000000,HitBox Edition Cthulhu+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
03000000632500002605000000000000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00005f00000000000000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00005e00000000000000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00004000000000000000,Hori Fighting Stick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
@ -90,9 +120,11 @@
030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00006e00000000000000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00006600000000000000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f0000ee00000000000000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
03000000250900000017000000000000,HRAP2 on PS/SS/N64 Joypad to USB BOX,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows,
030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows,
@ -138,9 +170,13 @@
03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows,
03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,back:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b0,leftshoulder:b4,leftstick:b0,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b0,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
030000008f0e00001030000000000000,Mayflash USB Adapter for original Sega Saturn controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows,
0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000790000002418000000000000,Mega Drive,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows,
03000000380700006382000000000000,MLG GamePad PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
@ -191,6 +227,8 @@
03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
030000000d0f00001100000000000000,REAL ARCADE PRO.3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
@ -221,14 +259,16 @@
03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows,
0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
# 030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows,
03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,
03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows,
03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows,
@ -247,6 +287,7 @@
03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows,
03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
030000006e0500001320000000000000,U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
03000000341a00002308000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
@ -256,7 +297,9 @@
03000000f0250000c183000000000000,USB gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000ff1100004133000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
03000000632500002305000000000000,USB Vibration Joystick (BM),a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
030000006f0e00000302000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
@ -267,10 +310,14 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
# Mac OS X
030000008f0e00000300000009010000,2In1 USB Joystick,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000c82d00000031000001000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
@ -282,6 +329,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
030000006f0e00000102000000000000,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
030000007d0400000540000001010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000000d0f00005f00000000010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000000d0f00005e00000000010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
030000000d0f00005f00000000000000,HORI Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
@ -302,6 +350,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000006d04000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000006d04000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000006d0400001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
030000006d04000018c2000000010000,Logitech RumblePad 2 USB,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
030000006d04000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
@ -310,14 +359,19 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000380700008433000000010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000380700008483000000010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X,
0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X,
03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X,
03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
03000000632500007505000000020000,NEOGEO mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,
030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Mac OS X,
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X,
030000004c050000da0c000000010000,Playstation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,
030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,
@ -329,6 +383,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
@ -336,6 +391,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000c6240000fefa000000000000,Rock Candy Gamepad for PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X,
03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X,
03000000b40400000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X,
030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
@ -353,6 +409,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X,
030000006f0e00000302000025040000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
03000000791d00000103000009010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X,
050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X,
030000005e0400008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
@ -370,37 +428,57 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
# Linux
05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux,
03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,
05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,
03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00003028000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
030000005e0400008e02000020010000,8BitDo Wireless Adapter,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000c82d00000031000011010000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
05000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
030000006f0e00001302000000010000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux,
030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,
05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,
03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux,
03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux,
03000000ffff0000ffff000000010000,Chinese-made Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux,
03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux,
03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
03000000b40400000a01000000010000,CYPRESS USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,
03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000007d0400000540000000010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
@ -408,6 +486,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys GamePad ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux,
030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
06000000adde0000efbe000002010000,Hidromancer Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux,
03000000c9110000f055000011010000,HJC Game GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
@ -428,6 +507,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux,
03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux,
0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux,
@ -463,10 +543,12 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000380700001888000010010000,MadCatz PC USB Wired Stick 8818,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000380700003888000010010000,MadCatz PC USB Wired Stick 8838,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
0300000079000000d218000011010000,MAGIC-NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
03000000790000004318000010010000,Mayflash GameCube Controller Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux,
0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
03000000780000000600000010010000,Microntek USB Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,
@ -478,12 +560,15 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
03000000c62400001a53000000010000,Mini PE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,
030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Linux,
030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux,
050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
@ -498,9 +583,11 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000006f0e0000a802000023020000,PDP Wired Controller for Xbox One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
030000004c050000da0c000011010000,Playstation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
@ -510,7 +597,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
@ -521,6 +608,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
@ -533,6 +621,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000321500000204000011010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000321500000104000011010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
03000000321500000010000011010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
@ -540,6 +629,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,
0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux,
0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,
030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
@ -548,9 +638,11 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux,
03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux,
03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a1,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux,
03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux,
03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux,
03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,a:b12,b:b10,back:b4,dpdown:b2,dpleft:b3,dpright:b1,dpup:b0,leftshoulder:b9,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b8,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b5,x:b13,y:b11,platform:Linux,
03000000f025000021c1000010010000,ShanWan Gioteck PS3 Wired Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
03000000632500007505000010010000,SHANWAN PS3/PC Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
@ -582,11 +674,15 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000004f04000012b3000010010000,Thrustmaster vibrating gamepad,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
03000000bd12000015d0000010010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,
03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux,
030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
03000000791d00000103000010010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
@ -596,9 +692,11 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux,
030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
030000005e040000ea02000001030000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000450c00002043000010010000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux,
03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux,
@ -619,6 +717,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android,
05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,
05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,
@ -630,9 +730,15 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
# iOS
05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
050000004c050000cc090000df070000,DUALSHOCK 4 Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS,
4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS,
05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,

View file

@ -623,6 +623,7 @@ file( GLOB HEADER_FILES
common/console/*.h
common/filesystem/*.h
common/music/*.h
common/menu/*.h
build/src/*.h
thirdparty/include/*.h
@ -664,9 +665,9 @@ set( FASTMATH_SOURCES
set (PCH_SOURCES
audiolib/src/drivers.cpp
audiolib/src/driver_adlib.cpp
audiolib/src/driver_nosound.cpp
audiolib/src/driver_sdl.cpp
audiolib/src/driver_winmm.cpp
audiolib/src/formats.cpp
@ -746,11 +747,11 @@ set (PCH_SOURCES
common/searchpaths.cpp
common/initfs.cpp
common/openaudio.cpp
common/optionmenu/optionmenu.cpp
common/statistics.cpp
common/secrets.cpp
common/compositesavegame.cpp
common/savegamehelp.cpp
common/quotes.cpp
common/2d/v_2ddrawer.cpp
common/2d/v_draw.cpp
@ -772,6 +773,7 @@ set (PCH_SOURCES
common/console/c_commandline.cpp
common/console/c_dispatch.cpp
common/console/d_event.cpp
common/console/c_con.cpp
common/utility/i_time.cpp
common/utility/name.cpp
@ -788,6 +790,7 @@ set (PCH_SOURCES
common/utility/m_png.cpp
common/utility/memarena.cpp
common/utility/sc_man.cpp
common/utility/stringtable.cpp
common/utility/stats.cpp
common/filesystem/filesystem.cpp
@ -824,7 +827,16 @@ set (PCH_SOURCES
common/music/backend/oalsound.cpp
common/music/backend/i_sound.cpp
common/menu/imagescroller.cpp
common/menu/joystickmenu.cpp
common/menu/listmenu.cpp
common/menu/savegamemanager.cpp
common/menu/loadsavemenu.cpp
common/menu/menu.cpp
common/menu/menudef.cpp
common/menu/menuinput.cpp
common/menu/messagebox.cpp
common/menu/optionmenu.cpp
)
if( MSVC )
@ -848,7 +860,7 @@ add_executable( demolition WIN32 MACOSX_BUNDLE
#zzautozend.cpp
)
set_source_files_properties( ${FASTMATH_SOURCES} PROPERTIES COMPILE_FLAGS ${DEM_FASTMATH_FLAG} )
#set_source_files_properties( ${FASTMATH_SOURCES} PROPERTIES COMPILE_FLAGS ${DEM_FASTMATH_FLAG} )
set_source_files_properties( xlat/parse_xlat.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c" )
set_source_files_properties( utility/sc_man.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h" )
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
@ -887,6 +899,8 @@ include_directories(
common/textures
common/filesystem
common/music
common/dobject
common/menu
platform
${CMAKE_BINARY_DIR}/libraries/gdtoa
@ -995,6 +1009,8 @@ source_group("Code\\Console" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/co
source_group("Code\\Fonts" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/fonts/.+")
source_group("Code\\File System" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/filesystem/.+")
source_group("Code\\Music" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/music/.+")
source_group("Code\\DObject" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/dobject/.+")
source_group("Code\\Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/menu/.+")
source_group("Utility\\Audiolib" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/audiolib/.+")
source_group("Utility\\Audiolib Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/audiolib/include/.+")
source_group("Utility\\Audiolib Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/audiolib/src/.+")

View file

@ -39,7 +39,7 @@ typedef struct
extern AdLibTimbre ADLIB_TimbreBank[256];
opl3_chip *AL_GetChip(void);
void AL_RegisterTimbreBank(uint8_t *timbres);
void AL_RegisterTimbreBank(uint8_t const *timbres);
void AL_SetStereo(int const stereo);
#endif

View file

@ -0,0 +1,144 @@
/*
* Copyright by Hannu Savolainen 1993-1996
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. 2.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// heavily modified for audiolib
// original definitions found at http://www.cs.albany.edu/~sdc/Linux/linux-2.0/drivers/sound/opl3.h
// it's from old Linux source but the license is pretty clearly 2-clause BSD.
#ifndef opl3_reg_h__
#define OPL3_opl3_reg_h__
#define OPL3_TEST_REGISTER 0x01
#define OPL3_ENABLE_WAVE_SELECT 0x20
#define OPL3_TIMER1_REGISTER 0x02
#define OPL3_TIMER2_REGISTER 0x03
#define OPL3_TIMER_CONTROL_REGISTER 0x04 /* Left side */
#define OPL3_IRQ_RESET 0x80
#define OPL3_TIMER1_MASK 0x40
#define OPL3_TIMER2_MASK 0x20
#define OPL3_TIMER1_START 0x01
#define OPL3_TIMER2_START 0x02
#define OPL3_CONNECTION_SELECT_REGISTER 0x04 /* Right side */
#define OPL3_RIGHT_4OP_0 0x01
#define OPL3_RIGHT_4OP_1 0x02
#define OPL3_RIGHT_4OP_2 0x04
#define OPL3_LEFT_4OP_0 0x08
#define OPL3_LEFT_4OP_1 0x10
#define OPL3_LEFT_4OP_2 0x20
#define OPL3_MODE_REGISTER 0x05 /* Right side */
#define OPL3_ENABLE 0x01
#define OPL3_OPL4_ENABLE 0x02
#define OPL3_KBD_SPLIT_REGISTER 0x08 /* Left side */
#define OPL3_COMPOSITE_SINE_WAVE_MODE 0x80 /* Don't use with OPL-3? */
#define OPL3_KEYBOARD_SPLIT 0x40
#define OPL3_PERCUSSION_REGISTER 0xbd /* Left side only */
#define OPL3_TREMOLO_DEPTH 0x80
#define OPL3_VIBRATO_DEPTH 0x40
#define OPL3_PERCUSSION_ENABLE 0x20
#define OPL3_BASSDRUM_ON 0x10
#define OPL3_SNAREDRUM_ON 0x08
#define OPL3_TOMTOM_ON 0x04
#define OPL3_CYMBAL_ON 0x02
#define OPL3_HIHAT_ON 0x01
/*
* Offsets to the register banks for operators. To get the
* register number just add the operator offset to the bank offset
*
* AM/VIB/EG/KSR/Multiple (0x20 to 0x35)
*/
#define OPL3_AM_VIB 0x20
#define OPL3_TREMOLO_ON 0x80
#define OPL3_VIBRATO_ON 0x40
#define OPL3_SUSTAIN_ON 0x20
#define OPL3_KSR 0x10 /* Key scaling rate */
#define OPL3_MULTIPLE_MASK 0x0f /* Frequency multiplier */
/*
* KSL/Total level (0x40 to 0x55)
*/
#define OPL3_KSL_LEVEL 0x40
#define OPL3_KSL_MASK 0xc0 /* Envelope scaling bits */
#define OPL3_TOTAL_LEVEL_MASK 0x3f /* Strength (volume) of OP */
/*
* Attack / Decay rate (0x60 to 0x75)
*/
#define OPL3_ATTACK_DECAY 0x60
#define OPL3_ATTACK_MASK 0xf0
#define OPL3_DECAY_MASK 0x0f
/*
* Sustain level / Release rate (0x80 to 0x95)
*/
#define OPL3_SUSTAIN_RELEASE 0x80
#define OPL3_SUSTAIN_MASK 0xf0
#define OPL3_RELEASE_MASK 0x0f
/*
* Wave select (0xE0 to 0xF5)
*/
#define OPL3_WAVE_SELECT 0xe0
/*
* Offsets to the register banks for voices. Just add to the
* voice number to get the register number.
*
* F-Number low bits (0xA0 to 0xA8).
*/
#define OPL3_FNUM_LOW 0xa0
/*
* F-number high bits / Key on / Block (octave) (0xB0 to 0xB8)
*/
#define OPL3_KEYON_BLOCK 0xb0
#define OPL3_KEYON_BIT 0x20
#define OPL3_BLOCKNUM_MASK 0x1c
#define OPL3_FNUM_HIGH_MASK 0x03
/*
* Feedback / Connection (0xc0 to 0xc8)
*
* These registers have two new bits when the OPL-3 mode
* is selected. These bits controls connecting the voice
* to the stereo channels. For 4 OP voices this bit is
* defined in the second half of the voice (add 3 to the
* register offset).
*
* For 4 OP voices the connection bit is used in the
* both halfs (gives 4 ways to connect the operators).
*/
#define OPL3_FEEDBACK_CONNECTION 0xc0
#define OPL3_FEEDBACK_MASK 0x0e /* Valid just for 1st OP of a voice */
#define OPL3_CONNECTION_BIT 0x01
#define OPL3_STEREO_BITS 0x30 /* OPL-3 only */
#define OPL3_VOICE_TO_LEFT 0x10
#define OPL3_VOICE_TO_RIGHT 0x20
#endif // opl3_reg_h__

View file

@ -33,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef enum
{
ASS_NoSound,
ASS_SDL,
ASS_DirectSound,
ASS_OPL3,

View file

@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "midi.h"
#include "midifuncs.h"
#include "opl3.h"
#include "opl3_reg.h"
#include "c_cvars.h"
CUSTOM_CVARD(Bool, mus_al_stereo, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable OPL3 stereo mode")
@ -127,7 +128,7 @@ static opl3_chip chip;
opl3_chip *AL_GetChip(void) { return &chip; }
static constexpr uint32_t OctavePitch[MAX_OCTAVE+1] = {
static uint32_t constexpr OctavePitch[MAX_OCTAVE+1] = {
OCTAVE_0, OCTAVE_1, OCTAVE_2, OCTAVE_3, OCTAVE_4, OCTAVE_5, OCTAVE_6, OCTAVE_7,
};
@ -141,7 +142,7 @@ static uint32_t NoteDiv12[MAX_NOTE+1];
// { C, C_SHARP, D, D_SHARP, E, F, F_SHARP, G, G_SHARP, A, A_SHARP, B },
// };
static constexpr uint32_t NotePitch[FINETUNE_MAX+1][12] = {
static uint32_t constexpr NotePitch[FINETUNE_MAX+1][12] = {
{ 0x157, 0x16b, 0x181, 0x198, 0x1b0, 0x1ca, 0x1e5, 0x202, 0x220, 0x241, 0x263, 0x287 },
{ 0x157, 0x16b, 0x181, 0x198, 0x1b0, 0x1ca, 0x1e5, 0x202, 0x220, 0x242, 0x264, 0x288 },
{ 0x158, 0x16c, 0x182, 0x199, 0x1b1, 0x1cb, 0x1e6, 0x203, 0x221, 0x243, 0x265, 0x289 },
@ -179,7 +180,7 @@ static constexpr uint32_t NotePitch[FINETUNE_MAX+1][12] = {
// Slot numbers as a function of the voice and the operator.
// ( melodic only)
static constexpr int slotVoice[NUMADLIBVOICES][2] = {
static int constexpr slotVoice[NUMADLIBVOICES][2] = {
{ 0, 3 }, // voice 0
{ 1, 4 }, // 1
{ 2, 5 }, // 2
@ -197,7 +198,7 @@ static int VoiceKsl[AL_NumChipSlots][2];
// This table gives the offset of each slot within the chip.
// offset = fn( slot)
static constexpr int8_t offsetSlot[AL_NumChipSlots] = { 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 };
static int8_t constexpr offsetSlot[AL_NumChipSlots] = { 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 };
static int VoiceReserved[NUMADLIBVOICES * 2];
@ -206,10 +207,14 @@ static AdLibVoiceList Voice_Pool;
static AdLibChannel Channel[NUMADLIBCHANNELS];
static int AL_LeftPort = ADLIB_PORT;
static int AL_RightPort = ADLIB_PORT;
static int constexpr AL_LeftPort = ADLIB_PORT;
static int constexpr AL_RightPort = ADLIB_PORT + 2;
static int constexpr AL_MaxMidiChannel = ARRAY_SIZE(Channel);
int AL_Stereo = TRUE;
static int AL_MaxMidiChannel = 16;
int AL_PostAmp = 3;
// TODO: clean up this shit...
#define OFFSET(structure, offset) (*((char **)&(structure)[offset]))
@ -260,8 +265,7 @@ static void AL_SendOutputToPort(int const port, int const reg, int const data)
static void AL_SendOutput(int const voice, int const reg, int const data)
{
int port = (voice == 0) ? AL_RightPort : AL_LeftPort;
AL_SendOutputToPort(port, reg, data);
AL_SendOutputToPort(voice ? AL_LeftPort : AL_RightPort, reg, data);
}
@ -282,39 +286,39 @@ static void AL_SetVoiceTimbre(int const voice)
int slot = slotVoice[voc][0];
int off = offsetSlot[slot];
VoiceLevel[slot][port] = 63 - (timbre->Level[0] & 0x3f);
VoiceKsl[slot][port] = timbre->Level[0] & 0xc0;
VoiceLevel[slot][port] = OPL3_TOTAL_LEVEL_MASK - (timbre->Level[0] & OPL3_TOTAL_LEVEL_MASK);
VoiceKsl[slot][port] = timbre->Level[0] & OPL3_KSL_MASK;
AL_SendOutput(port, 0xA0 + voc, 0);
AL_SendOutput(port, 0xB0 + voc, 0);
AL_SendOutput(port, OPL3_FNUM_LOW + voc, 0);
AL_SendOutput(port, OPL3_KEYON_BLOCK + voc, 0);
// Let voice clear the release
AL_SendOutput(port, 0x80 + off, 0xff);
AL_SendOutput(port, OPL3_SUSTAIN_RELEASE + off, 0xff);
AL_SendOutput(port, 0x60 + off, timbre->Env1[0]);
AL_SendOutput(port, 0x80 + off, timbre->Env2[0]);
AL_SendOutput(port, 0x20 + off, timbre->SAVEK[0]);
AL_SendOutput(port, 0xE0 + off, timbre->Wave[0]);
AL_SendOutput(port, OPL3_ATTACK_DECAY + off, timbre->Env1[0]);
AL_SendOutput(port, OPL3_SUSTAIN_RELEASE + off, timbre->Env2[0]);
AL_SendOutput(port, OPL3_ENABLE_WAVE_SELECT + off, timbre->SAVEK[0]);
AL_SendOutput(port, OPL3_WAVE_SELECT + off, timbre->Wave[0]);
AL_SendOutput(port, 0x40 + off, timbre->Level[0]);
AL_SendOutput(port, OPL3_KSL_LEVEL + off, timbre->Level[0]);
slot = slotVoice[voc][1];
AL_SendOutput(port, 0xC0 + voc, (timbre->Feedback & 0x0f) | 0x30);
AL_SendOutput(port, OPL3_FEEDBACK_CONNECTION + voc, (timbre->Feedback & OPL3_FEEDBACK_MASK) | OPL3_STEREO_BITS);
off = offsetSlot[slot];
VoiceLevel[slot][port] = 63 - (timbre->Level[1] & 0x3f);
VoiceKsl[slot][port] = timbre->Level[1] & 0xc0;
VoiceLevel[slot][port] = OPL3_TOTAL_LEVEL_MASK - (timbre->Level[1] & OPL3_TOTAL_LEVEL_MASK);
VoiceKsl[slot][port] = timbre->Level[1] & OPL3_KSL_MASK;
AL_SendOutput(port, 0x40 + off, 63);
AL_SendOutput(port, OPL3_KSL_LEVEL + off, OPL3_TOTAL_LEVEL_MASK);
// Let voice clear the release
AL_SendOutput(port, 0x80 + off, 0xff);
AL_SendOutput(port, OPL3_SUSTAIN_RELEASE + off, 0xff);
AL_SendOutput(port, 0x60 + off, timbre->Env1[1]);
AL_SendOutput(port, 0x80 + off, timbre->Env2[1]);
AL_SendOutput(port, 0x20 + off, timbre->SAVEK[1]);
AL_SendOutput(port, 0xE0 + off, timbre->Wave[1]);
AL_SendOutput(port, OPL3_ATTACK_DECAY + off, timbre->Env1[1]);
AL_SendOutput(port, OPL3_SUSTAIN_RELEASE + off, timbre->Env2[1]);
AL_SendOutput(port, OPL3_ENABLE_WAVE_SELECT + off, timbre->SAVEK[1]);
AL_SendOutput(port, OPL3_WAVE_SELECT + off, timbre->Wave[1]);
}
@ -332,10 +336,10 @@ static void AL_SetVoiceVolume(int const voice)
auto t1 = (uint32_t)VoiceLevel[slot][port] * (velocity + 0x80);
t1 = (Channel[channel].Volume * t1) >> 15;
uint32_t volume = t1 ^ 63;
uint32_t volume = t1 ^ OPL3_TOTAL_LEVEL_MASK;
volume |= (uint32_t)VoiceKsl[slot][port];
AL_SendOutput(port, 0x40 + offsetSlot[slot], volume);
AL_SendOutput(port, OPL3_KSL_LEVEL + offsetSlot[slot], volume);
// Check if this timbre is Additive
if (timbre->Feedback & 0x01)
@ -349,24 +353,22 @@ static void AL_SetVoiceVolume(int const voice)
t2 = (Channel[channel].Volume * t1) >> 15;
volume = t2 ^ 63;
volume = t2 ^ OPL3_TOTAL_LEVEL_MASK;
volume |= (uint32_t)VoiceKsl[slot][port];
AL_SendOutput(port, 0x40 + offsetSlot[slot], volume);
AL_SendOutput(port, OPL3_KSL_LEVEL + offsetSlot[slot], volume);
}
}
static int AL_AllocVoice(void)
{
if (Voice_Pool.start)
{
if (!Voice_Pool.start)
return AL_VoiceNotFound;
int const voice = Voice_Pool.start->num;
LL_Remove(AdLibVoice, &Voice_Pool, &Voice[voice]);
return voice;
}
return AL_VoiceNotFound;
}
@ -418,8 +420,8 @@ static void AL_SetVoicePitch(int const voice)
pitch |= Voice[voice].status;
AL_SendOutput(port, 0xA0 + voc, pitch);
AL_SendOutput(port, 0xB0 + voc, pitch >> 8);
AL_SendOutput(port, OPL3_FNUM_LOW + voc, pitch);
AL_SendOutput(port, OPL3_KEYON_BLOCK + voc, pitch >> 8);
}
static void AL_SetVoicePan(int const voice)
@ -531,32 +533,32 @@ static void AL_FlushCard(int const port)
auto slot1 = offsetSlot[slotVoice[i][0]];
auto slot2 = offsetSlot[slotVoice[i][1]];
AL_SendOutputToPort(port, 0xA0 + i, 0);
AL_SendOutputToPort(port, 0xB0 + i, 0);
AL_SendOutputToPort(port, OPL3_FNUM_LOW + i, 0);
AL_SendOutputToPort(port, OPL3_KEYON_BLOCK + i, 0);
AL_SendOutputToPort(port, 0xE0 + slot1, 0);
AL_SendOutputToPort(port, 0xE0 + slot2, 0);
AL_SendOutputToPort(port, OPL3_WAVE_SELECT + slot1, 0);
AL_SendOutputToPort(port, OPL3_WAVE_SELECT + slot2, 0);
// Set the envelope to be fast and quiet
AL_SendOutputToPort(port, 0x60 + slot1, 0xff);
AL_SendOutputToPort(port, 0x60 + slot2, 0xff);
AL_SendOutputToPort(port, 0x80 + slot1, 0xff);
AL_SendOutputToPort(port, 0x80 + slot2, 0xff);
AL_SendOutputToPort(port, OPL3_ATTACK_DECAY + slot1, 0xff);
AL_SendOutputToPort(port, OPL3_ATTACK_DECAY + slot2, 0xff);
AL_SendOutputToPort(port, OPL3_SUSTAIN_RELEASE + slot1, 0xff);
AL_SendOutputToPort(port, OPL3_SUSTAIN_RELEASE + slot2, 0xff);
// Maximum attenuation
AL_SendOutputToPort(port, 0x40 + slot1, 0xff);
AL_SendOutputToPort(port, 0x40 + slot2, 0xff);
AL_SendOutputToPort(port, OPL3_KSL_LEVEL + slot1, 0xff);
AL_SendOutputToPort(port, OPL3_KSL_LEVEL + slot2, 0xff);
}
}
static void AL_Reset(void)
{
AL_SendOutputToPort(ADLIB_PORT, 1, 0x20);
AL_SendOutputToPort(ADLIB_PORT, 0x08, 0);
AL_SendOutputToPort(ADLIB_PORT, 1, OPL3_ENABLE_WAVE_SELECT);
AL_SendOutputToPort(ADLIB_PORT, OPL3_KBD_SPLIT_REGISTER, 0);
// Set the values: AM Depth, VIB depth & Rhythm
AL_SendOutputToPort(ADLIB_PORT, 0xBD, 0);
AL_SendOutputToPort(ADLIB_PORT, OPL3_PERCUSSION_REGISTER, 0);
AL_SetStereo(AL_Stereo);
@ -565,10 +567,7 @@ static void AL_Reset(void)
}
void AL_SetStereo(int const stereo)
{
AL_SendOutputToPort(AL_RightPort, 0x5, (stereo<<1)+1);
}
void AL_SetStereo(int const stereo) { AL_SendOutputToPort(AL_RightPort, OPL3_MODE_REGISTER, (stereo << 1) + 1); }
static void AL_NoteOff(int const channel, int const key, int velocity)
@ -579,17 +578,17 @@ static void AL_NoteOff(int const channel, int const key, int velocity)
if (channel > AL_MaxMidiChannel)
return;
int voice = AL_GetVoice(channel, key);
int const voice = AL_GetVoice(channel, key);
if (voice == AL_VoiceNotFound)
return;
Voice[voice].status = NOTE_OFF;
int port = Voice[voice].port;
int voc = (voice >= NUMADLIBVOICES) ? voice - NUMADLIBVOICES : voice;
int const port = Voice[voice].port;
int const voc = (voice >= NUMADLIBVOICES) ? voice - NUMADLIBVOICES : voice;
AL_SendOutput(port, 0xB0 + voc, hibyte(Voice[voice].pitchleft));
AL_SendOutput(port, OPL3_KEYON_BLOCK + voc, hibyte(Voice[voice].pitchleft));
LL_Remove(AdLibVoice, &Channel[channel].Voices, &Voice[voice]);
LL_AddToTail(AdLibVoice, &Voice_Pool, &Voice[voice]);
@ -720,12 +719,9 @@ static void AL_SetPitchBend(int const channel, int const lsb, int const msb)
return;
int const pitchbend = lsb + (msb << 8);
int const TotalBend = pitchbend * Channel[channel].PitchBendRange / (PITCHBEND_CENTER / FINETUNE_RANGE);
Channel[channel].Pitchbend = pitchbend;
int TotalBend = pitchbend * Channel[channel].PitchBendRange;
TotalBend /= (PITCHBEND_CENTER / FINETUNE_RANGE);
Channel[channel].KeyOffset = (int)(TotalBend / FINETUNE_RANGE);
Channel[channel].KeyOffset -= Channel[channel].PitchBendSemiTones;
@ -751,9 +747,6 @@ static int AL_Init(int const rate)
{
OPL3_Reset(&chip, rate);
AL_LeftPort = ADLIB_PORT;
AL_RightPort = ADLIB_PORT + 2;
AL_CalcPitchInfo();
AL_Reset();
AL_ResetVoices();
@ -762,7 +755,7 @@ static int AL_Init(int const rate)
}
void AL_RegisterTimbreBank(uint8_t *timbres)
void AL_RegisterTimbreBank(uint8_t const *timbres)
{
for (int i = 0; i < 256; i++)
{

View file

@ -23,6 +23,7 @@
#include "opl3.h"
extern int AL_Stereo;
extern int AL_PostAmp;
int AdLibDrv_GetError(void);
const char *AdLibDrv_ErrorString(int ErrorNumber);

View file

@ -1,83 +0,0 @@
/*
Copyright (C) 2009 Jonathon Fowler <jf@jonof.id.au>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* Stub driver for no output
*/
#include "compat.h"
#include "midifuncs.h"
int NoSoundDrv_GetError(void) { return 0; }
const char *NoSoundDrv_ErrorString(int ErrorNumber)
{
UNREFERENCED_PARAMETER(ErrorNumber);
return "No sound, Ok.";
}
int NoSoundDrv_PCM_Init(int *mixrate, int *numchannels, void *initdata)
{
UNREFERENCED_PARAMETER(mixrate);
UNREFERENCED_PARAMETER(numchannels);
UNREFERENCED_PARAMETER(initdata);
return 0;
}
void NoSoundDrv_PCM_Shutdown(void) {}
int NoSoundDrv_PCM_BeginPlayback(char *BufferStart, int BufferSize, int NumDivisions, void (*CallBackFunc)(void))
{
UNREFERENCED_PARAMETER(BufferStart);
UNREFERENCED_PARAMETER(BufferSize);
UNREFERENCED_PARAMETER(NumDivisions);
UNREFERENCED_PARAMETER(CallBackFunc);
return 0;
}
void NoSoundDrv_PCM_StopPlayback(void) {}
void NoSoundDrv_PCM_Lock(void) {}
void NoSoundDrv_PCM_Unlock(void) {}
int NoSoundDrv_MIDI_Init(midifuncs *funcs)
{
Bmemset(funcs, 0, sizeof(midifuncs));
return 0;
}
void NoSoundDrv_MIDI_Shutdown(void) {}
int NoSoundDrv_MIDI_StartPlayback(void (*service)(void))
{
UNREFERENCED_PARAMETER(service);
return 0;
}
void NoSoundDrv_MIDI_HaltPlayback(void) {}
uint32_t NoSoundDrv_MIDI_GetTick(void) { return 0; }
void NoSoundDrv_MIDI_SetTempo(int tempo, int division)
{
UNREFERENCED_PARAMETER(tempo);
UNREFERENCED_PARAMETER(division);
}
void NoSoundDrv_MIDI_Lock(void) {}
void NoSoundDrv_MIDI_Unlock(void) {}

View file

@ -1,43 +0,0 @@
/*
Copyright (C) 2009 Jonathon Fowler <jf@jonof.id.au>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "midifuncs.h"
#include <inttypes.h>
int NoSoundDrv_GetError(void);
const char *NoSoundDrv_ErrorString( int ErrorNumber );
int NoSoundDrv_PCM_Init(int * mixrate, int * numchannels, void * initdata);
void NoSoundDrv_PCM_Shutdown(void);
int NoSoundDrv_PCM_BeginPlayback(char *BufferStart, int BufferSize,
int NumDivisions, void ( *CallBackFunc )( void ) );
void NoSoundDrv_PCM_StopPlayback(void);
void NoSoundDrv_PCM_Lock(void);
void NoSoundDrv_PCM_Unlock(void);
int NoSoundDrv_MIDI_Init(midifuncs *);
void NoSoundDrv_MIDI_Shutdown(void);
int NoSoundDrv_MIDI_StartPlayback(void (*service)(void));
void NoSoundDrv_MIDI_HaltPlayback(void);
uint32_t NoSoundDrv_MIDI_GetTick(void);
void NoSoundDrv_MIDI_SetTempo(int tempo, int division);
void NoSoundDrv_MIDI_Lock(void);
void NoSoundDrv_MIDI_Unlock(void);

View file

@ -25,7 +25,6 @@
#include "drivers.h"
#include "driver_nosound.h"
#include "driver_adlib.h"
#ifdef RENDERTYPESDL
@ -67,26 +66,7 @@ static struct {
void (*MIDI_Unlock)(void);
} SoundDrivers[ASS_NumSoundCards] = {
// Everyone gets the "no sound" driver
{
"null sound device",
NoSoundDrv_GetError,
NoSoundDrv_ErrorString,
NoSoundDrv_PCM_Init,
NoSoundDrv_PCM_Shutdown,
NoSoundDrv_PCM_BeginPlayback,
NoSoundDrv_PCM_StopPlayback,
NoSoundDrv_PCM_Lock,
NoSoundDrv_PCM_Unlock,
NoSoundDrv_MIDI_Init,
NoSoundDrv_MIDI_Shutdown,
NoSoundDrv_MIDI_StartPlayback,
NoSoundDrv_MIDI_HaltPlayback,
NoSoundDrv_MIDI_SetTempo,
NoSoundDrv_MIDI_Lock,
NoSoundDrv_MIDI_Unlock,
},
// Simple DirectMedia Layer
{
"SDL",

View file

@ -62,8 +62,6 @@ int FX_Init(int numvoices, int numchannels, int mixrate, void *initdata)
SoundCard = ASS_SDL;
#elif defined RENDERTYPEWIN
SoundCard = ASS_DirectSound;
#else
SoundCard = ASS_NoSound;
#endif
}
@ -76,8 +74,8 @@ int FX_Init(int numvoices, int numchannels, int mixrate, void *initdata)
if (SoundDriver_IsPCMSupported(SoundCard) == 0)
{
// unsupported cards fall back to no sound
MV_Printf("Couldn't init %s, falling back to no sound...\n", SoundDriver_GetName(SoundCard));
SoundCard = ASS_NoSound;
FX_SetErrorCode(FX_InvalidCard);
return FX_Error;
}
int status = FX_Ok;

View file

@ -538,8 +538,8 @@ static void _MIDI_ServiceMultivoc(void)
}
if (MV_MIDIRenderTempo >= 0) MV_MIDIRenderTimer += MV_MIDIRenderTempo;
OPL3_GenerateResampled(AL_GetChip(), buf);
*buffer16++ = clamp(buf[0]<<3, INT16_MIN, INT16_MAX);
*buffer16++ = clamp(buf[1]<<3, INT16_MIN, INT16_MAX);
*buffer16++ = clamp(buf[0]<<AL_PostAmp, INT16_MIN, INT16_MAX);
*buffer16++ = clamp(buf[1]<<AL_PostAmp, INT16_MIN, INT16_MAX);
}
}

View file

@ -102,6 +102,7 @@ set( PCH_SOURCES
src/view.cpp
src/warp.cpp
src/weapon.cpp
src/d_menu.cpp
)

View file

@ -1707,7 +1707,7 @@ MissileType missileInfo[] = {
}
};
THINGINFO thingInfo[] = {
const THINGINFO thingInfo[] = {
//TNT Barrel
{
25,
@ -3868,7 +3868,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
sectortype *pSectorHit = NULL; XSECTOR *pXSectorHit = NULL;
actHitcodeToData(hitCode, &gHitInfo, &nSpriteHit, &pSpriteHit, &pXSpriteHit, &nWallHit, &pWallHit, &pXWallHit, &nSectorHit, &pSectorHit, &pXSectorHit);
THINGINFO *pThingInfo = NULL; DUDEINFO *pDudeInfo = NULL;
const THINGINFO *pThingInfo = NULL; DUDEINFO *pDudeInfo = NULL;
if (hitCode == 3 && pSpriteHit) {
switch (pSpriteHit->statnum) {
@ -4211,7 +4211,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite)
if (pSprite2->statnum == kStatThing)
{
int nType = pSprite2->type-kThingBase;
THINGINFO *pThingInfo = &thingInfo[nType];
const THINGINFO *pThingInfo = &thingInfo[nType];
if (pThingInfo->flags&1)
pSprite2->flags |= 1;
@ -4546,7 +4546,7 @@ int MoveThing(spritetype *pSprite)
int nSprite = pSprite->index;
int v8 = 0;
dassert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase];
const THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase];
int nSector = pSprite->sectnum;
dassert(nSector >= 0 && nSector < kMaxSectors);
int top, bottom;
@ -5829,7 +5829,7 @@ void actProcessSprites(void)
if (pXSector && pXSector->panVel && (pXSector->panAlways || pXSector->state || pXSector->busy))
{
int nType = pSprite->type - kThingBase;
THINGINFO *pThingInfo = &thingInfo[nType];
const THINGINFO *pThingInfo = &thingInfo[nType];
if (pThingInfo->flags & 1)
pSprite->flags |= 1;
@ -6546,7 +6546,7 @@ spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
pSprite->type = nThingType;
dassert(nXThing > 0 && nXThing < kMaxXSprites);
XSPRITE *pXThing = &xsprite[nXThing];
THINGINFO *pThingInfo = &thingInfo[nType];
const THINGINFO *pThingInfo = &thingInfo[nType];
pXThing->health = pThingInfo->startHealth<<4;
pSprite->clipdist = pThingInfo->clipdist;
pSprite->flags = pThingInfo->flags;

View file

@ -186,7 +186,7 @@ extern WEAPONITEMDATA gWeaponItemData[];
extern ITEMDATA gItemData[];
extern MissileType missileInfo[];
extern EXPLOSION explodeInfo[];
extern THINGINFO thingInfo[];
extern const THINGINFO thingInfo[];
extern VECTORDATA gVectorData[];
extern int gDudeDrag;

View file

@ -284,7 +284,7 @@ static void ThrowThing(int nXIndex, bool impact) {
if (curWeapon < kThingBase || curWeapon >= kThingMax)
return;
THINGINFO* pThinkInfo = &thingInfo[curWeapon - kThingBase];
const THINGINFO* pThinkInfo = &thingInfo[curWeapon - kThingBase];
if (!pThinkInfo->allowThrow) return;
if (!playGenDudeSound(pSprite, kGenDudeSndAttackThrow))

View file

@ -166,7 +166,7 @@ int RFS::Open(const char *fileName)
{
strcpy(_fileName, fileName);
auto hFile = kopenFileReader(fileName, 0);
auto hFile = fileSystem.OpenFileReader(fileName, 0);
if (!hFile.isOpen()) {
initprintf("BARF: Error opening file %s", _fileName);
return 1;

View file

@ -48,7 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "menu.h"
#include "gamemenu.h"
#include "mirrors.h"
#include "music.h"
#include "network.h"
@ -71,6 +71,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "gamecontrol.h"
#include "m_argv.h"
#include "statistics.h"
#include "menu/menu.h"
#ifdef _WIN32
# include <shellapi.h>
@ -97,8 +98,6 @@ char bAddUserMap = false;
bool bNoDemo = false;
bool bQuickStart = true;
int gMusicPrevLoadedEpisode = -1;
int gMusicPrevLoadedLevel = -1;
char gUserMapFilename[BMAX_PATH];
@ -376,7 +375,7 @@ static void PrecacheSounds(void)
if (pNode->ResType() == NAME_RAW || pNode->ResType() == NAME_SFX)
{
pNode->Get();
if ((i&15) == 15) gameHandleEvents(); // don't do this too often. That made sense in 1996 but not in 2019
//if ((i&15) == 15) gameHandleEvents(); // don't do this too often. That made sense in 1996 but not in 2019
}
}
}
@ -387,8 +386,6 @@ void PreloadCache(void)
if (gDemo.at1)
return;
PrecacheSounds();
if (mus_restartonload)
sndTryPlaySpecialMusic(MUS_LOADING);
PreloadTiles();
ClockTicks clock = totalclock;
int cnt = 0;
@ -485,8 +482,6 @@ void StartLevel(GAMEOPTIONS *gameOptions)
EndLevel();
gStartNewGame = 0;
ready2send = 0;
gMusicPrevLoadedEpisode = gGameOptions.nEpisode;
gMusicPrevLoadedLevel = gGameOptions.nLevel;
if (gDemo.at0 && gGameStarted)
gDemo.Close();
netWaitForEveryone(0);
@ -547,6 +542,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
return;
}
char levelName[BMAX_PATH];
currentLevel = &mapList[gGameOptions.nEpisode * kMaxLevels + gGameOptions.nLevel];
STAT_NewLevel(gameOptions->zLevelName);
G_LoadMapHack(levelName, gameOptions->zLevelName);
wsrand(gameOptions->uMapCRC);
@ -719,8 +715,8 @@ void StartLevel(GAMEOPTIONS *gameOptions)
gCacheMiss = 0;
gFrame = 0;
gChokeCounter = 0;
if (!gDemo.at1)
gGameMenuMgr.Deactivate();
if (!gDemo.at1)
M_ClearMenus();
levelTryPlayMusicOrNothing(gGameOptions.nEpisode, gGameOptions.nLevel);
// viewSetMessage("");
viewSetErrorMessage("");
@ -768,38 +764,6 @@ void StartNetworkLevel(void)
int gDoQuickSave = 0;
static void DoQuickLoad(void)
{
if (!gGameMenuMgr.m_bActive)
{
if (gQuickLoadSlot != -1)
{
QuickLoadGame();
return;
}
if (gQuickLoadSlot == -1 && gQuickSaveSlot != -1)
{
gQuickLoadSlot = gQuickSaveSlot;
QuickLoadGame();
return;
}
gGameMenuMgr.Push(&menuLoadGame,-1);
}
}
static void DoQuickSave(void)
{
if (gGameStarted && !gGameMenuMgr.m_bActive && gPlayer[myconnectindex].pXSprite->health != 0)
{
if (gQuickSaveSlot != -1)
{
QuickSaveGame();
return;
}
gGameMenuMgr.Push(&menuSaveGame,-1);
}
}
void LocalKeys(void)
{
bool alt = inputState.AltPressed();
@ -837,21 +801,6 @@ void LocalKeys(void)
gView = &gPlayer[gViewIndex];
}
}
if (gDoQuickSave)
{
inputState.keyFlushScans();
switch (gDoQuickSave)
{
case 1:
DoQuickSave();
break;
case 2:
DoQuickLoad();
break;
}
gDoQuickSave = 0;
return;
}
char key;
if ((key = inputState.keyGetScan()) != 0)
{
@ -872,78 +821,21 @@ void LocalKeys(void)
buttonMap.ClearButton(gamefunc_See_Chase_View);
return;
}
#if 0
switch (key)
{
case sc_kpad_Period:
case sc_Delete:
if (ctrl && alt)
{
gQuitGame = 1;
gQuitGame = 1; // uh, what?
return;
}
break;
case sc_Escape:
inputState.keyFlushScans();
if (gGameStarted && gPlayer[myconnectindex].pXSprite->health != 0)
{
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuMainWithSave,-1);
}
else
{
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuMain,-1);
}
return;
case sc_F1:
inputState.keyFlushScans();
if (gGameOptions.nGameType == 0)
gGameMenuMgr.Push(&menuOrder,-1);
break;
case sc_F2:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive && gGameOptions.nGameType == 0)
gGameMenuMgr.Push(&menuSaveGame,-1);
break;
case sc_F3:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive && gGameOptions.nGameType == 0)
gGameMenuMgr.Push(&menuLoadGame,-1);
break;
case sc_F4:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuOptionsSound,-1);
return;
case sc_F5:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuOptions,-1);
return;
case sc_F6:
inputState.keyFlushScans();
DoQuickSave();
break;
case sc_F8:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuOptionsDisplayMode, -1);
return;
case sc_F9:
inputState.keyFlushScans();
DoQuickLoad();
break;
case sc_F10:
inputState.keyFlushScans();
if (!gGameMenuMgr.m_bActive)
gGameMenuMgr.Push(&menuQuit,-1);
break;
case sc_F11:
break;
case sc_F12:
videoCaptureScreen();
case default:
break;
}
#endif
}
}
@ -1007,7 +899,7 @@ void ProcessFrame(void)
viewClearInterpolations();
if (!gDemo.at1)
{
if (gPaused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && gGameMenuMgr.m_bActive))
if (gPaused || gEndGameMgr.at0 || (gGameOptions.nGameType == 0 && M_Active()))
return;
if (gDemo.at0)
gDemo.Write(gFifoInput[(gNetFifoTail-1)&255]);
@ -1056,7 +948,7 @@ void ProcessFrame(void)
}
if (gDemo.at0)
gDemo.Close();
sndFadeSong(4000);
Mus_Fade(4000);
seqKillAll();
if (gGameOptions.uGameFlags&2)
{
@ -1064,8 +956,9 @@ void ProcessFrame(void)
{
if (gGameOptions.uGameFlags&8)
levelPlayEndScene(gGameOptions.nEpisode);
gGameMenuMgr.Deactivate();
gGameMenuMgr.Push(&menuCredits,-1);
M_StartControlPanel(false);
M_SetMenu(NAME_CreditsMenu);
}
gGameOptions.uGameFlags &= ~3;
gRestartGame = 1;
@ -1313,7 +1206,6 @@ int GameInterface::app_main()
levelAddUserMap(gUserMapFilename);
gStartNewGame = 1;
}
SetupMenus();
videoSetViewableArea(0, 0, xdim - 1, ydim - 1);
if (!bQuickStart)
credLogosDos();
@ -1349,26 +1241,21 @@ RESTART:
else if (gDemo.at1 && !bAddUserMap && !bNoDemo)
gDemo.Playback();
if (gDemo.at59ef > 0)
gGameMenuMgr.Deactivate();
if (!bAddUserMap && !gGameStarted)
gGameMenuMgr.Push(&menuMain, -1);
M_ClearMenus();
if (!bAddUserMap && !gGameStarted)
{
M_StartControlPanel(false);
M_SetMenu(NAME_MainMenu);
}
ready2send = 1;
while (!gQuitGame)
{
if (handleevents() && quitevent)
{
inputState.SetKeyStatus(sc_Escape, 1);
quitevent = 0;
}
handleevents();
netUpdate();
MUSIC_Update();
inputState.SetBindsEnabled(gInputMode == kInputGame);
switch (gInputMode)
{
case kInputMenu:
if (gGameMenuMgr.m_bActive)
gGameMenuMgr.Process();
break;
case kInputGame:
LocalKeys();
break;
@ -1445,10 +1332,6 @@ RESTART:
{
switch (gInputMode)
{
case kInputMenu:
if (gGameMenuMgr.m_bActive)
gGameMenuMgr.Draw();
break;
case kInputMessage:
gPlayerMsg.ProcessKeys();
gPlayerMsg.Draw();
@ -1475,7 +1358,6 @@ RESTART:
//}
if (gStartNewGame)
{
STAT_StartNewGame(gEpisodeInfo[gGameOptions.nEpisode].at0, gGameOptions.nDifficulty);
StartLevel(&gGameOptions);
}
}
@ -1485,13 +1367,15 @@ RESTART:
if (gRestartGame)
{
UpdateDacs(0, true);
sndStopSong();
Mus_Stop();
FX_StopAllSounds();
gQuitGame = 0;
gQuitRequest = 0;
gRestartGame = 0;
gGameStarted = 0;
levelSetupOptions(0,0);
#if 0
// What's this loop for? Needs checking
while (gGameMenuMgr.m_bActive)
{
gGameMenuMgr.Process();
@ -1503,6 +1387,7 @@ RESTART:
videoNextPage();
}
}
#endif
if (gGameOptions.nGameType != 0)
{
if (!gDemo.at0 && gDemo.at59ef > 0 && gGameOptions.nGameType == 0 && !bNoDemo)
@ -1560,9 +1445,8 @@ static int32_t S_DefineMusic(const char *ID, const char *name)
return -1;
}
int nEpisode = sel/kMaxLevels;
int nLevel = sel%kMaxLevels;
return S_DefineAudioIfSupported(gEpisodeInfo[nEpisode].at28[nLevel].atd0, name);
quoteMgr.InitializeQuote(sel, name);
return 0;
}
static int parsedefinitions_game(scriptfile *, int);
@ -1800,7 +1684,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
break;
}
if (fileName == NULL || check_file_exist(fileName))
if (fileName == NULL || fileSystem.FileExists(fileName))
break;
if (S_DefineMusic(musicID, fileName) == -1)
@ -2052,7 +1936,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
break;
}
if (fileName == NULL || check_file_exist(fileName))
if (fileName == NULL || fileSystem.FileExists(fileName))
break;
// maybe I should have just packed this into a sound_t and passed a reference...
@ -2104,29 +1988,18 @@ bool fileExistsRFF(int id, const char *ext) {
int sndTryPlaySpecialMusic(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (sndPlaySong(gEpisodeInfo[nEpisode].at28[nLevel].at0, gEpisodeInfo[nEpisode].at28[nLevel].atd0, true))
if (Mus_Play(nullptr, quoteMgr.GetQuote(nMusic), true))
{
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
return 0;
}
else
{
// Unable to stat the music.
*gGameOptions.zLevelSong = 0;
}
return 1;
}
void sndPlaySpecialMusicOrNothing(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (sndTryPlaySpecialMusic(nMusic))
{
sndStopSong();
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
Mus_Stop();
}
}

View file

@ -46,7 +46,6 @@ extern INICHAIN *pINIChain;
enum INPUT_MODE {
kInputGame = 0,
kInputMenu,
kInputMessage,
kInputEndGame,
};
@ -60,8 +59,6 @@ extern bool gRestartGame;
extern double g_gameUpdateTime, g_gameUpdateAndDrawTime;
extern double g_gameUpdateAvgTime;
extern int blood_globalflags;
extern int gMusicPrevLoadedEpisode;
extern int gMusicPrevLoadedLevel;
extern int gSaveGameNum;
extern bool gPaused;
@ -90,8 +87,21 @@ struct GameInterface : ::GameInterface
bool validate_hud(int) override;
void set_hud_layout(int size) override;
void set_hud_scale(int size) override;
bool mouseInactiveConditional(bool condition) override;
FString statFPS() override;
FSavegameInfo GetSaveSig() override;
void MenuOpened() override;
void MenuClosed() override;
bool CanSave() override;
void StartGame(FGameStartup& gs) override;
void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override;
void DrawMenuCaption(const DVector2& origin, const char* text) override;
bool SaveGame(FSaveGameNode*) override;
bool LoadGame(FSaveGameNode*) override;
void DoPrintMessage(int prio, const char*) override;
void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg);
void QuitToTitle() override;
GameStats getStats() override;
};
END_BLD_NS

View file

@ -50,7 +50,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
int32_t mus_restartonload;
int32_t gTurnSpeed;
int32_t gDetail;
int32_t cl_weaponswitch;

View file

@ -121,60 +121,15 @@ void ctrlGetInput(void)
D_ProcessEvents();
if (in_aimmode)
g_MyAimMode = 0;
if (buttonMap.ButtonDown(gamefunc_Mouse_Aiming))
{
if (in_aimmode)
g_MyAimMode = 1;
else
{
buttonMap.ClearButton(gamefunc_Mouse_Aiming);
g_MyAimMode = !g_MyAimMode;
if (g_MyAimMode)
{
if (!bSilentAim)
viewSetMessage("Mouse aiming ON");
}
else
{
if (!bSilentAim)
viewSetMessage("Mouse aiming OFF");
gInput.keyFlags.lookCenter = 1;
}
}
}
else if (in_aimmode)
gInput.keyFlags.lookCenter = 1;
bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming);
if (!mouseaim) gInput.keyFlags.lookCenter = 1;
CONTROL_GetInput(&info);
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
if (gQuitRequest)
gInput.keyFlags.quit = 1;
if (gGameStarted && gInputMode != kInputMessage && gInputMode != kInputMenu
if (gGameStarted && gInputMode != kInputMessage
&& buttonMap.ButtonDown(gamefunc_SendMessage))
{
buttonMap.ClearButton(gamefunc_SendMessage);
@ -182,16 +137,6 @@ void ctrlGetInput(void)
gInputMode = kInputMessage;
}
if (buttonMap.ButtonDown(gamefunc_AutoRun))
{
buttonMap.ClearButton(gamefunc_AutoRun);
gAutoRun = !gAutoRun;
if (gAutoRun)
viewSetMessage("Auto run ON");
else
viewSetMessage("Auto run OFF");
}
if (buttonMap.ButtonDown(gamefunc_Map_Toggle))
{
buttonMap.ClearButton(gamefunc_Map_Toggle);
@ -415,13 +360,7 @@ void ctrlGetInput(void)
strafe = ClipRange(strafe-(info.dx<<5), -2048, 2048);
#if 0
if (info.dz < 0)
gInput.mlook = ClipRange((info.dz+127)>>7, -127, 127);
else
gInput.mlook = ClipRange(info.dz>>7, -127, 127);
#endif
if (g_MyAimMode)
if (mouseaim)
gInput.q16mlook = fix16_clamp(fix16_div(fix16_from_int(info.mousey), F16(128)), F16(-127)>>2, F16(127)>>2);
else
forward = ClipRange(forward - info.mousey, -2048, 2048);

View file

@ -140,7 +140,7 @@ void credLogosDos(void)
rotatesprite(160<<16, 100<<16, 65536, 0, 2518, 0, 0, 0x4a, 0, 0, xdim-1, ydim-1);
scrNextPage();
Wait(360);
sndFadeSong(4000);
Mus_Fade(4000);
}
void credReset(void)
@ -160,14 +160,14 @@ FileReader credKOpen4Load(char *&pzFile)
if (pzFile[i] == '\\')
pzFile[i] = '/';
}
auto nHandle = kopenFileReader(pzFile, 0);
auto nHandle = fileSystem.OpenFileReader(pzFile, 0);
if (!nHandle.isOpen())
{
// Hack
if (nLen >= 3 && isalpha(pzFile[0]) && pzFile[1] == ':' && pzFile[2] == '/')
{
pzFile += 3;
nHandle = kopenFileReader(pzFile, 0);
nHandle = fileSystem.OpenFileReader(pzFile, 0);
}
}
return nHandle;

330
source/blood/src/d_menu.cpp Normal file
View file

@ -0,0 +1,330 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 Nuke.YKT
This file is part of NBlood.
NBlood is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else!
#include "build.h"
#include "compat.h"
#include "mouse.h"
#include "common_game.h"
#include "blood.h"
#include "config.h"
#include "gamemenu.h"
#include "globals.h"
#include "inifile.h"
#include "levels.h"
#include "qav.h"
#include "resource.h"
#include "view.h"
#include "demo.h"
#include "network.h"
#include "mmulti.h"
#include "c_bind.h"
#include "menu/menu.h"
bool ShowOptionMenu();
BEGIN_BLD_NS
class CGameMenuItemQAV
{
public:
int m_nX, m_nY;
TArray<uint8_t> raw;
int at2c;
int lastTick;
bool bWideScreen;
bool bClearBackground;
CGameMenuItemQAV(int, int, const char*, bool widescreen = false, bool clearbackground = false);
void Draw(void);
};
CGameMenuItemQAV::CGameMenuItemQAV(int a3, int a4, const char* name, bool widescreen, bool clearbackground)
{
m_nY = a4;
m_nX = a3;
bWideScreen = widescreen;
bClearBackground = clearbackground;
if (name)
{
// NBlood read this directly from the file system cache, but let's better store the data locally for robustness.
raw = fileSystem.LoadFile(name, 0);
if (raw.Size() != 0)
{
auto data = (QAV*)raw.Data();
data->nSprite = -1;
data->x = m_nX;
data->y = m_nY;
data->Preload();
at2c = data->at10;
lastTick = (int)totalclock;
}
}
}
void CGameMenuItemQAV::Draw(void)
{
if (bClearBackground)
videoClearScreen(0);
if (raw.Size() > 0)
{
auto data = (QAV*)raw.Data();
ClockTicks backFC = gFrameClock;
gFrameClock = totalclock;
int nTicks = (int)totalclock - lastTick;
lastTick = (int)totalclock;
at2c -= nTicks;
if (at2c <= 0 || at2c > data->at10)
{
at2c = data->at10;
}
data->Play(data->at10 - at2c - nTicks, data->at10 - at2c, -1, NULL);
int wx1, wy1, wx2, wy2;
wx1 = windowxy1.x;
wy1 = windowxy1.y;
wx2 = windowxy2.x;
wy2 = windowxy2.y;
windowxy1.x = 0;
windowxy1.y = 0;
windowxy2.x = xdim - 1;
windowxy2.y = ydim - 1;
if (bWideScreen)
{
int xdim43 = scale(ydim, 4, 3);
int nCount = (xdim + xdim43 - 1) / xdim43;
int backX = data->x;
for (int i = 0; i < nCount; i++)
{
data->Draw(data->at10 - at2c, 10 + kQavOrientationLeft, 0, 0);
data->x += 320;
}
data->x = backX;
}
else
data->Draw(data->at10 - at2c, 10, 0, 0);
windowxy1.x = wx1;
windowxy1.y = wy1;
windowxy2.x = wx2;
windowxy2.y = wy2;
gFrameClock = backFC;
}
}
static std::unique_ptr<CGameMenuItemQAV> itemBloodQAV; // This must be global to ensure that the animation remains consistent across menus.
void UpdateNetworkMenus(void)
{
// For now disable the network menu item as it is not yet functional.
for (auto name : { NAME_MainMenu, NAME_IngameMenu })
{
FMenuDescriptor** desc = MenuDescriptors.CheckKey(name);
if (desc != NULL && (*desc)->mType == MDESC_ListMenu)
{
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*desc);
for (auto& li : ld->mItems)
{
if (li->GetAction(nullptr) == NAME_MultiMenu)
{
li->mEnabled = false;
}
}
}
}
}
//----------------------------------------------------------------------------
//
// Implements the native looking menu used for the main menu
// and the episode/skill selection screens, i.e. the parts
// that need to look authentic
//
//----------------------------------------------------------------------------
class BloodListMenu : public DListMenu
{
using Super = DListMenu;
protected:
void PostDraw()
{
itemBloodQAV->Draw();
}
};
//----------------------------------------------------------------------------
//
//
//
//----------------------------------------------------------------------------
class BloodImageScreen : public ImageScreen
{
CGameMenuItemQAV anim;
public:
BloodImageScreen(FImageScrollerDescriptor::ScrollerItem* desc)
: ImageScreen(desc), anim(169, 100, mDesc->text.GetChars(), false, true)
{
}
void Drawer() override
{
anim.Draw();
}
};
class DBloodImageScrollerMenu : public DImageScrollerMenu
{
ImageScreen* newImageScreen(FImageScrollerDescriptor::ScrollerItem* desc) override
{
if (desc->type >= 0) return DImageScrollerMenu::newImageScreen(desc);
return new BloodImageScreen(desc);
}
};
//----------------------------------------------------------------------------
//
// Menu related game interface functions
//
//----------------------------------------------------------------------------
void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags)
{
if (!text) return;
int shade = (state != NIT_InactiveState) ? 32 : 48;
int pal = (state != NIT_InactiveState) ? 5 : 5;
if (state == NIT_SelectedState) shade = 32 - ((int)totalclock & 63);
int width, height;
int gamefont = fontnum == NIT_BigFont ? 1 : fontnum == NIT_SmallFont ? 2 : 3;
int x = int(xpos);
int y = int(ypos);
viewGetFontInfo(gamefont, text, &width, &height);
if (flags & LMF_Centered)
{
x -= width / 2;
}
viewDrawText(gamefont, text, x, y, shade, pal, 0, true);
}
void GameInterface::MenuOpened()
{
itemBloodQAV.reset(new CGameMenuItemQAV(160, 100, "BDRIP.QAV", true));
}
void GameInterface::MenuClosed()
{
itemBloodQAV.reset();
}
bool GameInterface::CanSave()
{
return (gGameStarted && gPlayer[myconnectindex].pXSprite->health != 0);
}
void GameInterface::StartGame(FGameStartup& gs)
{
gGameOptions.nDifficulty = gs.Skill;
gGameOptions.nEpisode = gs.Episode;
gSkill = gs.Skill;
gGameOptions.nLevel = gs.Level;
if (gDemo.at1)
gDemo.StopPlayback();
gStartNewGame = true;
gCheatMgr.sub_5BCF4();
}
FSavegameInfo GameInterface::GetSaveSig()
{
return { SAVESIG_BLD, MINSAVEVER_BLD, SAVEVER_BLD };
}
void GameInterface::DrawMenuCaption(const DVector2& origin, const char* text)
{
int height;
// font #1, tile #2038.
viewGetFontInfo(1, NULL, NULL, &height);
rotatesprite(int(origin.X * 65536) + (320 << 15), 20 << 16, 65536, 0, 2038, -128, 0, 78, 0, 0, xdim - 1, ydim - 1);
viewDrawText(1, text, 160, 20 - height / 2, -128, 0, 1, false);
}
void GameInterface::DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg)
{
if (text)
{
int width, height = 0;
viewGetFontInfo(0, "T", &width, &height);
auto lines = FString(text).Split("\n");
int y = 100 - (height * lines.Size() / 2);
for (auto& l : lines)
{
int lheight = 0;
viewGetFontInfo(0, l, &width, &lheight);
int x = 160 - width / 2;
viewDrawText(0, l, x, y, 0, 0, 0, false);
y += height;
}
}
}
void GameInterface::QuitToTitle()
{
if (gGameOptions.nGameType == 0 || numplayers == 1)
{
gQuitGame = true;
gRestartGame = true;
}
else
gQuitRequest = 2;
}
END_BLD_NS
//----------------------------------------------------------------------------
//
// Class registration
//
//----------------------------------------------------------------------------
static TMenuClassDescriptor<Blood::BloodListMenu> _lm("Blood.ListMenu");
static TMenuClassDescriptor<Blood::DBloodImageScrollerMenu> _im("Blood.ImageScrollerMenu");
void RegisterBloodMenus()
{
menuClasses.Push(&_lm);
menuClasses.Push(&_im);
}

View file

@ -50,99 +50,6 @@ char qsprite_filler[kMaxSprites], qsector_filler[kMaxSectors];
int gVisibility;
bool gModernMap = false;
const char *gItemText[] = {
"Skull Key",
"Eye Key",
"Fire Key",
"Dagger Key",
"Spider Key",
"Moon Key",
"Key 7",
"Doctor's Bag",
"Medicine Pouch",
"Life Essence",
"Life Seed",
"Red Potion",
"Feather Fall",
"Limited Invisibility",
"INVULNERABILITY",
"Boots of Jumping",
"Raven Flight",
"Guns Akimbo",
"Diving Suit",
"Gas mask",
"Clone",
"Crystal Ball",
"Decoy",
"Doppleganger",
"Reflective shots",
"Beast Vision",
"ShadowCloak",
"Rage shroom",
"Delirium Shroom",
"Grow shroom",
"Shrink shroom",
"Death mask",
"Wine Goblet",
"Wine Bottle",
"Skull Grail",
"Silver Grail",
"Tome",
"Black Chest",
"Wooden Chest",
"Asbestos Armor",
"Basic Armor",
"Body Armor",
"Fire Armor",
"Spirit Armor",
"Super Armor",
"Blue Team Base",
"Red Team Base",
"Blue Flag",
"Red Flag",
"DUMMY",
"Level map",
};
const char *gAmmoText[] = {
"Spray can",
"Bundle of TNT*",
"Bundle of TNT",
"Case of TNT",
"Proximity Detonator",
"Remote Detonator",
"Trapped Soul",
"4 shotgun shells",
"Box of shotgun shells",
"A few bullets",
"Voodoo Doll",
"OBSOLETE",
"Full drum of bullets",
"Tesla Charge",
"OBSOLETE",
"OBSOLETE",
"Flares",
"OBSOLETE",
"OBSOLETE",
"Gasoline Can",
NULL,
};
const char *gWeaponText[] = {
"RANDOM",
"Sawed-off",
"Tommy Gun",
"Flare Pistol",
"Voodoo Doll",
"Tesla Cannon",
"Napalm Launcher",
"Pitchfork",
"Spray Can",
"Dynamite",
"Life Leech",
};
void dbCrypt(char *pPtr, int nLength, int nKey)
{

View file

@ -39,7 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "gamemenu.h"
#include "globals.h"
#include "levels.h"
#include "menu.h"
#include "messages.h"
#include "misc.h"
#include "music.h"
@ -49,6 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "i_specialpaths.h"
#include "view.h"
#include "gamecontrol.h"
#include "menu/menu.h"
BEGIN_BLD_NS
@ -61,10 +61,7 @@ void ReadGameOptionsLegacy(GAMEOPTIONS &gameOptions, GAMEOPTIONSLEGACY &gameOpti
gameOptions.nEpisode = gameOptionsLegacy.nEpisode;
gameOptions.nLevel = gameOptionsLegacy.nLevel;
strcpy(gameOptions.zLevelName, gameOptionsLegacy.zLevelName);
strcpy(gameOptions.zLevelSong, gameOptionsLegacy.zLevelSong);
gameOptions.nTrackNumber = gameOptionsLegacy.nTrackNumber;
strcpy(gameOptions.szSaveGameName, gameOptionsLegacy.szSaveGameName);
strcpy(gameOptions.szUserGameName, gameOptionsLegacy.szUserGameName);
gameOptions.nSaveGameSlot = gameOptionsLegacy.nSaveGameSlot;
gameOptions.picEntry = gameOptionsLegacy.picEntry;
gameOptions.uMapCRC = gameOptionsLegacy.uMapCRC;
@ -214,16 +211,14 @@ bool CDemo::SetupPlayback(const char *pzFile)
at1 = 0;
if (pzFile)
{
hPFile = fopenFileReader(pzFile, 0);
if (!hPFile.isOpen())
if (!hPFile.OpenFile(pzFile))
return false;
}
else
{
if (!pCurrentDemo)
return false;
hPFile = fopenFileReader(pCurrentDemo->zName, 0);
if (hPFile.isOpen())
if (!hPFile.OpenFile(pCurrentDemo->zName))
return false;
}
hPFile.Read(&atf, sizeof(DEMOHEADER));
@ -280,9 +275,6 @@ void CDemo::ProcessKeys(void)
{
switch (gInputMode)
{
case kInputMenu:
gGameMenuMgr.Process();
break;
case kInputMessage:
gPlayerMsg.ProcessKeys();
break;
@ -293,14 +285,7 @@ void CDemo::ProcessKeys(void)
{
switch (nKey)
{
case 1:
if (!CGameMenuMgr::m_bActive)
{
gGameMenuMgr.Push(&menuMain, -1);
at2 = 1;
}
break;
case 0x58:
case sc_F12:
gViewIndex = connectpoint2[gViewIndex];
if (gViewIndex == -1)
gViewIndex = connecthead;
@ -321,21 +306,12 @@ void CDemo::Playback(void)
inputState.SetBindsEnabled(false);
ready2send = 0;
int v4 = 0;
if (!CGameMenuMgr::m_bActive)
{
gGameMenuMgr.Push(&menuMain, -1);
at2 = 1;
}
gNetFifoClock = totalclock;
gViewMode = 3;
_DEMOPLAYBACK:
while (at1 && !gQuitGame)
{
if (handleevents() && quitevent)
{
inputState.SetKeyStatus(sc_Escape, 1);
quitevent = 0;
}
handleevents();
MUSIC_Update();
while (totalclock >= gNetFifoClock && !gQuitGame)
{
@ -407,8 +383,6 @@ _DEMOPLAYBACK:
if (G_FPSLimit())
{
viewDrawScreen();
if (gInputMode == kInputMenu && CGameMenuMgr::m_bActive)
gGameMenuMgr.Draw();
videoNextPage();
}
if (TestBitString(gotpic, 2342))
@ -435,8 +409,8 @@ void CDemo::LoadDemoInfo(void)
D_AddWildFile(demos, zFN);
for (auto &filename : demos)
{
auto hFile = fopenFileReader(filename, 0);
if (!hFile.isOpen())
FileReader hFile;
if (!hFile.OpenFile(filename))
ThrowError("Error loading demo file header.");
hFile.Read(&atf, sizeof(atf));
#if B_BIG_ENDIAN == 1

View file

@ -33,13 +33,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "menu.h"
#include "gamemenu.h"
#include "network.h"
#include "player.h"
#include "sound.h"
#include "view.h"
#include "messages.h"
#include "statistics.h"
#include "gamemenu.h"
#include "gstrings.h"
BEGIN_BLD_NS
@ -52,27 +54,27 @@ void CEndGameMgr::Draw(void)
{
viewLoadingScreenWide();
int nHeight;
gMenuTextMgr.GetFontInfo(1, NULL, NULL, &nHeight);
viewGetFontInfo(1, NULL, NULL, &nHeight);
rotatesprite(160<<16, 20<<16, 65536, 0, 2038, -128, 0, 6, 0, 0, xdim-1, ydim-1);
int nY = 20 - nHeight / 2;
if (gGameOptions.nGameType == 0)
{
viewDrawText(1, "LEVEL STATS", 160, nY, -128, 0, 1, 0);
viewDrawText(1, GStrings("TXTB_LEVELSTATS"), 160, nY, -128, 0, 1, 0);
if (CCheatMgr::m_bPlayerCheated)
{
viewDrawText(3, ">>> YOU CHEATED! <<<", 160, 32, -128, 0, 1, 1);
viewDrawText(3, GStrings("TXTB_CHESTED"), 160, 32, -128, 0, 1, 1);
}
gKillMgr.Draw();
gSecretMgr.Draw();
}
else
{
viewDrawText(1, "FRAG STATS", 160, nY, -128, 0, 1, 0);
viewDrawText(1, GStrings("TXTB_FRAGSTATS"), 160, nY, -128, 0, 1, 0);
gKillMgr.Draw();
}
if (/*dword_28E3D4 != 1 && */((int)totalclock&32))
{
viewDrawText(3, "PRESS A KEY TO CONTINUE", 160, 134, -128, 0, 1, 1);
viewDrawText(3, GStrings("PRESSKEY"), 160, 134, -128, 0, 1, 1);
}
}
@ -163,18 +165,18 @@ void CKillMgr::Draw(void)
char pBuffer[40];
if (gGameOptions.nGameType == 0)
{
viewDrawText(1, "KILLS:", 75, 50, -128, 0, 0, 1);
viewDrawText(1, FStringf("%s:", GStrings("KILLS")), 75, 50, -128, 0, 0, 1);
sprintf(pBuffer, "%2d", at4);
viewDrawText(1, pBuffer, 160, 50, -128, 0, 0, 1);
viewDrawText(1, "OF", 190, 50, -128, 0, 0, 1);
viewDrawText(1, GStrings("OF"), 190, 50, -128, 0, 0, 1);
sprintf(pBuffer, "%2d", at0);
viewDrawText(1, pBuffer, 220, 50, -128, 0, 0, 1);
}
else
{
viewDrawText(3, "#", 85, 35, -128, 0, 0, 1);
viewDrawText(3, "NAME", 100, 35, -128, 0, 0, 1);
viewDrawText(3, "FRAGS", 210, 35, -128, 0, 0, 1);
viewDrawText(3, GStrings("NAME"), 100, 35, -128, 0, 0, 1);
viewDrawText(3, GStrings("FRAGS"), 210, 35, -128, 0, 0, 1);
int nStart = 0;
int nEnd = gInitialNetPlayers;
//if (dword_28E3D4 == 1)
@ -218,28 +220,21 @@ void CSecretMgr::Found(int nType)
} else at8++;
if (gGameOptions.nGameType == 0) {
switch (Random(2)) {
case 0:
viewSetMessage("A secret is revealed.", 0, MESSAGE_PRIORITY_SECRET);
break;
case 1:
viewSetMessage("You found a secret.", 0, MESSAGE_PRIORITY_SECRET);
break;
}
viewSetMessage(GStrings(FStringf("TXT_SECRET%d", Random(2))), 0, MESSAGE_PRIORITY_SECRET);
}
}
void CSecretMgr::Draw(void)
{
char pBuffer[40];
viewDrawText(1, "SECRETS:", 75, 70, -128, 0, 0, 1);
viewDrawText(1, FStringf("%s:", GStrings("TXT_SECRETS")), 75, 70, -128, 0, 0, 1);
sprintf(pBuffer, "%2d", at4);
viewDrawText(1, pBuffer, 160, 70, -128, 0, 0, 1);
viewDrawText(1, "OF", 190, 70, -128, 0, 0, 1);
viewDrawText(1, GStrings("OF"), 190, 70, -128, 0, 0, 1);
sprintf(pBuffer, "%2d", at0);
viewDrawText(1, pBuffer, 220, 70, -128, 0, 0, 1);
if (at8 > 0)
viewDrawText(1, "YOU FOUND A SUPER SECRET!", 160, 100, -128, 2, 1, 1);
viewDrawText(1, GStrings("TXT_SUPERSECRET"), 160, 100, -128, 2, 1, 1);
}
void CSecretMgr::Clear(void)

File diff suppressed because it is too large Load diff

View file

@ -31,464 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
#define M_MOUSETIMEOUT 210
#define kMaxGameMenuItems 128
#define kMaxGameCycleItems 128
#define kMaxPicCycleItems 128
#define kMaxTitleLength 32
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
// use 16 anyway :P
#define MOUSEUSEALPHA (videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15)
#define MOUSEALPHA (MOUSEUSEALPHA ? clamp(((int)totalclock - gGameMenuMgr.m_mouselastactivity - 90)*3, 0, 255) : 0)
#define CURSORALPHA (MOUSEUSEALPHA ? clamp(((int)totalclock - gGameMenuMgr.m_mouselastactivity - 90)*2 + (255/3), (255/3), 255) : 255/3)
#define MOUSEACTIVECONDITION ((int)totalclock - gGameMenuMgr.m_mouselastactivity < M_MOUSETIMEOUT)
#define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
#define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
#define MOUSEWATCHPOINTCONDITIONAL(condition) ((condition) || gGameMenuMgr.m_mousewake_watchpoint || gGameMenuMgr.m_menuchange_watchpoint == 3)
enum {
kMenuEventNone = 0,
kMenuEventKey = 1,
kMenuEventUp = 2,
kMenuEventDown = 3,
kMenuEventLeft = 4,
kMenuEventRight = 5,
kMenuEventEnter = 6,
kMenuEventEscape = 7,
kMenuEventSpace = 8,
kMenuEventBackSpace = 9,
kMenuEventDelete = 10,
kMenuEventScrollUp = 11,
kMenuEventScrollDown = 12,
kMenuEventInit = 0x8000,
kMenuEventDeInit = 0x8001
};
enum {
kMenuSliderNone = 0,
kMenuSliderValue,
kMenuSliderPercent,
kMenuSliderQ16
};
struct CGameMenuEvent {
unsigned short at0;
char at2;
};
// NUKE-TODO:
#ifdef DrawText
#undef DrawText
#endif
class CMenuTextMgr
{
public:
int at0;
CMenuTextMgr();
void DrawText(const char *pString, int nFont, int x, int y, int nShade, int nPalette, bool shadow );
void GetFontInfo(int nFont, const char *pString, int *pXSize, int *pYSize);
};
class CGameMenu;
class CGameMenuItem {
public:
CGameMenu *pMenu;
const char* m_pzText;
int m_nFont;
int m_nX;
int m_nY;
int m_nWidth;
void (*pPreDrawCallback)(CGameMenuItem *pItem);
//int nFlags;
unsigned int bCanSelect : 1;
unsigned int bEnable : 1;
unsigned int bNoDraw : 1;
CGameMenuItem();
virtual ~CGameMenuItem();
virtual void Draw(void) = 0;
virtual bool Event(CGameMenuEvent &);
virtual bool MouseEvent(CGameMenuEvent &);
};
class CGameMenuItemText : public CGameMenuItem
{
public:
int at20;
CGameMenuItemText();
CGameMenuItemText(const char *, int, int, int, int);
virtual void Draw(void);
//virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemTitle : public CGameMenuItem
{
public:
int at20;
CGameMenuItemTitle();
CGameMenuItemTitle(const char *, int, int, int, int);
virtual void Draw(void);
//virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemZBool : public CGameMenuItem
{
public:
bool at20;
const char *at21;
const char *at25;
void (*at29)(CGameMenuItemZBool *);
CGameMenuItemZBool();
CGameMenuItemZBool(const char *,int,int,int,int,bool,void (*)(CGameMenuItemZBool *),const char *,const char *);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemChain : public CGameMenuItem
{
public:
int at20;
CGameMenu *at24;
int at28;
void(*at2c)(CGameMenuItemChain *);
int at30;
CGameMenuItemChain();
CGameMenuItemChain(const char *, int, int, int, int, int, CGameMenu *, int, void(*)(CGameMenuItemChain *), int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItem7EA1C : public CGameMenuItem
{
public:
int at20; // text align
CGameMenu *at24;
int at28;
void(*at2c)(CGameMenuItem7EA1C *);
int at30;
IniFile *at34;
char at38[16];
char at48[16];
CGameMenuItem7EA1C();
CGameMenuItem7EA1C(const char *a1, int a2, int a3, int a4, int a5, const char *a6, const char *a7, int a8, int a9, void(*a10)(CGameMenuItem7EA1C *), int a11);
void Setup(void);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItem7EE34 : public CGameMenuItem
{
public:
int at20;
int at24;
CGameMenu *at28;
CGameMenu *at2c;
CGameMenuItem7EE34();
CGameMenuItem7EE34(const char *a1, int a2, int a3, int a4, int a5, int a6);
void Setup(void);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemChain7F2F0 : public CGameMenuItemChain
{
public:
int at34;
CGameMenuItemChain7F2F0();
CGameMenuItemChain7F2F0(char *a1, int a2, int a3, int a4, int a5, int a6, CGameMenu *a7, int a8, void(*a9)(CGameMenuItemChain *), int a10);
//virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemBitmap : public CGameMenuItem
{
public:
int at20;
CGameMenuItemBitmap();
CGameMenuItemBitmap(const char *, int, int, int, int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemBitmapLS : public CGameMenuItemBitmap
{
public:
int at24;
int at28;
CGameMenuItemBitmapLS();
CGameMenuItemBitmapLS(const char *, int, int, int, int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemKeyList : public CGameMenuItem
{
public:
void(*pCallback)(CGameMenuItemKeyList *);
int at24;
int nRows;
int nTopDelta;
int nFocus;
int nGameFuncs;
bool bScan;
CGameMenuItemKeyList();
CGameMenuItemKeyList(const char * a1, int a2, int a3, int a4, int a5, int a6, int a7, void(*a8)(CGameMenuItemKeyList *));
void Scan(void);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
virtual bool MouseEvent(CGameMenuEvent &);
};
class CGameMenuItemSlider : public CGameMenuItem
{
public:
int *pValue;
int nValue;
int nRangeLow;
int nRangeHigh;
int nStep;
void(*pCallback)(CGameMenuItemSlider *);
int nSliderTile;
int nCursorTile;
int nShowValue;
CGameMenuItemSlider();
CGameMenuItemSlider(const char *_pzText, int _nFont, int _nX, int _nY, int _nWidth, int _nValue, int _nRangeLow, int _nRangeHigh, int _nStep, void(*_pCallback)(CGameMenuItemSlider *), int _nSliderTile, int _nCursorTile, int _nShowValue = kMenuSliderNone);
CGameMenuItemSlider(const char *_pzText, int _nFont, int _nX, int _nY, int _nWidth, int *pnValue, int _nRangeLow, int _nRangeHigh, int _nStep, void(*_pCallback)(CGameMenuItemSlider *), int _nSliderTile, int _nCursorTile, int _nShowValue = kMenuSliderNone);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
virtual bool MouseEvent(CGameMenuEvent &);
};
class CGameMenuItemSliderFloat : public CGameMenuItem
{
public:
float *pValue;
float fValue;
float fRangeLow;
float fRangeHigh;
float fStep;
void(*pCallback)(CGameMenuItemSliderFloat *);
int nSliderTile;
int nCursorTile;
int nShowValue;
CGameMenuItemSliderFloat();
CGameMenuItemSliderFloat(const char *_pzText, int _nFont, int _nX, int _nY, int _nWidth, float _fValue, float _fRangeLow, float _fRangeHigh, float _fStep, void(*_pCallback)(CGameMenuItemSliderFloat *), int _nSliderTile, int _nCursorTile, int _nShowValue = kMenuSliderNone);
CGameMenuItemSliderFloat(const char *_pzText, int _nFont, int _nX, int _nY, int _nWidth, float *pnValue, float _fRangeLow, float _fRangeHigh, float _fStep, void(*_pCallback)(CGameMenuItemSliderFloat *), int _nSliderTile, int _nCursorTile, int _nShowValue = kMenuSliderNone);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemZEdit : public CGameMenuItem
{
public:
char *at20;
int at24;
int at28;
void(*at2c)(CGameMenuItemZEdit *, CGameMenuEvent *);
char at30;
char at31;
char at32;
CGameMenuItemZEdit();
CGameMenuItemZEdit(const char *, int, int, int, int, char *, int, char, void(*)(CGameMenuItemZEdit *, CGameMenuEvent *), int);
void AddChar(char);
void BackChar(void);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemZEditBitmap : public CGameMenuItem
{
public:
char *at20;
int at24;
int at28;
CGameMenuItemBitmapLS *at2c;
void(*at30)(CGameMenuItemZEditBitmap *, CGameMenuEvent *);
char bScan;
char at35;
char at36;
char at37;
CGameMenuItemZEditBitmap();
CGameMenuItemZEditBitmap(char *, int, int, int, int, char *, int, char, void(*)(CGameMenuItemZEditBitmap *, CGameMenuEvent *), int);
void AddChar(char);
void BackChar(void);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemQAV : public CGameMenuItem
{
public:
const char *at20;
DICTNODE *at24;
QAV *at28;
int at2c;
int at30;
bool bWideScreen;
bool bClearBackground;
CGameMenuItemQAV();
CGameMenuItemQAV(const char *, int, int, int, const char *, bool widescreen = false, bool clearbackground = false);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
void Reset(void);
};
class CGameMenuItemZCycleSelect : public CGameMenuItem
{
public:
void(*m_pCallback)(CGameMenuItemZCycleSelect *);
int m_nRows;
int m_nTopDelta;
int m_nFocus;
int m_nItems;
int *m_pReturn;
const char **m_pzStrings;
CGameMenuItemZCycleSelect();
CGameMenuItemZCycleSelect(const char *pzText, int nFont, int nX, int nY, int nWidth, int nRows, int nItems, const char **pzStrings, int *pReturn, void(*pCallback)(CGameMenuItemZCycleSelect *));
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
virtual bool MouseEvent(CGameMenuEvent &);
};
class CGameMenuItemZCycle : public CGameMenuItem
{
public:
int m_nItems;
int m_nFocus;
int m_nAlign;
const char *m_pzStrings[kMaxGameCycleItems];
char m_zTitle[kMaxTitleLength];
void(*m_pCallback)(CGameMenuItemZCycle *);
void(*m_pCallbackSelect)(CGameMenuItemZCycleSelect *);
bool m_bMenu;
int m_nMenuSelectReturn;
CGameMenu *m_pMenuSelect;
CGameMenuItemTitle *m_pItemSelectTitle;
CGameMenuItemZCycleSelect *m_pItemSelect;
CGameMenuItemZCycle();
CGameMenuItemZCycle(const char *, int, int, int, int, int, void(*)(CGameMenuItemZCycle *), const char **, int, int, bool = false, void(*)(CGameMenuItemZCycleSelect*) = NULL);
~CGameMenuItemZCycle();
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
void Add(const char *, bool);
void Next(void);
void Prev(void);
void Clear(void);
void SetTextArray(const char **, int, int);
void SetTextIndex(int);
};
class CGameMenuItemYesNoQuit : public CGameMenuItem
{
public:
int at20;
int m_nRestart;
CGameMenuItemYesNoQuit();
CGameMenuItemYesNoQuit(const char *, int, int, int, int, int, int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenuItemPicCycle : public CGameMenuItem
{
public:
int m_nItems;
int at24;
int at28;
int at2c;
int at30[kMaxPicCycleItems];
void(*atb0)(CGameMenuItemPicCycle *);
int atb4;
CGameMenuItemPicCycle();
CGameMenuItemPicCycle(int, int, void(*)(CGameMenuItemPicCycle *), int *, int, int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
void Add(int, bool);
void Next(void);
void Prev(void);
void Clear(void);
void SetPicArray(int *, int, int);
void SetPicIndex(int);
};
class CGameMenuItemPassword : public CGameMenuItem
{
public:
char at20[9];
char at29[9];
int at32;
char at36;
int at37;
char at3b[32];
int at5b;
CGameMenuItemZBool *at5f;
CGameMenuItemPassword();
CGameMenuItemPassword(const char *, int, int, int);
virtual void Draw(void);
virtual bool Event(CGameMenuEvent &);
};
class CGameMenu
{
public:
int m_nItems;
int m_nFocus;
int at8;
char atc;
CGameMenuItem *pItemList[kMaxGameMenuItems]; // atd
CGameMenu();
CGameMenu(int);
~CGameMenu();
void InitializeItems(CGameMenuEvent &event);
void Draw(void);
bool Event(CGameMenuEvent &event);
void Add(CGameMenuItem *pItem, bool active);
void SetFocusItem(int nItem);
void SetFocusItem(CGameMenuItem *Item);
bool CanSelectItem(int nItem);
void FocusPrevItem(void);
void FocusNextItem(void);
bool IsFocusItem(CGameMenuItem *pItem);
bool MouseEvent(CGameMenuEvent &event);
};
class CGameMenuMgr
{
public:
static bool m_bInitialized;
static bool m_bActive;
static bool m_bScanning;
CGameMenu *pTempMenu;
CGameMenu *pActiveMenu;
CGameMenu *pMenuStack[8];
int nMenuPointer;
int32_t m_mouselastactivity;
int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
int32_t m_mousecaught;
vec2_t m_prevmousepos, m_mousepos, m_mousedownpos;
bool m_postPop;
CGameMenuMgr();
~CGameMenuMgr();
void InitializeMenu(void);
void DeInitializeMenu(void);
bool Push(CGameMenu *pMenu, int data);
void Pop(void);
void PostPop(void);
void Draw(void);
void Clear(void);
void Process(void);
void Deactivate(void);
bool MouseOutsideBounds(vec2_t const * const pos, const int32_t x, const int32_t y, const int32_t width, const int32_t height);
};
extern CMenuTextMgr gMenuTextMgr;
extern CGameMenuMgr gGameMenuMgr;
void drawLoadingScreen(void);
void UpdateNetworkMenus(void);
END_BLD_NS

View file

@ -62,7 +62,6 @@ void _consoleSysMsg(const char* pzFormat, ...) {
va_list args;
va_start(args, pzFormat);
vsprintf(buffer, pzFormat, args);
initprintf("%s(%i): %s\n", _module, _line, buffer);
OSD_Printf(OSDTEXT_RED "%s(%i): %s\n", _module, _line, buffer);
}

View file

@ -130,7 +130,7 @@ void IniFile::Load()
curNode = &head;
auto fp = kopenFileReader(fileName, 0);
auto fp = fileSystem.OpenFileReader(fileName, 0);
if (fp.isOpen())
{
int nSize = fp.GetLength();

View file

@ -43,13 +43,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sfx.h"
#include "view.h"
#include "eventq.h"
#include "menu/menu.h"
BEGIN_BLD_NS
GAMEOPTIONS gGameOptions;
GAMEOPTIONS gSingleGameOptions = {
0, 2, 0, 0, "", "", 2, "", "", 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 3600, 1800, 1800, 7200
0, 2, 0, 0, "", 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 3600, 1800, 1800, 7200
};
EPISODEINFO gEpisodeInfo[kMaxEpisodes+1];
@ -69,7 +70,7 @@ IniFile *BloodINI;
void levelInitINI(const char *pzIni)
{
if (!testkopen(pzIni, 0))
if (!fileSystem.FileExists(pzIni))
ThrowError("Initialization: %s does not exist", pzIni);
BloodINI = new IniFile(pzIni);
Bstrncpy(BloodIniFile, pzIni, BMAX_PATH);
@ -87,7 +88,7 @@ void levelOverrideINI(const char *pzIni)
void levelPlayIntroScene(int nEpisode)
{
gGameOptions.uGameFlags &= ~4;
sndStopSong();
Mus_Stop();
sndKillAllSounds();
sfxKillAllSounds();
ambKillAll();
@ -103,7 +104,7 @@ void levelPlayIntroScene(int nEpisode)
void levelPlayEndScene(int nEpisode)
{
gGameOptions.uGameFlags &= ~8;
sndStopSong();
Mus_Stop();
sndKillAllSounds();
sfxKillAllSounds();
ambKillAll();
@ -145,48 +146,48 @@ void CheckKeyAbend(const char *pzSection, const char *pzKey)
ThrowError("Key %s expected in section [%s] of BLOOD.INI", pzKey, pzSection);
}
LEVELINFO * levelGetInfoPtr(int nEpisode, int nLevel)
MapRecord * levelGetInfoPtr(int nEpisode, int nLevel)
{
dassert(nEpisode >= 0 && nEpisode < gEpisodeCount);
EPISODEINFO *pEpisodeInfo = &gEpisodeInfo[nEpisode];
dassert(nLevel >= 0 && nLevel < pEpisodeInfo->nLevels);
return &pEpisodeInfo->at28[nLevel];
return &pEpisodeInfo->levels[nLevel];
}
char * levelGetFilename(int nEpisode, int nLevel)
const char * levelGetFilename(int nEpisode, int nLevel)
{
dassert(nEpisode >= 0 && nEpisode < gEpisodeCount);
EPISODEINFO *pEpisodeInfo = &gEpisodeInfo[nEpisode];
dassert(nLevel >= 0 && nLevel < pEpisodeInfo->nLevels);
return pEpisodeInfo->at28[nLevel].at0;
return pEpisodeInfo->levels[nLevel].labelName;
}
char * levelGetMessage(int nMessage)
const char * levelGetMessage(int nMessage)
{
int nEpisode = gGameOptions.nEpisode;
int nLevel = gGameOptions.nLevel;
dassert(nMessage < kMaxMessages);
char *pMessage = gEpisodeInfo[nEpisode].at28[nLevel].atec[nMessage];
const char *pMessage = gEpisodeInfo[nEpisode].levels[nLevel].GetMessage(nMessage);
if (*pMessage == 0)
return NULL;
return pMessage;
}
char * levelGetTitle(void)
const char * levelGetTitle(void)
{
int nEpisode = gGameOptions.nEpisode;
int nLevel = gGameOptions.nLevel;
char *pTitle = gEpisodeInfo[nEpisode].at28[nLevel].at90;
const char *pTitle = gEpisodeInfo[nEpisode].levels[nLevel].DisplayName();
if (*pTitle == 0)
return NULL;
return pTitle;
}
char * levelGetAuthor(void)
const char * levelGetAuthor(void)
{
int nEpisode = gGameOptions.nEpisode;
int nLevel = gGameOptions.nLevel;
char *pAuthor = gEpisodeInfo[nEpisode].at28[nLevel].atb0;
const char *pAuthor = gEpisodeInfo[nEpisode].levels[nLevel].author;
if (*pAuthor == 0)
return NULL;
return pAuthor;
@ -196,39 +197,37 @@ void levelSetupOptions(int nEpisode, int nLevel)
{
gGameOptions.nEpisode = nEpisode;
gGameOptions.nLevel = nLevel;
strcpy(gGameOptions.zLevelName, gEpisodeInfo[nEpisode].at28[nLevel].at0);
strcpy(gGameOptions.zLevelName, gEpisodeInfo[nEpisode].levels[nLevel].labelName);
gGameOptions.uMapCRC = dbReadMapCRC(gGameOptions.zLevelName);
// strcpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0);
gGameOptions.nTrackNumber = gEpisodeInfo[nEpisode].at28[nLevel].ate0;
gGameOptions.nTrackNumber = gEpisodeInfo[nEpisode].levels[nLevel].cdSongId;
}
void levelLoadMapInfo(IniFile *pIni, LEVELINFO *pLevelInfo, const char *pzSection)
void levelLoadMapInfo(IniFile *pIni, MapRecord *pLevelInfo, const char *pzSection, int epinum, int mapnum)
{
char buffer[16];
strncpy(pLevelInfo->at90, pIni->GetKeyString(pzSection, "Title", pLevelInfo->at0), 31);
strncpy(pLevelInfo->atb0, pIni->GetKeyString(pzSection, "Author", ""), 31);
strncpy(pLevelInfo->atd0, pIni->GetKeyString(pzSection, "Song", ""), BMAX_PATH);
pLevelInfo->ate0 = pIni->GetKeyInt(pzSection, "Track", -1);
pLevelInfo->ate4 = pIni->GetKeyInt(pzSection, "EndingA", -1);
pLevelInfo->ate8 = pIni->GetKeyInt(pzSection, "EndingB", -1);
pLevelInfo->at8ec = pIni->GetKeyInt(pzSection, "Fog", -0);
pLevelInfo->at8ed = pIni->GetKeyInt(pzSection, "Weather", -0);
pLevelInfo->SetName(pIni->GetKeyString(pzSection, "Title", pLevelInfo->labelName));
pLevelInfo->author = pIni->GetKeyString(pzSection, "Author", "");
pLevelInfo->music.Format("%s.%s", pIni->GetKeyString(pzSection, "Song", ""), ".mid");
pLevelInfo->cdSongId = pIni->GetKeyInt(pzSection, "Track", -1);
pLevelInfo->nextLevel = pIni->GetKeyInt(pzSection, "EndingA", -1); //if (pLevelInfo->nextLevel >= 0) pLevelInfo->nextLevel +epinum * kMaxLevels;
pLevelInfo->nextSecret = pIni->GetKeyInt(pzSection, "EndingB", -1); //if (pLevelInfo->nextSecret >= 0) pLevelInfo->nextSecret + epinum * kMaxLevels;
pLevelInfo->fog = pIni->GetKeyInt(pzSection, "Fog", -0);
pLevelInfo->weather = pIni->GetKeyInt(pzSection, "Weather", -0);
pLevelInfo->messageStart = 1024 + ((epinum * kMaxLevels) + mapnum) * kMaxMessages;
for (int i = 0; i < kMaxMessages; i++)
{
sprintf(buffer, "Message%d", i+1);
strncpy(pLevelInfo->atec[i], pIni->GetKeyString(pzSection, buffer, ""), 63);
quoteMgr.InitializeQuote(pLevelInfo->messageStart + i, pIni->GetKeyString(pzSection, buffer, ""), true);
}
}
extern void MenuSetupEpisodeInfo(void);
void levelLoadDefaults(void)
{
char buffer[64];
char buffer2[16];
levelInitINI(G_ConFile()); // This doubles for the INI in the global code.
memset(gEpisodeInfo, 0, sizeof(gEpisodeInfo));
strncpy(gEpisodeInfo[MUS_INTRO/kMaxLevels].at28[MUS_INTRO%kMaxLevels].atd0, "PESTIS", BMAX_PATH);
quoteMgr.InitializeQuote(MUS_INTRO, "PESTIS.MID");
int i;
for (i = 0; i < kMaxEpisodes; i++)
{
@ -236,7 +235,8 @@ void levelLoadDefaults(void)
if (!BloodINI->SectionExists(buffer))
break;
EPISODEINFO *pEpisodeInfo = &gEpisodeInfo[i];
strncpy(pEpisodeInfo->at0, BloodINI->GetKeyString(buffer, "Title", buffer), 31);
auto ep_str = BloodINI->GetKeyString(buffer, "Title", buffer);
gVolumeNames[i] = ep_str; // only keep one table for the names. Todo: Consolidate this across games.
strncpy(pEpisodeInfo->at8f08, BloodINI->GetKeyString(buffer, "CutSceneA", ""), BMAX_PATH);
pEpisodeInfo->at9028 = BloodINI->GetKeyInt(buffer, "CutWavA", -1);
if (pEpisodeInfo->at9028 == 0)
@ -254,22 +254,23 @@ void levelLoadDefaults(void)
pEpisodeInfo->cutALevel = BloodINI->GetKeyInt(buffer, "CutSceneALevel", 0);
if (pEpisodeInfo->cutALevel > 0)
pEpisodeInfo->cutALevel--;
pEpisodeInfo->levels = mapList + i * kMaxLevels;
int j;
for (j = 0; j < kMaxLevels; j++)
{
LEVELINFO *pLevelInfo = &pEpisodeInfo->at28[j];
auto pLevelInfo = &pEpisodeInfo->levels[j];
sprintf(buffer2, "Map%d", j+1);
if (!BloodINI->KeyExists(buffer, buffer2))
break;
const char *pMap = BloodINI->GetKeyString(buffer, buffer2, NULL);
CheckSectionAbend(pMap);
strncpy(pLevelInfo->at0, pMap, BMAX_PATH);
levelLoadMapInfo(BloodINI, pLevelInfo, pMap);
pLevelInfo->labelName = pMap;
pLevelInfo->fileName.Format("%s.map", pMap);
levelLoadMapInfo(BloodINI, pLevelInfo, pMap, i, j);
}
pEpisodeInfo->nLevels = j;
}
gEpisodeCount = i;
MenuSetupEpisodeInfo();
}
void levelAddUserMap(const char *pzMap)
@ -287,29 +288,28 @@ void levelAddUserMap(const char *pzMap)
if (pEpisodeInfo->nLevels == 0)
{
gEpisodeCount++;
sprintf(pEpisodeInfo->at0, "Episode %d", nEpisode);
gVolumeNames[nEpisode].Format("Episode %d", nEpisode+1);
}
nLevel = pEpisodeInfo->nLevels++;
}
LEVELINFO *pLevelInfo = &pEpisodeInfo->at28[nLevel];
auto pLevelInfo = &pEpisodeInfo->levels[nLevel];
ChangeExtension(buffer, "");
strncpy(pLevelInfo->at0, buffer, BMAX_PATH);
levelLoadMapInfo(&UserINI, pLevelInfo, NULL);
pLevelInfo->name = buffer;
levelLoadMapInfo(&UserINI, pLevelInfo, NULL, nEpisode, nLevel);
gGameOptions.nEpisode = nEpisode;
gGameOptions.nLevel = nLevel;
gGameOptions.uMapCRC = dbReadMapCRC(pLevelInfo->at0);
strcpy(gGameOptions.zLevelName, pLevelInfo->at0);
MenuSetupEpisodeInfo();
gGameOptions.uMapCRC = dbReadMapCRC(pLevelInfo->name);
strcpy(gGameOptions.zLevelName, pLevelInfo->name);
}
void levelGetNextLevels(int nEpisode, int nLevel, int *pnEndingA, int *pnEndingB)
{
dassert(pnEndingA != NULL && pnEndingB != NULL);
LEVELINFO *pLevelInfo = &gEpisodeInfo[nEpisode].at28[nLevel];
int nEndingA = pLevelInfo->ate4;
auto pLevelInfo = &gEpisodeInfo[nEpisode].levels[nLevel];
int nEndingA = pLevelInfo->nextLevel;
if (nEndingA >= 0)
nEndingA--;
int nEndingB = pLevelInfo->ate8;
int nEndingB = pLevelInfo->nextSecret;
if (nEndingB >= 0)
nEndingB--;
*pnEndingA = nEndingA;
@ -399,21 +399,20 @@ int levelGetMusicIdx(const char *str)
bool levelTryPlayMusic(int nEpisode, int nLevel, bool bSetLevelSong)
{
char buffer[BMAX_PATH];
if (mus_redbook && gEpisodeInfo[nEpisode].at28[nLevel].ate0 > 0)
snprintf(buffer, BMAX_PATH, "blood%02i.ogg", gEpisodeInfo[nEpisode].at28[nLevel].ate0);
if (mus_redbook && gEpisodeInfo[nEpisode].levels[nLevel].cdSongId > 0)
snprintf(buffer, BMAX_PATH, "blood%02i.ogg", gEpisodeInfo[nEpisode].levels[nLevel].cdSongId);
else
strncpy(buffer, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
bool bReturn = !!sndPlaySong(gEpisodeInfo[nEpisode].at28[nLevel].atd0, buffer, true);
if (bReturn || bSetLevelSong)
strncpy(gGameOptions.zLevelSong, buffer, BMAX_PATH);
else *gGameOptions.zLevelSong = 0;
return bReturn;
{
strncpy(buffer, gEpisodeInfo[nEpisode].levels[nLevel].music, BMAX_PATH);
}
if (!strchr(buffer, '.')) strcat(buffer, ".mid");
return !!Mus_Play(gEpisodeInfo[nEpisode].levels[nLevel].labelName, buffer, true);
}
void levelTryPlayMusicOrNothing(int nEpisode, int nLevel)
{
if (levelTryPlayMusic(nEpisode, nLevel, true))
sndStopSong();
Mus_Stop();
}
class LevelsLoadSave : public LoadSave

View file

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include "common_game.h"
#include "inifile.h"
#include "mapinfo.h"
BEGIN_BLD_NS
@ -39,10 +40,7 @@ struct GAMEOPTIONS {
int nEpisode;
int nLevel;
char zLevelName[BMAX_PATH];
char zLevelSong[BMAX_PATH];
int nTrackNumber; //at12a;
char szSaveGameName[BMAX_PATH];
char szUserGameName[BMAX_PATH];
short nSaveGameSlot;
int picEntry;
unsigned int uMapCRC;
@ -71,27 +69,13 @@ enum {
MUS_LOADING = MUS_FIRST_SPECIAL + 1,
};
struct LEVELINFO
{
char at0[BMAX_PATH]; // Filename
char at90[32]; // Title
char atb0[32]; // Author
char atd0[BMAX_PATH]; // Song;
int ate0; // SongId
int ate4; // EndingA
int ate8; // EndingB
char atec[kMaxMessages][64]; // Messages
char at8ec; // Fog
char at8ed; // Weather
}; // 0x8ee bytes
struct EPISODEINFO
{
char at0[32];
//char at0[32]; removed, so that the global episode name table can be used for consistency
int nLevels;
unsigned int bloodbath : 1;
unsigned int cutALevel : 4;
LEVELINFO at28[kMaxLevels];
MapRecord* levels; // points into the global table.
char at8f08[BMAX_PATH];
char at8f98[BMAX_PATH];
int at9028;
@ -121,13 +105,12 @@ void levelSetupSecret(int nCount);
void levelTriggerSecret(int nSecret);
void CheckSectionAbend(const char *pzSection);
void CheckKeyAbend(const char *pzSection, const char *pzKey);
LEVELINFO * levelGetInfoPtr(int nEpisode, int nLevel);
char * levelGetFilename(int nEpisode, int nLevel);
char * levelGetMessage(int nMessage);
char * levelGetTitle(void);
char * levelGetAuthor(void);
MapRecord * levelGetInfoPtr(int nEpisode, int nLevel);
const char * levelGetFilename(int nEpisode, int nLevel);
const char * levelGetMessage(int nMessage);
const char * levelGetTitle(void);
const char * levelGetAuthor(void);
void levelSetupOptions(int nEpisode, int nLevel);
void levelLoadMapInfo(IniFile *pIni, LEVELINFO *pLevelInfo, const char *pzSection);
void levelLoadDefaults(void);
void levelAddUserMap(const char *pzMap);
// EndingA is normal ending, EndingB is secret level

View file

@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "globals.h"
#include "db.h"
#include "messages.h"
#include "menu.h"
#include "gamemenu.h"
#include "network.h"
#include "loadsave.h"
#include "resource.h"
@ -46,13 +46,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sound.h"
#include "i_specialpaths.h"
#include "view.h"
#include "statistics.h"
#include "secrets.h"
#include "savegamehelp.h"
#include "z_music.h"
#include "mapinfo.h"
BEGIN_BLD_NS
GAMEOPTIONS gSaveGameOptions[10];
char *gSaveGamePic[10];
unsigned int gSavedOffset = 0;
@ -102,7 +101,7 @@ void LoadSave::Write(void *pData, int nSize)
ThrowError("File error #%d writing save file.", errno);
}
void LoadSave::LoadGame(char *pzFile)
bool GameInterface::LoadGame(FSaveGameNode* node)
{
bool demoWasPlayed = gDemo.at1;
if (gDemo.at1)
@ -118,20 +117,18 @@ void LoadSave::LoadGame(char *pzFile)
memset(sprite, 0, sizeof(spritetype)*kMaxSprites);
automapping = 1;
}
OpenSaveGameForRead(pzFile);
hLFile = ReadSavegameChunk("snapshot.bld");
if (!hLFile.isOpen())
ThrowError("Error loading save file.");
LoadSave *rover = head.next;
while (rover != &head)
OpenSaveGameForRead(node->Filename);
LoadSave::hLFile = ReadSavegameChunk("snapshot.bld");
if (!LoadSave::hLFile.isOpen())
return false;
LoadSave *rover = LoadSave::head.next;
while (rover != &LoadSave::head)
{
rover->Load();
rover = rover->next;
}
if (!ReadStatistics() || !SECRET_Load()) // read the rest...
ThrowError("Error loading save file.");
hLFile.Close();
LoadSave::hLFile.Close();
FinishSavegameRead();
if (!gGameStarted)
scrLoadPLUs();
@ -181,40 +178,41 @@ void LoadSave::LoadGame(char *pzFile)
gGameStarted = 1;
bVanilla = false;
if (mus_restartonload
|| demoWasPlayed
|| (gMusicPrevLoadedEpisode != gGameOptions.nEpisode || gMusicPrevLoadedLevel != gGameOptions.nLevel))
{
levelTryPlayMusic(gGameOptions.nEpisode, gGameOptions.nLevel);
}
gMusicPrevLoadedEpisode = gGameOptions.nEpisode;
gMusicPrevLoadedLevel = gGameOptions.nLevel;
MUS_ResumeSaved();
netBroadcastPlayerInfo(myconnectindex);
//sndPlaySong(gGameOptions.zLevelSong, 1);
return true;
}
void LoadSave::SaveGame(char *pzFile)
bool GameInterface::SaveGame(FSaveGameNode* node)
{
OpenSaveGameForWrite(pzFile);
hSFile = WriteSavegameChunk("snapshot.bld");
if (hSFile == NULL)
ThrowError("File error #%d creating save file.", errno);
dword_27AA38 = 0;
dword_27AA40 = 0;
LoadSave *rover = head.next;
while (rover != &head)
{
rover->Save();
if (dword_27AA38 > dword_27AA40)
dword_27AA40 = dword_27AA38;
dword_27AA38 = 0;
rover = rover->next;
}
SaveStatistics();
SECRET_Save();
FinishSavegameWrite();
hSFile = NULL;
OpenSaveGameForWrite(node->Filename);
LoadSave::hSFile = WriteSavegameChunk("snapshot.bld");
try
{
dword_27AA38 = 0;
dword_27AA40 = 0;
LoadSave* rover = LoadSave::head.next;
while (rover != &LoadSave::head)
{
rover->Save();
if (dword_27AA38 > dword_27AA40)
dword_27AA40 = dword_27AA38;
dword_27AA38 = 0;
rover = rover->next;
}
}
catch (std::runtime_error & err)
{
// Let's not abort for write errors.
Printf(TEXTCOLOR_RED "%s\n", err.what());
return false;
}
G_WriteSaveHeader(node->SaveTitle);
LoadSave::hSFile = NULL;
return FinishSavegameWrite();
}
class MyLoadSave : public LoadSave
@ -440,47 +438,10 @@ void MyLoadSave::Save(void)
void LoadSavedInfo(void)
{
FString path = M_GetSavegamesPath() + "game*.sav";
TArray<FString> saves;
D_AddWildFile(saves, path);
int nCount = 0;
for (auto & savename : saves)
{
OpenSaveGameForRead(savename);
auto hFile = ReadSavegameChunk("snapshot.bld");
if (!hFile.isOpen())
{
FinishSavegameRead();
ThrowError("Error loading save file header.");
}
int vc;
short v4;
vc = 0;
v4 = word_27AA54;
if ((uint32_t)hFile.Read(&vc, sizeof(vc)) != sizeof(vc))
{
continue;
}
if (vc != 0x5653424e/*'VSBN'*/)
{
continue;
}
hFile.Read(&v4, sizeof(v4));
if (v4 != BYTEVERSION)
{
continue;
}
if ((uint32_t)hFile.Read(&gSaveGameOptions[nCount], sizeof(gSaveGameOptions[0])) != sizeof(gSaveGameOptions[0]))
ThrowError("Error reading save file.");
strcpy(strRestoreGameStrings[gSaveGameOptions[nCount].nSaveGameSlot], gSaveGameOptions[nCount].szUserGameName);
nCount++;
}
FinishSavegameRead();
}
void UpdateSavedInfo(int nSlot)
{
strcpy(strRestoreGameStrings[gSaveGameOptions[nSlot].nSaveGameSlot], gSaveGameOptions[nSlot].szUserGameName);
}
static MyLoadSave *myLoadSave;

View file

@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <stdio.h>
#include "levels.h"
struct FSavegameNode;
BEGIN_BLD_NS
class LoadSave {
@ -49,12 +50,11 @@ public:
virtual void Load(void);
void Read(void *, int);
void Write(void *, int);
static void LoadGame(char *);
static void SaveGame(char *);
static void LoadGame(FSavegameNode *);
static void SaveGame(FSavegameNode*);
};
extern unsigned int gSavedOffset;
extern GAMEOPTIONS gSaveGameOptions[];
extern char *gSaveGamePic[10];
void UpdateSavedInfo(int nSlot);
void LoadSavedInfo(void);

View file

@ -197,8 +197,8 @@ void CViewMap::sub_25C74(void)
videoClearScreen(0);
renderDrawMapView(x,y,nZoom>>2,angle);
sub_2541C(x,y,nZoom>>2,angle);
char *pTitle = levelGetTitle();
char *pFilename = levelGetFilename(gGameOptions.nEpisode, gGameOptions.nLevel);
const char *pTitle = levelGetTitle();
const char *pFilename = levelGetFilename(gGameOptions.nEpisode, gGameOptions.nLevel);
if (pTitle)
sprintf(pBuffer, "%s: %s", pFilename, pTitle);
else
@ -210,10 +210,12 @@ void CViewMap::sub_25C74(void)
nViewY = gViewY0S+1;
viewDrawText(3, pBuffer, gViewX1S, nViewY, -128, 0, 2, 0, 256);
#if 0 // needs to be generalized
if (gViewMap.bFollowMode)
viewDrawText(3, "MAP FOLLOW MODE", gViewX1S, nViewY+8, -128, 0, 2, 0, 256);
else
viewDrawText(3, "MAP SCROLL MODE", gViewX1S, nViewY+8, -128, 0, 2, 0, 256);
#endif
if (tm)
viewResizeView(viewSize);
}

File diff suppressed because it is too large Load diff

View file

@ -1,63 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 Nuke.YKT
This file is part of NBlood.
NBlood is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#pragma once
#include "gamemenu.h"
BEGIN_BLD_NS
extern CGameMenu menuMain;
extern CGameMenu menuMainWithSave;
extern CGameMenu menuNetMain;
extern CGameMenu menuNetStart;
extern CGameMenu menuEpisode;
extern CGameMenu menuDifficulty;
extern CGameMenu menuOptionsOld;
extern CGameMenu menuControls;
extern CGameMenu menuMessages;
extern CGameMenu menuKeys;
extern CGameMenu menuSaveGame;
extern CGameMenu menuLoadGame;
extern CGameMenu menuLoading;
extern CGameMenu menuSounds;
extern CGameMenu menuQuit;
extern CGameMenu menuRestart;
extern CGameMenu menuCredits;
extern CGameMenu menuOrder;
extern CGameMenu menuPlayOnline;
extern CGameMenu menuParentalLock;
extern CGameMenu menuSorry;
extern CGameMenu menuSorry2;
extern CGameMenu menuOptions;
extern CGameMenu menuOptionsSound;
extern CGameMenu menuOptionsDisplayMode;
extern short gQuickLoadSlot;
extern short gQuickSaveSlot;
extern char strRestoreGameStrings[][16];
void drawLoadingScreen(void);
void SetupMenus(void);
void UpdateNetworkMenus(void);
void QuickSaveGame(void);
void QuickLoadGame(void);
END_BLD_NS

View file

@ -1,537 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2016 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#ifndef menus_h_
#define menus_h_
#include "compat.h"
#include "cache1d.h"
#include "pragmas.h"
#include "common.h"
#include "blood.h"
BEGIN_BLD_NS
#if defined EDUKE32_TOUCH_DEVICES
# define EDUKE32_SIMPLE_MENU
# define EDUKE32_ANDROID_MENU
#endif
// #define EDUKE32_SIMPLE_MENU
enum MenuIndex_t {
MENU_NULL = INT32_MIN, // sentinel for "do nothing"
MENU_CLOSE = -2, // sentinel for "close the menu"/"no menu"
MENU_PREVIOUS = -1, // sentinel for "go to previous menu"
MENU_MAIN = 0,
MENU_MAIN_INGAME = 50,
MENU_EPISODE = 100,
MENU_USERMAP = 101,
MENU_NEWGAMECUSTOM = 102,
MENU_NEWGAMECUSTOMSUB = 103,
MENU_SKILL = 110,
MENU_GAMESETUP = 200,
MENU_OPTIONS = 202,
MENU_VIDEOSETUP = 203,
MENU_KEYBOARDSETUP = 204,
MENU_MOUSESETUP = 205,
MENU_JOYSTICKSETUP = 206,
MENU_JOYSTICKBTNS = 207,
MENU_JOYSTICKAXES = 208,
MENU_KEYBOARDKEYS = 209,
MENU_MOUSEBTNS = 210,
MENU_MOUSEADVANCED = 212,
MENU_JOYSTICKAXIS = 213,
MENU_TOUCHSETUP = 214,
MENU_TOUCHSENS = 215,
MENU_TOUCHBUTTONS = 216,
MENU_CONTROLS = 220,
MENU_POLYMOST = 230,
MENU_COLCORR = 231,
MENU_COLCORR_INGAME = 232,
MENU_SCREENSETUP = 233,
MENU_DISPLAYSETUP = 234,
MENU_POLYMER = 240,
MENU_LOAD = 300,
MENU_SAVE = 350,
MENU_STORY = 400,
MENU_F1HELP = 401,
MENU_QUIT = 500,
MENU_QUITTOTITLE = 501,
MENU_QUIT_INGAME = 502,
MENU_NETSETUP = 600,
MENU_NETWAITMASTER = 601,
MENU_NETWAITVOTES = 603,
MENU_SOUND = 700,
MENU_SOUND_INGAME = 701,
MENU_ADVSOUND = 702,
MENU_SAVESETUP = 750,
MENU_SAVECLEANVERIFY = 751,
MENU_RESETSTATSVERIFY = 752,
MENU_CHEATS = 800,
MENU_CHEATENTRY = 801,
MENU_CHEAT_WARP = 802,
MENU_CHEAT_SKILL = 803,
MENU_CREDITS = 990,
MENU_CREDITS2 = 991,
MENU_CREDITS3 = 992,
MENU_CREDITS4 = 993,
MENU_CREDITS5 = 994,
MENU_LOADVERIFY = 1000,
MENU_LOADDELVERIFY = 1100,
MENU_NEWVERIFY = 1500,
MENU_SAVEVERIFY = 2000,
MENU_SAVEDELVERIFY = 2100,
MENU_COLCORRRESETVERIFY = 2200,
MENU_KEYSRESETVERIFY = 2201,
MENU_KEYSCLASSICVERIFY = 2202,
MENU_JOYSTANDARDVERIFY = 2203,
MENU_JOYPROVERIFY = 2204,
MENU_JOYCLEARVERIFY = 2205,
MENU_ADULTPASSWORD = 10001,
MENU_RESETPLAYER = 15000,
MENU_BUYDUKE = 20000,
MENU_NETWORK = 20001,
MENU_PLAYER = 20002,
MENU_MACROS = 20004,
MENU_NETHOST = 20010,
MENU_NETOPTIONS = 20011,
MENU_NETUSERMAP = 20012,
MENU_NETJOIN = 20020,
};
typedef int32_t MenuID_t;
typedef enum MenuAnimationType_t
{ // Note: This enum is for logical categories, not visual types.
MA_None,
MA_Return,
MA_Advance,
} MenuAnimationType_t;
// a subset of screentext parameters, restricted because menus require accessibility
typedef struct MenuFont_t
{
// int32_t xspace, yline;
vec2_t emptychar, between;
int32_t zoom;
int32_t cursorLeftPosition, cursorCenterPosition, cursorScale;
int32_t textflags;
int16_t tilenum;
// selected shade glows, deselected shade is used by Blood, disabled shade is used by SW
int8_t shade_deselected, shade_disabled;
uint8_t pal;
uint8_t pal_selected, pal_deselected, pal_disabled;
uint8_t pal_selected_right, pal_deselected_right, pal_disabled_right;
int32_t get_yline() const { return mulscale16(emptychar.y, zoom); }
} MenuFont_t;
typedef enum MenuEntryType_t
{
Dummy,
Link,
Option,
Custom2Col,
RangeInt32,
RangeFloat,
#ifdef MENU_ENABLE_RANGEDOUBLE
RangeDouble,
#endif
String,
Spacer,
} MenuEntryType_t;
typedef struct MenuEntryFormat_t
{
int32_t marginBottom;
int32_t indent;
int32_t width; // 0: center, >0: width of the label column (left-aligned options), <0: -width of everything (right-aligned)
} MenuEntryFormat_t;
typedef struct MenuMenuFormat_t
{
vec2_t pos;
int32_t bottomcutoff; // >0: the bottom edge of the menu before automatic scrolling kicks in, <0: -total height for vertical justification
} MenuMenuFormat_t;
typedef struct MenuLink_t
{
// traits
MenuID_t linkID;
MenuAnimationType_t animation;
} MenuLink_t;
typedef struct MenuOptionSet_t
{
// traits
char const **optionNames;
int32_t *optionValues; // If NULL, the identity of currentOption is assumed.
// pop-up list appearance
MenuMenuFormat_t *menuFormat;
MenuEntryFormat_t *entryFormat;
MenuFont_t *font;
// traits
int32_t numOptions;
// pop-up list state
int32_t currentEntry;
int32_t scrollPos;
// appearance
uint8_t features; // bit 1 = disable left/right arrows, bit 2 = disable list
int32_t getMarginBottom() const { return mulscale16(entryFormat->marginBottom, font->zoom); }
int32_t getIndent() const { return mulscale16(entryFormat->indent, font->zoom); }
} MenuOptionSet_t;
typedef struct MenuOption_t
{
// appearance
MenuFont_t *font;
// traits
MenuOptionSet_t *options; // so that common sets such as Yes/No, On/Off can be reused
// effect
int32_t *data;
// state
int32_t currentOption;
} MenuOption_t;
typedef struct MenuCustom2Col_t
{
// effect
uint8_t *column[2];
char const **key;
// appearance
MenuFont_t *font;
// effect
size_t numvalid;
// appearance
int32_t columnWidth;
// state
int8_t screenOpen;
} MenuCustom2Col_t;
enum MenuRangeFlags_t
{
DisplayTypeInteger = 1,
DisplayTypePercent = 2,
DisplayTypeNormalizedDecimal = 3,
DisplayTypeMask = (1<<0)|(1<<1),
EnforceIntervals = 1<<7,
};
typedef struct MenuRangeInt32_t
{
// effect
int32_t *variable;
// appearance
MenuFont_t *font;
// traits
int32_t min;
int32_t max;
int32_t onehundredpercent; // 0 implies max
int32_t steps;
uint8_t flags;
} MenuRangeInt32_t;
typedef struct MenuRangeFloat_t
{
// effect
float *variable;
// appearance
MenuFont_t *font;
// traits
float min;
float max;
float onehundredpercent; // 0 implies 1.0
int32_t steps;
uint8_t flags;
} MenuRangeFloat_t;
#ifdef MENU_ENABLE_RANGEDOUBLE
typedef struct MenuRangeDouble_t
{
// effect
double *variable;
// appearance
MenuFont_t *font;
// traits
double min;
double max;
double onehundredpercent; // 0 implies 1.0
int32_t steps;
uint8_t flags;
} MenuRangeDouble_t;
#endif
typedef struct MenuString_t
{
// state
char* editfield;
// effect
char* variable;
// appearance
MenuFont_t *font;
// effect
int32_t bufsize;
int32_t flags;
} MenuString_t;
typedef struct MenuSpacer_t
{
int32_t height;
} MenuSpacer_t;
// For internal use only.
enum MenuEntryFlags_t
{
MEF_Disabled = 1<<0,
MEF_LookDisabled = 1<<1,
MEF_Hidden = 1<<2,
};
typedef struct MenuEntry_t
{
// traits
const char *name;
// appearance
MenuFont_t *font;
MenuEntryFormat_t *format;
void *entry;
MenuEntryType_t type;
// state
int32_t flags;
int32_t ytop, ybottom;
int32_t getMarginBottom() const { return mulscale16(format->marginBottom, font->zoom); }
int32_t getIndent() const { return mulscale16(format->indent, font->zoom); }
int32_t getHeight() const
{
return type == Spacer ? mulscale16(((MenuSpacer_t *)entry)->height, font->zoom) : font->get_yline();
}
} MenuEntry_t;
typedef enum MenuType_t
{
Menu,
Panel,
Verify,
Message,
TextForm,
FileSelect,
} MenuType_t;
typedef struct MenuMenu_t
{
const char *title;
MenuMenuFormat_t *format;
MenuEntry_t **entrylist;
int32_t numEntries;
// state
int32_t currentEntry, currentColumn;
int32_t scrollPos;
} MenuMenu_t;
typedef struct MenuPanel_t
{
const char *title;
MenuID_t previousID;
MenuAnimationType_t previousAnimation;
MenuID_t nextID;
MenuAnimationType_t nextAnimation;
} MenuPanel_t;
typedef struct MenuVerify_t
{
vec2_t cursorpos;
MenuID_t linkID;
MenuAnimationType_t animation;
} MenuVerify_t;
typedef struct MenuMessage_t
{
vec2_t cursorpos;
MenuID_t linkID;
MenuAnimationType_t animation;
} MenuMessage_t;
enum MenuTextFormFlags_t
{
MTF_Password = 1<<0,
};
typedef struct MenuTextForm_t
{
// state
char *input;
// traits
const char *instructions;
int32_t bufsize;
uint8_t flags;
} MenuTextForm_t;
typedef struct MenuFileSelect_t
{
const char *title;
// appearance
MenuMenuFormat_t *format[2];
MenuFont_t *font[2];
// traits
const char * startdir;
const char *pattern;
char *destination;
// state
//CACHE1D_FIND_REC *findhigh[2];
int32_t scrollPos[2];
// appearance
int32_t marginBottom[2];
// state
//fnlist_t fnlist;
int32_t currentList;
int32_t getMarginBottom(size_t index) const { return mulscale16(marginBottom[index], font[index]->zoom); }
} MenuFileSelect_t;
typedef struct Menu_t
{
void *object;
MenuID_t menuID;
MenuID_t parentID;
MenuAnimationType_t parentAnimation;
MenuType_t type;
} Menu_t;
typedef struct MenuAnimation_t
{
int32_t(*out)(struct MenuAnimation_t *);
int32_t(*in)(struct MenuAnimation_t *);
Menu_t *previous;
Menu_t *current;
int32_t start;
int32_t length;
} MenuAnimation_t;
extern MenuAnimation_t m_animation;
extern MenuID_t g_currentMenu;
extern Menu_t *m_currentMenu;
extern int32_t g_quitDeadline;
extern int32_t voting;
int Menu_Change(MenuID_t cm);
void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype);
int32_t Menu_IsTextInput(Menu_t *cm);
int G_CheckPlayerColor(int color);
void Menu_Init(void);
void Menu_Open(uint8_t playerID);
void Menu_Close(uint8_t playerID);
void M_DisplayMenus(void);
extern MenuFont_t MF_Redfont, MF_Bluefont, MF_Minifont;
#define M_MOUSETIMEOUT 210
extern int32_t m_mouselastactivity;
#if defined EDUKE32_TOUCH_DEVICES
# define MOUSEALPHA 0
# define CURSORALPHA (255/3)
# define MOUSEACTIVECONDITIONAL(condition) (condition)
# define MOUSEWATCHPOINTCONDITIONAL(condition) (condition)
#else
extern int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
// use 16 anyway :P
#if 0
# define MOUSEUSEALPHA (videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15)
# define MOUSEALPHA (MOUSEUSEALPHA ? clamp(((int32_t) totalclock - m_mouselastactivity - 90)*3, 0, 255) : 0)
# define CURSORALPHA (MOUSEUSEALPHA ? clamp(((int32_t) totalclock - m_mouselastactivity - 90)*2 + (255/3), (255/3), 255) : 255/3)
# define MOUSEACTIVECONDITION (totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
# define MOUSEINACTIVECONDITIONAL(condition) ((gInputMode != kInputMenu || !MOUSEACTIVECONDITION) && (condition))
# define MOUSEWATCHPOINTCONDITIONAL(condition) ((condition) || m_mousewake_watchpoint || m_menuchange_watchpoint == 3)
#endif
#endif
#define MAXMENUGAMEPLAYENTRIES 7
enum MenuGameplayEntryFlags
{
MGE_Locked = 1u<<0u,
MGE_Hidden = 1u<<1u,
MGE_UserContent = 1u<<2u,
};
typedef struct MenuGameplayEntry
{
char name[64];
uint8_t flags;
bool isValid() const { return name[0] != '\0'; }
} MenuGameplayEntry;
typedef struct MenuGameplayStemEntry
{
MenuGameplayEntry entry;
MenuGameplayEntry subentries[MAXMENUGAMEPLAYENTRIES];
} MenuGameplayStemEntry;
extern MenuGameplayStemEntry g_MenuGameplayEntries[MAXMENUGAMEPLAYENTRIES];
extern MenuEntry_t ME_NEWGAMECUSTOMENTRIES[MAXMENUGAMEPLAYENTRIES];
extern MenuEntry_t ME_NEWGAMECUSTOMSUBENTRIES[MAXMENUGAMEPLAYENTRIES][MAXMENUGAMEPLAYENTRIES];
END_BLD_NS
#endif

View file

@ -36,11 +36,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "globals.h"
#include "levels.h"
#include "loadsave.h"
#include "menu.h"
#include "gamemenu.h"
#include "messages.h"
#include "network.h"
#include "player.h"
#include "view.h"
#include "gstrings.h"
BEGIN_BLD_NS
@ -53,32 +54,22 @@ void sub_5A928(void)
buttonMap.ClearButton(i);
}
void sub_5A944(int key)
{
auto binding = Bindings.GetBind(key);
if (binding)
{
auto index = buttonMap.FindButtonIndex(binding);
if (index >= 0) buttonMap.ClearButton(index);
}
}
void SetGodMode(bool god)
{
playerSetGodMode(gMe, god);
if (gMe->godMode)
viewSetMessage("You are immortal.");
viewSetMessage(GStrings("TXTB_GODMODE"));
else
viewSetMessage("You are mortal.");
viewSetMessage(GStrings("TXTB_NOTGODMODE"));
}
void SetClipMode(bool noclip)
{
gNoClip = noclip;
if (gNoClip)
viewSetMessage("Unclipped movement.");
viewSetMessage(GStrings("TXTB_NOCLIP"));
else
viewSetMessage("Normal movement.");
viewSetMessage(GStrings("TXTB_NOCLIPOFF"));
}
void packStuff(PLAYER *pPlayer)
@ -103,13 +94,13 @@ void SetAmmo(bool stat)
{
for (int i = 0; i < 12; i++)
gMe->ammoCount[i] = gAmmoInfo[i].max;
viewSetMessage("You have full ammo.");
viewSetMessage(GStrings("TXTB_FULLAMMO"));
}
else
{
for (int i = 0; i < 12; i++)
gMe->ammoCount[i] = 0;
viewSetMessage("You have no ammo.");
viewSetMessage(GStrings("TXTB_NOAMMO"));
}
}
@ -121,7 +112,7 @@ void SetWeapons(bool stat)
}
SetAmmo(stat);
if (stat)
viewSetMessage("You have all weapons.");
viewSetMessage(GStrings("TXTB_ALLWEAP"));
else
{
if (!VanillaMode())
@ -131,7 +122,7 @@ void SetWeapons(bool stat)
gMe->curWeapon = 0;
gMe->nextWeapon = 1;
}
viewSetMessage("You have no weapons.");
viewSetMessage(GStrings("TXTB_NOWEAP"));
}
}
@ -140,12 +131,12 @@ void SetToys(bool stat)
if (stat)
{
packStuff(gMe);
viewSetMessage("Your inventory is full.");
viewSetMessage(GStrings("TXTB_FULLINV"));
}
else
{
packClear(gMe);
viewSetMessage("Your inventory is empty.");
viewSetMessage(GStrings("TXTB_NOINV"));
}
}
@ -154,12 +145,12 @@ void SetArmor(bool stat)
int nAmount;
if (stat)
{
viewSetMessage("You have full armor.");
viewSetMessage(GStrings("TXTB_FULLARM"));
nAmount = 3200;
}
else
{
viewSetMessage("You have no armor.");
viewSetMessage(GStrings("TXTB_NOARM"));
nAmount = 0;
}
for (int i = 0; i < 3; i++)
@ -171,27 +162,27 @@ void SetKeys(bool stat)
for (int i = 1; i <= 6; i++)
gMe->hasKey[i] = stat;
if (stat)
viewSetMessage("You have all keys.");
viewSetMessage(GStrings("TXTB_ALLKEYS"));
else
viewSetMessage("You have no keys.");
viewSetMessage(GStrings("TXTB_NOKEYS"));
}
void SetInfiniteAmmo(bool stat)
{
gInfiniteAmmo = stat;
if (gInfiniteAmmo)
viewSetMessage("You have infinite ammo.");
viewSetMessage(GStrings("TXTB_INFAMMO"));
else
viewSetMessage("You have limited ammo.");
viewSetMessage(GStrings("TXTB_LIMAMMO"));
}
void SetMap(bool stat)
{
gFullMap = stat;
if (gFullMap)
viewSetMessage("You have the map.");
viewSetMessage(GStrings("TXTB_ALLMAP"));
else
viewSetMessage("You have no map.");
viewSetMessage(GStrings("TXTB_NOALLMAP"));
}
void SetWooMode(bool stat)
@ -221,7 +212,7 @@ void ToggleBoots(void)
{
if (powerupCheck(gMe, kPwUpJumpBoots))
{
viewSetMessage("You have no Jumping Boots.");
viewSetMessage(GStrings("TXTB_NOJBOOTS"));
if (!VanillaMode())
{
gMe->pwUpTime[kPwUpJumpBoots] = 0;
@ -231,7 +222,7 @@ void ToggleBoots(void)
}
else
{
viewSetMessage("You have the Jumping Boots.");
viewSetMessage(GStrings("TXTB_JBOOTS"));
if (!VanillaMode())
gMe->pwUpTime[kPwUpJumpBoots] = gPowerUpInfo[kPwUpJumpBoots].bonusTime;
powerupActivate(gMe, kPwUpJumpBoots);
@ -242,14 +233,14 @@ void ToggleInvisibility(void)
{
if (powerupCheck(gMe, kPwUpShadowCloak))
{
viewSetMessage("You are visible.");
viewSetMessage(GStrings("TXTB_VISIBLE"));
if (!VanillaMode())
gMe->pwUpTime[kPwUpShadowCloak] = 0;
powerupDeactivate(gMe, kPwUpShadowCloak);
}
else
{
viewSetMessage("You are invisible.");
viewSetMessage(GStrings("TXTB_INVISIBLE"));
powerupActivate(gMe, kPwUpShadowCloak);
}
}
@ -258,14 +249,14 @@ void ToggleInvulnerability(void)
{
if (powerupCheck(gMe, kPwUpDeathMask))
{
viewSetMessage("You are vulnerable.");
viewSetMessage(GStrings("TXTB_VULN"));
if (!VanillaMode())
gMe->pwUpTime[kPwUpDeathMask] = 0;
powerupDeactivate(gMe, kPwUpDeathMask);
}
else
{
viewSetMessage("You are invulnerable.");
viewSetMessage(GStrings("TXTB_INVULN"));
powerupActivate(gMe, kPwUpDeathMask);
}
}
@ -274,14 +265,14 @@ void ToggleDelirium(void)
{
if (powerupCheck(gMe, kPwUpDeliriumShroom))
{
viewSetMessage("You are not delirious.");
viewSetMessage(GStrings("TXTB_NODELIR"));
if (!VanillaMode())
gMe->pwUpTime[kPwUpDeliriumShroom] = 0;
powerupDeactivate(gMe, kPwUpDeliriumShroom);
}
else
{
viewSetMessage("You are delirious.");
viewSetMessage(GStrings("TXTB_DELIR"));
powerupActivate(gMe, kPwUpDeliriumShroom);
}
}
@ -335,7 +326,7 @@ void CGameMessageMgr::SetState(char state)
void CGameMessageMgr::Add(const char *pText, char a2, const int pal, const MESSAGE_PRIORITY priority)
{
if (a2 && messageFlags)
if (a2 && messageFlags && hud_messages == 1) // add only if messages are enabled and in native format
{
messageStruct *pMessage = &messages[nextMessagesIndex];
strncpy(pMessage->text, pText, kMaxMessageTextLength-1);
@ -383,7 +374,7 @@ void CGameMessageMgr::Display(void)
if (gViewMode == 3)
{
int height;
gMenuTextMgr.GetFontInfo(nFont, pMessage->text, &height, NULL);
viewGetFontInfo(nFont, pMessage->text, &height, NULL);
if (x+height > gViewX1S)
viewUpdatePages();
}
@ -428,7 +419,7 @@ void CGameMessageMgr::Display(void)
if (gViewMode == 3)
{
int height;
gMenuTextMgr.GetFontInfo(nFont, pMessage->text, &height, NULL);
viewGetFontInfo(nFont, pMessage->text, &height, NULL);
if (x+height > gViewX1S)
viewUpdatePages();
}
@ -590,58 +581,6 @@ void CPlayerMsg::Send(void)
void CPlayerMsg::ProcessKeys(void)
{
if (inputState.GetKeyStatus(sc_Escape)) Term();
#if 0
int key = inputState.keyGetScan();
int ch;
if (key != 0)
{
bool ctrl = (inputState.CtrlPressed());
bool shift = (inputState.ShiftPressed());
switch (key)
{
case sc_Escape:
Term();
break;
case sc_F1:
case sc_F2:
case sc_F3:
case sc_F4:
case sc_F5:
case sc_F6:
case sc_F7:
case sc_F8:
case sc_F9:
case sc_F10:
buttonMap.ClearButton(gamefunc_See_Chase_View);
Set(*CombatMacros[key-sc_F1]);
Send();
inputState.ClearKeyStatus(key);
break;
case sc_BackSpace:
if (ctrl)
Clear();
else
DelChar();
break;
case sc_Enter:
case sc_kpad_Enter:
if (gCheatMgr.Check(text))
Term();
else
Send();
break;
default:
if (key < 128)
{
ch = shift ? g_keyAsciiTableShift[key] : g_keyAsciiTable[key];
if (ch)
AddChar(ch);
}
break;
}
sub_5A944(key);
}
#endif
}
bool CPlayerMsg::IsWhitespaceOnly(const char * const pzString)
@ -781,19 +720,19 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs)
break;
case kCheatKevorkian:
actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_2, 8000);
viewSetMessage("Kevorkian approves.");
viewSetMessage(GStrings("TXTB_KEVORKIAN"));
break;
case kCheatMcGee:
{
if (!gMe->pXSprite->burnTime)
evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick);
actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400);
viewSetMessage("You're fired!");
viewSetMessage(GStrings("TXTB_FIRED"));
break;
}
case kCheatEdmark:
actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_3, 8000);
viewSetMessage("Ahhh...those were the days.");
viewSetMessage(GStrings("TXTB_THEDAYS"));
break;
case kCheatKrueger:
{
@ -802,7 +741,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs)
if (!gMe->pXSprite->burnTime)
evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick);
actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400);
viewSetMessage("Flame retardant!");
viewSetMessage(GStrings("TXTB_RETARD"));
break;
}
case kCheatSterno:
@ -820,7 +759,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs)
case kCheatClarice:
if (!VanillaMode())
{
viewSetMessage("You have half armor.");
viewSetMessage(GStrings("TXTB_HALFARMOR"));
for (int i = 0; i < 3; i++)
gMe->armor[i] = 1600;
}

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "controls.h"
#include "globals.h"
#include "network.h"
#include "menu.h"
#include "gamemenu.h"
#include "player.h"
#include "seq.h"
#include "sound.h"
@ -542,7 +542,7 @@ void netGetPackets(void)
gStartNewGame = 1;
break;
case 255:
inputState.SetKeyStatus(sc_Escape, 1);
inputState.SetKeyStatus(sc_Escape);
break;
}
}
@ -1007,11 +1007,13 @@ void netInitialize(bool bConsole)
while (numplayers < gNetPlayers)
{
handleevents();
#if 0
if (quitevent)
{
netServerDisconnect();
QuitGame();
}
#endif
if (!bConsole && inputState.GetKeyStatus(sc_Escape))
{
netServerDisconnect();
@ -1168,11 +1170,13 @@ void netInitialize(bool bConsole)
while (bWaitServer)
{
handleevents();
#if 0
if (quitevent)
{
netClientDisconnect();
QuitGame();
}
#endif
if (!bConsole && inputState.GetKeyStatus(sc_Escape))
{
netClientDisconnect();

View file

@ -47,53 +47,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
static int osdcmd_changelevel(osdcmdptr_t parm)
{
int32_t volume,level;
char *p;
if (parm->numparms != 2) return OSDCMD_SHOWHELP;
volume = strtol(parm->parms[0], &p, 10) - 1;
if (p[0]) return OSDCMD_SHOWHELP;
level = strtol(parm->parms[1], &p, 10) - 1;
if (p[0]) return OSDCMD_SHOWHELP;
if (volume < 0) return OSDCMD_SHOWHELP;
if (level < 0) return OSDCMD_SHOWHELP;
if (volume >= 6)
{
OSD_Printf("changelevel: invalid volume number (range 1-%d)\n",6);
return OSDCMD_OK;
}
if (level >= gEpisodeInfo[volume].nLevels)
{
OSD_Printf("changelevel: invalid level number\n");
return OSDCMD_SHOWHELP;
}
if (gDemo.at1)
gDemo.StopPlayback();
if (numplayers > 1)
{
gPacketStartGame.episodeId = volume;
gPacketStartGame.levelId = level;
netBroadcastNewGame();
gStartNewGame = 1;
gGameMenuMgr.Deactivate();
return OSDCMD_OK;
}
levelSetupOptions(volume, level);
StartLevel(&gGameOptions);
viewResizeView(gViewSize);
gGameMenuMgr.Deactivate();
return OSDCMD_OK;
}
static int osdcmd_map(osdcmdptr_t parm)
{
char filename[BMAX_PATH];
@ -118,13 +71,11 @@ static int osdcmd_map(osdcmdptr_t parm)
gPacketStartGame.levelId = gGameOptions.nLevel;
netBroadcastNewGame();
gStartNewGame = 1;
gGameMenuMgr.Deactivate();
return OSDCMD_OK;
}
levelSetupOptions(gGameOptions.nEpisode, gGameOptions.nLevel);
StartLevel(&gGameOptions);
viewResizeView(gViewSize);
gGameMenuMgr.Deactivate();
return OSDCMD_OK;
}
@ -153,43 +104,6 @@ static int osdcmd_demo(osdcmdptr_t parm)
return OSDCMD_OK;
}
static int osdcmd_music(osdcmdptr_t parm)
{
char buffer[128];
if (parm->numparms == 1)
{
int32_t sel = levelGetMusicIdx(parm->parms[0]);
if (sel == -1)
return OSDCMD_SHOWHELP;
if (sel == -2)
{
OSD_Printf("%s is not a valid episode/level number pair\n", parm->parms[0]);
return OSDCMD_OK;
}
int nEpisode = sel/kMaxLevels;
int nLevel = sel%kMaxLevels;
if (!levelTryPlayMusic(nEpisode, nLevel))
{
if (mus_redbook)
snprintf(buffer, sizeof(buffer), "Playing %i track", gEpisodeInfo[nEpisode].at28[nLevel].ate0);
else
snprintf(buffer, sizeof(buffer), "Playing %s", gEpisodeInfo[nEpisode].at28[nLevel].atd0);
viewSetMessage(buffer);
}
else
{
OSD_Printf("No music defined for %s\n", parm->parms[0]);
}
return OSDCMD_OK;
}
return OSDCMD_SHOWHELP;
}
static int osdcmd_vidmode(osdcmdptr_t parm)
{
@ -367,112 +281,22 @@ static int osdcmd_restartsound(osdcmdptr_t UNUSED(parm))
sndInit();
sfxInit();
if (MusicEnabled() && (gGameStarted || gDemo.at1))
sndPlaySong(nullptr, "*", true);
return OSDCMD_OK;
}
void onvideomodechange(int32_t newmode)
{
UNREFERENCED_PARAMETER(newmode);
#if 0
uint8_t palid;
// XXX?
if (!newmode || g_player[screenpeek].ps->palette < BASEPALCOUNT)
palid = g_player[screenpeek].ps->palette;
else
palid = BASEPAL;
#ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER)
{
int32_t i = 0;
while (i < MAXSPRITES)
{
if (actor[i].lightptr)
{
polymer_deletelight(actor[i].lightId);
actor[i].lightptr = NULL;
actor[i].lightId = -1;
}
i++;
}
}
#endif
videoSetPalette(0, palid, 0);
g_restorePalette = -1;
#endif
if (newmode)
scrResetPalette();
UpdateDacs(gLastPal, false);
}
static int osdcmd_quicksave(osdcmdptr_t UNUSED(parm))
{
UNREFERENCED_CONST_PARAMETER(parm);
if (!gGameStarted || gDemo.at1 || gGameMenuMgr.m_bActive)
OSD_Printf("quicksave: not in a game.\n");
else gDoQuickSave = 1;
return OSDCMD_OK;
}
static int osdcmd_quickload(osdcmdptr_t UNUSED(parm))
{
UNREFERENCED_CONST_PARAMETER(parm);
if (!gGameStarted || gDemo.at1 || gGameMenuMgr.m_bActive)
OSD_Printf("quickload: not in a game.\n");
else gDoQuickSave = 2;
return OSDCMD_OK;
}
static int osdcmd_screenshot(osdcmdptr_t parm)
{
videoCaptureScreen();
return OSDCMD_OK;
}
#if 0
static int osdcmd_savestate(osdcmdptr_t UNUSED(parm))
{
UNREFERENCED_PARAMETER(parm);
G_SaveMapState();
return OSDCMD_OK;
}
static int osdcmd_restorestate(osdcmdptr_t UNUSED(parm))
{
UNREFERENCED_PARAMETER(parm);
G_RestoreMapState();
return OSDCMD_OK;
}
#endif
#if 0
#ifdef DEBUGGINGAIDS
static int osdcmd_inittimer(osdcmdptr_t parm)
{
if (parm->numparms != 1)
{
OSD_Printf("%dHz timer\n",g_timerTicsPerSecond);
return OSDCMD_SHOWHELP;
}
G_InitTimer(Batol(parm->parms[0]));
OSD_Printf("%s\n",parm->raw);
return OSDCMD_OK;
}
#endif
#endif
int32_t registerosdcommands(void)
{
OSD_RegisterFunction("changelevel","changelevel <volume> <level>: warps to the given level", osdcmd_changelevel);
OSD_RegisterFunction("map","map <mapfile>: loads the given user map", osdcmd_map);
OSD_RegisterFunction("demo","demo <demofile or demonum>: starts the given demo", osdcmd_demo);
OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor);
@ -480,12 +304,8 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god);
OSD_RegisterFunction("music","music E<ep>L<lev>: change music", osdcmd_music);
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);
OSD_RegisterFunction("quicksave","quicksave: performs a quick save", osdcmd_quicksave);
OSD_RegisterFunction("quickload","quickload: performs a quick load", osdcmd_quickload);
OSD_RegisterFunction("restartsound","restartsound: reinitializes the sound system",osdcmd_restartsound);
OSD_RegisterFunction("screenshot","screenshot [format]: takes a screenshot.", osdcmd_screenshot);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: change the video mode",osdcmd_vidmode);

View file

@ -53,6 +53,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "weapon.h"
#include "common_game.h"
#include "messages.h"
#include "gstrings.h"
BEGIN_BLD_NS
@ -1468,7 +1469,7 @@ char PickupWeapon(PLAYER *pPlayer, spritetype *pWeapon) {
void PickUp(PLAYER *pPlayer, spritetype *pSprite)
{
char buffer[80];
const char *msg = nullptr;
int nType = pSprite->type;
char pickedUp = 0;
int customMsg = -1;
@ -1481,15 +1482,15 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite)
if (nType >= kItemBase && nType <= kItemMax) {
pickedUp = PickupItem(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gItemText[nType - kItemBase]);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_ITEM%02d", int(nType - kItemBase +1)));
} else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) {
pickedUp = PickupAmmo(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gAmmoText[nType - kItemAmmoBase]);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_AMMO%02d", int(nType - kItemAmmoBase +1)));
} else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) {
pickedUp = PickupWeapon(pPlayer, pSprite);
if (pickedUp && customMsg == -1) sprintf(buffer, "Picked up %s", gWeaponText[nType - kItemWeaponBase]);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_WPN%02d", int(nType - kItemWeaponBase +1)));
}
if (!pickedUp) return;
@ -1505,7 +1506,7 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite)
pPlayer->pickupEffect = 30;
if (pPlayer == gMe) {
if (customMsg > 0) trTextOver(customMsg - 1);
else viewSetMessage(buffer, 0, MESSAGE_PRIORITY_PICKUP);
else if (msg) viewSetMessage(msg, 0, MESSAGE_PRIORITY_PICKUP);
}
}
@ -1798,14 +1799,14 @@ void ProcessInput(PLAYER *pPlayer)
int key = pXSector->Key;
if (pXSector->locked && pPlayer == gMe)
{
viewSetMessage("It's locked");
viewSetMessage(GStrings("TXTB_LOCKED"));
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->hasKey[key])
trTriggerSector(a2, pXSector, kCmdSpritePush, nSprite);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
viewSetMessage(GStrings("TXTB_KEY"));
sndStartSample(3063, 255, 2, 0);
}
}
@ -1816,14 +1817,14 @@ void ProcessInput(PLAYER *pPlayer)
int key = pXWall->key;
if (pXWall->locked && pPlayer == gMe)
{
viewSetMessage("It's locked");
viewSetMessage(GStrings("TXTB_LOCKED"));
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->hasKey[key])
trTriggerWall(a2, pXWall, kCmdWallPush, pPlayer->nSprite);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
viewSetMessage(GStrings("TXTB_KEY"));
sndStartSample(3063, 255, 2, 0);
}
break;
@ -1838,7 +1839,7 @@ void ProcessInput(PLAYER *pPlayer)
trTriggerSprite(a2, pXSprite, kCmdSpritePush, pPlayer->nSprite);
else if (pPlayer == gMe)
{
viewSetMessage("That requires a key.");
viewSetMessage(GStrings("TXTB_KEY"));
sndStartSample(3063, 255, 2, 0);
}
break;
@ -2157,7 +2158,7 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
int nSound = gSuicide[nMessage].at4;
if (pVictim == gMe && gMe->handTime <= 0)
{
sprintf(buffer, "You killed yourself!");
sprintf(buffer, GStrings("TXTB_KILLSELF"));
if (gGameOptions.nGameType > 0 && nSound >= 0)
sndStartSample(nSound, 255, 2, 0);
}
@ -2487,7 +2488,7 @@ void PlayerSurvive(int, int nXSprite)
{
PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
if (pPlayer == gMe)
viewSetMessage("I LIVE...AGAIN!!");
viewSetMessage(GStrings("TXT_LIVEAGAIM"));
else
{
sprintf(buffer, "%s lives again!", gProfile[pPlayer->nPlayer].name);

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "blood.h"
#include "common_game.h"
#include "screentext.h"
#include "menus.h"
BEGIN_BLD_NS
@ -832,282 +831,6 @@ vec2_t G_ScreenTextShadow(int32_t sx, int32_t sy,
return size;
}
#if 0
void G_PrintGameText(int32_t tile, int32_t x, int32_t y, const char *t,
int32_t s, int32_t p, int32_t o,
int32_t x1, int32_t y1, int32_t x2, int32_t y2,
int32_t z, int32_t a)
{
int32_t f = TEXT_GAMETEXTNUMHACK;
if (t == NULL)
return;
if (!(o & ROTATESPRITE_FULL16))
{
x <<= 16;
y <<= 16;
}
if (x == (160<<16))
f |= TEXT_XCENTER;
G_ScreenText(tile, x, y, z, 0, 0, t, s, p, 2|o|ROTATESPRITE_FULL16, a, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, x1, y1, x2, y2);
}
vec2_t gametext_(int32_t x, int32_t y, const char *t, int32_t s, int32_t p, int32_t o, int32_t a, int32_t f)
{
return G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, s, p, o|2|8|16|ROTATESPRITE_FULL16, a, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1);
}
void gametext_simple(int32_t x, int32_t y, const char *t)
{
G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, 0, MF_Bluefont.pal, 2|8|16|ROTATESPRITE_FULL16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags, 0, 0, xdim-1, ydim-1);
}
vec2_t mpgametext(int32_t x, int32_t y, const char *t, int32_t s, int32_t o, int32_t a, int32_t f)
{
return G_ScreenText(MF_Bluefont.tilenum, x, y, textsc(MF_Bluefont.zoom), 0, 0, t, s, MF_Bluefont.pal, o|2|8|16|ROTATESPRITE_FULL16, a, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1);
}
vec2_t mpgametextsize(const char *t, int32_t f)
{
return G_ScreenTextSize(MF_Bluefont.tilenum, 0, 0, textsc(MF_Bluefont.zoom), 0, t, 2|8|16|ROTATESPRITE_FULL16, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1);
}
// minitext_yofs: in hud_scale-independent, (<<16)-scaled, 0-200-normalized y coords,
// (sb&ROTATESPRITE_MAX) only.
int32_t minitext_yofs = 0;
int32_t minitext_lowercase = 0;
int32_t minitext_(int32_t x, int32_t y, const char *t, int32_t s, int32_t p, int32_t sb)
{
vec2_t dim;
int32_t z = MF_Minifont.zoom;
if (t == NULL)
{
OSD_Printf("minitext: NULL text!\n");
return 0;
}
if (!(sb & ROTATESPRITE_FULL16))
{
x<<=16;
y<<=16;
}
if (sb & ROTATESPRITE_MAX)
{
x = sbarx16(x);
y = minitext_yofs+sbary16(y);
z = sbarsc(z);
}
sb &= (ROTATESPRITE_MAX-1)|RS_CENTERORIGIN;
dim = G_ScreenText(MF_Minifont.tilenum, x, y, z, 0, 0, t, s, p, sb|ROTATESPRITE_FULL16, 0, MF_Minifont.emptychar.x, MF_Minifont.emptychar.y, MF_Minifont.between.x, MF_Minifont.between.y, MF_Minifont.textflags, 0, 0, xdim-1, ydim-1);
x += dim.x;
if (!(sb & ROTATESPRITE_FULL16))
x >>= 16;
return x;
}
void menutext_(int32_t x, int32_t y, int32_t s, char const *t, int32_t o, int32_t f)
{
G_ScreenText(MF_Redfont.tilenum, x, y - (12<<16), MF_Redfont.zoom, 0, 0, t, s, MF_Redfont.pal, o|ROTATESPRITE_FULL16, 0, MF_Redfont.emptychar.x, MF_Redfont.emptychar.y, MF_Redfont.between.x, MF_Redfont.between.y, f|MF_Redfont.textflags|TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1);
}
void captionmenutext(int32_t x, int32_t y, char const *t)
{
G_ScreenText(MF_Redfont.tilenum, x, y - (12<<16), MF_Redfont.zoom, 0, 0, t, 0, ud.menutitle_pal, 2|8|16|ROTATESPRITE_FULL16, 0, MF_Redfont.emptychar.x, MF_Redfont.emptychar.y, MF_Redfont.between.x, MF_Redfont.between.y, MF_Redfont.textflags|TEXT_LITERALESCAPE|TEXT_XCENTER|TEXT_YCENTER, 0, 0, xdim-1, ydim-1);
}
int32_t user_quote_time[MAXUSERQUOTES];
static char user_quote[MAXUSERQUOTES][178];
void G_AddUserQuote(const char *daquote)
{
int32_t i;
for (i=MAXUSERQUOTES-1; i>0; i--)
{
Bstrcpy(user_quote[i], user_quote[i-1]);
user_quote_time[i] = user_quote_time[i-1];
}
Bstrcpy(user_quote[0], daquote);
OSD_Printf("%s\n", daquote);
user_quote_time[0] = hud_messagetime;
pub = NUMPAGES;
}
int32_t textsc(int32_t sc)
{
return scale(sc, hud_textscale, 400);
}
#define FTAOPAQUETIME 30
// alpha increments of 8 --> 256 / 8 = 32 --> round up to power of 2 --> 32 --> divide by 2 --> 16 alphatabs required
static inline int32_t textsh(uint32_t t)
{
return (hud_glowingquotes && ((videoGetRenderMode() == REND_CLASSIC && numalphatabs < 15) || t >= FTAOPAQUETIME))
? sintable[(t << 7) & 2047] >> 11
: (sintable[(FTAOPAQUETIME << 7) & 2047] >> 11);
}
// orientation flags depending on time that a quote has still to be displayed
static inline int32_t texto(int32_t t)
{
if (videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15 || t > 4)
return 0;
if (t > 2)
return 1;
return 1|32;
}
static inline int32_t texta(int32_t t)
{
if (videoGetRenderMode() == REND_CLASSIC && numalphatabs < 15)
return 0;
return 255 - clamp(t<<3, 0, 255);
}
static FORCE_INLINE int32_t text_ypos(void)
{
if (hud_position == 1 && ud.screen_size == 4 && ud.althud == 1)
return 32<<16;
#ifdef GEKKO
return 16<<16;
#elif defined EDUKE32_TOUCH_DEVICES
return 24<<16;
#else
return 1<<16;
#endif
}
// this handles both multiplayer and item pickup message type text
// both are passed on to gametext
void G_PrintGameQuotes(int32_t snum)
{
auto const ps = g_player[snum].ps;
const int32_t reserved_quote = (ps->ftq >= QUOTE_RESERVED && ps->ftq <= QUOTE_RESERVED3);
// NOTE: QUOTE_RESERVED4 is not included.
int32_t const ybase = (fragbarheight()<<16) + text_ypos();
int32_t height = 0;
int32_t k = ps->fta;
// primary quote
do
{
if (k <= 1)
break;
if (EDUKE32_PREDICT_FALSE(apStrings[ps->ftq] == NULL))
{
OSD_Printf(OSD_ERROR "%s %d null quote %d\n", "screentext:", __LINE__, ps->ftq);
break;
}
int32_t y = ybase;
if (reserved_quote)
{
#ifdef SPLITSCREEN_MOD_HACKS
if (!g_fakeMultiMode)
y = 140<<16;
else
y = 70<<16;
#else
y = 140<<16;
#endif
}
int32_t pal = 0;
int32_t x = 160<<16;
#ifdef SPLITSCREEN_MOD_HACKS
if (g_fakeMultiMode)
{
pal = g_player[snum].pcolor;
const int32_t sidebyside = ud.screen_size != 0;
if (sidebyside)
x = snum == 1 ? 240<<16 : 80<<16;
else if (snum == 1)
y += 100<<16;
}
#endif
height = gametext_(x, y, apStrings[ps->ftq], textsh(k), pal, texto(k), texta(k), TEXT_XCENTER).y + (1<<16);
}
while (0);
// userquotes
int32_t y = ybase;
if (k > 1 && !reserved_quote)
y += k <= 8 ? (height * (k-1))>>3 : height;
for (int i = 0; i < MAXUSERQUOTES; i++)
{
k = user_quote_time[i];
if (k <= 0)
continue;
// int32_t const sh = hud_glowingquotes ? sintable[((totalclock+(i<<2))<<5)&2047]>>11 : 0;
height = mpgametext(mpgametext_x, y, user_quote[i], textsh(k), texto(k), texta(k), TEXT_LINEWRAP).y + textsc(1<<16);
y += k <= 4 ? (height * (k-1))>>2 : height;
}
}
void P_DoQuote(int32_t q, DukePlayer_t *p)
{
int32_t cq = 0;
if (hud_messages == 0 || q < 0 || !(p->gm & MODE_GAME))
return;
if (q & MAXQUOTES)
{
cq = 1;
q &= ~MAXQUOTES;
}
if (EDUKE32_PREDICT_FALSE(apStrings[q] == NULL))
{
OSD_Printf(OSD_ERROR "%s %d null quote %d\n", "screentext:", __LINE__, q);
return;
}
if (p->fta > 0 && q != QUOTE_RESERVED && q != QUOTE_RESERVED2)
if (p->ftq == QUOTE_RESERVED || p->ftq == QUOTE_RESERVED2) return;
p->fta = 100;
if (p->ftq != q)
{
if (p == g_player[screenpeek].ps && apStrings[q][0] != '\0')
OSD_Printf(cq ? OSDTEXT_DEFAULT "%s\n" : "%s\n", apStrings[q]);
p->ftq = q;
}
pub = NUMPAGES;
pus = NUMPAGES;
}
#endif
END_BLD_NS

View file

@ -22,8 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include "menus.h"
BEGIN_BLD_NS
#define USERQUOTE_LEFTOFFSET 5

View file

@ -75,178 +75,6 @@ SAMPLE2D * FindChannel(void)
return NULL;
}
#if 0
DICTNODE *hSong;
char *pSongPtr;
int nSongSize;
bool bWaveMusic;
int nWaveMusicHandle;
int sndPlaySong(const char *, const char* songName, bool bLoop)
{
if (!MusicEnabled())
return 0;
if (!songName || strlen(songName) == 0)
return 1;
auto fp = S_OpenAudio(songName, 0, 1);
if (!fp.isOpen())
{
hSong = gSoundRes.Lookup(songName, "MID");
if (!hSong)
{
OSD_Printf(OSD_ERROR "sndPlaySong(): error: can't open \"%s\" for playback!\n", songName);
return 2;
}
int nNewSongSize = hSong->Size();
char *pNewSongPtr = (char *)Xaligned_alloc(16, nNewSongSize);
memcpy(pNewSongPtr, hSong->Lock(), nNewSongSize);
hSong->Unlock(true);
MUSIC_SetVolume(mus_volume);
int32_t retval = MUSIC_PlaySong(pNewSongPtr, nNewSongSize, bLoop);
if (retval != MUSIC_Ok)
{
ALIGNED_FREE_AND_NULL(pNewSongPtr);
return 5;
}
if (bWaveMusic && nWaveMusicHandle >= 0)
{
FX_StopSound(nWaveMusicHandle);
nWaveMusicHandle = -1;
}
bWaveMusic = false;
ALIGNED_FREE_AND_NULL(pSongPtr);
pSongPtr = pNewSongPtr;
nSongSize = nNewSongSize;
return 0;
}
int32_t nSongLen = fp.Tell();
if (EDUKE32_PREDICT_FALSE(nSongLen < 4))
{
OSD_Printf(OSD_ERROR "sndPlaySong(): error: empty music file \"%s\"\n", songName);
return 3;
}
char * pNewSongPtr = (char *)Xaligned_alloc(16, nSongLen);
int nNewSongSize = fp.Read(pNewSongPtr, nSongLen);
if (EDUKE32_PREDICT_FALSE(nNewSongSize != nSongLen))
{
OSD_Printf(OSD_ERROR "sndPlaySong(): error: read %d bytes from \"%s\", expected %d\n",
nNewSongSize, songName, nSongLen);
ALIGNED_FREE_AND_NULL(pNewSongPtr);
return 4;
}
if (!Bmemcmp(pNewSongPtr, "MThd", 4))
{
int32_t retval = MUSIC_PlaySong(pNewSongPtr, nNewSongSize, bLoop);
if (retval != MUSIC_Ok)
{
ALIGNED_FREE_AND_NULL(pNewSongPtr);
return 5;
}
if (bWaveMusic && nWaveMusicHandle >= 0)
{
FX_StopSound(nWaveMusicHandle);
nWaveMusicHandle = -1;
}
bWaveMusic = false;
ALIGNED_FREE_AND_NULL(pSongPtr);
pSongPtr = pNewSongPtr;
nSongSize = nNewSongSize;
}
else
{
int nNewWaveMusicHandle = FX_Play(pNewSongPtr, bLoop ? nNewSongSize : -1, 0, 0, 0, mus_volume, mus_volume, mus_volume,
FX_MUSIC_PRIORITY, 1.f, (intptr_t)&nWaveMusicHandle);
if (nNewWaveMusicHandle <= FX_Ok)
{
ALIGNED_FREE_AND_NULL(pNewSongPtr);
return 5;
}
if (bWaveMusic && nWaveMusicHandle >= 0)
FX_StopSound(nWaveMusicHandle);
MUSIC_StopSong();
nWaveMusicHandle = nNewWaveMusicHandle;
bWaveMusic = true;
ALIGNED_FREE_AND_NULL(pSongPtr);
pSongPtr = pNewSongPtr;
nSongSize = nNewSongSize;
}
return 0;
}
bool sndIsSongPlaying(void)
{
//return MUSIC_SongPlaying();
return false;
}
void sndFadeSong(int nTime)
{
UNREFERENCED_PARAMETER(nTime);
if (bWaveMusic && nWaveMusicHandle >= 0)
{
FX_StopSound(nWaveMusicHandle);
nWaveMusicHandle = -1;
bWaveMusic = false;
}
// MUSIC_SetVolume(0);
MUSIC_StopSong();
}
void sndStopSong(void)
{
if (bWaveMusic && nWaveMusicHandle >= 0)
{
FX_StopSound(nWaveMusicHandle);
nWaveMusicHandle = -1;
bWaveMusic = false;
}
MUSIC_StopSong();
ALIGNED_FREE_AND_NULL(pSongPtr);
nSongSize = 0;
}
#else
int sndPlaySong(const char *mapname, const char* songName, bool bLoop)
{
return Mus_Play(mapname, songName, bLoop);
}
bool sndIsSongPlaying(void)
{
// Not used
return false;
}
void sndFadeSong(int nTime)
{
// not implemented
}
void sndStopSong(void)
{
Mus_Stop();
}
#endif
void sndSetFXVolume(int nVolume)
{
snd_fxvolume = nVolume;
@ -367,7 +195,7 @@ void sndStartWavDisk(const char *pzFile, int nVolume, int nChannel)
pChannel = &Channel[nChannel];
if (pChannel->at0 > 0)
sndKillSound(pChannel);
auto hFile = kopenFileReader(pzFile, 0);
auto hFile = fileSystem.OpenFileReader(pzFile, 0);
if (!hFile.isOpen())
return;
int nLength = hFile.GetLength();
@ -450,34 +278,6 @@ void DeinitSoundDevice(void)
ThrowError(FX_ErrorString(nStatus));
}
#if 0
void InitMusicDevice(void)
{
int nStatus;
if ((nStatus = MUSIC_Init(MusicDevice)) == MUSIC_Ok)
{
if (MusicDevice == ASS_AutoDetect)
MusicDevice = MIDI_GetDevice();
}
else if ((nStatus = MUSIC_Init(ASS_AutoDetect)) == MUSIC_Ok)
{
initprintf("InitMusicDevice: %s\n", MUSIC_ErrorString(nStatus));
return;
}
DICTNODE *hTmb = gSoundRes.Lookup("GMTIMBRE", "TMB");
if (hTmb)
AL_RegisterTimbreBank((unsigned char*)gSoundRes.Load(hTmb));
MUSIC_SetVolume(mus_volume);
}
void DeinitMusicDevice(void)
{
FX_StopAllSounds();
int nStatus = MUSIC_Shutdown();
if (nStatus != 0)
ThrowError(MUSIC_ErrorString(nStatus));
}
#endif
bool sndActive = false;
@ -486,7 +286,7 @@ void sndTerm(void)
if (!sndActive)
return;
sndActive = false;
sndStopSong();
Mus_Stop();
DeinitSoundDevice();
//DeinitMusicDevice();
}

View file

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include "resource.h"
#include "z_music.h"
BEGIN_BLD_NS
@ -44,12 +45,7 @@ struct SFX
};
int sndGetRate(int format);
int sndPlaySong(const char *mapname, const char *songName, bool bLoop);
bool sndIsSongPlaying(void);
void sndFadeSong(int nTime);
void sndSetMusicVolume(int nVolume);
void sndSetFXVolume(int nVolume);
void sndStopSong(void);
void sndStartSample(const char *pzSound, int nVolume, int nChannel = -1);
void sndStartSample(unsigned int nSound, int nVolume, int nChannel = -1, bool bLoop = false);
void sndStartWavID(unsigned int nSound, int nVolume, int nChannel = -1);

View file

@ -86,12 +86,12 @@ int tileInit(char a1, const char *a2)
for (int i = 0; i < kMaxTiles; i++)
voxelIndex[i] = 0;
auto hFile = kopenFileReader("SURFACE.DAT", 0);
auto hFile = fileSystem.OpenFileReader("SURFACE.DAT", 0);
if (hFile.isOpen())
{
hFile.Read(surfType, sizeof(surfType));
}
hFile = kopenFileReader("VOXEL.DAT", 0);
hFile = fileSystem.OpenFileReader("VOXEL.DAT", 0);
if (hFile.isOpen())
{
hFile.Read(voxelIndex, sizeof(voxelIndex));
@ -100,7 +100,7 @@ int tileInit(char a1, const char *a2)
voxelIndex[i] = B_LITTLE16(voxelIndex[i]);
#endif
}
hFile = kopenFileReader("SHADE.DAT", 0);
hFile = fileSystem.OpenFileReader("SHADE.DAT", 0);
if (hFile.isOpen())
{
hFile.Read(tileShade, sizeof(tileShade));

View file

@ -4769,7 +4769,7 @@ void trInit(void)
void trTextOver(int nId)
{
char *pzMessage = levelGetMessage(nId);
const char *pzMessage = levelGetMessage(nId);
if (pzMessage)
viewSetMessage(pzMessage, VanillaMode() ? 0 : 8, MESSAGE_PRIORITY_INI); // 8: gold
}

View file

@ -47,7 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "loadsave.h"
#include "map2d.h"
#include "messages.h"
#include "menu.h"
#include "gamemenu.h"
#include "mirrors.h"
#include "network.h"
#include "player.h"
@ -61,6 +61,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "warp.h"
#include "weapon.h"
#include "zstring.h"
#include "menu/menu.h"
#include "gstrings.h"
CVARD(Bool, hud_powerupduration, true, CVAR_ARCHIVE|CVAR_FRONTEND_BLOOD, "enable/disable displaying the remaining seconds for power-ups")
@ -1003,39 +1005,6 @@ void viewDrawText(int nFont, const char *pString, int x, int y, int nShade, int
if (shadow)
G_ScreenText(pFont->tile, x + 1, y + 1, 65536, 0, 0, pString, 127, nPalette, 2|8|16|nStat, alpha, 0, 0, pFont->space, 0, nFlags, 0, 0, xdim-1, ydim-1);
G_ScreenText(pFont->tile, x, y, 65536, 0, 0, pString, nShade, nPalette, 2|8|16|nStat, alpha, 0, 0, pFont->space, 0, nFlags, 0, 0, xdim-1, ydim-1);
//if (nFont < 0 || nFont >= 5 || !pString) return;
//FONT *pFont = &gFont[nFont];
//
//if (position)
//{
// const char *s = pString;
// int width = -pFont->space;
// while (*s)
// {
// int nTile = ((*s-' ')&127)+pFont->tile;
// if (tilesiz[nTile].x && tilesiz[nTile].y)
// width += tilesiz[nTile].x+pFont->space;
// s++;
// }
// if (position == 1)
// width >>= 1;
// x -= width;
//}
//const char *s = pString;
//while (*s)
//{
// int nTile = ((*s-' ')&127) + pFont->tile;
// if (tilesiz[nTile].x && tilesiz[nTile].y)
// {
// if (shadow)
// {
// rotatesprite_fs_alpha((x+1)<<16, (y+1)<<16, 65536, 0, nTile, 127, nPalette, 26|nStat, alpha);
// }
// rotatesprite_fs_alpha(x<<16, y<<16, 65536, 0, nTile, nShade, nPalette, 26|nStat, alpha);
// x += tilesiz[nTile].x+pFont->space;
// }
// s++;
//}
}
void viewTileSprite(int nTile, int nShade, int nPalette, int x1, int y1, int x2, int y2)
@ -1196,6 +1165,11 @@ void viewDrawStats(PLAYER *pPlayer, int x, int y)
viewDrawText(3, buffer, x, y, 20, 0, 0, true, 256);
}
GameStats GameInterface::getStats()
{
return { gKillMgr.at4, gKillMgr.at0, gSecretMgr.at8, gSecretMgr.at0, gLevelTime / kTicsPerSec, gPlayer[myconnectindex].fragCount };
}
#define kSBarNumberHealth 9220
#define kSBarNumberAmmo 9230
#define kSBarNumberInv 9240
@ -1270,7 +1244,7 @@ void viewDrawPowerUps(PLAYER* pPlayer)
void viewDrawMapTitle(void)
{
if (!hud_showmapname || gGameMenuMgr.m_bActive)
if (!hud_showmapname || M_Active())
return;
int const fadeStartTic = int((videoGetRenderMode() == REND_CLASSIC ? 1.25f : 1.f)*kTicsPerSec);
@ -1428,7 +1402,7 @@ void viewDrawCtfHudVanilla(ClockTicks arg)
int x = 1, y = 1;
if (dword_21EFD0[0] == 0 || ((int)totalclock & 8))
{
viewDrawText(0, "BLUE", x, y, -128, 10, 0, 0, 256);
viewDrawText(0, GStrings("TXT_COLOR_BLUE"), x, y, -128, 10, 0, 0, 256);
dword_21EFD0[0] = dword_21EFD0[0] - arg;
if (dword_21EFD0[0] < 0)
dword_21EFD0[0] = 0;
@ -1438,7 +1412,7 @@ void viewDrawCtfHudVanilla(ClockTicks arg)
x = 319;
if (dword_21EFD0[1] == 0 || ((int)totalclock & 8))
{
viewDrawText(0, "RED", x, y, -128, 7, 2, 0, 512);
viewDrawText(0, GStrings("TXT_COLOR_RED"), x, y, -128, 7, 2, 0, 512);
dword_21EFD0[1] = dword_21EFD0[1] - arg;
if (dword_21EFD0[1] < 0)
dword_21EFD0[1] = 0;
@ -2791,16 +2765,23 @@ void viewSetSystemMessage(const char* pMessage, ...) {
char buffer[1024]; va_list args; va_start(args, pMessage);
vsprintf(buffer, pMessage, args);
OSD_Printf("%s\n", buffer); // print it also in console
Printf(PRINT_HIGH | PRINT_NOTIFY, "%s\n", buffer); // print it also in console
gGameMessageMgr.Add(buffer, 15, 7, MESSAGE_PRIORITY_SYSTEM);
}
void viewSetMessage(const char *pMessage, const int pal, const MESSAGE_PRIORITY priority)
{
OSD_Printf("%s\n", pMessage);
int printlevel = priority < 0 ? PRINT_LOW : priority < MESSAGE_PRIORITY_SYSTEM ? PRINT_MEDIUM : PRINT_HIGH;
Printf(printlevel|PRINT_NOTIFY, "%s\n", pMessage);
gGameMessageMgr.Add(pMessage, 15, pal, priority);
}
void GameInterface::DoPrintMessage(int prio, const char*msg)
{
viewSetMessage(msg, 0, prio == PRINT_LOW ? MESSAGE_PRIORITY_PICKUP : prio == PRINT_MEDIUM ? MESSAGE_PRIORITY_NORMAL : MESSAGE_PRIORITY_SYSTEM);
}
void viewDisplayMessage(void)
{
gGameMessageMgr.Display();
@ -3056,7 +3037,7 @@ void viewDrawScreen(void)
if (delta < 0)
delta = 0;
lastUpdate = totalclock;
if (!gPaused && (!CGameMenuMgr::m_bActive || gGameOptions.nGameType != 0))
if (!gPaused && (!M_Active() || gGameOptions.nGameType != 0))
{
gInterpolate = ((totalclock-gNetFifoClock)+4).toScale16()/4;
}
@ -3577,7 +3558,7 @@ RORHACK:
viewDrawAimedPlayerName();
if (gPaused)
{
viewDrawText(1, "PAUSED", 160, 10, 0, 0, 1, 0);
viewDrawText(1, GStrings("TXTB_PAUSED"), 160, 10, 0, 0, 1, 0);
}
else if (gView != gMe)
{
@ -3631,7 +3612,7 @@ void viewLoadingScreenWide(void)
void viewLoadingScreenUpdate(const char *pzText4, int nPercent)
{
int vc;
gMenuTextMgr.GetFontInfo(1, NULL, NULL, &vc);
viewGetFontInfo(1, NULL, NULL, &vc);
if (nLoadingScreenTile == kLoadScreen)
viewLoadingScreenWide();
else if (nLoadingScreenTile)
@ -3660,7 +3641,7 @@ void viewLoadingScreenUpdate(const char *pzText4, int nPercent)
if (nPercent != -1)
TileHGauge(2260, 86, 110, nPercent, 100, 0, 131072);
viewDrawText(3, "Please Wait", 160, 134, -128, 0, 1, 1);
viewDrawText(3, GStrings("TXTB_PLSWAIT"), 160, 134, -128, 0, 1, 1);
}
void viewLoadingScreen(int nTile, const char *pText, const char *pText2, const char *pText3)

View file

@ -14,6 +14,7 @@
#include "inputstate.h"
#include "printf.h"
#include "zstring.h"
#include "vectors.h"
#ifdef DEBUGGINGAIDS
@ -21,7 +22,7 @@
extern int32_t g_maskDrawMode;
#endif
extern char quitevent, appactive;
extern char appactive;
extern char modechange;
extern char nogl;
@ -115,6 +116,7 @@ typedef struct
void (*pCallback)(int32_t, int32_t);
int32_t bits;
int32_t numAxes;
int32_t numBalls;
int32_t numButtons;
int32_t numHats;
int32_t isGameController;
@ -144,7 +146,7 @@ void joyScanDevices(void);
void mouseInit(void);
void mouseUninit(void);
void mouseGrabInput(bool grab);
void mouseLockToWindow(char a);
void mouseLockToWindow(bool a);
void mouseMoveToCenter(void);
void joyReadButtons(int32_t *pResult);
@ -166,8 +168,43 @@ struct GameStats
int kill, tkill;
int secret, tsecret;
int timesecnd;
int frags;
};
struct FGameStartup
{
int Episode;
int Level;
int Skill;
int CustomLevel1;
int CustomLevel2;
};
struct FSavegameInfo
{
const char *savesig;
int minsavever;
int currentsavever;
};
struct FSaveGameNode
{
FString SaveTitle;
FString Filename;
bool bOldVersion = false;
bool bMissingWads = false;
bool bNoDelete = false;
bool bIsExt = false;
bool isValid() const
{
return Filename.IsNotEmpty() && !bOldVersion && !bMissingWads;
}
};
enum EMenuSounds : int;
struct GameInterface
{
virtual ~GameInterface() {}
@ -176,9 +213,35 @@ struct GameInterface
virtual bool validate_hud(int) = 0;
virtual void set_hud_layout(int size) = 0;
virtual void set_hud_scale(int size) = 0;
virtual bool mouseInactiveConditional(bool condition) { return condition; }
virtual FString statFPS() { return "FPS display not available"; }
virtual GameStats getStats() { return {}; }
virtual void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) {}
virtual void MainMenuOpened() {}
virtual void MenuOpened() {}
virtual void MenuClosed() {}
virtual void MenuSound(EMenuSounds snd) {}
virtual bool CanSave() { return true; }
virtual void CustomMenuSelection(int menu, int item) {}
virtual void StartGame(FGameStartup& gs) {}
virtual FSavegameInfo GetSaveSig() { return { "", 0, 0}; }
virtual bool DrawSpecialScreen(const DVector2 &origin, int tilenum) { return false; }
virtual void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool withbg = true) {}
virtual void DrawMenuCaption(const DVector2& origin, const char* text) {}
virtual bool SaveGame(FSaveGameNode*) { return false; }
virtual bool LoadGame(FSaveGameNode*) { return false; }
virtual void DoPrintMessage(int prio, const char*) = 0;
void PrintMessage(int prio, const char*fmt, ...)
{
va_list ap;
va_start(ap, fmt);
FString f;
f.VFormat(fmt, ap);
DoPrintMessage(prio, f);
}
virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {}
virtual void QuitToTitle() {}
virtual void SetAmbience(bool on) {}
};
extern GameInterface* gi;

View file

@ -891,7 +891,7 @@ void updatesectorneighbor(int32_t const x, int32_t const y, int16_t * const sect
void updatesectorneighborz(int32_t const x, int32_t const y, int32_t const z, int16_t * const sectnum, int32_t initialMaxDistance = INITIALUPDATESECTORDIST, int32_t maxDistance = MAXUPDATESECTORDIST) ATTRIBUTE((nonnull(4)));
int findwallbetweensectors(int sect1, int sect2);
static FORCE_INLINE bool sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
static FORCE_INLINE int sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
int32_t getsectordist(vec2_t const in, int const sectnum, vec2_t * const out = nullptr);
extern const int16_t *chsecptr_onextwall;
int32_t checksectorpointer(int16_t i, int16_t sectnum);
@ -1147,7 +1147,7 @@ static FORCE_INLINE int32_t md_tilehasmodel(int32_t const tilenume, int32_t cons
}
#endif // defined USE_OPENGL
static FORCE_INLINE bool tilehasmodelorvoxel(int const tilenume, int pal)
static FORCE_INLINE int tilehasmodelorvoxel(int const tilenume, int pal)
{
UNREFERENCED_PARAMETER(pal);
return
@ -1189,7 +1189,7 @@ extern const int32_t engine_v8;
int32_t Mulscale(int32_t a, int32_t b, int32_t sh);
#endif
static FORCE_INLINE CONSTEXPR bool inside_p(int32_t const x, int32_t const y, int const sectnum) { return (sectnum >= 0 && inside(x, y, sectnum) == 1); }
static FORCE_INLINE CONSTEXPR int inside_p(int32_t const x, int32_t const y, int const sectnum) { return (sectnum >= 0 && inside(x, y, sectnum) == 1); }
#define SET_AND_RETURN(Lval, Rval) \
do \

View file

@ -9,58 +9,7 @@
#ifndef cache1d_h_
#define cache1d_h_
#include "compat.h"
#include "files.h"
void cacheAllocateBlock(intptr_t *newhandle, int32_t newbytes, uint8_t *newlockptr);
extern int32_t pathsearchmode; // 0 = gamefs mode (default), 1 = localfs mode (editor's mode)
#include "filesystem/filesystem.h"
// Wrappers for the handle based API to get rid of the direct calls without any actual changes to the implementation.
// These are now getting redirected to the file system so that the implementation here can be gutted without making changes to the calling code.
inline FileReader kopenFileReader(const char* name, int where)
{
auto lump = fileSystem.FindFile(name);
if (lump < 0) return FileReader();
else return fileSystem.OpenFileReader(lump);
}
// This is only here to mark a file as not being part of the game assets (e.g. savegames)
// These should be handled differently (e.g read from a userdata directory or similar things.)
inline FileReader fopenFileReader(const char* name, int where)
{
FileReader fr;
fr.OpenFile(name);
return fr;
}
inline bool testkopen(const char* name, int where)
{
// todo: if backed by a single file, we must actually open it to make sure.
return fileSystem.FindFile(name) >= 0;
}
inline TArray<uint8_t> kloadfile(const char* name, int where)
{
auto lump = fileSystem.FindFile(name);
if (lump < 0) return TArray<uint8_t>();
return fileSystem.GetFileData(lump);
}
inline int32_t kfilesize(const char* name, int where)
{
auto lump = fileSystem.FindFile(name);
if (lump < 0) return -1;
return fileSystem.FileLength(lump);
}
// checks from path and in ZIPs, returns 1 if NOT found
inline int32_t check_file_exist(const char* fn)
{
return fileSystem.FindFile(fn) >= 0;
}
#endif // cache1d_h_

View file

@ -13,7 +13,3 @@ static FORCE_INLINE int32_t paletteGetClosestColor(int32_t r, int32_t g, int32_t
{
return getclosestcol_lim(r, g, b, 255);
}
static FORCE_INLINE int32_t getclosestcol_nocache(int32_t r, int32_t g, int32_t b)
{
return getclosestcol_nocache_lim(r, g, b, 255);
}

View file

@ -568,7 +568,10 @@ typedef FILE BFILE;
// parsing the decimal representation of 0xffffffff,
// 4294967295 -- long is signed, so strtol would
// return LONG_MAX (== 0x7fffffff on 32-bit archs))
#define Batoi(str) ((int32_t)strtol(str, NULL, 10))
static FORCE_INLINE int32_t atoi_safe(const char *str) { return (int32_t)Bstrtol(str, NULL, 10); }
#define Batoi(x) atoi_safe(x)
#define Batol(str) (strtol(str, NULL, 10))
#define Batof(str) (strtod(str, NULL))
@ -1166,8 +1169,6 @@ static inline void append_ext_UNSAFE(char *outbuf, const char *ext)
////////// Paths //////////
char *Bgethomedir(void);
int32_t Bcorrectfilename(char *filename, int32_t removefn);
////////// String manipulation //////////
@ -1243,8 +1244,21 @@ static FORCE_INLINE void *xaligned_alloc(const bsize_t alignment, const bsize_t
void *ptr = Baligned_alloc(alignment, size);
return (EDUKE32_PREDICT_TRUE(ptr != NULL)) ? ptr : handle_memerr(ptr);
}
static FORCE_INLINE void *xaligned_calloc(const bsize_t alignment, const bsize_t count, const bsize_t size)
{
bsize_t const blocksize = count * size;
void *ptr = Baligned_alloc(alignment, blocksize);
if (EDUKE32_PREDICT_TRUE(ptr != NULL))
{
Bmemset(ptr, 0, blocksize);
return ptr;
}
return handle_memerr(ptr);
}
#else
# define xaligned_alloc(alignment, size) xmalloc(size)
# define xaligned_calloc(alignment, count, size) xcalloc(count, size)
#endif
#ifdef DEBUGGINGAIDS
@ -1258,6 +1272,7 @@ static FORCE_INLINE void *xaligned_alloc(const bsize_t alignment, const bsize_t
#define Xcalloc(nmemb, size) (EDUKE32_PRE_XALLOC xcalloc(nmemb, size))
#define Xrealloc(ptr, size) (EDUKE32_PRE_XALLOC xrealloc(ptr, size))
#define Xaligned_alloc(alignment, size) (EDUKE32_PRE_XALLOC xaligned_alloc(alignment, size))
#define Xaligned_calloc(alignment, count, size) (EDUKE32_PRE_XALLOC xaligned_calloc(alignment, count, size))
#define Xfree(ptr) (EDUKE32_PRE_XALLOC xfree(ptr))
#define Xaligned_free(ptr) (EDUKE32_PRE_XALLOC xaligned_free(ptr))

View file

@ -5,12 +5,13 @@
#define hash_h_
// Hash functions
#define DJB_MAGIC 5381u
typedef struct hashitem_ // size is 12/24 bytes.
typedef struct hashitem // size is 12/24 bytes.
{
char *string;
intptr_t key;
struct hashitem_ *next;
struct hashitem *next;
} hashitem_t;
typedef struct
@ -22,8 +23,8 @@ typedef struct
// djb3 algorithm
static inline uint32_t hash_getcode(const char *s)
{
uint32_t h = 5381;
int32_t ch;
uint32_t h = DJB_MAGIC;
char ch;
while ((ch = Btolower(*s++)) != '\0')
h = ((h << 5) + h) ^ ch;
@ -32,49 +33,51 @@ static inline uint32_t hash_getcode(const char *s)
}
void hash_init(hashtable_t *t);
void hash_loop(hashtable_t *t, void(*func)(const char *, intptr_t));
void hash_loop(hashtable_t *t, void (*func)(const char *, intptr_t));
void hash_free(hashtable_t *t);
intptr_t hash_findcase(hashtable_t const * t, char const * s);
intptr_t hash_find(hashtable_t const * t, char const * s);
void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace);
void hash_delete(hashtable_t *t, const char *s);
intptr_t hash_findcase(hashtable_t const *t, char const *s);
intptr_t hash_find(hashtable_t const *t, char const *s);
// Hash functions
// modified for raw binary keys and one big allocation, and maximum find() performance
typedef struct inthashitem_
typedef struct inthashitem
{
intptr_t key;
intptr_t value;
struct inthashitem_ *collision; // use NULL to signify empty and pointer identity to signify end of linked list
struct inthashitem *collision; // use NULL to signify empty and pointer identity to signify end of linked list
} inthashitem_t;
typedef struct
{
inthashitem_t * items;
inthashitem_t *items;
uint32_t count;
} inthashtable_t;
// djb3 algorithm
static inline uint32_t inthash_getcode(intptr_t key)
{
uint32_t h = 5381;
uint32_t h = DJB_MAGIC;
for (uint8_t const * keybuf = (uint8_t *) &key, *const keybuf_end = keybuf + sizeof(intptr_t); keybuf < keybuf_end; ++keybuf)
for (auto keybuf = (uint8_t const *) &key, keybuf_end = keybuf + sizeof(key); keybuf < keybuf_end; ++keybuf)
h = ((h << 5) + h) ^ (uint32_t) *keybuf;
return h;
}
void inthash_init(inthashtable_t *t);
void inthash_loop(inthashtable_t const *t, void(*func)(intptr_t, intptr_t));
void inthash_loop(inthashtable_t const *t, void (*func)(intptr_t, intptr_t));
void inthash_free(inthashtable_t *t);
intptr_t inthash_find(inthashtable_t const *t, intptr_t key);
void inthash_add(inthashtable_t *t, intptr_t key, intptr_t value, int32_t replace);
void inthash_delete(inthashtable_t *t, intptr_t key);
intptr_t inthash_find(inthashtable_t const *t, intptr_t key);
// keep the load factor below 0.75 and make sure the size is odd
// ideally we would find the next largest prime number
#define INTHASH_SIZE(size) ((size * 4u / 3u) | 1u)
#endif
#endif // hash_h_

View file

@ -11,7 +11,7 @@
#ifndef palette_h_
#define palette_h_
#include "cache1d.h"
#include "filesystem/filesystem.h"
#define MAXBASEPALS 256
#define MAXPALOOKUPS 256

View file

@ -189,9 +189,6 @@ void qinterpolatedown16short(intptr_t bufptr, int32_t num, int32_t val, int32_t
#ifndef pragmas_have_clearbuf
void clearbuf(void *d, int32_t c, int32_t a);
#endif
#ifndef pragmas_have_copybuf
void copybuf(const void *s, void *d, int32_t c);
#endif
#ifndef pragmas_have_swaps
void swapbuf4(void *a, void *b, int32_t c);
#endif
@ -199,9 +196,6 @@ void swapbuf4(void *a, void *b, int32_t c);
#ifndef pragmas_have_clearbufbyte
void clearbufbyte(void *D, int32_t c, int32_t a);
#endif
#ifndef pragmas_have_copybufbyte
void copybufbyte(const void *S, void *D, int32_t c);
#endif
#ifndef pragmas_have_copybufreverse
void copybufreverse(const void *S, void *D, int32_t c);
#endif

View file

@ -6,38 +6,9 @@
// by Jonathon Fowler (jf@jonof.id.au)
// by the EDuke32 team (development@voidpoint.com)
#include "compat.h"
#ifdef _WIN32
// for FILENAME_CASE_CHECK
# define NEED_SHELLAPI_H
# include "windows_inc.h"
#endif
#include <stdint.h>
#include "tarray.h"
#include "cache1d.h"
#include "pragmas.h"
#include "baselayer.h"
uint8_t toupperlookup[256] =
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x7b,0x7c,0x7d,0x7e,0x7f,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
};
// Only the sound code still uses this - but it never frees the data.
// So we may just toss out the cache and do regular allocations.

View file

@ -292,7 +292,8 @@ static char* KeyValues_FindKeyValue(char **vdfbuf, char * const vdfbufend, const
void Paths_ParseSteamKeyValuesForPaths(const char *vdf, SteamPathParseFunc func)
{
FileReader fr = fopenFileReader(vdf, 0);
FileReader fr;
if (!fr.OpenFile(vdf)) return;
auto size = fr.GetLength();
char *vdfbuf, *vdfbufend;

View file

@ -73,29 +73,6 @@ void set_memerr_handler(void(*handlerfunc)(int32_t, const char *, const char *))
g_MemErrHandler = handlerfunc;
}
//
// Stuff which must be a function
//
char *Bgethomedir(void)
{
#ifdef _WIN32
char appdata[MAX_PATH];
if (SUCCEEDED(SHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE)))
{
return Xstrdup(appdata);
}
return NULL;
#elif defined EDUKE32_OSX
return osx_gethomedir();
#else
char *e = getenv("HOME");
if (!e) return NULL;
return Xstrdup(e);
#endif
}
int32_t Bcorrectfilename(char *filename, int32_t removefn)
{

View file

@ -306,7 +306,6 @@ static int32_t defsparser(scriptfile *script)
}
#endif
handleevents();
if (quitevent) return 0;
tokn = getatoken(script,basetokens,ARRAY_SIZE(basetokens));
cmdtokptr = script->ltextptr;
switch (tokn)
@ -356,7 +355,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getnumber(script,&fnoo)) break; //y-size
if (scriptfile_getstring(script,&fn)) break;
if (check_file_exist(fn))
if (fileSystem.FileExists(fn))
break;
tileSetHightileReplacement(tile,pal,fn,-1.0,1.0,1.0,1.0,1.0,0);
@ -374,7 +373,7 @@ static int32_t defsparser(scriptfile *script)
{
if (scriptfile_getstring(script,&fn[i])) break; //grab the 6 faces
if (check_file_exist(fn[i]))
if (fileSystem.FileExists(fn[i]))
happy = 0;
}
if (i < 6 || !happy) break;
@ -1099,7 +1098,7 @@ static int32_t defsparser(scriptfile *script)
if (seenframe) { modelskin = ++lastmodelskin; }
seenframe = 0;
if (check_file_exist(skinfn))
if (fileSystem.FileExists(skinfn))
break;
#ifdef USE_OPENGL
@ -1474,7 +1473,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
if (check_file_exist(skinfn))
if (fileSystem.FileExists(skinfn))
break;
#ifdef USE_OPENGL
@ -1792,7 +1791,7 @@ static int32_t defsparser(scriptfile *script)
{
if (EDUKE32_PREDICT_FALSE(!fn[i])) initprintf("Error: skybox: missing '%s filename' near line %s:%d\n", skyfaces[i], script->filename, scriptfile_getlinum(script,skyboxtokptr)), happy = 0;
// FIXME?
if (check_file_exist(fn[i]))
if (fileSystem.FileExists(fn[i]))
happy = 0;
}
if (!happy) break;
@ -1847,7 +1846,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
if (check_file_exist(fn))
if (fileSystem.FileExists(fn))
break;
}
@ -2102,7 +2101,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
if (EDUKE32_PREDICT_FALSE(check_file_exist(fn)))
if (EDUKE32_PREDICT_FALSE(fileSystem.FileExists(fn)))
break;
if (xsiz > 0 && ysiz > 0)
@ -2165,7 +2164,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
if (EDUKE32_PREDICT_FALSE(check_file_exist(fn)))
if (EDUKE32_PREDICT_FALSE(fileSystem.FileExists(fn)))
break;
switch (token)
@ -2597,7 +2596,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
FileReader fil = kopenFileReader(fn, 0);
FileReader fil = fileSystem.OpenFileReader(fn, 0);
if (!fil.isOpen())
{
initprintf("Error: basepalette: Failed opening \"%s\" on line %s:%d\n", fn,
@ -2771,7 +2770,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
FileReader fil = kopenFileReader(fn, 0);
FileReader fil = fileSystem.OpenFileReader(fn, 0);
if (!fil.isOpen())
{
initprintf("Error: palookup: Failed opening \"%s\" on line %s:%d\n", fn,
@ -3064,7 +3063,7 @@ static int32_t defsparser(scriptfile *script)
break;
}
FileReader fil = kopenFileReader(fn, 0);
FileReader fil = fileSystem.OpenFileReader(fn, 0);
if (!fil.isOpen())
{
initprintf("Error: blendtable: Failed opening \"%s\" on line %s:%d\n", fn,

View file

@ -24,8 +24,10 @@
#include "gamecvars.h"
#include "c_console.h"
#include "v_2ddrawer.h"
#include "v_draw.h"
#include "imgui.h"
#include "stats.h"
#include "menu.h"
#ifdef USE_OPENGL
# include "glsurface.h"
@ -157,7 +159,8 @@ int32_t globaltilesizy;
int32_t globalx1, globaly2, globalx3, globaly3;
int32_t sloptable[SLOPTABLESIZ];
static intptr_t slopalookup[16384]; // was 2048
#define SLOPALOOKUPSIZ 16384
static intptr_t slopalookup[SLOPALOOKUPSIZ]; // was 2048
static int32_t no_radarang2 = 0;
static int16_t radarang[1280];
@ -3387,7 +3390,7 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
int32_t i, j, l, globalx1, globaly1, y1, y2, daslope, daz, wxi, wyi;
float fi, wx, wy, dasqr;
float globalx, globaly, globalx2, globaly2, globalx3, globaly3, globalz, globalzd, globalzx;
int32_t shoffs, m1, m2;
int32_t shoffs, m1, m2, shy1, shy2;
intptr_t *mptr1, *mptr2;
const usectortype *const sec = (usectortype *)&sector[sectnum];
@ -3521,7 +3524,14 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
//Avoid visibility overflow by crossing horizon
m1 += klabs(l);
m2 = m1+l;
mptr1 = (intptr_t *)&slopalookup[y1+(shoffs>>15)]; mptr2 = mptr1+1;
shy1 = y1+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ-1)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
return;
}
mptr1 = &slopalookup[shy1]; mptr2 = mptr1+1;
for (int x=dax1; x<=dax2; x++)
{
@ -3529,8 +3539,23 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
else { y1 = max(umost[x],dplc[x]); y2 = dmost[x]-1; }
if (y1 <= y2)
{
intptr_t *nptr1 = &slopalookup[y1+(shoffs>>15)];
intptr_t *nptr2 = &slopalookup[y2+(shoffs>>15)];
shy1 = y1+(shoffs>>15);
shy2 = y2+(shoffs>>15);
// Ridiculously steep gradient?
if ((unsigned)shy1 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
goto next_most;
}
if ((unsigned)shy2 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum);
goto next_most;
}
intptr_t *nptr1 = &slopalookup[shy1];
intptr_t *nptr2 = &slopalookup[shy2];
while (nptr1 <= mptr1)
{
@ -3660,6 +3685,7 @@ static void fgrouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
#undef LINTERPSIZ
if ((x&15) == 0) faketimerhandler();
}
next_most:
globalx2 += globalx;
globaly2 += globaly;
globalzx += globalz;
@ -3676,7 +3702,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
}
int32_t i, l, x, y, dx, dy, wx, wy, y1, y2, daz;
int32_t daslope, dasqr;
int32_t shoffs, m1, m2;
int32_t shoffs, m1, m2, shy1, shy2;
intptr_t *mptr1, *mptr2, j;
// Er, yes, they're not global anymore:
@ -3808,7 +3834,14 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
//Avoid visibility overflow by crossing horizon
m1 += klabs((int32_t) (globalzd>>16));
m2 = m1+l;
mptr1 = (intptr_t *)&slopalookup[y1+(shoffs>>15)]; mptr2 = mptr1+1;
shy1 = y1+(shoffs>>15);
if ((unsigned)shy1 >= SLOPALOOKUPSIZ - 1)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
return;
}
mptr1 = &slopalookup[shy1]; mptr2 = mptr1+1;
for (x=dax1; x<=dax2; x++)
{
@ -3816,8 +3849,23 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
else { y1 = max(umost[x],dplc[x]); y2 = dmost[x]-1; }
if (y1 <= y2)
{
intptr_t *nptr1 = &slopalookup[y1+(shoffs>>15)];
intptr_t *nptr2 = &slopalookup[y2+(shoffs>>15)];
shy1 = y1+(shoffs>>15);
shy2 = y2+(shoffs>>15);
// Ridiculously steep gradient?
if ((unsigned)shy1 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy1, sectnum);
goto next_most;
}
if ((unsigned)shy2 >= SLOPALOOKUPSIZ)
{
OSD_Printf("%s:%d: slopalookup[%" PRId32 "] overflow drawing sector %d!\n", EDUKE32_FUNCTION, __LINE__, shy2, sectnum);
goto next_most;
}
intptr_t *nptr1 = &slopalookup[shy1];
intptr_t *nptr2 = &slopalookup[shy2];
while (nptr1 <= mptr1)
{
@ -3849,6 +3897,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
if ((x&15) == 0) faketimerhandler();
}
next_most:
globalx2 += globalx;
globaly2 += globaly;
globalzx += globalz;
@ -4429,7 +4478,7 @@ static void classicDrawBunches(int32_t bunch)
smostwall[smostwallcnt] = z;
smostwalltype[smostwallcnt] = 1; //1 for umost
smostwallcnt++;
copybufbyte(&umost[x1],&smost[smostcnt],i*sizeof(smost[0]));
memcpy(&umost[x1],&smost[smostcnt],i*sizeof(smost[0]));
smostcnt += i;
}
}
@ -4515,7 +4564,7 @@ static void classicDrawBunches(int32_t bunch)
smostwall[smostwallcnt] = z;
smostwalltype[smostwallcnt] = 2; //2 for dmost
smostwallcnt++;
copybufbyte(&dmost[x1],&smost[smostcnt],i*sizeof(smost[0]));
memcpy(&dmost[x1],&smost[smostcnt],i*sizeof(smost[0]));
smostcnt += i;
}
}
@ -4984,16 +5033,6 @@ static void classicDrawVoxel(int32_t dasprx, int32_t daspry, int32_t dasprz, int
}
}
#if 0
for (x=0; x<xdimen; x++)
{
if (daumost[x]>=0 && daumost[x]<ydimen)
*(char *)(frameplace + x + bytesperline*daumost[x]) = editorcolors[13];
if (dadmost[x]>=0 && dadmost[x]<ydimen)
*(char *)(frameplace + x + bytesperline*dadmost[x]) = editorcolors[14];
}
#endif
videoEndDrawing(); //}}}
}
@ -6747,6 +6786,9 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
int32_t zoomsc, sx=*sxptr, sy=*syptr;
int32_t ouryxaspect = yxaspect, ourxyaspect = xyaspect;
if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK)
sx += NEGATE_ON_CONDITION(scale(120<<16,xdim,ydim) - (160<<16), !(dastat & RS_ALIGN_R));
sy += rotatesprite_y_offset;
// screen center to s[xy], 320<<16 coords.
@ -6774,17 +6816,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
// screen x center to sx1, scaled to viewport
const int32_t scaledxofs = scale(normxofs, scale(xdimen, xdim, oxdim), 320);
int32_t xbord = 0;
if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK)
{
xbord = scale(oxdim-xdim, twice_midcx, oxdim);
if ((dastat & RS_ALIGN_R)==0)
xbord = -xbord;
}
sx = ((twice_midcx+xbord)<<15) + scaledxofs;
sx = ((twice_midcx)<<15) + scaledxofs;
zoomsc = xdimenscale; //= scale(xdimen,yxaspect,320);
zoomsc = mulscale16(zoomsc, rotatesprite_yxaspect);
@ -6806,9 +6838,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
if ((dastat & RS_ALIGN_MASK) == RS_ALIGN_MASK)
sy += (oydim-ydim)<<15;
else if ((dastat & RS_ALIGN_MASK) == RS_ALIGN_R)
sx += (oxdim-xdim)<<16;
else if ((dastat & RS_ALIGN_MASK) == 0)
else
sx += (oxdim-xdim)<<15;
if (dastat & RS_CENTERORIGIN)
@ -9454,7 +9484,7 @@ int32_t engineLoadBoard(const char *filename, char flags, vec3_t *dapos, int16_t
flags &= 3;
FileReader fr = kopenFileReader(filename, 0);
FileReader fr = fileSystem.OpenFileReader(filename, 0);
if (!fr.isOpen())
{ mapversion = 7; return -1; }
@ -9646,7 +9676,7 @@ int32_t engineLoadBoardV5V6(const char *filename, char fromwhere, vec3_t *dapos,
struct walltypev6 v6wall;
struct spritetypev6 v6spr;
FileReader fr = kopenFileReader(filename, fromwhere);
FileReader fr = fileSystem.OpenFileReader(filename, fromwhere);
if (!fr.isOpen())
{ mapversion = 5L; return -1; }
@ -9984,6 +10014,7 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
}
xdim = daupscaledxdim/scalefactor;
ydim = daupscaledydim/scalefactor;
V_UpdateModeSize(xdim, ydim);
#ifdef USE_OPENGL
fxdim = (float) xdim;
@ -10037,8 +10068,22 @@ void DrawFullscreenBlends();
//
void videoNextPage(void)
{
static bool recursion;
permfifotype *per;
if (!recursion)
{
// This protection is needed because the menu can call scripts from inside its drawers and the scripts can call the busy-looping Screen_Play script event
// which calls videoNextPage for page flipping again. In this loop the UI drawers may not get called again.
// Ideally this stuff should be moved out of videoNextPage so that all those busy loops won't call UI overlays at all.
recursion = true;
M_Drawer();
FStat::PrintStat();
C_DrawConsole();
recursion = false;
}
if (in3dmode())
{
// software rendering only
@ -10055,24 +10100,13 @@ void videoNextPage(void)
g_beforeSwapTime = timerGetHiTicks();
// Draw the ImGui menu on top of the game content, but below the console (if open.)
if (GUICapture & 6)
{
ImGui::Render();
GLInterface.DrawImGui(ImGui::GetDrawData());
GUICapture &= ~4;
}
// Draw the console plus debug output on top of everything else.
DrawFullscreenBlends();
FStat::PrintStat();
C_DrawConsole();
GLInterface.Draw2D(&twod);
videoShowFrame(0);
// software rendering only
videoBeginDrawing(); //{{{
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
{
@ -10112,7 +10146,7 @@ void videoNextPage(void)
int32_t qloadkvx(int32_t voxindex, const char *filename)
{
auto fil = kopenFileReader(filename, 0);
auto fil = fileSystem.OpenFileReader(filename, 0);
if (!fil.isOpen())
return -1;
@ -10962,13 +10996,13 @@ int32_t lastwall(int16_t point)
* NOTE: The redundant bound checks are expected to be optimized away in the
* inlined code. */
static FORCE_INLINE CONSTEXPR bool inside_exclude_p(int32_t const x, int32_t const y, int const sectnum, const uint8_t *excludesectbitmap)
static FORCE_INLINE CONSTEXPR int inside_exclude_p(int32_t const x, int32_t const y, int const sectnum, const uint8_t *excludesectbitmap)
{
return (sectnum>=0 && !bitmap_test(excludesectbitmap, sectnum) && inside_p(x, y, sectnum));
}
/* NOTE: no bound check */
static inline bool inside_z_p(int32_t const x, int32_t const y, int32_t const z, int const sectnum)
static inline int inside_z_p(int32_t const x, int32_t const y, int32_t const z, int const sectnum)
{
int32_t cz, fz;
getzsofslope(sectnum, x, y, &cz, &fz);
@ -11396,6 +11430,9 @@ void renderFlushPerms(void)
}
bool rotatesprite_2doverride; // gross hack alert. Thanks to the insufficient abstraction the only chance to redirect rotatesprite calls
// to the 2D drawer is to use a global flag and check in rotatesprite_.
#include "v_2ddrawer.h"
//
// rotatesprite
//
@ -11413,6 +11450,12 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
tileUpdatePicnum(&picnum, (int16_t)0xc000);
if ((tilesiz[picnum].x <= 0) || (tilesiz[picnum].y <= 0)) return;
if (rotatesprite_2doverride)
{
twod.rotatesprite(sx, sy, z, a, picnum, dashade, dapalnum, dastat, daalpha, dablend, cx1, cy1, cx2, cy2);
return;
}
// Experimental / development bits. ONLY FOR INTERNAL USE!
// bit RS_CENTERORIGIN: see dorotspr_handle_bit2
////////////////////
@ -11594,8 +11637,8 @@ void renderSetTarget(int16_t tilenume, int32_t xsiz, int32_t ysiz)
rendmode = REND_CLASSIC;
#endif
copybufbyte(&startumost[windowxy1.x],&bakumost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(bakumost[0]));
copybufbyte(&startdmost[windowxy1.x],&bakdmost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(bakdmost[0]));
memcpy(&startumost[windowxy1.x],&bakumost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(bakumost[0]));
memcpy(&startdmost[windowxy1.x],&bakdmost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(bakdmost[0]));
setviewcnt++;
offscreenrendering = 1;
@ -11629,8 +11672,8 @@ void renderRestoreTarget(void)
ydim = bakysiz[setviewcnt];
videoSetViewableArea(bakwindowxy1[setviewcnt].x,bakwindowxy1[setviewcnt].y,
bakwindowxy2[setviewcnt].x,bakwindowxy2[setviewcnt].y);
copybufbyte(&bakumost[windowxy1.x],&startumost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(startumost[0]));
copybufbyte(&bakdmost[windowxy1.x],&startdmost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(startdmost[0]));
memcpy(&bakumost[windowxy1.x],&startumost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(startumost[0]));
memcpy(&bakdmost[windowxy1.x],&startdmost[windowxy1.x],(windowxy2.x-windowxy1.x+1)*sizeof(startdmost[0]));
frameplace = bakframeplace[setviewcnt];
calc_ylookup((setviewcnt == 0) ? bytesperline : bakxsiz[setviewcnt],
@ -12066,42 +12109,6 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall)
Xfree(tmpwall);
}
//
// qsetmodeany
//
void videoSet2dMode(int32_t daxdim, int32_t daydim)
{
if (daxdim < 640) daxdim = 640;
if (daydim < 480) daydim = 480;
if (qsetmode != ((daxdim<<16)|(daydim&0xffff)))
{
g_lastpalettesum = 0;
if (videoSetMode(daxdim, daydim, 8, fullscreen) < 0)
return;
xdim = xres;
ydim = yres;
#ifdef USE_OPENGL
fxdim = (float) xdim;
fydim = (float) ydim;
rendmode = REND_CLASSIC;
#endif
videoAllocateBuffers();
ydim16 = ydim - STATUS2DSIZ2;
halfxdim16 = xdim >> 1;
midydim16 = ydim16 >> 1; // scale(200,ydim,480);
videoBeginDrawing(); //{{{
Bmemset((char *)frameplace, 0, ydim*bytesperline);
videoEndDrawing(); //}}}
}
qsetmode = ((daxdim<<16)|(daydim&0xffff));
}
static int32_t printext_checkypos(int32_t ypos, int32_t *yminptr, int32_t *ymaxptr)
{

View file

@ -6,69 +6,63 @@
void hash_init(hashtable_t *t)
{
hash_free(t);
t->items=(hashitem_t **) Xcalloc(1, t->size * sizeof(hashitem_t));
t->items = (hashitem_t **) Xaligned_calloc(16, t->size, sizeof(hashitem_t));
}
void hash_loop(hashtable_t *t, void(*func)(const char *, intptr_t))
{
if (t->items == NULL)
if (t->items == nullptr)
return;
for (bssize_t i=0; i < t->size; i++)
for (hashitem_t *item=t->items[i]; item != NULL; item = item->next)
for (native_t i=0; i < t->size; i++)
for (auto item = t->items[i]; item != nullptr; item = item->next)
func(item->string, item->key);
}
void hash_free(hashtable_t *t)
{
if (t == NULL || t->items == NULL)
if (t->items == nullptr)
return;
int remaining = t->size - 1;
do
{
hashitem_t *cur = t->items[remaining];
auto cur = t->items[remaining];
while (cur)
{
hashitem_t * const tmp = cur;
auto tmp = cur;
cur = cur->next;
Xfree(tmp->string);
Xfree(tmp);
Xaligned_free(tmp);
}
} while (--remaining >= 0);
DO_FREE_AND_NULL(t->items);
ALIGNED_FREE_AND_NULL(t->items);
}
void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
{
initprintf("hash_add(): table not initialized!\n");
return;
}
Bassert(t->items != nullptr);
#endif
uint32_t code = hash_getcode(s) % t->size;
hashitem_t *cur = t->items[code];
uint32_t const code = hash_getcode(s) % t->size;
auto cur = t->items[code];
if (!cur)
{
cur = (hashitem_t *) Xcalloc(1, sizeof(hashitem_t));
cur = (hashitem_t *) Xaligned_alloc(16, sizeof(hashitem_t));
cur->string = Xstrdup(s);
cur->key = key;
cur->next = NULL;
cur->key = key;
cur->next = nullptr;
t->items[code] = cur;
return;
}
hashitem_t *prev = NULL;
hashitem_t *prev = nullptr;
do
{
@ -80,10 +74,11 @@ void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
prev = cur;
} while ((cur = cur->next));
cur = (hashitem_t *) Xcalloc(1, sizeof(hashitem_t));
cur = (hashitem_t *) Xaligned_alloc(16, sizeof(hashitem_t));
cur->string = Xstrdup(s);
cur->key = key;
cur->next = NULL;
cur->key = key;
cur->next = nullptr;
prev->next = cur;
}
@ -91,22 +86,15 @@ void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
void hash_delete(hashtable_t *t, const char *s)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (t->items == NULL)
{
initprintf("hash_delete(): table not initialized!\n");
return;
}
Bassert(t->items != nullptr);
#endif
uint32_t code = hash_getcode(s) % t->size;
hashitem_t *cur = t->items[code];
uint32_t const code = hash_getcode(s) % t->size;
auto cur = t->items[code];
if (!cur)
return;
hashitem_t *prev = NULL;
hashitem_t *prev = nullptr;
do
{
@ -119,7 +107,7 @@ void hash_delete(hashtable_t *t, const char *s)
else
prev->next = cur->next;
Xfree(cur);
Xaligned_free(cur);
break;
}
@ -130,16 +118,9 @@ void hash_delete(hashtable_t *t, const char *s)
intptr_t hash_find(const hashtable_t * const t, char const * const s)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (t->items == NULL)
{
initprintf("hash_find(): table not initialized!\n");
return -1;
}
Bassert(t->items != nullptr);
#endif
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
auto cur = t->items[hash_getcode(s) % t->size];
if (!cur)
return -1;
@ -155,16 +136,9 @@ intptr_t hash_find(const hashtable_t * const t, char const * const s)
intptr_t hash_findcase(const hashtable_t * const t, char const * const s)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (t->items == NULL)
{
initprintf("hash_findcase(): table not initialized!\n");
return -1;
}
Bassert(t->items != nullptr);
#endif
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
auto cur = t->items[hash_getcode(s) % t->size];
if (!cur)
return -1;
@ -178,60 +152,36 @@ intptr_t hash_findcase(const hashtable_t * const t, char const * const s)
}
void inthash_free(inthashtable_t *t) { ALIGNED_FREE_AND_NULL(t->items); }
void inthash_init(inthashtable_t *t)
{
if (EDUKE32_PREDICT_FALSE(!t->count))
{
initputs("inthash_add(): count is zero!\n");
return;
}
inthash_free(t);
t->items = (inthashitem_t *) Xcalloc(t->count, sizeof(inthashitem_t));
t->items = (inthashitem_t *) Xaligned_calloc(16, t->count, sizeof(inthashitem_t));
}
void inthash_loop(inthashtable_t const *t, void(*func)(intptr_t, intptr_t))
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
{
initputs("inthash_loop(): table not initialized!\n");
if (t->items == nullptr)
return;
}
#endif
for (inthashitem_t const * item = t->items, *const items_end = t->items + t->count; item < items_end; ++item)
for (auto *item = t->items, *const items_end = t->items + t->count; item < items_end; ++item)
func(item->key, item->value);
}
void inthash_free(inthashtable_t *t)
{
DO_FREE_AND_NULL(t->items);
}
void inthash_add(inthashtable_t *t, intptr_t key, intptr_t value, int32_t replace)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
{
initputs("inthash_add(): table not initialized!\n");
return;
}
Bassert(t->items != nullptr);
#endif
auto seeker = t->items + inthash_getcode(key) % t->count;
inthashitem_t * seeker = t->items + inthash_getcode(key) % t->count;
if (seeker->collision == NULL)
if (seeker->collision == nullptr)
{
seeker->key = key;
seeker->value = value;
seeker->collision = seeker;
return;
}
@ -254,17 +204,14 @@ void inthash_add(inthashtable_t *t, intptr_t key, intptr_t value, int32_t replac
}
}
inthashitem_t *tail = seeker;
auto tail = seeker;
do
tail = t->items + (tail - t->items + 1) % t->count;
while (tail->collision != NULL && tail != seeker);
while (tail->collision != nullptr && tail != seeker);
if (EDUKE32_PREDICT_FALSE(tail == seeker))
{
initputs("inthash_add(): table full!\n");
return;
}
I_Error("inthash_add(): table full!\n");
tail->key = key;
tail->value = value;
@ -275,35 +222,25 @@ void inthash_add(inthashtable_t *t, intptr_t key, intptr_t value, int32_t replac
void inthash_delete(inthashtable_t *t, intptr_t key)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
{
initputs("inthash_delete(): table not initialized!\n");
return;
}
Bassert(t->items != nullptr);
#endif
auto seeker = t->items + inthash_getcode(key) % t->count;
inthashitem_t * seeker = t->items + inthash_getcode(key) % t->count;
if (seeker->collision == NULL)
return;
if (seeker->key == key)
if (seeker->collision == nullptr || seeker->key == key)
{
seeker->collision = NULL;
seeker->collision = nullptr;
return;
}
while (seeker != seeker->collision)
{
inthashitem_t * const prev = seeker;
auto prev = seeker;
seeker = seeker->collision;
if (seeker->key == key)
{
prev->collision = seeker == seeker->collision ? prev : seeker->collision;
seeker->collision = NULL;
seeker->collision = nullptr;
return;
}
}
@ -312,18 +249,11 @@ void inthash_delete(inthashtable_t *t, intptr_t key)
intptr_t inthash_find(inthashtable_t const *t, intptr_t key)
{
#ifdef DEBUGGINGAIDS
Bassert(t->items != NULL);
#else
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
{
initputs("inthash_find(): table not initialized!\n");
return -1;
}
Bassert(t->items != nullptr);
#endif
auto seeker = t->items + inthash_getcode(key) % t->count;
inthashitem_t const * seeker = t->items + inthash_getcode(key) % t->count;
if (seeker->collision == NULL)
if (seeker->collision == nullptr)
return -1;
if (seeker->key == key)

View file

@ -1862,7 +1862,7 @@ mdmodel_t *mdload(const char *filnam)
vm = (mdmodel_t *)voxload(filnam);
if (vm) return vm;
auto fil = kopenFileReader(filnam,0);
auto fil = fileSystem.OpenFileReader(filnam,0);
if (!fil.isOpen())
return NULL;

View file

@ -178,7 +178,7 @@ void paletteLoadFromDisk(void)
return;
}
auto fil = kopenFileReader("palette.dat", 0);
auto fil = fileSystem.OpenFileReader("palette.dat", 0);
if (!fil.isOpen())
return;

View file

@ -697,7 +697,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
skyzbufferhack_pass--;
}
if (!tilePtr(globalpicnum))
if (!success)
GLInterface.SetColorMask(true);
}

View file

@ -71,17 +71,6 @@ void clearbuf(void *d, int32_t c, int32_t a)
}
#endif
#ifndef pragmas_have_copybuf
void copybuf(const void *s, void *d, int32_t c)
{
auto p = (const int32_t *) s;
auto q = (int32_t *) d;
while (c--)
*q++ = *p++;
}
#endif
#ifndef pragmas_have_swaps
void swapbuf4(void *a, void *b, int32_t c)
{
@ -113,16 +102,6 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
}
#endif
#ifndef pragmas_have_copybufbyte
void copybufbyte(const void *s, void *d, int32_t c)
{
auto src = (const char *)s;
auto dst = (char *)d;
while (c--)
*dst++ = *src++;
}
#endif
// copybufreverse() is a special case: use the assembly version for GCC on x86

View file

@ -8,6 +8,7 @@
#include "cmdlib.h"
#include "gamecontrol.h"
#include "printf.h"
#include "c_dispatch.h"
#include "../../glbackend/glbackend.h"
@ -156,5 +157,10 @@ int videoCaptureScreen()
return 0;
}
CCMD(screenshot)
{
videoCaptureScreen();
}
#undef HICOLOR

View file

@ -9,7 +9,7 @@
#include "scriptfile.h"
#include "baselayer.h"
#include "compat.h"
#include "cache1d.h"
#include "filesystem/filesystem.h"
#define ISWS(x) ((x == ' ') || (x == '\t') || (x == '\r') || (x == '\n'))
@ -299,7 +299,7 @@ void scriptfile_preparse(scriptfile *sf, char *tx, int32_t flen)
scriptfile *scriptfile_fromfile(const char *fn)
{
auto fr = kopenFileReader(fn, 0);
auto fr = fileSystem.OpenFileReader(fn, 0);
if (!fr.isOpen()) return nullptr;
uint32_t flen = fr.GetLength();

View file

@ -33,10 +33,14 @@
#include "i_time.h"
#include "c_dispatch.h"
#include "d_gui.h"
#include "menu.h"
#include "utf8.h"
#include "imgui.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_opengl3.h"
#ifndef NETCODE_DISABLE
#include "enet.h"
#endif
@ -98,8 +102,9 @@ unsigned char syncstate;
// fix for mousewheel
int32_t inputchecked = 0;
bool screenshot_requested;
char quitevent=0, appactive=1, novideo=0;
char appactive=1, novideo=0;
// video
static SDL_Surface *sdl_surface/*=NULL*/;
@ -662,8 +667,8 @@ static SDL_GameController *controller = NULL;
static void LoadSDLControllerDB()
{
auto fh = fopenFileReader("gamecontrollerdb.txt", 0);
if (!fh.isOpen())
FileReader fh;
if (!fh.OpenFile("gamecontrollerdb.txt"))
return;
int flen = fh.GetLength();
@ -743,8 +748,10 @@ void joyScanDevices()
buildprintf("Using controller %s\n", SDL_GameControllerName(controller));
joystick.numAxes = SDL_CONTROLLER_AXIS_MAX;
joystick.numBalls = 0;
joystick.numButtons = SDL_CONTROLLER_BUTTON_MAX;
joystick.numHats = 0;
joystick.isGameController = 1;
Xfree(joystick.pAxis);
@ -767,11 +774,15 @@ void joyScanDevices()
// KEEPINSYNC duke3d/src/gamedefs.h, mact/include/_control.h
joystick.numAxes = min(9, SDL_JoystickNumAxes(joydev));
joystick.numBalls = SDL_JoystickNumBalls(joydev);
joystick.numButtons = min(32, SDL_JoystickNumButtons(joydev));
joystick.numHats = min((36-joystick.numButtons)/4,SDL_JoystickNumHats(joydev));
joystick.numHats = min((36 - joystick.numButtons) / 4, SDL_JoystickNumHats(joydev));
joystick.isGameController = 0;
initprintf("Joystick %d has %d axes, %d buttons, and %d hat(s).\n", i+1, joystick.numAxes, joystick.numButtons, joystick.numHats);
buildprint("Joystick ", i+1, " has ", joystick.numAxes, " axes, ", joystick.numButtons, " buttons, ",
(joystick.numHats ? std::to_string(joystick.numHats).c_str() : "no"), " hats, and ",
(joystick.numBalls ? std::to_string(joystick.numBalls).c_str() : "no"), " balls.\n");
Xfree(joystick.pAxis);
joystick.pAxis = (int32_t *)Xcalloc(joystick.numAxes, sizeof(int32_t));
@ -959,18 +970,9 @@ void mouseGrabInput(bool grab)
g_mouseGrabbed = grab;
inputState.MouseSetPos(0, 0);
}
void mouseLockToWindow(char a)
{
if (!(a & 2))
{
mouseGrabInput(a);
g_mouseLockedToWindow = g_mouseGrabbed;
}
// Fixme
SDL_ShowCursor(GUICapture ? SDL_ENABLE : SDL_DISABLE);
SDL_ShowCursor(!grab ? SDL_ENABLE : SDL_DISABLE);
if (grab) GUICapture &= ~1;
else GUICapture |= 1;
}
//
@ -1663,6 +1665,7 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
switch (ev->type)
{
case SDL_MOUSEMOTION:
//case SDL_JOYBALLMOTION:
{
// The menus need this, even in non GUI-capture mode
event_t event;
@ -1706,8 +1709,27 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
if (j < 0)
break;
event_t evt = { uint8_t((ev->button.state == SDL_PRESSED)? EV_KeyDown : EV_KeyUp), 0, (int16_t)j};
D_PostEvent(&evt);
if (!(GUICapture & 1))
{
event_t evt = { uint8_t((ev->button.state == SDL_PRESSED) ? EV_KeyDown : EV_KeyUp), 0, (int16_t)j };
D_PostEvent(&evt);
}
else
{
event_t evt;
evt.type = EV_GUI_Event;
evt.subtype = uint8_t((ev->button.state == SDL_PRESSED) ? EV_GUI_LButtonDown : EV_GUI_LButtonUp);
evt.data1 = ev->motion.x;
evt.data2 = ev->motion.y;
SDL_Keymod kmod = SDL_GetModState();
evt.data3 = ((kmod & KMOD_SHIFT) ? GKM_SHIFT : 0) |
((kmod & KMOD_CTRL) ? GKM_CTRL : 0) |
((kmod & KMOD_ALT) ? GKM_ALT : 0);
D_PostEvent(&evt);
}
break;
}
@ -1779,7 +1801,7 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
break;
case SDL_QUIT:
quitevent = 1;
throw ExitEvent(0); // completely bypass the hackery in the games to block Alt-F4.
return -1;
}
@ -1890,7 +1912,7 @@ int32_t handleevents_pollsdl(void)
{
code = ev.text.text[j];
// Fixme: Send an EV_GUI_Event instead and properly deal with Unicode.
if (GUICapture & 1)
if ((GUICapture & 1) && menuactive != MENU_WaitKey)
{
event_t ev = { EV_GUI_Event, EV_GUI_Char, int16_t(j), !!(SDL_GetModState() & KMOD_ALT) };
D_PostEvent(&ev);
@ -1902,7 +1924,7 @@ int32_t handleevents_pollsdl(void)
case SDL_KEYDOWN:
case SDL_KEYUP:
{
if (GUICapture & 1)
if ((GUICapture & 1) && menuactive != MENU_WaitKey)
{
event_t event = {};
event.type = EV_GUI_Event;
@ -2060,6 +2082,17 @@ int32_t handleevents(void)
return rv;
}
void I_SetMouseCapture()
{
// Clear out any mouse movement.
SDL_CaptureMouse(SDL_TRUE);
}
void I_ReleaseMouseCapture()
{
SDL_CaptureMouse(SDL_FALSE);
}
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
//
@ -2078,3 +2111,4 @@ void debugprintf(const char* f, ...)
OutputDebugStringA(buf);
}

View file

@ -52,10 +52,17 @@ ATTRIBUTE((flatten)) void timerUpdateClock(void)
totalclock += n;
timerlastsample += n*nanoseconds(1000000000/timerticspersec);
// This function can get called from deep within processing loops.
// The callbacks in here may not be called recursively, though.
static bool recursion;
if (recursion) return;
recursion = true;
for (; n > 0; n--)
{
for (auto cb : callbacks) cb();
}
recursion = false;
}
void(*timerSetCallback(void(*callback)(void)))(void)

View file

@ -607,7 +607,7 @@ static void read_pal(FileReader &fil, int32_t pal[256])
static int32_t loadvox(const char *filnam)
{
auto fil = kopenFileReader(filnam, 0);
auto fil = fileSystem.OpenFileReader(filnam, 0);
if (!fil.isOpen())
return -1;
@ -683,7 +683,7 @@ static int32_t loadkvx(const char *filnam)
{
int32_t i, mip1leng;
auto fil = kopenFileReader(filnam, 0);
auto fil = fileSystem.OpenFileReader(filnam, 0);
if (!fil.isOpen())
return -1;
@ -767,7 +767,7 @@ static int32_t loadkv6(const char *filnam)
{
int32_t i;
auto fil = kopenFileReader(filnam, 0);
auto fil = fileSystem.OpenFileReader(filnam, 0);
if (!fil.isOpen())
return -1;

View file

@ -31,6 +31,7 @@
#include "renderstyle.h"
#include "drawparms.h"
#include "vectors.h"
#include "gamecvars.h"
//#include "doomtype.h"
#include "templates.h"
//#include "r_utility.h"
@ -554,3 +555,49 @@ void F2DDrawer::Clear()
mData.Clear();
mIsFirstPass = true;
}
//==========================================================================
//
//
//
//==========================================================================
#include "build.h"
#include "../src/engine_priv.h"
void F2DDrawer::rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
int8_t dashade, uint8_t dapalnum, int32_t dastat, uint8_t daalpha, uint8_t dablend,
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2)
{
if (r_rotatespritenowidescreen)
{
dastat |= RS_STRETCH;
dastat &= ~RS_ALIGN_MASK;
}
// This is mainly a hack because the rotatesprite code is far too messed up to integrate into the 2D drawer.
// This merely stores the parameters and later just calls polymost_rotatesprite do do the work.
// Cleanup can be done once everything is working - but for the menu's transition the original calls should be preserved.
RenderCommand dg;
dg.mType = DrawTypeRotateSprite;
// Just store the values in the otherwise useless fields of the draw command instead of allocating separate memory.
dg.mVertIndex = sx;
dg.mVertCount = sy;
dg.mIndexIndex = z;
dg.mIndexCount = a;
dg.mSpecialColormap[0].d = picnum;
dg.mRemapIndex = dashade;
dg.mFlags = dapalnum;
dg.mSpecialColormap[1].d = dastat;
dg.mDesaturate = daalpha;
dg.mColor1.d = dablend;
dg.mScissor[0] = cx1;
dg.mScissor[1] = cy1;
dg.mScissor[2] = cx2;
dg.mScissor[3] = cy2;
mData.Push(dg); // don't even try to merge.
}

View file

@ -19,6 +19,7 @@ public:
DrawTypeTriangles,
DrawTypeLines,
DrawTypePoints,
DrawTypeRotateSprite,
};
enum ETextureFlags : uint8_t
@ -85,7 +86,7 @@ public:
bool isCompatible(const RenderCommand &other) const
{
return mTexture == other.mTexture &&
mType == other.mType &&
mType == other.mType && mType != DrawTypeRotateSprite &&
mRemapIndex == other.mRemapIndex &&
mSpecialColormap[0].d == other.mSpecialColormap[0].d &&
mSpecialColormap[1].d == other.mSpecialColormap[1].d &&
@ -122,6 +123,10 @@ public:
void AddThickLine(int x1, int y1, int x2, int y2, double thickness, uint32_t color, uint8_t alpha = 255);
void AddPixel(int x1, int y1, uint32_t color);
void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
int8_t dashade, uint8_t dapalnum, int32_t dastat, uint8_t daalpha, uint8_t dablend,
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
void Clear();
bool mIsFirstPass = true;

View file

@ -107,6 +107,36 @@ int CleanWidth, CleanHeight;
int CleanXfac_1, CleanYfac_1, CleanWidth_1, CleanHeight_1;
void V_UpdateModeSize(int width, int height)
{
// This calculates the menu scale.
// The optimal scale will always be to fit a virtual 640 pixel wide display onto the screen.
// Exceptions are made for a few ranges where the available virtual width is > 480.
// This reference size is being used so that on 800x450 (small 16:9) a scale of 2 gets used.
CleanXfac = std::max(std::min(screen->GetWidth() / 400, screen->GetHeight() / 240), 1);
if (CleanXfac >= 4) CleanXfac--; // Otherwise we do not have enough space for the episode/skill menus in some languages.
CleanYfac = CleanXfac;
CleanWidth = screen->GetWidth() / CleanXfac;
CleanHeight = screen->GetHeight() / CleanYfac;
int w = screen->GetWidth();
int factor;
if (w < 640) factor = 1;
else if (w >= 1024 && w < 1280) factor = 2;
else if (w >= 1600 && w < 1920) factor = 3;
else factor = w / 640;
if (w < 1360) factor = 1;
else if (w < 1920) factor = 2;
else factor = int(factor * 0.7);
CleanYfac_1 = CleanXfac_1 = factor;// MAX(1, int(factor * 0.7));
CleanWidth_1 = width / CleanXfac_1;
CleanHeight_1 = height / CleanYfac_1;
}
//==========================================================================
//
// Draw parameter parsing
@ -871,3 +901,4 @@ void ScaleWithAspect(int& w, int& h, int Width, int Height)
h = static_cast<int>(y);
}

View file

@ -42,11 +42,13 @@ double AspectPspriteOffset(float aspect);
int AspectMultiplier(float aspect);
bool AspectTallerThanWide(float aspect);
void ScaleWithAspect(int& w, int& h, int Width, int Height);
void V_UpdateModeSize(int width, int height);
void DrawTexture(F2DDrawer *drawer, FTexture* img, double x, double y, int tags_first, ...);
void DrawChar (F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, int character, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, const char *string, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, const char32_t *string, int tag_first, ...);
void DrawFrame(F2DDrawer* twod, PalEntry color, int left, int top, int width, int height, int thickness);
EXTERN_CVAR(Int, con_scaletext) // Scale notify text at high resolutions?
EXTERN_CVAR(Int, con_scale)

View file

@ -44,6 +44,7 @@
#include "v_draw.h"
#include "image.h"
#include "v_2ddrawer.h"
#include "gstrings.h"
#include "v_font.h"
class FFont;
@ -225,7 +226,7 @@ void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double
{
return;
}
DrawTextCommon(drawer, font, normalcolor, x, y, (const uint8_t*)string, parms);
DrawTextCommon(drawer, font, normalcolor, x, y, (const uint8_t*)GStrings.localize(string), parms);
}
void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, const char32_t *string, int tag_first, ...)
@ -246,3 +247,25 @@ void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double
DrawTextCommon(drawer, font, normalcolor, x, y, string, parms);
}
//==========================================================================
//
// V_DrawFrame
//
// Draw a frame around the specified area using the view border
// frame graphics. The border is drawn outside the area, not in it.
//
//==========================================================================
void DrawFrame(F2DDrawer* twod, PalEntry color, int left, int top, int width, int height, int thickness)
{
// Sanity check for incomplete gameinfo
int offset = thickness == -1 ? screen->GetHeight() / 400 : thickness;
int right = left + width;
int bottom = top + height;
// Draw top and bottom sides.
twod->AddColorOnlyQuad(left, top - offset, width, offset, color);
twod->AddColorOnlyQuad(left - offset, top - offset, offset, height + 2 * offset, color);
twod->AddColorOnlyQuad(left, bottom, width, offset, color);
twod->AddColorOnlyQuad(right, top - offset, offset, height + 2 * offset, color);
}

View file

@ -649,7 +649,7 @@ CCMD(rebind)
//
//=============================================================================
void ReadBindings(int lump)
void ReadBindings(int lump, bool override)
{
FScanner sc(lump);
@ -675,20 +675,26 @@ void ReadBindings(int lump)
}
key = GetConfigKeyFromName(sc.String);
sc.MustGetString();
dest->SetBind(key, sc.String);
dest->SetBind(key, sc.String, override);
}
}
void CONFIG_SetDefaultKeys(const char* baseconfig)
{
auto lump = fileSystem.GetFile(baseconfig);
ReadBindings(lump);
auto lump = fileSystem.GetFile("demolition/commonbinds.txt", ELookupMode::FullName, 0);
if (lump >= 0) ReadBindings(lump, true);
int lastlump = 0;
while ((lump = fileSystem.Iterate(baseconfig, &lastlump)) != -1)
{
if (fileSystem.GetFileContainer(lump) > 0) break;
ReadBindings(lump, true);
}
while ((lump = fileSystem.Iterate("defbinds.txt", &lastlump)) != -1)
{
ReadBindings(lump);
ReadBindings(lump, false);
}
}
@ -802,3 +808,4 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
}
return false;
}

View file

@ -61,8 +61,9 @@ public:
void DoBind (const char *key, const char *bind);
void DefaultBind(const char *keyname, const char *cmd);
void SetBind(unsigned int key, const char *bind)
void SetBind(unsigned int key, const char *bind, bool override = true)
{
if (!override && Binds[key].IsNotEmpty()) return;
if (key < NUM_KEYS) Binds[key] = bind;
}
@ -115,4 +116,13 @@ struct FKeySection
};
extern TArray<FKeySection> KeySections;
struct GameFuncDesc
{
const char *action;
const char *description;
bool replaced;
};
#endif //__C_BINDINGS_H__

View file

@ -48,170 +48,72 @@ struct ButtonDesc
};
static const ButtonDesc gamefuncs[] = {
{ gamefunc_Move_Forward, "Move_Forward"},
{ gamefunc_Move_Backward, "Move_Backward"},
{ gamefunc_Turn_Left, "Turn_Left"},
{ gamefunc_Turn_Right, "Turn_Right"},
{ gamefunc_Strafe, "Strafe"},
{ gamefunc_Fire, "Fire"},
{ gamefunc_Open, "Open"},
{ gamefunc_Run, "Run"},
{ gamefunc_Alt_Fire, "Alt_Fire"},
{ gamefunc_Jump, "Jump"},
{ gamefunc_Crouch, "Crouch"},
{ gamefunc_Look_Up, "Look_Up"},
{ gamefunc_Look_Down, "Look_Down"},
{ gamefunc_Look_Left, "Look_Left"},
{ gamefunc_Look_Right, "Look_Right"},
{ gamefunc_Strafe_Left, "Strafe_Left"},
{ gamefunc_Strafe_Right, "Strafe_Right"},
{ gamefunc_Aim_Up, "Aim_Up"},
{ gamefunc_Aim_Down, "Aim_Down"},
{ gamefunc_Weapon_1, "Weapon_1"},
{ gamefunc_Weapon_2, "Weapon_2"},
{ gamefunc_Weapon_3, "Weapon_3"},
{ gamefunc_Weapon_4, "Weapon_4"},
{ gamefunc_Weapon_5, "Weapon_5"},
{ gamefunc_Weapon_6, "Weapon_6"},
{ gamefunc_Weapon_7, "Weapon_7"},
{ gamefunc_Weapon_8, "Weapon_8"},
{ gamefunc_Weapon_9, "Weapon_9"},
{ gamefunc_Weapon_10, "Weapon_10"},
{ gamefunc_Inventory, "Inventory"},
{ gamefunc_Inventory_Left, "Inventory_Left"},
{ gamefunc_Inventory_Right, "Inventory_Right"},
{ gamefunc_Holo_Duke, "Holo_Duke"},
{ gamefunc_Jetpack, "Jetpack"},
{ gamefunc_NightVision, "NightVision"},
{ gamefunc_MedKit, "MedKit"},
{ gamefunc_TurnAround, "Turn_Around"},
{ gamefunc_SendMessage, "Send_Message"},
{ gamefunc_Map, "Map"},
{ gamefunc_Shrink_Screen, "Shrink_Screen"},
{ gamefunc_Enlarge_Screen, "Enlarge_Screen"},
{ gamefunc_Center_View, "Center_View"},
{ gamefunc_Holster_Weapon, "Holster_Weapon"},
{ gamefunc_Move_Forward, "Move_Forward"},
{ gamefunc_Move_Backward, "Move_Backward"},
{ gamefunc_Turn_Left, "Turn_Left"},
{ gamefunc_Turn_Right, "Turn_Right"},
{ gamefunc_Strafe, "Strafe"},
{ gamefunc_Fire, "Fire"},
{ gamefunc_Open, "Open"},
{ gamefunc_Run, "Run"},
{ gamefunc_Alt_Fire, "Alt_Fire"},
{ gamefunc_Jump, "Jump"},
{ gamefunc_Crouch, "Crouch"},
{ gamefunc_Look_Up, "Look_Up"},
{ gamefunc_Look_Down, "Look_Down"},
{ gamefunc_Look_Left, "Look_Left"},
{ gamefunc_Look_Right, "Look_Right"},
{ gamefunc_Strafe_Left, "Strafe_Left"},
{ gamefunc_Strafe_Right, "Strafe_Right"},
{ gamefunc_Aim_Up, "Aim_Up"},
{ gamefunc_Aim_Down, "Aim_Down"},
{ gamefunc_Weapon_1, "Weapon_1"},
{ gamefunc_Weapon_2, "Weapon_2"},
{ gamefunc_Weapon_3, "Weapon_3"},
{ gamefunc_Weapon_4, "Weapon_4"},
{ gamefunc_Weapon_5, "Weapon_5"},
{ gamefunc_Weapon_6, "Weapon_6"},
{ gamefunc_Weapon_7, "Weapon_7"},
{ gamefunc_Weapon_8, "Weapon_8"},
{ gamefunc_Weapon_9, "Weapon_9"},
{ gamefunc_Weapon_10, "Weapon_10"},
{ gamefunc_Inventory, "Inventory"},
{ gamefunc_Inventory_Left, "Inventory_Left"},
{ gamefunc_Inventory_Right, "Inventory_Right"},
{ gamefunc_Holo_Duke, "Holo_Duke"},
{ gamefunc_Jetpack, "Jetpack"},
{ gamefunc_NightVision, "NightVision"},
{ gamefunc_MedKit, "MedKit"},
{ gamefunc_TurnAround, "Turn_Around"},
{ gamefunc_SendMessage, "Send_Message"},
{ gamefunc_Map, "Map"},
{ gamefunc_Shrink_Screen, "Shrink_Screen"},
{ gamefunc_Enlarge_Screen, "Enlarge_Screen"},
{ gamefunc_Center_View, "Center_View"},
{ gamefunc_Holster_Weapon, "Holster_Weapon"},
{ gamefunc_Show_Opponents_Weapon, "Show_Opponents_Weapon"},
{ gamefunc_Map_Follow_Mode, "Map_Follow_Mode"},
{ gamefunc_Map_Follow_Mode, "Map_Follow_Mode"},
{ gamefunc_See_Coop_View, "See_Coop_View"},
{ gamefunc_Mouse_Aiming, "Mouse_Aiming"},
{ gamefunc_Mouse_Aiming, "Mouse_Aiming"},
{ gamefunc_Toggle_Crosshair, "Toggle_Crosshair"},
{ gamefunc_Steroids, "Steroids"},
{ gamefunc_Quick_Kick, "Quick_Kick"},
{ gamefunc_Next_Weapon, "Next_Weapon"},
{ gamefunc_Previous_Weapon, "Previous_Weapon"},
{ gamefunc_Show_Console, "Show_Console"},
{ gamefunc_Show_DukeMatch_Scores, "Show_DukeMatch_Scores"},
{ gamefunc_Steroids, "Steroids"},
{ gamefunc_Quick_Kick, "Quick_Kick"},
{ gamefunc_Next_Weapon, "Next_Weapon"},
{ gamefunc_Previous_Weapon, "Previous_Weapon"},
{ gamefunc_Show_DukeMatch_Scores, "Show_DukeMatch_Scores"},
{ gamefunc_Dpad_Select, "Dpad_Select"},
{ gamefunc_Dpad_Aiming, "Dpad_Aiming"},
{ gamefunc_AutoRun, "AutoRun"},
{ gamefunc_Last_Weapon, "Last_Used_Weapon"},
{ gamefunc_Quick_Save, "Quick_Save"},
{ gamefunc_Quick_Load, "Quick_Load"},
{ gamefunc_Alt_Weapon, "Alt_Weapon"},
{ gamefunc_Third_Person_View, "Third_Person_View"},
{ gamefunc_Toggle_Crouch, "Toggle_Crouch"},
{ gamefunc_See_Chase_View, "See_Chase_View"}, // the following were added by Blood
{ gamefunc_BeastVision, "BeastVision"},
{ gamefunc_CrystalBall, "CrystalBall"},
{ gamefunc_JumpBoots, "JumpBoots"},
{ gamefunc_ProximityBombs, "ProximityBombs"},
{ gamefunc_RemoteBombs, "RemoteBombs"},
{ gamefunc_Smoke_Bomb, "Smoke_Bomb" },
{ gamefunc_Gas_Bomb, "Gas_Bomb" },
{ gamefunc_Flash_Bomb, "Flash_Bomb" },
{ gamefunc_Caltrops, "Calitrops" },
};
static const ButtonDesc gamealiases_Duke3D[] = {
{ gamefunc_BeastVision, ""},
{ gamefunc_CrystalBall, ""},
{ gamefunc_ProximityBombs, ""},
{ gamefunc_RemoteBombs, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
};
static const ButtonDesc gamealiases_Nam[] = {
{ gamefunc_Holo_Duke, "Holo_Soldier"},
{ gamefunc_Jetpack, "Huey"},
{ gamefunc_Steroids, "Tank_Mode"},
{ gamefunc_Show_DukeMatch_Scores, "Show_GruntMatch_Scores"},
{ gamefunc_BeastVision, ""},
{ gamefunc_CrystalBall, ""},
{ gamefunc_ProximityBombs, ""},
{ gamefunc_RemoteBombs, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
};
static const ButtonDesc gamealiases_WW2GI[] = {
{ gamefunc_Holo_Duke, "Fire Mission"},
{ gamefunc_Jetpack, ""},
{ gamefunc_Steroids, "Smokes"},
{ gamefunc_Show_DukeMatch_Scores, "Show_GIMatch_Scores"},
{ gamefunc_BeastVision, ""},
{ gamefunc_CrystalBall, ""},
{ gamefunc_ProximityBombs, ""},
{ gamefunc_RemoteBombs, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
};
static const ButtonDesc gamealiases_RR[] = {
{ gamefunc_Holo_Duke, "Beer"},
{ gamefunc_Jetpack, "Cow Pie"},
{ gamefunc_NightVision, "Yeehaa"},
{ gamefunc_MedKit, "Whiskey"},
{ gamefunc_Steroids, "Moonshine"},
{ gamefunc_Quick_Kick, "Pee"},
{ gamefunc_Show_DukeMatch_Scores, "Show_Scores"},
{ gamefunc_Alt_Fire, ""},
{ gamefunc_BeastVision, ""},
{ gamefunc_CrystalBall, ""},
{ gamefunc_ProximityBombs, ""},
{ gamefunc_RemoteBombs, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
};
static const ButtonDesc gamealiases_Blood[] = {
{ gamefunc_Holo_Duke, ""},
{ gamefunc_JumpBoots, "JumpBoots"},
{ gamefunc_Steroids, ""},
{ gamefunc_Quick_Kick, ""},
{ gamefunc_Show_DukeMatch_Scores, ""},
{ gamefunc_Alt_Weapon, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
};
static const ButtonDesc gamealiases_SW[] = {
{ gamefunc_Holo_Duke, ""},
{ gamefunc_Jetpack, ""},
{ gamefunc_NightVision, ""},
{ gamefunc_MedKit, ""},
{ gamefunc_Steroids, ""},
{ gamefunc_Quick_Kick, ""},
{ gamefunc_Show_DukeMatch_Scores, ""},
{ gamefunc_Smoke_Bomb, "" },
{ gamefunc_Gas_Bomb, "" },
{ gamefunc_Flash_Bomb, "" },
{ gamefunc_Caltrops, "" },
{ gamefunc_Alt_Weapon, "Alt_Weapon"},
{ gamefunc_Third_Person_View, "Third_Person_View"},
{ gamefunc_Toggle_Crouch, "Toggle_Crouch"},
{ gamefunc_CrystalBall, "CrystalBall"}, // the following were added by Blood
{ gamefunc_ProximityBombs, "ProximityBombs"},
{ gamefunc_RemoteBombs, "RemoteBombs"},
{ gamefunc_Smoke_Bomb, "Smoke_Bomb" },
{ gamefunc_Gas_Bomb, "Gas_Bomb" },
{ gamefunc_Flash_Bomb, "Flash_Bomb" },
{ gamefunc_Caltrops, "Caltrops" },
};
@ -236,60 +138,7 @@ ButtonMap::ButtonMap()
for(auto &gf : gamefuncs)
{
NameToNum.Insert(gf.name, gf.index);
NumToAlias[gf.index] = NumToName[gf.index] = gf.name;
}
}
//=============================================================================
//
//
//
//=============================================================================
void ButtonMap::SetGameAliases()
{
// Ion Fury hacks this together from the CON script and uses the same table as Duke Nukem
if (g_gameType & (GAMEFLAG_DUKE|GAMEFLAG_FURY))
{
for (auto& gf : gamealiases_Duke3D)
{
NumToAlias[gf.index] = gf.name;
}
}
if (g_gameType & GAMEFLAG_NAM)
{
for (auto& gf : gamealiases_Nam)
{
NumToAlias[gf.index] = gf.name;
}
}
if (g_gameType & GAMEFLAG_WW2GI)
{
for (auto& gf : gamealiases_WW2GI)
{
NumToAlias[gf.index] = gf.name;
}
}
if (g_gameType & (GAMEFLAG_RR|GAMEFLAG_RRRA))
{
for (auto& gf : gamealiases_RR)
{
NumToAlias[gf.index] = gf.name;
}
}
if (g_gameType & GAMEFLAG_BLOOD)
{
for (auto& gf : gamealiases_Blood)
{
NumToAlias[gf.index] = gf.name;
}
}
if (g_gameType & GAMEFLAG_SW)
{
for (auto& gf : gamealiases_SW)
{
NumToAlias[gf.index] = gf.name;
}
NumToName[gf.index] = gf.name;
}
}
@ -306,18 +155,16 @@ int ButtonMap::ListActionCommands (const char *pattern)
for (int i = 0; i < NumButtons(); i++)
{
if (NumToAlias[i].IsEmpty()) continue; // do not list buttons that were removed from the alias list
if (pattern == NULL || CheckWildcards (pattern,
(snprintf (matcher, countof(matcher), "+%s", NumToName[i].GetChars()), matcher)))
{
Printf ("+%s\n", NumToName[i]);
Printf ("+%s\n", NumToName[i].GetChars());
count++;
}
if (pattern == NULL || CheckWildcards (pattern,
(snprintf (matcher, countof(matcher), "-%s", NumToName[i].GetChars()), matcher)))
{
Printf ("-%s\n", NumToName[i]);
Printf ("-%s\n", NumToName[i].GetChars());
count++;
}
}
@ -374,34 +221,6 @@ void ButtonMap::ResetButtonStates ()
}
}
//=============================================================================
//
//
//
//=============================================================================
void ButtonMap::SetButtonAlias(int num, const char *text)
{
if ((unsigned)num >= (unsigned)NUMGAMEFUNCTIONS)
return;
NumToAlias[num] = text;
NameToNum.Insert(text, num);
}
//=============================================================================
//
//
//
//=============================================================================
void ButtonMap::ClearButtonAlias(int num)
{
if ((unsigned)num >= (unsigned)NUMGAMEFUNCTIONS)
return;
NumToAlias[num] = "";
}
//=============================================================================
//
//
@ -497,4 +316,3 @@ bool FButtonStatus::ReleaseKey (int keynum)
// Returns true if releasing this key caused the button to go up.
return wasdown && !bDown;
}

View file

@ -46,6 +46,7 @@ enum GameFunction_t
gamefunc_JumpBoots = gamefunc_Jetpack,
gamefunc_NightVision,
gamefunc_Night_Vision = gamefunc_NightVision,
gamefunc_BeastVision = gamefunc_NightVision,
gamefunc_MedKit,
gamefunc_Med_Kit = gamefunc_MedKit,
gamefunc_TurnAround,
@ -68,19 +69,14 @@ enum GameFunction_t
gamefunc_Quick_Kick,
gamefunc_Next_Weapon,
gamefunc_Previous_Weapon,
gamefunc_Show_Console,
gamefunc_Show_DukeMatch_Scores,
gamefunc_Dpad_Select,
gamefunc_Dpad_Aiming,
gamefunc_AutoRun,
gamefunc_Last_Weapon,
gamefunc_Quick_Save,
gamefunc_Quick_Load,
gamefunc_Alt_Weapon,
gamefunc_Third_Person_View,
gamefunc_See_Chase_View = gamefunc_Third_Person_View, // this was added by Blood
gamefunc_Toggle_Crouch,
gamefunc_BeastVision,
gamefunc_See_Chase_View = gamefunc_Third_Person_View,
gamefunc_Toggle_Crouch, // This is the last one used by EDuke32.
gamefunc_CrystalBall,
gamefunc_ProximityBombs,
gamefunc_RemoteBombs,
@ -119,7 +115,6 @@ class ButtonMap
FButtonStatus Buttons[NUMGAMEFUNCTIONS];
FString NumToName[NUMGAMEFUNCTIONS]; // The internal name of the button
FString NumToAlias[NUMGAMEFUNCTIONS]; // The display name which can be altered by scripts.
TMap<FName, int> NameToNum;
public:
@ -139,6 +134,7 @@ public:
return index > -1? &Buttons[index] : nullptr;
}
// This is still in use but all cases are scheduled for termination.
const char* GetButtonName(int32_t func) const
{
if ((unsigned)func >= (unsigned)NumButtons())
@ -146,15 +142,6 @@ public:
return NumToName[func];
}
const char* GetButtonAlias(int32_t func) const
{
if ((unsigned)func >= (unsigned)NumButtons())
return nullptr;
return NumToAlias[func];
}
void SetButtonAlias(int num, const char* text);
void ClearButtonAlias(int num);
void ResetButtonTriggers (); // Call ResetTriggers for all buttons
void ResetButtonStates (); // Same as above, but also clear bDown
int ListActionCommands(const char* pattern);

View file

@ -0,0 +1,276 @@
/*
** c_con.cpp
** Interface for CON scripts.
**
**
**---------------------------------------------------------------------------
** Copyright 2019 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include <stdlib.h>
#include "basics.h"
#include "zstring.h"
#include "c_bind.h"
#include "control.h"
#include "gamecontrol.h"
//=============================================================================
//
// Interface for CON scripts to get descriptions for actions
// This code can query the 64 original game functions by index.
//
// This is mostly an ill-advised hackery to change menu texts. It no longer
// changes the menu but gets used when scripts try to write
// key related messages. Ion Fury uses this and is one of the reasons
// why that game is by all accounts not localizable.
//
// Important note: The list of actions may not be altered. If some of these
// commands get refactored, the string below needs to be changed to match
// the new command.
//
//=============================================================================
static GameFuncDesc con_gamefuncs[] = {
{"+Move_Forward", "Move_Forward"},
{"+Move_Backward", "Move_Backward"},
{"+Turn_Left", "Turn_Left"},
{"+Turn_Right", "Turn_Right"},
{"+Strafe", "Strafe"},
{"+Fire", "Fire"},
{"+Open", "Open"},
{"+Run", "Run"},
{"+Alt_Fire", "Alt_Fire"},
{"+Jump", "Jump"},
{"+Crouch", "Crouch"},
{"+Look_Up", "Look_Up"},
{"+Look_Down", "Look_Down"},
{"+Look_Left", "Look_Left"},
{"+Look_Right", "Look_Right"},
{"+Strafe_Left", "Strafe_Left"},
{"+Strafe_Right", "Strafe_Right"},
{"+Aim_Up", "Aim_Up"},
{"+Aim_Down", "Aim_Down"},
{"+Weapon_1", "Weapon_1"},
{"+Weapon_2", "Weapon_2"},
{"+Weapon_3", "Weapon_3"},
{"+Weapon_4", "Weapon_4"},
{"+Weapon_5", "Weapon_5"},
{"+Weapon_6", "Weapon_6"},
{"+Weapon_7", "Weapon_7"},
{"+Weapon_8", "Weapon_8"},
{"+Weapon_9", "Weapon_9"},
{"+Weapon_10", "Weapon_10"},
{"+Inventory", "Inventory"},
{"+Inventory_Left", "Inventory_Left"},
{"+Inventory_Right", "Inventory_Right"},
{"+Holo_Duke", "Holo_Duke"},
{"+Jetpack", "Jetpack"},
{"+NightVision", "NightVision"},
{"+MedKit", "MedKit"},
{"+TurnAround", "TurnAround"},
{"+SendMessage", "SendMessage"},
{"+Map", "Map"},
{"+Shrink_Screen", "Shrink_Screen"},
{"+Enlarge_Screen", "Enlarge_Screen"},
{"+Center_View", "Center_View"},
{"+Holster_Weapon", "Holster_Weapon"},
{"+Show_Opponents_Weapon", "Show_Opponents_Weapon"},
{"+Map_Follow_Mode", "Map_Follow_Mode"},
{"+See_Coop_View", "See_Coop_View"},
{"+Mouse_Aiming", "Mouse_Aiming"},
{"+Toggle_Crosshair", "Toggle_Crosshair"},
{"+Steroids", "Steroids"},
{"+Quick_Kick", "Quick_Kick"},
{"+Next_Weapon", "Next_Weapon"},
{"+Previous_Weapon", "Previous_Weapon"},
{"ToggleConsole", "Show_Console"},
{"+Show_DukeMatch_Scores", "Show_Scoreboard"},
{"+Dpad_Select", "Dpad_Select"},
{"+Dpad_Aiming", "Dpad_Aiming"},
{"toggle cl_autorun", "AutoRun"},
{"+Last_Used_Weapon", "Last_Used_Weapon"},
{"QuickSave", "Quick_Save"},
{"QuickLoad", "Quick_Load"},
{"+Alt_Weapon", "Alt_Weapon"},
{"+Third_Person_View", "Third_Person_View"},
{"+Toggle_Crouch", "Toggle_Crouch"}
};
//=============================================================================
//
//
//
//=============================================================================
void C_CON_SetAliases()
{
if (g_gameType & GAMEFLAG_NAM)
{
con_gamefuncs[32].description = "Holo_Soldier";
con_gamefuncs[33].description = "Huey";
con_gamefuncs[48].description = "Tank_Mode";
}
if (g_gameType & GAMEFLAG_WW2GI)
{
con_gamefuncs[32].description = "Fire_Mission";
con_gamefuncs[33].description = "";
con_gamefuncs[48].description = "Smokes";
}
}
static FString C_CON_GetGameFuncOnKeyboard(int gameFunc)
{
if (gameFunc >= 0 && gameFunc < countof(con_gamefuncs))
{
auto keys = Bindings.GetKeysForCommand(con_gamefuncs[gameFunc].action);
for (auto key : keys)
{
if (key < KEY_FIRSTMOUSEBUTTON)
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
}
return "";
}
static FString C_CON_GetGameFuncOnMouse(int gameFunc)
{
if (gameFunc >= 0 && gameFunc < countof(con_gamefuncs))
{
auto keys = Bindings.GetKeysForCommand(con_gamefuncs[gameFunc].action);
for (auto key : keys)
{
if ((key >= KEY_FIRSTMOUSEBUTTON && key < KEY_FIRSTJOYBUTTON) || (key >= KEY_MWHEELUP && key <= KEY_MWHEELLEFT))
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
}
return "";
}
char const* C_CON_GetGameFuncOnJoystick(int gameFunc)
{
if (gameFunc >= 0 && gameFunc < countof(con_gamefuncs))
{
auto keys = Bindings.GetKeysForCommand(con_gamefuncs[gameFunc].action);
for (auto key : keys)
{
if (key >= KEY_FIRSTJOYBUTTON && !(key >= KEY_MWHEELUP && key <= KEY_MWHEELLEFT))
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
}
return "";
}
FString C_CON_GetBoundKeyForLastInput(int gameFunc)
{
if (CONTROL_LastSeenInput == LastSeenInput::Joystick)
{
FString name = C_CON_GetGameFuncOnJoystick(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
}
FString name = C_CON_GetGameFuncOnKeyboard(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
name = C_CON_GetGameFuncOnMouse(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
name = C_CON_GetGameFuncOnJoystick(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
return "UNBOUND";
}
//=============================================================================
//
//
//
//=============================================================================
void C_CON_SetButtonAlias(int num, const char *text)
{
if (num >= 0 && num < countof(con_gamefuncs))
{
if (con_gamefuncs[num].replaced) free((void*)con_gamefuncs[num].description);
con_gamefuncs[num].description = strdup(text);
con_gamefuncs[num].replaced = true;
}
}
//=============================================================================
//
//
//
//=============================================================================
void C_CON_ClearButtonAlias(int num)
{
if (num >= 0 && num < countof(con_gamefuncs))
{
if (con_gamefuncs[num].replaced) free((void*)con_gamefuncs[num].description);
con_gamefuncs[num].description = "";
con_gamefuncs[num].replaced = false;
}
}
//=============================================================================
//
//
//
//=============================================================================
const char *C_CON_GetButtonFunc(int num)
{
if (num >= 0 && num < countof(con_gamefuncs))
{
return con_gamefuncs[num].action;
}
return "";
}

View file

@ -53,6 +53,9 @@
#include "v_font.h"
#include "printf.h"
#include "inputstate.h"
#include "i_time.h"
#include "gamecvars.h"
#include "baselayer.h"
#define LEFTMARGIN 8
@ -123,15 +126,13 @@ static GameAtExit *ExitCmdList;
#define SCROLLDN 2
#define SCROLLNO 0
CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
// Buffer for AddToConsole()
static char *work = NULL;
static int worklen = 0;
CVAR(Float, con_notifytime, 3.f, CVAR_ARCHIVE)
CVAR(Bool, con_centernotify, false, CVAR_ARCHIVE)
CUSTOM_CVAR(Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high resolutions?
CUSTOM_CVAR(Int, con_scaletext, 2, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // Scale notify text at high resolutions?
{
if (self < 0) self = 0;
}
@ -205,13 +206,13 @@ public:
if (scale == 1)
{
DrawChar(&twod, CurrentConsoleFont, CR_ORANGE, x, y, '\x1c', TAG_DONE);
DrawText(&twod, CurrentConsoleFont, CR_ORANGE, x + CurrentConsoleFont->GetCharWidth(0x1c), y,
DrawText(&twod, CurrentConsoleFont, CR_ORANGE, x + CurrentConsoleFont->CharWidth(0x1c), y,
&Text[StartPos], TAG_DONE);
if (cursor)
{
DrawChar(&twod, CurrentConsoleFont, CR_YELLOW,
x + CurrentConsoleFont->GetCharWidth(0x1c) + (CursorPosCells - StartPosCells) * CurrentConsoleFont->GetCharWidth(0xb),
x + CurrentConsoleFont->CharWidth(0x1c) + (CursorPosCells - StartPosCells) * CurrentConsoleFont->CharWidth(0xb),
y, '\xb', TAG_DONE);
}
}
@ -222,7 +223,7 @@ public:
DTA_VirtualHeight, screen->GetHeight() / scale,
DTA_KeepRatio, true, TAG_DONE);
DrawText(&twod, CurrentConsoleFont, CR_ORANGE, x + CurrentConsoleFont->GetCharWidth(0x1c), y,
DrawText(&twod, CurrentConsoleFont, CR_ORANGE, x + CurrentConsoleFont->CharWidth(0x1c), y,
&Text[StartPos],
DTA_VirtualWidth, screen->GetWidth() / scale,
DTA_VirtualHeight, screen->GetHeight() / scale,
@ -231,7 +232,7 @@ public:
if (cursor)
{
DrawChar(&twod, CurrentConsoleFont, CR_YELLOW,
x + CurrentConsoleFont->GetCharWidth(0x1c) + (CursorPosCells - StartPosCells) * CurrentConsoleFont->GetCharWidth(0xb),
x + CurrentConsoleFont->CharWidth(0x1c) + (CursorPosCells - StartPosCells) * CurrentConsoleFont->CharWidth(0xb),
y, '\xb',
DTA_VirtualWidth, screen->GetWidth() / scale,
DTA_VirtualHeight, screen->GetHeight() / scale,
@ -541,7 +542,7 @@ CUSTOM_CVAR(Int, con_notifylines, NUMNOTIFIES, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
}
int PrintColors[PRINTLEVELS+2] = { CR_RED, CR_GOLD, CR_GRAY, CR_GREEN, CR_GREEN, CR_GOLD };
int PrintColors[PRINTLEVELS+2] = { CR_RED, CR_GOLD, CR_YELLOW, CR_GREEN, CR_GREEN, CR_GOLD };
static void setmsgcolor (int index, int color);
@ -614,7 +615,7 @@ void C_InitConsole (int width, int height, bool ingame)
vidactive = ingame;
if (CurrentConsoleFont != NULL)
{
cwidth = CurrentConsoleFont->GetCharWidth ('M');
cwidth = CurrentConsoleFont->CharWidth ('M');
cheight = CurrentConsoleFont->GetHeight();
}
else
@ -775,7 +776,7 @@ void FNotifyBuffer::AddString(int printlevel, FString source)
TArray<FBrokenLines> lines;
int width;
if ((printlevel != 128 && !show_messages) ||
if (hud_messages != 2 ||
source.IsEmpty() ||
//gamestate == GS_FULLCONSOLE ||
//gamestate == GS_DEMOSCREEN ||
@ -901,7 +902,7 @@ int PrintString (int iprintlevel, const char *outline)
#endif
conbuffer->AddText(printlevel, outline);
if (vidactive && screen && !(iprintlevel & PRINT_NONOTIFY))
if (vidactive && (iprintlevel & PRINT_NOTIFY))
{
NotifyStrings.AddString(printlevel, outline);
}
@ -959,7 +960,7 @@ void OSD_Printf(const char *format, ...)
int count;
va_start (argptr, format);
count = VPrintf (PRINT_HIGH|PRINT_NONOTIFY, format, argptr);
count = VPrintf (PRINT_HIGH, format, argptr);
va_end (argptr);
}
@ -1074,7 +1075,7 @@ void FNotifyBuffer::Tick()
if (Text[i].TimeOut != 0 && --Text[i].TimeOut <= 0)
break;
}
if (i > 0)
if (i < Text.Size())
{
Text.Delete(0, i);
}
@ -1106,9 +1107,6 @@ void FNotifyBuffer::Draw()
j = notify.TimeOut;
if (j > 0)
{
if (!show_messages && notify.PrintLevel != 128)
continue;
double alpha = (j < NOTIFYFADETIME) ? 1. * j / NOTIFYFADETIME : 1;
if (notify.PrintLevel >= PRINTLEVELS)
@ -1320,13 +1318,14 @@ void C_ToggleConsole ()
HistPos = NULL;
TabbedLast = false;
TabbedList = false;
GUICapture |= 1;
mouseGrabInput(false);
}
else //if (gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP)
{
ConsoleState = c_rising;
C_FlushDisplay ();
GUICapture &= ~1;
mouseGrabInput(true);
}
}
@ -1802,7 +1801,7 @@ void C_MidPrint (FFont *font, const char *msg, bool bold)
if (msg != nullptr)
{
auto color = (EColorRange)PrintColors[bold? PRINTLEVELS+1 : PRINTLEVELS];
Printf(PRINT_HIGH|PRINT_NONOTIFY, TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", color, console_bar, msg, console_bar);
Printf(PRINT_HIGH, TEXTCOLOR_ESCAPESTR "%c%s\n%s\n%s\n", color, console_bar, msg, console_bar);
StatusBar->AttachMessage (Create<DHUDMessage>(font, msg, 1.5f, 0.375f, 0, 0, color, con_midtime), MAKE_ID('C','N','T','R'));
}

View file

@ -38,12 +38,14 @@
#include "c_cvars.h"
#include "configfile.h"
#include "baselayer.h"
#include "c_console.h"
#include "gamecvars.h"
#include "cmdlib.h"
#include "c_dispatch.h"
#include "printf.h"
#include "quotemgr.h"
struct FLatchedValue
@ -142,7 +144,7 @@ FBaseCVar::~FBaseCVar ()
const char *FBaseCVar::GetHumanString(int precision) const
{
assert(true);
return "";// GetGenericRep(CVAR_String).String;
return GetGenericRep(CVAR_String).String;
}
void FBaseCVar::ForceSet (UCVarValue value, ECVarType type, bool nouserinfosend)
@ -1511,8 +1513,23 @@ CCMD (toggle)
val = var->GetGenericRep (CVAR_Bool);
val.Bool = !val.Bool;
var->SetGenericRep (val, CVAR_Bool);
Printf ("\"%s\" = \"%s\"\n", var->GetName(),
val.Bool ? "true" : "false");
const char *statestr = argv.argc() <= 2? "*" : argv[2];
if (*statestr == '*')
{
gi->PrintMessage(PRINT_MEDIUM, "\"%s\" = \"%s\"\n", var->GetName(), val.Bool ? "true" : "false");
}
else
{
int state = (int)strtoll(argv[2], nullptr, 0);
if (state != 0)
{
// Order of Duke's quote string varies, some have on first, some off, so use the sign of the parameter to decide.
// Positive means Off/On, negative means On/Off
int quote = state > 0? state + val.Bool : -(state + val.Bool);
auto text = quoteMgr.GetQuote(quote);
if (text) gi->PrintMessage(PRINT_MEDIUM, "%s\n", text);
}
}
}
}
}

View file

@ -1,30 +1,44 @@
//-----------------------------------------------------------------------------
//
// Copyright 1993-1996 id Software
// Copyright 1999-2016 Randy Heit
// Copyright 2002-2016 Christoph Oelckers
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
//
//
//-----------------------------------------------------------------------------
/*
** c_dispatch.cpp
** Functions for executing console commands and aliases
**
**---------------------------------------------------------------------------
** Copyright 1998-2016 Randy Heit
** Copyright 2003-2019 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include "c_bind.h"
#include "d_event.h"
#include "c_console.h"
#include "d_gui.h"
#include "inputstate.h"
#include "menu.h"
int eventhead;
int eventtail;
@ -39,62 +53,6 @@ event_t events[NUM_EVENTS];
bool G_Responder (event_t *ev)
{
#if 0
// any other key pops up menu if in demos
// [RH] But only if the key isn't bound to a "special" command
if (gameaction == ga_nothing &&
(demoplayback || gamestate == GS_DEMOSCREEN || gamestate == GS_TITLELEVEL))
{
const char *cmd = Bindings.GetBind (ev->data1);
if (ev->type == EV_KeyDown)
{
if (!cmd || (
strnicmp (cmd, "menu_", 5) &&
stricmp (cmd, "toggleconsole") &&
stricmp (cmd, "sizeup") &&
stricmp (cmd, "sizedown") &&
stricmp (cmd, "togglemap") &&
stricmp (cmd, "spynext") &&
stricmp (cmd, "spyprev") &&
stricmp (cmd, "chase") &&
stricmp (cmd, "+showscores") &&
stricmp (cmd, "bumpgamma") &&
stricmp (cmd, "screenshot")))
{
M_StartControlPanel(true);
M_SetMenu(NAME_Mainmenu, -1);
return true;
}
else
{
return
C_DoKey (ev, &Bindings, &DoubleBindings);
}
}
if (cmd && cmd[0] == '+')
return C_DoKey (ev, &Bindings, &DoubleBindings);
return false;
}
#endif
#if 0
if (gamestate == GS_LEVEL)
{
if (ST_Responder (ev))
return true; // status window ate it
if (!viewactive && primaryLevel->automap->Responder (ev, false))
return true; // automap ate it
}
else if (gamestate == GS_FINALE)
{
if (F_Responder (ev))
return true; // finale ate the event
}
#endif
switch (ev->type)
{
case EV_KeyDown:
@ -115,10 +73,11 @@ bool G_Responder (event_t *ev)
#endif
}
// [RH] If the view is active, give the automap a chance at
// the events *last* so that any bound keys get precedence.
#if 0
// [RH] If the view is active, give the automap a chance at
// the events *last* so that any bound keys get precedence.
// An option for later. Currently the automap is insufficiently separated from the game loop
if (gamestate == GS_LEVEL && viewactive && primaryLevel->automap)
return primaryLevel->automap->Responder (ev, true);
#endif
@ -150,10 +109,8 @@ void D_ProcessEvents (void)
(void)0;//UpdateJoystickMenu(I_UpdateDeviceList());
if (C_Responder (ev))
continue; // console ate the event
#if 0
if (M_Responder (ev))
continue; // menu ate the event
#endif
G_Responder (ev);
}
}
@ -186,13 +143,6 @@ void D_PostEvent (const event_t *ev)
return;
}
if ((GUICapture & 8) && ev->type == EV_KeyDown)
{
// This must bypass the entire event management
sendKeyForBinding(ev->data1);
return;
}
// Add the key to the global keyboard state.
// This is probably the biggest roadblock with the input system as it undermines a proper event driven approach.
// Too much code depends on just checking this instead of waiting for events to happen.

View file

@ -1,36 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright 1993-1996 id Software
// Copyright 1999-2016 Randy Heit
// Copyright 2002-2016 Christoph Oelckers
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
//
//-----------------------------------------------------------------------------
#ifndef __D_EVENT_H__
#define __D_EVENT_H__
#pragma once
#include <functional>
//
// Event handling.
//
// Input event types.
enum EGenericEvent
{
@ -47,7 +17,7 @@ struct event_t
{
uint8_t type;
uint8_t subtype;
int16_t data1; // keys / mouse/joystick buttons
int16_t data1; // keys / mouse/joystick buttons
int16_t data2;
int16_t data3;
int x; // mouse/joystick x move
@ -61,10 +31,6 @@ void D_PostEvent (const event_t* ev);
void D_RemoveNextCharEvent();
void D_ProcessEvents(void);
//
// GLOBAL VARIABLES
//
enum
{
NUM_EVENTS = 128
@ -72,5 +38,3 @@ enum
extern event_t events[NUM_EVENTS];
#endif

View file

@ -149,8 +149,10 @@ int FDirectory::AddDirectory(const char *dirpath)
(fi[1] == '\0' ||
(fi[1] == '.' && fi[2] == '\0'))))
{
// Skip if requested and do not record . and .. directories.
continue;
// Movie and music subdirectories must always pass.
if (fi.CompareNoCase("movie") && fi.CompareNoCase("music"))
// Skip if requested and do not record . and .. directories.
continue;
}
FString newdir = dirpath;
newdir << fi << '/';

View file

@ -48,6 +48,7 @@
#include "filesystem.h"
#include "resourcefile.h"
#include "v_text.h"
#include "c_dispatch.h"
//#include "md5.h"
//#include "doomstat.h"
@ -230,7 +231,8 @@ int FileSystem::CheckIfResourceFileLoaded (const char *name) noexcept
{
for (i = 0; i < Files.Size(); ++i)
{
if (stricmp (GetResourceFileName (i), name) == 0)
auto pth = ExtractFileBase(GetResourceFileName(i), true);
if (stricmp (pth.GetChars(), name) == 0)
{
return i;
}
@ -321,6 +323,7 @@ int FileSystem::FindResource (int resid, const char *type, int filenum) const no
for (i = fli[int(resid) % NumEntries]; i != NULL_INDEX; i = nli[i])
{
if (filenum > 0 && FileInfo[i].rfnum != filenum) continue;
if (FileInfo[i].lump->ResourceId != resid) continue;
auto lump = FileInfo[i].lump;
if (lump->LumpName[lookuptype] == lname) return i;
}
@ -481,7 +484,7 @@ int FileSystem::Iterate (const char *name, int *lastlump, ELookupMode lookupmode
}
lump_p = &FileInfo[*lastlump];
while (lump_p < &FileInfo[NumEntries])
while (lump_p <= &FileInfo.Last())
{
auto lump = lump_p->lump;
if (lump->LumpName[lookupindex] == lname)
@ -767,6 +770,13 @@ FileReader FileSystem::ReopenFileReader(int lump, bool alwayscache)
return rl->NewReader(); // This always gets a reader to the cache
}
FileReader FileSystem::OpenFileReader(const char* name, int where)
{
auto lump = FindFile(name);
if (lump < 0) return FileReader();
else return OpenFileReader(lump);
}
//==========================================================================
//
// GetAllFilesOfType
@ -1063,28 +1073,18 @@ static void PrintLastError ()
}
#endif
#if 0
void FileSystem::HashDump()
CCMD(printfs)
{
FILE* f = fopen("fs_hash.txt", "wb");
for (int list = 0; list < 5; list++)
{
fprintf(f, "List %d\n------------\n", list);
auto fli = FirstFileIndex[list];
auto nli = NextFileIndex[list];
for (int hash = 0; hash < NumEntries; hash++)
{
if (fli[hash] != NULL_INDEX)
{
fprintf(f, "\tHash %d\n", hash);
for (uint32_t i = fli[hash]; i != NULL_INDEX; i = nli[i])
{
auto lump = FileInfo[i].lump;
fprintf(f, "\t\t%s (%d)\t%d, %d\n", lump->LumpName[list].GetChars(), lump->LumpName[list].GetIndex(), lump->Size(), i);
}
}
}
}
fclose(f);
fileSystem.PrintDirectory();
}
void FileSystem::PrintDirectory()
{
for (int i = 0; i < NumEntries; i++)
{
auto lump = FileInfo[i].lump;
auto f = GetFileContainer(i);
auto n = GetResourceFileFullName(f);
Printf("%5d: %9d %64s %4s %3d %s\n", i, lump->LumpSize, lump->LumpName[0].GetChars(), lump->LumpName[4].GetChars(), lump->ResourceId, n);
}
}
#endif

View file

@ -95,12 +95,25 @@ public:
int FindFile (const char *name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const noexcept;
int GetFile (const char *name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const; // Like FindFile, but throws an exception when it cannot find what it looks for.
bool FileExists(const char* name)
{
return FindFile(name) >= 0;
}
int FindFile (const FString &name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const noexcept { return FindFile(name.GetChars(), lookupmode, filenum); }
int GetFile (const FString &name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const { return GetFile(name.GetChars(), lookupmode, filenum); }
bool FileExists(const FString & name)
{
return FindFile(name) >= 0;
}
int FindFile (const std::string &name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const noexcept { return FindFile(name.c_str(), lookupmode, filenum); }
int GetFile (const std::string &name, ELookupMode lookupmode = ELookupMode::FullName, int filenum = -1) const { return GetFile(name.c_str(), lookupmode, filenum); }
bool FileExists(const std::string& name)
{
return FindFile(name) >= 0;
}
int FindResource (int resid, const char *type, int filenum = -1) const noexcept;
int GetResource (int resid, const char *type, int filenum = -1) const; // Like FindFile, but throws an exception when it cannot find what it looks for.
@ -112,6 +125,15 @@ public:
TArray<uint8_t> GetFileData(int file, int pad = 0); // reads file into a writable buffer and optionally adds some padding at the end. (FileData isn't writable!)
FileData ReadFile (int file);
FileData ReadFile (const char *name) { return ReadFile (GetFile (name)); }
inline TArray<uint8_t> LoadFile(const char* name, int padding)
{
auto lump = FindFile(name);
if (lump < 0) return TArray<uint8_t>();
return GetFileData(lump, padding);
}
const void *Lock(int lump);
void Unlock(int lump, bool mayfree = false);
@ -127,6 +149,7 @@ public:
FileReader OpenFileReader(int file); // opens a reader that redirects to the containing file's one.
FileReader ReopenFileReader(int file, bool alwayscache = false); // opens an independent reader.
FileReader OpenFileReader(const char* name, int where);
int Iterate (const char *name, int *lastfile, ELookupMode lookupmode = ELookupMode::FullName); // [RH] Find files with duplication
@ -148,6 +171,7 @@ public:
{
return FileInfo[lump].lump;
}
void PrintDirectory();
protected:

View file

@ -303,15 +303,15 @@ void FResourceFile::PostProcessArchive(void *lumps, size_t lumpsize)
int lastpos = -1;
FString file;
if (LumpFilter.IndexOf('.') < 0)
auto segments = LumpFilter.Split(".");
FString build;
for (auto& segment : segments)
{
if (build.IsEmpty()) build = segment;
else build << "." << segment;
max -= FilterLumps(LumpFilter, lumps, lumpsize, max);
}
else while ((len = LumpFilter.IndexOf('.', lastpos+1)) > 0)
{
max -= FilterLumps(LumpFilter.Left(len), lumps, lumpsize, max);
lastpos = len;
}
JunkLeftoverFilters(lumps, lumpsize, max);
}

View file

@ -576,11 +576,11 @@ FTexture *FFont::GetChar (int code, int translation, int *const width, bool *red
//==========================================================================
//
// FFont :: GetCharWidth
// FFont :: CharWidth
//
//==========================================================================
int FFont::GetCharWidth (int code) const
int FFont::CharWidth (int code) const
{
code = GetCharCode(code, true);
if (code >= 0) return Chars[code - FirstChar].XMove;
@ -684,7 +684,7 @@ int FFont::StringWidth(const uint8_t *string) const
}
else
{
w += GetCharWidth(chr) + GlobalKerning;
w += CharWidth(chr) + GlobalKerning;
}
}

View file

@ -34,7 +34,7 @@
**
*/
#include "cache1d.h"
#include "filesystem/filesystem.h"
#include "bitmap.h"
#include "image.h"
#include "imagehelpers.h"
@ -89,8 +89,8 @@ void FFontChar1::Create8BitPixels (uint8_t *data)
//
//==========================================================================
FFontChar2::FFontChar2 (const char *sourcelump, int sourcepos, int width, int height, int leftofs, int topofs)
: SourceLump (sourcelump), SourcePos (sourcepos), SourceRemap(nullptr)
FFontChar2::FFontChar2 (TArray<uint8_t>& sourcelump, int sourcepos, int width, int height, int leftofs, int topofs)
: sourceData (sourcelump), SourcePos (sourcepos), SourceRemap(nullptr)
{
Size.x = width;
Size.y = height;
@ -119,7 +119,8 @@ void FFontChar2::SetSourceRemap(const uint8_t *sourceremap)
void FFontChar2::Create8BitPixels(uint8_t *Pixels)
{
auto lump = kopenFileReader(SourceLump, 0);
FileReader lump;
lump.OpenMemory(sourceData.Data(), sourceData.Size());
int destSize = GetWidth() * GetHeight();
uint8_t max = 255;
bool rle = true;
@ -225,7 +226,23 @@ void FFontChar2::Create8BitPixels(uint8_t *Pixels)
if (destSize < 0)
{
I_Error ("The font %s is corrupt", SourceLump.GetChars());
I_Error ("The font %s is corrupt", GetName().GetChars());
}
}
FBitmap FFontChar2::GetBgraBitmap(const PalEntry* remap, int* ptrans)
{
FBitmap bmp;
TArray<uint8_t> buffer;
bmp.Create(Size.x, Size.y);
const uint8_t* ppix = Get8BitPixels();
if (!ppix)
{
// This is needed for tiles with a palette remap.
buffer.Resize(Size.x * Size.y);
Create8BitPixels(buffer.Data());
ppix = buffer.Data();
}
if (ppix) bmp.CopyPixelData(0, 0, ppix, Size.x, Size.y, Size.y, 1, 0, remap);
return bmp;
}

View file

@ -20,13 +20,14 @@ protected:
class FFontChar2 : public FTexture
{
public:
FFontChar2 (const char *sourcelump, int sourcepos, int width, int height, int leftofs=0, int topofs=0);
FFontChar2 (TArray<uint8_t>& sourceData, int sourcepos, int width, int height, int leftofs=0, int topofs=0);
void Create8BitPixels(uint8_t*) override;
FBitmap GetBgraBitmap(const PalEntry* remap, int* ptrans) override;
void SetSourceRemap(const uint8_t *sourceremap);
protected:
FString SourceLump;
TArray<uint8_t>& sourceData;
int SourcePos;
const uint8_t *SourceRemap;
};

View file

@ -40,7 +40,7 @@
#include "fontchars.h"
#include "printf.h"
#include "imagehelpers.h"
#include "cache1d.h"
#include "filesystem/filesystem.h"
#include "fontinternals.h"
@ -125,7 +125,8 @@ FSingleLumpFont::FSingleLumpFont (const char *name, const char * lump)
FontName = name;
auto data = kloadfile(name, 0);
rawData = fileSystem.LoadFile(lump, 0);
auto& data = rawData;
if (data[0] == 0xE1 && data[1] == 0xE6 && data[2] == 0xD5 && data[3] == 0x1A)
{
@ -329,7 +330,7 @@ void FSingleLumpFont::LoadFON2 (const char * lump, const uint8_t *data)
}
else
{
Chars[i].TranslatedPic = new FFontChar2 (lump, int(data_p - data), widths2[i], FontHeight);
Chars[i].TranslatedPic = new FFontChar2 (rawData, int(data_p - data), widths2[i], FontHeight);
TileFiles.AllTiles.Push(Chars[i].TranslatedPic);
do
{
@ -458,7 +459,7 @@ void FSingleLumpFont::LoadBMF(const char *lump, const uint8_t *data)
{ // Empty character: skip it.
continue;
}
auto tex = new FFontChar2(lump, int(chardata + chari + 6 - data),
auto tex = new FFontChar2(rawData, int(chardata + chari + 6 - data),
chardata[chari+1], // width
chardata[chari+2], // height
-(int8_t)chardata[chari+3], // x offset
@ -514,7 +515,7 @@ int FSingleLumpFont::BMFCompare(const void *a, const void *b)
void FSingleLumpFont::CheckFON1Chars (double *luminosity)
{
auto data = kloadfile(GetName(), 0);
auto &data = rawData;
if (data.Size() < 8) return;
uint8_t used[256], reverse[256];
@ -530,7 +531,7 @@ void FSingleLumpFont::CheckFON1Chars (double *luminosity)
if(!Chars[i].TranslatedPic)
{
Chars[i].TranslatedPic = new FFontChar2 (GetName(), int(data_p - data.Data()), SpaceWidth, FontHeight);
Chars[i].TranslatedPic = new FFontChar2 (rawData, int(data_p - data.Data()), SpaceWidth, FontHeight);
Chars[i].XMove = SpaceWidth;
TileFiles.AllTiles.Push(Chars[i].TranslatedPic);
}

View file

@ -93,7 +93,7 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
FFont *font = FFont::FindFont (name);
if (font == nullptr)
{
auto lumpy = kopenFileReader(name, 0);
auto lumpy = fileSystem.OpenFileReader(fontlumpname, 0);
if (!lumpy.isOpen()) return nullptr;
uint32_t head;
lumpy.Read (&head, 4);
@ -101,7 +101,8 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
head == MAKE_ID(0xE1,0xE6,0xD5,0x1A))
{
FFont *CreateSingleLumpFont (const char *fontname, const char *lump);
return CreateSingleLumpFont (name, name);
lumpy.Close();
return CreateSingleLumpFont (name, fontlumpname);
}
}
return font;
@ -403,7 +404,7 @@ void V_InitFontColors ()
TranslationLookup.Clear();
TranslationColors.Clear();
while ((lump = fileSystem.Iterate("textcolors.txt", &lastlump)) != -1)
while ((lump = fileSystem.Iterate("demolition/textcolors.txt", &lastlump)) != -1)
{
FScanner sc(lump);
while (sc.GetString())
@ -720,12 +721,8 @@ void V_InitFonts()
NewSmallFont = CreateHexLumpFont2("NewSmallFont", "demolition/newconsolefont.hex");
CurrentConsoleFont = NewConsoleFont;
/*
ConFont = V_GetFont("ConsoleFont", "CONFONT");
{
ConFont = SmallFont;
}
*/
ConFont = V_GetFont("ConsoleFont", "demolition/confont.lmp"); // The con font is needed for the slider graphics
SmallFont = ConFont; // This is so that it doesn't crash and that it immediately gets seen as a proble. The SmallFont should later be mapped to the small game font.
}
void V_ClearFonts()

View file

@ -98,7 +98,7 @@ public:
virtual ~FFont ();
virtual FTexture *GetChar (int code, int translation, int *const width, bool *redirected = nullptr) const;
virtual int GetCharWidth (int code) const;
virtual int CharWidth (int code) const;
int GetColorTranslation (EColorRange range, PalEntry *color = nullptr) const;
int GetSpaceWidth () const { return SpaceWidth; }
int GetHeight () const { return FontHeight; }
@ -168,6 +168,7 @@ protected:
uint8_t PatchRemap[256];
FName FontName = NAME_None;
TArray<uint8_t> rawData;
FFont *Next;
static FFont *FirstFont;

View file

@ -114,7 +114,7 @@ TArray<FBrokenLines> V_BreakLines (FFont *font, int maxwidth, const uint8_t *str
lastWasSpace = false;
}
nw = font->GetCharWidth (c);
nw = font->CharWidth (c);
if ((w > 0 && w + nw > maxwidth) || c == '\n')
{ // Time to break the line

View file

@ -23,10 +23,20 @@
#include "i_specialpaths.h"
#include "z_music.h"
#include "statistics.h"
#include "menu.h"
#include "gstrings.h"
#include "quotemgr.h"
#include "mapinfo.h"
#ifndef NETCODE_DISABLE
#include "enet.h"
#endif
MapRecord mapList[512]; // Due to how this gets used it needs to be static. EDuke defines 7 episode plus one spare episode with 64 potential levels each and relies on the static array which is freely accessible by scripts.
MapRecord *currentLevel; // level that is currently played. (The real level, not what script hacks modfifying the current level index can pretend.)
MapRecord* lastLevel; // Same here, for the last level.
MapRecord userMapRecord; // stand-in for the user map.
void C_CON_SetAliases();
InputState inputState;
void SetClipshapes();
int ShowStartupWindow(TArray<GrpEntry> &);
@ -36,7 +46,8 @@ bool gHaveNetworking;
FString currentGame;
FString LumpFilter;
TMap<FName, int32_t> NameToTileIndex; // for assigning names to tiles. The menu accesses this list. By default it gets everything from the dynamic tile map in Duke Nukem and Redneck Rampage.
// Todo: Add additional definition file for the other games or textures not in that list so that the menu does not have to rely on indices.
CVAR(Int, cl_defaultconfiguration, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -54,14 +65,16 @@ void UserConfig::ProcessOptions()
initprintf("Build-format config files not supported and will be ignored\n");
}
#if 0 // MP disabled pending evaluation
auto v = Args->CheckValue("-port");
if (v) netPort = strtol(v, nullptr, 0);
netServerMode = Args->CheckParm("-server");
netServerAddress = Args->CheckValue("-connect");
netPassword = Args->CheckValue("-password");
#endif
v = Args->CheckValue("-addon");
auto v = Args->CheckValue("-addon");
if (v)
{
auto val = strtol(v, nullptr, 0);
@ -81,6 +94,22 @@ void UserConfig::ProcessOptions()
{
gamegrp = "WW2GI.GRP";
}
// Set up all needed content for these two mod which feature a very messy distribution.
// As an alternative they can be zipped up - the launcher will be able to detect and set up such versions automatically.
else if (Args->CheckParm("-route66"))
{
gamegrp = "REDNECK.GRP";
DefaultCon = "GAME66.CON";
const char* argv[] = { "tilesa66.art" , "tilesb66.art" };
AddArt.reset(new FArgs(2, argv));
}
else if (Args->CheckParm("-cryptic"))
{
gamegrp = "BLOOD.RFF";
DefaultCon = "CRYPTIC.INI";
const char* argv[] = { "cpart07.ar_" , "cpart15.ar_" };
AddArt.reset(new FArgs(2, argv));
}
v = Args->CheckValue("-gamegrp");
if (v)
@ -271,6 +300,42 @@ int GameMain()
//
//==========================================================================
#define LOCALIZED_STRING(s) "$" s
void SetDefaultStrings()
{
// Blood hard codes its skill names, so we have to define them manually.
if (g_gameType & GAMEFLAG_BLOOD)
{
gSkillNames[0] = "$STILL KICKING";
gSkillNames[1] = "$PINK ON THE INSIDE";
gSkillNames[2] = "$LIGHTLY BROILED";
gSkillNames[3] = "$WELL DONE";
gSkillNames[4] = "$EXTRA CRISPY";
}
//Set a few quotes which are used for common handling of a few status messages
quoteMgr.InitializeQuote(23, "$MESSAGES: ON");
quoteMgr.InitializeQuote(24, "$MESSAGES: OFF");
quoteMgr.InitializeQuote(83, "$FOLLOW MODE OFF");
quoteMgr.InitializeQuote(84, "$FOLLOW MODE ON");
quoteMgr.InitializeQuote(85, "$AUTORUNOFF");
quoteMgr.InitializeQuote(86, "$AUTORUNON");
#if 0 // todo: print a message
if (gAutoRun)
viewSetMessage("Auto run ON");
else
viewSetMessage("Auto run OFF");
#endif
}
//==========================================================================
//
//
//
//==========================================================================
int CONFIG_Init()
{
SetClipshapes();
@ -369,10 +434,18 @@ int CONFIG_Init()
CheckFrontend(g_gameType);
InitFileSystem(usedgroups);
TArray<FString> addArt;
for (auto& grp : usedgroups)
{
for (auto& art : grp.FileInfo.loadart)
{
addArt.Push(art);
}
}
TileFiles.AddArt(addArt);
CONTROL_ClearAssignments();
CONFIG_InitMouseAndController();
CONFIG_SetGameControllerDefaultsStandard();
CONFIG_SetDefaultKeys(cl_defaultconfiguration == 1 ? "demolition/origbinds.txt" : cl_defaultconfiguration == 2 ? "demolition/leftbinds.txt" : "demolition/defbinds.txt");
G_ReadConfig(currentGame);
@ -385,13 +458,14 @@ int CONFIG_Init()
{
playername = userConfig.CommandName;
}
GStrings.LoadStrings();
V_InitFonts();
buttonMap.SetGameAliases();
C_CON_SetAliases();
Mus_Init();
InitStatistics();
M_Init();
SetDefaultStrings();
if (g_gameType & GAMEFLAG_RR) InitRREndMap(); // this needs to be done better later
return gi->app_main();
}
@ -452,7 +526,7 @@ int32_t CONFIG_GetMapBestTime(char const* const mapname, uint8_t const* const ma
if (GameConfig->SetSection("MapTimes"))
{
auto s = GameConfig->GetValueForKey(m);
if (s) (int)strtoull(s, nullptr, 0);
if (s) return (int)strtoull(s, nullptr, 0);
}
return -1;
}
@ -473,7 +547,6 @@ int CONFIG_SetMapBestTime(uint8_t const* const mapmd4, int32_t tm)
//
//==========================================================================
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
int32_t MouseAnalogueAxes[MAXMOUSEAXES];
int32_t JoystickFunctions[MAXJOYBUTTONSANDHATS][2];
int32_t JoystickDigitalFunctions[MAXJOYAXES][2];
@ -490,51 +563,6 @@ static const char* mouseanalogdefaults[MAXMOUSEAXES] =
};
static const char* mousedigitaldefaults[MAXMOUSEDIGITAL] =
{
};
static const char* joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
"Fire",
"Strafe",
"Run",
"Open",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Aim_Down",
"Look_Right",
"Aim_Up",
"Look_Left",
};
static const char* joystickclickeddefaults[MAXJOYBUTTONSANDHATS] =
{
"",
@ -552,18 +580,6 @@ static const char* joystickanalogdefaults[MAXJOYAXES] =
};
static const char* joystickdigitaldefaults[MAXJOYDIGITAL] =
{
"",
"",
"",
"",
"",
"",
"Run",
};
//==========================================================================
//
//
@ -627,62 +643,6 @@ void CONFIG_SetupMouse(void)
void CONFIG_SetupJoystick(void)
{
const char* val;
FString section = currentGame + ".ControllerSettings";
if (!GameConfig->SetSection(section)) return;
for (int i = 0; i < MAXJOYBUTTONSANDHATS; i++)
{
section.Format("ControllerButton%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickFunctions[i][0] = buttonMap.FindButtonIndex(val);
section.Format("ControllerButtonClicked%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickFunctions[i][1] = buttonMap.FindButtonIndex(val);
}
// map over the axes
for (int i = 0; i < MAXJOYAXES; i++)
{
section.Format("ControllerAnalogAxes%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickAnalogueAxes[i] = CONFIG_AnalogNameToNum(val);
section.Format("ControllerDigitalAxes%d_0", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickDigitalFunctions[i][0] = buttonMap.FindButtonIndex(val);
section.Format("ControllerDigitalAxes%d_1", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickDigitalFunctions[i][1] = buttonMap.FindButtonIndex(val);
section.Format("ControllerAnalogScale%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickAnalogueScale[i] = (int32_t)strtoull(val, nullptr, 0);
section.Format("ControllerAnalogInvert%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickAnalogueInvert[i] = (int32_t)strtoull(val, nullptr, 0);
section.Format("ControllerAnalogDead%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickAnalogueDead[i] = (int32_t)strtoull(val, nullptr, 0);
section.Format("ControllerAnalogSaturate%d", i);
val = GameConfig->GetValueForKey(section);
if (val)
JoystickAnalogueSaturate[i] = (int32_t)strtoull(val, nullptr, 0);
}
for (int i = 0; i < MAXJOYAXES; i++)
{
CONTROL_MapAnalogAxis(i, JoystickAnalogueAxes[i], controldevice_joystick);
@ -803,220 +763,15 @@ static void CONFIG_SetGameControllerAxesModern()
analogAxis.apply();
}
void CONFIG_SetGameControllerDefaultsStandard()
{
CONFIG_SetGameControllerDefaultsClear();
CONFIG_SetGameControllerAxesModern();
static GameControllerButtonSetting const buttons[] =
{
{ GAMECONTROLLER_BUTTON_A, gamefunc_Jump },
{ GAMECONTROLLER_BUTTON_B, gamefunc_Toggle_Crouch },
{ GAMECONTROLLER_BUTTON_BACK, gamefunc_Map },
{ GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run },
{ GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Quick_Kick },
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Jump },
{ GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon },
};
static GameControllerButtonSetting const buttonsDuke[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Open },
{ GAMECONTROLLER_BUTTON_Y, gamefunc_Inventory },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right },
};
static GameControllerButtonSetting const buttonsFury[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Steroids }, // Reload
{ GAMECONTROLLER_BUTTON_Y, gamefunc_Open },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision }, // Radar
};
static GameControllerDigitalAxisSetting const digitalAxes[] =
{
{ GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Alt_Fire },
{ GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire },
};
for (auto const& button : buttons)
button.apply();
/*
if (FURY)
{
for (auto const& button : buttonsFury)
button.apply();
}
else
*/
{
for (auto const& button : buttonsDuke)
button.apply();
}
for (auto const& digitalAxis : digitalAxes)
digitalAxis.apply();
}
void CONFIG_SetGameControllerDefaultsPro()
{
CONFIG_SetGameControllerDefaultsClear();
CONFIG_SetGameControllerAxesModern();
static GameControllerButtonSetting const buttons[] =
{
{ GAMECONTROLLER_BUTTON_A, gamefunc_Open },
{ GAMECONTROLLER_BUTTON_B, gamefunc_Third_Person_View },
{ GAMECONTROLLER_BUTTON_Y, gamefunc_Quick_Kick },
{ GAMECONTROLLER_BUTTON_BACK, gamefunc_Map },
{ GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run },
{ GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon },
};
static GameControllerButtonSetting const buttonsDuke[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Inventory },
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Next_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right },
};
static GameControllerButtonSetting const buttonsFury[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Steroids }, // Reload
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Alt_Fire },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision }, // Radar
};
static GameControllerDigitalAxisSetting const digitalAxes[] =
{
{ GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Jump },
{ GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire },
};
for (auto const& button : buttons)
button.apply();
#if 0 // ouch...
if (FURY)
{
for (auto const& button : buttonsFury)
button.apply();
}
else
#endif
{
for (auto const& button : buttonsDuke)
button.apply();
}
for (auto const& digitalAxis : digitalAxes)
digitalAxis.apply();
}
FString CONFIG_GetGameFuncOnKeyboard(int gameFunc)
{
auto binding = buttonMap.GetButtonAlias(gameFunc);
auto keys = Bindings.GetKeysForCommand(binding);
for(auto key : keys)
{
if (key < KEY_FIRSTMOUSEBUTTON)
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
return "";
}
FString CONFIG_GetGameFuncOnMouse(int gameFunc)
{
auto binding = buttonMap.GetButtonAlias(gameFunc);
auto keys = Bindings.GetKeysForCommand(binding);
for (auto key : keys)
{
if ((key >= KEY_FIRSTMOUSEBUTTON && key < KEY_FIRSTJOYBUTTON) || (key >= KEY_MWHEELUP && key <= KEY_MWHEELLEFT))
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
return "";
}
char const* CONFIG_GetGameFuncOnJoystick(int gameFunc)
{
auto binding = buttonMap.GetButtonAlias(gameFunc);
auto keys = Bindings.GetKeysForCommand(binding);
for (auto key : keys)
{
if (key >= KEY_FIRSTJOYBUTTON && !(key >= KEY_MWHEELUP && key <= KEY_MWHEELLEFT))
{
auto scan = KB_ScanCodeToString(key);
if (scan) return scan;
}
}
return "";
}
// FIXME: Consider the mouse as well!
FString CONFIG_GetBoundKeyForLastInput(int gameFunc)
{
if (CONTROL_LastSeenInput == LastSeenInput::Joystick)
{
FString name = CONFIG_GetGameFuncOnJoystick(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
}
FString name = CONFIG_GetGameFuncOnKeyboard(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
name = CONFIG_GetGameFuncOnMouse(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
name = CONFIG_GetGameFuncOnJoystick(gameFunc);
if (name.IsNotEmpty())
{
return name;
}
return "UNBOUND";
}
void CONFIG_InitMouseAndController()
{
memset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions));
memset(JoystickFunctions, -1, sizeof(JoystickFunctions));
memset(JoystickDigitalFunctions, -1, sizeof(JoystickDigitalFunctions));
for (int i = 0; i < MAXMOUSEAXES; i++)
{
MouseDigitalFunctions[i][0] = buttonMap.FindButtonIndex(mousedigitaldefaults[i * 2]);
MouseDigitalFunctions[i][1] = buttonMap.FindButtonIndex(mousedigitaldefaults[i * 2 + 1]);
CONTROL_MapDigitalAxis(i, MouseDigitalFunctions[i][0], 0, controldevice_mouse);
CONTROL_MapDigitalAxis(i, MouseDigitalFunctions[i][1], 1, controldevice_mouse);
MouseAnalogueAxes[i] = CONFIG_AnalogNameToNum(mouseanalogdefaults[i]);
CONTROL_MapAnalogAxis(i, MouseAnalogueAxes[i], controldevice_mouse);
}
@ -1043,20 +798,6 @@ void CONFIG_WriteControllerSettings()
{
FString section = currentGame + ".ControllerSettings";
GameConfig->SetSection(section);
for (int dummy = 0; dummy < MAXJOYBUTTONSANDHATS; dummy++)
{
if (buttonMap.GetButtonName(JoystickFunctions[dummy][0]))
{
buf.Format("ControllerButton%d", dummy);
GameConfig->SetValueForKey(buf, buttonMap.GetButtonName(JoystickFunctions[dummy][0]));
}
if (buttonMap.GetButtonName(JoystickFunctions[dummy][1]))
{
buf.Format("ControllerButtonClicked%d", dummy);
GameConfig->SetValueForKey(buf, buttonMap.GetButtonName(JoystickFunctions[dummy][1]));
}
}
for (int dummy = 0; dummy < MAXJOYAXES; dummy++)
{
if (CONFIG_AnalogNumToName(JoystickAnalogueAxes[dummy]))
@ -1065,12 +806,6 @@ void CONFIG_WriteControllerSettings()
GameConfig->SetValueForKey(buf, CONFIG_AnalogNumToName(JoystickAnalogueAxes[dummy]));
}
if (buttonMap.GetButtonName(JoystickDigitalFunctions[dummy][0]))
{
buf.Format("ControllerDigitalAxes%d_0", dummy);
GameConfig->SetValueForKey(buf, buttonMap.GetButtonName(JoystickDigitalFunctions[dummy][0]));
}
if (buttonMap.GetButtonName(JoystickDigitalFunctions[dummy][1]))
{
buf.Format("ControllerDigitalAxes%d_1", dummy);

View file

@ -7,6 +7,8 @@
#include "zstring.h"
#include "inputstate.h"
#include "gamecvars.h"
#include "tarray.h"
#include "name.h"
EXTERN_CVAR(Int, cl_defaultconfiguration)
@ -14,6 +16,8 @@ extern FString currentGame;
extern FString LumpFilter;
class FArgs;
extern TMap<FName, int32_t> NameToTileIndex;
void D_AddWildFile(TArray<FString>& wadfiles, const char* value);
int CONFIG_Init();
@ -34,29 +38,12 @@ void CONFIG_SetDefaultKeys(const char *defbinds);
#define DEFAULTJOYSTICKANALOGUESATURATE 9500
extern int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
extern int32_t MouseAnalogueAxes[MAXMOUSEAXES];
extern int32_t JoystickFunctions[MAXJOYBUTTONSANDHATS][2];
extern int32_t JoystickDigitalFunctions[MAXJOYAXES][2];
extern int32_t JoystickAnalogueAxes[MAXJOYAXES];
extern int32_t JoystickAnalogueScale[MAXJOYAXES];
extern int32_t JoystickAnalogueDead[MAXJOYAXES];
extern int32_t JoystickAnalogueSaturate[MAXJOYAXES];
extern int32_t JoystickAnalogueInvert[MAXJOYAXES];
int32_t CONFIG_AnalogNameToNum(const char* func);
const char* CONFIG_AnalogNumToName(int32_t func);
void CONFIG_SetupMouse(void);
void CONFIG_SetupJoystick(void);
void CONFIG_WriteControllerSettings();
void CONFIG_InitMouseAndController();
void CONFIG_SetGameControllerDefaultsStandard();
void CONFIG_SetGameControllerDefaultsPro();
void CONFIG_SetGameControllerDefaultsClear();
FString CONFIG_GetBoundKeyForLastInput(int gameFunc);
extern FStringCVar* const CombatMacros[];
void CONFIG_ReadCombatMacros();
@ -96,7 +83,7 @@ extern UserConfig userConfig;
inline bool MusicEnabled()
{
return mus_enabled && !userConfig.nomusic;
return !userConfig.nomusic;
}
inline bool SoundEnabled()

View file

@ -47,6 +47,9 @@
#include "rts.h"
#include "stats.h"
#include "z_music.h"
#include "c_dispatch.h"
#include "gstrings.h"
#include "quotemgr.h"
/* Notes
@ -59,7 +62,16 @@
CVARD(Bool, cl_crosshair, true, CVAR_ARCHIVE, "enable/disable crosshair");
CVARD(Bool, cl_automsg, false, CVAR_ARCHIVE, "enable/disable automatically sending messages to all players") // Not implemented for Blood
CVARD(Bool, cl_autorun, true, CVAR_ARCHIVE, "enable/disable autorun")
CVARD(Bool, cl_runmode, true, CVAR_ARCHIVE, "enable/disable modernized run key operation")
bool G_CheckAutorun(bool button)
{
if (cl_runmode) return button || cl_autorun;
else return button ^ !!cl_autorun;
}
CVARD(Bool, cl_autosave, true, CVAR_ARCHIVE, "enable/disable autosaves") // Not implemented for Blood (but looks like the other games never check it either.)
CVARD(Bool, cl_autosavedeletion, true, CVAR_ARCHIVE, "enable/disable automatic deletion of autosaves") // Not implemented for Blood
CVARD(Int, cl_maxautosaves, 8, CVAR_ARCHIVE, "number of autosaves to keep before deleting the oldest") // Not implemented for Blood
@ -106,12 +118,6 @@ CUSTOM_CVARD(Int, cl_autovote, 0, CVAR_ARCHIVE, "enable/disable automatic voting
if (self < 0 || self > 2) self = 0;
}
bool G_CheckAutorun(bool button)
{
if (cl_runmode) return button || cl_autorun;
else return button ^ !!cl_autorun;
}
// Demos
CVARD_NAMED(Bool, demorec_diffcompress, demorec_diffcompress_cvar, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "Compression for diffs")
@ -124,12 +130,14 @@ CVARD(Bool, demoplay_showsync, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/dis
// Sound
CVARD(Bool, snd_ambience, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables ambient sounds") // Not implemented for Blood
CUSTOM_CVARD(Bool, snd_ambience, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL, "enables/disables ambient sounds") // Not implemented for Blood
{
gi->SetAmbience(self);
}
CVARD(Bool, snd_enabled, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables sound effects")
CVARD(Bool, snd_tryformats, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables automatic discovery of replacement sounds and music in .flac and .ogg formats")
CVARD(Bool, snd_doppler, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable 3d sound")
CVARD(Bool, mus_enabled, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables music")
CVARD(Bool, mus_restartonload, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "restart the music when loading a saved game with the same map or not") // only implemented for Blood - todo: generalize
CVARD(Bool, mus_redbook, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_FRONTEND_BLOOD, "enables/disables redbook audio (Blood only!)") // only Blood has assets for this.
@ -168,14 +176,6 @@ CUSTOM_CVARD(Int, snd_speech, 5, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disabl
else if (self > 5) self = 5;
}
int MusicDevice = ASS_WinMM;
CUSTOM_CVARD(Int, mus_device, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "selects music device")
{
if (self < 0) self = 0;
else if (self > 1) self = 1;
else MusicDevice = self? ASS_WinMM : ASS_OPL3; // must be copied because it gets altered by the music code.
}
// HUD
@ -209,17 +209,17 @@ bool G_ChangeHudLayout(int direction)
{
int layout = hud_size - 1;
while (!gi->validate_hud(layout) && layout >= 0) layout--;
if (layout >= 0)
if (layout >= 0 && layout < hud_size && gi->validate_hud(layout))
{
hud_size = layout;
return true;
}
}
else if (hud_size < 11)
else if (direction > 0 && hud_size < 11)
{
int layout = hud_size + 1;
while (!gi->validate_hud(layout) && layout <= 11) layout++;
if (layout <= 11)
if (layout <= 11 && layout > hud_size && gi->validate_hud(layout))
{
hud_size = layout;
return true;
@ -240,8 +240,28 @@ CVARD(Bool, hud_showmapname, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disab
CVARD(Bool, hud_position, false, CVAR_ARCHIVE, "aligns the status bar to the bottom/top")
CVARD(Bool, hud_bgstretch, false, CVAR_ARCHIVE|CVAR_FRONTEND_DUKELIKE, "enable/disable background image stretching in wide resolutions")
CVARD(Int, hud_messagetime, 120, CVAR_ARCHIVE|CVAR_FRONTEND_DUKELIKE, "length of time to display multiplayer chat messages")
// Should be available to all games - the message handling should also be consolidated into a game independent feature.
/*CUSTOM_*/CVARD(Bool, hud_messages, true, CVAR_ARCHIVE | CVAR_FRONTEND_BLOOD|CVAR_FRONTEND_SHADOWWARRIOR, "enable/disable showing messages")
CUSTOM_CVARD(Int, hud_messages, 1, CVAR_ARCHIVE, "enable/disable showing messages")
{
if (self < 0 || self > 2) self = 1;
}
// This cannot be done with the 'toggle' CCMD because it needs to control itself when to output the message
CCMD (togglemessages)
{
if (hud_messages)
{
gi->PrintMessage(PRINT_MEDIUM, "%s\n", quoteMgr.GetQuote(24));
hud_messages = false;
}
else
{
hud_messages = true;
gi->PrintMessage(PRINT_MEDIUM, "%s\n", quoteMgr.GetQuote(23));
}
}
//{
//Blood::gGameMessageMgr.SetState(self); // this is for terminaing an active message. Cannot be done like this because CVARs are global.
//}
@ -282,14 +302,19 @@ CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCAL
CONTROL_MouseEnabled = (self && CONTROL_MousePresent);
}
// Does it even make sense to have this configurable? It is in the menu but can be switched around at will by the mouse input code.
int32_t g_MyAimMode = 1;
CUSTOM_CVARD(Bool, in_mousemode, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "toggles vertical mouse view")
CVARD(Bool, in_mousemode, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "toggles vertical mouse view")
CVAR(Bool, silentmouseaimtoggle, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CCMD(togglemouseaim)
{
g_MyAimMode = self; // Needs to be copied to a shadow variable because the input code messes around with this setting - but that should not affect the user's original choice.
in_mousemode = !in_mousemode;
if (!silentmouseaimtoggle)
{
gi->DoPrintMessage(PRINT_MEDIUM, in_mousemode? GStrings("TXT_MOUSEAIMON") : GStrings("TXT_MOUSEAIMOFF"));
}
}
CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold to aim")
CVARD(Bool, in_mouseflip, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "invert vertical mouse movement")
CUSTOM_CVARD(Int, in_mousebias, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time")
@ -306,22 +331,22 @@ CUSTOM_CVARD(Int, in_mousedeadzone, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "amount o
CVARD(Bool, in_mousesmoothing, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "enable/disable mouse input smoothing")
CUSTOM_CVARD(Float, in_mousesensitivity, DEFAULTMOUSESENSITIVITY, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
CUSTOM_CVARD(Float, in_mousesensitivity, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
{
if (self < 0) self = 0;
else if (self > 25) self = 25;
else if (self > 6) self = 6;
}
CUSTOM_CVARD(Int, in_mousescalex, 65536, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
CUSTOM_CVARD(Float, in_mousescalex, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
{
if (self < -4*65536) self = 4 * 65536;
else if (self > 4 * 65536) self = 4 * 65536;
if (self < -4) self = 4;
else if (self > 4) self = 4;
}
CUSTOM_CVARD(Int, in_mousescaley, 65536, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
CUSTOM_CVARD(Float, in_mousescaley, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "changes the mouse sensitivity")
{
if (self < -4 * 65536) self = 4 * 65536;
else if (self > 4 * 65536) self = 4 * 65536;
if (self < -4) self = 4;
else if (self > 4) self = 4;
}
@ -488,6 +513,30 @@ CUSTOM_CVARD(Float, vid_brightness, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adju
// todo: tell the system to update
}
CUSTOM_CVARD(Float, vid_saturation, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts saturation component of gamma ramp")
{
if (self < -3) self = -3;
else if (self > 3) self = 3;
// todo: tell the system to update
}
CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CCMD (bumpgamma)
{
// [RH] Gamma correction tables are now generated on the fly for *any* gamma level
// Q: What are reasonable limits to use here?
float newgamma = vid_gamma + 0.1f;
if (newgamma > 3.0)
newgamma = 1.0;
vid_gamma = newgamma;
Printf ("Gamma correction level %g\n", newgamma);
}
//{ "vid_contrast","adjusts contrast component of gamma ramp",(void *) &vid_contrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
//{ "vid_brightness","adjusts brightness component of gamma ramp",(void *) &vid_brightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
@ -499,32 +548,44 @@ CUSTOM_CVAR(String, rtsname, "", CVAR_ARCHIVE | CVAR_USERINFO)
CVAR(String, usermapfolder, "", CVAR_ARCHIVE);
CUSTOM_CVAR(Int, playercolor, 0, CVAR_ARCHIVE|CVAR_USERINFO)
{
if (self < 0 || self > 10) self = 0;
else ;// gi->UpdatePlayerColor(); // this part is game specific
}
CUSTOM_CVAR(Int, playerteam, 0, CVAR_USERINFO) // this one is transient and won't be saved.
{
if (self < 0 || self > 3) self = 0;
else ;// gi->UpdatePlayerTeam(); // this part is game specific
}
// Will only become useful if the obituary system gets overhauled and for localization
CUSTOM_CVAR(Int, playergender, 0, CVAR_USERINFO|CVAR_ARCHIVE)
{
if (self < 0 || self > 3) self = 0;
}
// Internal settings for demo recording and the multiplayer menu. These won't get saved and only are CVARs so that the menu code can use them.
CVAR(Bool, m_recstat, false, CVAR_NOSET)
CVAR(Int, m_coop, 0, CVAR_NOSET)
CVAR(Int, m_ffire, 1, CVAR_NOSET)
CVAR(Int, m_monsters, 1, CVAR_NOSET)
CVAR(Int, m_marker, 1, CVAR_NOSET)
CVAR(Int, m_level_number, 0, CVAR_NOSET)
CVAR(Int, m_episode_number, 0, CVAR_NOSET)
CVAR(Int, m_noexits, 0, CVAR_NOSET)
CVAR(Int, playercolor, 0, CVAR_NOSET)
CVAR(Int, playerteam, 0, CVAR_NOSET)
CVAR(String, m_server, "localhost", CVAR_NOSET)
CVAR(String, m_netport, "19014", CVAR_NOSET)
#if 0
// These have to wait until the HUD code is cleaned up (no idea which may survive and which won't.)
/*
// Currently unavailable due to dependency on an obsolete OpenGL feature
{ "deliriumblur", "enable/disable delirium blur effect(polymost)", (void *)&gDeliriumBlur, CVAR_BOOL, 0, 1 },
if (!Bstrcasecmp(parm->name, "color"))
{
playercolor = G_CheckPlayerColor(playercolor);
g_player[0].ps->palookup = g_player[0].pcolor = playercolor;
}
// This one gets changed at run time by the game code, so making it persistent does not work
// This option is not really useful anymore
@ -533,9 +594,6 @@ CVAR(Int, playerteam, 0, CVAR_NOSET)
// This requires a different approach, because it got used like a CCMD, not a CVAR.
{ "skill","changes the game skill setting", (void *)&ud.m_player_skill, CVAR_INT|CVAR_FUNCPTR|CVAR_NOSAVE/*|CVAR_NOMULTI*/, 0, 5 },
// requires cleanup first
//{ "team","change team in multiplayer", (void *)&playerteam, CVAR_INT|CVAR_MULTI, 0, 3 },
// just as a reminder:
/*
else if (!Bstrcasecmp(parm->name, "vid_gamma"))

Some files were not shown because too many files have changed in this diff Show more