ui.render: set pack alignment to 1, so padding images isn't needed anymore
							parent
							
								
									7fe04fa8ee
								
							
						
					
					
						commit
						14f8742aae
					
				| 
						 | 
					@ -290,14 +290,6 @@ ERROR: invalid-color-type/bit-depth loading-png ;
 | 
				
			||||||
: validate-truecolor-alpha ( loading-png -- loading-png )
 | 
					: validate-truecolor-alpha ( loading-png -- loading-png )
 | 
				
			||||||
    { 8 16 } validate-bit-depth ;
 | 
					    { 8 16 } validate-bit-depth ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: pad-bitmap ( image -- image )
 | 
					 | 
				
			||||||
    dup dim>> second 4 divisor? [
 | 
					 | 
				
			||||||
        dup [ bytes-per-pixel ]
 | 
					 | 
				
			||||||
        [ dim>> first * ]
 | 
					 | 
				
			||||||
        [ dim>> first 4 mod ] tri
 | 
					 | 
				
			||||||
        '[ _ group [ _ 0 <array> append ] map B{ } concat-as ] change-bitmap
 | 
					 | 
				
			||||||
    ] unless ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
: loading-png>bitmap ( loading-png -- bytes component-order )
 | 
					: loading-png>bitmap ( loading-png -- bytes component-order )
 | 
				
			||||||
    dup color-type>> {
 | 
					    dup color-type>> {
 | 
				
			||||||
        { greyscale [
 | 
					        { greyscale [
 | 
				
			||||||
| 
						 | 
					@ -323,7 +315,7 @@ ERROR: invalid-color-type/bit-depth loading-png ;
 | 
				
			||||||
        [ loading-png>bitmap [ >>bitmap ] [ >>component-order ] bi* ]
 | 
					        [ loading-png>bitmap [ >>bitmap ] [ >>component-order ] bi* ]
 | 
				
			||||||
        [ [ width>> ] [ height>> ] bi 2array >>dim ]
 | 
					        [ [ width>> ] [ height>> ] bi 2array >>dim ]
 | 
				
			||||||
        [ png-component >>component-type ]
 | 
					        [ png-component >>component-type ]
 | 
				
			||||||
    } cleave pad-bitmap ;
 | 
					    } cleave ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: load-png ( stream -- loading-png )
 | 
					: load-png ( stream -- loading-png )
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,8 @@ SLOT: background-color
 | 
				
			||||||
    GL_BLEND glEnable
 | 
					    GL_BLEND glEnable
 | 
				
			||||||
    GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc
 | 
					    GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc
 | 
				
			||||||
    GL_VERTEX_ARRAY glEnableClientState
 | 
					    GL_VERTEX_ARRAY glEnableClientState
 | 
				
			||||||
 | 
					    GL_PACK_ALIGNMENT 1 glPixelStorei
 | 
				
			||||||
 | 
					    GL_UNPACK_ALIGNMENT 1 glPixelStorei
 | 
				
			||||||
    init-matrices
 | 
					    init-matrices
 | 
				
			||||||
    [ init-clip ]
 | 
					    [ init-clip ]
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue