fix Tetris example build on dmd 2.0.67

This commit is contained in:
Vadim Lopatin 2015-03-25 09:20:03 +03:00
parent fc479a1cfa
commit d7ecdc4417
1 changed files with 64 additions and 59 deletions

View File

@ -69,7 +69,11 @@ struct Figure {
}
/// All shapes
const Figure[7] FIGURES = [
__gshared const Figure[7] FIGURES;
// workaround for dmd 2.0.67 - move initialization to static this
__gshared static this() {
FIGURES = [
// FIGURE1 ===========================================
// ## ####
// 00## 00##
@ -127,7 +131,8 @@ const Figure[7] FIGURES = [
FigureShape([0, 1], [0,-1], [ 1, 0]),
FigureShape([1, 0], [-1,0], [ 0, 1]),
FigureShape([0, 1], [0,-1], [-1, 0])]),
];
];
}
/// colors for different figure types
const uint[7] _figureColors = [0xC00000, 0x80A000, 0xA00080, 0x0000C0, 0x800020, 0x408000, 0x204000];