Skip to content

Commit

Permalink
Fix situation where no back buffer exists when using CNFGRASTERIZER
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlohr committed Jun 11, 2024
1 parent a53ea30 commit 2dd1b18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions CNFGFunctions.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ OTHER DEALINGS IN THE SOFTWARE.
#include "TextTool/FontData.h"
#endif

//TODO: Refactor to remove malloc reliance.
#ifndef __clang__
#endif

int CNFGPenX, CNFGPenY;
uint32_t CNFGBGColor;
uint32_t CNFGLastColor;
Expand Down
2 changes: 1 addition & 1 deletion CNFGXDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ void CNFGUpdateScreenWithBitmap( uint32_t * data, int w, int h )
{
static int lw, lh;

if( lw != w || lh != h )
if( lw != w || lh != h || !xi )
{
if( xi ) free( xi );
xi = XCreateImage(CNFGDisplay, CNFGVisual, CNFGDepth, ZPixmap, 0, (char*)data, w, h, 32, w*4 );
Expand Down
4 changes: 2 additions & 2 deletions rawdraw_sf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//This file was automatically generated by Makefile at https://github.com/cntools/rawdraw
//Generated from files git hash ce81fa80a8ae034546fa93b392b282fe9815319c on Sat May 11 07:49:24 PM PDT 2024 (This is not the git hash of this file)
//Generated from files git hash a53ea30df86f5876197873975efee3dbc983a942 on Mon Jun 10 06:52:08 PM PDT 2024 (This is not the git hash of this file)
// Copyright 2010-2021 <>< CNLohr, et. al. (Several other authors, many but not all mentioned)
// Licensed under the MIT/x11 or NewBSD License you choose.
//
Expand Down Expand Up @@ -6078,7 +6078,7 @@ void CNFGUpdateScreenWithBitmap( uint32_t * data, int w, int h )
{
static int lw, lh;

if( lw != w || lh != h )
if( lw != w || lh != h || !xi )
{
if( xi ) free( xi );
xi = XCreateImage(CNFGDisplay, CNFGVisual, CNFGDepth, ZPixmap, 0, (char*)data, w, h, 32, w*4 );
Expand Down

0 comments on commit 2dd1b18

Please sign in to comment.