void CMiniMap::HandleMessage(SGUIMessage& Message) { switch (Message.type) { case GUIM_MOUSE_PRESS_LEFT: if (m_MouseHovering) { SetCameraPos(); m_Clicking = true; } break; case GUIM_MOUSE_RELEASE_LEFT: if (m_MouseHovering && m_Clicking) SetCameraPos(); m_Clicking = false; break; case GUIM_MOUSE_DBLCLICK_LEFT: if (m_MouseHovering && m_Clicking) SetCameraPos(); m_Clicking = false; break; case GUIM_MOUSE_ENTER: m_MouseHovering = true; break; case GUIM_MOUSE_LEAVE: m_Clicking = false; m_MouseHovering = false; break; case GUIM_MOUSE_RELEASE_RIGHT: CMiniMap::FireWorldClickEvent(SDL_BUTTON_RIGHT, 1); break; case GUIM_MOUSE_DBLCLICK_RIGHT: CMiniMap::FireWorldClickEvent(SDL_BUTTON_RIGHT, 2); break; case GUIM_MOUSE_MOTION: if (m_MouseHovering && m_Clicking) SetCameraPos(); break; case GUIM_MOUSE_WHEEL_DOWN: case GUIM_MOUSE_WHEEL_UP: Message.Skip(); break; default: break; } }
void CGLTouch::CreateObjects() { if(0) { m_img1.Make(8*3,6.4*3, 1); m_img1.SetUV(800,640); m_img1.ReloadTexture(0,"../_image/bg_frog_800x640.png"); } else { m_img1.Make(6.4*3,4.8*3, 1); m_img1.SetUV(640,480); m_img1.ReloadTexture(0,"../_image/bg_frog_640x480.png"); } SetCameraPos(dhVector(-9.6,-7.2, -26.9)); //SetCameraPos(dhVector(-10,-7,0)); }
COpenGL_3D::COpenGL_3D() { m_WindowWidth = m_WindowHeight = 0; // window sizes SetCameraPos(0, 0, -3); CameraToWorldCenter(); }
void DeadPlayerFrame (void) { fix xTimeDead, h; CFixVector fVec; if (gameStates.app.bPlayerIsDead) { xTimeDead = gameData.time.xGame - gameStates.app.nPlayerTimeOfDeath; // If unable to create camera at time of death, create now. if (!gameData.objs.deadPlayerCamera) { CObject *playerP = OBJECTS + LOCALPLAYER.nObject; int nObject = CreateCamera (playerP); if (nObject != -1) gameData.objs.viewerP = gameData.objs.deadPlayerCamera = OBJECTS + nObject; else Int3 (); } h = DEATH_SEQUENCE_EXPLODE_TIME - xTimeDead; h = max (0, h); gameData.objs.consoleP->mType.physInfo.rotVel = CFixVector::Create(h / 4, h / 2, h / 3); xCameraToPlayerDistGoal = min (xTimeDead * 8, I2X (20)) + gameData.objs.consoleP->info.xSize; SetCameraPos (&gameData.objs.deadPlayerCamera->info.position.vPos, gameData.objs.consoleP); fVec = gameData.objs.consoleP->info.position.vPos - gameData.objs.deadPlayerCamera->info.position.vPos; gameData.objs.deadPlayerCamera->info.position.mOrient = CFixMatrix::CreateF(fVec); if (xTimeDead > DEATH_SEQUENCE_EXPLODE_TIME) { if (!gameStates.app.bPlayerExploded) { if (LOCALPLAYER.hostages.nOnBoard > 1) HUDInitMessage (TXT_SHIP_DESTROYED_2, LOCALPLAYER.hostages.nOnBoard); else if (LOCALPLAYER.hostages.nOnBoard == 1) HUDInitMessage (TXT_SHIP_DESTROYED_1); else HUDInitMessage (TXT_SHIP_DESTROYED_0); #ifdef TACTILE if (TactileStick) ClearForces (); #endif gameStates.app.bPlayerExploded = 1; if (gameData.app.nGameMode & GM_NETWORK) { AdjustMineSpawn (); MultiCapObjects (); } DropPlayerEggs (gameData.objs.consoleP); gameStates.app.bPlayerEggsDropped = 1; if (IsMultiGame) MultiSendPlayerExplode (MULTI_PLAYER_EXPLODE); gameData.objs.consoleP->ExplodeBadassPlayer (); //is this next line needed, given the badass call above? gameData.objs.consoleP->Explode (0); gameData.objs.consoleP->info.nFlags &= ~OF_SHOULD_BE_DEAD; //don't really kill CPlayerData gameData.objs.consoleP->info.renderType = RT_NONE; //..just make him disappear gameData.objs.consoleP->SetType (OBJ_GHOST); //..and kill intersections LOCALPLAYER.flags &= ~PLAYER_FLAGS_HEADLIGHT_ON; #if 0 if (gameOpts->gameplay.bFastRespawn) gameStates.app.bDeathSequenceAborted = 1; #endif } } else { if (d_rand () < gameData.time.xFrame * 4) { if (gameData.app.nGameMode & GM_MULTI) MultiSendCreateExplosion (gameData.multiplayer.nLocalPlayer); CreateSmallFireballOnObject (gameData.objs.consoleP, I2X (1), 1); } } if (gameStates.app.bDeathSequenceAborted) { //xTimeDead > DEATH_SEQUENCE_LENGTH) { StopPlayerMovement (); gameStates.app.bEnterGame = 2; if (!gameStates.app.bPlayerEggsDropped) { if (gameData.app.nGameMode & GM_NETWORK) { AdjustMineSpawn (); MultiCapObjects (); } DropPlayerEggs (gameData.objs.consoleP); gameStates.app.bPlayerEggsDropped = 1; if (gameData.app.nGameMode & GM_MULTI) MultiSendPlayerExplode (MULTI_PLAYER_EXPLODE); } DoPlayerDead (); //kill_playerP (); } } }