Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t *P_MakeMobjBuffer (void)
- {
- int i, j;
- thinker_t *current;
- uint8_t *mobjbuf = malloc(MAX_MOBJ_BUFFER);
- current = thinkercap.next;
- i = 1;
- j = 0;
- memset(mobjbuf, 0, MAX_MOBJ_BUFFER);
- while (current != &thinkercap)
- {
- if (current->function.acp1 == (actionf_p1)P_MobjThinker && ((mobj_t*)current)->type != MT_PLAYER)
- {
- if(((mobj_t*)current)->netid == i) // The mobj for "i" is still here
- {
- mobjbuf[j] |= 1 << (i % 8);
- current = current->next;
- }
- j += (!(++i % 8));
- if(j == MAX_MOBJ_BUFFER - 1)
- I_Error("P_MakeMobjBuffer: Buffer overflow\n");
- }
- else
- current = current->next;
- }
- /*
- void *p = mobjbuf;
- for (i = 0; i < 63; i++)
- printf("%i ", ReadUInt8((uint8_t**)&p));
- printf("\n");
- */
- free(mobjbuf);
- mobjbuf = NULL;
- return mobjbuf;
- }
Advertisement
Add Comment
Please, Sign In to add comment