Mercurial > otakunoraifu
diff scn2k/scn2k_grpimpl.cc @ 60:e16e13d8cd68
Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
author | Thibaut GIRKA <thib@sitedethib.com> |
---|---|
date | Fri, 18 Dec 2009 20:41:38 +0100 |
parents | c7bcc0ec2267 |
children | bdd8a5ff8f46 |
line wrap: on
line diff
--- a/scn2k/scn2k_grpimpl.cc +++ b/scn2k/scn2k_grpimpl.cc @@ -155,6 +155,7 @@ void Grp::impl_recFill(Cmd& cmd) { } void Grp::impl_recCopy(Cmd& cmd) { + //TODO: Handle forms 0 and 1 int sx = cmd.args[0].value; int sy = cmd.args[1].value; int w = cmd.args[2].value; @@ -172,7 +173,6 @@ void Grp::impl_recCopy(Cmd& cmd) { // if (dest == 0) screen->ReBlit(Rect(dx,dy,dx+w,dy+h)); cmd.cmd_type = CMD_SAVECMDGRP; } - else if (cmd.cmd4 == 3) { // alpha つきcopy unsigned char alpha; if (cmd.args[8].value < 0) alpha = 0; @@ -191,7 +191,7 @@ void Grp::impl_recCopy(Cmd& cmd) { } void Grp::impl_recAdd(Cmd& cmd) { - if (cmd.cmd4 == 3) { // saturate mode で alpha 付き copy + if (cmd.cmd4 == 3) { // add mode で alpha 付き copy int sx = cmd.args[0].value; int sy = cmd.args[1].value; int w = cmd.args[2].value; @@ -205,15 +205,15 @@ void Grp::impl_recAdd(Cmd& cmd) { if (cmd.args[8].value < 0) alpha = 0; else if (cmd.args[8].value > 255) alpha = 255; else alpha = cmd.args[8].value; - eprintf("copy surface w/ saturate %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy); + eprintf("copy surface w/ add %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy); if (src == dest) { DSurfaceMove(Ssurface(src), rect, Dsurface(WORKPDT), rect); src = WORKPDT; } if (alpha != 0) { - // saturate mode : screen (picture) を一時的に作成 + // add mode : screen (picture) を一時的に作成 PicBase* screen_tmp = parent.create_leaf(Rect(0, 0, parent.Width(), parent.Height()), 0); - screen_tmp->SetSurface(Ssurface(src), 0, 0, PicBase::BLIT_SATURATE); + screen_tmp->SetSurface(Ssurface(src), 0, 0, PicBase::BLIT_ADD); screen_tmp->SetSurfaceRect(rect); screen_tmp->Move(dx, dy); screen_tmp->SetSurfaceAlpha(&alpha, Rect(0,0,1,1)); @@ -348,7 +348,7 @@ void Grp::impl_createObj(Cmd& cmd) { base_argc = 1; if (cmd.cmd3 == 1000) { /* ファイル名設定 */ - g->gtype = GrpObj::FILE; //FIXME: Strange thing in the main menu; that happens with objComposite + g->gtype = GrpObj::FILE; string name = cmd.Str(cmd.args[base_argc + 1]); if (name.find('?') != -1) {//TODO //Used for shading, with DAT/tcdata.tcc or other filename provided by #TONECURVE_FILENAME @@ -516,12 +516,11 @@ void Grp::impl_objColour(Cmd& cmd) { void Grp::impl_objComposite(Cmd& cmd) {//FIXME int base_arg = 0; GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51)); - if (cmd.args[base_arg + 1].value == 1) { - g->attr = GrpObj::Attribute(g->attr | GrpObj::SATURATE); + g->attr = GrpObj::Attribute(g->attr | GrpObj::BLIT_ADD); cmd.clear(); } else if (cmd.args[base_arg + 1].value == 0) { - g->attr = GrpObj::Attribute(g->attr & (~GrpObj::SATURATE)); + g->attr = GrpObj::Attribute(g->attr & (~GrpObj::BLIT_ADD)); cmd.clear(); } g->SetUpdate(); @@ -765,3 +764,4 @@ void Grp::impl_movPlay(Cmd& cmd) { cmd.clear(); } } +