Remove deprecaded functions, fix build errors/warnings

This commit is contained in:
JupiterRider 2023-04-07 21:22:05 +02:00
parent e0ea1245da
commit 9e86471b2f
5 changed files with 7 additions and 76 deletions

View file

@ -62,7 +62,7 @@ typedef struct {
extern "C" { // Prevents name mangling of functions
#endif
qoaplay_desc *qoaplay_open(char *path);
qoaplay_desc *qoaplay_open(const char *path);
qoaplay_desc *qoaplay_open_memory(const unsigned char *data, int data_size);
void qoaplay_close(qoaplay_desc *qoa_ctx);
@ -83,7 +83,7 @@ int qoaplay_get_frame(qoaplay_desc *qoa_ctx);
//----------------------------------------------------------------------------------
// Open QOA file, keep FILE pointer to keep reading from file
qoaplay_desc *qoaplay_open(char *path)
qoaplay_desc *qoaplay_open(const char *path)
{
FILE *file = fopen(path, "rb");
if (!file) return NULL;

View file

@ -8,44 +8,8 @@ package rl
*/
import "C"
// SetCameraMode - Set camera mode (multiple camera modes available)
func SetCameraMode(camera Camera, mode CameraMode) {
ccamera := camera.cptr()
cmode := (C.int)(mode)
C.SetCameraMode(*ccamera, cmode)
}
// UpdateCamera - Update camera position for selected mode
func UpdateCamera(camera *Camera) {
func UpdateCamera(camera *Camera, mode CameraMode) {
ccamera := camera.cptr()
C.UpdateCamera(ccamera)
}
// SetCameraPanControl - Set camera pan key to combine with mouse movement (free camera)
func SetCameraPanControl(panKey int32) {
cpanKey := (C.int)(panKey)
C.SetCameraPanControl(cpanKey)
}
// SetCameraAltControl - Set camera alt key to combine with mouse movement (free camera)
func SetCameraAltControl(altKey int32) {
caltKey := (C.int)(altKey)
C.SetCameraAltControl(caltKey)
}
// SetCameraSmoothZoomControl - Set camera smooth zoom key to combine with mouse (free camera)
func SetCameraSmoothZoomControl(szKey int32) {
cszKey := (C.int)(szKey)
C.SetCameraSmoothZoomControl(cszKey)
}
// SetCameraMoveControls - Set camera move controls (1st person and 3rd person cameras)
func SetCameraMoveControls(frontKey int32, backKey int32, rightKey int32, leftKey int32, upKey int32, downKey int32) {
cfrontKey := (C.int)(frontKey)
cbackKey := (C.int)(backKey)
crightKey := (C.int)(rightKey)
cleftKey := (C.int)(leftKey)
cupKey := (C.int)(upKey)
cdownKey := (C.int)(downKey)
C.SetCameraMoveControls(cfrontKey, cbackKey, crightKey, cleftKey, cupKey, cdownKey)
C.UpdateCamera(ccamera, C.int(mode))
}

View file

@ -986,11 +986,11 @@ func GetShaderBufferSize(id uint32) uint32 {
}
// BindImageTexture - Bind image texture
func BindImageTexture(id uint32, index uint32, format uint32, readonly int32) {
func BindImageTexture(id uint32, index uint32, format int32, readonly bool) {
cid := C.uint(id)
cindex := C.uint(index)
cformat := C.uint(format)
creadonly := C.int(readonly)
cformat := C.int(format)
creadonly := C.bool(readonly)
C.rlBindImageTexture(cid, cindex, cformat, creadonly)
}

View file

@ -97,17 +97,6 @@ func DrawCubeWiresV(position Vector3, size Vector3, col color.RGBA) {
C.DrawCubeWiresV(*cposition, *csize, *ccolor)
}
// DrawCubeTexture - Draw cube textured
func DrawCubeTexture(texture Texture2D, position Vector3, width float32, height float32, length float32, col color.RGBA) {
ctexture := texture.cptr()
cposition := position.cptr()
cwidth := (C.float)(width)
cheight := (C.float)(height)
clength := (C.float)(length)
ccolor := colorCptr(col)
C.DrawCubeTexture(*ctexture, *cposition, cwidth, cheight, clength, *ccolor)
}
// DrawSphere - Draw sphere
func DrawSphere(centerPos Vector3, radius float32, col color.RGBA) {
ccenterPos := centerPos.cptr()

View file

@ -686,28 +686,6 @@ func DrawTextureRec(texture Texture2D, sourceRec Rectangle, position Vector2, ti
C.DrawTextureRec(*ctexture, *csourceRec, *cposition, *ctint)
}
// DrawTextureQuad - Draw texture quad with tiling and offset parameters
func DrawTextureQuad(texture Texture2D, tiling, offset Vector2, rectangle Rectangle, tint color.RGBA) {
ctexture := texture.cptr()
ctiling := tiling.cptr()
coffset := offset.cptr()
crectangle := rectangle.cptr()
ctint := colorCptr(tint)
C.DrawTextureQuad(*ctexture, *ctiling, *coffset, *crectangle, *ctint)
}
// DrawTextureTiled - Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest
func DrawTextureTiled(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, scale float32, tint color.RGBA) {
ctexture := texture.cptr()
csourceRec := sourceRec.cptr()
cdestRec := destRec.cptr()
corigin := origin.cptr()
crotation := (C.float)(rotation)
cscale := (C.float)(scale)
ctint := colorCptr(tint)
C.DrawTextureTiled(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, cscale, *ctint)
}
// DrawTexturePro - Draw a part of a texture defined by a rectangle with 'pro' parameters
func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, tint color.RGBA) {
ctexture := texture.cptr()