Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Raylib 4.2 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions ...ectations/DeprectationsRaylib-4_0_0.swift → ...precations/DeprecationsRaylib-4_2_0.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* http://stregasgate.com
*/

// This file contains deprecations for SwiftRaylib from Raylib 3.7 to 4.0
// This file contains deprecations for SwiftRaylib from Raylib 3.7 to 4.2
// Swift will guide you through upgrading, and this file contains the hints it needs to do so.

import _RaylibC
Expand Down Expand Up @@ -56,6 +56,13 @@ public extension Raylib {
fatalError()
}

/// Get collision info between ray and model
@available(*, unavailable, message: "Removed in Raylib 4.2.0")
@inlinable
static func getRayCollisionModel(_ ray: Ray, _ model: Model) -> RayCollision {
fatalError()
}

/// Get collision info between ray and triangle
@available(*, unavailable, renamed: "getRayCollisionTriangle()")
@inlinable
Expand Down Expand Up @@ -85,10 +92,17 @@ public extension Raylib {
}

/// Compute mesh binormals
@available(*, deprecated, renamed: "genMeshBinormals()")
@available(*, deprecated, message: "Removed in Raylib 4.2.0")
@inlinable
static func meshBinormals(_ mesh: inout Mesh) {
_RaylibC.GenMeshBinormals(&mesh)
fatalError()
}

/// Compute mesh binormals
/// @available(*, deprecated, message: "Removed in Raylib 4.2.0")
@inlinable
static func genMeshBinormals(_ mesh: inout Mesh) {
fatalError()
}

/// Detect collision between ray and sphere
Expand Down Expand Up @@ -216,6 +230,14 @@ public func max(_ v1: Vector3, _ v2: Vector3) -> Vector3 {
return _RaylibC.Vector3Max(v1, v2)
}

/// Normalize provided matrix
@available(*, unavailable, message: "Removed in Raylin 4.2.0")
@inlinable
var normalized: Matrix {
fatalError()
}



//MARK: - Raylib_h_audio.swift
public extension Raylib {
Expand Down Expand Up @@ -261,4 +283,46 @@ public extension Raylib {
static func getTouchPointsCount() -> Int32 {
return _RaylibC.GetTouchPointCount()
}

/// Get filenames in a directory path (memory should be freed)
@available(*, unavailable, renamed: "loadDirectoryFiles()")
@inlinable
static func getDirectoryFiles(_ dirPath: String) -> [String] {
fatalError()
}

/// Clear directory files paths buffers (free memory)
@available(*, unavailable, renamed: "unloadDirectoryFiles()")
@inlinable
static func clearDirectoryFiles() {
fatalError()
}

/// Get dropped files names (memory should be freed)
@available(*, unavailable, renamed: "loadDroppedFiles()")
@inlinable
static func getDroppedFiles() -> [String] {
fatalError()
}

/// Clear dropped files paths buffer (free memory)
@available(*, unavailable, renamed: "unloadDroppedFiles()")
@inlinable
static func clearDroppedFiles() {
fatalError()
}

/// Save integer value to storage file (to defined position), returns true on success
@available(*, unavailable, message: "Removed in Raylib 4.2.0")
@inlinable
static func saveStorageValue(_ position: UInt32, _ value: Int32) -> Bool {
fatalError()
}

/// Load integer value from storage file (from defined position)
@available(*, unavailable, message: "Removed in Raylib 4.2.0")
@inlinable
static func loadStorageValue(_ position: UInt32) -> Int32 {
fatalError()
}
}
2 changes: 1 addition & 1 deletion Sources/Raylib/Enums/CameraMode.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ public enum CameraMode: Int32 {
/// First person camera
case firstPerson
/// Third person camera
case thridPerson
case thirdPerson
}
3 changes: 3 additions & 0 deletions Sources/Raylib/SwiftRaylib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ import _RaylibC
// VR Stereo rendering configuration for simulator
@_exported import struct _RaylibC.VrStereoConfig

// File path list
@_exported import struct _RaylibC.FilePathList

#if canImport(Foundation)
@_exported import struct Foundation.URL
@_exported import class Foundation.Bundle
Expand Down
18 changes: 18 additions & 0 deletions Sources/Raylib/raylib_h_audio.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,22 @@ public extension Raylib {
static func setAudioStreamBufferSizeDefault(_ size: Int32) {
_RaylibC.SetAudioStreamBufferSizeDefault(size)
}

/// Audio thread callback to request new data
@inlinable
static func setAudioStreamCallback(_ stream: AudioStream, _ callback: @escaping AudioCallback) {
_RaylibC.SetAudioStreamCallback(stream, callback)
}

/// Attach audio stream processor to stream
@inlinable
static func attachAudioStreamProcessor(_ stream: AudioStream, _ processor: @escaping AudioCallback) {
_RaylibC.AttachAudioStreamProcessor(stream, processor)
}

/// Detach audio stream processor from stream
@inlinable
static func detachAudioStreamProcessor(_ stream: AudioStream, _ processor: @escaping AudioCallback) {
_RaylibC.DetachAudioStreamProcessor(stream, processor)
}
}
Loading