Skip to content

Commit 60fccb0

Browse files
authored
v9.4.0f2
1 parent 245b0f3 commit 60fccb0

4 files changed

Lines changed: 25 additions & 23 deletions

File tree

Engine/Console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self):
3030
self.pipe_in_name,
3131
win32pipe.PIPE_ACCESS_DUPLEX,
3232
win32pipe.PIPE_TYPE_MESSAGE | win32pipe.PIPE_WAIT,
33-
1, 1024 * 1024, 1024 * 1024, 0, None
33+
1, 1024 * 1024 * 32, 1024 * 1024 * 32, 0, None
3434
)
3535

3636
threading.Thread(target=os.system, args=[f"start py ./engine/sub_console.py {self.id}"], daemon=False).start()
@@ -62,7 +62,7 @@ def _get_(self):
6262
"""Байтовое принятие команд"""
6363
if not self.enable: return
6464
try:
65-
return win32file.ReadFile(self.pipe_in, 1024 * 1024)
65+
return win32file.ReadFile(self.pipe_in, 1024 * 1024 * 32)
6666
except:
6767
self.enable = False
6868

Engine/Output.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import ctypes
2-
import ctypes.wintypes
3-
import os
4-
5-
class Output:
6-
"""Настройка выходного буффера окна консоли"""
7-
8-
def init(handle:int, mode:int=5) -> bool:
9-
"""Иницаилизация окна консоли"""
10-
return bool(ctypes.windll.kernel32.SetConsoleMode(handle, mode))
11-
12-
def get_title() -> str:
13-
"""Получение заголовка окна консоли"""
14-
out = (ctypes.c_char * 256)()
15-
size = ctypes.windll.kernel32.GetConsoleTitleW(ctypes.byref(out), ctypes.wintypes.DWORD(256))
16-
return bytes(out).decode("utf-16-le")[:size]
1+
import ctypes
2+
import ctypes.wintypes
3+
import os
4+
5+
class Output:
6+
"""Настройка выходного буффера окна консоли"""
7+
8+
def init(handle:int, mode:int=5) -> bool:
9+
"""Иницаилизация окна консоли"""
10+
return bool(ctypes.windll.kernel32.SetConsoleMode(handle, mode))
11+
12+
def get_title() -> str:
13+
"""Получение заголовка окна консоли"""
14+
out = (ctypes.c_char * 256)()
15+
size = ctypes.windll.kernel32.GetConsoleTitleW(ctypes.byref(out), ctypes.wintypes.DWORD(256))
16+
return bytes(out).decode("utf-16-le")[:size]

Engine/Sub_Console.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure):
3535
win32pipe.PIPE_ACCESS_DUPLEX, # доступ на чтение и запись
3636
win32pipe.PIPE_TYPE_MESSAGE | win32pipe.PIPE_WAIT,
3737
1, # количество экземпляров канала
38-
1024 * 1024, # размер выходного буфера
39-
1024 * 1024, # размер входного буфера
38+
1024 * 1024 * 32, # размер выходного буфера
39+
1024 * 1024 * 32, # размер входного буфера
4040
0, # таймаут на соединение
4141
None # защита по умолчанию
4242
)
@@ -48,7 +48,7 @@ class CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure):
4848

4949
while enable:
5050
try:
51-
message = win32file.ReadFile(pipe_out, 1024 * 1024)
51+
message = win32file.ReadFile(pipe_out, 1024 * 1024 * 32)
5252
except:
5353
enable = False
5454
quit()

Engine/Window.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def set_size(self, w:int, h:int):
3232
def print(self):
3333
"""Вывод буффера в консоль"""
3434
if self.prev_frame and self.prev_frame == self.buffer:
35-
return
35+
...#return
3636

3737
s = ""
3838
for string in self.buffer:
@@ -55,9 +55,11 @@ def fill(self, symbol:str=" "):
5555
self.buffer[i].append(symbol)
5656

5757
def point(self, x:int, y:int, symbol:int="*"):
58+
x = int(x)
59+
y = int(y)
5860
"""Установка символа в буффер по координатам"""
5961
if (0 <= x < self.w) and (0 <= y < self.h):
60-
self.buffer[y][x] = symbol
62+
self.buffer[y][x] = symbol
6163

6264
def rectFill(self, x:int=0, y:int=0, w:int=1, h:int=1, symbol:str="*"):
6365
"""Заполненный прямоугольник в буффер"""

0 commit comments

Comments
 (0)