diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 17:25:27 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 17:25:27 +0100 |
commit | 842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24 (patch) | |
tree | fa3894a02efd5cd730b6f395ae01ff82bdaf65e7 /minilibx_linux/rgb2c.pl | |
parent | Edited sounds, bug fix (diff) | |
parent | Back to the GNU C Compiler, tweaked move speed (diff) | |
download | 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.gz 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.bz2 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.xz 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.zst 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.zip |
Merge branch 'master' into back-to-pthread
Diffstat (limited to '')
-rwxr-xr-x | minilibx_linux/rgb2c.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/minilibx_linux/rgb2c.pl b/minilibx_linux/rgb2c.pl new file mode 100755 index 0000000..9ef39a0 --- /dev/null +++ b/minilibx_linux/rgb2c.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# +## rgb2c.pl for MiniLibX in /home/boulon/work/c/raytraceur/minilibx +## +## Made by Olivier Crouzet +## Login <ol@epitech.net> +## +## Started on Tue Oct 5 16:33:46 2004 Olivier Crouzet +## Last update Tue Oct 5 16:36:11 2004 Olivier Crouzet +## + + +# +# Generate a .c file with encoded colors, from the XFree86 rgb.txt file. +# + +open(RGB, "/usr/X11/lib/X11/rgb.txt"); + + +printf("/*\n** This is a generated file with rgb2c.pl and rgb.txt from\n"); +printf("** the XFree86 distribution.\n*/\n\n"); +printf("struct s_col_name mlx_col_name[] =\n{\n"); + +while (<RGB>) +{ + @tab = split; + if ($tab[0] ne "!") + { + $color = $tab[3]; + if ("$tab[4]" ne "") + { + $color = "$tab[3] $tab[4]"; + } + printf(" { \"%s\" , 0x%x },\n", $color, $tab[0]*65536+$tab[1]*256+$tab[2]); + } +} + +printf(" { 0, 0 }\n};\n"); |