|
|
@ -122,6 +122,8 @@ class Object{ |
|
|
|
vi2d spos; |
|
|
|
vi2d spos; |
|
|
|
vi2d size; |
|
|
|
vi2d size; |
|
|
|
bool hascut=false; |
|
|
|
bool hascut=false; |
|
|
|
|
|
|
|
bool tempObj; |
|
|
|
|
|
|
|
Object(){}; |
|
|
|
Object(Decal*spr) { |
|
|
|
Object(Decal*spr) { |
|
|
|
this->spr=spr; |
|
|
|
this->spr=spr; |
|
|
|
} |
|
|
|
} |
|
|
@ -516,7 +518,6 @@ public: |
|
|
|
BASE_OBJECTS["METEORSHOWER_NODE"]=new ObjectLoadInfo(POWER_METEOR_SHOWER_DECAL,&POWER_METEOR_SHOWER_ANIMATION); |
|
|
|
BASE_OBJECTS["METEORSHOWER_NODE"]=new ObjectLoadInfo(POWER_METEOR_SHOWER_DECAL,&POWER_METEOR_SHOWER_ANIMATION); |
|
|
|
BASE_OBJECTS["METEORSTORM_NODE"]=new ObjectLoadInfo(POWER_METEOR_STORM_DECAL,&POWER_METEOR_STORM_ANIMATION); |
|
|
|
BASE_OBJECTS["METEORSTORM_NODE"]=new ObjectLoadInfo(POWER_METEOR_STORM_DECAL,&POWER_METEOR_STORM_ANIMATION); |
|
|
|
BASE_OBJECTS["SNOWSTORM_NODE"]=new ObjectLoadInfo(POWER_SNOWSTORM_DECAL,&POWER_SNOWSTORM_ANIMATION); |
|
|
|
BASE_OBJECTS["SNOWSTORM_NODE"]=new ObjectLoadInfo(POWER_SNOWSTORM_DECAL,&POWER_SNOWSTORM_ANIMATION); |
|
|
|
BASE_OBJECTS["PLAYER_BACK"]=new ObjectLoadInfo(PLAYER_DECAL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0;i<MAX_PIXELS;i++) { |
|
|
|
for (int i=0;i<MAX_PIXELS;i++) { |
|
|
@ -1071,6 +1072,7 @@ public: |
|
|
|
case cutscene::CUTSCENE_4:{ |
|
|
|
case cutscene::CUTSCENE_4:{ |
|
|
|
if (!messageBoxVisible) { |
|
|
|
if (!messageBoxVisible) { |
|
|
|
if (!CUTSCENE_FLAGS[0]) { |
|
|
|
if (!CUTSCENE_FLAGS[0]) { |
|
|
|
|
|
|
|
CreateObject(GetMapFileCoords(8,17),PLAYER_DECAL,{64,0},{32,32}); |
|
|
|
CUTSCENE_FLAGS[0]=true; |
|
|
|
CUTSCENE_FLAGS[0]=true; |
|
|
|
DisplayMessageBox(0); |
|
|
|
DisplayMessageBox(0); |
|
|
|
} else |
|
|
|
} else |
|
|
@ -1326,7 +1328,7 @@ public: |
|
|
|
DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2+(obj->anim->flipped?32:0),(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->anim->spr,{obj->anim->getCurrentFrame().x,obj->anim->getCurrentFrame().y},{obj->anim->width,obj->anim->height},{obj->anim->flipped?-1:1,1}); |
|
|
|
DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2+(obj->anim->flipped?32:0),(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->anim->spr,{obj->anim->getCurrentFrame().x,obj->anim->getCurrentFrame().y},{obj->anim->width,obj->anim->height},{obj->anim->flipped?-1:1,1}); |
|
|
|
} else
|
|
|
|
} else
|
|
|
|
if (obj->hascut) { |
|
|
|
if (obj->hascut) { |
|
|
|
DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr,obj->spos,{obj->anim->width,obj->anim->height},{obj->anim->flipped?-1:1,1}); |
|
|
|
DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr,obj->spos,obj->size); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
DrawDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr); |
|
|
|
DrawDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr); |
|
|
|
} |
|
|
|
} |
|
|
@ -1796,27 +1798,38 @@ public: |
|
|
|
PLAYER_COORDS[1]=teleLoc.y+0.5; |
|
|
|
PLAYER_COORDS[1]=teleLoc.y+0.5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Object*createObject(vf2d pos,Decal*spr) { |
|
|
|
Object*CreateObject(vf2d pos,Decal*spr,bool temporary=false) { |
|
|
|
Object*newobj; |
|
|
|
Object*newobj; |
|
|
|
OBJECTS.push_back(newobj=new Object(spr)); |
|
|
|
OBJECTS.push_back(newobj=new Object(spr)); |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->y=pos.y; |
|
|
|
newobj->y=pos.y; |
|
|
|
|
|
|
|
newobj->tempObj=temporary; |
|
|
|
return newobj; |
|
|
|
return newobj; |
|
|
|
} |
|
|
|
} |
|
|
|
Object*createObject(vf2d pos,Decal*spr,Animation*anim) { |
|
|
|
Object*CreateObject(vf2d pos,Decal*spr,Animation*anim,bool temporary=false) { |
|
|
|
Object*newobj; |
|
|
|
Object*newobj; |
|
|
|
OBJECTS.push_back(newobj=new Object(spr,anim)); |
|
|
|
OBJECTS.push_back(newobj=new Object(spr,anim)); |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->y=pos.y; |
|
|
|
newobj->y=pos.y; |
|
|
|
|
|
|
|
newobj->tempObj=temporary; |
|
|
|
return newobj; |
|
|
|
return newobj; |
|
|
|
} |
|
|
|
} |
|
|
|
Object*createObject(vf2d pos,Decal*spr,vi2d spos,vi2d size) { |
|
|
|
Object*CreateObject(vf2d pos,Decal*spr,vi2d spos,vi2d size,bool temporary=false) { |
|
|
|
Object*newobj; |
|
|
|
Object*newobj; |
|
|
|
OBJECTS.push_back(newobj=new Object(spr,spos,size)); |
|
|
|
OBJECTS.push_back(newobj=new Object(spr,spos,size)); |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->x=pos.x; |
|
|
|
newobj->y=pos.y; |
|
|
|
newobj->y=pos.y; |
|
|
|
|
|
|
|
newobj->tempObj=temporary; |
|
|
|
return newobj; |
|
|
|
return newobj; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void ClearAllTemporaryObjects() { |
|
|
|
|
|
|
|
for (int i=0;i<OBJECTS.size();i++) { |
|
|
|
|
|
|
|
if (OBJECTS[i]->tempObj) { |
|
|
|
|
|
|
|
delete OBJECTS[i]; |
|
|
|
|
|
|
|
OBJECTS.erase(OBJECTS.begin()+i--); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|