remove fullscreen debug prints; py3 updates for SetupWin
This commit is contained in:
parent
2bba3da368
commit
d9cf993fd9
|
@ -46,7 +46,6 @@ class Display(GameChild):
|
|||
|
||||
def set_screen(self, flags=0x0, dimensions=None, fs=False):
|
||||
self.dimensions_changed = dimensions is not None
|
||||
print("set_screen flags", hex(flags))
|
||||
flags |= RESIZABLE
|
||||
if dimensions is None:
|
||||
if display.get_surface():
|
||||
|
@ -85,16 +84,13 @@ class Display(GameChild):
|
|||
screen = self.screen
|
||||
cpy = screen.convert()
|
||||
flags = self.screen.get_flags()
|
||||
print("toggle_fullscreen get_flags", hex(flags))
|
||||
if flags & 0x80000000:
|
||||
full = False
|
||||
print(hex(maxsize), hex(maxsize >> 33), hex(flags ^ 0x80000000), hex(flags ^ -0x80000000), hex(FULLSCREEN))
|
||||
if not platform == "win32" and maxsize >> 33:
|
||||
flags ^= 0x80000000
|
||||
else:
|
||||
flags ^= -0x80000000
|
||||
else:
|
||||
full = True
|
||||
print("toggle_fullscreen set_screen", hex(flags))
|
||||
self.set_screen(flags, fs=full)
|
||||
screen.blit(cpy, (0, 0))
|
||||
|
|
|
@ -6,7 +6,7 @@ from zipfile import ZipFile
|
|||
|
||||
import py2exe
|
||||
|
||||
from Setup import Setup
|
||||
from .Setup import Setup
|
||||
|
||||
class SetupWin(Setup):
|
||||
|
||||
|
@ -23,13 +23,13 @@ class SetupWin(Setup):
|
|||
py2exe.build_exe.isSystemDLL = isSystemDLL
|
||||
|
||||
def setup(self):
|
||||
self.numpy_dll_paths_fix()
|
||||
self.numpy_dll_paths_fix()
|
||||
config = self.config.get_section("setup")
|
||||
windows = [{}]
|
||||
if config["init-script"]:
|
||||
windows[0]["script"] = config["init-script"]
|
||||
if config["windows-icon-path"]:
|
||||
windows[0]["icon-resources"] = [(1, config["windows-icon-path"])]
|
||||
windows = [{}]
|
||||
if config["init-script"]:
|
||||
windows[0]["script"] = config["init-script"]
|
||||
if config["windows-icon-path"]:
|
||||
windows[0]["icon-resources"] = [(1, config["windows-icon-path"])]
|
||||
Setup.setup(self, windows,
|
||||
{"py2exe": {"packages": self.build_package_list(),
|
||||
"dist_dir": config["windows-dist-path"]}})
|
||||
|
@ -39,8 +39,8 @@ class SetupWin(Setup):
|
|||
|
||||
# https://stackoverflow.com/questions/36191770/py2exe-errno-2-no-such-file-or-directory-numpy-atlas-dll
|
||||
def numpy_dll_paths_fix(self):
|
||||
import numpy
|
||||
import sys
|
||||
import numpy
|
||||
import sys
|
||||
paths = set()
|
||||
np_path = numpy.__path__[0]
|
||||
for dirpath, _, filenames in walk(np_path):
|
||||
|
@ -50,21 +50,21 @@ class SetupWin(Setup):
|
|||
sys.path.append(*list(paths))
|
||||
|
||||
def copy_data_files(self):
|
||||
root = self.config.get("setup", "windows-dist-path")
|
||||
root = self.config.get("setup", "windows-dist-path")
|
||||
for path in chain(*zip(*self.build_data_map())[1]):
|
||||
dest = join(root, dirname(path))
|
||||
if not exists(dest):
|
||||
makedirs(dest)
|
||||
copy(path, dest)
|
||||
self.include_readme(root)
|
||||
self.include_readme(root)
|
||||
|
||||
def include_readme(self, root):
|
||||
name = "README"
|
||||
if exists(name):
|
||||
readme = open(name, "r")
|
||||
reformatted = open(join(root, name + ".txt"), "w")
|
||||
for line in open(name, "r"):
|
||||
reformatted.write(line.rstrip() + "\r\n")
|
||||
name = "README"
|
||||
if exists(name):
|
||||
readme = open(name, "r")
|
||||
reformatted = open(join(root, name + ".txt"), "w")
|
||||
for line in open(name, "r"):
|
||||
reformatted.write(line.rstrip() + "\r\n")
|
||||
|
||||
def create_archive(self):
|
||||
config = self.config.get_section("setup")
|
||||
|
|
Loading…
Reference in New Issue