Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
the list events handled simple switch block

The list events handled simple switch block

170 6.

Client Programming

After
catio
gun, I
shade and h

E

odifi-
ng
ook at ent,
ne.

Creating Client Events 171

That was nothing! I didn’t even break a sweat typing that, how about you? Here, the list of events is handled in a simple switch block. And as all good C programmers know, to add a new bit of code to a switch, you use the case keyword. Here, you add a case for EV_LIGHTNINGARC, which will call the new function CG_LightningArc, passing in two para-meters. The first is position, which is a vector passed into
CG_EntityEvent, representing the location of the event, in its starting place. The second parameter is es->origin2. es is a variable set at the top of CG_EntityEvent, which points to cent->currentState. So what is cent, you ask? cent is actually the other variable passed into
CG_EntityEvent, and it is of type centity_t. Let’s take a look at what that type of variable is.

The struct centity_t is declared at line 149 in cg_local.h:

qboolean currentValid; holds this entity

// true if cg.frame

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Kevin Klein

PageId: DOCCB5AE5A