+static void
+place_back_char (m_state *state, char textc, int x, int y){
+ if((x>=0) && (y>=0) &&
+ (x < state->grid_width) && (y < state->grid_height)){
+ m_cell *celltmp = &state->background[state->grid_width * y + x];
+ celltmp -> glyph = char_map[(unsigned char)textc] + 1;
+ if(!celltmp->glyph || (celltmp->glyph == 3)){
+ celltmp -> glyph = char_map[32] + 1;
+ }
+ celltmp -> changed = 1;
+ }
+}
+
+static void
+place_back_text (m_state *state, char *text, int x, int y){
+ int i;
+ for(i=0; i<strlen(text); i++){
+ place_back_char(state, text[i], x+i, y);
+ }
+}
+
+static void
+place_back_pipe (m_state *state, char textc){
+ Bool new_line = False;
+ /* gringer pipe insert */
+ state->back_line[state->back_pos] = textc;
+ if(textc == '\n'){
+ state->back_line[state->back_pos] = '\0';
+ new_line = True;
+ }
+ else if ((state->back_pos > (state->grid_width - 4)) ||
+ (state->back_pos >= BUF_SIZE)){ /* off by 1? */
+ state->back_line[++state->back_pos] = '\0';
+ new_line = True;
+ }
+ else{
+ state->back_pos++;
+ }
+ if(new_line){
+ int startx = (state->grid_width >> 1) -
+ (strlen(state->back_line) >> 1);
+ place_back_text(state, state->back_line,
+ startx, state->back_y);
+ state->back_pos = 0;
+ state->back_y++;
+ if(state->back_y >= (state->grid_height - 1)){
+ state->back_y = 1;
+ state->back_text_full_p = True;
+ state->start_reveal_back_p = True;
+ }
+ }
+}
+