Compare commits
5 Commits
d7dd244442
...
0e7cff0715
Author | SHA1 | Date | |
---|---|---|---|
0e7cff0715 | |||
4d30fd7a2b | |||
292bd1d739 | |||
1a756358f5 | |||
009c0d0519 |
@@ -68,6 +68,7 @@ struct TWebBrowser {
|
||||
void tag_a();
|
||||
void tag_p();
|
||||
void tag_img();
|
||||
void tag_kosicon();
|
||||
void tag_div();
|
||||
void tag_h1234_caption();
|
||||
void tag_ol_ul_dt();
|
||||
@@ -176,7 +177,7 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
||||
}
|
||||
}
|
||||
if (ESBYTE[bufpos] == '&') {
|
||||
bufpos = GetUnicodeSymbol(#linebuf, sizeof(TWebBrowser.linebuf), bufpos+1, bufpointer+bufsize);
|
||||
bufpos = GetUnicodeSymbol(#linebuf, sizeof(TWebBrowser.linebuf)-1, bufpos+1, bufpointer+bufsize);
|
||||
continue;
|
||||
}
|
||||
if (ESBYTE[bufpos] == '<') && (is_html) {
|
||||
|
@@ -67,7 +67,7 @@ bool _tag::parse(dword _bufpos, bufend)
|
||||
|
||||
if (!whitepos) || (whitepos > closepos) {
|
||||
//no param
|
||||
strncpy(#name, bufpos, math.min(closepos - bufpos, sizeof(tag.name)));
|
||||
strncpy(#name, bufpos, math.min(closepos - bufpos, sizeof(tag.name)-1));
|
||||
bufpos = closepos;
|
||||
} else {
|
||||
//we have param
|
||||
@@ -76,7 +76,7 @@ bool _tag::parse(dword _bufpos, bufend)
|
||||
if (openpos < strchr(closepos+1, '>')) break;
|
||||
if (!closepos = EAX) {closepos = bufend;break;}
|
||||
}
|
||||
strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name)));
|
||||
strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name)-1));
|
||||
bufpos = closepos;
|
||||
|
||||
params = malloc(closepos - whitepos + 1);
|
||||
|
@@ -151,7 +151,7 @@ bool TWebBrowser::RenderImage(dword cur_img)
|
||||
int img_x, img_y, img_w, img_h;
|
||||
dword imgbuf[44];
|
||||
|
||||
if (!cur_img) return false;
|
||||
if (!cur_img) || (!buf_data) return false;
|
||||
|
||||
img_h = ESDWORD[cur_img+8];
|
||||
img_w = ESDWORD[cur_img+4];
|
||||
|
@@ -10,6 +10,7 @@ void TWebBrowser::SetStyle()
|
||||
if (tag.is("a")) { tag_a(); return; }
|
||||
if (tag.is("p")) { tag_p(); return; }
|
||||
if (tag.is("img")) { tag_img(); return; }
|
||||
if (tag.is("kosicon")) { tag_kosicon(); return; }
|
||||
if (tag.is("div")) { tag_div(); return; }
|
||||
if (tag.is("br")) { /*draw_x++;*/NewLine(); return; }
|
||||
if (tag.is("nav")) { style.nav = tag.opened; return; }
|
||||
@@ -266,6 +267,17 @@ void TWebBrowser::tag_h1234_caption()
|
||||
}
|
||||
}
|
||||
|
||||
void TWebBrowser::tag_kosicon()
|
||||
{
|
||||
dword imgbuf[44];
|
||||
dword shared_i18 = memopen("ICONS18", NULL, SHM_READ);
|
||||
if (shared_i18) && (tag.get_number_of("n")) {
|
||||
if (draw_x + 18 > canvas.bufw) NewLine();
|
||||
canvas.DrawImage(draw_x, draw_y-2, 18, 18, 18*18*4*tag.number+shared_i18);
|
||||
draw_x += 22;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TWebBrowser::tag_img()
|
||||
{
|
||||
@@ -305,7 +317,7 @@ void TWebBrowser::tag_img()
|
||||
img_decode stdcall (cache.current_buf, cache.current_size, 0);
|
||||
if (EAX) goto IMGOK; else goto NOIMG;
|
||||
} else {
|
||||
img_url.add(#img_path);
|
||||
if (img_url.get_pos_by_name(#img_path)==-1) img_url.add(#img_path);
|
||||
goto NOIMG;
|
||||
}
|
||||
|
||||
@@ -453,9 +465,10 @@ void TWebBrowser::tag_table()
|
||||
}
|
||||
if (table.cols.get(tr_pos-1)-td_pos>1) && (tag.get_number_of("width")) {
|
||||
if (strchr(tag.value, '%')) {
|
||||
tag.number = cur_cell_w - table.margin - 23 - left_gap * tag.number / 100;
|
||||
tag.number = cur_cell_w * tag.number / 100; //
|
||||
}
|
||||
if (tag.number < draw_w) draw_w = tag.number;
|
||||
if (tag.number < list.w - table.margin - left_gap) draw_w = tag.number;
|
||||
|
||||
}
|
||||
draw_y = row_start_y;
|
||||
td_pos++;
|
||||
|
@@ -66,6 +66,7 @@ char *unicode_symbols[]={
|
||||
"lowast","*",
|
||||
|
||||
"#128154","<3",
|
||||
"#128545",":(",
|
||||
|
||||
0};
|
||||
|
||||
|
@@ -79,7 +79,7 @@ char default_dir[] = "/sys";
|
||||
od_filter filter2 = { 22, "TXT\0HTM\0HTML\0DOCX\0\0" };
|
||||
|
||||
char editURL[URL_SIZE+1];
|
||||
edit_box omnibox_edit = {, 0, 0, 0xffffff,
|
||||
edit_box omnibox_edit = {250, 0, 0, 0xffffff,
|
||||
0x94AECE, 0xffffff, 0xffffff,0x10000000,URL_SIZE-2,#editURL,0,,19,19};
|
||||
|
||||
//===================================================//
|
||||
@@ -199,7 +199,7 @@ void main()
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
ProcessMenuClick();
|
||||
sc.get();
|
||||
if (Form.status_window>2) break;
|
||||
if (Form.status_window & ROLLED_UP) break;
|
||||
if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; }
|
||||
if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; }
|
||||
draw_window();
|
||||
@@ -258,6 +258,7 @@ void main()
|
||||
free(http.content_pointer);
|
||||
GetImg(false);
|
||||
}
|
||||
debugln("end evNetwork");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -516,7 +517,6 @@ bool GetLocalFileData(dword _path)
|
||||
bool GetUrl(dword _http_url)
|
||||
{
|
||||
char new_url_full[URL_SIZE+1];
|
||||
|
||||
if (!strncmp(_http_url,"http:",5)) {
|
||||
http.get(_http_url);
|
||||
return true;
|
||||
@@ -571,10 +571,10 @@ void OpenPage(dword _open_URL)
|
||||
//INTERNAL PAGE
|
||||
history.add(#new_url);
|
||||
WB1.custom_encoding = -1;
|
||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home));
|
||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test));
|
||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home)-1);
|
||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test)-1);
|
||||
else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
|
||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
|
||||
} else if (!strncmp(#new_url,"http:",5)) || (!strncmp(#new_url,"https:",6)) {
|
||||
//WEB PAGE
|
||||
@@ -589,7 +589,7 @@ void OpenPage(dword _open_URL)
|
||||
|
||||
if (!http.transfer) {
|
||||
history.add(#new_url);
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
}
|
||||
} else {
|
||||
//LOCAL PAGE
|
||||
@@ -602,7 +602,7 @@ void OpenPage(dword _open_URL)
|
||||
strcpy(#new_url, "/tmp0/1/temp/word/document.xml");
|
||||
}
|
||||
if (!GetLocalFileData(#new_url)) {
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -712,7 +712,7 @@ void EventSubmitOmnibox()
|
||||
|
||||
void LoadInternalPage(dword _bufdata, _in_bufsize){
|
||||
if (!_bufdata) || (!_in_bufsize) {
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error)-1);
|
||||
} else {
|
||||
WB1.list.first = 0; //scroll page to the top
|
||||
DrawOmnibox();
|
||||
@@ -870,7 +870,7 @@ void DrawStatusBar(dword _msg)
|
||||
{
|
||||
dword status_y = Form.cheight - STATUSBAR_H + 4;
|
||||
dword status_w = Form.cwidth - 90;
|
||||
if (Form.status_window>2) return;
|
||||
if (Form.status_window & ROLLED_UP) return;
|
||||
DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work);
|
||||
if (_msg) {
|
||||
ESI = math.min(status_w/6, strlen(_msg));
|
||||
@@ -920,7 +920,7 @@ dword GetAbsoluteActiveURL()
|
||||
void CheckContentType()
|
||||
{
|
||||
char content_type[64];
|
||||
if (http.header_field("content-type", #content_type, sizeof(content_type))) // application || image
|
||||
if (http.header_field("content-type", #content_type, sizeof(content_type)-1)) // application || image
|
||||
|
||||
if (content_type[0] == 'i') {
|
||||
EventDownloadAndOpenImage(http.cur_url);
|
||||
@@ -968,12 +968,14 @@ dword GetImg(bool _new)
|
||||
for (i = 0; i < WB1.img_url.count; i++)
|
||||
{
|
||||
cur_img_url = WB1.img_url.get(i);
|
||||
if (debug_mode)
|
||||
{debug("get img: ");debugln(cur_img_url);}
|
||||
if (cache.has(cur_img_url)==false) {
|
||||
prbar.max = WB1.img_url.count;
|
||||
prbar.value = i;
|
||||
if (GetUrl(cur_img_url)) {DrawStatusBar(cur_img_url); DrawProgress(); return;}
|
||||
if (GetUrl(cur_img_url)) {
|
||||
DrawStatusBar(cur_img_url);
|
||||
DrawProgress();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_new) return;
|
||||
|
@@ -112,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
||||
|
||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||
|
||||
char version[]="WebView 3.82";
|
||||
char version[]="WebView 3.85";
|
@@ -2,38 +2,38 @@
|
||||
<title>TEST</title>
|
||||
<style>a {display:block;font-size:130%;margin:5px 40px 5px 0;}</style>
|
||||
<body>
|
||||
<pre><a href=//wiby.org>wiby.org</a>
|
||||
<a href=//www.xlr8yourmac.com/OSX/os_x_network_cards.html>OSX network cards</a>
|
||||
<a href=//macintoshgarden.org/>Macintosh Garden</a>
|
||||
|
||||
<table><tr><td>Simplest:
|
||||
<a href=//nostalgy.net.ru/>nostalgy.net.ru</a>
|
||||
<pre><h2>HTTP</h2>
|
||||
<a href=//th99.infania.net>Total Hardware 1999</a>
|
||||
<a href=//wiby.org>wiby.org</a>
|
||||
<a href=//menuetos.net>menuetos.net</a>
|
||||
<a href=//macintosh.garden/>Macintosh Garden</a>
|
||||
<a href=//pci-ids.ucw.cz>pci.ids</a>
|
||||
<a href=//toastytech.com/guis/index.html>GUI Gallery</a>
|
||||
<a href=//www.weitek.com/textual/support/driver.html>weitek</a>
|
||||
<a href=//www.abandonwarering.com/?Page=Listing>abandonware</a>
|
||||
<a href=//neonfloppy.sytes.net/articles/win3-usb/>neonfloppy</a>
|
||||
<a href=//www.win31.de/eindex.htm>win31.de</a>
|
||||
|
||||
<h3>VPN-only</h3>
|
||||
<a href=//dgmag.in>dgmag.in</a>
|
||||
<a href=//web.archive.org/web/https://bash.im>bash.im</a>
|
||||
<a href=//web.archive.org/web/https://opennet.ru>opennet</a>
|
||||
<a href=//linux.org.ru>LOR</a>
|
||||
<a href=//web.archive.org/web/https://samlib.ru/b>samlib.ru/b</a>
|
||||
<a href=//web.archive.org/web/https://mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
||||
<a href=//web.archive.org/web/http://gona.mactar.hu/ATI_Mac/>ATI drivers for Mac</a>
|
||||
<td>Simple:
|
||||
<a href=//web.archive.org/web/http://lionovsky.us>lionovsky.us</a>
|
||||
<a href=//fdd5-25.pdp-11.ru>fdd5-25</a>
|
||||
<a href=//old-dos.ru>old-dos.ru</a>
|
||||
<a href=//artcon.ru>artcon.ru</a>
|
||||
<a href=//nubo.ru>nubo.ru</a>
|
||||
<a href=//mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
||||
<a href=//nostalgy.net.ru/>nostalgy.net.ru</a>
|
||||
|
||||
<h2>HTTPS :(</h2>
|
||||
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
|
||||
<a href=//mestack.narod.ru/index.html>mestack.narod.ru</a>
|
||||
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
||||
<a href=//vetusware.com>vetusware.com</a>
|
||||
<a href=//th99.infania.net>Total Hardware 1999</a>
|
||||
<a href=//toastytech.com/guis/index.html>GUI Gallery</a>
|
||||
<a href=//menuetos.net>menuetos.net</a>
|
||||
<tr><td>
|
||||
Moderate:
|
||||
<a href=//fdd5-25.pdp-11.ru>fdd5-25</a>
|
||||
<a href=//lionovsky.us>lionovsky.us</a>
|
||||
<a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
|
||||
<a href=//old-dos.ru>old-dos.ru</a>
|
||||
<a href=//www.weitek.com/textual/support/driver.html>weitek</a>
|
||||
<a href=//www.abandonwarering.com/?Page=Listing>abandonware</a>
|
||||
<td>Complex:
|
||||
<a href=//web.archive.org/web/https://artcon.ru>artcon.ru</a>
|
||||
<a href=//nubo.ru>nubo.ru</a>
|
||||
<a href=//xn--80abh7bk0c.xn--p1ai>bashorg</a>
|
||||
<a href=//opennet.ru>opennet</a>
|
||||
<a href=//linux.org.ru>LOR</a>
|
||||
<a href=//www.xlr8yourmac.com/OSX/os_x_network_cards.html>OSX network cards</a>
|
||||
<a href=//samlib.ru/b>samlib.ru/b</a>
|
||||
<a href=//vetusware.com>vetusware.com</a>
|
||||
<a href=//electromyne.de>electromyne.de</a>
|
||||
<a href=//web.archive.org/web/20190403215447//www.thg.ru/>thg</a>
|
@@ -11,9 +11,9 @@ TODO:
|
||||
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
||||
*/
|
||||
|
||||
#define ABOUT_TITLE "EOLITE 5.28"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.28"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.28";
|
||||
#define ABOUT_TITLE "EOLITE 5.29"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.29"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.29";
|
||||
|
||||
#define MEMSIZE 1024 * 250
|
||||
#include "../lib/clipboard.h"
|
||||
@@ -195,6 +195,8 @@ void main()
|
||||
|
||||
handle_param();
|
||||
|
||||
kfont.init(DEFAULT_FONT);
|
||||
|
||||
SystemDiscs.Get();
|
||||
OpenDir(ONLY_OPEN);
|
||||
llist_copy(#files_inactive, #files);
|
||||
|
@@ -175,8 +175,10 @@ void properties_dialog()
|
||||
break;
|
||||
|
||||
case evMouse:
|
||||
edit_box_mouse stdcall (#file_name_ed);
|
||||
edit_box_mouse stdcall (#path_to_file_ed);
|
||||
if (!apply_question_active) {
|
||||
edit_box_mouse stdcall (#file_name_ed);
|
||||
edit_box_mouse stdcall (#path_to_file_ed);
|
||||
}
|
||||
break;
|
||||
|
||||
case evKey:
|
||||
|
@@ -7,7 +7,7 @@ edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x100000
|
||||
#path_start,0, 100000000000010b,0,0};
|
||||
|
||||
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
|
||||
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
|
||||
more_less_box line_height = { NULL, 18, 64, LIST_LINE_HEIGHT };
|
||||
checkbox show_dev_name = { SHOW_DEVICE_CLASS };
|
||||
checkbox big_icons = { BIG_ICONS };
|
||||
checkbox colored_lines = { COLORED_LINES };
|
||||
@@ -134,7 +134,6 @@ void LoadIniSettings()
|
||||
Form.height = ini.GetInt("WinH", efm*100+517);
|
||||
ini.GetString("DefaultPath", #path_start, 4096, "/sys");
|
||||
path_start_ed.size = path_start_ed.pos = strlen(#path_start);
|
||||
kfont.init(DEFAULT_FONT);
|
||||
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
|
||||
if(streq(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
|
||||
}
|
||||
|
@@ -26,15 +26,9 @@ struct collection_int
|
||||
|
||||
:void collection_int::add(dword _in) {
|
||||
unsigned i;
|
||||
if (!buf) {
|
||||
//if (buf_size) notify("'buf_size on empty buf' -A");
|
||||
buf_size = 4096 * 5;
|
||||
buf = malloc(4096 * 5);
|
||||
//if (!buf) notify("'malloc error' -E");
|
||||
} else if (count + 1 * DWSIZE4 >= buf_size) {
|
||||
if (!buf) || (count + 1 * DWSIZE4 >= buf_size) {
|
||||
buf_size += 4096 * 5;
|
||||
buf = realloc(buf, buf_size);
|
||||
//if (!buf) notify("'realloc error' -E");
|
||||
}
|
||||
i = count * DWSIZE4 + buf;
|
||||
ESDWORD[i] = _in;
|
||||
@@ -77,8 +71,8 @@ struct collection_int
|
||||
|
||||
:void collection_int::drop() {
|
||||
count = 0;
|
||||
if (buf) buf = free(buf);
|
||||
buf_size = 0;
|
||||
//if (buf) buf = free(buf);
|
||||
//buf_size = 0;
|
||||
}
|
||||
|
||||
/*========================================================
|
||||
@@ -97,31 +91,30 @@ struct collection
|
||||
dword get(); //get_name_by_pos
|
||||
dword get_pos_by_name();
|
||||
void drop();
|
||||
void increase_data_size();
|
||||
dword get_last();
|
||||
bool pop();
|
||||
};
|
||||
|
||||
:void collection::increase_data_size() {
|
||||
if (realloc_size<4096) realloc_size = 4096;
|
||||
if (!data_size) {
|
||||
data_size = realloc_size;
|
||||
data_start = malloc(data_size);
|
||||
} else {
|
||||
data_size = data_size + realloc_size;
|
||||
data_start = realloc(data_start, data_size);
|
||||
}
|
||||
}
|
||||
|
||||
:dword collection::add(dword in) {
|
||||
dword len = strlen(in);
|
||||
while (offset.get(count) + len + 4 > data_size) {
|
||||
increase_data_size();
|
||||
unsigned cur_buf_size;
|
||||
|
||||
if (!count) {
|
||||
cur_buf_size = 0;
|
||||
} else {
|
||||
cur_buf_size = offset.get(count);
|
||||
}
|
||||
strncpy(data_start+offset.get(count), in, len);
|
||||
|
||||
if (realloc_size<4096) realloc_size = 4096;
|
||||
while (cur_buf_size + len + 4 > data_size) {
|
||||
data_size += realloc_size;
|
||||
data_start = realloc(data_start, data_size);
|
||||
}
|
||||
|
||||
strncpy(data_start+cur_buf_size, in, len);
|
||||
count++;
|
||||
offset.set(count, offset.get(count-1) + len + 1);
|
||||
return data_start+offset.get(count-1);
|
||||
offset.set(count, cur_buf_size + len + 1);
|
||||
return data_start + cur_buf_size;
|
||||
}
|
||||
|
||||
:dword collection::get(dword pos) {
|
||||
|
@@ -17,17 +17,25 @@ struct CANVAS {
|
||||
void Show();
|
||||
void Fill();
|
||||
void DrawBar();
|
||||
void DrawImage();
|
||||
void WriteText();
|
||||
void PutPixel();
|
||||
void AlignCenter();
|
||||
void AlignRight();
|
||||
void IncreaseBufSize();
|
||||
bool BufIsInvalid();
|
||||
};
|
||||
|
||||
char draw_buf_not_enaught_ram[] =
|
||||
"'CANVAS requested %i MB more memory than the system has.
|
||||
Application could be unstable.' -E";
|
||||
|
||||
bool CANVAS::BufIsInvalid()
|
||||
{
|
||||
if (!buf_data) || (!bufw) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CANVAS::Init(dword i_bufx, i_bufy, i_bufw, i_bufh)
|
||||
{
|
||||
bufx = i_bufx;
|
||||
@@ -45,6 +53,7 @@ bool CANVAS::Init(dword i_bufx, i_bufy, i_bufw, i_bufh)
|
||||
void CANVAS::Fill(dword start_pointer, i_fill_color)
|
||||
{
|
||||
dword max_i = bufw * bufh * 4 - start_pointer/4;
|
||||
if (BufIsInvalid()) return;
|
||||
fill_color = i_fill_color | 0xFF000000; //set background color non-transparent
|
||||
@MEMSETD(buf_data+start_pointer+8, max_i, fill_color);
|
||||
}
|
||||
@@ -52,6 +61,7 @@ void CANVAS::Fill(dword start_pointer, i_fill_color)
|
||||
void CANVAS::DrawBar(dword x, y, w, h, color)
|
||||
{
|
||||
dword i, j;
|
||||
if (BufIsInvalid()) return;
|
||||
if (y + h >= bufh) IncreaseBufSize();
|
||||
for (j=0; j<h; j++) {
|
||||
for (i = y+j*bufw+x<<2+8+buf_data; i<y+j*bufw+x+w<<2+8+buf_data; i+=4) {
|
||||
@@ -60,12 +70,30 @@ void CANVAS::DrawBar(dword x, y, w, h, color)
|
||||
}
|
||||
}
|
||||
|
||||
void CANVAS::DrawImage(dword x, y, w, h, img)
|
||||
{
|
||||
dword i, j, p=0;
|
||||
dword ystart;
|
||||
if (BufIsInvalid()) return;
|
||||
if (y < 0) y = 0;
|
||||
if (x < 0) x = 0;
|
||||
while (y + h >= bufh) IncreaseBufSize(); //WHY NOT WORKING?
|
||||
for (j=0; j<h; j++) {
|
||||
ystart = y + j * bufw + x;
|
||||
for (i = ystart<<2+8+buf_data; i<ystart+w<<2+8+buf_data; i+=4) {
|
||||
ESDWORD[i] = ESDWORD[img+p];
|
||||
p+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CANVAS::WriteText(dword x, y, byte fontType, dword color, str_offset, strlen)
|
||||
{
|
||||
#define BUGFIX_32000 32000
|
||||
dword ydiv=0;
|
||||
dword reserve_data_1, reserve_data_2;
|
||||
dword new_buf_offset;
|
||||
if (BufIsInvalid()) return;
|
||||
if (y + 30 >= bufh) IncreaseBufSize();
|
||||
if (y < BUGFIX_32000) {
|
||||
ESI = strlen;
|
||||
@@ -92,6 +120,7 @@ void CANVAS::WriteText(dword x, y, byte fontType, dword color, str_offset, strle
|
||||
void CANVAS::PutPixel(dword x, y, color)
|
||||
{
|
||||
dword pos = y*bufw+x*4+8+buf_data;
|
||||
if (BufIsInvalid()) return;
|
||||
ESDWORD[pos] = color;
|
||||
}
|
||||
|
||||
@@ -99,6 +128,7 @@ void CANVAS::AlignRight(dword x,y,w,h, content_width)
|
||||
{
|
||||
dword i, j, l;
|
||||
dword content_left = w - content_width / 2;
|
||||
if (BufIsInvalid()) return;
|
||||
for (j=0; j<h; j++)
|
||||
{
|
||||
for (i=j*w+w-x*4, l=j*w+content_width+x*4; (i>=j*w+content_left*4) && (l>=j*w*4); i-=4, l-=4)
|
||||
@@ -112,6 +142,7 @@ void CANVAS::AlignCenter(dword x,y,w,h, content_width)
|
||||
{
|
||||
dword i, j, l;
|
||||
dword content_left = w - content_width / 2;
|
||||
if (BufIsInvalid()) return;
|
||||
for (j=0; j<h; j++)
|
||||
{
|
||||
for (i=j*w+content_width+content_left*4, l=j*w+content_width+x*4; (i>=j*w+content_left*4) && (l>=j*w*4); i-=4, l-=4)
|
||||
@@ -123,6 +154,7 @@ void CANVAS::AlignCenter(dword x,y,w,h, content_width)
|
||||
|
||||
void CANVAS::Show(dword _y_offset, _h)
|
||||
{
|
||||
if (BufIsInvalid()) return;
|
||||
PutPaletteImage(_y_offset * bufw * 4 + buf_data+8, bufw, _h, bufx, bufy, 32, 0);
|
||||
}
|
||||
|
||||
@@ -133,6 +165,8 @@ void CANVAS::IncreaseBufSize()
|
||||
dword free_ram_size;
|
||||
char error_str[256];
|
||||
|
||||
if (!bufw) return;
|
||||
|
||||
if (!buf_data) {
|
||||
alloc_size = bufh * bufw * 4 + 8;
|
||||
buf_data = malloc(alloc_size);
|
||||
|
Reference in New Issue
Block a user