optimized activation of fullscreen

small-fixes-for-0.3.3
Max Lange 8 years ago
parent 4c186404f8
commit 2b6fcc7832

@ -2,15 +2,19 @@ from chat import getinput
from draw import init
from draw import ingame
from draw import debug
from draw import drawtargetsum
from draw import drawsongname
from draw import adjustscreen
from draw import drawworldname
from draw import status
from interface import init
from interface import handle
from interface import getall
from main import main
from menu import fade_screen
from menu import menu_template
from menu import main
from menu import pause
from menu import choose_world
from menu import inputpopup
from menu import savegames
from menu import options
@ -25,11 +29,9 @@ from movement import init
from movement import handle
from namings import run
from objects import stars
from objects import button
from objects import inputfield
from objects import sliders
from objects import bullet
from objects import target
from objects import warp_station
from player import player
from settings import init
from settings import reset

@ -40,8 +40,6 @@ def ingame():
screen = settings.screen
adjustscreen()
settings.world.blit()
status()
@ -53,7 +51,8 @@ def ingame():
drawworldname()
if no16to9:
screen.blit(correcture, correcture_pos)
pass
#screen.blit(correcture, correcture_pos)
pygame.display.flip()
@ -184,24 +183,6 @@ def drawworldname():
settings.screen.blit(name, pos)
def adjustscreen():
"""Changes to fullscreen and back"""
# changes resolution and so on when fullscreen is toggled
global fullscreenold
screenx = settings.screenx
screeny = settings.screeny
fullscreen = settings.fullscreen
fullscreenold = settings.fullscreenold
if fullscreenold != fullscreen:
if fullscreen:
pygame.display.set_mode((screenx, screeny), pygame.FULLSCREEN)
if not fullscreen:
pygame.display.set_mode((screenx / 2, screeny / 2))
settings.fullscreenold = fullscreen
def status():
xsize = int(settings.screenx_current * 0.05)
ysize = int(settings.screeny_current * 0.3) + 10

@ -234,13 +234,20 @@ def upd(level):
saves.append(filename)
return
if level == "adjust_screen":
from . import draw
global background
global background_pos
global konstspeed
global no16to9
global fullscreenold
global fullscreen
if fullscreenold != fullscreen:
if fullscreen:
pygame.display.set_mode((screenx, screeny), pygame.FULLSCREEN)
if not fullscreen:
pygame.display.set_mode((screenx / 2, screeny / 2))
fullscreenold = fullscreen
draw.adjustscreen()
upd("screenvalues")
konstspeed = 0.0025

Loading…
Cancel
Save