Game Menu -> Gamepad Config configures only 2 gamepads #494
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/menu.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/menu.c
									
									
									
									
									
								
							@@ -224,10 +224,9 @@ static void drawPlayerButtons(Menu* menu, s32 x, s32 y)
 | 
			
		||||
 | 
			
		||||
static void drawGamepadSetupTabs(Menu* menu, s32 x, s32 y)
 | 
			
		||||
{
 | 
			
		||||
	enum{Width = 90, Height = 41, Tabs = 2};
 | 
			
		||||
	enum{Width = 90, Height = 41, Tabs = TIC_GAMEPADS, TabWidth = 16};
 | 
			
		||||
	tic_mem* tic = menu->tic;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	tic->api.rect(tic, x, y, Width, Height, (tic_color_white));
 | 
			
		||||
	tic->api.pixel(tic, x, y, (tic_color_blue));
 | 
			
		||||
	tic->api.pixel(tic, x+Width-1, y, (tic_color_blue));
 | 
			
		||||
@@ -236,12 +235,7 @@ static void drawGamepadSetupTabs(Menu* menu, s32 x, s32 y)
 | 
			
		||||
	tic->api.rect(tic, x+1, y+Height, Width-2 , 1, (tic_color_black));
 | 
			
		||||
 | 
			
		||||
	for(s32 i = 0; i < Tabs; i++)
 | 
			
		||||
	{
 | 
			
		||||
		if(menu->gamepad.tab == i)
 | 
			
		||||
			drawTab(menu, x + 73 - i*17, y + 43, i);
 | 
			
		||||
		else
 | 
			
		||||
			drawTabDisabled(menu, x + 73 - i*17, y + 43, i);
 | 
			
		||||
	}
 | 
			
		||||
		(menu->gamepad.tab == i ? drawTab : drawTabDisabled)(menu, x + 73 - i*TabWidth, y + 43, i);
 | 
			
		||||
 | 
			
		||||
	drawPlayerButtons(menu, x + 3, y + 3);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								src/studio.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/studio.c
									
									
									
									
									
								
							@@ -45,17 +45,11 @@
 | 
			
		||||
#include "ext/md5.h"
 | 
			
		||||
 | 
			
		||||
#define STUDIO_UI_SCALE 3
 | 
			
		||||
 | 
			
		||||
#define TEXTURE_SIZE (TIC80_FULLWIDTH)
 | 
			
		||||
 | 
			
		||||
#define MAX_CONTROLLERS (sizeof(tic80_gamepads))
 | 
			
		||||
#define STUDIO_PIXEL_FORMAT SDL_PIXELFORMAT_ARGB8888
 | 
			
		||||
 | 
			
		||||
#define FRAME_SIZE (TIC80_FULLWIDTH * TIC80_FULLHEIGHT * sizeof(u32))
 | 
			
		||||
 | 
			
		||||
#define OFFSET_LEFT ((TIC80_FULLWIDTH-TIC80_WIDTH)/2)
 | 
			
		||||
#define OFFSET_TOP ((TIC80_FULLHEIGHT-TIC80_HEIGHT)/2)
 | 
			
		||||
 | 
			
		||||
#define POPUP_DUR (TIC_FRAMERATE*2)
 | 
			
		||||
 | 
			
		||||
#if defined(TIC80_PRO)
 | 
			
		||||
@@ -110,7 +104,7 @@ static struct
 | 
			
		||||
		SDL_AudioCVT 		cvt;
 | 
			
		||||
	} audio;
 | 
			
		||||
 | 
			
		||||
	SDL_Joystick* joysticks[MAX_CONTROLLERS];
 | 
			
		||||
	SDL_Joystick* joysticks[TIC_GAMEPADS];
 | 
			
		||||
 | 
			
		||||
	EditorMode mode;
 | 
			
		||||
	EditorMode prevMode;
 | 
			
		||||
@@ -1936,7 +1930,7 @@ SDL_Event* pollEvent()
 | 
			
		||||
			{
 | 
			
		||||
				s32 id = event.jdevice.which;
 | 
			
		||||
 | 
			
		||||
				if (id < MAX_CONTROLLERS)
 | 
			
		||||
				if (id < TIC_GAMEPADS)
 | 
			
		||||
				{
 | 
			
		||||
					if(studio.joysticks[id])
 | 
			
		||||
						SDL_JoystickClose(studio.joysticks[id]);
 | 
			
		||||
@@ -1950,7 +1944,7 @@ SDL_Event* pollEvent()
 | 
			
		||||
			{
 | 
			
		||||
				s32 id = event.jdevice.which;
 | 
			
		||||
 | 
			
		||||
				if (id < MAX_CONTROLLERS && studio.joysticks[id])
 | 
			
		||||
				if (id < TIC_GAMEPADS && studio.joysticks[id])
 | 
			
		||||
				{
 | 
			
		||||
					SDL_JoystickClose(studio.joysticks[id]);
 | 
			
		||||
					studio.joysticks[id] = NULL;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user