This commit is contained in:
parent
ad8173d562
commit
a30d306da0
5 changed files with 17 additions and 13 deletions
|
|
@ -28,7 +28,9 @@ print(OUT " rgb->green = (v >> 8) & 0xff;");
|
|||
print(OUT " rgb->blue = (v >> 0) & 0xff;");
|
||||
print(OUT "}\n");
|
||||
print(OUT "\n");
|
||||
print(OUT "static void add_color(const char* name, int red, int green, int blue){\n");
|
||||
print(OUT
|
||||
"static void add_color(const char* name, int red, int green, int blue){\n"
|
||||
);
|
||||
print(OUT " MwU32 v = (red << 16) | (green << 8) | (blue << 0);\n");
|
||||
print(OUT " shput(colors, name, v);\n");
|
||||
print(OUT "}\n");
|
||||
|
|
@ -36,10 +38,11 @@ print(OUT "\n");
|
|||
print(OUT "void MwColorTableInit(void){\n");
|
||||
print(OUT " sh_new_strdup(colors);\n");
|
||||
print(OUT " shdefault(colors, 0);\n");
|
||||
|
||||
while (my $l = <IN>) {
|
||||
$l =~ s/\r?\n$//;
|
||||
if ($l =~ /^[ \t]*([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+(.+)$/) {
|
||||
print(OUT " add_color(\"$4\", $1, $2, $3);\n");
|
||||
print(OUT " add_color(\"$4\", $1, $2, $3);\n");
|
||||
}
|
||||
}
|
||||
print(OUT "}\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue