# HG changeset patch # User John Tsiombikas # Date 1348194448 -10800 # Node ID 0d4061b1e6a10c7e1770f6be8879cb3945c7b454 # Parent 508540dae114f1e52ce0c668d9f743dffe3bcfee changed the level a bit to indicate where there should be lights I need to scrap all this asap diff -r 508540dae114 -r 0d4061b1e6a1 prototype/data/0.level --- a/prototype/data/0.level Fri Sep 21 01:05:35 2012 +0300 +++ b/prototype/data/0.level Fri Sep 21 05:27:28 2012 +0300 @@ -21,22 +21,22 @@ ################################################################ ################################################################ ################################################################ -############################# s s H ########################## -############################# s ### ########################## -############################# ### ########################## -############################# ### ########################## -###############################D##### ########################## -########################### ## ##T ########################## -######################### D w## ## ########################## -######################### # ## ##T T########################## -######################### #### ############################### -######################### S ########################## -######################### #### #### ########################## +############################# * * * * ######################### +#############################* *####*######################### +############################# + #### ######################### +#############################* *####*######################### +###############################*###### ######################### +###########################**## ##* * *######################### +#########################* ##*## ######################### +######################### #**## ##* * *######################### +#########################*####* *############################### +######################### * * * * ########################## +#########################*####* *####*########################## ######################### ########### ########################## +#########################*###########*########################## ######################### ########### ########################## -######################### ########### ########################## -######################### #####s##### ########################## -######################### ########################## +#########################*#####*#####*########################## +######################### * * * * * * ########################## ################################################################ ################################################################ ################################################################ diff -r 508540dae114 -r 0d4061b1e6a1 prototype/data/default.tileset --- a/prototype/data/default.tileset Fri Sep 21 01:05:35 2012 +0300 +++ b/prototype/data/default.tileset Fri Sep 21 05:27:28 2012 +0300 @@ -1,1 +1,2 @@ -default:deftile.obj +default:deftile-nolight.obj +light:deftile-lights.obj diff -r 508540dae114 -r 0d4061b1e6a1 prototype/src/level.cc --- a/prototype/src/level.cc Fri Sep 21 01:05:35 2012 +0300 +++ b/prototype/src/level.cc Fri Sep 21 05:27:28 2012 +0300 @@ -69,10 +69,29 @@ break; } - if(isalpha(buf[i]) || buf[i] == ' ') { + + if(buf[i] != '#') { GridCell *cell = new GridCell(deftile); *grid_row = cell; cell_list.push_back(*grid_row); + + Tile *tile; + + switch(buf[i]) { + case '*': + if(!(tile = tileset->get_tile("light"))) { + fprintf(stderr, "failed to add light tile\n"); + } + break; + + default: + tile = 0; + break; + } + + if(tile) { + cell->add_tile(tile); + } } grid_row++; }