Added Path Trace mode for Scene editing.

master
Alec Murphy 6 years ago
parent f22d91844f
commit 13699616bf

Binary file not shown.

@ -76,7 +76,7 @@ CDC *to_02=GRRead("Chars/KtchDoorOpen.TGT.GR");
CDC *dc=DCNew(640,480);
Scene *SceneAdd(I64 init_x, I64 t_x, I64 t_y, U8 *loc, U8 *bg_file, Scene *sc_head)
Scene *SceneAdd(I64 init_x, I64 t_x, I64 t_y, U8 *loc, U8 *bg_file, U8 *path_file, Scene *sc_head)
{
I64 scx=0;
Scene *sc_new = CAlloc(sizeof(Scene));
@ -95,9 +95,16 @@ Scene *SceneAdd(I64 init_x, I64 t_x, I64 t_y, U8 *loc, U8 *bg_file, Scene *sc_he
StrCpy(sc_new->song,"R");
sc_new->bg=GRRead(bg_file);
sc_new->mask=DCNew(sc_new->bg->width,sc_new->bg->height);
sc_new->path=DCNew(sc_new->bg->width,sc_new->bg->height);
if (StrCmp(path_file,"")==0)
{
sc_new->path=DCNew(sc_new->bg->width,sc_new->bg->height);
DCFill(sc_new->path,0);
}
else
{
sc_new->path=GRRead(path_file);
};
DCFill(sc_new->mask,0);
DCFill(sc_new->path,0);
sc_new->next=0;
if (sc_head->next==0)
{
@ -447,6 +454,11 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
I64 scene_ctr=0;
I64 snd_toggle=TRUE;
I64 success=FALSE;
I64 tr_c=BLUE;
I64 tr_x1=-1;
I64 tr_x2=-1;
I64 tr_y1=-1;
I64 tr_y2=-1;
I64 use_obj=FALSE;
I64 use_tid=-1;
@ -561,11 +573,73 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
if (scan_code==0x50) { get_oid=-1; use_tid=-1; gs->walkto_y= gs->player_y+WALK_SPEED*2; };
msg_code=ScanMsg(,,1<<MSG_MS_L_UP+1<<MSG_MS_R_UP);
if (msg_code==MSG_MS_R_UP)
// Path Trace Mode
if (!bg_layer)
{
if (scan_code==0x0C)
{
tr_c--;
};
if (scan_code==0x0D)
{
tr_c++;
};
if (scan_code==0x1F)
{
GRWrite("PATH.GR.Z",s_ptr->path);
pop_up=PopUpOk("Scene Path saved to PATH.GR.Z");
};
if (tr_c>15) { tr_c=0; };
if (tr_c<0) { tr_c=15; };
if (tr_x1 != -1 && tr_x2 == -1)
{
s_ptr->mask->color=tr_c;
GrLine(s_ptr->mask, tr_x1, tr_y1, -gs->bgscroll_x+ms.pos.x, ms.pos.y);
};
};
if (msg_code==MSG_MS_L_UP && !bg_layer)
{
s_ptr->path->color=tr_c;
if (tr_x1==-1)
{
tr_x1= -gs->bgscroll_x+ms.pos.x;
tr_y1= ms.pos.y;
}
else
{
tr_x2= -gs->bgscroll_x+ms.pos.x;
tr_y2= ms.pos.y;
GrLine(s_ptr->path, tr_x1, tr_y1, tr_x2, tr_y2);
tr_x1=-1;
tr_x2=-1;
};
};
if (msg_code==MSG_MS_R_UP && !bg_layer)
{
s_ptr->mask->color=tr_c;
if (tr_x1==-1)
{
GrFloodFill(s_ptr->path, -gs->bgscroll_x+ms.pos.x, ms.pos.y, TRUE);
}
else
{
tr_x1=-1;
tr_x2=-1;
};
};
if (msg_code==MSG_MS_R_UP && bg_layer)
{
left_action=ACT_WALK_TO;
};
if (msg_code==MSG_MS_L_UP)
if (msg_code==MSG_MS_L_UP && bg_layer)
{
if (ms.pos.y>103)
{
@ -1001,11 +1075,14 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
//Debug
if (!bg_layer)
{
GrPrint(dc,24+(8*6),32+(8*1),"ms.X1Y1: %d %d", -gs->bgscroll_x+ms.pos.x, ms.pos.y);
GrPrint(dc,24+(8*8),32+(8*2),"BX: %d", gs->bgscroll_x);
GrPrint(dc,24+(8*8),32+(8*3),"X1 Y1: %d %d", -gs->bgscroll_x+gs->player_x+16, gs->player_y+132);
GrPrint(dc,24+(8*8),32+(8*4),"X2 Y2: %d %d", -gs->bgscroll_x+gs->player_x+16+39, gs->player_y+132+15);
dc->color=tr_c;
GrPrint(dc,24+(8*3),32-(8*1),"%d",tr_c);
dc->color=WHITE;
GrPrint(dc,24+(8*3),32+(8*1),"Mouse X1 Y1: %d %d", -gs->bgscroll_x+ms.pos.x, ms.pos.y);
GrPrint(dc,24+(8*3),32+(8*2),"BgrScrollPos: %d", gs->bgscroll_x);
GrPrint(dc,24+(8*3),32+(8*3),"Player X1 Y1: %d %d", -gs->bgscroll_x+gs->player_x+16, gs->player_y+132);
GrPrint(dc,24+(8*3),32+(8*4),"Player X2 Y2: %d %d", -gs->bgscroll_x+gs->player_x+16+39, gs->player_y+132+15);
};
// Terry
@ -1013,7 +1090,7 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
GR96Blot(dc,gs->player_x,gs->player_y,s_Terry,2,2,!gs->walk_dir);
// Test Dianna Thumbnail Overlay
//GrBlot(dc,0,360,th_Dianna);
GrBlot(dc,0,360,th_Dianna);
bnd_x1y1 = GrPeek(s_ptr->mask, -gs->bgscroll_x+gs->player_x+16, gs->player_y+132);
bnd_x2y2 = GrPeek(s_ptr->mask, -gs->bgscroll_x+gs->player_x+16+39, gs->player_y+132+15);
@ -1077,7 +1154,7 @@ U0 Run(I64 sfx_cpu=0,Bool load_state=FALSE)
}
else
{
if (left_action==ACT_PICK_UP && get_oid!=-1)
if (left_action==ACT_PICK_UP && get_oid!=-1)
{
get_obj=TRUE;
if (gs->player_y+48<gs->s_obj_y[get_oid] || gs->player_y+48>(gs->s_obj_y[get_oid]+48))

@ -28,7 +28,7 @@ U0 TargetOverlay(Bool bg_layer, CDC *dc, CDC *s_mask, I64 bgs_x, I64 uid)
GrBlot(dc,bgs_x+454,284,to_01);
}
else {
s_mask->color=6;
dc->color=6;
GrRect(dc,bgs_x+454,284,154,80);
};
break;
@ -42,7 +42,7 @@ U0 TargetOverlay(Bool bg_layer, CDC *dc, CDC *s_mask, I64 bgs_x, I64 uid)
GrBlot(dc,bgs_x+544,80,to_02);
}
else {
 s_mask->color=6;
dc->color=6;
GrRect(dc,bgs_x+544,80,to_02->width,to_02->height);
};
break;

@ -16,16 +16,10 @@ Scene *m_ptr;
Scene *scenes=CAlloc(sizeof(Scene));
// 00
m_ptr=SceneAdd(-120, 320, 240, "Outside Terry's House", "Scenes/00.SCENE.GR", scenes);
m_ptr=SceneAdd(-120, 320, 240, "Outside Terry's House", "Scenes/00.SCENE.GR", "Scenes/00.PATH.GR", scenes);
StrCpy(m_ptr->song, "5qD4A5G4G5E4BeG5D4G5E5qD4A5G4G5E4BeG5D4G5E5q4AetB5E4Gq5CeEEsCECEqDetG4B5DE4G5C5q4AetB5E4Gq5CeEEsCECEqDetG4B5DE4G5C");
m_ptr->path->color=1;
GrRect(m_ptr->path,0,350,144,96);
GrRect(m_ptr->path,453,350,144,96);
GrRect(m_ptr->path,0,416,m_ptr->path->width-1,62);
m_ptr->path->color=2;
GrRect(m_ptr->path,77,306,76,68);
// to Asteroid Way
m_ptr->st_id[2]=1;
m_ptr->st_bx[2]=-544;
m_ptr->st_nx[2]=480;
@ -40,98 +34,50 @@ m_ptr->st_ny[6]=300;
// 01
m_ptr=SceneAdd(0, 0, 300, "Asteroid Way", "Scenes/01.SCENE.GR", scenes);
m_ptr=SceneAdd(0, 0, 300, "Asteroid Way", "Scenes/01.SCENE.GR", "Scenes/01.PATH.GR", scenes);
StrCpy(m_ptr->song, "5M6/8q4Get5EDDG4GGqGeA5GsD4G5D4G5M6/8q4Get5EDDG4GGqGeA5GsD4G5D4G5qFs4B5C4B5CqGet4A5FDe4B5Cet4AG5CqC4B5qFs4B5C4B5CqGet4A5FDe4B5Cet4AG5CqC4B");
m_ptr->path->color=1;
GrRect(m_ptr->path,0,436,m_ptr->path->width-1,62);
m_ptr->path->color=2;
GrRect(m_ptr->path,0,416,114,48);
// to Green Valley Grocery
m_ptr->st_id[2]=2;
//m_ptr->st_bx[2]=-544;
m_ptr->st_bx[2]=-1024;
m_ptr->st_nx[2]=480;
m_ptr->st_ny[2]=320;
m_ptr->path->color=3;
GrRect(m_ptr->path,1164,416,76,48);
// to Outside Terry's House
m_ptr->st_id[3]=0;
m_ptr->st_bx[3]=0;
m_ptr->st_nx[3]=70;
m_ptr->st_ny[3]=270;
// 02
//m_ptr=SceneAdd(0, 0, 300, "Vegas Blvd", "Scenes/02.SCENE.GR", scenes);
m_ptr=SceneAdd(0, 0, 300, "Green Valley Grocery", "Scenes/05.SCENE.GR", scenes);
// 02
m_ptr=SceneAdd(0, 0, 300, "Green Valley Grocery", "Scenes/05.SCENE.GR", "Scenes/05.PATH.GR", scenes);
StrCpy(m_ptr->song, "6M6/8qGetF5GBe.Bs6Cq5BAetG6C5B6M6/8qGetF5GBe.Bs6Cq5BAetG6C5B6eGGCCet5BGAe6GDqDs5B6D5B6DqGsCFCF6eGGCCet5BGAe6GDqDs5B6D5B6DqGsCFCF");
m_ptr->path->color=1;
GrRect(m_ptr->path,0,436,m_ptr->path->width-1,62);
GrLine(m_ptr->path,574,440,1143,312);
GrLine(m_ptr->path,1061,335,1147,311);
GrLine(m_ptr->path,1147,311,1299,310);
GrLine(m_ptr->path,1299,310,1589,440);
GrFloodFill(m_ptr->path,1123,332,TRUE);
m_ptr->path->color=2;
GrRect(m_ptr->path,881,331,80,32);
//GrLine(m_ptr->path,1143,312,1143,450);
//GrRect(m_ptr->path,960,430,240,96);
//m_ptr->path->color=3;
//GrRect(m_ptr->path,1164,416,76,48);
// teleport back to Outside Terry's House
m_ptr->st_id[2]=0;
m_ptr->st_bx[2]=0;
m_ptr->st_nx[2]=70;
m_ptr->st_ny[2]=270;
// 03
m_ptr=SceneAdd(0,0, 300, "Terry'sGarage", "Scenes/06.SCENE.GR", scenes);
m_ptr=SceneAdd(0,0, 300, "Terry'sGarage", "Scenes/06.SCENE.GR", "Scenes/06.PATH.GR", scenes);
StrCpy(m_ptr->song, "2qGeEEs1B2E1B2EetCCRq1B2FCet1BAB2qGeEEs1B2E1B2EetCCRq1B2FCet1BAB2sDFDF1BBBBe2F1G2EDqE1AB2E2sDFDF1BBBBe2F1G2EDqE1AB2E");
m_ptr->path->color=1;
GrRect(m_ptr->path,0,430,960,96);
GrLine(m_ptr->path,92,435,170,389);
GrLine(m_ptr->path,170,389,170,356);
GrLine(m_ptr->path,170,356,238,317);
GrLine(m_ptr->path,238,317,350,311);
GrLine(m_ptr->path,350,311,435,306);
GrLine(m_ptr->path,435,306,518,305);
GrLine(m_ptr->path,518,305,521,280);
GrLine(m_ptr->path,521,280,547,282);
GrLine(m_ptr->path,547,282,550,253);
GrLine(m_ptr->path,550,253,630,258);
GrLine(m_ptr->path,630,258,633,278);
GrLine(m_ptr->path,633,278,665,283);
GrLine(m_ptr->path,665,283,671,300);
GrLine(m_ptr->path,671,300,702,304);
GrLine(m_ptr->path,702,304,727,320);
GrLine(m_ptr->path,727,320,753,310);
GrLine(m_ptr->path,753,310,827,349);
GrLine(m_ptr->path,827,349,831,368);
GrLine(m_ptr->path,831,368,959,420);
GrFloodFill(m_ptr->path,522,332,TRUE);
m_ptr->path->color=2;
GrRect(m_ptr->path,0,446,960,96);
// Exit to street Outside Terry's House
m_ptr->st_id[2]=0;
m_ptr->st_bx[2]=-200;
m_ptr->st_nx[2]=320;
m_ptr->st_ny[2]=240;
// test for open kitchen door
// (Opened) Door to Kitchen
m_ptr->st_id[6]=4;
//m_ptr->st_bx[2]=-544;
m_ptr->st_bx[6]=0;
m_ptr->st_nx[6]=320;
m_ptr->st_ny[6]=300;
// 04
m_ptr=SceneAdd(0,0, 300, "Terry's Giant Kitchen", "Scenes/07.SCENE.GR", scenes);
m_ptr=SceneAdd(0,0, 300, "Terry's Giant Kitchen", "Scenes/07.SCENE.GR", "", scenes);
//StrCpy(m_ptr->song, "2qGeEEs1B2E1B2EetCCRq1B2FCet1BAB2qGeEEs1B2E1B2EetCCRq1B2FCet1BAB2sDFDF1BBBBe2F1G2EDqE1AB2E2sDFDF1BBBBe2F1G2EDqE1AB2E");
m_ptr->path->color=1;
GrRect(m_ptr->path,0,430,960,96);
@ -141,8 +87,18 @@ GrRect(m_ptr->path,0,446,960,96);
m_ptr->st_id[2]=3;
m_ptr->st_bx[2]=-220;
m_ptr->st_nx[2]=346;
m_ptr->st_nx[2]=346;
m_ptr->st_ny[2]=146;
// 02 (old)
//m_ptr=SceneAdd(0, 0, 300, "Vegas Blvd", "Scenes/02.SCENE.GR", scenes);
//GrLine(m_ptr->path,1143,312,1143,450);
//GrRect(m_ptr->path,960,430,240,96);
//m_ptr->path->color=3;
//GrRect(m_ptr->path,1164,416,76,48);
s_ptr=*scenes;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save