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 [b22c8897cb]:

To Artifact [923fd4390d]:


107
108
109
110
111
112
113


















114
115
116
117
118
119
120
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







      c=classes[objects[o]->class];
      if(objects[o]->anim && (objects[o]->anim->status&ANISTAT_VISUAL)) i=objects[o]->anim->vimage; else i=objects[o]->image;
      if(i<c->nimages) draw_picture((x-1)*picture_size+left_margin,(y-1)*picture_size,c->images[i]&0x7FFF);
    }
    o=objects[o]->up;
  }
}

void draw_selection_rectangle(void) {
  Uint16 pitch=screen->pitch;
  Uint8*p=screen->pixels+left_margin+(editrect.x0-1)*picture_size+pitch*(editrect.y0-1)*picture_size;
  int xr=(editrect.x1+1-editrect.x0)*picture_size-1;
  int yr=(editrect.y1+1-editrect.y0)*picture_size-1;
  int i;
  if(p+xr+yr*pitch>=((Uint8*)screen->pixels)+screen->h*pitch+screen->w) return;
  memset(p,0xF7,xr);
  memset(p+yr*pitch,0xF7,xr);
  for(i=1;i<yr;i++) {
    p[i*pitch]=p[i*pitch+xr]=0xF7;
    p[i*pitch+1]=p[i*pitch+xr-1]=0xF0;
  }
  memset(p+pitch+1,0xF0,xr-2);
  memset(p+(yr-1)*pitch+1,0xF0,xr-2);
  p[0]=p[xr]=p[yr*pitch]=p[yr*pitch+xr]=0xF8;
}

void draw_text(int x,int y,const unsigned char*t,int bg,int fg) {
  // To be called only when screen is locked!
  int len=strlen(t);
  Uint8*pix=screen->pixels;
  Uint8*p;
  Uint16 pitch=screen->pitch;