first commit - moved from local dev to git
This commit is contained in:
76
devtools/rsm/DE/modules/rsm2cs/ciconini.c
Normal file
76
devtools/rsm/DE/modules/rsm2cs/ciconini.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/*************************************************************
|
||||
* *
|
||||
* Beispiele f<>r cicon_init() und cicon_exit() *
|
||||
* Autor: Armin Diedering *
|
||||
* WWW: http://www.Diedering.de *
|
||||
* *
|
||||
*************************************************************/
|
||||
|
||||
#include <portab.h>
|
||||
#include <gemfast.h>
|
||||
|
||||
|
||||
/* Folgende Funktionen werden Ben<65>tigt */
|
||||
|
||||
WORD CountOfPlanes(); /* liefert die Anzahl der Planes der aktuellen */
|
||||
/* Aufl<66>sung zur<75>ck */
|
||||
|
||||
WORD CanCicon(); /* gibt Auskunft, ob das System CICONs kann */
|
||||
|
||||
WORD IsMagiC(); /* Ist MagiC das OS ? */
|
||||
|
||||
|
||||
/* Jetzt gehts aber los */
|
||||
|
||||
long rs_ciconinit(CICONBLK *ciconblks, int ncib, OBJECT *objects, int nobj)
|
||||
{
|
||||
if(CanCicon())
|
||||
{
|
||||
if(IsMagiC())
|
||||
{
|
||||
while(ncib--) /* siehe rsm2cs.hyp */
|
||||
{
|
||||
CICON *cicon = ciconblks->mainlist;
|
||||
CICON *found = cicon;
|
||||
WORD planes = 0;
|
||||
while(cicon) /* passende Farbzahl suchen */
|
||||
{
|
||||
if(cicon->num_planes <= CountOfPlanes()) /* kann das OS dieses Icon? */
|
||||
{
|
||||
if(cicon->num_planes > planes) /* sind es mehr Planes als */
|
||||
{ /* ich schon gefunden habe? */
|
||||
found = cicon;
|
||||
planes = found->num_planes; /* das merk ich mir */
|
||||
}
|
||||
}
|
||||
cicon = cicon->next_res; /* n<>chste Farbzahl */
|
||||
}
|
||||
ciconblks->mainlist = found; /* gefundesnes setzen */
|
||||
ciconblks++; /* n<>chstes Icon */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Hier wirds jetz aber kompliziert. man mu<6D> CICON f<>r CICON durchgehen. */
|
||||
/* Dabei sollte man erst einmal die passende Farbzahl (<28>hnlich wie bei */
|
||||
/* MagiC s.o.) suchen und setzen. Dann m<>ssen die gefundenen Bilddaten, */
|
||||
/* die ja im Standrd-Format vorliegen in das ger<65>teabh<62>ngige Format */
|
||||
/* gewandelt werden. */
|
||||
/* wie das zu bewerkstelligen ist <20>berlasse ich eurer Fantasie ;-) */
|
||||
}
|
||||
}
|
||||
else /* das System kann gar keine CICONs */
|
||||
{
|
||||
while(nobj--) /* dann alle CICONs in ICONs <20>ndern */
|
||||
{
|
||||
if((objects->ob_type & 0xff) == G_CICON)
|
||||
objects->ob_type = (objects->ob_type & ~0xff) | G_ICON;
|
||||
objects++;
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void rs_ciconexit(long deskriptor)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user