cocoa.m (libcaca-0.99.beta19) | : | cocoa.m (libcaca-0.99.beta20.tar.bz2) | ||
---|---|---|---|---|
/* | /* | |||
* libcaca Colour ASCII-Art library | * libcaca Colour ASCII-Art library | |||
* Copyright (c) 2006 Colin Delacroix <colin@zoy.org> | * Copyright © 2021 Sam Hocevar <sam@hocevar.net> | |||
* All Rights Reserved | * 2006 Colin Delacroix <colin@zoy.org> | |||
* All Rights Reserved | ||||
* | * | |||
* This library is free software. It comes without any warranty, to | * This library is free software. It comes without any warranty, to | |||
* the extent permitted by applicable law. You can redistribute it | * the extent permitted by applicable law. You can redistribute it | |||
* and/or modify it under the terms of the Do What the Fuck You Want | * and/or modify it under the terms of the Do What the Fuck You Want | |||
* to Public License, Version 2, as published by Sam Hocevar. See | * to Public License, Version 2, as published by Sam Hocevar. See | |||
* http://www.wtfpl.net/ for more details. | * http://www.wtfpl.net/ for more details. | |||
*/ | */ | |||
/* | /* | |||
* This file contains the libcaca Cocoa input and output driver | * This file contains the libcaca Cocoa input and output driver | |||
skipping to change at line 206 | skipping to change at line 207 | |||
|| _h != caca_get_canvas_height(dp->cv) | || _h != caca_get_canvas_height(dp->cv) | |||
|| !_attrs || !_bkg_rects || !_bkg_colors) | || !_attrs || !_bkg_rects || !_bkg_colors) | |||
{ | { | |||
debug_log(@"%s resize to %ux%u", _cmd, _w, _h); | debug_log(@"%s resize to %ux%u", _cmd, _w, _h); | |||
_w = caca_get_canvas_width(dp->cv); | _w = caca_get_canvas_width(dp->cv); | |||
_h = caca_get_canvas_height(dp->cv); | _h = caca_get_canvas_height(dp->cv); | |||
if(_attrs) | if(_attrs) | |||
free(_attrs); | free(_attrs); | |||
_attrs = malloc(_w * _h * sizeof(uint32_t) * 2); | _attrs = _caca_alloc2d(_w , _h, sizeof(uint32_t) * 2); | |||
if(_bkg_rects) | if(_bkg_rects) | |||
free(_bkg_rects); | free(_bkg_rects); | |||
_bkg_rects = malloc(_w * _h * sizeof(NSRect)); | _bkg_rects = _caca_alloc2d(_w, _h, sizeof(NSRect)); | |||
if(_bkg_colors) | if(_bkg_colors) | |||
free(_bkg_colors); | free(_bkg_colors); | |||
_bkg_colors = malloc(_w * _h * sizeof(NSColor*)); | _bkg_colors = _caca_alloc2d(_w, _h, sizeof(NSColor*)); | |||
// [[self window] setContentSize: NSMakeSize(caca_get_canvas_width(dp->cv ) * _font_rect.size.width, | // [[self window] setContentSize: NSMakeSize(caca_get_canvas_width(dp->cv ) * _font_rect.size.width, | |||
// caca_get_canvas_height(dp->c v) * _font_rect.size.height)]; | // caca_get_canvas_height(dp->c v) * _font_rect.size.height)]; | |||
[[self window] setContentSize: NSMakeSize(caca_get_canvas_width(dp->cv ) * 8, | [[self window] setContentSize: NSMakeSize(caca_get_canvas_width(dp->cv ) * 8, | |||
caca_get_canvas_height(dp->c v) * 13)]; | caca_get_canvas_height(dp->c v) * 13)]; | |||
} | } | |||
} | } | |||
- (void)updateBuffersFromCaca:(caca_display_t *)dp | - (void)updateBuffersFromCaca:(caca_display_t *)dp | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added |