<commit_before>local o = {}

local startx = love.window.getWidth() * 0.5 - 191 * 0.5
local starty = 80

o.imgBackground		= love.graphics.newImage("gfx/menu/menu_background.png")
o.imgMiddleground	= love.graphics.newImage("gfx/menu/menu_middleground.png")
o.imgScreen			= love.graphics.newImage("gfx/menu/screen00.png")

o.fontMenu = love.graphics.newFont(32)
o.fontOption = love.graphics.newFont(24)

o.effectTimer = 0
o.chromaticEffect = 0

o.guiMenu		= love.gui.newGui()
o.chkFullscreen	= o.guiMenu.newCheckbox(startx, starty + 64 * 0, 191, 32, false, "Fullscreen")
o.chkLarge		= o.guiMenu.newCheckbox(startx, starty + 64 * 1, 191, 32, false, "Large")
o.btnBack		= o.guiMenu.newButton(startx + 8, starty + 64 * 5 + 8, 176, 34, "Back")

o.optionLarge = small

o.reset = function()
	o.guiMenu.flushMouse()
end

o.update = function(dt)
	o.effectTimer = o.effectTimer + dt
	o.chromaticEffect = o.chromaticEffect + dt

	o.guiMenu.update(dt)

	if o.chkFullscreen.isHit() then
		love.sounds.playSound("sounds/button_pressed.wav")
		o.optionFullscreen = o.chkFullscreen.isChecked()
		local success = love.window.setFullscreen( o.optionFullscreen )
	end

	if o.chkLarge.isHit() then
		love.sounds.playSound("sounds/button_pressed.wav")
		local success
		o.optionLarge = o.chkLarge.isChecked()
		o.optionFullscreen = o.chkFullscreen.isChecked()
		if o.optionLarge then
			success = love.window.setMode( 1280, 720, {fullscreen=o.optionFullscreen})
		else
			success = love.window.setMode( 800, 600 ,{fullscreen=o.optionFullscreen})
		end
		if success then
			love.postshader.refreshScreenSize()
			lightWorld.refreshScreenSize()
			stateMainMenu.refreshScreenSize()
			stateSettings.refreshScreenSize()
			stateSettingsVideo.refreshScreenSize()
			stateSettingsVideoShaders.refreshScreenSize()
			stateSettingsVideoDisplay.refreshScreenSize()
			stateSettingsAudio.refreshScreenSize()
			love.turris.reinit()
		end
	end

	if o.btnBack.isHit() or love.keyboard.isDown("escape") then
		love.sounds.playSound("sounds/button_pressed.wav")
		love.setgamestate(7)
		o.guiMenu.flushMouse()
	end
end

o.draw = function()
	love.graphics.setFont(o.fontMenu)
	love.graphics.setBlendMode("alpha")
	love.graphics.setColor(255, 255, 255)
	love.graphics.draw(o.imgScreen)
	love.graphics.setColor(255, 255, 255, 223)
	love.graphics.draw(o.imgBackground)
	love.graphics.setColor(95 + math.sin(o.effectTimer * 0.1) * 63, 191 + math.cos(o.effectTimer) * 31, 223 + math.sin(o.effectTimer) * 31, 255)
	love.graphics.setBlendMode("additive")
	love.graphics.draw(o.imgMiddleground,(love.window.getWidth()-o.imgMiddleground:getWidth())*0.5,0)
<commit_msg>vsync off by default<commit_after>local o = {}

local startx = love.window.getWidth() * 0.5 - 191 * 0.5
local starty = 80

o.imgBackground		= love.graphics.newImage("gfx/menu/menu_background.png")
o.imgMiddleground	= love.graphics.newImage("gfx/menu/menu_middleground.png")
o.imgScreen			= love.graphics.newImage("gfx/menu/screen00.png")

o.fontMenu = love.graphics.newFont(32)
o.fontOption = love.graphics.newFont(24)

o.effectTimer = 0
o.chromaticEffect = 0

o.guiMenu		= love.gui.newGui()
o.chkFullscreen	= o.guiMenu.newCheckbox(startx, starty + 64 * 0, 191, 32, false, "Fullscreen")
o.chkLarge		= o.guiMenu.newCheckbox(startx, starty + 64 * 1, 191, 32, false, "Large")
o.btnBack		= o.guiMenu.newButton(startx + 8, starty + 64 * 5 + 8, 176, 34, "Back")

o.optionLarge = small

o.reset = function()
	o.guiMenu.flushMouse()
end
o.checkOptionsLarge = function()
	if o.optionLarge then
		success = love.window.setMode( 1280, 720, {fullscreen=o.optionFullscreen,vsync=false})--TODO: make vsync an option
	else
		success = love.window.setMode( 800, 600 ,{fullscreen=o.optionFullscreen,vsync=false})
	end
	if success then
		love.postshader.refreshScreenSize()
		lightWorld.refreshScreenSize()
		stateMainMenu.refreshScreenSize()
		stateSettings.refreshScreenSize()
		stateSettingsVideo.refreshScreenSize()
		stateSettingsVideoShaders.refreshScreenSize()
		stateSettingsVideoDisplay.refreshScreenSize()
		stateSettingsAudio.refreshScreenSize()
		love.turris.reinit()
	end
end
o.update = function(dt)
	o.effectTimer = o.effectTimer + dt
	o.chromaticEffect = o.chromaticEffect + dt

	o.guiMenu.update(dt)

	if o.chkFullscreen.isHit() then
		love.sounds.playSound("sounds/button_pressed.wav")
		o.optionFullscreen = o.chkFullscreen.isChecked()
		local success = love.window.setFullscreen( o.optionFullscreen )
	end

	if o.chkLarge.isHit() then
		love.sounds.playSound("sounds/button_pressed.wav")
		local success
		o.optionLarge = o.chkLarge.isChecked()
		o.optionFullscreen = o.chkFullscreen.isChecked()
		o.checkOptionLarge()
	end

	if o.btnBack.isHit() or love.keyboard.isDown("escape") then
		love.sounds.playSound("sounds/button_pressed.wav")
		love.setgamestate(7)
		o.guiMenu.flushMouse()
	end
end

o.draw = function()
	love.graphics.setFont(o.fontMenu)
	love.graphics.setBlendMode("alpha")
	love.graphics.setColor(255, 255, 255)
	love.graphics.draw(o.imgScreen)
	love.graphics.setColor(255, 255, 255, 223)
	love.graphics.draw(o.imgBackground)
	love.graphics.setColor(95 + math.sin(o.effectTimer * 0.1) * 63, 191 + math.cos(o.effectTimer) * 31, 223 + math.sin(o.effectTimer) * 31, 255)
	love.graphics.setBlendMode("additive")
	love.graphics.draw(o.imgMiddleground,(love.window.getWidth()-o.imgMiddleground:getWidth())*0.5,0)

{'fraction_non_alphanumeric': 0.13729891507669287, 'fraction_numerical': 0.03741114852225964, 'mean_word_length': 4.967633928571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1986602', 'n_tokens_mistral': 2203, 'n_tokens_neox': 1959, 'n_words': 323}