Skip to content

Commit 24d8a66

Browse files
committed
small change
1 parent 1f09607 commit 24d8a66

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

simlcd/simlcd.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void simlcd_display(simlcd_buffer_t *buf)
6767
if(buf->wu)
6868
{
6969
if(buf->displayed)SDL_DestroyWindow(buf->window);
70-
SDL_RenderClear(buf->renderer);
7170
buf->displayed=false;
7271
buf->wu=false;
7372
}
@@ -81,6 +80,7 @@ void simlcd_display(simlcd_buffer_t *buf)
8180
// wxp+=(buf->w*buf->scale);
8281
}
8382

83+
SDL_RenderClear(buf->renderer);
8484
for(i=0;i<buf->h;i++)
8585
{
8686
for(j=0;j<buf->w;j++)
@@ -175,8 +175,12 @@ void simlcd_div(simlcd_buffer_t *in,simlcd_buffer_t *out,int scale)
175175
}
176176
out->w=(in->w/scale);
177177

178-
if(out->displayed==true || out->wu==true)free(out->buf);
179-
out->buf=(uint32_t*)calloc(sizeof(uint32_t),out->h*out->w);
178+
if(out->wu==true)free(out->buf);
179+
180+
if(out->displayed==false || out->wu==true)
181+
{
182+
out->buf=(uint32_t*)calloc(sizeof(uint32_t),out->h*out->w);
183+
}
180184

181185
for(y=0;y<(out->h);y++)
182186
for(x=0;x<(out->w);x++)

0 commit comments

Comments
 (0)