Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [370dd766bc]:

To Artifact [612e3375bc]:


131
132
133
134
135
136
137
















































138
139
140
141
142
143
144
      ++f;
    }
    t++;
    if(!--len) return;
    pix+=8;
  }
}

















































void draw_key(int x,int y,int k,int bg,int fg) {
  // To be called only when screen is locked!
  Uint8*p=screen->pixels;
  Uint16 pitch=screen->pitch;
  int xx,yy;
  const unsigned char*f;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
      ++f;
    }
    t++;
    if(!--len) return;
    pix+=8;
  }
}

int draw_text_line(int x,int y,unsigned char*t,int cur,Uint8**cp) {
  // To be called only when screen is locked!
  int len=strlen(t);
  const unsigned char*s=t;
  Uint8*pix=screen->pixels;
  Uint8*p;
  Uint16 pitch=screen->pitch;
  int bg,fg,xx,yy;
  char isimg=0;
  char e=0;
  const unsigned char*f;
  if(!*t) return 0;
  len=(screen->w-x)>>3;
  if(len<=0 || y+8>screen->h) return len<1?1:len;
  pix+=y*pitch+x;
  for(;;) {
    if(!cur) *cp=t;
    if(*t==10) {
      f=fontdata+(17<<3);
      bg=0xF0,fg=0xF1;
      e=1;
    } else if(!*t) {
      f=fontdata+(254<<3);
      bg=0xF0,fg=0xF1;
      e=1;
    } else if(*t<31) {
      f=fontdata+(" 01234567?NLC#IBQ???????????????"[*t]<<3);
      if(*t==14) isimg=1;
      bg=0xF3,fg=0xF0;
    } else {
      if(*t==31 && t[1]) t++;
      f=fontdata+(*t<<3);
      bg=0xF0,fg=isimg?0xF2:0xF7;
    }
    if(!cur--) bg^=15,fg^=15;
    p=pix;
    for(yy=0;yy<8;yy++) {
      for(xx=0;xx<8;xx++) p[xx]=(*f<<xx)&128?fg:bg;
      p+=pitch;
      ++f;
    }
    if(*t=='\\') isimg=0;
    if(!--len || e) return t-s;
    t++;
    pix+=8;
  }
}

void draw_key(int x,int y,int k,int bg,int fg) {
  // To be called only when screen is locked!
  Uint8*p=screen->pixels;
  Uint16 pitch=screen->pitch;
  int xx,yy;
  const unsigned char*f;