Subversion Repositories Kolibri OS

Rev

Rev 8396 | Rev 8439 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8396 Rev 8425
Line 126... Line 126...
126
	PutPaletteImage(_y_offset * bufw * 4 + buf_data+8, bufw, _h, bufx, bufy, 32, 0);
126
	PutPaletteImage(_y_offset * bufw * 4 + buf_data+8, bufw, _h, bufx, bufy, 32, 0);
127
}
127
}
Line 128... Line 128...
128
 
128
 
129
void DrawBufer::IncreaseBufSize()
129
void DrawBufer::IncreaseBufSize()
130
{
-
 
131
	static dword alloc_counter;
130
{
132
	static dword bufh_initial;
131
	static dword bufh_initial;
133
	dword alloc_size;
132
	dword alloc_size;
134
	dword free_ram_size;
133
	dword free_ram_size;
Line 135... Line 134...
135
	char error_str[256];
134
	char error_str[256];
136
 
-
 
137
	if (!buf_data) {
-
 
138
		alloc_counter = 1;
135
 
139
		bufh_initial = bufh;
136
	if (!buf_data) {
140
		alloc_size = bufw * bufh * 4 + 8;
-
 
141
		buf_data = malloc(alloc_size);
137
		alloc_size = bufh * bufw * 4 + 8;
142
	}
138
		buf_data = malloc(alloc_size);
143
	else {
139
	} else {
144
		alloc_counter++;
140
		if (bufh_initial != bufh) bufh_initial = bufh;
145
		bufh = bufh_initial * alloc_counter;
141
		bufh += 4096*1600/bufw; //+50 Mb
146
		alloc_size = bufw * bufh * 4 + 8;
142
		alloc_size = bufh * bufw * 4 + 8;
147
		buf_data = realloc(buf_data, alloc_size);
143
		buf_data = realloc(buf_data, alloc_size);
148
		Fill(alloc_counter - 1 * bufw * bufh_initial * 4 + 8, fill_color);
-
 
-
 
144
		Fill(bufh_initial * bufw * 4 + 8, fill_color);
149
	}
145
	}
150
 
146
	bufh_initial = bufh;
151
	free_ram_size = GetFreeRAM() * 1024;
147
	free_ram_size = GetFreeRAM() * 1024;
152
	if (alloc_size > free_ram_size) {
148
	if (alloc_size > free_ram_size) {
153
		sprintf(#error_str, #draw_buf_not_enaught_ram, alloc_size - free_ram_size/1048576);
149
		sprintf(#error_str, #draw_buf_not_enaught_ram, alloc_size - free_ram_size/1048576);
154
		notify(#error_str);
150
		notify(#error_str);
Line 155... Line -...
155
	}
-
 
156
}
151
	}
157
 
152
}