#include "BaseType.h"#include "Vec3d.h"#include "XForm3d.h"#include "GETypes.h"#include "ExtBox.h"#include "vfile.h"#include "Bitmap.h"#include "Path.h"#include "Motion.h"#include "Actor.h"#include "Sprite.h"Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 119 of file Genesis.h. Referenced by Bot_CheckPosition(), Bot_CheckVelocity(), Bot_ScanCheckVelocity(), CheckPlayer(), CheckVelocity(), and geWorld_LinkPolyToLeaf(). |
|
|
Definition at line 160 of file Genesis.h. Referenced by gePuppet_DrawShadow(), geSound3D_GetConfig(), Trace_GetContents(), Trace_IntersectWorldBSP(), Trace_ModelCollision(), Trace_TestModelMove(), and Trace_WorldCollisionExact2(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 124 of file Genesis.h. Referenced by Vis_MarkWaterFaces(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 100 of file Genesis.h. Referenced by RenderTexturedPoint(), and RenderTexturedPoly(). |
|
|
Definition at line 99 of file Genesis.h. Referenced by ControlExplode1Anim(), RenderTexturedPoint(), RenderTexturedPoly(), and User_RenderPolyList(). |
|
|
Definition at line 96 of file Genesis.h. Referenced by _Electric_BoltEffectRender(), Corona_Frame(), DoSplashScreen(), DrawFace(), DrawLine3d(), Electric_BoltEffectRender(), PathPoint_Frame2(), RenderTexturedPoint(), and RenderTexturedPoly(). |
|
|
Definition at line 97 of file Genesis.h. Referenced by Corona_Frame(), DoSplashScreen(), PathPoint_Frame2(), RenderTexturedPoint(), and RenderTexturedPoly(). |
|
|
Definition at line 102 of file Genesis.h. Referenced by RenderTexturedPoly(). |
|
|
Definition at line 101 of file Genesis.h. Referenced by RenderTexturedPoint(), and RenderTexturedPoly(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 79 of file Genesis.h. Referenced by Sys_EngineCreate(). |
|
|
|
|
|
|
|
|
|
|
|
Value: ( GE_CONTENTS_SOLID | \ GE_CONTENTS_EMPTY | \ GE_CONTENTS_WINDOW | \ GE_CONTENTS_WAVY) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 42 of file Genesis.h. Referenced by geEngine_GetDriverSystem(), and ModeList_Create(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 67 of file Genesis.h. Referenced by AddBoneLight(), DoSplashScreen(), and geWorld_AddLight(). |
|
|
Definition at line 72 of file Genesis.h. Referenced by Trace_GetContents(), Trace_GEWorldCollision(), and Trace_ModelCollision(). |
|
|
|
|
|
|
|
|
Definition at line 49 of file Genesis.h. Referenced by geSound_PlaySoundDef(). |
|
|
|
|
|
Definition at line 48 of file Genesis.h. Referenced by geSound_LoadSoundDef(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 614 of file Genesis.h.
00615 {
00616 NET_MSG_NONE, // No msg
00617 NET_MSG_USER, // User message
00618 NET_MSG_CREATE_CLIENT, // A new client has joined in
00619 NET_MSG_DESTROY_CLIENT, // An existing client has left
00620 NET_MSG_HOST, // We are the server now
00621 NET_MSG_SESSIONLOST, // Connection was lost
00622 NET_MSG_SERVER_ID, // Internal, for hand shaking process
00623 } geCSNetMgr_NetMsgType;
|
|
|
Definition at line 88 of file Genesis.h.
00089 {
00090 GE_TEXTURED_POLY,
00091 GE_GOURAUD_POLY,
00092 GE_TEXTURED_POINT
00093 } gePoly_Type;
|
|
||||||||||||
|
Definition at line 709 of file Camera.c. References geXForm3d::AX, geXForm3d::AY, geXForm3d::AZ, geXForm3d::BX, geXForm3d::BY, geXForm3d::BZ, geXForm3d::CX, geXForm3d::CY, geXForm3d::CZ, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, geVec3d_Inverse(), geXForm3d_Rotate(), and geXForm3d::Translation. Referenced by geSound3D_GetConfig(), geSound3D_GetConfigIgnoreObstructions(), RenderSubModels(), and RenderWorldModel().
00710 {
00711 // The rotation portion is just the transpose of the model xform
00712 CXForm->AX = WXForm->AX;
00713 CXForm->AY = WXForm->BX;
00714 CXForm->AZ = WXForm->CX;
00715
00716 CXForm->BX = WXForm->AY;
00717 CXForm->BY = WXForm->BY;
00718 CXForm->BZ = WXForm->CY;
00719
00720 CXForm->CX = WXForm->AZ;
00721 CXForm->CY = WXForm->BZ;
00722 CXForm->CZ = WXForm->CZ;
00723
00724 CXForm->Translation = WXForm->Translation;
00725
00726 geVec3d_Inverse(&CXForm->Translation);
00727
00728 // Rotate the translation in the new camera matrix
00729 geXForm3d_Rotate(CXForm, &CXForm->Translation, &CXForm->Translation);
00730
00731 return GE_TRUE;
00732 }
|
|
||||||||||||
|
Definition at line 79 of file Camera.c. References GE_RAM_ALLOCATE_STRUCT, GE_TRUE, geCamera_SetAttributes(), geErrorLog_Add, GENESISAPI, GENESISCC, NULL, geCamera::ZFar, geCamera::ZFarEnable, and geCamera::ZScale. Referenced by DoSplashScreen(), and GameMgr_SetDriverAndMode().
00080 {
00081 geCamera *Camera;
00082
00083 assert( Rect != NULL );
00084
00085 Camera = GE_RAM_ALLOCATE_STRUCT(geCamera);
00086 if (Camera == NULL)
00087 {
00088 geErrorLog_Add(-1, NULL); //FIXME
00089 return NULL;
00090 }
00091
00092 memset(Camera, 0, sizeof(geCamera));
00093
00094 Camera->ZScale = 0.5f;
00095
00096 #if 0
00097 Camera->ZFar = 1000.0f;
00098 Camera->ZFarEnable = GE_TRUE;
00099 #endif
00100
00101 geCamera_SetAttributes(Camera,Fov,Rect);
00102 return Camera;
00103 }
|
|
|
Definition at line 108 of file Camera.c. References GENESISAPI, GENESISCC, geRam_Free, and NULL. Referenced by DoSplashScreen(), GameMgr_FreeAllObjects(), and GameMgr_PrepareToChangeMode().
00109 {
00110 assert( pCamera != NULL );
00111 assert( *pCamera != NULL );
00112 geRam_Free(*pCamera);
00113 *pCamera = NULL;
00114 }
|
|
|
Definition at line 651 of file Camera.c. References GENESISAPI, GENESISCC, NULL, and geCamera::XForm. Referenced by Frustum_RotateToWorldSpace(), Frustum_TransformToWorldSpace(), geBodyInst_GetGeometry(), gePuppet_Render(), geWorld_IsActorPotentiallyVisible(), RenderBSPFrontBack_r(), RenderFace(), RenderTransPoly(), SetupSkyForScene(), SetWorldspaceClipPlane(), and World_WorldRenderQ().
00652 {
00653 assert(Camera != NULL);
00654 return &(Camera->XForm);
00655 }
|
|
||||||||||||
|
Definition at line 159 of file Camera.c. References geCamera::Bottom, GE_Rect::Bottom, GENESISAPI, GENESISCC, int32, geCamera::Left, GE_Rect::Left, NULL, geCamera::Right, GE_Rect::Right, geCamera::Top, and GE_Rect::Top. Referenced by geEngine_BeginFrame(), geEngine_DrawAlphaBitmap(), gePuppet_Render(), geWorld_IsActorPotentiallyVisible(), and RenderTexturedPoint().
|
|
||||||||||||||||
|
Definition at line 148 of file Camera.c. References GENESISAPI, GENESISCC, geCamera::ZFar, and geCamera::ZFarEnable. Referenced by Frustum_SetFromCamera(), and gePuppet_Render().
00149 {
00150 assert(Camera);
00151
00152 *Enable = Camera->ZFarEnable;
00153 *ZFar = Camera->ZFar;
00154 }
|
|
|
Definition at line 686 of file Camera.c. References GENESISCC, NULL, and geCamera::Pov. Referenced by Frustum_TransformToWorldSpace(), gePuppet_RenderThroughFrustum(), RenderBSPFrontBack_r(), RenderBSPFrontBack_r2(), RenderFace(), and World_WorldRenderQ().
00687 {
00688 assert( Camera != NULL );
00689 return &(Camera->Pov);
00690 }
|
|
|
Definition at line 673 of file Camera.c. References GENESISAPI, GENESISCC, NULL, geCamera::TransposeVisXForm, geCamera::TransposeXForm, and geCamera::UseVisPov. Referenced by geWorld_IsActorPotentiallyVisible(), and geWorld_IsSpritePotentiallyVisible().
00674 {
00675 assert(Camera != NULL);
00676
00677 if (Camera->UseVisPov)
00678 return &(Camera->TransposeVisXForm);
00679 else
00680 return &(Camera->TransposeXForm);
00681 }
|
|
|
Definition at line 642 of file Camera.c. References GENESISAPI, GENESISCC, and geCamera::TransposeXForm. Referenced by geSprite_CreateFrustumClippedScreenPoly(), geSprite_UpdateSurfaceNormalToFaceCamera(), geSprite_UpdateVertexesToFaceCamera(), RenderFace(), RenderSubModels(), RenderTexturedPoint(), RenderWorldModel(), and SetupSkyForScene().
00643 {
00644 assert(Camera );
00645 return &(Camera->TransposeXForm);
00646 }
|
|
|
Definition at line 128 of file Camera.c. References geFloat, GENESISAPI, GENESISCC, and geCamera::ZScale. Referenced by Frustum_SetFromCamera().
00129 {
00130 assert(Camera);
00131 return Camera->ZScale;
00132 }
|
|
||||||||||||||||
|
Definition at line 322 of file Camera.c. References CAMERA_MINIMUM_PROJECTION_DISTANCE, geFloat, GENESISAPI, GENESISCC, NULL, geCamera::Scale, geVec3d::X, geCamera::XCenter, geVec3d::Y, geCamera::YCenter, geVec3d::Z, Z, and geCamera::ZScale. Referenced by Frustum_ProjectRGBNoClamp(), geBodyInst_GetGeometry(), gePuppet_DrawShadow(), gePuppet_Render(), geWorld_IsActorPotentiallyVisible(), and RenderTexturedPoint().
00328 {
00329 geFloat ScaleOverZ;
00330 geFloat Z;
00331 assert( Camera != NULL );
00332 assert( PointInCameraSpace != NULL );
00333 assert( ProjectedPoint != NULL );
00334
00335 Z = -PointInCameraSpace->Z;
00336
00337 if (Z < CAMERA_MINIMUM_PROJECTION_DISTANCE)
00338 {
00339 Z = CAMERA_MINIMUM_PROJECTION_DISTANCE;
00340 }
00341
00342 ScaleOverZ = Camera->Scale / Z;
00343
00344 ProjectedPoint->Z = Z*Camera->ZScale;
00345
00346 ProjectedPoint->X = ( PointInCameraSpace->X * ScaleOverZ ) + Camera->XCenter;
00347
00348 ProjectedPoint->Y = Camera->YCenter - ( PointInCameraSpace->Y * ScaleOverZ );
00349 }
|
|
||||||||||||||||||||
|
Definition at line 285 of file Camera.c. References geFloat, GENESISAPI, GENESISCC, geVec3d_Add(), geVec3d_Copy(), geVec3d_Normalize(), geVec3d_Scale(), geXForm3d_GetIn(), geXForm3d_GetLeft(), geXForm3d_GetUp(), geCamera::Scale, geCamera::TransposeXForm, geCamera::XCenter, and geCamera::YCenter.
00291 {
00292 geVec3d In,Left,Up;
00293 geVec3d ScaledIn,ScaledLeft,ScaledUp ;
00294 geFloat XCenter ;
00295 geFloat YCenter ;
00296 geFloat Scale ;
00297 const geXForm3d *pM;
00298
00299 pM = &(Camera->TransposeXForm);
00300 XCenter = Camera->XCenter ;
00301 YCenter = Camera->YCenter ;
00302 Scale = Camera->Scale ;
00303
00304 geXForm3d_GetIn( pM, &In ) ;
00305 geXForm3d_GetLeft( pM, &Left ) ;
00306 geXForm3d_GetUp( pM, &Up ) ;
00307
00308 geVec3d_Scale(&In, Scale, &ScaledIn);
00309 geVec3d_Scale(&Left, XCenter - ((geFloat)ScreenX), &ScaledLeft );
00310 geVec3d_Scale(&Up, YCenter - ((geFloat)ScreenY), &ScaledUp );
00311
00312 geVec3d_Copy(&ScaledIn, Vector);
00313 geVec3d_Add(Vector, &ScaledLeft, Vector );
00314 geVec3d_Add(Vector, &ScaledUp, Vector );
00315 geVec3d_Normalize(Vector);
00316 }
|
|
||||||||||||||||
|
Definition at line 195 of file Camera.c. References geCamera::Bottom, GE_Rect::Bottom, geCamera::CosViewAngleX, geCamera::CosViewAngleY, geCamera::Fov, geFloat, GENESISAPI, GENESISCC, geCamera::Height, geCamera::Left, GE_Rect::Left, max, NULL, geCamera::Right, GE_Rect::Right, geCamera::Scale, geCamera::SinViewAngleX, geCamera::SinViewAngleY, geCamera::Top, GE_Rect::Top, geCamera::Width, geCamera::XCenter, geCamera::XRatio, geCamera::YCenter, and geCamera::YRatio. Referenced by geCamera_Create(), and SetupCamera().
00196 {
00197
00198 #define TOO_SMALL (0.0001f) // width and Fov must be >= TOO_SMALL
00199
00200 geFloat Width, Height;
00201 geFloat OneOverFov;
00202
00203 assert (Camera != NULL);
00204 assert (Rect != NULL);
00205 assert (! ((Fov < TOO_SMALL) && (Fov > -TOO_SMALL)));
00206
00207 Width = (geFloat)(Rect->Right - Rect->Left)+1.0f;
00208 Height = (geFloat)(Rect->Bottom - Rect->Top)+1.0f;
00209
00210 assert( Width > 0.0f );
00211 assert( Height > 0.0f );
00212
00213 Camera->Width = Width;
00214 Camera->Height = Height;
00215
00216 Camera->Fov = Fov;
00217
00218 if ((Camera->Fov < TOO_SMALL) && (Camera->Fov > -TOO_SMALL))
00219 Camera->Fov = TOO_SMALL; // Just in case
00220
00221 OneOverFov = 1.0f/Fov;
00222
00223 if (Width <=0.0f)
00224 Width = TOO_SMALL; // Just in case
00225 if (Height <=0.0f)
00226 Height = TOO_SMALL; // Just in case
00227
00228 Camera->XRatio = Width * OneOverFov;
00229 Camera->YRatio = Height * OneOverFov;
00230
00231 Camera->Scale = max(Camera->XRatio, Camera->YRatio);
00232 //Camera->YScale = Camera->XScale;
00233
00234 Camera->Left = (geFloat)Rect->Left;
00235 Camera->Right = (geFloat)Rect->Right;
00236 Camera->Top = (geFloat)Rect->Top;
00237 Camera->Bottom = (geFloat)Rect->Bottom;
00238
00239 Camera->XCenter = Camera->Left + ( Width * 0.5f ) - 0.5f;
00240 Camera->YCenter = Camera->Top + ( Height * 0.5f ) - 0.5f;
00241
00242 {
00243 geFloat Numerator = 2.0f * OneOverFov * Camera->Scale;
00244 double Angle;
00245 Angle = atan(Numerator / Camera->XRatio);
00246 Camera->CosViewAngleX = (geFloat)cos(Angle);
00247 Camera->SinViewAngleX = (geFloat)sin(Angle);
00248
00249 Angle = atan(Numerator / Camera->YRatio);
00250 Camera->CosViewAngleY = (geFloat)cos(Angle);
00251 Camera->SinViewAngleY = (geFloat)sin(Angle);
00252 }
00253 }
|
|
||||||||||||||||
|
Definition at line 137 of file Camera.c. References GENESISAPI, GENESISCC, geCamera::ZFar, and geCamera::ZFarEnable.
00138 {
00139 assert(Camera);
00140
00141 Camera->ZFarEnable = Enable;
00142 Camera->ZFar = ZFar;
00143 }
|
|
||||||||||||
|
Definition at line 618 of file Camera.c. References GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, geXForm3d_GetTranspose(), NULL, geXForm3d::Translation, geCamera::TransposeVisXForm, geCamera::UseVisPov, geCamera::VisPov, and geCamera::VisXForm.
00619 {
00620 assert(Camera != NULL);
00621
00622 if (XForm)
00623 {
00624 Camera->TransposeVisXForm = *XForm; // Make a copy of the original XForm
00625 Camera->VisPov = XForm->Translation;
00626 geXForm3d_GetTranspose(XForm, &Camera->VisXForm);
00627
00628 Camera->UseVisPov = GE_TRUE;
00629 }
00630 else
00631 {
00632 Camera->UseVisPov = GE_FALSE;
00633 }
00634
00635 return GE_TRUE;
00636 }
|
|
||||||||||||
|
Definition at line 599 of file Camera.c. References GE_TRUE, geBoolean, GENESISAPI, GENESISCC, geXForm3d_GetTranspose(), NULL, geCamera::Pov, geXForm3d::Translation, geCamera::TransposeXForm, and geCamera::XForm. Referenced by DoSplashScreen(), RenderFace(), RenderSubModels(), RenderWorldModel(), SetupCamera(), and SetupSkyForScene().
00600 {
00601 assert(Camera != NULL);
00602 assert(XForm != NULL);
00603
00604 Camera->TransposeXForm = *XForm; // Make a copy of the model XForm
00605
00606 // Convert the model transform into a camera xform...
00607 //geCamera_ConvertModelToCamera(XForm, &Camera->XForm);
00608 geXForm3d_GetTranspose(XForm, &Camera->XForm);
00609
00610 Camera->Pov = XForm->Translation;
00611
00612 return GE_TRUE;
00613 }
|
|
||||||||||||
|
Definition at line 119 of file Camera.c. References GENESISAPI, GENESISCC, and geCamera::ZScale. Referenced by GameMgr_SetDriverAndMode().
00120 {
00121 assert(Camera);
00122 Camera->ZScale = ZScale;
00123 }
|
|
||||||||||||||||
|
Definition at line 465 of file Camera.c. References GENESISAPI, GENESISCC, geXForm3d_Transform(), and geCamera::XForm. Referenced by gePuppet_DrawShadow(), gePuppet_RenderThroughFrustum(), RenderGouraudPoly(), RenderTexturedPoint(), RenderTexturedPoly(), and User_RenderPolyList().
00468 {
00469 assert( Camera );
00470 assert( WorldSpacePoint );
00471 assert( CameraSpacePoint );
00472
00473 // Would be better if xform3d_transform was assembly, or a macro, or anything
00474 geXForm3d_Transform(&(Camera->XForm),WorldSpacePoint,CameraSpacePoint);
00475 }
|
|
||||||||||||||||
|
Definition at line 531 of file Camera.c. References CAMERA_MINIMUM_PROJECTION_DISTANCE, geFloat, GENESISAPI, GENESISCC, geXForm3d_Transform(), max, geCamera::Scale, geVec3d::X, geCamera::XCenter, geCamera::XForm, geVec3d::Y, geCamera::YCenter, geVec3d::Z, Z, and geCamera::ZScale. Referenced by geCamera_TransformAndProjectArray().
00537 {
00538 geFloat Z;
00539
00540 assert( Camera );
00541 assert( Point );
00542 assert( ProjectedPoint );
00543
00544 geXForm3d_Transform(&(Camera->XForm),Point,ProjectedPoint);
00545
00546 Z = - ProjectedPoint->Z;
00547
00548 Z = max(Z,CAMERA_MINIMUM_PROJECTION_DISTANCE);
00549
00550 ProjectedPoint->Z = Z*Camera->ZScale;
00551
00552 Z = Camera->Scale / Z;
00553
00554 ProjectedPoint->X = ( ProjectedPoint->X * Z ) + Camera->XCenter;
00555 ProjectedPoint->Y = - ( ProjectedPoint->Y * Z ) + Camera->YCenter;
00556 }
|
|
||||||||||||||||||||
|
Definition at line 498 of file Camera.c. References count, geCamera_TransformAndProject(), GENESISAPI, and GENESISCC.
00502 {
00503 assert( Camera );
00504 assert( WorldSpacePointPtr );
00505 assert( ProjectedSpacePointPtr );
00506 while(count--)
00507 {
00508 geCamera_TransformAndProject(Camera,WorldSpacePointPtr++,ProjectedSpacePointPtr++);
00509 }
00510 }
|
|
||||||||||||||||
|
Definition at line 562 of file Camera.c. References GE_TLVertex::a, GE_TLVertex::b, CAMERA_MINIMUM_PROJECTION_DISTANCE, GE_TLVertex::g, geFloat, GENESISAPI, GENESISCC, geXForm3d_Transform(), max, GE_TLVertex::r, geCamera::Scale, GE_TLVertex::u, GE_TLVertex::v, GE_TLVertex::x, geCamera::XCenter, geCamera::XForm, GE_TLVertex::y, geCamera::YCenter, GE_TLVertex::z, Z, and geCamera::ZScale. Referenced by geCamera_TransformAndProjectLArray().
00568 {
00569 geFloat ScaleOverZ;
00570 geFloat Z;
00571
00572 assert( Camera );
00573 assert( Point );
00574 assert( ProjectedPoint );
00575
00576 geXForm3d_Transform(&(Camera->XForm),(geVec3d *)Point,(geVec3d *)ProjectedPoint);
00577
00578 Z = - ProjectedPoint->z;
00579
00580 Z = max(Z,CAMERA_MINIMUM_PROJECTION_DISTANCE);
00581
00582 ScaleOverZ = Camera->Scale / Z;
00583
00584 ProjectedPoint->z = Z*Camera->ZScale;
00585 ProjectedPoint->x = ( ProjectedPoint->x * ScaleOverZ ) + Camera->XCenter;
00586 ProjectedPoint->y = - ( ProjectedPoint->y * ScaleOverZ ) + Camera->YCenter;
00587
00588 ProjectedPoint->u = Point->u;
00589 ProjectedPoint->v = Point->v;
00590 ProjectedPoint->r = Point->r;
00591 ProjectedPoint->g = Point->g;
00592 ProjectedPoint->b = Point->b;
00593 ProjectedPoint->a = Point->a;
00594 }
|
|
||||||||||||||||||||
|
Definition at line 515 of file Camera.c. References count, geCamera_TransformAndProjectL(), GENESISAPI, and GENESISCC.
00518 {
00519 assert( Camera );
00520 assert( WorldSpacePointPtr );
00521 assert( ProjectedSpacePointPtr );
00522 while(count--)
00523 {
00524 geCamera_TransformAndProjectL(Camera,WorldSpacePointPtr++,ProjectedSpacePointPtr++);
00525 }
00526 }
|
|
||||||||||||||||||||
|
Definition at line 481 of file Camera.c. References count, GENESISAPI, GENESISCC, geXForm3d_Transform(), and geCamera::XForm. Referenced by geSprite_CreateFrustumClippedScreenPoly().
00484 {
00485 assert( Camera );
00486 assert( WorldSpacePointPtr );
00487 assert( CameraSpacePointPtr );
00488 // use transformarray!!
00489 while(count--)
00490 {
00491 geXForm3d_Transform(&(Camera->XForm),WorldSpacePointPtr++,CameraSpacePointPtr++);
00492 }
00493 }
|
|
|
Definition at line 82 of file CSNetMgr.c. References GE_RAM_ALLOCATE_STRUCT, geErrorLog_Add, GENESISAPI, GENESISCC, NULL, and geCSNetMgr::Valid. Referenced by NetMgr_Create().
00083 {
00084 geCSNetMgr *M;
00085
00086 M = GE_RAM_ALLOCATE_STRUCT(geCSNetMgr);
00087
00088 if ( M == NULL)
00089 {
00090 geErrorLog_Add(-1, NULL); //FIXME
00091 return NULL;
00092 }
00093
00094 M->Valid = M;
00095
00096 return M;
00097 }
|
|
|
Definition at line 100 of file CSNetMgr.c. References GE_FALSE, geCSNetMgr_IsValid(), GENESISAPI, GENESISCC, geRam_Free, and NULL. Referenced by NetMgr_FreeAllObjects().
00101 {
00102 assert( ppM != NULL );
00103 assert( geCSNetMgr_IsValid(*ppM)!=GE_FALSE );
00104
00105 (*ppM) -> Valid = 0;
00106 geRam_Free(*ppM);
00107 *ppM = NULL;
00108 };
|
|
|
Definition at line 423 of file CSNetMgr.c. References GE_FALSE, geCSNetMgr_IsValid(), geCSNetMgr_NetID, GENESISAPI, and GENESISCC.
00424 {
00425 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00426 return(DPID_ALLPLAYERS);
00427 }
|
|
|
Definition at line 414 of file CSNetMgr.c. References GE_FALSE, geCSNetMgr_IsValid(), geCSNetMgr_NetID, GENESISAPI, GENESISCC, and OurPlayerId. Referenced by NetMgr_GetOurID().
00415 {
00416 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00417 return(OurPlayerId);
00418 }
|
|
|
Definition at line 405 of file CSNetMgr.c. References GE_FALSE, geCSNetMgr_IsValid(), geCSNetMgr_NetID, GENESISAPI, GENESISCC, and ServerId.
00406 {
00407 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00408 return(ServerId);
00409 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 342 of file CSNetMgr.c. References BUFFER_SIZE, DWORD, gClient, GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), geCSNetMgr_ProcessSystemMessage(), GENESISAPI, GENESISCC, NET_MSG_NONE, NetPlayReceive(), NetSession, NULL, Packet, PACKET_HEADER_SIZE, ServerId, and uint8.
00343 {
00344 DWORD BSize = BUFFER_SIZE;
00345 HRESULT Result;
00346
00347 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00348
00349 *Size = 0;
00350 *Data = NULL;
00351 *Type = NET_MSG_NONE;
00352
00353 if (!NetSession)
00354 return GE_FALSE;
00355
00356 *IdFrom = 0;
00357 *IdTo = 0;
00358 //*IdTo = ServerId;
00359
00360 Result = NetPlayReceive((DPID*)IdFrom, (DPID*)IdTo, DPRECEIVE_ALL, &Packet, &BSize);
00361 //Result = NetPlayReceive((DPID*)IdFrom, (DPID*)IdTo, DPRECEIVE_TOPLAYER, &Packet, &BSize);
00362
00363 if (*IdTo != ServerId)
00364 return GE_TRUE;
00365
00366 if (Result != DP_OK)
00367 {
00368 if (Result == DPERR_NOMESSAGES)
00369 return GE_TRUE; // Not an error, there is simply no msg's. (*Size will == 0, so they will know)
00370
00371 return GE_FALSE;
00372 }
00373
00374 if (BSize > 0)
00375 {
00376 if (*IdFrom == DPID_SYSMSG)
00377 {
00378 // IdTo used to be DPID_ALLPLAYERS...
00379 // Had to change to IdTo so it would work correctly.
00380 if (!geCSNetMgr_ProcessSystemMessage(M, *IdTo, (LPDPMSG_GENERIC)&Packet, Type, &gClient))
00381 return GE_FALSE;
00382
00383 if (*Type != NET_MSG_NONE)
00384 {
00385 *Size = sizeof( geCSNetMgr_NetClient );
00386 *Data = (uint8*)&gClient;
00387 }
00388 }
00389 else
00390 {
00391 *Type = Packet[0];
00392 *Size = BSize - PACKET_HEADER_SIZE;
00393 *Data = (uint8*)&Packet[1];
00394 return GE_TRUE;
00395 }
00396 }
00397
00398 return GE_TRUE;
00399 }
|
|
||||||||||||||||||||||||
|
Definition at line 174 of file CSNetMgr.c. References BUFFER_SIZE, DWORD, gClient, GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), geCSNetMgr_ReceiveSystemMessage(), GENESISAPI, GENESISCC, NET_MSG_NONE, NetPlayReceive(), NetSession, NULL, Packet, PACKET_HEADER_SIZE, ServerId, and uint8. Referenced by NetMgr_ReceiveClientMessage().
00175 {
00176 DPID IdTo;
00177 DWORD BSize = BUFFER_SIZE;
00178 HRESULT Result;
00179
00180 *Size = 0;
00181 *Data = NULL;
00182 *Type = NET_MSG_NONE;
00183
00184 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00185
00186 if (!NetSession)
00187 return GE_FALSE;
00188
00189 // Empty out all the system msg's first
00190 if (!geCSNetMgr_ReceiveSystemMessage(M, ServerId, Type, &gClient))
00191 return GE_FALSE;
00192
00193 if (*Type != NET_MSG_NONE)
00194 {
00195 *Size = sizeof( geCSNetMgr_NetClient );
00196 *Data = (uint8*)&gClient;
00197 return( GE_TRUE );
00198 }
00199
00200 // Find the client player
00201 IdTo = ServerId;
00202
00203 Result = NetPlayReceive((DPID*)IdClient, &IdTo, DPRECEIVE_TOPLAYER, (uint8*)&Packet, &BSize);
00204
00205 if (Result != DP_OK)
00206 {
00207 if (Result == DPERR_NOMESSAGES)
00208 return GE_TRUE; // Not an error, there is simply no msg's. (*Size will == 0, so they will know)
00209
00210 return GE_FALSE;
00211 }
00212
00213 if (BSize > 0)
00214 {
00215 *Type = Packet[0];
00216 *Size = BSize - PACKET_HEADER_SIZE;
00217 *Data = (uint8*)&Packet[1];
00218 }
00219
00220 return GE_TRUE;
00221 }
|
|
||||||||||||||||||||
|
Definition at line 113 of file CSNetMgr.c. References BUFFER_SIZE, DWORD, gClient, GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), geCSNetMgr_ReceiveSystemMessage(), geErrorLog_AddString, GENESISAPI, GENESISCC, NET_MSG_NONE, NetPlayReceive(), NetSession, NULL, OurPlayerId, Packet, PACKET_HEADER_SIZE, ServerId, and uint8. Referenced by NetMgr_ReceiveServerMessage().
00114 {
00115 DPID IdTo;
00116 DWORD BSize = BUFFER_SIZE;
00117 HRESULT Result;
00118
00119 *Size = 0;
00120 *Data = NULL;
00121 *Type = NET_MSG_NONE;
00122
00123 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00124
00125 if (!NetSession)
00126 {
00127 geErrorLog_AddString(-1, "geCSNetMgr_ReceiveFromServer: No net session.\n", NULL);
00128 return GE_FALSE;
00129 }
00130
00131 #if 1
00132 // Empty out all the system msg's first
00133 if (!geCSNetMgr_ReceiveSystemMessage(M, OurPlayerId, Type, &gClient))
00134 {
00135 geErrorLog_AddString(-1, "geCSNetMgr_ReceiveFromServer: geCSNetMgr_ReceiveSystemMessage failed.\n", NULL);
00136 return GE_FALSE;
00137 }
00138
00139 if (*Type != NET_MSG_NONE)
00140 {
00141 *Size = sizeof( geCSNetMgr_NetClient );
00142 *Data = (uint8*)&gClient;
00143 return( GE_TRUE );
00144 }
00145 #endif
00146
00147 // Find the server player
00148 IdTo = 0;
00149
00150 Result = NetPlayReceive(&ServerId, &IdTo, DPRECEIVE_FROMPLAYER, (uint8*)&Packet, &BSize);
00151
00152 if (Result != DP_OK)
00153 {
00154 if (Result == DPERR_NOMESSAGES)
00155 return GE_TRUE; // Not an error, there is simply no msg's. (*Size will == 0, so they will know)
00156
00157 geErrorLog_AddString(-1, "geCSNetMgr_ReceiveFromServer: NetPlayReceive failed.\n", NULL);
00158 return GE_FALSE;
00159 }
00160
00161 if (BSize > 0)
00162 {
00163 *Type = Packet[0];
00164 *Size = BSize - PACKET_HEADER_SIZE;
00165 *Data = (uint8*)&Packet[1];
00166 }
00167
00168 return GE_TRUE;
00169 }
|
|
||||||||||||||||||||
|
Definition at line 226 of file CSNetMgr.c. References BUFFER_SIZE, DWORD, GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), geCSNetMgr_ProcessSystemMessage(), GENESISAPI, GENESISCC, NET_MSG_NONE, NetPlayReceive(), NetSession, and Packet. Referenced by geCSNetMgr_ReceiveFromClient(), and geCSNetMgr_ReceiveFromServer().
00227 {
00228 DPID SystemId, IdTo;
00229 DWORD BSize = BUFFER_SIZE;
00230 HRESULT Result;
00231
00232 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00233
00234 *Type = NET_MSG_NONE;
00235
00236 if (!NetSession)
00237 return GE_FALSE;
00238
00239 // Find system messages
00240 SystemId = DPID_SYSMSG;
00241 IdTo = IdFor;
00242
00243 Result = NetPlayReceive(&SystemId,&IdTo, DPRECEIVE_FROMPLAYER | DPRECEIVE_TOPLAYER, &Packet, &BSize);
00244
00245 if (Result != DP_OK)
00246 {
00247 if (Result == DPERR_NOMESSAGES)
00248 return GE_TRUE; // Not an error, there is simply no msg's. (*Size will == 0, so they will know)
00249
00250 return GE_FALSE;
00251 }
00252
00253 if (BSize > 0)
00254 {
00255 if (!geCSNetMgr_ProcessSystemMessage(M, IdFor, (LPDPMSG_GENERIC)&Packet, Type, Client))
00256 return GE_FALSE;
00257 }
00258
00259 return GE_TRUE;
00260 }
|
|
||||||||||||||||||||||||
|
Referenced by NetMgr_SendClientMessage(). |
|
||||||||||||||||||||
|
Referenced by NetMgr_SendServerMessage(). |
|
||||||||||||||||
|
Definition at line 441 of file CSNetMgr.c. References GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), geErrorLog_AddString, GENESISAPI, GENESISCC, InitNetPlay(), MAX_CLIENT_NAME, NetPlayCreatePlayer(), NetPlayCreateSession(), NetSession, NULL, OurPlayerId, ServerId, and WeAreTheServer. Referenced by NetMgr_StartSession().
00442 {
00443 char Name2[MAX_CLIENT_NAME];
00444
00445 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00446 assert(PlayerName);
00447
00448 NetSession = GE_FALSE;
00449 WeAreTheServer = GE_FALSE;
00450
00451 if (!InitNetPlay((LPGUID)&GENESIS_GUID))
00452 return GE_FALSE;
00453
00454 if (!NetPlayCreateSession((char*)SessionName, 16))
00455 return GE_FALSE;
00456
00457 if (!NetPlayCreatePlayer(&ServerId, "Server", NULL, NULL, 0, GE_TRUE))
00458 {
00459 geErrorLog_AddString(-1, "geCSNetMgr_StartSession: NetPlayCreatePlayer failed for server player.\n", NULL);
00460 return GE_FALSE;
00461 }
00462
00463 strncpy(Name2, PlayerName, MAX_CLIENT_NAME);
00464
00465 if (!NetPlayCreatePlayer(&OurPlayerId, Name2, NULL, NULL, 0, GE_FALSE))
00466 {
00467 geErrorLog_AddString(-1, "geCSNetMgr_StartSession: NetPlayCreatePlayer failed for client player.\n", NULL);
00468 return GE_FALSE;
00469 }
00470
00471 WeAreTheServer = GE_TRUE;
00472 NetSession = GE_TRUE;
00473
00474 return GE_TRUE;
00475 }
|
|
|
Definition at line 568 of file CSNetMgr.c. References DeInitNetPlay(), GE_FALSE, GE_TRUE, geBoolean, geCSNetMgr_IsValid(), GENESISAPI, GENESISCC, NetPlayDestroyPlayer(), NetSession, OurPlayerId, ServerId, and WeAreTheServer. Referenced by NetMgr_FreeAllObjects().
00569 {
00570 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00571
00572 if (NetSession)
00573 {
00574 NetSession = GE_FALSE;
00575
00576 if (WeAreTheServer) // If we are the server, then free the server player
00577 {
00578 if (!NetPlayDestroyPlayer(ServerId))
00579 return GE_FALSE;
00580 }
00581
00582 if (!NetPlayDestroyPlayer(OurPlayerId))
00583 return GE_FALSE;
00584
00585 if (!DeInitNetPlay())
00586 {
00587 //AFX_CPrintf("AFX_DestroyNetSession: There was a problem while De-Intializing NetPlay.\n");
00588 return GE_FALSE;
00589 }
00590
00591 }
00592
00593 WeAreTheServer = GE_FALSE;
00594 return GE_TRUE;
00595 }
|
|
|
Definition at line 432 of file CSNetMgr.c. References GE_FALSE, geBoolean, geCSNetMgr_IsValid(), GENESISAPI, GENESISCC, and WeAreTheServer.
00433 {
00434 assert( geCSNetMgr_IsValid(M)!=GE_FALSE );
00435 return (WeAreTheServer);
00436 }
|
|
||||||||||||
|
Definition at line 130 of file System.c. References GE_TRUE, geBoolean, GENESISAPI, and geDriver::Name. Referenced by ModeList_Create().
|
|
||||||||||||
|
Definition at line 107 of file System.c. References GENESISAPI, geDriver::Modes, NULL, and geDriver::NumModes. Referenced by ModeList_Create().
00108 {
00109 geDriver_Mode *Last;
00110
00111 Last = &Driver->Modes[Driver->NumModes-1];
00112
00113 if (Start) // If there is a start, return the next one
00114 Start++;
00115 else
00116 Start = Driver->Modes; // Else, return the first
00117
00118 if (Start > Last) // No more Modes left
00119 return NULL;
00120
00121 // This must be true...
00122 assert(Start >= Driver->Modes && Start <= Last);
00123
00124 return Start;
00125 }
|
|
||||||||||||
|
Definition at line 143 of file System.c. References GE_TRUE, geBoolean, GENESISAPI, and geDriver_Mode::Name. Referenced by ModeList_Create().
|
|
||||||||||||||||
|
Definition at line 156 of file System.c. References GE_TRUE, geBoolean, GENESISAPI, geDriver_Mode::Height, and geDriver_Mode::Width. Referenced by DoSplashScreen(), and ModeList_Create().
|
|
||||||||||||
|
Definition at line 76 of file System.c. References GENESISAPI, NULL, Sys_DriverInfo::NumSubDrivers, and Sys_DriverInfo::SubDrivers. Referenced by ModeList_Create().
00077 {
00078 Sys_DriverInfo *DriverInfo;
00079 geDriver *Last;
00080
00081 assert(DriverSystem != NULL);
00082
00083 DriverInfo = (Sys_DriverInfo*)DriverSystem;
00084
00085 if (!DriverInfo->NumSubDrivers)
00086 return NULL;
00087
00088 Last = &DriverInfo->SubDrivers[DriverInfo->NumSubDrivers-1];
00089
00090 if (Start) // If they have a driver, return the next one
00091 Start++;
00092 else
00093 Start = DriverInfo->SubDrivers; // Else, return the first one...
00094
00095 if (Start > Last) // No more drivers left
00096 return NULL;
00097
00098 // This must be true!!!
00099 assert(Start >= DriverInfo->SubDrivers && Start <= Last);
00100
00101 return Start; // This is it...
00102 }
|
|
||||||||||||
|
Definition at line 576 of file engine.c. References Sys_DriverInfo::Active, bActive, geEngine::DriverInfo, Engine, GE_TRUE, geBoolean, GENESISAPI, Sys_DriverInfo::RDriver, and DRV_Driver::SetActive. Referenced by WndProc().
00577 {
00578 DRV_Driver *RDriver;
00579
00580 assert(Engine);
00581
00582 RDriver =Engine->DriverInfo.RDriver;
00583
00584 if(Engine->DriverInfo.Active && RDriver)
00585 {
00586 // <> this can sometimes be a pain for debugging
00587 #if 1
00588 if ( RDriver->SetActive )
00589 return RDriver->SetActive(bActive);
00590 #endif
00591 }
00592
00593 return GE_TRUE;
00594 }
|
|
||||||||||||
|
Definition at line 225 of file engine.c. References geEngine::AttachedBitmaps, BitmapList_Add(), geEngine::Changed, Engine, geEngine::FrameState, FrameState_None, GE_FALSE, GE_TRUE, geBitmap_SetDriverFlags(), geBoolean, geErrorLog_AddString, GENESISAPI, NULL, and RDRIVER_PF_2D. Referenced by Client_CreateStatusBar(), geEngine_InitFonts(), geFont_AddBitmapBuffer(), geFont_AddCharacters(), GMenu_Create(), SetupConsole(), and Text_Create().
00226 {
00227 assert(Engine);
00228 assert(Bitmap);
00229 assert(Engine->AttachedBitmaps);
00230
00231 assert(Engine->FrameState == FrameState_None);
00232
00233 if (!Engine->AttachedBitmaps)
00234 {
00235 geErrorLog_AddString(-1, "geEngine_AddBitmap: AttachedBitmaps is NULL.", NULL);
00236 return GE_FALSE;
00237 }
00238
00239 geBitmap_SetDriverFlags(Bitmap,RDRIVER_PF_2D);
00240
00241 // Add bitmap to the lit of bitmaps attached to the engine
00242 if ( BitmapList_Add(Engine->AttachedBitmaps, (geBitmap *)Bitmap) )
00243 {
00244 Engine->Changed = GE_TRUE;
00245
00246 #ifdef DO_ADDREMOVE_MESSAGES
00247 {
00248 char str[100];
00249 sprintf(str,"Engine_AddBitmap : %08X : new\n",Bitmap);
00250 OutputDebugString(str);
00251 }
00252 #endif
00253 }
00254 else
00255 {
00256 #ifdef DO_ADDREMOVE_MESSAGES
00257 {
00258 char str[100];
00259 sprintf(str,"Engine_AddBitmap : %08X : old\n",Bitmap);
00260 OutputDebugString(str);
00261 }
00262 #endif
00263 }
00264
00265 return GE_TRUE;
00266 }
|
|
||||||||||||
|
Definition at line 812 of file engine.c. References geWorld::Changed, geEngine::Changed, Engine, ENGINE_MAX_WORLDS, GE_FALSE, GE_TRUE, geBoolean, geEngine_RebuildFastWorldList(), geErrorLog_AddString, GENESISAPI, geWorld_CreateRef(), int32, NULL, geEngine_WorldList::RefCount, geEngine_WorldList::World, and geEngine::WorldList. Referenced by DoSplashScreen(), and GameMgr_SetWorld().
00813 {
00814 int32 i;
00815 geEngine_WorldList *pWorldList;
00816
00817 assert(Engine);
00818 assert(World);
00819
00820 // Try to find it in the list first
00821 pWorldList = Engine->WorldList;
00822 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00823 {
00824 if (pWorldList->World == World) // World is allready in list
00825 {
00826 assert(pWorldList->RefCount > 0); // There should allready be a ref count!!!
00827 pWorldList->RefCount++;
00828
00829 #ifdef DO_ADDREMOVE_MESSAGES
00830 {
00831 char str[100];
00832 sprintf(str,"Engine_AddWorld : %08X : old\n",World);
00833 OutputDebugString(str);
00834 }
00835 #endif
00836
00837 return GE_TRUE;
00838 }
00839
00840 }
00841
00842 #ifdef DO_ADDREMOVE_MESSAGES
00843 {
00844 char str[100];
00845 sprintf(str,"Engine_AddWorld : %08X : new\n",World);
00846 OutputDebugString(str);
00847 }
00848 #endif
00849
00850 // Not found, add a new one
00851 pWorldList = Engine->WorldList;
00852 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00853 {
00854 if (!pWorldList->RefCount)
00855 break;
00856 }
00857
00858 if (i == ENGINE_MAX_WORLDS)
00859 {
00860 geErrorLog_AddString(-1, "geEngine_AddWorld: Out of slots.", NULL);
00861 return GE_FALSE;
00862 }
00863
00864 // Save the info for the first time
00865 pWorldList->World = World;
00866 pWorldList->RefCount = 1;
00867
00868 // Re-build the fast list of worlds
00869 geEngine_RebuildFastWorldList(Engine);
00870 Engine->Changed = GE_TRUE;
00871 World->Changed = GE_TRUE;
00872
00873 if (!geWorld_CreateRef(World))
00874 {
00875 geErrorLog_AddString(-1, "geEngine_AddWorld: geWorld_CreateRef failed...", NULL);
00876 return GE_FALSE;
00877 }
00878
00879 return GE_TRUE;
00880 }
|
|
||||||||||||||||
|
Definition at line 1737 of file engine.c. References Sys_DriverInfo::Active, DRV_Driver::BeginScene, GE_Rect::Bottom, tagRECT::bottom, geEngine::CurrentTic, geEngine::DebugInfo, geEngine::DriverInfo, Engine, FALSE, geEngine::FrameState, FrameState_Begin, FrameState_None, GE_ERR_DRIVER_BEGIN_SCENE_FAILED, GE_ERR_DRIVER_NOT_INITIALIZED, GE_FALSE, GE_TRUE, geBoolean, geCamera_GetClippingRect(), geEngine_Prep(), geErrorLog_Add, GENESISAPI, GE_Rect::Left, tagRECT::left, NULL, Sys_DriverInfo::RDriver, GE_Rect::Right, tagRECT::right, GE_Rect::Top, tagRECT::top, and TRUE. Referenced by DoSplashScreen(), and GameMgr_BeginFrame().
01738 {
01739 RECT DrvRect, *pDrvRect;
01740 geRect gDrvRect;
01741
01742 assert(Engine != NULL);
01743
01744 assert(Engine->FrameState == FrameState_None);
01745
01746 Engine->FrameState = FrameState_Begin;
01747
01748 // Make sure the driver is avtive
01749 if (!Engine->DriverInfo.Active)
01750 {
01751 geErrorLog_Add(GE_ERR_DRIVER_NOT_INITIALIZED, NULL);
01752 return GE_FALSE;
01753 }
01754
01755 assert(Engine->DriverInfo.RDriver != NULL);
01756
01757 // Make sure we have everything finalized with this world so the engine can render it
01758 if (!geEngine_Prep(Engine))
01759 return FALSE;
01760
01761 // Do some timing stuff
01762 QueryPerformanceCounter(&Engine->CurrentTic);
01763
01764 // Clear some debug info
01765 memset(&Engine->DebugInfo, 0, sizeof(Engine->DebugInfo));
01766
01767 if(Camera)
01768 {
01769 geCamera_GetClippingRect(Camera, &gDrvRect);
01770
01771 DrvRect.left =gDrvRect.Left;
01772 DrvRect.top =gDrvRect.Top;
01773 DrvRect.right =gDrvRect.Right;
01774 DrvRect.bottom =gDrvRect.Bottom;
01775
01776 pDrvRect = &DrvRect;
01777 }
01778 else
01779 pDrvRect = NULL;
01780
01781 if (!Engine->DriverInfo.RDriver->BeginScene( ClearScreen , TRUE, pDrvRect))
01782 {
01783 geErrorLog_Add(GE_ERR_DRIVER_BEGIN_SCENE_FAILED, NULL);
01784 return GE_FALSE;
01785 }
01786
01787 return GE_TRUE;
01788 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 324 of file engine.c. References GE_RGBA::a, GE_TLVertex::a, GE_RGBA::b, GE_TLVertex::b, GE_Rect::Bottom, CHeight, CWidth, DRV_RENDER_ALPHA, DRV_RENDER_CLAMP_UV, DRV_RENDER_FLUSH, DRV_RENDER_NO_ZMASK, DRV_RENDER_NO_ZWRITE, Engine, GE_RGBA::g, GE_TLVertex::g, GE_FALSE, GE_TRUE, geBitmap_GetInfo(), geBoolean, geCamera_GetClippingRect(), geEngine_RenderPoly(), geErrorLog_AddString, geFloat, GENESISAPI, GENESISCC, geBitmap_Info::Height, int32, GE_Rect::Left, NULL, GE_RGBA::r, GE_TLVertex::r, GE_Rect::Right, GE_Rect::Top, GE_TLVertex::u, GE_TLVertex::v, geBitmap_Info::Width, geVec3d::X, GE_TLVertex::x, geVec3d::Y, GE_TLVertex::y, and GE_TLVertex::z.
00334 {
00335 // set up variables
00336 GE_TLVertex vertex[4];
00337 geFloat fUVAdd = 0.0f;
00338 geFloat fWidthBmp = 0;
00339 geFloat fHeightBmp = 0;
00340 GE_Rect ClipRect = {0,0,0,0};
00341 GE_Rect UseRect = {0,0,0,0};
00342 geVec3d DefaultUVArray[4] = {{0,0,0},{1,0,0},{1,1,0},{0,1,0}};
00343 GE_RGBA DefaultRGBA_Array[4] =
00344 {{255,255,255,Alpha},
00345 {255,255,255,Alpha},
00346 {255,255,255,Alpha},
00347 {255,255,255,Alpha}};
00348 geBitmap_Info TempInfo, TempInfo2;
00349 geFloat UVbreak = 0.0f;
00350
00351 if(pBitmap)
00352 geBitmap_GetInfo(pBitmap, &TempInfo, &TempInfo2);
00353 else
00354 TempInfo.Height = TempInfo.Width = 8;
00355
00356 fWidthBmp = (geFloat)TempInfo.Width;
00357 fHeightBmp = (geFloat)TempInfo.Height;
00358
00359 //
00360 // Clip 2d viewport
00361 //
00362
00363 #if 0
00364 // eaa3 01/14/2001 Right now, you have to pass the camera in.
00365 // ..I'll fix it eventually...
00366 if(!ClipCamera )
00367 {
00368 ClipRect.Top = 0;
00369 ClipRect.Left = 0;
00370 ClipRect.Bottom = CHeight-1;
00371 ClipRect.Right = CWidth-1;
00372 }
00373 else
00374 #endif
00375 geCamera_GetClippingRect( ClipCamera, &ClipRect );
00376
00377 if(!VertUVArray)
00378 VertUVArray = &DefaultUVArray[0];
00379 if(!RGBA_Array)
00380 RGBA_Array = &DefaultRGBA_Array[0];
00381 if(PixelRect)
00382 {
00383 UseRect.Top = PixelRect->Top + ClipRect.Top;
00384 UseRect.Left = PixelRect->Left + ClipRect.Left;
00385 UseRect.Bottom = PixelRect->Bottom + ClipRect.Top;
00386 UseRect.Right = PixelRect->Right + ClipRect.Left;
00387 }
00388 else
00389 {
00390 if(PercentRect)
00391 {
00392 UseRect.Top = ClipRect.Top
00393 + (int32)(0.01f * PercentRect->Top
00394 * (ClipRect.Bottom - ClipRect.Top));
00395 UseRect.Left = ClipRect.Left
00396 + (int32)(0.01f * PercentRect->Left
00397 * (ClipRect.Right - ClipRect.Left));
00398 UseRect.Bottom = ClipRect.Bottom
00399 + (int32)(0.01f * PercentRect->Bottom
00400 * (ClipRect.Bottom - ClipRect.Top));
00401 UseRect.Right = ClipRect.Right
00402 + (int32)(0.01f * PercentRect->Right
00403 * (ClipRect.Right - ClipRect.Left));
00404 }
00405 else
00406 {
00407 UseRect = ClipRect;
00408 }
00409 }
00410
00411 vertex[0].x = (geFloat)UseRect.Left;
00412 vertex[0].y = (geFloat)UseRect.Top;
00413 vertex[0].z = 1.0f;
00414 vertex[0].r = RGBA_Array[0].r;
00415 vertex[0].g = RGBA_Array[0].g;
00416 vertex[0].b = RGBA_Array[0].b;
00417 vertex[0].a = RGBA_Array[0].a;
00418 vertex[0].u = VertUVArray[0].X + UVbreak/fWidthBmp;
00419 vertex[0].v = VertUVArray[0].Y + UVbreak/fHeightBmp;
00420
00421 vertex[1].x = (geFloat)UseRect.Right;
00422 vertex[1].y = (geFloat)UseRect.Top;
00423 vertex[1].z = vertex[0].z;
00424 vertex[1].r = RGBA_Array[1].r;
00425 vertex[1].g = RGBA_Array[1].g;
00426 vertex[1].b = RGBA_Array[1].b;
00427 vertex[1].a = RGBA_Array[1].a;
00428 vertex[1].u = VertUVArray[1].X - UVbreak/fWidthBmp;
00429 vertex[1].v = VertUVArray[1].Y + UVbreak/fHeightBmp;
00430
00431 vertex[2].x = (geFloat)UseRect.Right;
00432 vertex[2].y = (geFloat)UseRect.Bottom;
00433 vertex[2].z = vertex[0].z;
00434 vertex[2].r = RGBA_Array[2].r;
00435 vertex[2].g = RGBA_Array[2].g;
00436 vertex[2].b = RGBA_Array[2].b;
00437 vertex[2].a = RGBA_Array[2].a;
00438 vertex[2].u = VertUVArray[2].X - UVbreak/fWidthBmp;
00439 vertex[2].v = VertUVArray[2].Y - UVbreak/fHeightBmp;
00440
00441 vertex[3].x = (geFloat)UseRect.Left;
00442 vertex[3].y = (geFloat)UseRect.Bottom;
00443 vertex[3].z = vertex[0].z;
00444 vertex[3].r = RGBA_Array[3].r;
00445 vertex[3].g = RGBA_Array[3].g;
00446 vertex[3].b = RGBA_Array[3].b;
00447 vertex[3].a = RGBA_Array[3].a;
00448 vertex[3].u = VertUVArray[3].X + UVbreak/fWidthBmp;
00449 vertex[3].v = VertUVArray[3].Y - UVbreak/fHeightBmp;
00450
00451 if(vertex[0].x < ClipRect.Left )
00452 {
00453 if(vertex[1].x <= ClipRect.Left )
00454 {
00455 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00456 NULL);
00457 return GE_FALSE;
00458 }
00459 fUVAdd = ( ClipRect.Left - vertex[0].x ) / fWidthBmp;
00460 fWidthBmp -= ( ClipRect.Left - vertex[0].x );
00461 vertex[0].u += fUVAdd;
00462 vertex[3].u = vertex[0].u;
00463 vertex[0].x = (geFloat)ClipRect.Left;
00464 vertex[3].x = vertex[0].x;
00465 }
00466
00467 if( vertex[0].y < ClipRect.Top )
00468 {
00469 if( vertex[2].y <= ClipRect.Top )
00470 {
00471 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00472 NULL);
00473 return GE_FALSE;
00474 }
00475 fUVAdd = ( ClipRect.Top - vertex[0].y ) / fHeightBmp;
00476 fHeightBmp -= ( ClipRect.Top - vertex[0].y );
00477 vertex[0].v += fUVAdd;
00478 vertex[1].v = vertex[0].v;
00479 vertex[0].y = (geFloat)ClipRect.Top;
00480 vertex[1].y = vertex[0].y;
00481 }
00482
00483 if(vertex[1].x > ClipRect.Right )
00484 {
00485 if( vertex[0].x >= ClipRect.Right )
00486 {
00487 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00488 NULL);
00489 return GE_FALSE;
00490 }
00491 fUVAdd = ( vertex[1].x - ClipRect.Right ) / fWidthBmp;
00492 vertex[1].u -= fUVAdd;
00493 vertex[2].u = vertex[1].u;
00494 vertex[1].x = (geFloat)ClipRect.Right - 1;
00495 vertex[2].x = vertex[1].x;
00496 }
00497
00498 if( vertex[2].y > ClipRect.Bottom )
00499 {
00500 if( vertex[0].y >= ClipRect.Bottom )
00501 {
00502 geErrorLog_AddString(-1, "Clipping Rect has negative dimension",
00503 NULL);
00504 return GE_FALSE;
00505 }
00506 fUVAdd = ( vertex[2].y - ClipRect.Bottom ) / fHeightBmp;
00507 vertex[2].v -= fUVAdd;
00508 vertex[3].v = vertex[2].v;
00509 vertex[2].y = (geFloat)ClipRect.Bottom - 1;
00510 vertex[3].y = vertex[2].y;
00511 }
00512
00513 geEngine_RenderPoly( Engine,
00514 vertex,
00515 4,
00516 pBitmap,
00517 ( Alpha != 255 ? DRV_RENDER_ALPHA : 0 ) |
00518 DRV_RENDER_CLAMP_UV | DRV_RENDER_FLUSH |
00519 DRV_RENDER_NO_ZMASK | DRV_RENDER_NO_ZWRITE );
00520
00521 return GE_TRUE;
00522 }
|
|
||||||||||||||||||||||||
|
Definition at line 737 of file engine.c. References geEngine::AttachedBitmaps, BitmapList_Has(), tagRECT::bottom, DRV_Driver::DrawDecal, geEngine::DriverInfo, Engine, GE_TRUE, geBitmap_GetTHandle(), geBoolean, geErrorLog_AddString, GENESISAPI, GENESISCC, tagRECT::left, NULL, Sys_DriverInfo::RDriver, tagRECT::right, Source, tagRECT::top, and y. Referenced by Console_Frame(), Console_XYPrintf(), DrawStatusBar(), Engine_DrawFontBuffer(), geFont_DrawText(), geFont_TestDraw(), Menu_Draw(), and Text_Out().
00740 {
00741 geRDriver_THandle * TH;
00742 geBoolean Ret;
00743
00744 //#pragma message("make geRect the same as RECT, or don't use RECT!?")
00745 // The drivers once did not include genesis .h's
00746 // (D3D uses RECT so thats why the drivers adopted RECT's...)
00747 #pragma message("Engine : Make the drivers use geRect, JP")
00748
00749 assert(Engine);
00750 assert(Bitmap);
00751
00752 assert(Engine->AttachedBitmaps);
00753 assert(BitmapList_Has(Engine->AttachedBitmaps, (geBitmap *)Bitmap) == GE_TRUE);
00754
00755 TH = geBitmap_GetTHandle(Bitmap);
00756 assert(TH);
00757
00758 //Ret = Engine->DriverInfo.RDriver->Drawdecal(TH,(RECT *)Source,x,y);
00759
00760 if (Source) // Source CAN be NULL!!!
00761 {
00762 RECT rect;
00763
00764 rect.left = Source->Left;
00765 rect.top = Source->Top;
00766 rect.right = Source->Right;
00767 rect.bottom = Source->Bottom;
00768
00769 Ret = Engine->DriverInfo.RDriver->DrawDecal(TH, &rect, x,y);
00770 }
00771 else
00772 Ret = Engine->DriverInfo.RDriver->DrawDecal(TH, NULL, x,y);
00773
00774 if ( ! Ret )
00775 {
00776 geErrorLog_AddString(-1,"geEngine_DrawBitmap : DrawDecal failed", NULL);
00777 }
00778
00779 return Ret;
00780 }
|
|
||||||||||||
|
Definition at line 103 of file Ge.c. References geEngine::DisplayFrameRateCounter, Engine, and GENESISAPI. Referenced by GMenu_Key(), and WinMain().
00104 {
00105 assert(Engine);
00106 Engine->DisplayFrameRateCounter = Enabled;
00107 }
|
|
|
Definition at line 1797 of file engine.c. References Sys_DriverInfo::Active, geEngine::CPUInfo, geEngine::CurrentTic, geEngine::DebugInfo, geEngine::DisplayFrameRateCounter, geEngine::DriverInfo, DRV_Driver::EndScene, Engine, Engine_DrawFontBuffer(), Engine_Tick(), geEngine::FrameState, FrameState_Begin, FrameState_None, Sys_CPUInfo::Freq, GE_ERR_DRIVER_END_SCENE_FAILED, GE_ERR_DRIVER_NOT_INITIALIZED, GE_FALSE, GE_TRUE, geBoolean, geEngine_Printf(), geErrorLog_Add, geFloat, GENESISAPI, int32, NULL, Sys_DebugInfo::NumActors, Sys_DebugInfo::NumDLights, Sys_DebugInfo::NumFog, Sys_DebugInfo::NumMirrors, Sys_DebugInfo::NumModels, DRV_Driver::NumRenderedPolys, Sys_DriverInfo::RDriver, Sys_DebugInfo::RenderedPolys, Sys_DebugInfo::SentPolys, SubLarge(), and Sys_DebugInfo::TraversedPolys. Referenced by DoSplashScreen(), and GameMgr_EndFrame().
01798 {
01799 LARGE_INTEGER NowTic, DeltaTic;
01800 geFloat Fps;
01801 //DRV_Debug *Debug;
01802
01803 assert(Engine != NULL);
01804
01805 assert(Engine->FrameState == FrameState_Begin);
01806
01807 Engine->FrameState = FrameState_None;
01808
01809 if (!Engine->DriverInfo.Active)
01810 {
01811 geErrorLog_Add(GE_ERR_DRIVER_NOT_INITIALIZED, NULL);
01812 return GE_FALSE;
01813 }
01814
01815 assert(Engine->DriverInfo.RDriver != NULL);
01816
01817 //Debug = (DRV_Debug*)Engine->DriverInfo.RDriver->LoadMiscTexture;
01818 //geEngine_Printf(Engine, 2, 20, "LMap Cycles = %i", Debug->LMapCount[0][0]);
01819
01820 Engine_DrawFontBuffer(Engine);
01821
01822 if (!Engine->DriverInfo.RDriver->EndScene())
01823 {
01824 geErrorLog_Add(GE_ERR_DRIVER_END_SCENE_FAILED, NULL);
01825 return GE_FALSE;
01826 }
01827
01828 QueryPerformanceCounter(&NowTic);
01829 //CurrentFrequency = ((geFloat)PR_EntireFrame.ElapsedCycles/200.0f)
01830
01831 SubLarge(&Engine->CurrentTic, &NowTic, &DeltaTic);
01832
01833 if (DeltaTic.LowPart > 0)
01834 Fps = (geFloat)Engine->CPUInfo.Freq / (geFloat)DeltaTic.LowPart;
01835 else
01836 Fps = 100.0f;
01837
01838 if (Engine->DisplayFrameRateCounter == GE_TRUE) // Dieplay debug info
01839 {
01840 #define MAX_FPS_ARRAY 20
01841
01842 geFloat AverageFps;
01843 //DRV_CacheInfo *pCacheInfo;
01844 static geFloat FpsArray[MAX_FPS_ARRAY];
01845 static int32 NumFps = 0, i;
01846
01847 // Changed Average Fps to go accross last n frames, JP...
01848 FpsArray[(NumFps++) % MAX_FPS_ARRAY] = Fps;
01849
01850 for (AverageFps = 0.0f, i=0; i<MAX_FPS_ARRAY; i++)
01851 AverageFps += FpsArray[i];
01852
01853 AverageFps *= (1.0f/(geFloat)MAX_FPS_ARRAY);
01854
01855 // Grab some driver debug info
01856 Engine->DebugInfo.RenderedPolys = Engine->DriverInfo.RDriver->NumRenderedPolys;
01857
01858 geEngine_Printf(Engine, 2,2+15*0, "Fps : %2.2f / %2.2f", Fps, AverageFps);
01859 geEngine_Printf(Engine, 2,2+15*1, "Polys : %4i/%4i/%4i", Engine->DebugInfo.TraversedPolys, Engine->DebugInfo.SentPolys, Engine->DebugInfo.RenderedPolys);
01860
01861 geEngine_Printf(Engine, 2,2+15*2, "Mirrors: %3i", Engine->DebugInfo.NumMirrors);
01862 /*
01863 pCacheInfo = Engine->DriverInfo.RDriver->CacheInfo;
01864
01865 if (pCacheInfo)
01866 {
01867 geEngine_Printf(Engine, 2, 2+15*3, "Cache: %4i/%4i/%4i/%4i/%4i",
01868 pCacheInfo->CacheFull,
01869 pCacheInfo->CacheRemoved,
01870 pCacheInfo->CacheFlushes,
01871 pCacheInfo->TexMisses,
01872 pCacheInfo->LMapMisses);
01873
01874 }
01875 */
01876 geEngine_Printf(Engine, 2,2+15*3, "Actors : %3i, Models: %3i", Engine->DebugInfo.NumActors, Engine->DebugInfo.NumModels);
01877 geEngine_Printf(Engine, 2,2+15*4, "DLights: %3i", Engine->DebugInfo.NumDLights);
01878 geEngine_Printf(Engine, 2,2+15*5, "Fog : %3i", Engine->DebugInfo.NumFog);
01879 // geEngine_Printf(Engine, 2,2+15*7, "LMap1 : %3i, LMap2 : %3i", Engine->DebugInfo.LMap1, Engine->DebugInfo.LMap2);
01880 /*
01881 // For now, just display debug info for the first world...
01882 if (Engine->NumWorlds)
01883 {
01884 geWorld_DebugInfo *Info;
01885
01886 Info = &Engine->Worlds[0]->DebugInfo;
01887 geEngine_Printf(Engine, 2, 2+15*8, "Nodes: %3i/%3i, Leafs: %3i/%3i, Userp: %3i/%3i", Info->NumNodesTraversed1, Info->NumNodesTraversed2, Info->NumLeafsHit1, Info->NumLeafsHit2, Info->NumLeafsWithUserPolys, Info->NumUserPolys);
01888 geEngine_Printf(Engine, 2, 2+15*9, "Cast: %3i/%3i, GetC: %3i: %i", NumExactCast, NumBBoxCast, NumGetContents);
01889
01890 memset(Info, 0, sizeof(*Info));
01891
01892 NumExactCast = 0;
01893 NumBBoxCast = 0;
01894 NumGetContents = 0;
01895
01896 }
01897 */
01898 }
01899
01900 // Do an engine frame
01901 Engine_Tick(Engine);
01902
01903 return GE_TRUE;
01904 }
|
|
||||||||||||||||
|
Definition at line 85 of file Ge.c. References Engine, GENESISAPI, and User_EngineFillRect().
00086 {
00087 User_EngineFillRect(Engine, Rect, Color);
00088 }
|
|
|
Definition at line 77 of file Ge.c. References Engine, GENESISAPI, and Sys_EngineFree(). Referenced by GameMgr_FreeAllObjects().
00078 {
00079 Sys_EngineFree(Engine);
00080 }
|
|
|
Definition at line 564 of file engine.c. References geEngine::DriverInfo, Engine, geDriver_System, and GENESISAPI. Referenced by ModeList_Create().
00565 {
00566 assert(Engine);
00567
00568 return (geDriver_System*)&Engine->DriverInfo;
00569 }
|
|
||||||||||||
|
Definition at line 87 of file engine.c. References geEngine::CurrentGamma, Engine, GE_TRUE, geBoolean, and GENESISAPI.
00088 {
00089 assert(Engine);
00090 assert(Gamma);
00091
00092 *Gamma = Engine->CurrentGamma;
00093
00094 return GE_TRUE;//Engine->DriverInfo.RDriver->GetGamma(Gamma);
00095 }
|
|
||||||||||||||||||||||||
|
Definition at line 2032 of file engine.c. References Engine, geBoolean, geEngine_Puts(), GENESISAPI, and y. Referenced by Corona_Frame(), Engine_DrawFontBuffer(), GameMgr_ClearBackground(), geEngine_EndFrame(), gePuppet_Render(), ParseClientMove(), ReadServerMessages(), SendPlayersToClients(), and Server_Frame().
02033 {
02034 va_list ArgPtr;
02035 char TempStr[1024];
02036
02037 va_start(ArgPtr, String);
02038 vsprintf(TempStr, String, ArgPtr);
02039 va_end(ArgPtr);
02040
02041 return geEngine_Puts(Engine, x, y, TempStr);
02042 }
|
|
||||||||||||
|
Definition at line 271 of file engine.c. References geEngine::AttachedBitmaps, BitmapList_Remove(), geEngine::Changed, Engine, GE_FALSE, GE_TRUE, geBitmap_DetachDriver(), geBoolean, geErrorLog_AddString, GENESISAPI, and NULL. Referenced by Client_DestroyStatusBar(), Console_FreeResources(), geEngine_ShutdownFonts(), geFont_Destroy(), geFont_DestroyBitmapBuffer(), GMenu_DestroyAllData(), and Text_Destroy().
00272 {
00273 assert(Engine);
00274 assert(Bitmap);
00275 assert(Engine->AttachedBitmaps);
00276
00277 // assert(Engine->FrameState == FrameState_None);
00278
00279 if ( ! Engine->AttachedBitmaps )
00280 return GE_FALSE;
00281
00282 if ( BitmapList_Remove(Engine->AttachedBitmaps,Bitmap) )
00283 {
00284 Engine->Changed = GE_TRUE;
00285
00286 if (!geBitmap_DetachDriver(Bitmap, GE_TRUE))
00287 {
00288 geErrorLog_AddString(-1, "geEngine_RemoveBitmap: geBitmap_DetachDriver failed...", NULL);
00289 return GE_FALSE;
00290 }
00291
00292 #ifdef DO_ADDREMOVE_MESSAGES
00293 {
00294 char str[100];
00295 sprintf(str,"Engine_RemoveBitmap : %08X : removed\n",Bitmap);
00296 OutputDebugString(str);
00297 }
00298 #endif
00299 }
00300 else
00301 {
00302 #ifdef DO_ADDREMOVE_MESSAGES
00303 {
00304 char str[100];
00305 sprintf(str,"Engine_RemoveBitmap : %08X : left\n",Bitmap);
00306 OutputDebugString(str);
00307 }
00308 #endif
00309 }
00310
00311 return GE_TRUE;
00312 }
|
|
||||||||||||
|
Definition at line 885 of file engine.c. References Sys_DriverInfo::Active, geEngine::Changed, geEngine::DriverInfo, Engine, ENGINE_MAX_WORLDS, GE_FALSE, GE_TRUE, geBoolean, geEngine_RebuildFastWorldList(), geErrorLog_AddString, GENESISAPI, geWorld_DetachAll(), geWorld_Free(), int32, NULL, geEngine_WorldList::RefCount, geEngine_WorldList::World, and geEngine::WorldList. Referenced by DoSplashScreen(), and GameMgr_FreeWorld().
00886 {
00887 int32 i;
00888 geEngine_WorldList *pWorldList;
00889
00890 assert(Engine);
00891 assert(World);
00892
00893 // Try to find it in the list
00894 pWorldList = Engine->WorldList;
00895 for (i=0; i< ENGINE_MAX_WORLDS; i++, pWorldList++)
00896 {
00897 if (pWorldList->World == World)
00898 break;
00899 }
00900
00901 if (i == ENGINE_MAX_WORLDS)
00902 {
00903 geErrorLog_AddString(-1, "geEngine_RemoveWorld: World not found.", NULL);
00904 return GE_FALSE;
00905 }
00906
00907 assert(pWorldList->RefCount > 0);
00908
00909 // Decrease the reference count on the worldlist
00910 pWorldList->RefCount--;
00911
00912 // When the ref count gos to zero, remove the world for good
00913 if (pWorldList->RefCount == 0)
00914 {
00915
00916 #ifdef DO_ADDREMOVE_MESSAGES
00917 {
00918 char str[100];
00919 sprintf(str,"Engine_RemoveWorld : %08X : removed\n",World);
00920 OutputDebugString(str);
00921 }
00922 #endif
00923
00924 // Detach all the bitmaps in the world before finally removing it
00925 if (Engine->DriverInfo.Active)
00926 {
00927 if (!geWorld_DetachAll(World))
00928 {
00929 geErrorLog_AddString(-1, "geEngine_RemoveWorld: geWorld_DetachAll failed.", NULL);
00930 return GE_FALSE;
00931 }
00932 }
00933
00934 // Clear this pWorldList slot
00935 memset(pWorldList, 0, sizeof(*pWorldList));
00936
00937 // Re-build the fast list of worlds
00938 geEngine_RebuildFastWorldList(Engine);
00939
00940 // Force an update
00941 Engine->Changed = GE_TRUE;
00942
00943 // Free the world (decrease it's reference count)
00944 geWorld_Free(World);
00945 }
00946 else
00947 {
00948 #ifdef DO_ADDREMOVE_MESSAGES
00949 {
00950 char str[100];
00951 sprintf(str,"Engine_RemoveWorld : %08X : left\n",World);
00952 OutputDebugString(str);
00953 }
00954 #endif
00955 }
00956
00957 return GE_TRUE;
00958 }
|
|
||||||||||||||||||||||||
|
Definition at line 663 of file engine.c. References geEngine::DriverInfo, Engine, GE_TRUE, geBitmap_GetTHandle(), geBoolean, GENESISAPI, GENESISCC, Sys_DriverInfo::RDriver, DRV_Driver::RenderGouraudPoly, and DRV_Driver::RenderMiscTexturePoly. Referenced by geEngine_DrawAlphaBitmap(), gePuppet_DrawShadow(), gePuppet_Render(), gePuppet_RenderThroughFrustum(), and geSprite_RenderThroughFrustum().
00665 {
00666 geBoolean Ret;
00667
00668 assert(Engine && Points );
00669
00670 if ( Texture )
00671 {
00672 geRDriver_THandle * TH;
00673
00674 // assert(World);
00675 // assert(geEngine_HasWorld(Engine, World) == GE_TRUE);
00676 // assert(World->AttachedBitmaps);
00677 // assert(BitmapList_Has(World->AttachedBitmaps, (geBitmap*)Texture) == GE_TRUE);
00678
00679 TH = geBitmap_GetTHandle(Texture);
00680 assert(TH);
00681
00682 Ret = Engine->DriverInfo.RDriver->RenderMiscTexturePoly((DRV_TLVertex *)Points,
00683 NumPoints,TH,Flags);
00684 }
00685 else
00686 {
00687 Ret = Engine->DriverInfo.RDriver->RenderGouraudPoly((DRV_TLVertex *)Points,
00688 NumPoints,Flags);
00689 }
00690
00691 assert(Ret == GE_TRUE);
00692 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 694 of file engine.c. References geEngine::DriverInfo, Engine, geBitmap_GetTHandle(), geBoolean, GENESISAPI, GENESISCC, Sys_DriverInfo::RDriver, DRV_Driver::RenderGouraudPoly, and DRV_Driver::RenderMiscTexturePoly.
00696 {
00697 geBoolean Ret;
00698 int pn;
00699 DRV_Driver * Driver;
00700
00701 assert(Engine && pPoints && pNumPoints );
00702
00703 Driver = Engine->DriverInfo.RDriver;
00704 assert(Driver);
00705
00706 if ( Texture )
00707 {
00708 geRDriver_THandle * TH;
00709
00710 TH = geBitmap_GetTHandle(Texture);
00711 assert(TH);
00712
00713 for(pn=0;pn<NumPolys;pn++)
00714 {
00715 assert(pPoints[pn]);
00716 Ret = Driver->RenderMiscTexturePoly((DRV_TLVertex *)pPoints[pn],
00717 pNumPoints[pn],TH,Flags);
00718 assert(Ret);
00719 }
00720 }
00721 else
00722 {
00723 for(pn=0;pn<NumPolys;pn++)
00724 {
00725 assert(pPoints[pn]);
00726 Ret = Driver->RenderGouraudPoly((DRV_TLVertex *)pPoints[pn],
00727 pNumPoints[pn],Flags);
00728 assert(Ret);
00729 }
00730 }
00731
00732 }
|
|
||||||||||||||||||||
|
Definition at line 1687 of file engine.c. References geWorld::Changed, geEngine::Changed, Sys_DriverInfo::CurMode, geEngine::DriverInfo, Engine, GE_ERR_INVALID_CAMERA, GE_ERR_INVALID_PARMS, GE_FALSE, GE_TRUE, geBoolean, geCamera_GetWidthHeight(), geEngine_HasWorld(), geErrorLog_Add, geFloat, GENESISAPI, geDriver_Mode::Height, int32, NULL, geDriver_Mode::Width, and World_WorldRenderQ(). Referenced by DoSplashScreen(), and RenderWorld().
01688 {
01689 Sys_DriverInfo *DInfo;
01690 int32 Width, Height;
01691
01692 assert(Engine != NULL);
01693 assert(World != NULL);
01694 assert(Camera != NULL);
01695
01696 assert(geEngine_HasWorld(Engine, World) == GE_TRUE); // You have to add the world to the engine before rendering!
01697
01698 assert(Engine->Changed == GE_FALSE);
01699 assert(World->Changed == GE_FALSE);
01700
01701 if (!World || !Camera)
01702 {
01703 geErrorLog_Add(GE_ERR_INVALID_PARMS, NULL);
01704 return GE_FALSE;
01705 }
01706
01707 DInfo = &Engine->DriverInfo;
01708
01709 // This must not be NULL, or there is not a true current driver mode set
01710 assert(DInfo->CurMode);
01711
01712 Width = DInfo->CurMode->Width;
01713 Height = DInfo->CurMode->Height;
01714
01715 if (Width != -1 && Height != -1) // If not in window mode...
01716 {
01717 geFloat CameraWidth,CameraHeight;
01718
01719 geCamera_GetWidthHeight(Camera,&CameraWidth,&CameraHeight);
01720
01721 if (CameraWidth > Width || CameraHeight > Height)
01722 {
01723 geErrorLog_Add(GE_ERR_INVALID_CAMERA, NULL);
01724 return GE_FALSE;
01725 }
01726 }
01727
01728 if (!World_WorldRenderQ(Engine, World, Camera))
01729 return GE_FALSE;
01730
01731 return GE_TRUE;
01732 }
|
|
||||||||||||
|
Definition at line 93 of file Ge.c. References geEngine::DriverInfo, Engine, geBoolean, GENESISAPI, Sys_DriverInfo::RDriver, and DRV_Driver::ScreenShot. Referenced by WndProc().
00094 {
00095 assert(Engine);
00096
00097 return Engine->DriverInfo.RDriver->ScreenShot(FileName);
00098 }
|
|
||||||||||||||||
|
Definition at line 527 of file engine.c. References geEngine::Changed, DoSplashScreen(), Engine, Engine_InitDriver(), GE_FALSE, GE_TRUE, geBoolean, geEngine_SetAllWorldChangedFlag(), geEngine_UpdateFogEnable(), geEngine_UpdateGamma(), and GENESISAPI. Referenced by AutoSelect_PickDriver(), and PickMode().
00530 {
00531 assert(Engine);
00532 assert(Driver);
00533 assert(DriverMode);
00534
00535 // init calls _Reset and eventually it gets down and Detaches all
00536
00537 // Set up the Render Driver
00538 if (!Engine_InitDriver(Engine, Driver, DriverMode))
00539 return GE_FALSE;
00540
00541 // Force a Driver update
00542 geEngine_SetAllWorldChangedFlag(Engine, GE_TRUE);
00543 Engine->Changed = GE_TRUE;
00544
00545 geEngine_UpdateGamma(Engine);
00546 geEngine_UpdateFogEnable(Engine);
00547
00548 //#ifdef DONT_DO_SPLASH
00549 #ifdef _DEBUG
00550 #pragma message("Engine :splash screen disabled")
00551 Engine = Engine;
00552 #else
00553 // Do the splash screen
00554 if (DoSplashScreen(Engine, DriverMode) == GE_FALSE)
00555 return GE_FALSE;
00556 #endif
00557
00558 return GE_TRUE;
00559 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 118 of file engine.c. References Engine, geEngine::FogB, geEngine::FogEnable, geEngine::FogEnd, geEngine::FogG, geEngine::FogR, geEngine::FogStart, geBoolean, geEngine_UpdateFogEnable(), GENESISAPI, and r. Referenced by Sys_EngineCreate().
|
|
||||||||||||
|
Definition at line 67 of file engine.c. References ABS, geEngine::CurrentGamma, Engine, GE_TRUE, geBoolean, geEngine_UpdateGamma(), and GENESISAPI. Referenced by GMenu_Key(), and WinMain().
00068 {
00069 assert(Engine);
00070
00071 if ( Gamma < 0.01f )
00072 Gamma = 0.01f;
00073
00074 if ( ABS( Engine->CurrentGamma - Gamma) < 0.01f )
00075 return GE_TRUE;
00076
00077 Engine->CurrentGamma = Gamma;
00078
00079 geEngine_UpdateGamma(Engine);
00080
00081 return GE_TRUE;
00082 }
|
|
|
Definition at line 619 of file engine.c. References Sys_DriverInfo::Active, Sys_DriverInfo::DriverHandle, geEngine::DriverInfo, Engine, GE_FALSE, GE_TRUE, geBoolean, geEngine_ResetDriver(), geErrorLog_AddString, GENESISAPI, NULL, Sys_DriverInfo::RDriver, and DRV_Driver::Shutdown. Referenced by Engine_InitDriver(), PickMode(), Sys_EngineCreate(), and Sys_EngineFree().
00620 {
00621 Sys_DriverInfo *DrvInfo;
00622
00623 assert(Engine);
00624
00625 DrvInfo = &(Engine->DriverInfo);
00626
00627 assert(DrvInfo);
00628
00629 if (!DrvInfo->Active)
00630 return GE_TRUE; // Just return true, and don't do nothing
00631
00632 #if 0 // <>
00633 #ifdef _DEBUG
00634 OutputDebugString("geEngine_ShutdownDriver\n");
00635 #endif
00636 #endif
00637
00638 // First, reset the driver
00639 if (!geEngine_ResetDriver(Engine))
00640 {
00641 geErrorLog_AddString(-1, "geEngine_ShutdownDriver: geEngine_ResetDriver failed.", NULL);
00642 return GE_FALSE;
00643 }
00644
00645 // Shutdown the driver
00646 DrvInfo->RDriver->Shutdown();
00647
00648 if (!FreeLibrary(DrvInfo->DriverHandle) )
00649 return GE_FALSE;
00650
00651 DrvInfo->Active = GE_FALSE;
00652 DrvInfo->RDriver = NULL;
00653
00654 return GE_TRUE;
00655 }
|
|
||||||||||||
|
Definition at line 589 of file Entities.c. References geEntity_EntitySet::Current, geEntity_EntitySet::Entity, GENESISAPI, geEntity_EntitySet::Next, and NULL. Referenced by Bot_GetActorStart(), Bot_IsActorRespawn(), CheckVelocity(), Corona_Frame(), CreateStaticFogList(), DynLight_Frame(), DynLight_Reset(), DynLight_SetWorld(), Electric_Frame(), Electric_Reset(), Electric_SetWorld(), Ent_WorldInit(), gePuppet_ComputeAmbientLight(), ModelCtl_Frame(), ModelCtl_Reset(), PathPt_Frame(), PathPt_Startup(), PhysicsObject_Control(), and Server_SpawnWorld().
00590 {
00591 geEntity_EntitySet *Set, *NextSet;
00592
00593 assert(EntitySet);
00594
00595 if (!Entity)
00596 {
00597 EntitySet->Current = EntitySet;
00598 return EntitySet->Entity;
00599 }
00600
00601 assert(EntitySet->Current);
00602
00603 // Search is easy if this was the last entity we returned
00604 if (EntitySet->Current->Entity == Entity)
00605 {
00606 NextSet = EntitySet->Current->Next;
00607
00608 if (!NextSet)
00609 return NULL; // No more in the list
00610
00611 EntitySet->Current = NextSet;
00612 return NextSet->Entity;
00613 }
00614
00615 // Must do a search now, that'll teach'em to jump around...
00616 for (Set = EntitySet; Set; Set = Set->Next)
00617 {
00618 assert(Set->Entity);
00619
00620 if (Set->Entity == Entity)
00621 {
00622 NextSet = Set->Next;
00623
00624 EntitySet->Current = NextSet;
00625 return NextSet->Entity;
00626 }
00627 }
00628
00629 return NULL;
00630 }
|
|
||||||||||||||||
|
Definition at line 511 of file Entities.c. References geEntity_GetStringForKey(), GENESISAPI, and min. Referenced by DynLight_SetWorld(), Electric_SetWorld(), ModelCtl_Frame(), and Server_SpawnWorld().
00512 {
00513 const char * EntName;
00514 int Length;
00515
00516 assert(Entity);
00517 assert(Buff);
00518
00519 EntName = geEntity_GetStringForKey(Entity, "%Name%");
00520 assert(EntName);
00521 Length = strlen(EntName) + 1;
00522 memcpy(Buff, EntName, min(Length, MaxLen));
00523 }
|
|
|
Definition at line 215 of file Entities.c. References GENESISAPI, and geEntity::UserData. Referenced by Bot_GetActorStart(), Bot_IsActorRespawn(), CheckVelocity(), Corona_Frame(), CreateStaticFogList(), DynLight_Frame(), DynLight_Reset(), DynLight_SetWorld(), Electric_Frame(), Electric_Reset(), Electric_SetWorld(), gePuppet_ComputeAmbientLight(), ModelCtl_Frame(), ModelCtl_Reset(), PathPt_Frame(), PathPt_Startup(), PhysicsObject_Control(), and Server_SpawnWorld().
00216 {
00217 assert(Entity);
00218
00219 return Entity->UserData;
00220 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 63 of file Fog.c.
00069 {
00070 Fog->Pos = *Pos;
00071 Fog->Color.r = Color->r*(1.0f/255.0f)*(1<<8);
00072 Fog->Color.g = Color->g*(1.0f/255.0f)*(1<<8);
00073 Fog->Color.b = Color->b*(1.0f/255.0f)*(1<<8);
00074 Fog->LightBrightness = LightBrightness;
00075 Fog->VolumeBrightness = VolumeBrightness;
00076 Fog->VolumeRadius = VolumeRadius;
00077 Fog->VolumeRadiusSquared = VolumeRadius*VolumeRadius;
00078 Fog->VolumeRadius2 = VolumeRadius*2;
00079
00080 // Now that all is set, call the CB if it exist...
00081 if (Fog->SetAttrCB)
00082 {
00083 if (!Fog->SetAttrCB(Fog))
00084 return GE_FALSE;
00085 }
00086
00087 return GE_TRUE;
00088 }
|
|
||||||||||||||||
|
Definition at line 1070 of file User.c.
|
|
||||||||||||||||
|
Definition at line 1087 of file User.c.
01088 {
01089 assert (Poly != NULL);
01090 assert(LVert != NULL);
01091 assert(geWorld_PolyIsValid(Poly));
01092
01093 assert(Index >= 0);
01094 assert(Index < Poly->NumVerts);
01095
01096 Poly->Verts[Index] = *LVert;
01097
01098 assert(Poly->LeafData); // A poly does not get created UNLESS it gets attaches to a leaf!!!
01099
01100 geWorld_UnLinkPolyFromLeaf(Poly); // Detach the poly from it's current leaf
01101 geWorld_LinkPolyToLeaf(Poly->World, Poly); // Re-attach to the new leaf (if any, check for cohearency!)
01102
01103 return GE_TRUE;
01104 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 87 of file Sound3d.c.
00096 {
00097 geVec3d ViewPos, LocalPos, Dist;
00098 geSound3d_Cfg Cfg;
00099 geFloat Magnitude;
00100 geVec3d Origin = {0.0f, 0.0f, 0.0f};
00101 geXForm3d CXForm;
00102 int32 Leaf1, Leaf2;
00103
00104 assert( World != NULL );
00105 assert( MXForm != NULL );
00106 assert( SndPos != NULL );
00107 assert( Volume != NULL );
00108 assert( Pan != NULL );
00109 assert( Frequency != NULL );
00110
00111
00112 LocalPos = MXForm->Translation;
00113 // Transform the sound to view space
00114 geCamera_ConvertWorldSpaceToCameraSpace(MXForm, &CXForm);
00115 geXForm3d_Transform( &CXForm, SndPos, &ViewPos);
00116 // FIXME: Need to check these and return TRUE or FALSE
00117 if( !geWorld_GetLeaf((geWorld*)World, &LocalPos, &Leaf1) )
00118 return;
00119 if( !geWorld_GetLeaf((geWorld*)World, SndPos, &Leaf2) )
00120 return;
00121
00122 if (!geWorld_LeafMightSeeLeaf((geWorld*)World, Leaf1, Leaf2, 0))
00123 {
00124 Magnitude = 0.0f;
00125 Dist.X = 0.0f; // Shut up compiler warning
00126 Cfg.Volume = 0.0f;
00127 }
00128 else
00129 {
00130 GE_Collision Col;
00131
00132 // Find the distance from the camera to the original light pos
00133 geVec3d_Subtract(&LocalPos, SndPos, &Dist);
00134
00135 Magnitude = geVec3d_Length(&Dist);
00136
00137 if (Trace_GEWorldCollision((geWorld*)World, NULL, NULL, &LocalPos, SndPos, GE_CONTENTS_SOLID_CLIP, GE_COLLIDE_MODELS, 0, NULL, NULL, &Col))
00138 Magnitude *= 1.5f;
00139
00140 geSound3D_RollOut(&Cfg, Magnitude, Min, Min*10);
00141 }
00142
00143 geSound3D_Pan(&Cfg, (geFloat)atan2( (double)ViewPos.X, (double)ViewPos.Z ) );
00144 //Cfg->Frequency = 1.0f;
00145 geSound3D_Doppler(&Cfg, Ds);
00146
00147 *Volume = Cfg.Volume;
00148 *Pan = Cfg.Pan;
00149 *Frequency = Cfg.Frequency;
00150 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 156 of file Sound3d.c.
00165 {
00166 geVec3d ViewPos, LocalPos, Dist;
00167 geSound3d_Cfg Cfg;
00168 geFloat Magnitude;
00169 geVec3d Origin = {0.0f, 0.0f, 0.0f};
00170 geXForm3d CXForm;
00171 int32 Leaf1, Leaf2;
00172
00173 assert( World != NULL );
00174 assert( MXForm != NULL );
00175 assert( SndPos != NULL );
00176 assert( Volume != NULL );
00177 assert( Pan != NULL );
00178 assert( Frequency != NULL );
00179
00180
00181 LocalPos = MXForm->Translation;
00182 // Transform the sound to view space
00183 geCamera_ConvertWorldSpaceToCameraSpace(MXForm, &CXForm);
00184 geXForm3d_Transform( &CXForm, SndPos, &ViewPos);
00185 // FIXME: Need to check these and return TRUE or FALSE
00186 if( !geWorld_GetLeaf((geWorld*)World, &LocalPos, &Leaf1) )
00187 return;
00188 if( !geWorld_GetLeaf((geWorld*)World, SndPos, &Leaf2) )
00189 return;
00190
00191 if (!geWorld_LeafMightSeeLeaf((geWorld*)World, Leaf1, Leaf2, 0))
00192 {
00193 Magnitude = 0.0f;
00194 Dist.X = 0.0f; // Shut up compiler warning
00195 Cfg.Volume = 0.0f;
00196 }
00197 else
00198 {
00199 // Find the distance from the camera to the original light pos
00200 geVec3d_Subtract(&LocalPos, SndPos, &Dist);
00201
00202 Magnitude = geVec3d_Length(&Dist);
00203
00204 geSound3D_RollOut(&Cfg, Magnitude, Min, Min*10);
00205 }
00206
00207 geSound3D_Pan(&Cfg, (geFloat)atan2( (double)ViewPos.X, (double)ViewPos.Z ) );
00208 //Cfg->Frequency = 1.0f;
00209 geSound3D_Doppler(&Cfg, Ds);
00210
00211 *Volume = Cfg.Volume;
00212 *Pan = Cfg.Pan;
00213 *Frequency = Cfg.Frequency;
00214 }
|
|
|
Definition at line 147 of file Engine/Sound.c.
00148 {
00149 assert(Sound != NULL);
00150
00151 // Shutdown the sound system
00152 DestroySoundManager(Sound->SoundM);
00153
00154 Sound->SoundM = NULL;
00155
00156 geRam_Free(Sound);
00157 }
|
|
||||||||||||
|
Definition at line 199 of file Engine/Sound.c.
00200 {
00201 Channel* Channel;
00202
00203 assert(SoundS != NULL);
00204 assert(SoundDef != 0);
00205
00206 Channel = GetChannel(SoundS->SoundM, (unsigned int)SoundDef);
00207
00208 if (!Channel)
00209 return;
00210
00211 FreeChannel(SoundS->SoundM, Channel);
00212 }
|
|
|
Definition at line 107 of file Engine/Sound.c.
00108 {
00109 return (void *)lpDirectSound;
00110 }
|
|
||||||||||||
|
Definition at line 163 of file Engine/Sound.c.
00164 {
00165 unsigned int SoundDef = 0;
00166
00167 assert(SoundS != NULL);
00168
00169 // if (!FillSoundChannel(SoundS->SoundM, (char*)Path, (char*)FileName, &SoundDef))
00170 if (!FillSoundChannel(SoundS->SoundM, File, &SoundDef))
00171 return 0;
00172
00173 return (geSound_Def *)SoundDef;
00174 }
|
|
||||||||||||||||||||||||
|
Definition at line 272 of file Engine/Sound.c.
00276 {
00277 Channel* Channel;
00278 geSound_Cfg LocalCfg;
00279
00280 assert(SoundS != NULL);
00281 assert(Sound != NULL);
00282
00283 Channel = GetChannel(SoundS->SoundM, (unsigned int)Sound);
00284
00285 if (!Channel)
00286 return GE_FALSE;
00287 LocalCfg.Volume = Volume;
00288 LocalCfg.Pan = Pan;
00289 LocalCfg.Frequency = Frequency;
00290 LocalCfg.Volume *= SoundS->GlobalVolume;
00291 return ModifyChannel(Channel, &LocalCfg);
00292 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 228 of file Engine/Sound.c.
00234 {
00235 unsigned int Sound;
00236 geSound_Cfg LocalCfg;
00237
00238 LocalCfg.Volume = Volume;
00239 LocalCfg.Pan = Pan;
00240 LocalCfg.Frequency = Frequency;
00241
00242 LocalCfg.Volume *= SoundS->GlobalVolume;
00243 if (!StartSoundChannel(SoundS->SoundM, (unsigned int)SoundDef, &LocalCfg, (BOOL)Loop, &Sound))
00244 {
00245 return 0;
00246 }
00247
00248 return (geSound *)Sound;
00249 }
|
|
||||||||||||
|
Definition at line 217 of file Engine/Sound.c.
00218 {
00219 if( !SoundS )
00220 return( GE_FALSE );
00221 SoundS->GlobalVolume = Volume;
00222 return( GE_TRUE );
00223 }
|
|
||||||||||||
|
Definition at line 297 of file Engine/Sound.c.
00298 {
00299 Channel* Channel;
00300
00301 assert(SoundS != NULL);
00302 assert(Sound != NULL);
00303
00304 Channel = GetChannel(SoundS->SoundM, (unsigned int)Sound);
00305
00306 if (!Channel)
00307 return GE_FALSE;
00308
00309 return ChannelPlaying(Channel);
00310 }
|
|
||||||||||||
|
Definition at line 254 of file Engine/Sound.c.
00255 {
00256 Channel* Channel;
00257
00258 assert(SoundS != NULL);
00259 assert(Sound != NULL);
00260
00261 Channel = GetChannel(SoundS->SoundM, (unsigned int)Sound);
00262
00263 if (!Channel)
00264 return GE_FALSE;
00265
00266 return StopSoundChannel(Channel);
00267 }
|
|
|
Definition at line 174 of file Tclip.c.
00175 {
00176 geTClip_StaticsType * TCI;
00177 if ( ! geTClip_Link )
00178 return GE_FALSE;
00179 TCI = Link_Pop( geTClip_Link );
00180 if ( ! TCI )
00181 return GE_FALSE;
00182 memcpy(&geTClip_Statics,TCI,sizeof(geTClip_StaticsType));
00183 geRam_Free(TCI);
00184
00185 if ( ! Link_Peek(geTClip_Link) )
00186 {
00187 Link_Destroy(geTClip_Link);
00188 geTClip_Link = NULL;
00189 List_Stop();
00190 }
00191
00192 ActiveRenderFlags = geTClip_Statics.RenderFlags; // LA, set ARF from newly pop'd statics
00193
00194 return GE_TRUE;
00195 }
|
|
|
Definition at line 148 of file Tclip.c.
00149 {
00150 geTClip_StaticsType * TCI;
00151
00152 geTClip_Statics.RenderFlags = ActiveRenderFlags; // LA
00153
00154 if ( ! geTClip_Link )
00155 {
00156 List_Start();
00157 geTClip_Link = Link_Create();
00158 if ( ! geTClip_Link )
00159 return GE_FALSE;
00160 }
00161
00162 TCI = geRam_Allocate(sizeof(geTClip_StaticsType));
00163 if ( ! TCI )
00164 return GE_FALSE;
00165 memcpy(TCI,&geTClip_Statics,sizeof(geTClip_StaticsType));
00166
00167 Link_Push( geTClip_Link , TCI );
00168
00169 geTClip_Statics.RenderFlags = 0; // LA, this is needed to set RF = 0 for default after any _Push
00170
00171 return GE_TRUE;
00172 }
|
|
|
Definition at line 141 of file Tclip.c.
00142 {
00143 geTClip_Statics.RenderFlags = newflags;
00144 ActiveRenderFlags = newflags;
00145 return;
00146 }
|
|
|
Definition at line 197 of file Tclip.c.
00198 {
00199 geTClip_Statics.Bitmap = Bitmap;
00200 if ( Bitmap )
00201 {
00202 geTClip_Statics.THandle = geBitmap_GetTHandle(Bitmap);
00203 assert(geTClip_Statics.THandle);
00204 geTClip_Statics.RasterizeFunc = geTClip_Rasterize_Tex;
00205 }
00206 else
00207 {
00208 geTClip_Statics.THandle = NULL;
00209 geTClip_Statics.RasterizeFunc = geTClip_Rasterize_Gou;
00210 }
00211 return GE_TRUE;
00212 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 214 of file Tclip.c.
00221 {
00222 assert(Engine);
00223 memset(&geTClip_Statics,0,sizeof(geTClip_Statics));
00224 geTClip_Statics.Engine = Engine;
00225 geTClip_Statics.Driver = Engine->DriverInfo.RDriver; //Engine_GetRDriver(Engine);
00226 geTClip_Statics.LeftEdge = LeftEdge;
00227 geTClip_Statics.RightEdge = RightEdge;
00228 geTClip_Statics.TopEdge = TopEdge;
00229 geTClip_Statics.BottomEdge = BottomEdge;
00230 geTClip_Statics.BackEdge = BackEdge;
00231 }
|
|
|
Definition at line 238 of file Tclip.c.
00239 {
00240
00241 TIMER_P(TClip_Triangle);
00242
00243 #if 1
00244 geTClip_TrianglePlane(TriVertex,BACK_CLIPPING_PLANE);
00245 //geTClip_TrianglePlane(TriVertex,LEFT_CLIPPING_PLANE);
00246 #else
00247 geTClip_TrianglePlane_Old(TriVertex,BACK_CLIPPING_PLANE);
00248 #endif
00249
00250 TIMER_Q(TClip_Triangle);
00251 }
|
|
|
Definition at line 557 of file Tclip.c.
00558 {
00559 if ( geTClip_Statics.THandle )
00560 {
00561 geTClip_Statics.Driver->RenderMiscTexturePoly((DRV_TLVertex *)TriVertex,
00562 3,geTClip_Statics.THandle,ActiveRenderFlags);
00563 }
00564 else
00565 {
00566 geTClip_Statics.Driver->RenderGouraudPoly((DRV_TLVertex *)TriVertex,3,ActiveRenderFlags);
00567 }
00568 return;
00569 }
|
|
||||||||||||||||||||
|
Definition at line 2287 of file World.c. References geWorld::ActorArray, geWorld::ActorCount, GE_FALSE, GE_RAM_REALLOC_ARRAY, GE_TRUE, geActor_CreateRef(), geActor_IsValid(), geActor_RenderPrep(), geBoolean, geErrorLog_AddString, GENESISAPI, and NULL. Referenced by CheckClientPlayerChanges(), DoSplashScreen(), and GameMgr_SetActorIndex().
02288 {
02289 World_Actor *NewArray;
02290 assert( World != NULL );
02291 assert( geActor_IsValid(Actor) != GE_FALSE );
02292 assert( World->ActorCount >= 0 );
02293
02294 NewArray = GE_RAM_REALLOC_ARRAY( World->ActorArray, World_Actor , World->ActorCount+1);
02295 if (NewArray == NULL)
02296 {
02297 geErrorLog_AddString(-1,"Failed to grow world actor array", NULL);
02298 return GE_FALSE;
02299 }
02300 World->ActorArray = NewArray;
02301 World->ActorArray[World->ActorCount].Actor = Actor;
02302 World->ActorArray[World->ActorCount].Flags = Flags;
02303 World->ActorArray[World->ActorCount].UserFlags = UserFlags;
02304 if (geActor_RenderPrep( Actor,World )==GE_FALSE)
02305 {
02306 geErrorLog_AddString(-1,"Failed to prepare the actor for rendering", NULL);
02307 return GE_FALSE;
02308 }
02309 World->ActorCount++;
02310 geActor_CreateRef(Actor);
02311
02312 #ifdef DO_ADDREMOVE_MESSAGES
02313 {
02314 char str[100];
02315 sprintf(str,"World_AddActor : %08X\n",Actor);
02316 OutputDebugString(str);
02317 }
02318 #endif
02319
02320 return GE_TRUE;
02321 }
|
|
||||||||||||
|
Definition at line 3350 of file World.c. References geWorld::AttachedBitmaps, BitmapList_Add(), geWorld::Changed, GE_FALSE, GE_TRUE, geBitmap_SetDriverFlags(), geBoolean, geErrorLog_AddString, GENESISAPI, NULL, RDRIVER_PF_3D, and RDRIVER_PF_COMBINE_LIGHTMAP.
03351 {
03352 assert(World);
03353 assert(Bitmap);
03354 assert(World->AttachedBitmaps);
03355
03356 if (!World->AttachedBitmaps)
03357 {
03358 geErrorLog_AddString(-1, "geWorld_AddBitmap: AttachedBitmapList is NULL.", NULL);
03359 return GE_FALSE;
03360 }
03361
03362 geBitmap_SetDriverFlags(Bitmap, RDRIVER_PF_3D | RDRIVER_PF_COMBINE_LIGHTMAP);
03363
03364 // Add bitmap to the list of bitmaps attached to the engine
03365 if ( BitmapList_Add(World->AttachedBitmaps, (void*)Bitmap) )
03366 {
03367 World->Changed = GE_TRUE;
03368
03369 #ifdef DO_ADDREMOVE_MESSAGES
03370 {
03371 char str[100];
03372 sprintf(str,"World_AddBitmap : %08X : new\n",Bitmap);
03373 OutputDebugString(str);
03374 }
03375 #endif
03376 }
03377 else
03378 {
03379 #ifdef DO_ADDREMOVE_MESSAGES
03380 {
03381 char str[100];
03382 sprintf(str,"World_AddBitmap : %08X : old\n",Bitmap);
03383 OutputDebugString(str);
03384 }
03385 #endif
03386 }
03387
03388 return GE_TRUE;
03389 }
|
|
|
Definition at line 2687 of file World.c. References geWorld::FogList, GE_RAM_ALLOCATE_STRUCT, geFog_Create(), geFog_SetAttributesCB(), geFog_SetUserData(), GENESISAPI, geRam_Free, geWorld_RemoveFog(), geFog::Next, NULL, geFog::Prev, and geWorld_FogData::World. Referenced by CreateStaticFogList().
02688 {
02689 geFog *Fog;
02690 geWorld_FogData *FogData;
02691
02692 assert(World);
02693
02694 Fog = NULL;
02695 FogData = NULL;
02696
02697 Fog = geFog_Create(geFog_SetAttributesCB); // Create the fog
02698
02699 if (!Fog)
02700 goto ExitWithError;
02701
02702 // Insert at begining of list
02703 if (World->FogList)
02704 World->FogList->Prev = Fog;
02705
02706 Fog->Next = World->FogList;
02707 World->FogList = Fog;
02708
02709 // Set up fog user data for the engine to use ONLY
02710 FogData = GE_RAM_ALLOCATE_STRUCT(geWorld_FogData);
02711
02712 if (!FogData)
02713 goto ExitWithError;
02714
02715 FogData->World = World; // Remember what world created the fog
02716
02717 geFog_SetUserData(Fog, FogData);
02718
02719 return Fog;
02720
02721 ExitWithError:
02722 {
02723 if (FogData)
02724 geRam_Free(FogData);
02725
02726 if (Fog)
02727 geWorld_RemoveFog(World, Fog);
02728 }
02729
02730 return NULL;
02731 }
|
|
|
Definition at line 256 of file Ge.c. References geLight, GENESISAPI, Light_WorldAddLight(), and NULL. Referenced by AddBoneLight(), CheckClientPlayerChanges(), and DynLight_SetWorld().
00257 {
00258 assert(World != NULL);
00259
00260 return (geLight*)Light_WorldAddLight(World);
00261 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 968 of file User.c.
00975 {
00976 gePoly *Poly;
00977
00978 assert(World != NULL);
00979 assert(World->UserInfo != NULL);
00980
00981 assert(Bitmap != NULL || Type == GE_GOURAUD_POLY);
00982 assert(Verts != NULL);
00983 assert(NumVerts <= MAX_USER_VERTS);
00984
00985 Poly = GE_RAM_ALLOCATE_STRUCT(gePoly);
00986
00987 if (!Poly)
00988 return NULL;
00989
00990 if ( World->CurrentBSP )
00991 gGFXModels = World->CurrentBSP->BSPData.GFXModels;
00992 else
00993 gGFXModels = NULL;
00994
00995 #ifdef _DEBUG
00996 Poly->Self1 = Poly;
00997 Poly->Self2 = Poly;
00998 #endif
00999
01000 Poly->NumVerts = NumVerts;
01001 Poly->Bitmap = Bitmap;
01002 Poly->Type = Type;
01003 Poly->RenderFlags = RenderFlags;
01004 Poly->Scale = Scale;
01005 Poly->World = World; // I could think of no other way!!! Poly needs world in SetLVertex. Should we require it as a parm???
01006 Poly->AddOnceNext = NULL;
01007 Poly->Next = NULL;
01008 Poly->Prev = NULL;
01009 Poly->LeafData = NULL;
01010
01011 memcpy(Poly->Verts, Verts, sizeof(GE_LVertex)*NumVerts);
01012
01013 // Link the poly to the leaf it is in
01014 geWorld_LinkPolyToLeaf(World, Poly);
01015
01016 World->ActiveUserPolys++;
01017
01018 return Poly;
01019 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 1024 of file User.c.
01031 {
01032 gePoly *Poly;
01033
01034 assert(World != NULL);
01035 assert(World->UserInfo != NULL);
01036
01037 // For AddPOlyOnce, do an AddPoly, then put it in the list to be removed at the end of the frame
01038 Poly = geWorld_AddPoly(World, Verts, NumVerts, Bitmap, Type, RenderFlags, Scale);
01039
01040 if (!Poly)
01041 return NULL;
01042
01043 // Insert add poly once polys into the AddPolyOnceList so they can be removed at the end of the frame
01044 Poly->AddOnceNext = World->UserInfo->AddPolyOnceList;
01045 World->UserInfo->AddPolyOnceList = Poly;
01046
01047 return Poly;
01048 }
|
|
||||||||||||||||||||
|
Definition at line 2386 of file World.c. References GE_FALSE, GE_RAM_REALLOC_ARRAY, GE_TRUE, geBoolean, geErrorLog_AddString, GENESISAPI, geSprite_CreateRef(), geSprite_IsValid(), geSprite_RenderPrep(), NULL, geWorld::SpriteArray, and geWorld::SpriteCount.
02387 {
02388 World_Sprite *NewArray;
02389
02390 assert( World );
02391 assert( geSprite_IsValid(Sprite) );
02392 assert( World->SpriteCount >= 0 );
02393
02394 NewArray = GE_RAM_REALLOC_ARRAY( World->SpriteArray, World_Sprite, (World->SpriteCount + 1) );
02395
02396 if (NewArray == NULL)
02397 {
02398 geErrorLog_AddString(-1, "Failed to grow world sprite array", NULL);
02399 return GE_FALSE;
02400 }
02401
02402 World->SpriteArray = NewArray;
02403 World->SpriteArray[World->SpriteCount].Sprite = Sprite;
02404 World->SpriteArray[World->SpriteCount].Flags = Flags;
02405 World->SpriteArray[World->SpriteCount].UserFlags = UserFlags;
02406
02407 if ( geSprite_RenderPrep(Sprite, World) == GE_FALSE )
02408 {
02409 geErrorLog_AddString(-1, "Failed to prepare the sprite for rendering", NULL);
02410 return GE_FALSE;
02411 }
02412
02413 World->SpriteCount++;
02414 geSprite_CreateRef(Sprite);
02415
02416 #ifdef DO_ADDREMOVE_MESSAGES
02417 {
02418 char str[100];
02419
02420 sprintf(str, "World_AddSprite : %08X\n", Sprite);
02421 OutputDebugString(str);
02422 }
02423 #endif
02424
02425 return GE_TRUE;
02426 }
|
|
||||||||||||
|
Definition at line 3490 of file World.c. References geWorld::CurFrameDynamic, geWorld::CurrentBSP, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, geWBitmap_GetVisFrame(), geWBitmap_Pool_GetWBitmapByBitmap(), and World_BSP::WBitmapPool. Referenced by ProcEng_Animate().
03491 {
03492 geWBitmap *pWBitmap;
03493
03494 pWBitmap = geWBitmap_Pool_GetWBitmapByBitmap(World->CurrentBSP->WBitmapPool, Bitmap);
03495
03496 if (!pWBitmap) // Not in the list! Should this be an error?????
03497 return GE_FALSE;
03498
03499 if (geWBitmap_GetVisFrame(pWBitmap) == World->CurFrameDynamic)
03500 return GE_TRUE;
03501
03502 return GE_FALSE;
03503 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 340 of file Ge.c. References geBoolean, GENESISAPI, and Trace_GEWorldCollision(). Referenced by Blaster_Control(), Bot_CanSeePlayerToPlayer(), Bot_CanSeePlayerToPoint(), Bot_CanSeePointToPoint(), Bot_CheckVelocity(), Bot_NudgePlayer(), Bot_OverLedge(), Bot_OverLedgeScan(), Bot_ScanCheckVelocity(), CheckVelocity(), ControlShredderFx(), Corona_Frame(), FireBlaster(), FireRocket(), FireShredder(), Grenade_Control(), MovePlayerUpStep(), PathPoint_Frame2(), RadiusDammage(), Rocket_Control(), and SendPlayersToClients().
00341 {
00342 return Trace_GEWorldCollision(World, Mins, Maxs, Front, Back, Contents, CollideFlags, UserFlags, CollisionCB, Context, Col);
00343 }
|
|
|
Definition at line 357 of file World.c.
00358 {
00359 geWorld *NewWorld;
00360 int32 i;
00361 geWorld_Model *Models;
00362
00363 NewWorld = GE_RAM_ALLOCATE_STRUCT(geWorld);
00364
00365 if (!NewWorld)
00366 {
00367 geErrorLog_Add(GE_ERR_OUT_OF_MEMORY, NULL);
00368 return NULL;
00369 }
00370
00371 memset(NewWorld, 0, sizeof(geWorld));
00372
00373 // Create a ref on the world now, so if there is an error, it will free what is in the world...
00374 geWorld_CreateRef(NewWorld);
00375
00376 if ( ! List_Start() )
00377 goto Error;
00378
00379 if (!File)
00380 {
00381 geVec3d TMins = {-1000.0f, -1000.0f, -1000.0f};
00382 geVec3d TMaxs = { 1000.0f, 1000.0f, 1000.0f};
00383
00384 NewWorld->CurrentBSP = World_CreateBSPFromBox(&TMins, &TMaxs);
00385 }
00386 else
00387 {
00388 assert(File != NULL);
00389
00390 NewWorld->CurrentBSP = CreateGBSP(File);
00391 }
00392
00393 // The world has changed
00394 NewWorld->Changed = GE_TRUE;
00395
00396 if (!NewWorld->CurrentBSP)
00397 goto Error;
00398
00399 assert(NewWorld->CurrentBSP->BSPData.NumGFXLeafs > 0);
00400
00401 // Create the leafdata array
00402 NewWorld->CurrentBSP->LeafData = GE_RAM_ALLOCATE_ARRAY(geWorld_Leaf, NewWorld->CurrentBSP->BSPData.NumGFXLeafs);
00403
00404 if (!NewWorld->CurrentBSP->LeafData)
00405 goto Error;
00406
00407 memset(NewWorld->CurrentBSP->LeafData, 0, sizeof(geWorld_Leaf)*NewWorld->CurrentBSP->BSPData.NumGFXLeafs);
00408
00409 if (!Light_WorldInit(NewWorld))
00410 goto Error;
00411
00412 if (!Ent_WorldInit(NewWorld))
00413 goto Error;
00414
00415 if (!Vis_WorldInit(NewWorld))
00416 goto Error;
00417
00418 if (!Surf_WorldInit(NewWorld))
00419 goto Error;
00420
00421 // Create the wbitmaps out of the GFXTexData
00422 NewWorld->CurrentBSP->WBitmapPool = geWBitmap_Pool_Create(&NewWorld->CurrentBSP->BSPData);
00423
00424 if (!NewWorld->CurrentBSP->WBitmapPool)
00425 goto Error;
00426
00427 #if 1
00428 // HACK
00429 // We can now free the texturedata in the BSP that was loaded off disk.
00430 // Eventually, the BSP disk format will be bitmaps, and no conversion will be needed, JP.
00431 if (NewWorld->CurrentBSP->BSPData.GFXTexData) // Not all worlds have tex data!!!
00432 {
00433 geRam_Free(NewWorld->CurrentBSP->BSPData.GFXTexData);
00434 NewWorld->CurrentBSP->BSPData.GFXTexData = NULL; // This is to assure that FreeGBSPFile does not touch this again
00435 NewWorld->CurrentBSP->BSPData.NumGFXTexData = 0;
00436 }
00437 #endif
00438
00439 // Add all the bitmaps in the WBitmapPool to the world
00440 if (!geWorld_BitmapListInit(NewWorld))
00441 {
00442 geErrorLog_AddString(-1, "geWorld_WorldCreate: geWorld_BitmapListInit failed.", NULL);
00443 return GE_FALSE;
00444 }
00445
00446 // Init user stuff
00447 if (!User_WorldInit(NewWorld))
00448 goto Error;
00449
00450 Models = NewWorld->CurrentBSP->Models;
00451
00452 //#pragma message ("Fixed number of models supported")
00453 for (i=0; i< MAX_MODELS; i++)
00454 {
00455 memset(&Models[i], 0, sizeof(geWorld_Model));
00456
00457 Models[i].VisFrame = -1;
00458
00459 geXForm3d_SetIdentity(&Models[i].XForm);
00460 }
00461
00462 CalcBSPModelInfo(NewWorld->CurrentBSP);
00463
00464 if (!BuildSkyBox(&NewWorld->SkyBox, &NewWorld->CurrentBSP->BSPData.GFXSkyData))
00465 goto Error;
00466
00467 NewWorld->CurrentLeaf = -1; // Make sure the level gets vised for the first time...
00468
00469 NewWorld->ActorCount = 0;
00470 NewWorld->ActorArray = NULL;
00471
00472 //MRB BEGIN
00473 //geSprite
00474 NewWorld->SpriteCount = 0;
00475 NewWorld->SpriteArray = NULL;
00476 //MRB END
00477
00478 if (!CreateStaticFogList(NewWorld))
00479 {
00480 geErrorLog_AddString(-1,"Failed to create static FogList", NULL);
00481 goto Error;
00482 }
00483
00484 return NewWorld;
00485
00486 Error:;
00487 geWorld_Free(NewWorld);
00488
00489 return NULL;
00490 }
|
|
|
Definition at line 495 of file World.c.
00496 {
00497 int i;
00498 geFog *Fog, *Next;
00499 /*extern geActor_Count;
00500 extern geActor_RefCount;
00501 extern geActor_DefCount;
00502 extern geActor_DefRefCount;*/
00503
00504 assert(World);
00505 assert(World->RefCount > 0);
00506
00507 World->RefCount--;
00508
00509 if (World->RefCount > 0)
00510 return; // No need to destroy till ref count goes to zero...
00511
00512 if (World->CurrentBSP)
00513 {
00514 // Shutdown actors
00515 if (World->ActorCount>0)
00516 {
00517 assert( World->ActorArray != NULL );
00518 for (i=0; i< World->ActorCount; i++)
00519 {
00520 if(!geActor_Destroy( &( World->ActorArray[i].Actor ) ))
00521 geErrorLog_AddString(-1, "geWorld_Free: geActor_Destroy failed.", NULL);
00522 }
00523
00524 /*geActor_Count = 0;geActor_DestroyDirect
00525 geActor_RefCount = 0;
00526 geActor_DefCount = 0;
00527 geActor_DefRefCount = 0;*/
00528 World->ActorCount = 0;
00529
00530 }
00531 if (World->ActorArray != NULL)
00532 {
00533 geRam_Free( World->ActorArray );
00534 World->ActorArray = NULL;
00535 }
00536
00537 //MRB BEGIN
00538 //geSprite
00539 // Shutdown sprites
00540 if (World->SpriteCount>0)
00541 {
00542 assert( World->SpriteArray != NULL );
00543 for (i=0; i< World->SpriteCount; i++)
00544 {
00545 geSprite_Destroy( &( World->SpriteArray[i].Sprite ) );
00546 }
00547 World->SpriteCount = 0;
00548 }
00549 if (World->SpriteArray != NULL)
00550 {
00551 geRam_Free( World->SpriteArray );
00552 World->SpriteArray = NULL;
00553 }
00554 //MRB END
00555
00556 assert( World->ActorArray == NULL );
00557
00558 // Call other modules to release info from the world that they created...
00559 #ifdef MESHES
00560 Mesh_WorldShutdown(World);
00561 #endif
00562 Light_WorldShutdown(World);
00563 Ent_WorldShutdown(World);
00564 Vis_WorldShutdown(World);
00565 Surf_WorldShutdown(World);
00566
00567 User_WorldShutdown(World);
00568
00569 if (World->CurrentBSP->WBitmapPool)
00570 {
00571 geWBitmap_Pool_Destroy(World->CurrentBSP->WBitmapPool);
00572 World->CurrentBSP->WBitmapPool = NULL;
00573 }
00574
00575 // Make sure we free all the fog
00576 for (Fog = World->FogList; Fog; Fog = Next)
00577 {
00578 geWorld_FogData *FogData;
00579
00580 Next = Fog->Next;
00581
00582 FogData = (geWorld_FogData*)geFog_GetUserData(Fog);
00583
00584 if (FogData)
00585 geRam_Free(FogData);
00586
00587 geFog_SetUserData(Fog, NULL); // Just in case...
00588
00589 geFog_Destroy(Fog);
00590 }
00591
00592 // Free the leaf data array in the world
00593 if (World->CurrentBSP->LeafData)
00594 {
00595 int32 l;
00596 geWorld_Leaf *pLeafData;
00597
00598 pLeafData = World->CurrentBSP->LeafData;
00599
00600 for (l=0; l< World->CurrentBSP->BSPData.NumGFXLeafs; l++, pLeafData++)
00601 {
00602 if (pLeafData->PolyList)
00603 {
00604 User_DestroyPolyList(World, pLeafData->PolyList);
00605 pLeafData->PolyList = NULL;
00606 }
00607 }
00608
00609 geRam_Free(World->CurrentBSP->LeafData);
00610 World->CurrentBSP->LeafData = NULL;
00611 }
00612
00613 GBSP_FreeGBSPFile(&World->CurrentBSP->BSPData);
00614 geRam_Free(World->CurrentBSP);
00615
00616 // Shutdown the bitmaplist (this should be done last, to give others a chance to remove their bitmaps)
00617 geWorld_BitmapListShutdown(World);
00618 }
00619
00620 geRam_Free(World);
00621
00622 List_Stop();
00623 }
|
|
||||||||||||
|
Definition at line 3434 of file World.c.
03435 {
03436 if (!World->CurrentBSP)
03437 return NULL;
03438
03439 assert(World->CurrentBSP->WBitmapPool);
03440
03441 return geWBitmap_Pool_GetBitmapByName(World->CurrentBSP->WBitmapPool, BitmapName);
03442 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 348 of file Ge.c. References geBoolean, GENESISAPI, and Trace_GetContents(). Referenced by Bot_CheckPosition(), Bot_CheckVelocity(), Bot_GetContents(), Bot_OverLedge(), Bot_ScanCheckVelocity(), CheckPlayer(), CheckVelocity(), Client_Control(), Grenade_Control(), and UpdatePlayerContents().
00349 {
00350 return Trace_GetContents(World, Pos, Mins, Maxs, Flags, UserFlags, CollisionCB, Context, Contents);
00351 }
|
|
||||||||||||
|
Definition at line 2586 of file World.c. References geWorld::EntClassSets, GENESISAPI, int32, NULL, geWorld::NumEntClassSets, and geWorld_EntClassSet::Set. Referenced by Bot_GetActorStart(), Bot_IsActorRespawn(), CheckVelocity(), Corona_Frame(), Corona_Init(), CreateStaticFogList(), DynLight_Frame(), DynLight_Reset(), DynLight_SetWorld(), Electric_Frame(), Electric_Reset(), Electric_SetWorld(), gePuppet_ComputeAmbientLight(), ModelCtl_Frame(), ModelCtl_Reset(), PathPoint_SetTexture(), PathPt_Frame(), PathPt_Startup(), PhysicsObject_Control(), and Server_SpawnWorld().
02587 {
02588 geWorld_EntClassSet *WSets;
02589 int32 i;
02590
02591 assert(World);
02592
02593 // No classname, just return the main set of all entities
02594 if (!ClassName)
02595 {
02596 assert(World->EntClassSets[0].Set);
02597
02598 return World->EntClassSets[0].Set;
02599 }
02600
02601 WSets = World->EntClassSets;
02602
02603 for (i=1; i< World->NumEntClassSets; i++)
02604 {
02605 assert(WSets[i].Set);
02606
02607 if (!stricmp(WSets[i].ClassName, ClassName))
02608 return WSets[i].Set;
02609 }
02610
02611 return NULL;
02612 }
|
|
||||||||||||||||
|
Definition at line 2501 of file World.c. References World_BSP::BSPData, geWorld::CurrentBSP, GE_TRUE, geBoolean, GENESISAPI, GBSP_BSPData::GFXModels, Plane_FindLeaf(), and GFX_Model::RootNode. Referenced by Bot_CanSeePlayerToPlayer(), Bot_CanSeePlayerToPoint(), Bot_CanSeePointToPoint(), Corona_Frame(), Electric_Frame(), geFog_SetAttributesCB(), geSound3D_GetConfig(), geSound3D_GetConfigIgnoreObstructions(), geWorld_IsActorPotentiallyVisible(), geWorld_IsSpritePotentiallyVisible(), RenderScene(), and SendPlayersToClients().
02502 {
02503 assert(World);
02504 assert(Leaf);
02505
02506 // Return the leaf that is model 0 (the main world model)
02507 *Leaf = Plane_FindLeaf(World, World->CurrentBSP->BSPData.GFXModels[0].RootNode[0], Pos);
02508
02509 return GE_TRUE;
02510 }
|
|
||||||||||||||||
|
Definition at line 2193 of file World.c.
|
|
||||||||||||||||
|
Definition at line 2064 of file World.c.
|
|
||||||||||||
|
Definition at line 2617 of file World.c. References BSPData, World_BSP::BSPData, geWorld::CurrentBSP, GENESISAPI, int32, World_BSP::Models, NULL, and GBSP_BSPData::NumGFXModels. Referenced by GameMgr_SetWorld().
02618 {
02619 int32 MNum;
02620 GBSP_BSPData *BSPData;
02621 World_BSP *WorldBSP;
02622
02623 assert(World != NULL);
02624
02625 WorldBSP = World->CurrentBSP;
02626
02627 assert(WorldBSP != NULL);
02628
02629 BSPData = &WorldBSP->BSPData;
02630
02631 if (Start)
02632 {
02633 MNum = (Start - WorldBSP->Models);
02634
02635 assert(MNum >= 0);
02636 assert(MNum < BSPData->NumGFXModels);
02637
02638 MNum++;
02639 }
02640 else
02641 MNum = 0;
02642
02643 if (MNum >= BSPData->NumGFXModels)
02644 return NULL; // No more models
02645
02646 return &WorldBSP->Models[MNum];
02647 }
|
|
||||||||||||||||||||||||
|
Definition at line 358 of file Ge.c. References geBoolean, GENESISAPI, and Trace_GetTexureName().
00359 {
00360 return Trace_GetTexureName(World, Pos, Mins, Maxs, TexName);
00361 }
|
|
||||||||||||
|
Definition at line 3481 of file World.c. References geWorld::AttachedBitmaps, BitmapList_Has(), geBoolean, and GENESISAPI. Referenced by RenderFace(), RenderSkyThroughFrustum(), RenderTexturedPoint(), RenderTexturedPoly(), and RenderTransPoly().
03482 {
03483 assert(World);
03484 assert(World->AttachedBitmaps);
03485
03486 return BitmapList_Has((BitmapList*)World->AttachedBitmaps, (geBitmap*)Bitmap);
03487 }
|
|
||||||||||||||||
|
Definition at line 791 of file World.c. References GE_Rect::Bottom, GE_FALSE, GE_TRUE, geActor_GetRenderHintExtBox(), geActor_IsValid(), geBoolean, geCamera_GetCameraSpaceXForm(), geCamera_GetClippingRect(), geCamera_GetWorldSpaceVisXForm(), geCamera_Project(), geExtBox_GetTranslation(), GENESISAPI, GENESISCC, geVec3d_Set(), geWorld_GetLeaf(), geWorld_LeafMightSeeLeaf(), geXForm3d_Transform(), int32, GE_Rect::Left, geExtBox::Max, geExtBox::Min, NULL, GE_Rect::Right, GE_Rect::Top, geXForm3d::Translation, V, geVec3d::X, geVec3d::Y, and geVec3d::Z.
00793 {
00794 #pragma message ("This is a fairly poor test: ")
00795 // mirrors aren't checked.
00796 // this doesn't check the extents of the actor, just the center point.
00797 // if the render hint box isn't set, should this return true, or find the DynamicExtBox?
00798 geExtBox Box;
00799 geBoolean Enabled;
00800 geVec3d Center;
00801 const geXForm3d *CameraTransform;
00802 int32 Leaf,CameraLeaf;
00803
00804 assert( World != NULL );
00805 assert( geActor_IsValid(Actor)!= GE_FALSE );
00806 assert( Camera != NULL );
00807
00808 geActor_GetRenderHintExtBox(Actor,&Box,&Enabled);
00809 if (Enabled == GE_FALSE)
00810 return GE_TRUE;
00811 geExtBox_GetTranslation ( &Box, &Center );
00812 // NOTE - We are not taking into acount that a actor may live in more than one leaf...
00813 geWorld_GetLeaf(World, &Center, &Leaf);
00814
00815 CameraTransform = geCamera_GetWorldSpaceVisXForm( Camera );
00816 geWorld_GetLeaf(World, &(CameraTransform->Translation), &CameraLeaf);
00817
00818 #pragma message ("geWorld_MightSeeLeaf would be WAY FASTER here, but would be a frame behind...")
00819 if (geWorld_LeafMightSeeLeaf(World, Leaf, CameraLeaf, 0 )==GE_FALSE)
00820 return GE_FALSE;
00821
00822 {
00823 // perhaps this should be a 'geCamera_IsExtBoxOnScreen(Camera,Box)' function?
00824 // see if the hint box is visible on the screen.
00825 // (transform and project it to the screen, then check extents of that projection
00826 // against the clipping rect)
00827 #pragma message ("This should use frustum in world space, and use Trace_BoxOnPlaneSides with frustum planes...")
00828 geRect ClippingRect;
00829 geVec3d BoxCorners[8];
00830 const geXForm3d *ObjectToCamera;
00831 geVec3d Maxs,Mins;
00832 #define BIG_NUMBER (99e9f)
00833 int i;
00834
00835 geCamera_GetClippingRect(Camera,&ClippingRect);
00836 BoxCorners[0] = Box.Min;
00837 BoxCorners[1] = BoxCorners[0]; BoxCorners[1].X = Box.Max.X;
00838 BoxCorners[2] = BoxCorners[0]; BoxCorners[2].Y = Box.Max.Y;
00839 BoxCorners[3] = BoxCorners[0]; BoxCorners[3].Z = Box.Max.Z;
00840 BoxCorners[4] = Box.Max;
00841 BoxCorners[5] = BoxCorners[4]; BoxCorners[5].X = Box.Min.X;
00842 BoxCorners[6] = BoxCorners[4]; BoxCorners[6].Y = Box.Min.Y;
00843 BoxCorners[7] = BoxCorners[4]; BoxCorners[7].Z = Box.Min.Z;
00844
00845 ObjectToCamera = geCamera_GetCameraSpaceXForm(Camera);
00846 assert( ObjectToCamera );
00847
00848 geVec3d_Set(&Maxs,-BIG_NUMBER,-BIG_NUMBER,-BIG_NUMBER);
00849 geVec3d_Set(&Mins, BIG_NUMBER, BIG_NUMBER, BIG_NUMBER);
00850 for (i=0; i<8; i++)
00851 {
00852 geVec3d V;
00853 geXForm3d_Transform( ObjectToCamera,&(BoxCorners[i]),&(BoxCorners[i]));
00854 geCamera_Project( Camera,&(BoxCorners[i]),&V);
00855 if (V.X > Maxs.X ) Maxs.X = V.X;
00856 if (V.X < Mins.X ) Mins.X = V.X;
00857 if (V.Y > Maxs.Y ) Maxs.Y = V.Y;
00858 if (V.Y < Mins.Y ) Mins.Y = V.Y;
00859 if (V.Z > Maxs.Z ) Maxs.Z = V.Z;
00860 if (V.Z < Mins.Z ) Mins.Z = V.Z;
00861 }
00862
00863 if ( (Maxs.X < ClippingRect.Left)
00864 || (Mins.X > ClippingRect.Right)
00865 || (Maxs.Y < ClippingRect.Top)
00866 || (Mins.Y > ClippingRect.Bottom)
00867 || (Maxs.Z < 0.0f) )
00868 {
00869 return GE_FALSE;
00870 }
00871 }
00872
00873 return GE_TRUE;
00874
00875 }
|
|
||||||||||||||||
|
Definition at line 879 of file World.c. References GE_FALSE, GE_TRUE, geBoolean, geCamera_GetWorldSpaceVisXForm(), GENESISAPI, GENESISCC, geSprite_GetPosition(), geSprite_IsValid(), geWorld_GetLeaf(), geWorld_LeafMightSeeLeaf(), int32, NULL, and geXForm3d::Translation.
00880 {
00881 #pragma message ("This is a fairly poor test: ")
00882 // mirrors aren't checked.
00883 // this doesn't check the extents of the sprite, just the center point.
00884 geVec3d Center;
00885 const geXForm3d *CameraTransform;
00886 int32 Leaf,CameraLeaf;
00887
00888 assert( World != NULL );
00889 assert( geSprite_IsValid(Sprite)!= GE_FALSE );
00890 assert( Camera != NULL );
00891
00892 geSprite_GetPosition ( Sprite, &Center );
00893
00894 // NOTE - We are not taking into acount that a sprite may live in more than one leaf...
00895 geWorld_GetLeaf(World, &Center, &Leaf);
00896
00897 CameraTransform = geCamera_GetWorldSpaceVisXForm( Camera );
00898 geWorld_GetLeaf(World, &(CameraTransform->Translation), &CameraLeaf);
00899
00900 #pragma message ("geWorld_MightSeeLeaf would be WAY FASTER here, but would be a frame behind...")
00901 if (geWorld_LeafMightSeeLeaf(World, Leaf, CameraLeaf, 0 )==GE_FALSE)
00902 return GE_FALSE;
00903
00904 return GE_TRUE;
00905 }
|
|
||||||||||||||||||||
|
Definition at line 2530 of file World.c. References GFX_Leaf::Area, World_BSP::AreaConnections, BSPData, World_BSP::BSPData, GFX_Leaf::Cluster, geWorld::CurrentBSP, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GBSP_BSPData::GFXClusters, GBSP_BSPData::GFXLeafs, GBSP_BSPData::GFXVisData, int32, uint8, and GFX_Cluster::VisOfs. Referenced by Bot_CanSeePlayerToPlayer(), Bot_CanSeePlayerToPoint(), Bot_CanSeePointToPoint(), geSound3D_GetConfig(), geSound3D_GetConfigIgnoreObstructions(), geWorld_IsActorPotentiallyVisible(), geWorld_IsSpritePotentiallyVisible(), and SendPlayersToClients().
02531 {
02532 GBSP_BSPData *BSPData;
02533 int32 Cluster1, Cluster2, VisOfs;
02534 uint8 *VisData;
02535
02536 assert(World);
02537 assert(World->CurrentBSP);
02538 assert(VisFlags == 0); // VisFlags are not used, and must be set to 0 for future use...
02539
02540 BSPData = &World->CurrentBSP->BSPData;
02541
02542 assert(Leaf1 >= 0 && Leaf1 < BSPData->NumGFXLeafs);
02543 assert(Leaf2 >= 0 && Leaf2 < BSPData->NumGFXLeafs);
02544
02545 // Get the clusters that the leafs are in...
02546 Cluster1 = BSPData->GFXLeafs[Leaf1].Cluster;
02547 Cluster2 = BSPData->GFXLeafs[Leaf2].Cluster;
02548
02549 if (Cluster1 == -1 || Cluster2 == -1)
02550 return GE_FALSE; // If either on is in solid space, thern assume they can't see each other...
02551
02552 assert(Cluster1 >= 0 && Cluster1 < BSPData->NumGFXClusters);
02553 assert(Cluster2 >= 0 && Cluster2 < BSPData->NumGFXClusters);
02554
02555 VisOfs = BSPData->GFXClusters[Cluster1].VisOfs;
02556
02557 // If no vis data for cluster 1, then assume no vis data in entire map, and just return TRUE...
02558 // This lets them run the map with no vis info, they will just suffer...
02559 if (VisOfs == -1)
02560 return GE_TRUE;
02561
02562 assert(VisOfs >=0 && VisOfs < BSPData->NumGFXVisData);
02563
02564 VisData = &BSPData->GFXVisData[VisOfs];
02565
02566 // See if Cluster2's bit is set in Cluster1's vis data set
02567 if (VisData[Cluster2>>3] & (1<<(Cluster2&7)) )
02568 {
02569 int32 Area1, Area2;
02570
02571 Area1 = BSPData->GFXLeafs[Leaf1].Area;
02572 Area2 = BSPData->GFXLeafs[Leaf2].Area;
02573
02574 assert(Area1 > 0 && Area2 > 0);
02575
02576 if (World->CurrentBSP->AreaConnections[Area1][Area2])
02577 return GE_TRUE; // They can see each other...
02578 }
02579
02580 return GE_FALSE; // They cannot see each other...
02581 }
|
|
||||||||||||
|
Definition at line 2515 of file World.c. References geWorld::CurFrameStatic, geWorld::CurrentBSP, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, World_BSP::LeafData, and geWorld_Leaf::VisFrame. Referenced by Corona_Frame(), and Electric_Frame().
02516 {
02517 assert(World);
02518
02519 assert(Leaf >= 0 && Leaf < World->CurrentBSP->BSPData.NumGFXLeafs);
02520
02521 if (World->CurrentBSP->LeafData[Leaf].VisFrame == World->CurFrameStatic)
02522 return GE_TRUE;
02523
02524 return GE_FALSE;
02525 }
|
|
||||||||||||||||||||
|
Definition at line 320 of file Ge.c. References GE_Collision::Actor, geBoolean, GENESISAPI, GE_Collision::Impact, GE_Collision::Mesh, GE_Collision::Model, NULL, and Trace_ModelCollision().
|
|
||||||||||||||||||||
|
Definition at line 2210 of file World.c. References GE_TRUE, geBoolean, GENESISAPI, int32, geWorld_Model::Maxs, geWorld_Model::Mins, NULL, geWorld_Model::Pivot, and VectorToSUB. Referenced by PhysicsObject_Control(), and PhysicsObject_Spawn().
02211 {
02212 int32 i;
02213
02214 assert(World != NULL);
02215 assert(Model != NULL);
02216 assert(Mins);
02217 assert(Maxs);
02218
02219 *Mins = Model->Mins;
02220 *Maxs = Model->Maxs;
02221
02222 // Translate the BBox to object space
02223 for (i=0; i<3; i++)
02224 {
02225 VectorToSUB(*Mins, i) -= VectorToSUB(Model->Pivot, i);
02226 VectorToSUB(*Maxs, i) -= VectorToSUB(Model->Pivot, i);
02227 }
02228
02229 return GE_TRUE;
02230 }
|
|
||||||||||||
|
Definition at line 2278 of file World.c.
02279 {
02280 *Center = Model->RealCenter;
02281
02282 return;
02283 }
|
|
|
Definition at line 2267 of file World.c. References geWorld_Model::Flags, GENESISAPI, and uint32.
02268 {
02269 assert(Model);
02270
02271 return Model->Flags;
02272 }
|
|
|
Definition at line 2235 of file World.c.
|
|
|
Definition at line 2243 of file World.c.
02244 {
02245 assert(Model);
02246 return Model->UserData;
02247 }
|
|
||||||||||||
|
Definition at line 2259 of file World.c. References geWorld_Model::Flags, and GENESISAPI.
02260 {
02261 assert(Model);
02262 Model->Flags = ModelFlags;
02263 }
|
|
||||||||||||
|
Definition at line 2251 of file World.c.
02252 {
02253 assert(Model);
02254 Model->UserData = UserData;
02255 }
|
|
||||||||||||||||
|
Definition at line 2108 of file World.c. References World_BSP::AreaConnections, GFX_Model::Areas, World_BSP::BSPData, geWorld::CurrentBSP, FillAreas_r(), geWorld::ForceVis, GE_TRUE, geBoolean, GENESISAPI, geWorld_Model::GFXModelNum, GBSP_BSPData::GFXModels, int32, geWorld_Model::Open, and uint8. Referenced by CheckClientPlayerChanges().
02109 {
02110 World_BSP *WBSP;
02111 int32 a0, a1;
02112 GFX_Model *GFXModel;
02113 #if 0
02114 int32 i0, i1;
02115 int32 NumWorkAreas0;
02116 uint8 WorkAreas0[256];
02117 int32 NumWorkAreas1;
02118 uint8 WorkAreas1[256];
02119 #endif
02120
02121 assert(World);
02122 assert(Model);
02123
02124 if (Model->Open == Open)
02125 return GE_TRUE; // Nothing changed
02126
02127 Model->Open = Open;
02128 World->ForceVis = GE_TRUE; // Force an update
02129
02130 WBSP = World->CurrentBSP;
02131
02132 GFXModel = &WBSP->BSPData.GFXModels[Model->GFXModelNum];
02133
02134 a0 = GFXModel->Areas[0];
02135 a1 = GFXModel->Areas[1];
02136
02137 // We know these 2 can see each other
02138 WBSP->AreaConnections[a0][a1] = Open;
02139 WBSP->AreaConnections[a1][a0] = Open;
02140
02141 #if 0
02142 NumWorkAreas0 = NumWorkAreas1 = 0;
02143
02144 if (Open)
02145 {
02146 // Combine list into one, and combine vis sets
02147 FillAreas_r(World, a0, WorkAreas0, &NumWorkAreas0);
02148 FillAreas_r(World, a1, WorkAreas0, &NumWorkAreas0);
02149
02150 // Connect all areas that were flooded into on each side
02151 for (i0=0; i0<NumWorkAreas0; i0++)
02152 {
02153 uint8 *pWork0, *pWork1;
02154
02155 pWork0 = &WorkAreas0[i0];
02156 pWork1 = WorkAreas0;
02157
02158 for (i1=0; i1<NumWorkAreas0; i1++, pWork1++)
02159 {
02160 WBSP->AreaConnections[*pWork0][*pWork1] = 1;
02161 WBSP->AreaConnections[*pWork1][*pWork0] = 1;
02162 }
02163 }
02164 }
02165 else
02166 {
02167 // Seperate list into two list, and seperate vis list
02168 FillAreas_r(World, a0, WorkAreas0, &NumWorkAreas0);
02169 FillAreas_r(World, a1, WorkAreas1, &NumWorkAreas1);
02170
02171 // Seperate visiblity from one side to the other
02172 for (i0=0; i0<NumWorkAreas0; i0++)
02173 {
02174 uint8 *pWork0, *pWork1;
02175
02176 pWork0 = &WorkAreas0[i0];
02177 pWork1 = WorkAreas1;
02178
02179 for (i1=0; i1<NumWorkAreas1; i1++, pWork1++)
02180 {
02181 WBSP->AreaConnections[*pWork0][*pWork1] = 0;
02182 WBSP->AreaConnections[*pWork1][*pWork0] = 0;
02183 }
02184 }
02185 }
02186 #endif
02187
02188 return GE_TRUE;
02189 }
|
|
||||||||||||
|
Definition at line 2326 of file World.c. References World_Actor::Actor, geWorld::ActorArray, geWorld::ActorCount, World_Actor::Flags, GE_FALSE, GE_TRUE, geActor_Destroy(), geActor_IsValid(), geBoolean, geErrorLog_AddString, GENESISAPI, and NULL. Referenced by CheckClientPlayerChanges(), Client_DestroyPlayerWorldObjects(), DoSplashScreen(), GameMgr_FreeWorld(), and UpdatePlayers().
02327 {
02328 int i,Count;
02329 assert( World != NULL );
02330 assert( geActor_IsValid(Actor) != GE_FALSE );
02331 assert( World->ActorCount >= 0 );
02332
02333 Count = World->ActorCount;
02334
02335 #ifdef DO_ADDREMOVE_MESSAGES
02336 {
02337 char str[100];
02338 sprintf(str,"World_RemoveActor : %08X\n",Actor);
02339 OutputDebugString(str);
02340 }
02341 #endif
02342
02343 for (i=0; i<Count; i++)
02344 {
02345 if (World->ActorArray[i].Actor == Actor)
02346 {
02347 geActor_Destroy( &Actor );
02348 World->ActorArray[i] = World->ActorArray[Count-1];
02349 World->ActorArray[Count-1].Actor = NULL;
02350 World->ActorArray[Count-1].Flags = 0;
02351 World->ActorCount--;
02352 return GE_TRUE;
02353 }
02354 }
02355 geErrorLog_AddString(-1,"Failed to find actor in actor list", NULL);
02356
02357 return GE_FALSE;
02358 }
|
|
||||||||||||
|
Definition at line 3394 of file World.c. References geWorld::AttachedBitmaps, BitmapList_Remove(), geWorld::Changed, GE_FALSE, GE_TRUE, geBoolean, and GENESISAPI.
03395 {
03396
03397 assert(World);
03398 assert(Bitmap);
03399 assert(World->AttachedBitmaps);
03400
03401 if (!World->AttachedBitmaps)
03402 return GE_FALSE;
03403
03404 if ( BitmapList_Remove(World->AttachedBitmaps, Bitmap) )
03405 {
03406 World->Changed = GE_TRUE;
03407
03408 #ifdef DO_ADDREMOVE_MESSAGES
03409 {
03410 char str[100];
03411 sprintf(str,"World_RemoveBitmap : %08X : removed\n",Bitmap);
03412 OutputDebugString(str);
03413 }
03414 #endif
03415 }
03416 else
03417 {
03418 #ifdef DO_ADDREMOVE_MESSAGES
03419 {
03420 char str[100];
03421 sprintf(str,"World_RemoveBitmap : %08X : left\n",Bitmap);
03422 OutputDebugString(str);
03423 }
03424 #endif
03425 }
03426
03427
03428 return GE_TRUE;
03429 }
|
|
||||||||||||
|
Definition at line 2736 of file World.c. References geWorld::FogList, GE_TRUE, geBoolean, geFog_Destroy(), geFog_GetUserData(), geFog_SetUserData(), GENESISAPI, geRam_Free, geFog::Next, NULL, and geFog::Prev. Referenced by CreateStaticFogList(), and geWorld_AddFog().
02737 {
02738 geWorld_FogData *FogData;
02739
02740 assert(World);
02741 assert(Fog);
02742
02743 FogData = geFog_GetUserData(Fog);
02744
02745 if (FogData)
02746 geRam_Free(FogData);
02747
02748 geFog_SetUserData(Fog, NULL); // Just in case
02749
02750 if (Fog->Prev)
02751 Fog->Prev->Next = Fog->Next;
02752
02753 if (Fog->Next)
02754 Fog->Next->Prev = Fog->Prev;
02755
02756 if (Fog == World->FogList)
02757 {
02758 assert(Fog->Prev == NULL);
02759 World->FogList = Fog->Next;
02760 }
02761
02762 geFog_Destroy(Fog);
02763
02764 return GE_TRUE;
02765 }
|
|
||||||||||||
|
Definition at line 266 of file Ge.c. References GENESISAPI, Light_WorldRemoveLight(), and NULL. Referenced by CheckClientPlayerChanges(), Client_DestroyPlayerWorldObjects(), and UpdatePlayers().
00267 {
00268 assert(World != NULL);
00269 assert(Light != NULL);
00270
00271 Light_WorldRemoveLight(World, (Light_DLight*)Light);
00272 }
|
|
||||||||||||
|
Definition at line 1053 of file User.c.
01054 {
01055 assert(World != NULL);
01056 assert(Poly != NULL);
01057 assert(geWorld_PolyIsValid(Poly));
01058
01059 // Remove the poly from the leaf that it is in (it must be in one. or it would not have been added to the world)
01060 geWorld_UnLinkPolyFromLeaf(Poly);
01061
01062 World->ActiveUserPolys--;
01063
01064 geRam_Free(Poly);
01065 }
|
|
||||||||||||
|
Definition at line 2431 of file World.c. References World_Sprite::Flags, GE_FALSE, GE_TRUE, geBoolean, geErrorLog_AddString, GENESISAPI, geSprite_Destroy(), geSprite_IsValid(), NULL, World_Sprite::Sprite, geWorld::SpriteArray, and geWorld::SpriteCount.
02432 {
02433 int i, Count;
02434
02435 assert( World );
02436 assert( geSprite_IsValid(Sprite) );
02437 assert( World->SpriteCount >= 0 );
02438
02439 Count = World->SpriteCount;
02440
02441 #ifdef DO_ADDREMOVE_MESSAGES
02442 {
02443 char str[100];
02444
02445 sprintf(str,"World_RemoveSprite : %08X\n",Sprite);
02446 OutputDebugString(str);
02447 }
02448 #endif
02449
02450 for (i=0; i < Count; i++)
02451 {
02452 if (World->SpriteArray[i].Sprite == Sprite)
02453 {
02454 geSprite_Destroy( &Sprite );
02455
02456 World->SpriteArray[i] = World->SpriteArray[Count-1];
02457
02458 World->SpriteArray[Count-1].Sprite = NULL;
02459 World->SpriteArray[Count-1].Flags = 0;
02460
02461 World->SpriteCount--;
02462
02463 return GE_TRUE;
02464 }
02465 }
02466
02467 geErrorLog_AddString(-1,"Failed to find actor in actor list", NULL);
02468
02469 return GE_FALSE;
02470 }
|
|
||||||||||||||||
|
Definition at line 2362 of file World.c. References World_Actor::Actor, geWorld::ActorArray, geWorld::ActorCount, World_Actor::Flags, GE_FALSE, GE_TRUE, geActor_IsValid(), geBoolean, geErrorLog_AddString, GENESISAPI, and NULL. Referenced by SetClientProxyPlayer().
02363 {
02364 int i,Count;
02365 assert( World != NULL );
02366 assert( geActor_IsValid(Actor) != GE_FALSE );
02367
02368 Count = World->ActorCount;
02369
02370 for (i=0; i<Count; i++)
02371 {
02372 if (World->ActorArray[i].Actor == Actor)
02373 {
02374 World->ActorArray[i].Flags = Flags;
02375 return GE_TRUE;
02376 }
02377 }
02378 geErrorLog_AddString(-1,"Failed to find actor in actor list", NULL);
02379 return GE_FALSE;
02380 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 277 of file Ge.c. References geBoolean, GENESISAPI, Light_SetAttributes(), and NULL. Referenced by AddBoneLight(), Client_UpdateSinglePlayer(), DoSplashScreen(), and DynLight_Frame().
00283 {
00284 assert(World != NULL);
00285 assert(Light != NULL);
00286 assert(Pos != NULL);
00287 assert(RGBA != NULL);
00288
00289 return Light_SetAttributes((Light_DLight*)Light, Pos, RGBA, Radius, CastShadow);
00290 }
|
|
||||||||||||||||
|
Definition at line 295 of file Ge.c. References geBoolean, GENESISAPI, Light_WorldSetLTypeTable(), and NULL. Referenced by GameMgr_SetWorld().
00296 {
00297 assert(World != NULL);
00298 assert(Table != NULL);
00299
00300 return Light_WorldSetLTypeTable(World, LType, Table);
00301 }
|
|
||||||||||||||||
|
Definition at line 1999 of file World.c.
02000 {
02001 geVec3d AxisVecs[3], Center;
02002 int i, j;
02003
02004 assert(World != NULL);
02005 assert(Model != NULL);
02006
02007 Model->XForm = *XForm;
02008 memset(AxisVecs, 0, sizeof(geVec3d)*3);
02009
02010 //grab the box center
02011 geVec3d_Add(&Model->Mins, &Model->Maxs, &Center);
02012 geVec3d_Scale(&Center, 0.5f, &Center);
02013
02014 //build a local rotated axis based on extent vectors
02015 //(this could be simplified to less fmuls)
02016 for(i=0;i < 3;i++)
02017 {
02018 VectorToSUB(AxisVecs[i], i) =VectorToSUB(Model->Maxs, i) - VectorToSUB(Center, i);
02019 geXForm3d_Rotate(XForm, &AxisVecs[i], &AxisVecs[i]);
02020 }
02021
02022 //mask off the sign bits
02023 for(i=0;i < 3;i++)
02024 {
02025 for(j=0;j < 3;j++)
02026 {
02027 *((int *)(&AxisVecs[i])+j) =*((int *)(&AxisVecs[i])+j) & 0x7fffffff;
02028 }
02029 }
02030
02031 //add up vecs to get max
02032 for(i=0;i < 3;i++)
02033 {
02034 VectorToSUB(Model->TMaxs, i)
02035 =VectorToSUB(AxisVecs[0], i)
02036 + VectorToSUB(AxisVecs[1], i)
02037 + VectorToSUB(AxisVecs[2], i);
02038 }
02039
02040 //local min is opposite of max
02041 Model->TMins =Model->TMaxs;
02042 geVec3d_Inverse(&Model->TMins);
02043
02044 //move back to world
02045 geVec3d_Add(&XForm->Translation, &Center, &Center);
02046 geVec3d_Add(&Model->TMins, &Center, &Model->TMins);
02047 geVec3d_Add(&Model->TMaxs, &Center, &Model->TMaxs);
02048
02049 //add a small epsilon
02050 for(i=0;i < 3;i++)
02051 {
02052 VectorToSUB(Model->TMaxs, i) +=1.0f;
02053 VectorToSUB(Model->TMins, i) -=1.0f;
02054 }
02055
02056 Model->ChangedFlags |= MODEL_CHANGED_XFORM;
02057
02058 return GE_TRUE;
02059 }
|
|
||||||||||||||||
|
Definition at line 2474 of file World.c. References World_Sprite::Flags, GE_FALSE, GE_TRUE, geBoolean, geErrorLog_AddString, GENESISAPI, geSprite_IsValid(), NULL, World_Sprite::Sprite, geWorld::SpriteArray, and geWorld::SpriteCount.
02475 {
02476 int i, Count;
02477
02478 assert( World );
02479 assert( geSprite_IsValid(Sprite) );
02480
02481 Count = World->SpriteCount;
02482
02483 for (i = 0; i < Count; i++)
02484 {
02485 if (World->SpriteArray[i].Sprite == Sprite)
02486 {
02487 World->SpriteArray[i].Flags = Flags;
02488 return GE_TRUE;
02489 }
02490 }
02491
02492 geErrorLog_AddString(-1,"Failed to find actor in actor list", NULL);
02493
02494 return GE_FALSE;
02495 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 306 of file Ge.c. References geBoolean, GENESISAPI, and Trace_TestModelMove(). Referenced by Client_MovePlayerModel(), and Server_MovePlayerModel().
00311 {
00312 return Trace_TestModelMove( World, Model, DXForm,
00313 Mins, Maxs,
00314 In, Out);
00315 }
|
1.3.2