void PostRedrawMouse(){
	if(xLockMouse)return;
	bool need=true;
	if(MX==OldMX&&MY==OldMY)
		need=CmpMData((void*)buf2o,RealScreenPtr,MX,MY,RSCRSizeX,RSCRSizeY);
	if(need){
		RestoreMData(RealScreenPtr,(void*)buf1,(void*)buf2,MX,MY,RSCRSizeX,RSCRSizeY);
		RestoreMData(RealScreenPtr,(void*)buf1o,(void*)buf2o,OldMX,OldMY,RSCRSizeX,RSCRSizeY);
		GetMData((void*)buf1o,RealScreenPtr,MX,MY,RSCRSizeX,RSCRSizeY);
		void* osp=ScreenPtr;
		int osx=SCRSizeX;
		int sw=ScrWidth;
		ScrWidth=RSCRSizeX;
		ScreenPtr=RealScreenPtr;
		SCRSizeX=RSCRSizeX;
		//WindX=120;
		//WindX1=550;
		//ShowRLCItem(MX+32,MY,&mptr,curptr+4096,0);
		ShowRLCItem(MX,MY,&mptr,curptr,0);
		SCRSizeX=osx;
		ScreenPtr=osp;
		ScrWidth=sw;
		GetMData((void*)buf2o,RealScreenPtr,MX,MY,RSCRSizeX,RSCRSizeY);
		OldMX=MX;
		OldMY=MY;
	};
	LockMouse=false;
};
//Redraw mouse in the offscreen buffer
//and prepare data for onscreen transferring 
void RedrawOffScreenMouse(){
	if(xLockMouse)return;
	LockMouse=true;
	MX=mouseX-curdx;
	MY=mouseY-curdy;
	RestoreMData(ScreenPtr,(void*)buf1,(void*)buf2,OldMX,OldMY,SCRSizeX,SCRSizeY);
	GetMData((void*)buf1,ScreenPtr,MX,MY,SCRSizeX,SCRSizeY);
	//ShowRLCItem(MX+32,MY,&mptr,curptr+4096,0);
	ShowRLCItem(MX,MY,&mptr,curptr,0);
	GetMData((void*)buf2,ScreenPtr,MX,MY,SCRSizeX,SCRSizeY);
};
Пример #3
0
void ShowMPtra(){
	if(DDDebug)return;
	int i;
	int j;
	if(!int(RealScreenPtr))return; 
	bool Rpnt=0;
	char* xx=(char*)(RealScreenPtr);
	byte b;
	
	if(mouseX!=mouseX1a||mouseY!=mouseY1a)Rpnt=true;
	if(Rpnt){
		for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
			int xt1=mouseX1a+i;
			int yt1=mouseY1a+j;
			if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY){
				int of=xt1+yt1*RSCRSizeX;
				b=xx[of];
				if(b==buf2a[i][j])
					xx[of]=buf1a[i][j];
			};
		}
	};
	mouseX1a=mouseX2;
	mouseY1a=mouseY2;
	Transferreda=true;
	if(Rpnt){
		for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
			int xt1=mouseX1+i;
			int yt1=mouseY1+j;
			if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY)
				buf1a[i][j]=xx[xt1+yt1*RSCRSizeX];
		};
	};
	void* z=ScreenPtr;
	ScreenPtr=RealScreenPtr;
	int SSX=ScrWidth;
	ScrWidth=RSCRSizeX;
	ShowRLCItem(mouseX2,mouseY2,&mptr,curptr,0);
	ScrWidth=SSX;
	ScreenPtr=z;
	for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
		int xt1=mouseX1+i;
		int yt1=mouseY1+j;
		if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY)
			buf2a[i][j]=xx[xt1+yt1*RSCRSizeX];
	};
};
void RedrawScreenMouse(){
	if(xLockMouse)return;
	RestoreMData(RealScreenPtr,(void*)buf1o,(void*)buf2o,OldMX,OldMY,RSCRSizeX,RSCRSizeY);
	GetMData((void*)buf1o,RealScreenPtr,MX,MY,RSCRSizeX,RSCRSizeY);
	void* osp=ScreenPtr;
	int osx=SCRSizeX;
	int sw=ScrWidth;
	ScrWidth=RSCRSizeX;
	ScreenPtr=RealScreenPtr;
	SCRSizeX=RSCRSizeX;
	//ShowRLCItem(MX+32,MY,&mptr,curptr+4096,0);
	ShowRLCItem(MX,MY,&mptr,curptr,0);
	SCRSizeX=osx;
	ScreenPtr=osp;
	ScrWidth=sw;
	GetMData((void*)buf2o,RealScreenPtr,MX,MY,RSCRSizeX,RSCRSizeY);
};
Пример #5
0
void ShowMPtr(){
	//return;
	int i;
	int j;
	//void* Sp1=ScreenPtr;
	//ScreenPtr=RealScreenPtr;
	char* xx=(char*)(ScreenPtr);
	byte b;
	
	//if(!Transferred){
	for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
		int xt1=mouseX1+i;
		int yt1=mouseY1+j;
		if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY){
			int of=(i+mouseX1)+(j+mouseY1)*SCRSizeX;
			b=xx[of];
			if(b==buf2[i][j])xx[of]=buf1[i][j];
		};
	}
	//};
	mouseX2=mouseX-curdx;
	mouseY2=mouseY-curdy;
	mouseX1=mouseX2;
	mouseY1=mouseY2;
	Transferred=true;
	for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
		int xt1=mouseX1+i;
		int yt1=mouseY1+j;
		if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY)
			buf1[i][j]=xx[xt1+yt1*SCRSizeX];
	};
	ShowRLCItem(mouseX2,mouseY2,&mptr,curptr,0);
	for(i=0;i<MaxMX;i++)for(j=0;j<MaxMX;j++){
		int xt1=mouseX1+i;
		int yt1=mouseY1+j;
		if(xt1>=0&&xt1<RSCRSizeX&&yt1>=0&&yt1<RSCRSizeY)
			buf2[i][j]=xx[xt1+yt1*SCRSizeX];
	};
	//ScreenPtr=Sp1;
	ShowMPtra();
};