Skip to content

Commit

Permalink
Progress Tracking for Raylib 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-montanez committed Mar 12, 2021
1 parent 16d222d commit a180539
Show file tree
Hide file tree
Showing 6 changed files with 1,349 additions and 574 deletions.
1,288 changes: 715 additions & 573 deletions MAPPING.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PHP 7.x bindings for RayLib, a simple and easy-to-use library to learn video gam
This is currently a work-in-progress and bindings are not complete and are likely to change. Progress of binding can be tracked via
[MAPPING.md](MAPPING.md)

- raylib.h - 191 of 418 functions ~ %43 complete
- raylib.h - 203 of 422 functions ~ %49 complete (49 Functions are not going to be implemented)
- raymath.h - TODO Extra mathy stuff
- raygui.h - TODO API for drawing GUI
- physac.h - TODO More complex collision detection, more than built-in collision detection
Expand Down
7 changes: 7 additions & 0 deletions examples/tests/camera2d.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
$camera = new \raylib\Camera2d();

$camera->target->x = 5;
$camera->target->y = 6;

var_dump($camera->target);
53 changes: 53 additions & 0 deletions mappings-reader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

$row = 1;
$mapped = 0;
$todo = 0;
$skipped = 0;
$total = 0;

echo "# raylib to PHP Mapping / Progress
This is a one to one mapping of each raylib function.\n\n";

if (($handle = fopen(__DIR__ . '/raylib-3.5-status-functions.csv', "r")) !== FALSE) {
while (($data = fgetcsv($handle, 5000, ",")) !== FALSE) {
if ($row === 1) {
$header = $data;
$row++;
continue;
}

$mapped_data = [];

$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$mapped_data[$header[$c]] = $data[$c];
}

if (stristr($mapped_data['Function'], ';') !== false) {
if ($mapped_data['Mapped Method'] === '--') { $skipped++; }
elseif (strtoupper($mapped_data['Mapped Method']) === 'TODO') { $todo++; }
else { $mapped++; }
$total++;

echo '| ' . $mapped_data['Function'] . ' | ' . $mapped_data['Mapped Method'] . ' | ' . $mapped_data['Implementation Comment'] . ' |', PHP_EOL;
} elseif(stristr($mapped_data['Function'], ';') === false && strlen($mapped_data['Function']) > 0) {
echo PHP_EOL . PHP_EOL;
echo '##' . $mapped_data['Function'], PHP_EOL . PHP_EOL;
echo '| C API | PHP API | Comment |', PHP_EOL;
echo '|-------|---------|---------|', PHP_EOL;
}

}
fclose($handle);

echo "\nTotal: {$total}
Wont Implement: {$skipped}
Todo: {$todo}
Mapped: {$mapped}";

echo "\nDone: " . round($mapped / ($total - $skipped) * 100) . '%';
}
?>
Loading

0 comments on commit a180539

Please sign in to comment.