Skip to content

Commit 4fa940b

Browse files
change typehint for unsigned char * from str to bytes. fixes #210.
1 parent 9bd709c commit 4fa940b

6 files changed

Lines changed: 60 additions & 58 deletions

File tree

create_stub_pyray.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def ctype_to_python_type(t):
5858
return "float"
5959
elif "char * *" in t:
6060
return "list[str]"
61+
elif "unsigned char *" in t:
62+
return "bytes"
6163
elif "char *" in t:
6264
return "str"
6365
elif t == "char":

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 7faffbffd708531c584ff6cc7a8aa99d
3+
config: d2e698b9576bffb5afca021582567e2a
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/objects.inv

-127 Bytes
Binary file not shown.

docs/pyray.html

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

pyray/__init__.pyi

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,19 +1048,19 @@ def color_to_hsv(color: Color|list|tuple,) -> Vector3:
10481048
def color_to_int(color: Color|list|tuple,) -> int:
10491049
"""Get hexadecimal value for a Color (0xRRGGBBAA)."""
10501050
...
1051-
def compress_data(data: str,dataSize: int,compDataSize: Any,) -> str:
1051+
def compress_data(data: bytes,dataSize: int,compDataSize: Any,) -> bytes:
10521052
"""Compress data (DEFLATE algorithm), memory must be MemFree()."""
10531053
...
1054-
def compute_crc32(data: str,dataSize: int,) -> int:
1054+
def compute_crc32(data: bytes,dataSize: int,) -> int:
10551055
"""Compute CRC32 hash code."""
10561056
...
1057-
def compute_md5(data: str,dataSize: int,) -> Any:
1057+
def compute_md5(data: bytes,dataSize: int,) -> Any:
10581058
"""Compute MD5 hash code, returns static int[4] (16 bytes)."""
10591059
...
1060-
def compute_sha1(data: str,dataSize: int,) -> Any:
1060+
def compute_sha1(data: bytes,dataSize: int,) -> Any:
10611061
"""Compute SHA1 hash code, returns static int[5] (20 bytes)."""
10621062
...
1063-
def compute_sha256(data: str,dataSize: int,) -> Any:
1063+
def compute_sha256(data: bytes,dataSize: int,) -> Any:
10641064
"""Compute SHA256 hash code, returns static int[8] (32 bytes)."""
10651065
...
10661066
@deprecated("Raylib no longer recommends the use of Physac library")
@@ -1075,10 +1075,10 @@ def create_physics_body_polygon(pos: Vector2|list|tuple,radius: float,sides: int
10751075
def create_physics_body_rectangle(pos: Vector2|list|tuple,width: float,height: float,density: float,) -> Any:
10761076
"""Creates a new rectangle physics body with generic parameters."""
10771077
...
1078-
def decode_data_base64(text: str,outputSize: Any,) -> str:
1078+
def decode_data_base64(text: str,outputSize: Any,) -> bytes:
10791079
"""Decode Base64 string (expected NULL terminated), memory must be MemFree()."""
10801080
...
1081-
def decompress_data(compData: str,compDataSize: int,dataSize: Any,) -> str:
1081+
def decompress_data(compData: bytes,compDataSize: int,dataSize: Any,) -> bytes:
10821082
"""Decompress data (DEFLATE algorithm), memory must be MemFree()."""
10831083
...
10841084
@deprecated("Raylib no longer recommends the use of Physac library")
@@ -1388,7 +1388,7 @@ def enable_cursor() -> None:
13881388
def enable_event_waiting() -> None:
13891389
"""Enable waiting for events on EndDrawing(), no automatic event polling."""
13901390
...
1391-
def encode_data_base64(data: str,dataSize: int,outputSize: Any,) -> str:
1391+
def encode_data_base64(data: bytes,dataSize: int,outputSize: Any,) -> str:
13921392
"""Encode data to Base64 string (includes NULL terminator), memory must be MemFree()."""
13931393
...
13941394
def end_blend_mode() -> None:
@@ -1418,7 +1418,7 @@ def end_vr_stereo_mode() -> None:
14181418
def export_automation_event_list(list_0: AutomationEventList|list|tuple,fileName: str,) -> bool:
14191419
"""Export automation events list as text file."""
14201420
...
1421-
def export_data_as_code(data: str,dataSize: int,fileName: str,) -> bool:
1421+
def export_data_as_code(data: bytes,dataSize: int,fileName: str,) -> bool:
14221422
"""Export data to code (.h), returns true on success."""
14231423
...
14241424
def export_font_as_code(font: Font|list|tuple,fileName: str,) -> bool:
@@ -1430,7 +1430,7 @@ def export_image(image: Image|list|tuple,fileName: str,) -> bool:
14301430
def export_image_as_code(image: Image|list|tuple,fileName: str,) -> bool:
14311431
"""Export image as code file defining an array of bytes, returns true on success."""
14321432
...
1433-
def export_image_to_memory(image: Image|list|tuple,fileType: str,fileSize: Any,) -> str:
1433+
def export_image_to_memory(image: Image|list|tuple,fileType: str,fileSize: Any,) -> bytes:
14341434
"""Export image to memory buffer, memory must be MemFree()."""
14351435
...
14361436
def export_mesh(mesh: Mesh|list|tuple,fileName: str,) -> bool:
@@ -1957,7 +1957,7 @@ def gui_load_style(fileName: str,) -> None:
19571957
def gui_load_style_default() -> None:
19581958
"""Load style default over global style."""
19591959
...
1960-
def gui_load_style_from_memory(fileData: str,dataSize: int,) -> None:
1960+
def gui_load_style_from_memory(fileData: bytes,dataSize: int,) -> None:
19611961
"""Load style from memory (binary only)."""
19621962
...
19631963
def gui_lock() -> None:
@@ -2370,7 +2370,7 @@ def load_directory_files_ex(basePath: str,filter: str,scanSubdirs: bool,) -> Fil
23702370
def load_dropped_files() -> FilePathList:
23712371
"""Load dropped filepaths."""
23722372
...
2373-
def load_file_data(fileName: str,dataSize: Any,) -> str:
2373+
def load_file_data(fileName: str,dataSize: Any,) -> bytes:
23742374
"""Load file data as byte array (read)."""
23752375
...
23762376
def load_file_text(fileName: str,) -> str:
@@ -2379,7 +2379,7 @@ def load_file_text(fileName: str,) -> str:
23792379
def load_font(fileName: str,) -> Font:
23802380
"""Load font from file into GPU memory (VRAM)."""
23812381
...
2382-
def load_font_data(fileData: str,dataSize: int,fontSize: int,codepoints: Any,codepointCount: int,type: int,glyphCount: Any,) -> Any:
2382+
def load_font_data(fileData: bytes,dataSize: int,fontSize: int,codepoints: Any,codepointCount: int,type: int,glyphCount: Any,) -> Any:
23832383
"""Load font data for further use."""
23842384
...
23852385
def load_font_ex(fileName: str,fontSize: int,codepoints: Any,codepointCount: int,) -> Font:
@@ -2388,7 +2388,7 @@ def load_font_ex(fileName: str,fontSize: int,codepoints: Any,codepointCount: int
23882388
def load_font_from_image(image: Image|list|tuple,key: Color|list|tuple,firstChar: int,) -> Font:
23892389
"""Load font from Image (XNA style)."""
23902390
...
2391-
def load_font_from_memory(fileType: str,fileData: str,dataSize: int,fontSize: int,codepoints: Any,codepointCount: int,) -> Font:
2391+
def load_font_from_memory(fileType: str,fileData: bytes,dataSize: int,fontSize: int,codepoints: Any,codepointCount: int,) -> Font:
23922392
"""Load font from memory buffer, fileType refers to extension: i.e. '.ttf'."""
23932393
...
23942394
def load_image(fileName: str,) -> Image:
@@ -2397,13 +2397,13 @@ def load_image(fileName: str,) -> Image:
23972397
def load_image_anim(fileName: str,frames: Any,) -> Image:
23982398
"""Load image sequence from file (frames appended to image.data)."""
23992399
...
2400-
def load_image_anim_from_memory(fileType: str,fileData: str,dataSize: int,frames: Any,) -> Image:
2400+
def load_image_anim_from_memory(fileType: str,fileData: bytes,dataSize: int,frames: Any,) -> Image:
24012401
"""Load image sequence from memory buffer."""
24022402
...
24032403
def load_image_colors(image: Image|list|tuple,) -> Any:
24042404
"""Load color data from image as a Color array (RGBA - 32bit)."""
24052405
...
2406-
def load_image_from_memory(fileType: str,fileData: str,dataSize: int,) -> Image:
2406+
def load_image_from_memory(fileType: str,fileData: bytes,dataSize: int,) -> Image:
24072407
"""Load image from memory buffer, fileType refers to extension: i.e. '.png'."""
24082408
...
24092409
def load_image_from_screen() -> Image:
@@ -2436,7 +2436,7 @@ def load_model_from_mesh(mesh: Mesh|list|tuple,) -> Model:
24362436
def load_music_stream(fileName: str,) -> Music:
24372437
"""Load music stream from file."""
24382438
...
2439-
def load_music_stream_from_memory(fileType: str,data: str,dataSize: int,) -> Music:
2439+
def load_music_stream_from_memory(fileType: str,data: bytes,dataSize: int,) -> Music:
24402440
"""Load music stream from data."""
24412441
...
24422442
def load_random_sequence(count: int,min_1: int,max_2: int,) -> Any:
@@ -2481,7 +2481,7 @@ def load_vr_stereo_config(device: VrDeviceInfo|list|tuple,) -> VrStereoConfig:
24812481
def load_wave(fileName: str,) -> Wave:
24822482
"""Load wave data from file."""
24832483
...
2484-
def load_wave_from_memory(fileType: str,fileData: str,dataSize: int,) -> Wave:
2484+
def load_wave_from_memory(fileType: str,fileData: bytes,dataSize: int,) -> Wave:
24852485
"""Load wave from memory buffer, fileType refers to extension: i.e. '.wav'."""
24862486
...
24872487
def load_wave_samples(wave: Wave|list|tuple,) -> Any:
@@ -2767,7 +2767,7 @@ def set_gamepad_vibration(gamepad: int,leftMotor: float,rightMotor: float,durati
27672767
def set_gestures_enabled(flags: int,) -> None:
27682768
"""Enable a set of gestures using flags."""
27692769
...
2770-
def set_load_file_data_callback(callback: str,) -> None:
2770+
def set_load_file_data_callback(callback: bytes,) -> None:
27712771
"""Set custom file binary data loader."""
27722772
...
27732773
def set_load_file_text_callback(callback: str,) -> None:
@@ -3019,7 +3019,7 @@ def unload_directory_files(files: FilePathList|list|tuple,) -> None:
30193019
def unload_dropped_files(files: FilePathList|list|tuple,) -> None:
30203020
"""Unload dropped filepaths."""
30213021
...
3022-
def unload_file_data(data: str,) -> None:
3022+
def unload_file_data(data: bytes,) -> None:
30233023
"""Unload file data allocated by LoadFileData()."""
30243024
...
30253025
def unload_file_text(text: str,) -> None:
@@ -3469,13 +3469,13 @@ def glfw_get_input_mode(window: Any|list|tuple,mode: int,) -> int:
34693469
def glfw_get_joystick_axes(jid: int,count: Any,) -> Any:
34703470
"""."""
34713471
...
3472-
def glfw_get_joystick_buttons(jid: int,count: Any,) -> str:
3472+
def glfw_get_joystick_buttons(jid: int,count: Any,) -> bytes:
34733473
"""."""
34743474
...
34753475
def glfw_get_joystick_guid(jid: int,) -> str:
34763476
"""."""
34773477
...
3478-
def glfw_get_joystick_hats(jid: int,count: Any,) -> str:
3478+
def glfw_get_joystick_hats(jid: int,count: Any,) -> bytes:
34793479
"""."""
34803480
...
34813481
def glfw_get_joystick_name(jid: int,) -> str:
@@ -4111,7 +4111,7 @@ def rl_pop_matrix() -> None:
41114111
def rl_push_matrix() -> None:
41124112
"""Push the current matrix to stack."""
41134113
...
4114-
def rl_read_screen_pixels(width: int,height: int,) -> str:
4114+
def rl_read_screen_pixels(width: int,height: int,) -> bytes:
41154115
"""Read screen pixel data (color buffer)."""
41164116
...
41174117
def rl_read_shader_buffer(id: int,dest: Any,count: int,offset: int,) -> None:
@@ -4392,18 +4392,18 @@ class Matrix:
43924392
self.m15:float = m15 # type: ignore
43934393
class Mesh:
43944394
"""Mesh, vertex data and vao/vbo."""
4395-
def __init__(self, vertexCount: int|None = None, triangleCount: int|None = None, vertices: Any|None = None, texcoords: Any|None = None, texcoords2: Any|None = None, normals: Any|None = None, tangents: Any|None = None, colors: str|None = None, indices: Any|None = None, boneCount: int|None = None, boneIndices: str|None = None, boneWeights: Any|None = None, animVertices: Any|None = None, animNormals: Any|None = None, vaoId: int|None = None, vboId: Any|None = None):
4395+
def __init__(self, vertexCount: int|None = None, triangleCount: int|None = None, vertices: Any|None = None, texcoords: Any|None = None, texcoords2: Any|None = None, normals: Any|None = None, tangents: Any|None = None, colors: bytes|None = None, indices: Any|None = None, boneCount: int|None = None, boneIndices: bytes|None = None, boneWeights: Any|None = None, animVertices: Any|None = None, animNormals: Any|None = None, vaoId: int|None = None, vboId: Any|None = None):
43964396
self.vertexCount:int = vertexCount # type: ignore
43974397
self.triangleCount:int = triangleCount # type: ignore
43984398
self.vertices:Any = vertices # type: ignore
43994399
self.texcoords:Any = texcoords # type: ignore
44004400
self.texcoords2:Any = texcoords2 # type: ignore
44014401
self.normals:Any = normals # type: ignore
44024402
self.tangents:Any = tangents # type: ignore
4403-
self.colors:str = colors # type: ignore
4403+
self.colors:bytes = colors # type: ignore
44044404
self.indices:Any = indices # type: ignore
44054405
self.boneCount:int = boneCount # type: ignore
4406-
self.boneIndices:str = boneIndices # type: ignore
4406+
self.boneIndices:bytes = boneIndices # type: ignore
44074407
self.boneWeights:Any = boneWeights # type: ignore
44084408
self.animVertices:Any = animVertices # type: ignore
44094409
self.animNormals:Any = animNormals # type: ignore
@@ -4624,12 +4624,12 @@ class rlRenderBatch:
46244624
self.currentDepth:float = currentDepth # type: ignore
46254625
class rlVertexBuffer:
46264626
"""Dynamic vertex buffers (position + texcoords + colors + indices arrays)."""
4627-
def __init__(self, elementCount: int|None = None, vertices: Any|None = None, texcoords: Any|None = None, normals: Any|None = None, colors: str|None = None, indices: Any|None = None, vaoId: int|None = None, vboId: list|None = None):
4627+
def __init__(self, elementCount: int|None = None, vertices: Any|None = None, texcoords: Any|None = None, normals: Any|None = None, colors: bytes|None = None, indices: Any|None = None, vaoId: int|None = None, vboId: list|None = None):
46284628
self.elementCount:int = elementCount # type: ignore
46294629
self.vertices:Any = vertices # type: ignore
46304630
self.texcoords:Any = texcoords # type: ignore
46314631
self.normals:Any = normals # type: ignore
4632-
self.colors:str = colors # type: ignore
4632+
self.colors:bytes = colors # type: ignore
46334633
self.indices:Any = indices # type: ignore
46344634
self.vaoId:int = vaoId # type: ignore
46354635
self.vboId:list = vboId # type: ignore

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "6.0.1.0"
1+
__version__ = "6.0.1.1"

0 commit comments

Comments
 (0)