void PRINCOK() {
VIVAR = 0;
if(kbhit()) {
DEBJOUR(); }
if(saut) {
if(!hauteur_YOUPS) JJ.position_y -= JJvitesse_y;
if(JJposition_y == 93) hauteur_YOUPS = 1;
if(hauteur_YOUPS)
{
if(JJposition_y != 129)
{
JJposition_y += JJvitesse_y;
}
else
{
YOUPS = 0;
hauteur_YOUPS = 0;
}
}
}
deS_ghost(); deS_ecran(); putsprite(JJposition_x,JJposition_y,JJx,JJy,&JOUEUR[indice_joueur]);
if(!etat)
{ putsprite(ghost.position_x,ghost.position_y,ghost.x,ghost.y,&GHOST[indice_ghost]);
}
if(!Feu) { if(feu.position_x >= JJposition_x + 32) { if(feu.position_x > 308) Feu = 1; else { feu.position_x += feu.vitesse_x + VIVAR; putsprite(feu.position_x,feu.position_y,feu.x,feu.y,&FEU); } } else { if(feu.position_x < 10) Feu = 1; else { feu.position_x -= feu.vitesse_x - VIVAR; putsprite(feu.position_x,feu.position_y,feu.x,feu.y,&FEU); } } }
if(nbAff==30) nbAff = 0; nbAff++;
syncretrace(); cpyvirtuel(); }
Jean-Michel Reghem wrote:
enfin un peu d'animation sur cette liste ... on finissait par n'y parler que de technique depuis quelque temps ...
on va enfin pouvoir s'amuser à répondre à d'autres dans le but de se faire flamer encore plus ;-)
PS: pixelrock ... tant qu'à mettre du code source C++ builder, mets du code à toi ;-))
http://www.leunen.com/cbuilder/netenum.html
A+
pixelrock écrivait ( Thursday 20/03/2003 12:11 ) dans le message ci-dessous:
---
void __fastcall <TForm1::EnumNetRes(NETRESOURCE*>TForm1::EnumNetRes(NETRESOURCE* nr)
{
HANDLE hEnum;
//NetResource=NULL : we want to enumerate all resources
if(WNetOpenEnum(RESOURCE_GLOBALNET,RESOURCETYPE_ANY,
RESOURCEUSAGE_CONTAINER|RESOURCEUSAGE_CONNECTABLE
,nr,&hEnum)!=NO_ERROR)
{
// Error (access denied for instance)
return;
//If we don't want to continue the enumeration,
//throw an exception
//RaiseLastWin32Error();
}
//Enum all resources
DWORD Count=-1;
DWORD BufferSize=0;
DWORD ReturnVal=0;
//Allocate space for the NetResource array
NETRESOURCE *NetRes=(NETRESOURCE*)new char[1024];
ZeroMemory(NetRes,sizeof(NETRESOURCE));
for(;;)
{
ReturnVal=WNetEnumResource(hEnum,&Count,NetRes,&BufferSize);
if(ReturnVal==ERROR_MORE_DATA) //we set the size of NetRes
{
//we set the size of NetRes if there is more data
Count=-1;
delete[] NetRes;
NetRes=(NETRESOURCE*)new char[BufferSize];
ZeroMemory(NetRes,sizeof(NETRESOURCE));
ReturnVal=WNetEnumResource(hEnum,&Count,NetRes,&BufferSize);
}
if(ReturnVal!=NO_ERROR)break;
// Add the resource to the ListBox
for (unsigned int i=0;i<Count;i++)
{
ListBox1->Items->Add(NetRes[i].lpRemoteName);
//This line may be necessary
//Application->ProcessMessages();
if((NetRes[i].dwUsage & RESOURCEUSAGE_CONTAINER)==RESOURCEUSAGE_CONTAINER)
EnumNetRes(&NetRes[i]);
}
if(ReturnVal==ERROR_NO_MORE_ITEMS)
{
//the enumeration is completed
delete[] NetRes;
WNetCloseEnum(hEnum);
//RaiseLastWin32Error();
}
}
delete[] NetRes;
WNetCloseEnum(hEnum);
}
No comment
-- Decouvrez pourquoi votre prochain PC sera un Mac: http://www.apple.com/be Le Mac fonctionne, tout simplement. Il ne plante pas. Et il est beau! CyberCafe 2.0 <http://www.cybercafe.tv> Chaque Mardi 19h15 sur La 2! Desabonnement par email : <mailto:[EMAIL PROTECTED]>