#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 }
|
|