X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fnogl%2FnoGLALSW.inc;h=d18ff9923e81023e8acfaf1eb9277b2a86e08349;hb=9cdcaa197fc2ad55a382ba5c96273a94538922dc;hp=3f32dce7da3017af254de531b5300619863b22ad;hpb=df3ebf2eb1c829a29c4cb189244cd18703ececde;p=d2df-sdl.git diff --git a/src/nogl/noGLALSW.inc b/src/nogl/noGLALSW.inc index 3f32dce..d18ff99 100644 --- a/src/nogl/noGLALSW.inc +++ b/src/nogl/noGLALSW.inc @@ -48,12 +48,7 @@ implementation matrixMode: GLenum; blendMode: Integer; - globalTransTable: COLOR_MAP_T; - redTransTable: COLOR_MAP_T; - greenTransTable: COLOR_MAP_T; - blueTransTable: COLOR_MAP_T; - darkTransTable: COLOR_MAP_T; - lightTransTable: COLOR_MAP_T; + vram_usage, xram_usage: Integer; function AddTexture: Integer; var i: Integer; @@ -200,8 +195,15 @@ implementation BLEND_DEFAULT: begin (* FIX texture colorize *) - set_saturation_blender(0, 0, 0, 0); - drawing_mode(DRAW_MODE_TRANS, nil, 0, 0) + if sdl2allegro_bpp <= 8 then + begin + drawing_mode(DRAW_MODE_SOLID, nil, 0, 0) + end + else + begin + set_color_blender(0, 0, 0, 0); + drawing_mode(DRAW_MODE_TRANS, nil, 0, 0) + end end else ASSERT(FALSE) @@ -651,12 +653,14 @@ implementation tex[ctex].bmp := create_bitmap(width, height); assert(tex[ctex].bmp <> nil); + vram_usage += width * height; if pixels = nil then exit; p := pixels; if format = GL_RGBA then begin - if DEFAULT_DEPTH <= 8 then + xram_usage += width * height * 4; + if sdl2allegro_bpp <= 8 then trans := 0 else trans := makeacol(255, 0, 255, 0); @@ -674,6 +678,7 @@ implementation end else begin + xram_usage += width * height * 3; for j := 0 to height - 1 do for i := 0 to width - 1 do begin @@ -703,7 +708,8 @@ implementation p := pixels; if format = GL_RGBA then begin - if DEFAULT_DEPTH <= 8 then + xram_usage += width * height * 4; + if sdl2allegro_bpp <= 8 then trans := 0 else trans := makeacol(255, 0, 255, 0); @@ -721,6 +727,7 @@ implementation end else begin + xram_usage += width * height * 4; for j := 0 to height - 1 do for i := 0 to width - 1 do begin @@ -740,17 +747,11 @@ implementation procedure nogl_Init; begin cmds.mode := GL_INVALID_ENUM; - create_trans_table(@globalTransTable, default_palette, 255, 255, 255, nil); - create_trans_table(@redTransTable, default_palette, 0, 255, 255, nil); - create_trans_table(@greenTransTable, default_palette, 255, 0, 255, nil); - create_trans_table(@blueTransTable, default_palette, 255, 255, 0, nil); - create_trans_table(@darkTransTable, default_palette, 191, 191, 191, nil); - create_trans_table(@lightTransTable, default_palette, 64, 64, 64, nil); - color_map := @globalTransTable; end; procedure nogl_Quit; begin + e_LogWritefln('vram=%s xram=%s', [vram_usage, xram_usage]); end; initialization