mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-28 23:49:20 +00:00
updated presets
This commit is contained in:
parent
5da7f48d1e
commit
59cd5f78fa
@ -132,8 +132,8 @@ void init_game() {
|
||||
memset(players, 0, sizeof(players));
|
||||
players[0].head_attr = CHAR('1');
|
||||
players[1].head_attr = CHAR('2');
|
||||
players[0].tail_attr = 254;
|
||||
players[1].tail_attr = 254;
|
||||
players[0].tail_attr = '~';
|
||||
players[1].tail_attr = '@';
|
||||
frames_per_move = START_SPEED;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var palette;
|
||||
|
||||
function PixelEditor(parentDiv, fmt, palette, initialData, thumbnails) {
|
||||
var self = this;
|
||||
var width = fmt.w;
|
||||
@ -295,6 +293,9 @@ function convertPaletteBytes(arr,r0,r1,g0,g1,b0,b1) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var palette;
|
||||
var paletteSets;
|
||||
var paletteSetIndex=0;
|
||||
var currentPixelEditor;
|
||||
var parentSource;
|
||||
var parentOrigin;
|
||||
@ -306,7 +307,6 @@ var currentPaletteFmt;
|
||||
var allthumbs;
|
||||
|
||||
function pixelEditorDecodeMessage(e) {
|
||||
console.log(e.data);
|
||||
parentSource = e.source;
|
||||
parentOrigin = e.origin;
|
||||
currentFormat = e.data.fmt;
|
||||
@ -326,6 +326,14 @@ function pixelEditorDecodeMessage(e) {
|
||||
palette = convertPaletteBytes(palbytes, 0, rr, rr, gg, rr+gg, bb);
|
||||
else
|
||||
palette = convertPaletteBytes(palbytes, rr+gg, bb, rr, gg, 0, rr);
|
||||
if (currentPaletteFmt.n) {
|
||||
paletteSets = [];
|
||||
for (var i=0; i<palette.length; i+=currentPaletteFmt.n) {
|
||||
paletteSets.push(palette.slice(i, i+currentPaletteFmt.n));
|
||||
}
|
||||
palette = paletteSets[paletteSetIndex = 0];
|
||||
// TODO: swap palettes
|
||||
}
|
||||
} else {
|
||||
// TODO: default palette?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user