|
|
|
@ -1045,8 +1045,8 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
EnableLayer(layer::COLLISION,false); |
|
|
|
|
} |
|
|
|
|
FillRectDecal(drawpos,{16,24},VERY_DARK_GREY); |
|
|
|
|
DrawPartialDecal({drawpos.x,drawpos.y+8},{16,16},obj->spr->spr,{(obj->frameIndex%obj->spr->frames)*obj->spr->width,0},{obj->spr->width,obj->spr->spr->sprite->height},obj->color); |
|
|
|
|
DrawStringDecal({drawpos.x+2,drawpos.y},obj->name,WHITE,{12.0/GetTextSize(obj->name).x,1.0}); |
|
|
|
|
DrawPartialDecal({(float)drawpos.x,(float)drawpos.y+8},{16,16},obj->spr->spr,{(float)((obj->frameIndex%obj->spr->frames)*obj->spr->width),0},{(float)obj->spr->width,(float)obj->spr->spr->sprite->height},obj->color); |
|
|
|
|
DrawStringDecal({(float)(drawpos.x+2),(float)(drawpos.y)},obj->name,WHITE,{(float)(12.0/GetTextSize(obj->name).x),1.0}); |
|
|
|
|
if (SELECTED_OBJ_ID==obj->id) { |
|
|
|
|
DrawRectDecal(drawpos,{16,24},YELLOW); |
|
|
|
|
} |
|
|
|
@ -1081,15 +1081,15 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
} |
|
|
|
|
FillRectDecal(drawpos,{16,24},VERY_DARK_GREY); |
|
|
|
|
for (int i=0;i<enc->objs.size();i+=2) { |
|
|
|
|
DrawPartialDecal({drawpos.x+((double)8/(enc->objs.size()))*i-4,drawpos.y},{16,16},enc->objs[i]->obj->spr->spr,{(enc->objs[i]->obj->frameIndex%enc->objs[i]->obj->spr->frames)*enc->objs[i]->obj->spr->width,0},{enc->objs[i]->obj->spr->width,enc->objs[i]->obj->spr->spr->sprite->height},enc->objs[i]->obj->color); |
|
|
|
|
DrawPartialDecal({(float)(drawpos.x+((double)8/(enc->objs.size()))*i-4),(float)(drawpos.y)},{16,16},enc->objs[i]->obj->spr->spr,{(float)((enc->objs[i]->obj->frameIndex%enc->objs[i]->obj->spr->frames)*enc->objs[i]->obj->spr->width),0},{(float)(enc->objs[i]->obj->spr->width),(float)(enc->objs[i]->obj->spr->spr->sprite->height)},enc->objs[i]->obj->color); |
|
|
|
|
} |
|
|
|
|
for (int i=1;i<enc->objs.size();i+=2) { |
|
|
|
|
DrawPartialDecal({drawpos.x+((double)8/(enc->objs.size()))*i-4,drawpos.y+6},{16,16},enc->objs[i]->obj->spr->spr,{(enc->objs[i]->obj->frameIndex%enc->objs[i]->obj->spr->frames)*enc->objs[i]->obj->spr->width,0},{enc->objs[i]->obj->spr->width,enc->objs[i]->obj->spr->spr->sprite->height},enc->objs[i]->obj->color); |
|
|
|
|
DrawPartialDecal({(float)(drawpos.x+((double)8/(enc->objs.size()))*i-4),(float)(drawpos.y+6)},{16,16},enc->objs[i]->obj->spr->spr,{(float)((enc->objs[i]->obj->frameIndex%enc->objs[i]->obj->spr->frames)*enc->objs[i]->obj->spr->width),0},{(float)(enc->objs[i]->obj->spr->width),(float)(enc->objs[i]->obj->spr->spr->sprite->height)},enc->objs[i]->obj->color); |
|
|
|
|
} |
|
|
|
|
if (ENCOUNTER_SELECTED==enc->id) { |
|
|
|
|
DrawRectDecal(drawpos,{16,24},YELLOW); |
|
|
|
|
} |
|
|
|
|
DrawStringDecal({drawpos.x+2,drawpos.y+24-GetTextSize(std::to_string(enc->id)).y},std::to_string(enc->id),WHITE,{12.0/GetTextSize(std::to_string(enc->id)).x,1.0}); |
|
|
|
|
DrawStringDecal({(float)(drawpos.x+2),(float)(drawpos.y+24-GetTextSize(std::to_string(enc->id)).y)},std::to_string(enc->id),WHITE,{(float)(12.0/GetTextSize(std::to_string(enc->id)).x),1.0}); |
|
|
|
|
drawpos.x+=16; |
|
|
|
|
if (drawpos.x>=WIDTH) { |
|
|
|
|
drawpos.x=0; |
|
|
|
@ -1115,7 +1115,7 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
if (!obj->drawn&&(!obj->dead||EDITING_LAYER==layer::ENCOUNTER)&&obj->GetPos().y+obj->originPoint.y>(y+yTileOffset)*32&&obj->GetPos().y+obj->originPoint.y<=(y+yTileOffset+1)*32) { |
|
|
|
|
obj->drawn=true; |
|
|
|
|
SetDrawTarget(layer::DYNAMIC); |
|
|
|
|
DrawPartialDecal(obj->GetPos()-cameraPos,obj->spr->spr,{(obj->frameIndex%obj->spr->frames)*obj->spr->width,0},{obj->spr->width,obj->spr->spr->sprite->height},obj->GetScale(),obj->color); |
|
|
|
|
DrawPartialDecal(obj->GetPos()-cameraPos,obj->spr->spr,{(float)((obj->frameIndex%obj->spr->frames)*obj->spr->width),0},{(float)obj->spr->width,(float)obj->spr->spr->sprite->height},obj->GetScale(),obj->color); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int x=-1;x<WIDTH/32+2;x++) { |
|
|
|
@ -1123,23 +1123,23 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
if (x+xTileOffset>=0&&x+xTileOffset<MAP_WIDTH&&y+yTileOffset>=0&&y+yTileOffset<MAP_HEIGHT) { |
|
|
|
|
if(MAP5[y+yTileOffset][x+xTileOffset]->tileX*MAP5[y+yTileOffset][x+xTileOffset]->tileY!=225) { |
|
|
|
|
SetDrawTarget(layer::COLLISION); |
|
|
|
|
DrawPartialSprite({x*32-fmod(cameraPos.x,32),y*32-fmod(cameraPos.y,32)},SPRITES["terrainmap.png"]->sprite,{MAP5[y+yTileOffset][x+xTileOffset]->tileX*32,MAP5[y+yTileOffset][x+xTileOffset]->tileY*32},{32,32}); |
|
|
|
|
DrawPartialSprite({(int)(x*32-fmod(cameraPos.x,32)),(int)(y*32-fmod(cameraPos.y,32))},SPRITES["terrainmap.png"]->sprite,{(int)(MAP5[y+yTileOffset][x+xTileOffset]->tileX*32),(int)(MAP5[y+yTileOffset][x+xTileOffset]->tileY*32)},{32,32}); |
|
|
|
|
} |
|
|
|
|
if(MAP4[y+yTileOffset][x+xTileOffset]->tileX*MAP4[y+yTileOffset][x+xTileOffset]->tileY!=225) { |
|
|
|
|
SetDrawTarget(layer::BACKGROUND); |
|
|
|
|
DrawPartialDecal({x*32-fmod(cameraPos.x,32),y*32-fmod(cameraPos.y,32)},SPRITES["terrainmap.png"],{MAP4[y+yTileOffset][x+xTileOffset]->tileX*32,MAP4[y+yTileOffset][x+xTileOffset]->tileY*32},{32,32}); |
|
|
|
|
DrawPartialDecal({(float)(x*32-fmod(cameraPos.x,32)),(float)(y*32-fmod(cameraPos.y,32))},SPRITES["terrainmap.png"],{(float)(MAP4[y+yTileOffset][x+xTileOffset]->tileX*32),(float)(MAP4[y+yTileOffset][x+xTileOffset]->tileY*32)},{32,32}); |
|
|
|
|
} |
|
|
|
|
if(MAP3[y+yTileOffset][x+xTileOffset]->tileX*MAP3[y+yTileOffset][x+xTileOffset]->tileY!=225) { |
|
|
|
|
SetDrawTarget(layer::GROUND); |
|
|
|
|
DrawPartialDecal({x*32-fmod(cameraPos.x,32),y*32-fmod(cameraPos.y,32)},SPRITES["terrainmap.png"],{MAP3[y+yTileOffset][x+xTileOffset]->tileX*32,MAP3[y+yTileOffset][x+xTileOffset]->tileY*32},{32,32}); |
|
|
|
|
DrawPartialDecal({(float)(x*32-fmod(cameraPos.x,32)),(float)(y*32-fmod(cameraPos.y,32))},SPRITES["terrainmap.png"],{(float)(MAP3[y+yTileOffset][x+xTileOffset]->tileX*32),(float)(MAP3[y+yTileOffset][x+xTileOffset]->tileY*32)},{32,32}); |
|
|
|
|
} |
|
|
|
|
if(MAP2[y+yTileOffset][x+xTileOffset]->tileX*MAP2[y+yTileOffset][x+xTileOffset]->tileY!=225) { |
|
|
|
|
SetDrawTarget(layer::DYNAMIC); |
|
|
|
|
DrawPartialDecal({x*32-fmod(cameraPos.x,32),y*32-fmod(cameraPos.y,32)},SPRITES["terrainmap.png"],{MAP2[y+yTileOffset][x+xTileOffset]->tileX*32,MAP2[y+yTileOffset][x+xTileOffset]->tileY*32},{32,32}); |
|
|
|
|
DrawPartialDecal({(float)(x*32-fmod(cameraPos.x,32)),(float)(y*32-fmod(cameraPos.y,32))},SPRITES["terrainmap.png"],{(float)(MAP2[y+yTileOffset][x+xTileOffset]->tileX*32),(float)(MAP2[y+yTileOffset][x+xTileOffset]->tileY*32)},{32,32}); |
|
|
|
|
} |
|
|
|
|
if(MAP[y+yTileOffset][x+xTileOffset]->tileX*MAP[y+yTileOffset][x+xTileOffset]->tileY!=225) { |
|
|
|
|
SetDrawTarget(layer::HIGH); |
|
|
|
|
DrawPartialDecal({x*32-fmod(cameraPos.x,32),y*32-fmod(cameraPos.y,32)},SPRITES["terrainmap.png"],{MAP[y+yTileOffset][x+xTileOffset]->tileX*32,MAP[y+yTileOffset][x+xTileOffset]->tileY*32},{32,32}); |
|
|
|
|
DrawPartialDecal({(float)(x*32-fmod(cameraPos.x,32)),(float)(y*32-fmod(cameraPos.y,32))},SPRITES["terrainmap.png"],{(float)(MAP[y+yTileOffset][x+xTileOffset]->tileX*32),(float)(MAP[y+yTileOffset][x+xTileOffset]->tileY*32)},{32,32}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1764,10 +1764,10 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawDialogBox(const vi2d &pos, const vi2d &size, Pixel p = WHITE, Pixel p2 = DARK_GREY, Pixel p3 = VERY_DARK_GREY) { |
|
|
|
|
FillRect({(float)pos.x,(float)pos.y},size,p2); |
|
|
|
|
FillRect({(float)pos.x+1,(float)pos.y+1},{(float)size.x-2,(float)size.y-2},p); |
|
|
|
|
FillRect({(float)pos.x+2,(float)pos.y+2},{(float)size.x-4,(float)size.y-4},p3); |
|
|
|
|
FillRect({(float)pos.x+3,(float)pos.y+3},{(float)size.x-5,(float)size.y-5},p); |
|
|
|
|
FillRect({(int)pos.x,(int)pos.y},size,p2); |
|
|
|
|
FillRect({(int)pos.x+1,(int)pos.y+1},{(int)size.x-2,(int)size.y-2},p); |
|
|
|
|
FillRect({(int)pos.x+2,(int)pos.y+2},{(int)size.x-4,(int)size.y-4},p3); |
|
|
|
|
FillRect({(int)pos.x+3,(int)pos.y+3},{(int)size.x-5,(int)size.y-5},p); |
|
|
|
|
Draw({pos.x,pos.y},Pixel(77, 51, 125)); |
|
|
|
|
Draw({pos.x+size.x-1,pos.y+size.y-1},Pixel(77, 51, 125)); |
|
|
|
|
Draw({pos.x+size.x-1,pos.y},Pixel(77, 51, 125)); |
|
|
|
|