diff --git a/BuildLibs/buildmap.py b/BuildLibs/buildmap.py index 82ab17c..b943ac3 100644 --- a/BuildLibs/buildmap.py +++ b/BuildLibs/buildmap.py @@ -96,8 +96,8 @@ def ReadHeaders(self, data): def CreateSpritePacker(self): self.spritePacker = FancyPacker('<', OrderedDict( - pos='iii', cstat='h', picnum='h', gfxstuff='bBB', filler='B', - texcoords='BBbb', sectnum='h', statnum='h', angle='h', + pos='iii', cstat='h', picnum='h', shade='b', palette='B', clipdist='B', + filler='B', texcoords='BBbb', sectnum='h', statnum='h', angle='h', owner='h', velocity='hhh', lowtag='h', hightag='h', extra='h') ) @@ -240,9 +240,12 @@ def DupeSprite(self, rng: random.Random, sprite:Sprite, spacing: float, possible if rng.random() < replacementChance: replace = rng.choice((*possibleReplacements.keys(), sprite.picnum)) if replace != sprite.picnum: - sprite.lowtag = possibleReplacements[replace].get('lowtag', sprite.lowtag) - xrepeat = possibleReplacements[replace].get('xrepeat', sprite.texcoords[0]) - yrepeat = possibleReplacements[replace].get('yrepeat', sprite.texcoords[1]) + r = possibleReplacements[replace] + sprite.lowtag = r.get('lowtag', sprite.lowtag) + xrepeat = r.get('xrepeat', sprite.texcoords[0]) + yrepeat = r.get('yrepeat', sprite.texcoords[1]) + palettes = r.get('palettes', [0]) + sprite.palette = rng.choice(palettes) sprite.texcoords = [xrepeat, yrepeat, 0, 0] sprite.picnum = replace for i in range(20): @@ -446,8 +449,8 @@ def ReadHeaders(self, data): def CreateSpritePacker(self): self.spritePacker = FancyPacker('<', OrderedDict( - pos='iii', cstat='h', gfxstuff='bBB', texcoords='BBbb', - picnum='h', angle='h', velocity='hhh', owner='h', + pos='iii', cstat='h', shade='b', palette='B', clipdist='B', + texcoords='BBbb', picnum='h', angle='h', velocity='hhh', owner='h', sectnum='h', statnum='h', lowtag='h', hightag='h', extra='h') ) diff --git a/BuildLibs/games.py b/BuildLibs/games.py index 6d4fff6..9eefd7e 100644 --- a/BuildLibs/games.py +++ b/BuildLibs/games.py @@ -114,13 +114,15 @@ def GetGameConSettings(game: GameInfo) -> GameConSettings: g:GameConSettings = gamesConSettings.get(game.type, GameConSettings()) return g.copy() -def SpriteInfo(name:str, category:str='', lowtag:int=0, xrepeat:int=0, yrepeat:int=0) -> dict: +def SpriteInfo(name:str, category:str='', lowtag:int=0, xrepeat:int=0, yrepeat:int=0, palettes=None) -> dict: d = dict(name=name, category=category) if lowtag: d['lowtag'] = lowtag if xrepeat: d['xrepeat'] = xrepeat d['yrepeat'] = yrepeat + if palettes: + d['palettes'] = palettes return d def SpriteRange(min:int, max:int, value:dict):