• R/O
  • SSH
  • HTTPS

chnosproject: コミット


コミットメタ情報

リビジョン317 (tree)
日時2012-03-16 23:58:24
作者hikarupsp

ログメッセージ

シートの重なりバグは修正完了。
透明色も一応実装完了。
ただし、速度が著しく遅いので、どうにかしなければ…。

変更サマリ

差分

--- beta/tolset_chn_000/chnos_010/chnos/sht08.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/sht08.c (revision 317)
@@ -32,6 +32,8 @@
3232
3333 sheet->vramsize = xsize * ysize * 1;
3434 sheet->Config_Functions = &Sheet08_Config_Functions;
35+ sheet->IsVisiblePixel = &Sheet_Internal_IsVisiblePixel_Invalid;
36+ sheet->flags.bit.using_invcol = False;
3537
3638 sheet->flags.bit.buffer_configured = True;
3739
@@ -224,3 +226,11 @@
224226 return 0;
225227 }
226228
229+bool Sheet08_Internal_IsVisiblePixel(UI_Sheet *sheet, int px, int py)
230+{
231+ if(((uchar *)(sheet->vram))[(py - sheet->location.y) * (int)sheet->size.x + (px - sheet->location.x)] == sheet->invcol){
232+ return False;
233+ }
234+
235+ return True;
236+}
--- beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 317)
@@ -36,7 +36,7 @@
3636 return 1;
3737 }
3838
39-//親への子登録を削除する
39+//親の子登録を削除する
4040 if(sheet->parent != Null){
4141 search = &sheet->parent->child;
4242 for(i = 0; i < SHEET_MAX_CHILDREN; i++){
@@ -55,7 +55,7 @@
5555 }
5656 }
5757
58-//子への親登録を削除する
58+//子の親登録を削除する
5959 if(sheet->child != Null){
6060 search = &sheet->child;
6161 for(i = 0; i < SHEET_MAX_CHILDREN; i++){
@@ -261,7 +261,7 @@
261261 sheet->location.y = py;
262262 }
263263 sheet->flags.bit.visible = True;
264- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + sheet->size.x - 1, sheet->location.y + sheet->size.y - 1, False);
264+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + sheet->size.x - 1, sheet->location.y + sheet->size.y - 1);
265265
266266 Sheet_RefreshSheet_All(sheet);
267267
@@ -274,6 +274,13 @@
274274
275275 uint Sheet_RefreshSheet_All(UI_Sheet *sheet)
276276 {
277+ if(sheet == Null){
278+ #ifdef CHNOSPROJECT_DEBUG_SHEET
279+ debug("Sheet_RefreshSheet_All:Null sheet.\n");
280+ #endif
281+ return 1;
282+ }
283+
277284 return Sheet_RefreshSheet(sheet, 0, 0, sheet->size.x - 1, sheet->size.y - 1);
278285 }
279286
@@ -356,11 +363,17 @@
356363 uint i;
357364 UI_Sheet *search;
358365
366+ if(parent == Null){
367+ #ifdef CHNOSPROJECT_DEBUG_SHEET
368+ debug("Sheet_RefreshAllInRange:Null parent.\n");
369+ #endif
370+ return 1;
371+ }
359372 if(!parent->flags.bit.buffer_configured){
360373 #ifdef CHNOSPROJECT_DEBUG_SHEET
361374 debug("Sheet_RefreshAllInRange:Not buffer_configured sheet.\n");
362375 #endif
363- return 1;
376+ return 2;
364377 }
365378
366379 search = parent->child;
@@ -379,14 +392,101 @@
379392
380393 uint Sheet_RefreshSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1)
381394 {
395+ if(sheet == Null){
396+ #ifdef CHNOSPROJECT_DEBUG_SHEET
397+ debug("Sheet_RefreshSheet:Null sheet.\n");
398+ #endif
399+ return 1;
400+ }
382401 if(!sheet->flags.bit.buffer_configured){
383402 #ifdef CHNOSPROJECT_DEBUG_SHEET
384403 debug("Sheet_RefreshSheet:Not buffer_configured sheet.\n");
385404 #endif
386- return 1;
405+ return 2;
387406 }
388407
389408 return Sheet_Internal_RefreshSheet(sheet, px0 + sheet->location.x, py0 + sheet->location.y, px1 + sheet->location.x, py1 + sheet->location.y);
390409 }
391410
411+uint Sheet_RefreshMap(UI_Sheet *sheet, int px0, int py0, int px1, int py1)
412+{
413+ if(sheet == Null){
414+ #ifdef CHNOSPROJECT_DEBUG_SHEET
415+ debug("Sheet_RefreshMap:Null sheet.\n");
416+ #endif
417+ return 1;
418+ }
419+ if(!sheet->flags.bit.buffer_configured){
420+ #ifdef CHNOSPROJECT_DEBUG_SHEET
421+ debug("Sheet_RefreshMap:Not buffer_configured sheet.\n");
422+ #endif
423+ return 2;
424+ }
392425
426+ return Sheet_Internal_MapRefresh(sheet, px0 + sheet->location.x, py0 + sheet->location.y, px1 + sheet->location.x, py1 + sheet->location.y);
427+}
428+
429+uint Sheet_RefreshMap_All(UI_Sheet *sheet)
430+{
431+ if(sheet == Null){
432+ #ifdef CHNOSPROJECT_DEBUG_SHEET
433+ debug("Sheet_RefreshMap_All:Null sheet.\n");
434+ #endif
435+ return 1;
436+ }
437+
438+ return Sheet_RefreshMap(sheet, 0, 0, sheet->size.x - 1, sheet->size.y - 1);
439+}
440+
441+uint Sheet_Enable_InvisibleColor(UI_Sheet *sheet, uint invcol)
442+{
443+ if(sheet == Null){
444+ #ifdef CHNOSPROJECT_DEBUG_SHEET
445+ debug("Sheet_Enable_InvisibleColor:Null sheet.\n");
446+ #endif
447+ return 1;
448+ }
449+ if(!sheet->flags.bit.buffer_configured){
450+ #ifdef CHNOSPROJECT_DEBUG_SHEET
451+ debug("Sheet_Enable_InvisibleColor:Not buffer_configured sheet.\n");
452+ #endif
453+ return 2;
454+ }
455+
456+ if(sheet->bpp == 8){
457+ sheet->invcol = RGB_32_To_08(invcol);
458+ sheet->IsVisiblePixel = &Sheet08_Internal_IsVisiblePixel;
459+ } else if(sheet->bpp == 16){
460+ sheet->invcol = RGB_32_To_16(invcol);
461+ sheet->IsVisiblePixel = &Sheet16_Internal_IsVisiblePixel;
462+ } else if(sheet->bpp == 32){
463+ sheet->invcol = invcol;
464+ sheet->IsVisiblePixel = &Sheet32_Internal_IsVisiblePixel;
465+ } else{
466+ #ifdef CHNOSPROJECT_DEBUG_SHEET
467+ debug("Sheet_Enable_InvisibleColor:Not implemented invisible-color in %d bpp.\n", sheet->bpp);
468+ #endif
469+ return 3;
470+ }
471+ sheet->flags.bit.using_invcol = True;
472+ return 0;
473+}
474+
475+uint Sheet_Disable_InvisibleColor(UI_Sheet *sheet)
476+{
477+ if(sheet == Null){
478+ #ifdef CHNOSPROJECT_DEBUG_SHEET
479+ debug("Sheet_Disable_InvisibleColor:Null sheet.\n");
480+ #endif
481+ return 1;
482+ }
483+ if(!sheet->flags.bit.buffer_configured){
484+ #ifdef CHNOSPROJECT_DEBUG_SHEET
485+ debug("Sheet_Disable_InvisibleColor:Not buffer_configured sheet.\n");
486+ #endif
487+ return 2;
488+ }
489+ sheet->flags.bit.using_invcol = False;
490+ sheet->IsVisiblePixel = &Sheet_Internal_IsVisiblePixel_Invalid;
491+ return sheet->invcol;
492+}
--- beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 317)
@@ -148,12 +148,22 @@
148148 }
149149 }
150150 } else{
151- for(y = p.y; y <= r.y; y++){
152- for(x = p.x; x <= r.x; x++){
153- if(sheet->parent->map[y * sheet->parent->size.x + x] == Null){
154- sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
151+ if(sheet->flags.bit.using_invcol){
152+ for(y = p.y; y <= r.y; y++){
153+ for(x = p.x; x <= r.x; x++){
154+ if(sheet->parent->map[y * sheet->parent->size.x + x] == Null && sheet->IsVisiblePixel(sheet, x, y)){
155+ sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
156+ }
155157 }
156158 }
159+ } else{
160+ for(y = p.y; y <= r.y; y++){
161+ for(x = p.x; x <= r.x; x++){
162+ if(sheet->parent->map[y * sheet->parent->size.x + x] == Null){
163+ sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
164+ }
165+ }
166+ }
157167 }
158168 }
159169
@@ -332,14 +342,18 @@
332342 //uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
333343 //その範囲内のマップを、sheetに変更があったとして、最小限で再構成する。
334344 //座標はmap(parent)なので注意。
335-//nolocationchanged==Trueで、sheetの移動が無いものとみなし、書き込み対象を元々シートがあった場所のみに限定する。
336-//nolocationchanged==Falseで、sheetの高さまではすべて再構成する。
337-uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1, bool nolocationchanged)
345+//sheetの高さまではすべて再構成する。
346+//同時に、更新したシートに対して再描画をかける。
347+uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1)
338348 {
339349 UI_Sheet *search;
340- int x, y;
341- uint i;
350+ //int x, y;
351+ uint i;
352+ UI_Sheet **write_sheet;
353+ uint write_sheets;
342354
355+ write_sheet = (UI_Sheet **)System_Memory_Allocate(4 * SHEET_MAX_CHILDREN);
356+
343357 if(px0 < 0){
344358 px0 = 0;
345359 }
@@ -353,24 +367,32 @@
353367 py1 = (int)sheet->parent->size.y - 1;
354368 }
355369
356- if(!nolocationchanged){
357- search = sheet->parent->child;
358- for(i = 0; i < SHEET_MAX_CHILDREN; i++){
359- if(search == Null){
360- break;
361- }
362- if(Sheet_Internal_IsRangeOverlappedWithSheet(search, px0, py0, px1, py1)){
363- Sheet_Internal_MapClearFromSheet(search, False, px0, py0, px1, py1);
364- }
365- if(search == sheet){
366- break;
367- }
368- search = search->next;
370+ write_sheets = 0;
371+
372+ search = sheet->parent->child;
373+ for(i = 0; i < SHEET_MAX_CHILDREN; i++){
374+ if(search == Null){
375+ break;
369376 }
370- } else{
371- Sheet_Internal_MapClearFromSheet(sheet, False, px0, py0, px1, py1);
377+ if(Sheet_Internal_IsRangeOverlappedWithSheet(search, px0, py0, px1, py1)){
378+ Sheet_Internal_MapClearFromSheet(search, False, px0, py0, px1, py1);
379+ write_sheet[write_sheets] = search;
380+ write_sheets++;
381+ }
382+ if(search == sheet){
383+ break;
384+ }
385+ search = search->next;
372386 }
373387
388+
389+ for(; write_sheets != 0; ){
390+ write_sheets--;
391+ Sheet_Internal_MapWriteFromSheet(write_sheet[write_sheets], False, px0, py0, px1, py1);
392+ Sheet_Internal_RefreshSheet(write_sheet[write_sheets], px0, py0, px1, py1);
393+ }
394+
395+/*
374396 for(y = py0; y <= py1; y++){
375397 for(x = px0; x <= px1; x++){
376398 if(sheet->parent->map[y * sheet->parent->size.x + x] == Null){
@@ -381,7 +403,10 @@
381403 }
382404 }
383405 }
406+*/
384407
408+ System_Memory_Free(write_sheet, 4 * SHEET_MAX_CHILDREN);
409+
385410 return 0;
386411 }
387412
@@ -451,12 +476,11 @@
451476 sheet->flags.bit.visible = False;
452477
453478 if(apx >= xsize || apy >= ysize){
454- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1, True);
455- Sheet_RefreshAllInRange(sheet->parent, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1);
479+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1);
456480 sheet->location.x += rpx;
457481 sheet->location.y += rpy;
458482 sheet->flags.bit.visible = True;
459- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1, False);
483+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1);
460484
461485 Sheet_RefreshSheet_All(sheet);
462486 return 0;
@@ -468,24 +492,22 @@
468492 //yの負の方向に移動=上方向
469493 A.x = sheet->location.x;
470494 A.y = sheet->location.y + ysize - apy;
471- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
472- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
495+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
473496 sheet->location.x += rpx;
474497 sheet->location.y += rpy;
475498 sheet->flags.bit.visible = True;
476499 A.y -= ysize;
477- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
500+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
478501 } else if(rpy > 0){
479502 //yの正の方向に移動=下方向
480503 A.x = sheet->location.x;
481504 A.y = sheet->location.y;
482- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
483- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
505+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
484506 sheet->location.x += rpx;
485507 sheet->location.y += rpy;
486508 sheet->flags.bit.visible = True;
487509 A.y += ysize;
488- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
510+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
489511 } else{
490512 //y方向にも移動しない=そのまま
491513 sheet->flags.bit.visible = True;
@@ -498,10 +520,8 @@
498520 A.y = sheet->location.y + ysize - apy;
499521 B.x = sheet->location.x + xsize - apx;
500522 B.y = sheet->location.y;
501- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
502- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
503- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
504- Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
523+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
524+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
505525 sheet->location.x += rpx;
506526 sheet->location.y += rpy;
507527 sheet->flags.bit.visible = True;
@@ -508,8 +528,8 @@
508528 A.x -= apx;
509529 A.y -= ysize;
510530 B.x -= xsize;
511- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
512- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
531+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
532+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
513533 } else if(rpy > 0){
514534 //yの正の方向に移動=左下方向
515535 A.x = sheet->location.x;
@@ -516,10 +536,8 @@
516536 A.y = sheet->location.y;
517537 B.x = sheet->location.x + xsize - apx;
518538 B.y = sheet->location.y + apy;
519- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
520- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
521- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
522- Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
539+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
540+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
523541 sheet->location.x += rpx;
524542 sheet->location.y += rpy;
525543 sheet->flags.bit.visible = True;
@@ -526,19 +544,18 @@
526544 A.x -= apx;
527545 A.y += ysize;
528546 B.x -= xsize;
529- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
530- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
547+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
548+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
531549 } else{
532550 //y方向に移動しない=左方向
533551 A.x = sheet->location.x + xsize - apx;
534552 A.y = sheet->location.y;
535- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, True);
536- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
553+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
537554 sheet->location.x += rpx;
538555 sheet->location.y += rpy;
539556 sheet->flags.bit.visible = True;
540557 A.x -= xsize;
541- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, False);
558+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
542559 }
543560 } else{
544561 //xの正の方向に移動
@@ -548,10 +565,8 @@
548565 A.y = sheet->location.y + ysize - apy;
549566 B.x = sheet->location.x;
550567 B.y = sheet->location.y;
551- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
552- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
553- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
554- Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
568+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
569+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
555570 sheet->location.x += rpx;
556571 sheet->location.y += rpy;
557572 sheet->flags.bit.visible = True;
@@ -558,8 +573,8 @@
558573 A.x += apx;
559574 A.y -= ysize;
560575 B.x += xsize;
561- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
562- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
576+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
577+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
563578 } else if(rpy > 0){
564579 //yの正の方向に移動=右下方向
565580 A.x = sheet->location.x;
@@ -566,10 +581,8 @@
566581 A.y = sheet->location.y;
567582 B.x = sheet->location.x;
568583 B.y = sheet->location.y + apy;
569- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
570- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
571- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
572- Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
584+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
585+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
573586 sheet->location.x += rpx;
574587 sheet->location.y += rpy;
575588 sheet->flags.bit.visible = True;
@@ -576,23 +589,31 @@
576589 A.x += apx;
577590 A.y += ysize;
578591 B.x += xsize;
579- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
580- Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
592+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
593+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
581594 } else{
582595 //y方向に移動しない=右方向
583596 A.x = sheet->location.x;
584597 A.y = sheet->location.y;
585- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, True);
586- Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
598+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
587599 sheet->location.x += rpx;
588600 sheet->location.y += rpy;
589601 sheet->flags.bit.visible = True;
590602 A.x += xsize;
591- Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, False);
603+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
592604 }
593605 }
594606
595- Sheet_RefreshSheet_All(sheet);
607+ Sheet_RefreshMap_All(sheet);
596608 return 0;
597609 }
598610
611+//SheetXX_Internal_IsVisiblePixel(UI_Sheet *sheet, int px, int py)
612+//親シート内座標における、指定されたシートのピクセル(px, py)が可視状態であるかどうかを返す。
613+//引数チェックはすべて省略しているので、呼び出し元で厳密にチェックする必要がある。
614+
615+//下の関数は、透明色モードオフ時に指定される、ダミー関数である。
616+bool Sheet_Internal_IsVisiblePixel_Invalid(UI_Sheet *sheet, int px, int py)
617+{
618+ return True;
619+}
--- beta/tolset_chn_000/chnos_010/chnos/core.h (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/core.h (revision 317)
@@ -230,8 +230,8 @@
230230 uint Sheet_RefreshSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
231231 uint Sheet_RefreshMap(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
232232 uint Sheet_RefreshMap_All(UI_Sheet *sheet);
233-uint Sheet_EnableInvisibleColor(UI_Sheet *sheet, uint invcol);
234-uint Sheet_DisableInvisibleColor(UI_Sheet *sheet);
233+uint Sheet_Enable_InvisibleColor(UI_Sheet *sheet, uint invcol);
234+uint Sheet_Disable_InvisibleColor(UI_Sheet *sheet);
235235
236236 /*sht08.c 8bitカラー シート関連*/
237237 uint Sheet08_Internal_SetBuffer(UI_Sheet *sheet, void *vram, uint xsize, uint ysize, uint bpp);
@@ -268,7 +268,7 @@
268268 bool Sheet_Internal_IsRangeOverlappedWithSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
269269 UI_Sheet *Sheet_Internal_GetSheetFromLocation(UI_Sheet *parent, int px, int py);
270270 uint Sheet_Internal_MapRebuild(UI_Sheet *parent, int px0, int py0, int px1, int py1);
271-uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1, bool nolocationchanged);
271+uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
272272 uint Sheet_Internal_RefreshSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
273273 uint Sheet_Internal_SlideSub(UI_Sheet *sheet, int rpx, int rpy);
274274 bool Sheet_Internal_IsVisiblePixel_Invalid(UI_Sheet *sheet, int px, int py);
--- beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 317)
@@ -169,7 +169,8 @@
169169 Sheet_Show(sheet32, 2, 420, vramsheet->size.y >> 1);
170170
171171 Sheet_SetParent(testsheet, vramsheet);
172- Sheet_Show(testsheet, 6, 10, 10);
172+ Sheet_Enable_InvisibleColor(testsheet, 0xc6c6c6);
173+ Sheet_Show(testsheet, 4, 10, 10);
173174
174175 timer1 = Timer_Initialise();
175176 Timer_Config(timer1, 50, mytask->fifo, 11, True);
--- beta/tolset_chn_000/chnos_010/chnos/sht32.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/sht32.c (revision 317)
@@ -32,6 +32,8 @@
3232
3333 sheet->vramsize = xsize * ysize * 4;
3434 sheet->Config_Functions = &Sheet32_Config_Functions;
35+ sheet->IsVisiblePixel = &Sheet_Internal_IsVisiblePixel_Invalid;
36+ sheet->flags.bit.using_invcol = False;
3537
3638 sheet->flags.bit.buffer_configured = True;
3739
@@ -224,3 +226,16 @@
224226
225227 return 0;
226228 }
229+
230+bool Sheet32_Internal_IsVisiblePixel(UI_Sheet *sheet, int px, int py)
231+{
232+ if(((uint *)(sheet->vram))[(py - sheet->location.y) * (int)sheet->size.x + (px - sheet->location.x)] >> 24 == 0xff){
233+ return False;
234+ }
235+
236+ if(((uint *)(sheet->vram))[(py - sheet->location.y) * (int)sheet->size.x + (px - sheet->location.x)] == sheet->invcol){
237+ return False;
238+ }
239+
240+ return True;
241+}
--- beta/tolset_chn_000/chnos_010/chnos/sht16.c (revision 316)
+++ beta/tolset_chn_000/chnos_010/chnos/sht16.c (revision 317)
@@ -32,6 +32,8 @@
3232
3333 sheet->vramsize = xsize * ysize * 2;
3434 sheet->Config_Functions = &Sheet16_Config_Functions;
35+ sheet->IsVisiblePixel = &Sheet_Internal_IsVisiblePixel_Invalid;
36+ sheet->flags.bit.using_invcol = False;
3537
3638 sheet->flags.bit.buffer_configured = True;
3739
@@ -224,3 +226,11 @@
224226 return 0;
225227 }
226228
229+bool Sheet16_Internal_IsVisiblePixel(UI_Sheet *sheet, int px, int py)
230+{
231+ if(((ushort *)(sheet->vram))[(py - sheet->location.y) * (int)sheet->size.x + (px - sheet->location.x)] == sheet->invcol){
232+ return False;
233+ }
234+
235+ return True;
236+}
旧リポジトリブラウザで表示