summaryrefslogtreecommitdiff
path: root/apiScanner.lua
blob: 6a232680aab21a392affd046ea3966ca47df95df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
local raylib = {
	prefix = "RLAPI",
	file = "raylib.h",
	blacklist = {
		InitWindow = true, -- Handled internally.
		WindowShouldClose = true, -- Handled internally.
		GetScreenWidth = true, -- Replaced by GetScreenSize.
		GetScreenHeight = true, -- Replaced by GetScreenSize.
		GetRenderWidth = true, -- Replaced by GetRenderSize.
		GetRenderHeight = true, -- Replaced by GetRenderSize.
		GetMonitorWidth = true, -- Replaced by GetMonitorSize.
		GetMonitorHeight = true, -- Replaced by GetMonitorSize.
		GetMonitorPhysicalWidth = true, -- Replaced by GetMonitorPhysicalSize.
		GetMonitorPhysicalHeight = true, -- Replaced by GetMonitorPhysicalSize.
		UnloadRandomSequence = true, -- Handled internally.
		MemAlloc = true, -- Buffer should be used instead.
		MemRealloc = true, -- Buffer should be used instead.
		MemFree = true, -- Buffer should be used instead.
		SetTraceLogCallback = true, -- Handled internally.
		SetLoadFileDataCallback = true, -- Not seen necessary.
		SetSaveFileDataCallback = true, -- Not seen necessary.
		SetLoadFileTextCallback = true, -- Not seen necessary.
		SetSaveFileTextCallback = true, -- Not seen necessary.
		UnloadFileData = true, -- Handled internally.
		UnloadFileText = true, -- Handled internally.
		UnloadDirectoryFiles = true, -- Handled internally.
		UnloadDroppedFiles = true, -- Handled internally.
		GetMouseX = true, -- Replaced by GetMousePosition.
		GetMouseY = true, -- Replaced by GetMousePosition.
		GetTouchX = true, -- Replaced by GetTouchPosition.
		GetTouchY = true, -- Replaced by GetTouchPosition.
		UpdateCamera = true, -- Replaced by UpdateCamera3D.
		UpdateCameraPro = true, -- Replaced by UpdateCameraPro3D.
		DrawPixelV = true, -- Replaced by DrawPixel.
		DrawLineV = true, -- Replaced by DrawLine.
		DrawCircleV = true, -- Replaced by DrawCircle.
		DrawCircleLinesV = true, -- Replaced by DrawCircleLines.
		DrawRectangleV = true, -- Replaced by DrawRectangle.
		DrawRectangleRec = true, -- Replaced by DrawRectangle.
		ImageTextEx = true, -- Replaced by ImageText.
		UnloadImageColors = true, -- Handled internally.
		UnloadImagePalette = true, -- Handled internally.
		ImageDrawPixelV = true, -- Replaced by ImageDrawPixel.
		ImageDrawLineV = true, -- Replaced by ImageDrawLine.
		ImageDrawCircleV = true, -- Replaced by ImageDrawCircle.
		ImageDrawCircleLinesV = true, -- Replaced by ImageDrawCircleLines.
		ImageDrawRectangleV = true, -- Replaced by ImageDrawRectangle.
		ImageDrawRectangleRec = true, -- Replaced by ImageDrawRectangle.
		DrawTextureV = true, -- Replaced by DrawTexture.
		UnloadFontData = true, -- Handled internally.
		MeasureTextEx = true, -- Replaced by MeasureText.
		UnloadUTF8 = true, -- Handled internally.
		UnloadCodepoints = true, -- Handled internally.
		TextCopy = true, -- Can be replaced by Lua equivalent.
		TextIsEqual = true, -- Can be replaced by Lua equivalent.
		TextLength = true, -- Can be replaced by Lua equivalent.
		TextSubtext = true, -- Can be replaced by Lua equivalent.
		TextJoin = true, -- Can be replaced by Lua equivalent.
		TextAppend = true, -- Can be replaced by Lua equivalent.
		TextToUpper = true, -- Can be replaced by Lua equivalent.
		TextToLower = true, -- Can be replaced by Lua equivalent.
		TextToInteger = true, -- Can be replaced by Lua equivalent.
		DrawCubeV = true, -- Replaced by DrawCube.
		DrawCubeWiresV = true, -- Replaced by DrawCubeWires.
		UploadMesh = true, -- Handled internally.
		UpdateMeshBuffer = true, -- Handled internally.
		UnloadWaveSamples = true, -- Handled internally.
	},
	info = {
		IsKeyPressedRepeat = "Will be added",
		IsGamepadButtonUp = "Will be added",
		GetGamepadButtonPressed = "Will be added",
		GetMouseWheelMoveV = "Will be added",
		DrawLineEx = "Will be added",
		ImageDrawText = "Could be added",
		DrawTextureEx = "Will be added",
		DrawTriangleStrip3D = "Will be added",
		GenMeshHemiSphere = "Will be added",
		GenMeshCubicmap = "Will be added",
		UpdateSound = "Will be added",
		LoadWaveSamples = "Will be added",
	}
}
local rlgl = {
	prefix = "RLAPI",
	file = "rlgl.h",
	blacklist = {
		rlVertex2i = true, -- Most likely not needed.
		rlglInit = true, -- Handled internally.
		rlglClose = true, -- Handled internally.
		rlLoadExtensions = true, -- Handled internally.
		rlLoadDrawCube = true, -- Most likely not needed.
		rlLoadDrawQuad = true, -- Most likely not needed.
	},
	info = {
		rlEnableStatePointer = "Available for GRAPHICS_API_OPENGL_11",
		rlDisableStatePointer = "Available for GRAPHICS_API_OPENGL_11",
	},
}
local raygui = {
	prefix = "RAYGUIAPI",
	file = "raygui.h",
	blacklist = {
	},
	info = {
	},
}
local raymath = {
	prefix = "RMAPI",
	file = "raymath.h",
	blacklist = {
		Vector3ToFloatV = true, -- Can be replaced by Lua equivalent.
		MatrixToFloatV = true, -- Can be replaced by Lua equivalent.
	},
	info = {
		Vector3Project = "Will be added",
		Vector3Reject = "Will be added",
	},
}
local easings = {
	prefix = "EASEDEF",
	file = "easings.h",
	blacklist = {
		EaseLinearNone = true, -- "Replaced by EaseLinear"
		EaseLinearIn = true, -- "Replaced by EaseLinear"
		EaseLinearOut = true, -- "Replaced by EaseLinear"
		EaseLinearInOut = true, -- "Replaced by EaseLinear"
	},
	info = {
	},
}

local filePrefix = "../include/"
local headers = {
	raylib,
	rlgl,
	raygui,
	raymath,
	easings,
}

for _, header in ipairs( headers ) do
	local file = io.open( filePrefix..header.file, "r" )

	if file ~= nil then
		local line = ""

		print( "\nFunctions not implemented from '"..header.file.."':\n" )

		repeat
			line = file:read( "*l" )

			if line ~= nil and line:sub( 1, #header.prefix ) == header.prefix then
				local splits = RL.TextSplit( line:sub( 1, RL.TextFindIndex( line, "(" ) ), " " )
				local func = splits[ #splits ]
				func = func:gsub( "*", "" )

				if RL[ func ] == nil and not header.blacklist[ func ] then
					local output = func

					if header.info[ func ] ~= nil then
						output = output.."\t\""..header.info[ func ].."\""
					end

					print( output )
				end
			end
		until line == nil
	end
end