Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
casualty of #416
- Loading branch information
rt
committed
Nov 23, 2018
1 parent
9e01e1c
commit b7bb119
Showing
4 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,17 @@ | ||
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ | ||
|
||
|
||
#include "TAPalette.h" | ||
#include "System/FileSystem/FileHandler.h" | ||
|
||
CTAPalette palette; | ||
|
||
CTAPalette::CTAPalette() | ||
{ | ||
for (auto& color: p) { | ||
color[0] = 0; | ||
color[1] = 0; | ||
color[2] = 0; | ||
color[3] = 255; | ||
} | ||
} | ||
|
||
void CTAPalette::Init(CFileHandler& paletteFile) | ||
{ | ||
for (auto& color: p) { | ||
for (auto& channel: color) { | ||
paletteFile.Read(&color, 1); | ||
} | ||
color[3] = 255; | ||
if (!paletteFile.FileExists()) | ||
return; | ||
|
||
for (SColor& color: colors) { | ||
paletteFile.Read(&color.i, 4); | ||
// ignore alpha | ||
color.a = 255; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters