%alltop{
/*
* upkg: tool for manipulating Unreal Tournament packages.
- * Copyright © 2011 Nick Bowler
+ * Copyright © 2011, 2020 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
class Engine:Palette from U:Object (dynamic)
{
public unsigned entries = 0;
- public engine_palette_rgba *rgba = NULL;
+ public engine_palette_rgba *rgba = NULL destroywith free;
override (U:Object) int deserialize(U:Object *uo)
{
return -1;
self->entries = entries;
- upkg_export_seek(f, rc, SEEK_SET);
+ if (upkg_export_seek(f, rc, SEEK_SET) != 0)
+ return -1;
buflen = entries * sizeof self->rgba[0];
self->rgba = malloc(buflen);
if (!self->rgba)
return -1;
}
- printf("palette: %u entries\n", self->entries);
return 0;
}
}