void ReCreateMenuLanguageEntryLinks() { // удаляем все симлинки текстур vw_DeleteEntryLinkVFS("DATA/GAME/mission.tga"); vw_DeleteEntryLinkVFS("DATA/GAME/missionfailed.tga"); vw_DeleteEntryLinkVFS("DATA/GAME/pause.tga"); vw_DeleteEntryLinkVFS("DATA/MENU/button_weaponry_in.tga"); vw_DeleteEntryLinkVFS("DATA/MENU/button_weaponry_out.tga"); // создаем новые симлинки CreateMenuLanguageEntryLinks(); // если текстура была загружена - выгружаем, и загружаем по новой if (vw_FindTextureByName("DATA/GAME/mission.tga")) { vw_ReleaseTexture(vw_FindTextureByName("DATA/GAME/mission.tga")); vw_SetTextureAlpha(0.0f, 0.0f, 0.0f); vw_SetTextureProp(RI_MAGFILTER_LINEAR | RI_MINFILTER_LINEAR | RI_MIPFILTER_NONE, RI_CLAMP_TO_EDGE, true, TX_ALPHA_EQUAL, false); vw_LoadTexture("DATA/GAME/mission.tga", NULL, true); } if (vw_FindTextureByName("DATA/GAME/missionfailed.tga")) { vw_ReleaseTexture(vw_FindTextureByName("DATA/GAME/missionfailed.tga")); vw_SetTextureAlpha(0.0f, 0.0f, 0.0f); vw_SetTextureProp(RI_MAGFILTER_LINEAR | RI_MINFILTER_LINEAR | RI_MIPFILTER_NONE, RI_CLAMP_TO_EDGE, true, TX_ALPHA_EQUAL, false); vw_LoadTexture("DATA/GAME/missionfailed.tga", NULL, true); } if (vw_FindTextureByName("DATA/GAME/pause.tga")) { vw_ReleaseTexture(vw_FindTextureByName("DATA/GAME/pause.tga")); vw_SetTextureAlpha(0.0f, 0.0f, 0.0f); vw_SetTextureProp(RI_MAGFILTER_LINEAR | RI_MINFILTER_LINEAR | RI_MIPFILTER_NONE, RI_CLAMP_TO_EDGE, true, TX_ALPHA_EQUAL, false); vw_LoadTexture("DATA/GAME/pause.tga", NULL, true); } if (vw_FindTextureByName("DATA/MENU/button_weaponry_in.tga")) { vw_ReleaseTexture(vw_FindTextureByName("DATA/MENU/button_weaponry_in.tga")); vw_SetTextureAlpha(0.0f, 0.0f, 0.0f); vw_SetTextureProp(RI_MAGFILTER_LINEAR | RI_MINFILTER_LINEAR | RI_MIPFILTER_NONE, RI_CLAMP_TO_EDGE, false, TX_ALPHA_EQUAL, false); vw_LoadTexture("DATA/MENU/button_weaponry_in.tga", NULL, false); } if (vw_FindTextureByName("DATA/MENU/button_weaponry_out.tga")) { vw_ReleaseTexture(vw_FindTextureByName("DATA/MENU/button_weaponry_out.tga")); vw_SetTextureAlpha(0.0f, 0.0f, 0.0f); vw_SetTextureProp(RI_MAGFILTER_LINEAR | RI_MINFILTER_LINEAR | RI_MIPFILTER_NONE, RI_CLAMP_TO_EDGE, false, TX_ALPHA_EQUAL, false); vw_LoadTexture("DATA/MENU/button_weaponry_out.tga", NULL, false); } }
//----------------------------------------------------------------------------- // Тестура для брони //----------------------------------------------------------------------------- eTexture *GetArmourTexture(int ArmourType) { switch(ArmourType) { // фактически - брони нет, только стальной корпус case 0: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text00.VW2D"); break; // примитивная броня case 1: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text04.VW2D"); break; // модернизированная броня case 2: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text05.VW2D"); break; // и против иона case 3: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text07.VW2D"); break; // и против иона+ case 4: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text08.VW2D"); break; // и против иона++ case 5: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text09.VW2D"); break; // и против плазмы case 6: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text10.VW2D"); break; // универсальная case 7: return vw_FindTextureByName("DATA/MODELS/EARTHFIGHTER/sf-text06.VW2D"); break; default: fprintf(stderr, "Error in GetArmourTexture function call, wrong ArmourType.\n"); break; } return 0; }
//----------------------------------------------------------------------------- // Конструктор, инициализация всех переменных //----------------------------------------------------------------------------- void CBigAsteroid::Create(int AsteroidNum) { ObjectStatus = 1; // чужой ObjectType = 15; // задали первичный, нужно случайным образом найти if (AsteroidNum == 1 || AsteroidNum == 2) { int Rand = 1 + vw_iRandNum(4); if (Rand < 1) Rand = 1; if (Rand > 5) Rand = 5; AsteroidNum = AsteroidNum*10 + Rand; } ObjectCreationType = AsteroidNum; // перебираем и ставим нужные данные switch (AsteroidNum) { case 11: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-01.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case9next; case 12: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-02.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case9next; case 13: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-03.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case9next; case 14: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-04.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case9next; case 15: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-05.VW3D", this, 0, -1.0f, Setup.UseGLSL); case9next: //Speed = 25.0f; RotationSpeed.x = 10.0f + 10.0f*vw_Randf0; RotationSpeed.y = 2.0f + 20.0f*vw_Randf0; Texture[0] = vw_FindTextureByName("DATA/MODELS/PLANET/d_class3.tga"); TextureIllum[0] = 0; NormalMap[0] = vw_FindTextureByName("DATA/MODELS/NORMALMAP/d_class3_nm.tga"); break; // те же астероиды, но они летят сверху... case 21: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-01.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case10next; case 22: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-02.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case10next; case 23: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-03.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case10next; case 24: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-04.VW3D", this, 0, -1.0f, Setup.UseGLSL); goto case10next; case 25: LoadObjectData("DATA/MODELS/SPACE/bigasteroid-05.VW3D", this, 0, -1.0f, Setup.UseGLSL); case10next: //Speed = 25.0f; RotationSpeed.x = 10.0f + 10.0f*vw_Randf0; RotationSpeed.y = 2.0f + 20.0f*vw_Randf0; Texture[0] = vw_FindTextureByName("DATA/MODELS/PLANET/d_class3.tga"); TextureIllum[0] = 0; NormalMap[0] = vw_FindTextureByName("DATA/MODELS/NORMALMAP/d_class3_nm.tga"); break; } // находим все данные по геометрии ::CObject3D::InitByDrawObjectList(); }
//----------------------------------------------------------------------------- // Создание эффектов для космических объектов (двигатели для базы) //----------------------------------------------------------------------------- void SetSpaceObjectGFX(eParticleSystem *ParticleSystem, int GFXType) { ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/flare1.tga"); ParticleSystem->Direction = VECTOR3D(0.0f, -1.0f, 0.0f); switch(GFXType) { // двигатели на базе пиратов case 1: ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.30f; ParticleSystem->SizeEnd = 0.60f; ParticleSystem->Speed = 10.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->SpeedVar = 2.00f; ParticleSystem->Theta = 5.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.8f,0.1f,0.8f); ParticleSystem->AlphaShowHide= true; ParticleSystem->Direction = VECTOR3D(0.0f, -1.0f, 0.0f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.025f); break; case 2: ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->SpeedVar = 2.00f; ParticleSystem->Theta = 180.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->AlphaShowHide= true; ParticleSystem->Direction = VECTOR3D(0.0f, 1.0f, 0.0f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.3f); break; default: fprintf(stderr, "Error in SetSpaceObjectGFX function call, wrong GFXType.\n"); break; } }
//------------------------------------------------------------------------------------ // Прорисовка второго слоя "пыли" с тайловой анимацией //------------------------------------------------------------------------------------ void StarSystemDrawSecondLayer(int DrawType) { if (Setup.VisualEffectsQuality <= 1) { int VFV = RI_3f_XYZ | RI_4f_COLOR | RI_1_TEX; float *buff; buff = new float[4*9]; if (buff == 0) return; float width_2, heigh_2, length_2; width_2 = 0.0f; heigh_2 = 110.0f; length_2 = 110.0f; float x,y,z; x = GamePoint.x; y = GamePoint.y; z = GamePoint.z; float StartTransparentLayer2 = 0.9f; float EndTransparentLayer2 = 0.7f; if (DrawType == 2) { width_2 = length_2 = 175.0f; heigh_2 = 0.0f; VECTOR3D CurrentCameraLocation; vw_GetCameraLocation(&CurrentCameraLocation); x = GamePoint.x+GameCameraGetDeviation()*2.0f + CurrentCameraLocation.x*0.5f; y = GamePoint.y-GameCameraGetDeviation(); z = GamePoint.z+25.0f; StartTransparentLayer2 = StarsTileStartTransparentLayer2; EndTransparentLayer2 = StarsTileEndTransparentLayer2; } int k=0; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer2; buff[k++] = 3.2f; buff[k++] = 0.0f+StarsTile2; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer2; buff[k++] = 3.2f; buff[k++] = 3.0f+StarsTile2; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer2; buff[k++] = 0.2f; buff[k++] = 0.0f+StarsTile2; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer2; buff[k++] = 0.2f; buff[k++] = 3.0f+StarsTile2; if (DrawType == 1) { StarsTile2 -= 0.04f*(vw_GetTime() - StarsTileUpdateTime2); StarsTileUpdateTime2 = vw_GetTime(); } else { StarsTile2 -= 0.12f*(vw_GetTime(1) - StarsTileUpdateTime2); StarsTileUpdateTime2 = vw_GetTime(1); } if (StarsTile2 < -3.0f) StarsTile2 += 3.0f; eTexture *TileTexture = vw_FindTextureByName("DATA/SKYBOX/tile_stars.tga"); vw_SetTexture(0, TileTexture); // по умолчанию всегда трилинейная фильтрация, если надо - ставим билинейную if (Setup.TextureFilteringMode == 1) vw_SetTextureFiltering(RI_TEXTURE_BILINEAR); vw_SetTextureBlend(true, RI_BLEND_SRCALPHA, RI_BLEND_ONE); vw_DepthTest(false, -1); if (DrawType == 1) { vw_PushMatrix(); vw_Rotate(-20.0f, 0.0f, 0.0f, 1.0f); vw_Rotate(-45.0f, 0.0f, 1.0f, 0.0f); vw_Rotate(30.0f, 1.0f, 0.0f, 0.0f); } vw_SendVertices(RI_TRIANGLE_STRIP, 4, VFV, buff, 9*sizeof(float)); if (DrawType == 1) vw_PopMatrix(); vw_DepthTest(true, RI_LESSEQUAL); vw_SetTextureBlend(false, 0, 0); vw_BindTexture(0, 0); if (buff != 0){delete [] buff; buff = 0;} } }
//----------------------------------------------------------------------------- // Конструктор, инициализация всех переменных //----------------------------------------------------------------------------- void CWheeled::Create(int WheeledNum) { ObjectType = 5; ObjectCreationType = WheeledNum; MaxSpeed = 20.0f; MaxAcceler = 5.0f; MaxSpeedRotate = 20.0f; LoadObjectData(PresetWheeledData[WheeledNum-1].Name, this, 0, 2.0f); for (int i=0; i<DrawObjectQuantity; i++) { Texture[i] = vw_FindTextureByName(PresetWheeledData[WheeledNum-1].TextureName); } ResistanceHull = 1.0f; ResistanceSystems = 1.0f; SpeedToRotate = PresetWheeledData[WheeledNum-1].SpeedToRotate; Strength = StrengthStart = PresetWheeledData[WheeledNum-1].Strength/GameNPCArmorPenalty; WeaponQuantity = PresetWheeledData[WheeledNum-1].WeaponQuantity; // начальные установки для оружия WeaponSetFire = new bool[WeaponQuantity]; WeaponLocation = new VECTOR3D[WeaponQuantity]; Weapon = new CWeapon*[WeaponQuantity]; WeaponBound = new VECTOR3D[WeaponQuantity]; for (int i=0; i<WeaponQuantity; i++) { WeaponSetFire[i] = false; Weapon[i] = 0; } // установка доп. текстуры и других настроек для каждой модели switch (WheeledNum) { case 1: WeaponLocation[0] = VECTOR3D(0.3f, 4.5f, -1.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(206); WeaponLocation[1] = VECTOR3D(-0.3f, 4.5f, -1.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(206); WeaponLocation[2] = VECTOR3D(0.9f, 4.5f, -1.5f); Weapon[2] = new CWeapon; Weapon[2]->Create(206); WeaponLocation[3] = VECTOR3D(-0.9f, 4.5f, -1.5f); Weapon[3] = new CWeapon; Weapon[3]->Create(206); WeaponFireType = 3; WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 0; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 3; WheelRotateObjectsNum[1] = 4; MaxWheelRotateAngle = 30.0f; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 5; TargetVertObjectMaxAngle = 30.0f; break; case 2: WeaponLocation[0] = VECTOR3D(1.3f, 3.5f, -1.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(206); WeaponLocation[1] = VECTOR3D(-1.3f, 3.5f, -1.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(206); WeaponFireType = 3; DoNotCalculateRotation = true; WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 1; WheelRotateObjectsNum[1] = 4; MaxWheelRotateAngle = 20.0f; break; case 3: WeaponLocation[0] = VECTOR3D(0.8f, 4.2f, -1.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WeaponLocation[1] = VECTOR3D(-0.8f, 4.2f, -1.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(204); WeaponFireType = 2; WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 0; WheelObjectsNum[1] = 1; WheelObjectsNum[2] = 2; WheelObjectsNum[3] = 5; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 0; WheelRotateObjectsNum[1] = 1; MaxWheelRotateAngle = 20.0f; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 3; TargetHorizObject[1] = 6; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 6; TargetVertObjectMaxAngle = 60.0f; break; case 4: WeaponLocation[0] = VECTOR3D(0.0f, 4.5f, -4.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(207); WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 0; WheelObjectsNum[1] = 1; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 0; WheelRotateObjectsNum[1] = 3; MaxWheelRotateAngle = 20.0f; break; case 5: WeaponLocation[0] = VECTOR3D(0.0f, 4.5f, -4.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(208); WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 1; WheelRotateObjectsNum[1] = 2; MaxWheelRotateAngle = 30.0f; break; case 6: WeaponLocation[0] = VECTOR3D(0.0f, 6.0f, -3.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 1; WheelRotateObjectsNum[1] = 4; MaxWheelRotateAngle = 30.0f; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 5; TargetHorizObject[1] = 6; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 6; TargetVertObjectMaxAngle = 40.0f; break; case 7: WeaponLocation[0] = VECTOR3D(0.1f, 5.0f, -1.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WeaponLocation[1] = VECTOR3D(-0.1f, 5.0f, -1.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(204); WeaponFireType = 2; WheelQuantity = 4; WheelObjectsNum = new int[4]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelRotateQuantity = 2; WheelRotateObjectsNum = new int[2]; WheelRotateObjectsNum[0] = 1; WheelRotateObjectsNum[1] = 4; MaxWheelRotateAngle = 20.0f; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 5; TargetHorizObject[1] = 6; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 6; TargetVertObjectMaxAngle = 40.0f; break; case 8: WeaponLocation[0] = VECTOR3D(1.5f, 5.2f, 7.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(210); WeaponLocation[1] = VECTOR3D(-1.5f, 5.2f, 7.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(210); WeaponFireType = 3; WheelQuantity = 8; WheelObjectsNum = new int[8]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 5; WheelObjectsNum[4] = 6; WheelObjectsNum[5] = 7; WheelObjectsNum[6] = 8; WheelObjectsNum[7] = 9; WheelRotateQuantity = 4; WheelRotateObjectsNum = new int[4]; WheelRotateObjectsNum[0] = 1; WheelRotateObjectsNum[1] = 3; WheelRotateObjectsNum[2] = 6; WheelRotateObjectsNum[3] = 7; MaxWheelRotateAngle = 20.0f; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 2; TargetVertObjectMaxAngle = 90.0f; break; } // находим все данные по геометрии ::CObject3D::InitByDrawObjectList(); // установка остальных параметров девиации DeviationOn = false; DeviationObjQuantity = WheelQuantity; Deviation = new VECTOR3D[DeviationObjQuantity]; NeedDeviation = new float[DeviationObjQuantity]; CurentDeviation = new float[DeviationObjQuantity]; CurentDeviationSum = new float[DeviationObjQuantity]; DeviationObjNum = new int[DeviationObjQuantity]; for (int i=0; i<DeviationObjQuantity; i++) { Deviation[i] = VECTOR3D(0.0f, 1.0f, 0.0f); NeedDeviation[i] = vw_Randf0*0.1f; CurentDeviation[i] = CurentDeviationSum[i] = 0.0f; DeviationObjNum[i] = WheelObjectsNum[i]; } // делаем сдвиг поворота колес, чтобы смотрелось естественнее for (int i=0; i<WheelQuantity; i++) DrawObjectList[WheelObjectsNum[i]].Rotation.x = vw_fRandNum(360.0f); // вычисляем данные для нахождения точки стрельбы if (TargetHorizObject != 0) { BaseBound = DrawObjectList[TargetHorizObject[0]].Location; } if (TargetVertObject != 0) { if (TargetHorizObject != 0) { MiddleBound = DrawObjectList[TargetVertObject[0]].Location - DrawObjectList[TargetHorizObject[0]].Location; } else { MiddleBound = DrawObjectList[TargetVertObject[0]].Location; } } if (WeaponBound != 0) for (int i=0; i<WeaponQuantity; i++) { if (TargetVertObject != 0) { WeaponBound[i] = WeaponLocation[i] - DrawObjectList[TargetVertObject[0]].Location; } else if (TargetHorizObject != 0) { WeaponBound[i] = WeaponLocation[i] - DrawObjectList[TargetHorizObject[0]].Location; } else { WeaponBound[i] = WeaponLocation[i]; } } }
void OptionsMenu(float ContentTransp, float *ButtonTransp1, float *LastButtonUpdateTime1, float *ButtonTransp2, float *LastButtonUpdateTime2) { RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,0,0,Setup.iAspectRatioWidth,768); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, 0.5f*ContentTransp); int CurrentPos = 0; int X1 = Setup.iAspectRatioWidth/2 - 375; int Y1 = 65; int Prir1 = 55; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Music_Volume")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Decrease"), ContentTransp, !Setup.Music_check || Setup.MusicSw==0)) { Setup.MusicSw--; if (Setup.MusicSw<0) Setup.MusicSw = 0; vw_SetMusicMainVolume(Setup.MusicSw/10.0f); } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), ContentTransp, !Setup.Music_check || Setup.MusicSw==10)) { Setup.MusicSw++; if (Setup.MusicSw>10) Setup.MusicSw = 10; vw_SetMusicMainVolume(Setup.MusicSw/10.0f); } if (!Setup.Music_check) { int SizeI = (170-vw_FontSize(vw_GetText("3_Not_available")))/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,0.5f,0.0f, ContentTransp, vw_GetText("3_Not_available")); } else { for (int i=0; i<10; i++) { SetRect(&SrcRect,0,0,16,32); SetRect(&DstRect,X1+443+16*i,Y1-4,X1+443+16+16*i,Y1+32-4); if (Setup.MusicSw>i) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc.tga"), true, ContentTransp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc_none.tga"), true, ContentTransp); } } Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Voice_Volume")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Decrease"), ContentTransp, !Setup.Sound_check || Setup.VoiceSw==0, false)) { Setup.VoiceSw--; if (Setup.VoiceSw<0) Setup.VoiceSw = 0; Audio_SetVoiceMainVolume(Setup.VoiceSw/10.0f); Audio_PlayVoice(1, 1.0f); } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), ContentTransp, !Setup.Sound_check || Setup.VoiceSw==10, false)) { Setup.VoiceSw++; if (Setup.VoiceSw>10) Setup.VoiceSw = 10; Audio_SetVoiceMainVolume(Setup.VoiceSw/10.0f); Audio_PlayVoice(1, 1.0f); } if (!Setup.Sound_check) { int SizeI = (170-vw_FontSize(vw_GetText("3_Not_available")))/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,0.5f,0.0f, ContentTransp, vw_GetText("3_Not_available")); } else { for (int i=0; i<10; i++) { SetRect(&SrcRect,0,0,16,32); SetRect(&DstRect,X1+443+16*i,Y1-4,X1+443+16+16*i,Y1+32-4); if (Setup.VoiceSw>i) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc.tga"), true, ContentTransp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc_none.tga"), true, ContentTransp); } } Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Sound_Effects_Volume")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Decrease"), ContentTransp, !Setup.Sound_check || Setup.SoundSw==0)) { Setup.SoundSw--; if (Setup.SoundSw<0) Setup.SoundSw = 0; Audio_SetSound2DMainVolume(Setup.SoundSw/10.0f); } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), ContentTransp, !Setup.Sound_check || Setup.SoundSw==10)) { Setup.SoundSw++; if (Setup.SoundSw>10) Setup.SoundSw = 10; Audio_SetSound2DMainVolume(Setup.SoundSw/10.0f); } if (!Setup.Sound_check) { int SizeI = (170-vw_FontSize(vw_GetText("3_Not_available")))/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,0.5f,0.0f, ContentTransp, vw_GetText("3_Not_available")); } else { for (int i=0; i<10; i++) { SetRect(&SrcRect,0,0,16,32); SetRect(&DstRect,X1+443+16*i,Y1-4,X1+443+16+16*i,Y1+32-4); if (Setup.SoundSw>i) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc.tga"), true, ContentTransp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc_none.tga"), true, ContentTransp); } } // проверяем, есть ли вообще полноэкранные разрешения bool CanSwitchToFullScreen = false; for(int i=0; i<VideoModesNum; i++) { if ((VideoModes[i].BPP == 16) | (VideoModes[i].BPP == 24)) { CanSwitchToFullScreen = true; break; } } Y1 += Prir1; if (Options_BPP != 0) CurrentPos = 0; else CurrentPos = 1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Full_Screen")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, !CanSwitchToFullScreen) || DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, !CanSwitchToFullScreen)) { if (Options_BPP != 0) { Options_BPP = 0; } else { Options_BPP = CurrentVideoMode.BPP; // пробуем просто переключить BPP, проверяем есть ли такое разрешение bool NeedDetectResolution = true; for(int i=0; i<VideoModesNum; i++) { if ((VideoModes[i].W == Options_Width) & (VideoModes[i].H == Options_Height) & (VideoModes[i].BPP == Options_BPP)) { NeedDetectResolution = false; break; } } // находим первый полноэкранный режим в списке if (NeedDetectResolution) for(int i=0; i<VideoModesNum; i++) { if ((VideoModes[i].BPP == 16) | (VideoModes[i].BPP == 24)) { Options_Width = VideoModes[i].W; Options_Height = VideoModes[i].H; Options_BPP = VideoModes[i].BPP; break; } } } } int Size = vw_FontSize(Options_BPP ? vw_GetText("1_On") : vw_GetText("1_Off")); int SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, Options_BPP ? vw_GetText("1_On") : vw_GetText("1_Off")); // находим текущий номер режима в списке int CurrentListNum = 0; for(int i=0; i<VideoModesNum; i++) { if (VideoModes[i].W == Options_Width && VideoModes[i].H == Options_Height && VideoModes[i].BPP == Options_BPP) { CurrentListNum = i; break; } } Y1 += Prir1; if (Options_BPP != 0) CurrentPos = 0; else CurrentPos = 1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText(ButtonScreenModeTitle[CurrentPos])); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, false)) { CurrentListNum--; // ставим правильный bool check_next = true; while (check_next) { // вышли за предел if (CurrentListNum < 0) CurrentListNum = VideoModesNum-1; if ((VideoModes[CurrentListNum].BPP > 0 && Options_BPP > 0) || (VideoModes[CurrentListNum].BPP == 0 && Options_BPP == 0)) { check_next = false; } else { CurrentListNum--; } } Options_Width = VideoModes[CurrentListNum].W; Options_Height = VideoModes[CurrentListNum].H; Options_BPP = VideoModes[CurrentListNum].BPP; if ((Options_Width*1.0f)/(Options_Height*1.0f) < 1.4f) Options_iAspectRatioWidth = 1024; else Options_iAspectRatioWidth = 1228; } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, false)) { CurrentListNum++; // ставим правильный bool check_next = true; while (check_next) { // вышли за предел if (CurrentListNum >= VideoModesNum) CurrentListNum = 0; if ((VideoModes[CurrentListNum].BPP > 0 && Options_BPP > 0) || (VideoModes[CurrentListNum].BPP == 0 && Options_BPP == 0)) { check_next = false; } else { CurrentListNum++; } } Options_Width = VideoModes[CurrentListNum].W; Options_Height = VideoModes[CurrentListNum].H; Options_BPP = VideoModes[CurrentListNum].BPP; if ((Options_Width*1.0f)/(Options_Height*1.0f) < 1.4f) Options_iAspectRatioWidth = 1024; else Options_iAspectRatioWidth = 1228; } char VideoModeTitle[32]; if (VideoModes[CurrentListNum].BPP != 0) sprintf(VideoModeTitle, "%ix%i %ibit", VideoModes[CurrentListNum].W, VideoModes[CurrentListNum].H, VideoModes[CurrentListNum].BPP); else sprintf(VideoModeTitle, "%ix%i", VideoModes[CurrentListNum].W, VideoModes[CurrentListNum].H); Size = vw_FontSize(VideoModeTitle); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, VideoModeTitle); Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Aspect_Ration")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, false)) { if (Options_iAspectRatioWidth == 1228) Options_iAspectRatioWidth = 1024; else Options_iAspectRatioWidth = 1228; } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, false)) { if (Options_iAspectRatioWidth == 1024) Options_iAspectRatioWidth = 1228; else Options_iAspectRatioWidth = 1024; } if (Options_iAspectRatioWidth == 1024) { Size = vw_FontSize(vw_GetText("3_Standard")); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Standard")); } else { Size = vw_FontSize(vw_GetText("3_Widescreen")); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Widescreen")); } Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "VSync (%s)", vw_GetText("3_VSync")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, false) || DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, false)) if (NeedCheck == 0) { if (Options_VSync == 1) Options_VSync = 0; else Options_VSync = 1; } Size = vw_FontSize(Options_VSync ? vw_GetText("1_On") : vw_GetText("1_Off")); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, Options_VSync ? vw_GetText("1_On") : vw_GetText("1_Off")); Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Brightness")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Decrease"), ContentTransp, Setup.Brightness<=1)) { Setup.Brightness -= 1; if (Setup.Brightness <= 1) Setup.Brightness = 1; } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), ContentTransp, Setup.Brightness>=10)) { Setup.Brightness += 1; if (Setup.Brightness >= 10) Setup.Brightness = 10; } for (int i=0; i<10; i++) { SetRect(&SrcRect,0,0,16,32); SetRect(&DstRect,X1+443+16*i,Y1-4,X1+443+16+16*i,Y1+32-4); if (Setup.Brightness>i) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc.tga"), true, ContentTransp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/perc_none.tga"), true, ContentTransp); } int Prir = 100; int X; int Y = 165+Prir*4; X = Setup.iAspectRatioWidth/2 - 366; if (DrawButton200_2(X,Y+28, vw_GetText("1_Advanced"), ContentTransp, false)) { if (GameStatus == GAME) { SetOptionsMenu(OPTIONS_ADVANCED); GameMenuStatus = 3; } else ComBuffer = OPTIONS_ADVANCED; } X = Setup.iAspectRatioWidth/2 - 100; if (DrawButton200_2(X,Y+28, vw_GetText("1_Interface"), ContentTransp, false)) { if (GameStatus == GAME) { SetOptionsMenu(INTERFACE); GameMenuStatus = 4; } else ComBuffer = INTERFACE; } X = Setup.iAspectRatioWidth/2 + 166; if (DrawButton200_2(X,Y+28, vw_GetText("1_Config_Controls"), ContentTransp, false)) { if (GameStatus == GAME) { SetOptionsMenu(CONFCONTROL); GameMenuStatus = 5; } else ComBuffer = CONFCONTROL; } if ((Options_Width == Setup.Width && Options_Height == Setup.Height && Options_BPP == Setup.BPP && Options_VSync == Setup.VSync && Options_iAspectRatioWidth == Setup.iAspectRatioWidth)) { X = (Setup.iAspectRatioWidth - 384)/2; Y = Y+Prir; if (GameStatus == GAME) { if (DrawButton384(X,Y, vw_GetText("1_GAME_MENU"), ContentTransp, ButtonTransp1, LastButtonUpdateTime1)) { GameMenuStatus = 1; } } else { if (DrawButton384(X,Y, vw_GetText("1_MAIN_MENU"), ContentTransp, ButtonTransp1, LastButtonUpdateTime1)) { ComBuffer = MAIN_MENU; } } } else { X = Setup.iAspectRatioWidth/2 - 256 - 38; Y = Y+Prir; if (GameStatus == GAME) { if (DrawButton256(X,Y, vw_GetText("1_GAME_MENU"), ContentTransp, ButtonTransp1, LastButtonUpdateTime1)) { GameMenuStatus = 1; } } else { if (DrawButton256(X,Y, vw_GetText("1_MAIN_MENU"), ContentTransp, ButtonTransp1, LastButtonUpdateTime1)) { ComBuffer = MAIN_MENU; } } X = Setup.iAspectRatioWidth/2 + 38; if (DrawButton256(X,Y, vw_GetText("1_APPLY"), ContentTransp, ButtonTransp2, LastButtonUpdateTime2)) { // проверяем, нужно перегружать или нет if (Options_Width != Setup.Width || Options_Height != Setup.Height || Options_BPP != Setup.BPP || Options_VSync != Setup.VSync || Options_iAspectRatioWidth != Setup.iAspectRatioWidth) { if (GameStatus == GAME) SetCurrentDialogBox(17); else { CanQuit = false; Quit = true; NeedReCreate = true; SaveOptionsMenuTmpData(); } } } } }
//------------------------------------------------------------------------------------ // инициализация меню //------------------------------------------------------------------------------------ void InitMenu() { CreateCursor(); // установка курсора на центр // получаем размер клиентской области int W, H; vw_GetViewport(0, 0, &W, &H); float AWw = W*1.0f; float AHw = H*1.0f; float ARWidth; float ARHeight; vw_GetAspectWH(&ARWidth, &ARHeight); // установка мышки, чтобы не учитывать перемещения в меню #ifndef USE_GLES SDL_WarpMouse((int)((512.0f+256.0f)/(ARWidth/AWw)), (int)(384.0f/(ARHeight/AHw))); #endif Button1Transp = 1.0f; LastButton1UpdateTime = 0.0f; Button2Transp = 1.0f; LastButton2UpdateTime = 0.0f; Button3Transp = 1.0f; LastButton3UpdateTime = 0.0f; Button4Transp = 1.0f; LastButton4UpdateTime = 0.0f; Button5Transp = 1.0f; LastButton5UpdateTime = 0.0f; Button6Transp = 1.0f; LastButton6UpdateTime = 0.0f; Button7Transp = 1.0f; LastButton7UpdateTime = 0.0f; Button8Transp = 1.0f; LastButton8UpdateTime = 0.0f; Button9Transp = 1.0f; LastButton9UpdateTime = 0.0f; Button10Transp = 1.0f; LastButton10UpdateTime = 0.0f; Button11Transp = 1.0f; LastButton11UpdateTime = 0.0f; Button12Transp = 1.0f; LastButton12UpdateTime = 0.0f; Button13Transp = 1.0f; LastButton13UpdateTime = 0.0f; Button14Transp = 1.0f; LastButton14UpdateTime = 0.0f; LastMenuUpdateTime = 0.0f; MenuContentTransp = 0.0f; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // иним камеру, всегда до работы со скриптом (!!!) //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vw_ResizeScene(45.0f, Setup.fAspectRatioWidth/Setup.fAspectRatioHeight, 1.0f, 2000.0f); InitGameCamera(); vw_SetCameraLocation(VECTOR3D(-50,30,-50)); vw_SetCameraMoveAroundPoint(VECTOR3D(0,0,0), 0.0f, VECTOR3D(0.0f, 0.0f, 0.0f)); if (Script != 0){delete Script; Script = 0;} Script = new ScriptEngine; if (Setup.MenuScript > 2) Setup.MenuScript = 0; switch (Setup.MenuScript) { case 0: Script->RunScript("DATA/SCRIPT/menu1.xml", vw_GetTime()); break; case 1: Script->RunScript("DATA/SCRIPT/menu2.xml", vw_GetTime()); break; case 2: Script->RunScript("DATA/SCRIPT/menu3.xml", vw_GetTime()); break; // на всякий случай default: Script->RunScript("DATA/SCRIPT/menu1.xml", vw_GetTime()); break; } Setup.MenuScript ++; // немного прокручиваем скрипт float Time1 = vw_GetTime(); Script->StartTime = Time1-30; Script->TimeLastOp = Time1-30; for (float i=Time1-30; i<Time1;i+=1.0f) { UpdateAllObject3D(i); Script->Update(i); } Script->StartTime = Time1; Script->TimeLastOp = Time1; // активные частицы космоса psSpace = 0; if (psSpace==0) psSpace = new eParticleSystem; psSpace->ColorStart.r = 0.80f; psSpace->ColorStart.g = 0.80f; psSpace->ColorStart.b = 1.00f; psSpace->ColorEnd.r = 0.70f; psSpace->ColorEnd.g = 0.70f; psSpace->ColorEnd.b = 1.00f; psSpace->AlphaStart = 1.00f; psSpace->AlphaEnd = 0.00f; psSpace->SizeStart = 0.10f; psSpace->SizeVar = 0.05f; psSpace->SizeEnd = 0.30f; psSpace->Speed = 4.00f; psSpace->SpeedVar = 8.00f; psSpace->Theta = 0.00f; psSpace->Life = 10.00f; psSpace->LifeVar = 0.00f; psSpace->CreationType = 1; psSpace->CreationSize = VECTOR3D(2.0f,50.0f,30.0f); psSpace->ParticlesPerSec = 140; psSpace->Texture[0] = vw_FindTextureByName("DATA/GFX/flare3.tga"); psSpace->Direction = VECTOR3D(1.0f, 0.0f, 0.0f); psSpace->Resize = 0.1f; psSpace->SetStartLocation(VECTOR3D(-50,10,-20)); // немного "прокручиваем", чтобы сразу по появлению было заполнено float Time = psSpace->TimeLastUpdate; for (float i=Time; i<Time+20;i+=1.0f) { psSpace->Update(i); } psSpace->TimeLastUpdate = Time; LastMenuUpdateTime = vw_GetTime(); NeedShowMenu = true; NeedHideMenu = false; LastMenuOnOffUpdateTime = vw_GetTime(); MenuBlackTransp = 1.0f; NeedOnMenu = true; // подстраховка, если не укажем меню, перейдем в основное GameStatus = MAIN_MENU; DrawGameCursor = true; StarsTileUpdateTime = vw_GetTime(); StarsTileUpdateTime2 = vw_GetTime(); }
void InterfaceMenu(float ContentTransp, float *ButtonTransp1, float *LastButtonUpdateTime1) { RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,0,0,Setup.iAspectRatioWidth,768); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, 0.5f*ContentTransp); int X1 = Setup.iAspectRatioWidth/2 - 375; int Y1 = 65; int Prir1 = 55; // выбор языка меню vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Menu_Language")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, false)) { Setup.MenuLanguage--; if (Setup.MenuLanguage < 1) Setup.MenuLanguage = 3; ReCreateMenuLanguageEntryLinks(); vw_SetTextLanguage(Setup.MenuLanguage-1); } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, false)) { Setup.MenuLanguage++; if (Setup.MenuLanguage>3) Setup.MenuLanguage = 1; ReCreateMenuLanguageEntryLinks(); vw_SetTextLanguage(Setup.MenuLanguage-1); } int Size, SizeI; switch (Setup.MenuLanguage) { case 1: Size = vw_FontSize("English"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "English"); break; case 2: Size = vw_FontSize("Deutsch"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "Deutsch"); break; case 3: Size = vw_FontSize("Русский"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "Русский"); break; } // выбор языка голосовых сообщений Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Voice_Language")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, false)) { Setup.VoiceLanguage--; if (Setup.VoiceLanguage < 1) Setup.VoiceLanguage = 3; ReCreateVoiceLanguageEntryLinks(); } if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Next"), ContentTransp, false)) { Setup.VoiceLanguage++; if (Setup.VoiceLanguage>3) Setup.VoiceLanguage = 1; ReCreateVoiceLanguageEntryLinks(); } switch (Setup.VoiceLanguage) { case 1: Size = vw_FontSize("English"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "English"); break; case 2: Size = vw_FontSize("Deutsch"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "Deutsch"); break; case 3: Size = vw_FontSize("Русский"); SizeI = (170-Size)/2; vw_DrawFont(X1+438+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, "Русский"); break; } // выбор шрифта Y1 += Prir1; vw_DrawFont(X1, Y1, -280, 0, 1.0f, 1.0f,1.0f,1.0f, ContentTransp, vw_GetText("3_Menu_Font")); if (DrawButton128_2(X1+300, Y1-6, vw_GetText("1_Prev"), ContentTransp, Setup.FontNumber <= 0)) { Setup.FontNumber --; if (Setup.FontNumber < 0) Setup.FontNumber = 0; // удаляем все символы и их текстуры vw_ReleaseAllFontCharsWithTextures(); // инициализируем новый шрифт, вызывать vw_ShutdownFont не нужно vw_InitFont(FontList[Setup.FontNumber].FontFileName, 16); vw_GenerateFontChars(256, 256, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+\():;%&`'*#$=[]@^{}_~><–—«»“”|абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЧЦШЩЪЫЬЭЮЯ©®ÄÖÜäöüß°§/");
//------------------------------------------------------------------------------------ // покупка-установка систем корабля //------------------------------------------------------------------------------------ void Workshop_Workshop() { RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,256,256); SetRect(&DstRect,Setup.iAspectRatioWidth/2-256,0,Setup.iAspectRatioWidth/2-256+512,412); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/back_spot.tga"), true, 0.35f*MenuContentTransp); vw_End2DMode(); WorkshopDrawShip(WorkshopFighterGame, 1); vw_Start2DMode(-1,1); SetRect(&SrcRect,0,0,210,600); SetRect(&DstRect,Setup.iAspectRatioWidth/2-492,50-10,Setup.iAspectRatioWidth/2-492+210,50+600-10); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel2.tga"), true, MenuContentTransp); // стрелки SetRect(&SrcRect,0,0,74,120); SetRect(&DstRect,Setup.iAspectRatioWidth/2-461,494,Setup.iAspectRatioWidth/2-461+74,494+120); int MouseX, MouseY; vw_GetMousePos(&MouseX, &MouseY); if (((DstRect.right-8 >= MouseX)& (DstRect.left+8<= MouseX)& (DstRect.bottom-10 >= MouseY)& (DstRect.top+10<= MouseY)) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { Audio_PlaySound2D(2,1.0f); CurrentSystemStockNum = GetPrevSystemStockNum(); } vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrows_on.tga"), true, MenuContentTransp); } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrows_off.tga"), true, MenuContentTransp); } SetRect(&SrcRect,74,0,148,120); SetRect(&DstRect,Setup.iAspectRatioWidth/2-461+74,494,Setup.iAspectRatioWidth/2-461+148,494+120); if (((DstRect.right-8 >= MouseX)& (DstRect.left+8<= MouseX)& (DstRect.bottom-10 >= MouseY)& (DstRect.top+10<= MouseY)) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { Audio_PlaySound2D(2,1.0f); CurrentSystemStockNum = GetNextSystemStockNum(); } vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrows_on.tga"), true, MenuContentTransp); } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrows_off.tga"), true, MenuContentTransp); } // выводим иконки систем в магазине, по которым тоже можно кликать SetRect(&SrcRect,0,0,128,128); SetRect(&DstRect,Setup.iAspectRatioWidth/2-436,50+20+5-5,Setup.iAspectRatioWidth/2-338,50+128-20+5+5); if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { CurrentSystemStockNum = GetPrevSystemStockNum(); Audio_PlaySound2D(2,1.0f); } vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetPrevSystemStockNum()), true, MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(GetPrevSystemStockNum()))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(GetPrevSystemStockNum()))); } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetPrevSystemStockNum()), true, 0.35f*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(GetPrevSystemStockNum()))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, 0.35f*MenuContentTransp, vw_GetText(GetSystemName(GetPrevSystemStockNum()))); } SetRect(&SrcRect,0,0,128,128); SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,55+128+20,Setup.iAspectRatioWidth/2-451+128,55+128+128+20); vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(CurrentSystemStockNum), true, MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(CurrentSystemStockNum))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(CurrentSystemStockNum))); if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) CurrentCursorStatus = 1; SetRect(&SrcRect,0,0,128,128); SetRect(&DstRect,Setup.iAspectRatioWidth/2-451+20-5,60+20+256+40-5-5,Setup.iAspectRatioWidth/2-451+128-20+5,60-20+128+256+40-5 +5); if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { Audio_PlaySound2D(2,1.0f); CurrentSystemStockNum = GetNextSystemStockNum(); } vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetNextSystemStockNum()), true, MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(GetNextSystemStockNum()))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText(GetSystemName(GetNextSystemStockNum()))); } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(GetNextSystemStockNum()), true, 0.35f*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(GetNextSystemStockNum()))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, 0.35f*MenuContentTransp, vw_GetText(GetSystemName(GetNextSystemStockNum()))); } vw_DrawFont(Setup.iAspectRatioWidth/2-475, 630, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_System_Stock")); SetRect(&SrcRect,0,0,210,600); SetRect(&DstRect,Setup.iAspectRatioWidth/2+282,50-10,Setup.iAspectRatioWidth/2+492,50+600-10); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel2+.tga"), true, MenuContentTransp); // проверяем, а все ли нормально с энергией... если не нормально, будем моргать и выведем соотв. надпись bool NeedMoreEnergy = false; if (Setup.Profile[CurrentProfile].PowerSystem != 0) { float Have = GetShipRechargeEnergy(Setup.Profile[CurrentProfile].PowerSystem); float Need = 0.0f; // если это не аркадный режим, нужно учитывать двигатель if (Setup.Profile[CurrentProfile].SpaceShipControlMode != 1) if (Setup.Profile[CurrentProfile].EngineSystem != 0) Need += GetShipEngineSystemEnergyUse(Setup.Profile[CurrentProfile].EngineSystem); // если есть спец система, ее нужно тоже учитывать if (Setup.Profile[CurrentProfile].AdvancedProtectionSystem != 0) Need += GetShipProtectionSystemEnergyUse(Setup.Profile[CurrentProfile].AdvancedProtectionSystem); // слабый реактор if (Need >= Have) NeedMoreEnergy = true; } else { // у нас вообще нет реактора... караул!!! NeedMoreEnergy = true; } // выводим информационную надпись + голосовое сообщение if (NeedMoreEnergy) { // запускаем голос... if (vw_FindSoundByNum(VoiceNeedMoreEnergy) == 0) { // уже не играем, нужно запустить опять VoiceNeedMoreEnergy = Audio_PlayVoice(6, 1.0f); } // вывод текста int SizeI = (Setup.iAspectRatioWidth-vw_FontSize(vw_GetText("9_14Line1")))/2; vw_DrawFont(SizeI, 60, 0, 0, 1.0f, 1.0f,0.0f,0.0f, CurrentAlert3*MenuContentTransp, vw_GetText("9_14Line1")); SizeI = (Setup.iAspectRatioWidth-vw_FontSize(vw_GetText("9_14Line2")))/2; vw_DrawFont(SizeI, 80, 0, 0, 1.0f, 1.0f,0.0f,0.0f, CurrentAlert3*MenuContentTransp, vw_GetText("9_14Line2")); SizeI = (Setup.iAspectRatioWidth-vw_FontSize(vw_GetText("9_14Line3")))/2; vw_DrawFont(SizeI, 100, 0, 0, 1.0f, 1.0f,0.0f,0.0f, CurrentAlert3*MenuContentTransp, vw_GetText("9_14Line3")); } // сбор данных float Current = 0.5f; int Cost = 0; bool CanSell = false; bool CanBuy = true; // Engine SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100); if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) { if (Setup.Profile[CurrentProfile].EngineSystem != 0) { CanSell = true; Cost = GetSystemCost(Setup.Profile[CurrentProfile].EngineSystem); if (Cost + Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } else { if (Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } } // Power SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100); if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) { if (Setup.Profile[CurrentProfile].PowerSystem != 0) { CanSell = true; Cost = GetSystemCost(Setup.Profile[CurrentProfile].PowerSystem+4); if (Cost + Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } else { if (Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } } // Target SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100); if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) { if (Setup.Profile[CurrentProfile].TargetingSystem != 0) { CanSell = true; Cost = GetSystemCost(Setup.Profile[CurrentProfile].TargetingSystem+8); if (Cost + Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } else { if (Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } } // Mech SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100); if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) { if (Setup.Profile[CurrentProfile].TargetingMechanicSystem != 0) { CanSell = true; Cost = GetSystemCost(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12); if (Cost + Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } else { if (Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } } // Protect SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100); if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) { if (Setup.Profile[CurrentProfile].AdvancedProtectionSystem != 0) { CanSell = true; Cost = GetSystemCost(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16); if (Cost + Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } else { if (Setup.Profile[CurrentProfile].Money < GetSystemCost(CurrentSystemStockNum)) CanBuy = false; } } // прорисовка // Engine SetRect(&SrcRect,0,0,128,128); SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,70,Setup.iAspectRatioWidth/2+437,70+100); Current = 0.5f; float ColorR, ColorG, ColorB; ColorR = ColorG = ColorB = 1.0f; if (NeedMoreEnergy && Setup.Profile[CurrentProfile].EngineSystem != 0 && Setup.Profile[CurrentProfile].SpaceShipControlMode != 1) { ColorR = 1.0f; ColorG = 0.0f; ColorB = 0.0f; } if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) { if (!NeedMoreEnergy || Setup.Profile[CurrentProfile].EngineSystem == 0 || Setup.Profile[CurrentProfile].SpaceShipControlMode == 1) { if (CanBuy) {ColorR = 0.0f; ColorG = 0.8f; ColorB = 0.0f;} else {ColorR = 1.0f; ColorG = 0.5f; ColorB = 0.0f;} } Current = 1.0f; } if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } Current = 1.0f; CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { CurrentSystemStockNum = 1; Audio_PlaySound2D(2,1.0f); } } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } } if (Setup.Profile[CurrentProfile].EngineSystem <= 0) { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-4), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText("3_empty")); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty")); Size = vw_FontSize(vw_GetText("4_Spaceship_Engine")); WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Spaceship_Engine")); } else { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].EngineSystem), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].EngineSystem))); } // Power SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,180,Setup.iAspectRatioWidth/2+437,180+100); ColorR = ColorG = ColorB = 1.0f; if (NeedMoreEnergy) { ColorR = 1.0f; ColorG = 0.0f; ColorB = 0.0f; } Current = 0.5f; if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) { if (!NeedMoreEnergy) { if (CanBuy) {ColorR = 0.0f; ColorG = 0.8f; ColorB = 0.0f;} else {ColorR = 1.0f; ColorG = 0.5f; ColorB = 0.0f;} } Current = 1.0f; } if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } Current = 1.0f; CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { CurrentSystemStockNum = 5; Audio_PlaySound2D(2,1.0f); } } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } } if (Setup.Profile[CurrentProfile].PowerSystem <= 0) { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-2), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText("3_empty")); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty")); Size = vw_FontSize(vw_GetText("4_Power_Source")); WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Power_Source")); } else { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].PowerSystem+4), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].PowerSystem+4))); } // Target SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,290,Setup.iAspectRatioWidth/2+437,290+100); ColorR = ColorG = ColorB = 1.0f; Current = 0.5f; if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) { if (CanBuy) {ColorR = 0.0f; ColorG = 0.8f; ColorB = 0.0f;} else {ColorR = 1.0f; ColorG = 0.5f; ColorB = 0.0f;} Current = 1.0f; } if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } Current = 1.0f; CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { CurrentSystemStockNum = 9; Audio_PlaySound2D(2,1.0f); } } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } } if (Setup.Profile[CurrentProfile].TargetingSystem <= 0) { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-1), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText("3_empty")); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty")); Size = vw_FontSize(vw_GetText("4_Optical_Computer")); WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Optical_Computer")); } else { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingSystem+8), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingSystem+8))); } // Mech SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,400,Setup.iAspectRatioWidth/2+437,400+100); ColorR = ColorG = ColorB = 1.0f; Current = 0.5f; if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) { if (CanBuy) {ColorR = 0.0f; ColorG = 0.8f; ColorB = 0.0f;} else {ColorR = 1.0f; ColorG = 0.5f; ColorB = 0.0f;} Current = 1.0f; } if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } Current = 1.0f; CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { Audio_PlaySound2D(2,1.0f); CurrentSystemStockNum = 13; } } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } } if (Setup.Profile[CurrentProfile].TargetingMechanicSystem <= 0) { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(-3), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText("3_empty")); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty")); Size = vw_FontSize(vw_GetText("4_Targeting_System")); WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Targeting_System")); } else { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].TargetingMechanicSystem+12))); } // Protect SetRect(&DstRect,Setup.iAspectRatioWidth/2+337,510,Setup.iAspectRatioWidth/2+437,510+100); ColorR = ColorG = ColorB = 1.0f; if (NeedMoreEnergy && Setup.Profile[CurrentProfile].AdvancedProtectionSystem != 0) { ColorR = 1.0f; ColorG = 0.0f; ColorB = 0.0f; } Current = 0.5f; if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) { if (!NeedMoreEnergy || Setup.Profile[CurrentProfile].AdvancedProtectionSystem == 0) { if (CanBuy) {ColorR = 0.0f; ColorG = 0.8f; ColorB = 0.0f;} else {ColorR = 1.0f; ColorG = 0.5f; ColorB = 0.0f;} } Current = 1.0f; } if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (NeedPlayWorkshopOnButtonSoundX != DstRect.left || NeedPlayWorkshopOnButtonSoundY != DstRect.top) { Audio_PlaySound2D(1,1.0f); NeedPlayWorkshopOnButtonSoundX = DstRect.left; NeedPlayWorkshopOnButtonSoundY = DstRect.top; } Current = 1.0f; CurrentCursorStatus = 1; if (vw_GetWindowLBMouse(true)) { Audio_PlaySound2D(2,1.0f); CurrentSystemStockNum = 17; } } else { if (NeedPlayWorkshopOnButtonSoundX == DstRect.left && NeedPlayWorkshopOnButtonSoundY == DstRect.top) { NeedPlayWorkshopOnButtonSoundX = 0; NeedPlayWorkshopOnButtonSoundY = 0; } } if (Setup.Profile[CurrentProfile].AdvancedProtectionSystem <= 0) { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(0), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText("3_empty")); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.top-4, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("3_empty")); Size = vw_FontSize(vw_GetText("4_Advanced_System")); WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-20, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText("4_Advanced_System")); } else { vw_DrawTransparent(&DstRect, &SrcRect, GetSystemIcon(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16), true, Current*MenuContentTransp); int Size = vw_FontSize(vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16))); float WScale = 0; if (Size > 128) { Size = 128; WScale = -128; } vw_DrawFont(DstRect.left+(DstRect.right-DstRect.left-Size)/2, DstRect.bottom-70, WScale, 0, 1.0f, ColorR,ColorG,ColorB, Current*MenuContentTransp, vw_GetText(GetSystemName(Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16))); } vw_DrawFont(Setup.iAspectRatioWidth/2+475-vw_FontSize(vw_GetText("7_Installed_Systems"))*1.5f, 630, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_Installed_Systems")); // текущая система vw_DrawFont(Setup.iAspectRatioWidth/2-250, 430, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, vw_GetText("7_Selected_System")); vw_DrawFont(Setup.iAspectRatioWidth/2+250-vw_FontSize(vw_GetText("7_Installed_System")), 430, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, vw_GetText("7_Installed_System")); if (CanBuy) vw_DrawFont(Setup.iAspectRatioWidth/2-250, 485, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "%s: %i", vw_GetText("7_Cost"), GetSystemCost(CurrentSystemStockNum)); else vw_DrawFont(Setup.iAspectRatioWidth/2-250, 485, 0, 0, 1.0f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("7_Cost"), GetSystemCost(CurrentSystemStockNum)); vw_DrawFont(Setup.iAspectRatioWidth/2+250-vw_FontSize("%s: %i", vw_GetText("7_Cost"), Cost), 485, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "%s: %i", vw_GetText("7_Cost"), Cost); if (DrawButton128_2(Setup.iAspectRatioWidth/2-250,580-55, vw_GetText("1_Info"), MenuContentTransp, false)) { SetCurrentDialogBox(8); DialogSystem = CurrentSystemStockNum; } if (DrawButton128_2(Setup.iAspectRatioWidth/2+250-128,580-55, vw_GetText("1_Info"), MenuContentTransp, !CanSell)) { SetCurrentDialogBox(8); NeedMoreEnergyDialog = NeedMoreEnergy; if (CurrentSystemStockNum>=1 && CurrentSystemStockNum<=4) DialogSystem = Setup.Profile[CurrentProfile].EngineSystem; if (CurrentSystemStockNum>=5 && CurrentSystemStockNum<=8) DialogSystem = Setup.Profile[CurrentProfile].PowerSystem+4; if (CurrentSystemStockNum>=9 && CurrentSystemStockNum<=12) DialogSystem = Setup.Profile[CurrentProfile].TargetingSystem+8; if (CurrentSystemStockNum>=13 && CurrentSystemStockNum<=16) DialogSystem = Setup.Profile[CurrentProfile].TargetingMechanicSystem+12; if (CurrentSystemStockNum>=17 && CurrentSystemStockNum<=20) DialogSystem = Setup.Profile[CurrentProfile].AdvancedProtectionSystem+16; } if (DrawButton128_2(Setup.iAspectRatioWidth/2-250,50+580-55, vw_GetText("1_Buy"), MenuContentTransp, !CanBuy)) { BuyCurrentSystem(); } // покупка, если 2 раза кликнули на иконку текущей системы SetRect(&DstRect,Setup.iAspectRatioWidth/2-451,55+128+20,Setup.iAspectRatioWidth/2-451+128,55+128+128+20); if (vw_OnRect(&DstRect) && !isDialogBoxDrawing() && CanBuy) if (vw_GetWindowLBDoubleMouse(true)) BuyCurrentSystem(); if (DrawButton128_2(Setup.iAspectRatioWidth/2+250-128,50+580-55, vw_GetText("1_Sell"), MenuContentTransp, !CanSell)) { SellCurrentSystem(); } // вывод информации int SizeI = (Setup.iAspectRatioWidth-vw_FontSize("%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money)*1.25f)/2; if (CanBuy) vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,1.0f,0.0f, MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money); else vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money); }
eTexture * GetSystemIcon(int Num) { switch (Num) { case -4: return vw_FindTextureByName("DATA/MENU/system_empty.tga"); case -3: return vw_FindTextureByName("DATA/MENU/system_empty.tga"); case -2: return vw_FindTextureByName("DATA/MENU/system_empty.tga"); case -1: return vw_FindTextureByName("DATA/MENU/system_empty.tga"); case 0: return vw_FindTextureByName("DATA/MENU/system_empty.tga"); case 1: return vw_FindTextureByName("DATA/MENU/system_engine1.tga"); case 2: return vw_FindTextureByName("DATA/MENU/system_engine2.tga"); case 3: return vw_FindTextureByName("DATA/MENU/system_engine3.tga"); case 4: return vw_FindTextureByName("DATA/MENU/system_engine4.tga"); case 5: return vw_FindTextureByName("DATA/MENU/system_power1.tga"); case 6: return vw_FindTextureByName("DATA/MENU/system_power2.tga"); case 7: return vw_FindTextureByName("DATA/MENU/system_power3.tga"); case 8: return vw_FindTextureByName("DATA/MENU/system_power4.tga"); case 9: return vw_FindTextureByName("DATA/MENU/system_target1.tga"); case 10: return vw_FindTextureByName("DATA/MENU/system_target2.tga"); case 11: return vw_FindTextureByName("DATA/MENU/system_target3.tga"); case 12: return vw_FindTextureByName("DATA/MENU/system_target4.tga"); case 13: return vw_FindTextureByName("DATA/MENU/system_mechan1.tga"); case 14: return vw_FindTextureByName("DATA/MENU/system_mechan2.tga"); case 15: return vw_FindTextureByName("DATA/MENU/system_mechan3.tga"); case 16: return vw_FindTextureByName("DATA/MENU/system_mechan4.tga"); case 17: return vw_FindTextureByName("DATA/MENU/system_protect1.tga"); case 18: return vw_FindTextureByName("DATA/MENU/system_protect2.tga"); case 19: return vw_FindTextureByName("DATA/MENU/system_protect3.tga"); case 20: return vw_FindTextureByName("DATA/MENU/system_protect4.tga"); } return 0; }
//------------------------------------------------------------------------------------ // прорисовка кнопки вниз для списков //------------------------------------------------------------------------------------ bool DrawListDownButton(int X, int Y, float Transp, bool Off) { RECT SrcRect, DstRect, MouseRect; SetRect(&SrcRect,0,0,32,32); SetRect(&DstRect,X,Y,X+32,Y+32); SetRect(&MouseRect,X,Y,X+32,Y+32); if (Off || DragWeapon) { SetRect(&DstRect,X+2,Y+2,X+32-2,Y+32-2); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrow_list_down.tga"), true, 0.3f*Transp); if (vw_OnRect(&MouseRect) && !isDialogBoxDrawing()) { if (Transp==1.0f && !DragWeapon) { CurrentCursorStatus = 2; if (vw_GetWindowLBMouse(true)) Audio_PlaySound2D(7,1.0f); } } return false; } bool ON = false; bool CanClick = false; // работаем с клавиатурой if ((Transp >= 0.99f) && !isDialogBoxDrawing() && DrawGameCursor) CurrentActiveMenuElement++; bool InFocusByKeyboard = false; if (CurrentKeyboardSelectMenuElement > 0) { if (CurrentKeyboardSelectMenuElement == CurrentActiveMenuElement) { InFocusByKeyboard = true; } } if ((vw_OnRect(&MouseRect) || InFocusByKeyboard) && !isDialogBoxDrawing() && DrawGameCursor) { // если тухнем или появляемся - не жать ON = true; if (Transp==1.0f) { CanClick = true; CurrentCursorStatus = 1; } if (NeedPlayOnButtonSoundX != X || NeedPlayOnButtonSoundY != Y) { Audio_PlaySound2D(15,1.0f); NeedPlayOnButtonSoundX = X; NeedPlayOnButtonSoundY = Y; } } else { if (NeedPlayOnButtonSoundX == X && NeedPlayOnButtonSoundY == Y) { NeedPlayOnButtonSoundX = 0; NeedPlayOnButtonSoundY = 0; } } if (!ON) { SetRect(&DstRect,X+2,Y+2,X+32-2,Y+32-2); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrow_list_down.tga"), true, 0.3f*Transp); } else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/arrow_list_down.tga"), true, Transp); if (CanClick) if (vw_GetWindowLBMouse(true) || (InFocusByKeyboard && (vw_GetKeys(SDLK_KP_ENTER) || vw_GetKeys(SDLK_RETURN)))) { Audio_PlaySound2D(2,1.0f); if (InFocusByKeyboard) { vw_SetKeys(SDLK_KP_ENTER, false); vw_SetKeys(SDLK_RETURN, false); } return true; } return false; }
//------------------------------------------------------------------------------------ // прорисовка чекбокса //------------------------------------------------------------------------------------ void DrawCheckBox(int X, int Y, bool *CheckBoxStatus, const char *Text, float Transp) { RECT SrcRect, DstRect; // получаем длину текста int Size = vw_FontSize(Text); bool ON = false; bool CanClick = false; // работаем с клавиатурой if ((Transp >= 0.99f) && !isDialogBoxDrawing() && DrawGameCursor) CurrentActiveMenuElement++; bool InFocusByKeyboard = false; if (CurrentKeyboardSelectMenuElement > 0) { if (CurrentKeyboardSelectMenuElement == CurrentActiveMenuElement) { InFocusByKeyboard = true; } } // 20 - расстояние между текстом SetRect(&DstRect,X+4,Y+4,X+40+20+Size,Y+40-4); if ((vw_OnRect(&DstRect) || InFocusByKeyboard) && !isDialogBoxDrawing() && DrawGameCursor) { // если тухнем или появляемся - не жать ON = true; if (Transp==1.0f) { CanClick = true; CurrentCursorStatus = 1; } } // рисуем SetRect(&SrcRect,0,0,40,38); SetRect(&DstRect,X,Y,X+40,Y+38); if (!ON || DragWeapon) vw_DrawFont(X+40+20, Y+8, 0, 0, 1.0f, 1.0f,1.0f,1.0f, Transp, Text); else vw_DrawFont(X+40+20, Y+8, 0, 0, 1.0f, 1.0f,0.5f,0.0f, Transp, Text); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/checkbox_main.tga"), true, Transp); if (*CheckBoxStatus) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/checkbox_in.tga"), true, Transp); if (CanClick && !DragWeapon) if (vw_GetWindowLBMouse(true) || (InFocusByKeyboard && (vw_GetKeys(SDLK_KP_ENTER) || vw_GetKeys(SDLK_RETURN)))) { *CheckBoxStatus = !(*CheckBoxStatus); Audio_PlaySound2D(2,1.0f); if (InFocusByKeyboard) { vw_SetKeys(SDLK_KP_ENTER, false); vw_SetKeys(SDLK_RETURN, false); } } }
//------------------------------------------------------------------------------------ // прорисовка кнопки 384 //------------------------------------------------------------------------------------ bool DrawButton384(int X, int Y, const char *Text, float Transp, float *ButTransp, float *Update) { RECT SrcRect, DstRect; bool ON = false; bool CanClick = false; float IntTransp = Transp; // работаем с клавиатурой if ((Transp >= 0.99f) && !isDialogBoxDrawing() && DrawGameCursor) CurrentActiveMenuElement++; bool InFocusByKeyboard = false; if (CurrentKeyboardSelectMenuElement > 0) { if (CurrentKeyboardSelectMenuElement == CurrentActiveMenuElement) { InFocusByKeyboard = true; } } SetRect(&DstRect,X+2,Y+1,X+384,Y+63); if ((vw_OnRect(&DstRect) || InFocusByKeyboard) && !isDialogBoxDrawing() && DrawGameCursor) { // если тухнем или появляемся - не жать ON = true; if (Transp==1.0f) { CanClick = true; CurrentCursorStatus = 1; } if (*ButTransp == 1.0f) { Audio_PlaySound2D(1,1.0f); *Update = vw_GetTime(); *ButTransp = 0.99f; } (*ButTransp) -= 3.0f*(vw_GetTime() - (*Update)); if (*ButTransp < 0.60f) *ButTransp = 0.60f; *Update = vw_GetTime(); IntTransp = (*ButTransp) * Transp; } else { if (*ButTransp < 1.0f) { (*ButTransp) += 3.0f*(vw_GetTime() - (*Update)); if (*ButTransp > 1.0f) *ButTransp =1.0f; *Update = vw_GetTime(); } IntTransp = (*ButTransp) * Transp; } // размер задней тени SetRect(&SrcRect,2,2,512-2,96-2 ); // рисуем тень SetRect(&DstRect,X-64+2,Y-17+2,X-64+512-2,Y-17+96-2); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button384_back.tga"), true, IntTransp, 0.0f, RI_UL_CORNER, 1.0f, 1.0f, 1.0f); SetRect(&SrcRect,0,0,384,64 ); // рисуем кнопку SetRect(&DstRect,X,Y,X+384,Y+64); if (!ON) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button384_out.tga"), true, Transp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button384_in.tga"), true, Transp); // получаем длину текста int Size = vw_FontSize(Text); // если текст сильно большой - сжимаем буквы, чтобы не вылазило за пределы кнопки float WScale = 0; if (Size > 310) { Size = 310; WScale = -310; } // находим смещение текста int SizeI = X + (SrcRect.right-SrcRect.left-Size)/2; // рисуем текст if (!ON) vw_DrawFont(SizeI, Y+21, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, (0.7f*Transp)/2.0f, Text); else vw_DrawFont(SizeI, Y+21, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, Transp, Text); if (CanClick) if (vw_GetWindowLBMouse(true) || (InFocusByKeyboard && (vw_GetKeys(SDLK_KP_ENTER) || vw_GetKeys(SDLK_RETURN)))) { Audio_PlaySound2D(2,1.0f); if (InFocusByKeyboard) { vw_SetKeys(SDLK_KP_ENTER, false); vw_SetKeys(SDLK_RETURN, false); } return true; } return false; }
//------------------------------------------------------------------------------------ // прорисовка кнопки - 128 //------------------------------------------------------------------------------------ bool DrawButton128_2(int X, int Y, const char *Text, float Transp, bool Off, bool SoundClick) { RECT SrcRect, DstRect, MouseRect; SetRect(&SrcRect,2,2,158-2,64-2); SetRect(&DstRect,X-14+2,Y-14+2,X+158-14-2,Y+64-14-2); SetRect(&MouseRect,X,Y,X+132,Y+35); // получаем длину текста int Size = vw_FontSize(Text); // если текст сильно большой - сжимаем буквы, чтобы не вылазило за пределы кнопки float WScale = 0; if (Size > 108) { Size = 108; WScale = -108; } // находим смещение текста int SizeI = DstRect.left + (SrcRect.right-SrcRect.left-Size)/2; if (Off || DragWeapon) { vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button_dialog128_off.tga"), true, Transp); vw_DrawFont(SizeI, Y+6, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, (0.7f*Transp)/2.0f, Text); SetRect(&DstRect,X,Y,X+132,Y+35); if (vw_OnRect(&DstRect) && !isDialogBoxDrawing()) { if (Transp==1.0f && !DragWeapon) { CurrentCursorStatus = 2; if (vw_GetWindowLBMouse(true)) Audio_PlaySound2D(7,1.0f); } } return false; } bool ON = false; bool CanClick = false; // работаем с клавиатурой if ((Transp >= 0.99f) && !isDialogBoxDrawing() && DrawGameCursor) CurrentActiveMenuElement++; bool InFocusByKeyboard = false; if (CurrentKeyboardSelectMenuElement > 0) { if (CurrentKeyboardSelectMenuElement == CurrentActiveMenuElement) { InFocusByKeyboard = true; } } if ((vw_OnRect(&MouseRect) || InFocusByKeyboard) && !isDialogBoxDrawing() && DrawGameCursor) { // если тухнем или появляемся - не жать ON = true; if (Transp==1.0f) { CanClick = true; CurrentCursorStatus = 1; } if (NeedPlayOnButtonSoundX != X || NeedPlayOnButtonSoundY != Y) { Audio_PlaySound2D(15,1.0f); NeedPlayOnButtonSoundX = X; NeedPlayOnButtonSoundY = Y; } } else { if (NeedPlayOnButtonSoundX == X && NeedPlayOnButtonSoundY == Y) { NeedPlayOnButtonSoundX = 0; NeedPlayOnButtonSoundY = 0; } } if (!ON) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button_dialog128_out.tga"), true, Transp); else vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/button_dialog128_in.tga"), true, Transp); // рисуем текст if (!ON) vw_DrawFont(SizeI, Y+6, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, (0.7f*Transp)/2.0f, Text); else vw_DrawFont(SizeI, Y+6, WScale, 0, 1.0f, 1.0f,1.0f,1.0f, Transp, Text); if (CanClick) if (vw_GetWindowLBMouse(true) || (InFocusByKeyboard && (vw_GetKeys(SDLK_KP_ENTER) || vw_GetKeys(SDLK_RETURN)))) { if (SoundClick) Audio_PlaySound2D(2,1.0f); if (InFocusByKeyboard) { vw_SetKeys(SDLK_KP_ENTER, false); vw_SetKeys(SDLK_RETURN, false); } return true; } return false; }
//----------------------------------------------------------------------------- // Установка нужных данных для вспышки возле ствола //----------------------------------------------------------------------------- void SetWeaponFire(eParticleSystem *ParticleSystem, int WeaponNum) { switch (WeaponNum) { case 1: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.7f, 0.15f, 0.0f, 0.02f); break; case 2: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 0.10f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.50f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 40.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.5f, 0.05f, 0.0f, 0.02f); break; case 3: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 0.10f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.50f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.60f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 50.00f; ParticleSystem->Life = 0.50f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.5f, 0.05f, 0.0f, 0.02f); break; case 4: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.50f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.7f, 0.15f, 0.0f, 0.02f); break; case 5: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 4.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 10.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.5f, 0.35f, 0.0f, 0.02f); break; case 6: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.20f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 20.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.5f, 0.35f, 0.0f, 0.02f); break; case 7: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.20f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 6.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 10.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.5f, 0.35f, 0.0f, 0.02f); break; case 8: ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.2f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.2f; ParticleSystem->Speed = 4.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.30f; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.4f,0.4f,0.4f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.02f); break; case 9: ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.15f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.15f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.40f; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.3f,0.3f,0.3f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.02f); break; case 10: ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.50f; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.3f,0.3f,0.3f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.02f); break; case 11: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.60f; ParticleSystem->SizeStart = 0.1f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.30f; ParticleSystem->IsAttractive = true; ParticleSystem->ParticlesPerSec = 20; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.3f,0.2f,0.3f); break; case 12: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.60f; ParticleSystem->SizeStart = 0.1f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.30f; ParticleSystem->IsAttractive = true; ParticleSystem->ParticlesPerSec = 20; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.3f,0.2f,0.3f); break; case 13: ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.7f, 1.0f, 0.0f, 0.0f, 0.02f); break; case 14: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.10f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(0.2f,0.2f,0.8f); break; case 15: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.50f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.5f, 0.0f, 0.0f, 0.02f); break; case 16: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; break; case 17: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; break; case 18: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; break; case 19: ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 0.60f; ParticleSystem->AlphaEnd = 0.10f; ParticleSystem->SizeStart = 0.4f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 30.00f; ParticleSystem->Life = 0.40f; break; default: fprintf(stderr, "Error in SetWeaponFire function call, wrong WeaponNum.\n"); break; } ParticleSystem->IsSuppressed = true; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/flare1.tga"); }
//------------------------------------------------------------------------------------ // прорисовка меню //------------------------------------------------------------------------------------ void DrawMenu() { // делаем плавное появление меню if (NeedShowMenu) { MenuContentTransp = 2.4f*(vw_GetTime()-LastMenuUpdateTime); if (MenuContentTransp >= 1.0f) { MenuContentTransp = 1.0f; NeedShowMenu = false; LastMenuUpdateTime = vw_GetTime(); // выводим подсказку, если нужно if (GameStatus == PROFILE) if (Setup.NeedShowHint[0]) SetCurrentDialogBox(9); if (GameStatus == WORKSHOP) { if (CurrentWorkshop == 1) if (Setup.NeedShowHint[1]) SetCurrentDialogBox(10); if (CurrentWorkshop == 2) if (Setup.NeedShowHint[2]) SetCurrentDialogBox(11); if (CurrentWorkshop == 3) if (Setup.NeedShowHint[3]) SetCurrentDialogBox(12); } if (GameStatus == MISSION) { // проверяем, если в одном из профайлов уже открыли 3 миссии - выводим хинт с пожертвованием bool NeedShowDonate = false; for (int i=0; i<5; i++) { if (Setup.Profile[i].Used) if (Setup.Profile[i].ByMissionExperience[2] > 0) NeedShowDonate = true; } if (NeedShowDonate) if (Setup.NeedShowHint[6]) SetCurrentDialogBox(15); } } } // делаем полавное угасание меню if (NeedHideMenu) { MenuContentTransp = 1.0f - 2.4f*(vw_GetTime() - LastMenuUpdateTime); if (MenuContentTransp <= 0.0f) { MenuContentTransp = 0.0f; SetMenu2(NextMenu); LastMenuUpdateTime = vw_GetTime(); NeedShowMenu = true; NeedHideMenu = false; } } vw_SetCameraMoveAroundPoint(VECTOR3D(0,0,0), 0.0f, VECTOR3D(0.0f, 0.0f, 0.0f)); vw_CameraLookAt(); // всегда первым рисуем скайбокс и "далекое" окружение StarSystemUpdate(); StarSystemDraw(1); // рисуем название игры, чтобы звезды и корабли пролетали перед ним vw_Start2DMode(-1,1); // надпись AstroMenace RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,863,128 ); int StartX = (Setup.iAspectRatioWidth - 863)/2; SetRect(&DstRect,StartX,10,StartX+863,10+128); if (GameStatus != WORKSHOP && GameStatus != INFORMATION && GameStatus != INTERFACE && GameStatus != OPTIONS && GameStatus != CONFCONTROL && GameStatus != OPTIONS_ADVANCED) { vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/astromenace.tga"), true, MenuContentTransp, 0.0f, RI_UL_CORNER, 1.0f, 1.0f, 1.0f); } vw_End2DMode(); // рисуем все 3д объекты DrawAllObject3D(1); // после полной прорисовки делаем обновление данных UpdateAllObject3D(vw_GetTime()); vw_UpdateAllParticleSystems(vw_GetTime()); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // работаем со скриптом, пока он есть //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if (Script != 0) if (!Script->Update(vw_GetTime())) { // удаляем скрипт delete Script; Script = 0; } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // переходим в 2д режим для прорисовки всех 2д частей //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vw_Start2DMode(-1,1); switch(GameStatus) { case MAIN_MENU: MainMenu(); break; case TOP_SCORES: TopScoresMenu(); break; case INTERFACE: InterfaceMenu(MenuContentTransp, &Button10Transp, &LastButton10UpdateTime); break; case OPTIONS: OptionsMenu(MenuContentTransp, &Button10Transp, &LastButton10UpdateTime, &Button11Transp, &LastButton11UpdateTime); break; case OPTIONS_ADVANCED: OptionsAdvMenu(MenuContentTransp, &Button10Transp, &LastButton10UpdateTime, &Button11Transp, &LastButton11UpdateTime); break; case INFORMATION: InformationMenu(); break; case CREDITS: CreditsMenu(); break; case CONFCONTROL: ConfControlMenu(MenuContentTransp, &Button10Transp, &LastButton10UpdateTime); break; case PROFILE: ProfileMenu(); break; case DIFFICULTY: DifficultyMenu(); break; case MISSION: MissionMenu(); break; case WORKSHOP: WorkshopMenu(); break; default: break; } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // последнее - вывод версии и копирайта //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Version vw_DrawFont(6, 740, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.99f, "%s %s %s %i", vw_GetText("11_Version"), GAME_VERSION, vw_GetText("11_build"), GAME_BUILD); // Copyright int CSize = vw_FontSize("%s © 2007-2012, Viewizard", vw_GetText("11_Copyright")); vw_DrawFont(Setup.iAspectRatioWidth-7-CSize, 740, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.99f, "%s © 2007-2012, Viewizard", vw_GetText("11_Copyright")); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // завершение прорисовки //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vw_End2DMode(); // если нужно - рисуем в окошке еще одном switch(GameStatus) { case INFORMATION: InformationDrawObject(); break; default: break; } // черное затемнение, если нужно if (NeedOnMenu) { MenuBlackTransp = 1.0f - 2.4f*(vw_GetTime() - LastMenuOnOffUpdateTime); if (MenuBlackTransp <= 0.0f) { MenuBlackTransp = 0.0f; NeedOnMenu = false; LastMenuOnOffUpdateTime = vw_GetTime(); } vw_Start2DMode(-1,1); RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,0,0,Setup.iAspectRatioWidth,768); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, MenuBlackTransp); vw_End2DMode(); } // черное затемнение, если нужно if (NeedOffMenu) { MenuBlackTransp = 2.4f*(vw_GetTime() - LastMenuOnOffUpdateTime); if (MenuBlackTransp >= 1.0f) { MenuBlackTransp = 1.0f; NeedOffMenu = false; LastMenuOnOffUpdateTime = vw_GetTime(); // переход на игру WorkshopDestroyData(); ComBuffer = GAME; } vw_Start2DMode(-1,1); RECT SrcRect, DstRect; SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,0,0,Setup.iAspectRatioWidth,768); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, MenuBlackTransp); vw_End2DMode(); } }
//----------------------------------------------------------------------------- // Конструктор, инициализация всех переменных //----------------------------------------------------------------------------- void CPirateShip::Create(int PirateShipNum) { ObjectStatus = 1; // чужой ObjectType = 4; ObjectCreationType = PirateShipNum; PromptDrawDist2 = 100.0f; if (PirateShipNum > 5) PromptDrawDist2 = 20000.0f; // большие корабли пиратов ResistanceHull = 1.0f; ResistanceSystems = 1.0f; MaxSpeed = 20.0f; MaxAcceler = 20.0f; MaxSpeedRotate = 40.0f; //EngineSoundNum = 0; EngineLeftQuantity = 0; EngineRightQuantity = 0; Strength = StrengthStart = PresetPirateShipData[PirateShipNum-1].Strength/GameNPCArmorPenalty; WeaponQuantity = PresetPirateShipData[PirateShipNum-1].WeaponQuantity; BossWeaponQuantity = PresetPirateShipData[PirateShipNum-1].BossWeaponQuantity; EngineQuantity = PresetPirateShipData[PirateShipNum-1].EngineQuantity; LoadObjectData(PresetPirateShipData[PirateShipNum-1].Name, this, 0, 2.0f, PresetPirateShipData[PirateShipNum-1].NeedTangentAndBinormal && Setup.UseGLSL); // всегда только эти текстуры for (int i=0; i<DrawObjectQuantity; i++) { Texture[i] = vw_FindTextureByName(PresetPirateShipData[PirateShipNum-1].TextureName); if (PresetPirateShipData[PirateShipNum-1].NeedTangentAndBinormal && Setup.UseGLSL) NormalMap[i] = vw_FindTextureByName(PresetPirateShipData[PirateShipNum-1].NormalMapName); } // начальные установки для оружия if (WeaponQuantity > 0) { WeaponSetFire = new bool[WeaponQuantity]; WeaponLocation = new VECTOR3D[WeaponQuantity]; WeaponType = new int[WeaponQuantity]; Weapon = new CWeapon*[WeaponQuantity]; for (int i=0; i<WeaponQuantity; i++) { WeaponSetFire[i] = false; WeaponType[i] = 1; Weapon[i] = 0; } } if (BossWeaponQuantity > 0) { BossWeaponSetFire = new bool[BossWeaponQuantity]; BossWeaponLocation = new VECTOR3D[BossWeaponQuantity]; BossWeaponType = new int[BossWeaponQuantity]; BossWeapon = new CWeapon*[BossWeaponQuantity]; for (int i=0; i<BossWeaponQuantity; i++) { BossWeaponSetFire[i] = false; BossWeaponType[i] = 1; BossWeapon[i] = 0; } } // начальные установки для двигателей EngineLocation = new VECTOR3D[EngineQuantity]; Engine = new eParticleSystem*[EngineQuantity]; for (int i=0; i<EngineQuantity; i++) Engine[i] = 0; // перебираем и ставим нужные данные switch (PirateShipNum) { case 1: MaxSpeed = 30.0f; MaxAcceler = 30.0f; // оружие WeaponLocation[0] = VECTOR3D(1.8f, -1.2f, 6.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WeaponLocation[1] = VECTOR3D(-1.8f, -1.2f, 6.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(204); Weapon[1]->SoundNum = 0; WeaponFireType = 1; // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(0.9f, 1.6f, -5.4f); SetPirateShipEngine(Engine[0], 1); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-0.9f, 1.6f, -5.4f); SetPirateShipEngine(Engine[1], 1); break; case 2: MaxSpeed = 50.0f; MaxAcceler = 50.0f; // оружие WeaponLocation[0] = VECTOR3D(0.0f, -2.0f, 2.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(205); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.1f, 0.5f, -5.7f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.1f, 0.5f, -5.7f); SetPirateShipEngine(Engine[1], 2); break; case 3: MaxSpeed = 30.0f; MaxAcceler = 30.0f; // оружие WeaponLocation[0] = VECTOR3D(3.0f, -0.2f, -0.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WeaponLocation[1] = VECTOR3D(-3.0f, -0.2f, -0.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(204); WeaponLocation[2] = VECTOR3D(2.0f, -0.2f, 0.0f); Weapon[2] = new CWeapon; Weapon[2]->Create(206); WeaponLocation[3] = VECTOR3D(-2.0f, -0.2f, 0.0f); Weapon[3] = new CWeapon; Weapon[3]->Create(206); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.0f, 1.8f, -1.2f); SetPirateShipEngine(Engine[0], 1); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.0f, 1.8f, -1.2f); SetPirateShipEngine(Engine[1], 1); break; case 4: MaxSpeed = 30.0f; MaxAcceler = 30.0f; // оружие WeaponLocation[0] = VECTOR3D(4.3f, -0.4f, -0.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(211); WeaponLocation[1] = VECTOR3D(-4.3f, -0.4f, -0.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(211); WeaponLocation[2] = VECTOR3D(3.0f, -0.4f, 0.5f); Weapon[2] = new CWeapon; Weapon[2]->Create(205); WeaponLocation[3] = VECTOR3D(-3.0f, -0.4f, 0.5f); Weapon[3] = new CWeapon; Weapon[3]->Create(205); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.3f, 1.9f, -1.7f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.3f, 1.9f, -1.7f); SetPirateShipEngine(Engine[1], 2); break; case 5: MaxSpeed = 30.0f; MaxAcceler = 30.0f; // оружие WeaponLocation[0] = VECTOR3D(1.0f, 4.2f, -5.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(211); WeaponLocation[1] = VECTOR3D(-1.0f, 4.2f, -5.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(211); WeaponLocation[2] = VECTOR3D(0.5f, -1.8f, 5.0f); Weapon[2] = new CWeapon; Weapon[2]->Create(211); WeaponLocation[3] = VECTOR3D(-0.5f, -1.8f, 5.0f); Weapon[3] = new CWeapon; Weapon[3]->Create(211); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(5.8f, 6.5f-4.6f, 0.0f); SetPirateShipEngine(Engine[0], 3); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-5.8f, 6.5f-4.6f, 0.0f); SetPirateShipEngine(Engine[1], 3); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(5.8f, 7.3f-4.6f, 0.0f); SetPirateShipEngine(Engine[2], 4); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-5.8f, 7.3f-4.6f, 0.0f); SetPirateShipEngine(Engine[3], 4); Engine[4] = new eParticleSystem; EngineLocation[4] = VECTOR3D(5.8f, 6.1f-4.6f, -2.3f); SetPirateShipEngine(Engine[4], 1); Engine[4]->Direction = VECTOR3D(0.0f, -0.2f, -0.8f); Engine[5] = new eParticleSystem; EngineLocation[5] = VECTOR3D(-5.8f, 6.1f-4.6f, -2.3f); SetPirateShipEngine(Engine[5], 1); Engine[5]->Direction = VECTOR3D(0.0f, -0.2f, -0.8f); break; case 6: // оружие WeaponLocation[0] = VECTOR3D(0.0f, 2.2f, -0.2f); Weapon[0] = new CWeapon; Weapon[0]->Create(202); BossWeaponLocation[0] = VECTOR3D(5.4f, 1.0f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(209); BossWeaponLocation[1] = VECTOR3D(-5.4f, 1.0f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(209); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 5.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.7f, 6.6f-3.83f, -14.2f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.7f, 6.6f-3.83f, -14.2f); SetPirateShipEngine(Engine[1], 2); break; case 7: // оружие WeaponLocation[0] = VECTOR3D(0.0f, 2.4f, -0.2f); Weapon[0] = new CWeapon; Weapon[0]->Create(202); BossWeaponLocation[0] = VECTOR3D(9.5f, 1.3f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(210); BossWeaponLocation[1] = VECTOR3D(-9.5f, 1.3f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(210); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 5.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(2.2f, 7.6f-5.25f, -14.8f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-2.2f, 7.6f-5.25f, -14.8f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(17.2f, 6.8f-5.25f, -9.0f); SetPirateShipEngine(Engine[2], 5); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-17.2f, 6.8f-5.25f, -9.0f); SetPirateShipEngine(Engine[3], 5); break; case 8: // оружие WeaponLocation[0] = VECTOR3D(0.0f, 2.4f, -0.2f); Weapon[0] = new CWeapon; Weapon[0]->Create(202); BossWeaponLocation[0] = VECTOR3D(9.1f, 1.3f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(206); BossWeaponLocation[1] = VECTOR3D(9.4f, 1.0f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(206); BossWeaponLocation[2] = VECTOR3D(9.1f, 0.7f, 2.0f); BossWeapon[2] = new CWeapon; BossWeapon[2]->Create(206); BossWeaponLocation[3] = VECTOR3D(-9.1f, 1.3f, 2.0f); BossWeapon[3] = new CWeapon; BossWeapon[3]->Create(206); BossWeaponLocation[4] = VECTOR3D(-9.4f, 1.0f, 2.0f); BossWeapon[4] = new CWeapon; BossWeapon[4]->Create(206); BossWeaponLocation[5] = VECTOR3D(-9.1f, 0.7f, 2.0f); BossWeapon[5] = new CWeapon; BossWeapon[5]->Create(206); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 6.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(4.5f, 6.3f-3.62f, -12.5f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-4.5f, 6.3f-3.62f, -12.5f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(9.2f, 4.4f-3.62f, -5.6f); SetPirateShipEngine(Engine[2], 5); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-9.2f, 4.4f-3.62f, -5.6f); SetPirateShipEngine(Engine[3], 5); break; case 9: // оружие WeaponLocation[0] = VECTOR3D(0.0f, 4.2f, 7.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(201); WeaponLocation[1] = VECTOR3D(0.0f, 4.2f, 3.5f); Weapon[1] = new CWeapon; Weapon[1]->Create(201); Weapon[1]->SetRotation(VECTOR3D(0,180,0)); WeaponLocation[2] = VECTOR3D(0.0f, 3.4f, -5.0f); Weapon[2] = new CWeapon; Weapon[2]->Create(202); BossWeaponLocation[0] = VECTOR3D(11.1f, 2.7f, 9.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(205); BossWeaponLocation[1] = VECTOR3D(-11.1f, 2.7f, 9.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(205); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 7.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.4f, 8.7f-4.9f, -20.4f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.4f, 8.7f-4.9f, -20.4f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(4.7f, 7.0f-4.9f, 0.0f); SetPirateShipEngine(Engine[2], 2); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-4.7f, 7.0f-4.9f, 0.0f); SetPirateShipEngine(Engine[3], 2); Engine[4] = new eParticleSystem; EngineLocation[4] = VECTOR3D(7.5f, 6.8f-4.9f, 0.0f); SetPirateShipEngine(Engine[4], 2); Engine[5] = new eParticleSystem; EngineLocation[5] = VECTOR3D(-7.5f, 6.8f-4.9f, 0.0f); SetPirateShipEngine(Engine[5], 2); break; case 10: // оружие WeaponLocation[0] = VECTOR3D(0.0f, 4.4f, 6.8f); Weapon[0] = new CWeapon; Weapon[0]->Create(201); WeaponLocation[1] = VECTOR3D(0.0f, 4.4f, 2.6f); Weapon[1] = new CWeapon; Weapon[1]->Create(201); Weapon[1]->SetRotation(VECTOR3D(0,180,0)); WeaponLocation[2] = VECTOR3D(0.0f, 2.6f, -7.0f); Weapon[2] = new CWeapon; Weapon[2]->Create(202); WeaponLocation[3] = VECTOR3D(0.0f, 2.6f, -16.0f); Weapon[3] = new CWeapon; Weapon[3]->Create(201); Weapon[3]->SetRotation(VECTOR3D(0,180,0)); BossWeaponLocation[0] = VECTOR3D(11.1f, 2.7f, 8.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(205); BossWeaponLocation[1] = VECTOR3D(-11.1f, 2.7f, 8.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(205); BossWeaponLocation[2] = VECTOR3D(16.5f, 2.7f, 7.5f); BossWeapon[2] = new CWeapon; BossWeapon[2]->Create(205); BossWeaponLocation[3] = VECTOR3D(-16.5f, 2.7f, 7.5f); BossWeapon[3] = new CWeapon; BossWeapon[3]->Create(205); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 7.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(3.8f, 5.4f-4.29f, -19.5f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-3.8f, 5.4f-4.29f, -19.5f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(5.8f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[2], 2); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-5.8f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[3], 2); Engine[4] = new eParticleSystem; EngineLocation[4] = VECTOR3D(8.0f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[4], 2); Engine[5] = new eParticleSystem; EngineLocation[5] = VECTOR3D(-8.0f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[5], 2); Engine[6] = new eParticleSystem; EngineLocation[6] = VECTOR3D(20.0f, 5.0f-4.29f, -3.6f); SetPirateShipEngine(Engine[6], 2); Engine[7] = new eParticleSystem; EngineLocation[7] = VECTOR3D(-20.0f, 5.0f-4.29f, -3.6f); SetPirateShipEngine(Engine[7], 2); break; case 11: // оружие BossWeaponLocation[0] = VECTOR3D(5.4f, 1.0f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(209); BossWeaponLocation[1] = VECTOR3D(-5.4f, 1.0f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(209); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 5.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.7f, 6.6f-3.83f, -14.2f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.7f, 6.6f-3.83f, -14.2f); SetPirateShipEngine(Engine[1], 2); break; case 12: // оружие BossWeaponLocation[0] = VECTOR3D(9.5f, 1.3f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(210); BossWeaponLocation[1] = VECTOR3D(-9.5f, 1.3f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(210); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 5.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(2.2f, 7.6f-5.25f, -14.8f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-2.2f, 7.6f-5.25f, -14.8f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(17.2f, 6.8f-5.25f, -9.0f); SetPirateShipEngine(Engine[2], 5); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-17.2f, 6.8f-5.25f, -9.0f); SetPirateShipEngine(Engine[3], 5); break; case 13: // оружие BossWeaponLocation[0] = VECTOR3D(9.1f, 1.3f, 2.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(206); BossWeaponLocation[1] = VECTOR3D(9.4f, 1.0f, 2.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(206); BossWeaponLocation[2] = VECTOR3D(9.1f, 0.7f, 2.0f); BossWeapon[2] = new CWeapon; BossWeapon[2]->Create(206); BossWeaponLocation[3] = VECTOR3D(-9.1f, 1.3f, 2.0f); BossWeapon[3] = new CWeapon; BossWeapon[3]->Create(206); BossWeaponLocation[4] = VECTOR3D(-9.4f, 1.0f, 2.0f); BossWeapon[4] = new CWeapon; BossWeapon[4]->Create(206); BossWeaponLocation[5] = VECTOR3D(-9.1f, 0.7f, 2.0f); BossWeapon[5] = new CWeapon; BossWeapon[5]->Create(206); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 6.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(4.5f, 6.3f-3.62f, -12.5f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-4.5f, 6.3f-3.62f, -12.5f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(9.2f, 4.4f-3.62f, -5.6f); SetPirateShipEngine(Engine[2], 5); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-9.2f, 4.4f-3.62f, -5.6f); SetPirateShipEngine(Engine[3], 5); break; case 14: // оружие BossWeaponLocation[0] = VECTOR3D(11.1f, 2.7f, 9.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(205); BossWeaponLocation[1] = VECTOR3D(-11.1f, 2.7f, 9.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(205); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 7.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(1.4f, 8.7f-4.9f, -20.4f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-1.4f, 8.7f-4.9f, -20.4f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(4.7f, 7.0f-4.9f, 0.0f); SetPirateShipEngine(Engine[2], 2); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-4.7f, 7.0f-4.9f, 0.0f); SetPirateShipEngine(Engine[3], 2); Engine[4] = new eParticleSystem; EngineLocation[4] = VECTOR3D(7.5f, 6.8f-4.9f, 0.0f); SetPirateShipEngine(Engine[4], 2); Engine[5] = new eParticleSystem; EngineLocation[5] = VECTOR3D(-7.5f, 6.8f-4.9f, 0.0f); SetPirateShipEngine(Engine[5], 2); break; case 15: // оружие BossWeaponLocation[0] = VECTOR3D(11.1f, 2.7f, 8.0f); BossWeapon[0] = new CWeapon; BossWeapon[0]->Create(205); BossWeaponLocation[1] = VECTOR3D(-11.1f, 2.7f, 8.0f); BossWeapon[1] = new CWeapon; BossWeapon[1]->Create(205); BossWeaponLocation[2] = VECTOR3D(16.5f, 2.7f, 7.5f); BossWeapon[2] = new CWeapon; BossWeapon[2]->Create(205); BossWeaponLocation[3] = VECTOR3D(-16.5f, 2.7f, 7.5f); BossWeapon[3] = new CWeapon; BossWeapon[3]->Create(205); // фларе WeaponFlareLocation = VECTOR3D(0.0f, 7.0f, 0.0f); WeaponFlare = new CWeapon; WeaponFlare->Create(203); // двигатели Engine[0] = new eParticleSystem; EngineLocation[0] = VECTOR3D(3.8f, 5.4f-4.29f, -19.5f); SetPirateShipEngine(Engine[0], 2); Engine[1] = new eParticleSystem; EngineLocation[1] = VECTOR3D(-3.8f, 5.4f-4.29f, -19.5f); SetPirateShipEngine(Engine[1], 2); Engine[2] = new eParticleSystem; EngineLocation[2] = VECTOR3D(5.8f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[2], 2); Engine[3] = new eParticleSystem; EngineLocation[3] = VECTOR3D(-5.8f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[3], 2); Engine[4] = new eParticleSystem; EngineLocation[4] = VECTOR3D(8.0f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[4], 2); Engine[5] = new eParticleSystem; EngineLocation[5] = VECTOR3D(-8.0f, 6.0f-4.29f, -0.9f); SetPirateShipEngine(Engine[5], 2); Engine[6] = new eParticleSystem; EngineLocation[6] = VECTOR3D(20.0f, 5.0f-4.29f, -3.6f); SetPirateShipEngine(Engine[6], 2); Engine[7] = new eParticleSystem; EngineLocation[7] = VECTOR3D(-20.0f, 5.0f-4.29f, -3.6f); SetPirateShipEngine(Engine[7], 2); break; default: fprintf(stderr, "Wrong PirateShipNum!"); return; } for (int i=0; i< EngineQuantity; i++) { Engine[i]->SetStartLocation(EngineLocation[i]); // находим кол-во внутренних источников света if (Engine[i]->Light != 0) InternalLights++; } // находим все данные по геометрии ::CObject3D::InitByDrawObjectList(); }
//------------------------------------------------------------------------------------ // выбор миссии //------------------------------------------------------------------------------------ void MissionMenu() { // проверка ограничения if (Setup.Profile[CurrentProfile].OpenLevelNum > AllMission-1) Setup.Profile[CurrentProfile].OpenLevelNum = AllMission-1; RECT SrcRect, DstRect; SetRect(&SrcRect,2,2,863-2,484-2); SetRect(&DstRect,Setup.iAspectRatioWidth/2-427,175-15,Setup.iAspectRatioWidth/2-427+863-4,175-15+484-4); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/panel800_444_back.tga"), true, 0.9f*MenuContentTransp); int X1 = Setup.iAspectRatioWidth/2 - 372; int Y1 = 270; // выводим текущий профиль пилота int Size = vw_FontSize("%s: ", vw_GetText("3_Pilot_Profile")); vw_DrawFont(X1, 208+12, 0, 0, 1.0f, 0.0f,1.0f,0.0f, 1.0f*MenuContentTransp, "%s: ", vw_GetText("3_Pilot_Profile")); if (Size+vw_FontSize(Setup.Profile[CurrentProfile].Name) > 500) { vw_DrawFont(X1+Size, 208+12, 0, 500-Size, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, Setup.Profile[CurrentProfile].Name); vw_DrawFont(X1+510, 208+12, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "..."); } else vw_DrawFont(X1+Size, 208+12, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, Setup.Profile[CurrentProfile].Name); if (DrawButton200_2(X1+616-72, 212, vw_GetText("1_Change_Profile"), MenuContentTransp, false)) { ComBuffer = PROFILE; } // подложка для вывода описания миссий SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,X1-2,Y1-2,X1+2+710,Y1+2+320); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, 0.2f*MenuContentTransp); SetRect(&DstRect,X1,Y1,X1+710,Y1+320); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/blackpoint.tga"), true, 0.5f*MenuContentTransp); // подсвечиваем выбранный уровень if (CurrentMission != -1) if (StartMission<=CurrentMission && CurrentMission<=EndMission) { int ShowLine = CurrentMission; if (ShowLine>=StartMission) ShowLine -= StartMission; SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,X1+1,Y1 + 64*ShowLine+1,X1+709,Y1 + 64*ShowLine+63); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/whitepoint.tga"), true, 0.1f*MenuContentTransp); } // выводим миссии текущего листа int TMPSoundOnMissionID = -1; for (int i=StartMission; i<=EndMission; i++) if (AllMission > i) { // если не можем выбирать... if (i > Setup.Profile[CurrentProfile].OpenLevelNum) { SetRect(&SrcRect,0,0,64,64); SetRect(&DstRect,X1+2,Y1+2,X1+62,Y1+62); if (MissionIcon[i] != 0) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName(MissionIcon[i]), true, 0.3f*MenuContentTransp); if (MissionTitleType[i] == 1) vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], 0.3f*MenuContentTransp, vw_GetText(MissionTitle[i])); else vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], 0.3f*MenuContentTransp, MissionTitle[i]); if (MissionDescrType[i] == 1) vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], 0.3f*MenuContentTransp, vw_GetText(MissionDescr[i])); else vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], 0.3f*MenuContentTransp, MissionDescr[i]); } SetRect(&DstRect,X1,Y1+1,X1+710,Y1+64); if (i <= Setup.Profile[CurrentProfile].OpenLevelNum) { // работаем с клавиатурой if ((MenuContentTransp >= 0.99f) && !isDialogBoxDrawing()) CurrentActiveMenuElement++; bool InFocusByKeyboard = false; if (CurrentKeyboardSelectMenuElement > 0) { if (CurrentKeyboardSelectMenuElement == CurrentActiveMenuElement) { InFocusByKeyboard = true; } } if ((vw_OnRect(&DstRect) || InFocusByKeyboard) && !isDialogBoxDrawing()) { TMPSoundOnMissionID = i; CurrentCursorStatus = 1; // если только встали - нужно звуком это показать if (SoundOnMissionID != i) { SoundOnMissionID = i; // если задействуем клавиатуру - неиграем тут звук if (CurrentKeyboardSelectMenuElement == 0) Audio_PlaySound2D(5,1.0f); } // если стоим над ним... SetRect(&SrcRect,0,0,64,64); SetRect(&DstRect,X1,Y1,X1+64,Y1+64); if (MissionIcon != 0) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName(MissionIcon[i]), true, MenuContentTransp); if (MissionTitleType[i] == 1) vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], MenuContentTransp, vw_GetText(MissionTitle[i])); else vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], MenuContentTransp, MissionTitle[i]); if (MissionDescrType[i] == 1) vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], MenuContentTransp, vw_GetText(MissionDescr[i])); else vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], MenuContentTransp, MissionDescr[i]); if (CurrentMission != i) { SetRect(&SrcRect,0,0,2,2); SetRect(&DstRect,X1+64,Y1+1,X1+709,Y1+63); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/whitepoint.tga"), true, 0.1f*MenuContentTransp); } if (vw_GetWindowLBMouse(true) || (InFocusByKeyboard && (vw_GetKeys(SDLK_KP_ENTER) || vw_GetKeys(SDLK_RETURN)))) { CurrentMission = i; Setup.Profile[CurrentProfile].LastMission = CurrentMission; Audio_PlaySound2D(6,1.0f); if (InFocusByKeyboard) { vw_SetKeys(SDLK_KP_ENTER, false); vw_SetKeys(SDLK_RETURN, false); } } if (vw_GetWindowLBDoubleMouse(true)) { CurrentMission = i; Setup.Profile[CurrentProfile].LastMission = CurrentMission; // если уже играли в эту миссию if (Setup.Profile[CurrentProfile].MissionReplayCount[CurrentMission] > 0) { if (Setup.NeedShowHint[5]) { SetCurrentDialogBox(14); } else { ComBuffer = WORKSHOP; CurrentWorkshop = 3; WorkshopCreate(); } } else { ComBuffer = WORKSHOP; CurrentWorkshop = 3; WorkshopCreate(); } } } else { // если не стоим над ним, но можем выбирать SetRect(&SrcRect,0,0,64,64); SetRect(&DstRect,X1+2,Y1+2,X1+62,Y1+62); if (MissionIcon != 0) vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName(MissionIcon[i]), true, 0.8f*MenuContentTransp); if (MissionTitleType[i] == 1) vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], 0.8f*MenuContentTransp, vw_GetText(MissionTitle[i])); else vw_DrawFont(X1+20+64, Y1+9, -610, 0, 1.0f, MissionTitleColorR[i],MissionTitleColorG[i],MissionTitleColorB[i], 0.8f*MenuContentTransp, MissionTitle[i]); if (MissionDescrType[i] == 1) vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], 0.8f*MenuContentTransp, vw_GetText(MissionDescr[i])); else vw_DrawFont(X1+20+64, Y1+33, -610, 0, 1.0f, MissionDescrColorR[i],MissionDescrColorG[i],MissionDescrColorB[i], 0.8f*MenuContentTransp, MissionDescr[i]); } } Y1 += 64; } // если не стоим над профилями - нужно сбросить флаг if (TMPSoundOnMissionID == -1) SoundOnMissionID = -1; Y1 = 270; // стрелки перемещения списка if (DrawListUpButton(X1+718, Y1, MenuContentTransp, !(StartMission > 0))) { StartMission--; EndMission--; } if (DrawListDownButton(X1+718,Y1+320-32, MenuContentTransp, !(StartMission < AllMission-5))) { StartMission++; EndMission++; } // проверяем колесико мышки, если курсор находится над активной частью SetRect(&DstRect,X1,Y1,X1+750,Y1+320); if (vw_OnRect(&DstRect)) { if (vw_GetWheelStatus() != 0 && !isDialogBoxDrawing()) { StartMission += vw_GetWheelStatus(); EndMission += vw_GetWheelStatus(); if (StartMission < 0) { StartMission = 0; EndMission = 4; } if (EndMission > AllMission-1) { EndMission = AllMission-1; StartMission = EndMission-4; } vw_ResetWheelStatus(); } } else if (vw_GetWheelStatus() != 0) { vw_ResetWheelStatus(); } // выводим отображение положени в списке на полоске со стрелками SetRect(&SrcRect,0,0,32,32); SetRect(&DstRect,X1+750-32+4,Y1+32+((320.0f-64)/AllMission)*StartMission,X1+750-4,Y1+32+((320.0f-64)/AllMission)*(EndMission+1)); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/whitepoint.tga"), true, 0.3f*MenuContentTransp); // обработка перетягивания ползунка отображения позиции списка // если стоим на ползунком и нажали кнопку мышки - "захватываем" if (!SliderUnderMouseControl && vw_OnRect(&DstRect) && vw_GetWindowLBMouse(false) && !isDialogBoxDrawing()) { SliderUnderMouseControl = true; Audio_PlaySound2D(2,1.0f); } // если ползунок был захвачен, но уже не над секцией где его можно перетягивать или отпустили мышку - отпускаем RECT DstRect2; SetRect(&DstRect2,X1+750-32+4,Y1+32,X1+750-4,Y1+32+(320.0f-64)); if ((SliderUnderMouseControl && (!vw_OnRect(&DstRect2) || !vw_GetWindowLBMouse(false))) || isDialogBoxDrawing()) { SliderUnderMouseControl = false; } // просто кликнули на зону перетягивания, не на ползунок if (!vw_OnRect(&DstRect) && vw_OnRect(&DstRect2) && vw_GetWindowLBMouse(false) && !isDialogBoxDrawing()) { SliderUnderMouseControl = true; Audio_PlaySound2D(2,1.0f); vw_SetWindowLBMouse(false); } // отображаем курсором, что можно кликать на полосе прокрутки if (vw_OnRect(&DstRect2)) CurrentCursorStatus = 1; // корректируем его положение ползунка согласно положению мышки if (SliderUnderMouseControl) { int MouseX, MouseY; vw_GetMousePos(&MouseX, &MouseY); int SliderNewPosition = (MouseY - Y1-32)/((320.0f-64)/AllMission); StartMission = 0; EndMission = 4; if (SliderNewPosition > 2) { StartMission = SliderNewPosition-2; EndMission = SliderNewPosition+2; if (SliderNewPosition >= AllMission-2) { StartMission = AllMission-5; EndMission = AllMission-1; } } } int X = Setup.iAspectRatioWidth/2 - 284; int Y = 165+100*5; if (DrawButton256(X,Y, vw_GetText("1_MAIN_MENU"), MenuContentTransp, &Button10Transp, &LastButton10UpdateTime)) { ComBuffer = MAIN_MENU; } X = Setup.iAspectRatioWidth/2 + 28; if (DrawButton256(X,Y, vw_GetText("1_NEXT"), MenuContentTransp, &Button11Transp, &LastButton11UpdateTime, !(CurrentMission >= 0))) { // если уже играли в эту миссию if (Setup.Profile[CurrentProfile].MissionReplayCount[CurrentMission] > 0) { if (Setup.NeedShowHint[5]) { SetCurrentDialogBox(14); } else { ComBuffer = WORKSHOP; CurrentWorkshop = 3; WorkshopCreate(); } } else { ComBuffer = WORKSHOP; CurrentWorkshop = 3; WorkshopCreate(); } } }
//----------------------------------------------------------------------------- // инициализация класса //----------------------------------------------------------------------------- CSpaceStars::CSpaceStars() { Age = 0.0f; TimeLastUpdate = -1.0f; // положение системы Location = VECTOR3D( 0.0f, 0.0f, 0.0f); Size = 0.003f; CreationSize = VECTOR3D(5.21f,5.21f,5.21f); Texture = vw_FindTextureByName("DATA/GFX/flare1.tga"); DeadZone = 5.2f; if (Setup.UseGLSL) { GLSL = vw_FindShaderByName("SpaceStars"); UniformLocations[0] = vw_GetUniformLocation(GLSL, "ParticleTexture"); UniformLocations[1] = vw_GetUniformLocation(GLSL, "ParticleAge"); } // начальные установки для мартиц поворотов Matrix33Identity(CurrentRotationMat); Matrix33Identity(OldInvRotationMat); // настройка массива Start = 0; End = 0; unsigned int ParticlesCreated = 10000 - 4000*Setup.VisualEffectsQuality; // пока не создадим все необходимые частицы while (ParticlesCreated > 0) { // создаем новую частицу CStar *NewParticle = 0; NewParticle = new CStar; if (NewParticle == 0) return; // считаем значение альфы NewParticle->Alpha = 0.5f + 0.5f * vw_Randf1; // убираем переполнение Clamp( NewParticle->Alpha, 0.0f, 1.0f ); // считаем дельту альфы NewParticle->AlphaDelta = (1.5f + 1.5f * vw_Randf1) / 3.0f; // выпускаем частицу возле места нахождения системы // в сфере VECTOR3D tmp; float minDist = CreationSize.x*CreationSize.x+CreationSize.y*CreationSize.y+CreationSize.z*CreationSize.z; // если зона больше чем радиус излучения - выключаем ее if (minDist <= DeadZone*DeadZone) DeadZone = 0.0f; // прибавляем к рандому, чтобы избежать вероятности появления всех трех нулей и деления на ноль в дальнейшем tmp.x = (vw_Randf0 + 0.00001f) * CreationSize.x; tmp.y = vw_Randf0 * CreationSize.y; tmp.z = vw_Randf0 * CreationSize.z; float ParticleDist = tmp.x*tmp.x + tmp.y*tmp.y + tmp.z*tmp.z; while (ParticleDist > minDist || ParticleDist < DeadZone*DeadZone) { if (ParticleDist > minDist) { // ум. радиус VECTOR3D tmp1 = tmp; tmp1.Normalize(); tmp1 = tmp1^(1/100.0f); tmp = tmp - tmp1; } if ( ParticleDist < DeadZone*DeadZone) { // ув. радиус VECTOR3D tmp1 = tmp; tmp1.Normalize(); tmp1 = tmp1^(1/100.0f); tmp = tmp + tmp1; if (tmp.x > 0.0f) {if (tmp.x > CreationSize.x) tmp.x = CreationSize.x;} else {if (tmp.x < -CreationSize.x) tmp.x = -CreationSize.x;} if (tmp.y > 0.0f) {if (tmp.y > CreationSize.y) tmp.y = CreationSize.y;} else {if (tmp.y < -CreationSize.y) tmp.y = -CreationSize.y;} if (tmp.z > 0.0f) {if (tmp.z > CreationSize.z) tmp.z = CreationSize.z;} else {if (tmp.z < -CreationSize.z) tmp.z = -CreationSize.z;} } ParticleDist = tmp.x*tmp.x + tmp.y*tmp.y + tmp.z*tmp.z; } Matrix33CalcPoint(&tmp, CurrentRotationMat); NewParticle->Location = Location + tmp; // подключаем частицу к системе Attach(NewParticle); // уменьшаем необходимое количество частиц ParticlesCreated--; } list = 0; tmpDATA = 0; VBO = 0; LastCameraAngleX = LastCameraAngleY = LastCameraAngleZ = 0.0f; }
//----------------------------------------------------------------------------- // Конструктор, инициализация всех переменных //----------------------------------------------------------------------------- void CTracked::Create(int TrackedNum) { ObjectType = 5; MaxSpeed = 20.0f; MaxAcceler = 5.0f; MaxSpeedRotate = 20.0f; ObjectCreationType = TrackedNum; // ставим без оптимизации, иначе не увидим гусениц NeedCullFaces = false; LoadObjectData(PresetTrackedData[TrackedNum-1].Name, this, 0, 2.0f); for (int i=0; i<DrawObjectQuantity; i++) { Texture[i] = vw_FindTextureByName(PresetTrackedData[TrackedNum-1].TextureName); } ResistanceHull = 1.0f; ResistanceSystems = 1.0f; SpeedToRotate = PresetTrackedData[TrackedNum-1].SpeedToRotate; Strength = StrengthStart = PresetTrackedData[TrackedNum-1].Strength/GameNPCArmorPenalty; WeaponQuantity = PresetTrackedData[TrackedNum-1].WeaponQuantity; // начальные установки для оружия WeaponSetFire = new bool[WeaponQuantity]; WeaponLocation = new VECTOR3D[WeaponQuantity]; Weapon = new CWeapon*[WeaponQuantity]; WeaponBound = new VECTOR3D[WeaponQuantity]; for (int i=0; i<WeaponQuantity; i++) { WeaponSetFire[i] = false; Weapon[i] = 0; } // установка доп. текстуры и других настроек для каждой модели switch (TrackedNum) { case 1: WeaponLocation[0] = VECTOR3D(0.0f, 5.5f, 9.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(211); WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 2; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 6; WheelObjectsNum[4] = 7; WheelObjectsNum[5] = 8; WheelObjectsNum[6] = 9; WheelObjectsNum[7] = 10; WheelObjectsNum[8] = 11; WheelObjectsNum[9] = 12; WheelObjectsNum[10] = 13; WheelObjectsNum[11] = 14; WheelObjectsNum[12] = 15; WheelObjectsNum[13] = 16; WheelObjectsNum[14] = 17; WheelObjectsNum[15] = 18; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 1; TargetHorizObject[1] = 5; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 5; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 19; Texture[19] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 2: WeaponLocation[0] = VECTOR3D(0.1f, 6.1f, -0.4f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); WeaponLocation[1] = VECTOR3D(-0.1f, 6.1f, -0.4f); Weapon[1] = new CWeapon; Weapon[1]->Create(204); WeaponFireType = 2; WheelQuantity = 10; WheelObjectsNum = new int[10]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 11; TargetHorizObject[1] = 12; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 12; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 13; Texture[13] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 3: WeaponLocation[0] = VECTOR3D(0.0f, 5.2f, 3.7f); Weapon[0] = new CWeapon; Weapon[0]->Create(213); WheelQuantity = 14; WheelObjectsNum = new int[14]; WheelObjectsNum[0] = 0; WheelObjectsNum[1] = 1; WheelObjectsNum[2] = 2; WheelObjectsNum[3] = 3; WheelObjectsNum[4] = 4; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 10; WheelObjectsNum[8] = 11; WheelObjectsNum[9] = 12; WheelObjectsNum[10] = 13; WheelObjectsNum[11] = 14; WheelObjectsNum[12] = 15; WheelObjectsNum[13] = 16; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 8; TargetHorizObject[1] = 9; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 9; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 17; Texture[17] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 4: WeaponLocation[0] = VECTOR3D(0.0f, 5.3f, 6.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(208); WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 2; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 5; WheelObjectsNum[4] = 6; WheelObjectsNum[5] = 7; WheelObjectsNum[6] = 8; WheelObjectsNum[7] = 9; WheelObjectsNum[8] = 10; WheelObjectsNum[9] = 11; WheelObjectsNum[10] = 12; WheelObjectsNum[11] = 13; WheelObjectsNum[12] = 14; WheelObjectsNum[13] = 15; WheelObjectsNum[14] = 16; WheelObjectsNum[15] = 17; TargetHorizObjectQuantity = 3; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 18; TargetHorizObject[1] = 19; TargetHorizObject[2] = 20; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 19; //TargetVertObject[1] = 20; TargetVertObjectMaxAngle = 50.0f; DrawObjectList[20].Location.z -= 1.0f; TrackObjectNum = 21; Texture[21] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 5: WeaponLocation[0] = VECTOR3D(0.0f, 5.8f, 4.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(208); WheelQuantity = 14; WheelObjectsNum = new int[14]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 10; WheelObjectsNum[8] = 11; WheelObjectsNum[9] = 12; WheelObjectsNum[10] = 13; WheelObjectsNum[11] = 14; WheelObjectsNum[12] = 15; WheelObjectsNum[13] = 16; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 9; TargetHorizObject[1] = 8; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 8; TargetVertObjectMaxAngle = 30.0f; TrackObjectNum = 17; Texture[17] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 6: WeaponLocation[0] = VECTOR3D(0.0f, 4.9f, 4.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(211); WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 2; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 5; WheelObjectsNum[4] = 6; WheelObjectsNum[5] = 7; WheelObjectsNum[6] = 8; WheelObjectsNum[7] = 9; WheelObjectsNum[8] = 10; WheelObjectsNum[9] = 11; WheelObjectsNum[10] = 12; WheelObjectsNum[11] = 13; WheelObjectsNum[12] = 14; WheelObjectsNum[13] = 15; WheelObjectsNum[14] = 16; WheelObjectsNum[15] = 17; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 1; TargetHorizObject[1] = 18; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 18; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 19; Texture[19] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 7: WeaponLocation[0] = VECTOR3D(0.0f, 7.6f, 5.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(212); WheelQuantity = 22; WheelObjectsNum = new int[22]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; WheelObjectsNum[10] = 11; WheelObjectsNum[11] = 12; WheelObjectsNum[12] = 13; WheelObjectsNum[13] = 14; WheelObjectsNum[14] = 15; WheelObjectsNum[15] = 16; WheelObjectsNum[16] = 19; WheelObjectsNum[17] = 20; WheelObjectsNum[18] = 21; WheelObjectsNum[19] = 22; WheelObjectsNum[20] = 23; WheelObjectsNum[21] = 24; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 18; TargetHorizObject[1] = 17; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 17; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 25; Texture[25] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 8: WeaponLocation[0] = VECTOR3D(0.0f, 7.0f, 8.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(208); WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 2; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 5; WheelObjectsNum[4] = 6; WheelObjectsNum[5] = 7; WheelObjectsNum[6] = 8; WheelObjectsNum[7] = 9; WheelObjectsNum[8] = 10; WheelObjectsNum[9] = 11; WheelObjectsNum[10] = 12; WheelObjectsNum[11] = 13; WheelObjectsNum[12] = 14; WheelObjectsNum[13] = 15; WheelObjectsNum[14] = 16; WheelObjectsNum[15] = 17; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 18; TargetHorizObject[1] = 19; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 19; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 20; Texture[20] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 9: WeaponLocation[0] = VECTOR3D(0.0f, 6.7f, 6.8f); Weapon[0] = new CWeapon; Weapon[0]->Create(211); Weapon[0]->NextFireTime = Weapon[0]->NextFireTime / 2.0f; WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; WheelObjectsNum[10] = 11; WheelObjectsNum[11] = 12; WheelObjectsNum[12] = 13; WheelObjectsNum[13] = 14; WheelObjectsNum[14] = 15; WheelObjectsNum[15] = 16; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 18; TargetHorizObject[1] = 0; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 0; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 19; Texture[19] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 10: WeaponLocation[0] = VECTOR3D(0.0f, 6.1f, 0.5f); Weapon[0] = new CWeapon; Weapon[0]->Create(204); Weapon[0]->NextFireTime = Weapon[0]->NextFireTime / 2.0f; WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; WheelObjectsNum[10] = 11; WheelObjectsNum[11] = 12; WheelObjectsNum[12] = 13; WheelObjectsNum[13] = 14; WheelObjectsNum[14] = 15; WheelObjectsNum[15] = 16; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 18; TargetHorizObject[1] = 0; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 0; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 19; Texture[19] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 11: WeaponLocation[0] = VECTOR3D(2.2f, 5.4f, 7.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(209); WeaponLocation[1] = VECTOR3D(-2.2f, 5.4f, 7.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(209); WeaponFireType = 3; WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; WheelObjectsNum[10] = 11; WheelObjectsNum[11] = 12; WheelObjectsNum[12] = 13; WheelObjectsNum[13] = 14; WheelObjectsNum[14] = 15; WheelObjectsNum[15] = 16; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 0; TargetVertObjectMaxAngle = 55.0f; TrackObjectNum = 18; Texture[18] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 12: WeaponLocation[0] = VECTOR3D(0.55f, 5.0f, 2.0f); Weapon[0] = new CWeapon; Weapon[0]->Create(206); Weapon[0]->NextFireTime = Weapon[0]->NextFireTime / 2.0f; WeaponLocation[1] = VECTOR3D(-0.55f, 5.0f, 2.0f); Weapon[1] = new CWeapon; Weapon[1]->Create(206); Weapon[1]->NextFireTime = Weapon[1]->NextFireTime / 2.0f; WeaponLocation[2] = VECTOR3D(1.65f, 5.0f, 2.0f); Weapon[2] = new CWeapon; Weapon[2]->Create(206); Weapon[2]->NextFireTime = Weapon[2]->NextFireTime / 2.0f; WeaponLocation[3] = VECTOR3D(-1.65f, 5.0f, 2.0f); Weapon[3] = new CWeapon; Weapon[3]->Create(206); Weapon[3]->NextFireTime = Weapon[3]->NextFireTime / 2.0f; WeaponFireType = 3; WheelQuantity = 16; WheelObjectsNum = new int[16]; WheelObjectsNum[0] = 1; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; WheelObjectsNum[8] = 9; WheelObjectsNum[9] = 10; WheelObjectsNum[10] = 11; WheelObjectsNum[11] = 12; WheelObjectsNum[12] = 13; WheelObjectsNum[13] = 14; WheelObjectsNum[14] = 15; WheelObjectsNum[15] = 16; TargetVertObjectQuantity = 2; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 18; TargetVertObject[1] = 0; TargetVertObjectMaxAngle = 40.0f; TrackObjectNum = 19; Texture[19] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 13: WeaponLocation[0] = VECTOR3D(1.4f, 5.0f, 0.4f); Weapon[0] = new CWeapon; Weapon[0]->Create(206); Weapon[0]->NextFireTime = Weapon[0]->NextFireTime / 2.0f; WeaponLocation[1] = VECTOR3D(-1.4f, 5.0f, 0.4f); Weapon[1] = new CWeapon; Weapon[1]->Create(206); Weapon[1]->NextFireTime = Weapon[1]->NextFireTime / 2.0f; WeaponFireType = 3; WheelQuantity = 14; WheelObjectsNum = new int[14]; WheelObjectsNum[0] = 2; WheelObjectsNum[1] = 3; WheelObjectsNum[2] = 4; WheelObjectsNum[3] = 5; WheelObjectsNum[4] = 6; WheelObjectsNum[5] = 7; WheelObjectsNum[6] = 8; WheelObjectsNum[7] = 9; WheelObjectsNum[8] = 10; WheelObjectsNum[9] = 11; WheelObjectsNum[10] = 12; WheelObjectsNum[11] = 13; WheelObjectsNum[12] = 14; WheelObjectsNum[13] = 15; TargetHorizObjectQuantity = 2; TargetHorizObject = new int[TargetHorizObjectQuantity]; TargetHorizObject[0] = 0; TargetHorizObject[1] = 16; TargetVertObjectQuantity = 1; TargetVertObject = new int[TargetVertObjectQuantity]; TargetVertObject[0] = 16; TargetVertObjectMaxAngle = 50.0f; TrackObjectNum = 17; Texture[17] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); break; case 14: WeaponLocation[0] = VECTOR3D(0.0f, 0.0f, 0.0f); WheelQuantity = 8; WheelObjectsNum = new int[8]; WheelObjectsNum[0] = 0; WheelObjectsNum[1] = 2; WheelObjectsNum[2] = 3; WheelObjectsNum[3] = 4; WheelObjectsNum[4] = 5; WheelObjectsNum[5] = 6; WheelObjectsNum[6] = 7; WheelObjectsNum[7] = 8; TrackObjectNum = 10; Texture[10] = vw_FindTextureByName("DATA/MODELS/track.VW2D"); TrackRotationDirection = -1; break; } // находим все данные по геометрии ::CObject3D::InitByDrawObjectList(); // установка остальных параметров девиации DeviationOn = false; DeviationObjQuantity = WheelQuantity; Deviation = new VECTOR3D[DeviationObjQuantity]; NeedDeviation = new float[DeviationObjQuantity]; CurentDeviation = new float[DeviationObjQuantity]; CurentDeviationSum = new float[DeviationObjQuantity]; DeviationObjNum = new int[DeviationObjQuantity]; for (int i=0; i<DeviationObjQuantity; i++) { Deviation[i] = VECTOR3D(0.0f, 1.0f, 0.0f); NeedDeviation[i] = vw_Randf0*0.1f; CurentDeviation[i] = CurentDeviationSum[i] = 0.0f; DeviationObjNum[i] = WheelObjectsNum[i]; } // делаем сдвиг поворота колес, чтобы смотрелось естественнее for (int i=0; i<WheelQuantity; i++) DrawObjectList[WheelObjectsNum[i]].Rotation.x = vw_fRandNum(360.0f); // вычисляем данные для нахождения точки стрельбы if (TargetHorizObject != 0) { BaseBound = DrawObjectList[TargetHorizObject[0]].Location; } if (TargetVertObject != 0) { if (TargetHorizObject != 0) { MiddleBound = DrawObjectList[TargetVertObject[0]].Location - DrawObjectList[TargetHorizObject[0]].Location; } else { MiddleBound = DrawObjectList[TargetVertObject[0]].Location; } } if (WeaponBound != 0) for (int i=0; i<WeaponQuantity; i++) { if (TargetVertObject != 0) { WeaponBound[i] = WeaponLocation[i] - DrawObjectList[TargetVertObject[0]].Location; } else if (TargetHorizObject != 0) { WeaponBound[i] = WeaponLocation[i] - DrawObjectList[TargetHorizObject[0]].Location; } else { WeaponBound[i] = WeaponLocation[i]; } } }
//----------------------------------------------------------------------------- // Создание графического эффекта //----------------------------------------------------------------------------- void SetProjectileGFX(eParticleSystem *ParticleSystem, int GFXNum) { #ifdef PANDORA ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/MENU/whitepoint.tga"); #else ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/flare1.tga"); #endif switch(GFXNum) { case 1: // Kinetic ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 0.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.15f; ParticleSystem->ParticlesPerSec = 300; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.2f); break; case 2: // Kinetic ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.30f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.15f); break; case 3: // Kinetic ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.60f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.1f); break; case 4: // Kinetic ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedVar = 0.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 300; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.17f); break; case 5: // Ion ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 60; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(2.0f,2.0f,0.5f); ParticleSystem->DeadZone = 1.5f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = 25.0f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.5f, 0.35f, 0.0f, 0.1f); break; case 6: // Ion ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.30f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 30; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -20.0f; break; case 7: // Plasma ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 6.40f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->NeedStop = true; ParticleSystem->AlphaShowHide = true; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.15f); break; case 8: // Plasma ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.80f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(1.3f,1.3f,0.2f); ParticleSystem->DeadZone = 1.2f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = 2.0f; break; case 9: // Plasma ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.80f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(1.3f,0.2f,1.3f); ParticleSystem->DeadZone = 1.2f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = 2.0f; break; case 10: // Plasma ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.80f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 4.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 30; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.10f); break; case 11: // Plasma ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.60f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 150; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.08f); break; case 12: // Ion ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.70f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 200; break; case 13: // Missile ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.35f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.40f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.1f); break; case 14: // Torpedo ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.35f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 1.0f, 0.15f, 0.0f, 0.075f); break; case 15: // Nuke ParticleSystem->ColorStart.r = 0.30f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.15f, 0.35f, 1.0f, 0.0f, 0.05f); break; case 16: // Swarm ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.25f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.30f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.2f); break; case 17: // maser ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 600; ParticleSystem->CreationType = 11; ParticleSystem->CreationSize = VECTOR3D(0.4f,0.4f,0.2f); ParticleSystem->AlphaShowHide = true; break; case 18: // maser2 ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 400; ParticleSystem->CreationType = 11; ParticleSystem->CreationSize = VECTOR3D(0.8f,0.8f,0.2f); ParticleSystem->AlphaShowHide = true; break; case 19: // Antimatter ParticleSystem->ColorStart.r = 0.50f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 0.50f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(0.8f,0.1f,0.8f); ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -20.0f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.5f, 1.0f, 0.0f, 0.0f, 0.05f); break; case 20: // Laser ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 3000; ParticleSystem->CreationType = 11; ParticleSystem->CreationSize = VECTOR3D(0.2f,0.2f,0.1f); break; case 21: // Antimatter ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 0.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.50f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 150; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(1.0f,1.0f,0.1f); ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -40.0f; break; case 22: // Оружие пришельцев 1 ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 0.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.15f; ParticleSystem->ParticlesPerSec = 300; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.85f, 1.0f, 0.0f, 0.2f); break; case 23: // Оружие пришельцев 2 ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.30f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.85f, 1.0f, 0.0f, 0.1f); break; case 24: // Оружие пришельцев 2 ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.60f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.85f, 1.0f, 0.0f, 0.1f); break; case 25: // фларес ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.50f; ParticleSystem->ColorStart.b = 0.10f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.50f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(4.0f,4.0f,4.0f); ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/flare.tga"); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.5f, 0.25f, 0.05f, 0.0f, 0.05f); break; case 26: // стрельба 1-го пирата Kinetic ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 0.00f; ParticleSystem->Theta = 0.00f; ParticleSystem->Life = 0.15f; ParticleSystem->ParticlesPerSec = 300; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.2f); break; case 27: // стрельба 2-го пирата Missile ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.35f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.40f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.1f); break; case 28: // 2-я мина ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->SpeedVar = 2.00f; ParticleSystem->Theta = 180.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->AlphaShowHide= true; ParticleSystem->Direction = VECTOR3D(0.0f, -1.0f, 0.0f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.2f); break; case 29: // 3-я мина ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->SpeedVar = 2.00f; ParticleSystem->Theta = 60.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->AlphaShowHide= true; ParticleSystem->Direction = VECTOR3D(0.0f, -1.0f, 0.0f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.15f); break; case 30: // 4-я мина ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 3.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->SpeedVar = 2.00f; ParticleSystem->Theta = 180.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 150; ParticleSystem->AlphaShowHide= true; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(1.5f,0.1f,1.5f); ParticleSystem->Direction = VECTOR3D(0.0f, -1.0f, 0.0f); ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.1f); break; case 31: // Swarm для пиратов ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.25f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.30f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.2f); break; case 32: // Torpedo пиратов ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.35f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 1.0f, 0.15f, 0.0f, 0.075f); break; case 33: // Nuke пиратов ParticleSystem->ColorStart.r = 0.30f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 1.00f; ParticleSystem->SpeedVar = 1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 250; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.15f, 0.35f, 1.0f, 0.0f, 0.05f); break; case 34: // Kinetic2 пиратов ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.50f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.00f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.30f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.15f); break; case 35: // Kinetic3 пиратов ParticleSystem->ColorStart.r = 0.60f; ParticleSystem->ColorStart.g = 0.60f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.30f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.30f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.60f; ParticleSystem->SizeVar = 0.00f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 2.00f; ParticleSystem->SpeedVar = 3.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.50f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.45f, 0.8f, 0.3f, 0.0f, 0.1f); break; case 36: // Оружие пришельцев, мина 1 тип ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.70f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.01f; ParticleSystem->SizeVar = 0.02f; ParticleSystem->SizeEnd = 0.40f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.40f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(2.0,2.0f,2.0f); ParticleSystem->DeadZone = 1.9f; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = 25.0f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 0.75f, 1.0f, 0.0f, 0.1f); break; case 37: // Оружие пришельцев, мина 2 тип ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.20f; ParticleSystem->ColorStart.b = 0.20f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.20f; ParticleSystem->ColorEnd.b = 0.20f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 1.00f; ParticleSystem->SizeStart = 0.3f; ParticleSystem->SizeVar = 0.02f; ParticleSystem->SizeEnd = 0.1f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.40f; ParticleSystem->ParticlesPerSec = 200; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(2.0,0.2f,2.0f); ParticleSystem->DeadZone = 1.9f; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = 2.0f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.2f, 0.2f, 0.0f, 0.1f); break; case 38: // Оружие пришельцев, Laser ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.30f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.40f; ParticleSystem->SizeVar = 0.05f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 0.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.20f; ParticleSystem->ParticlesPerSec = 9000; ParticleSystem->CreationType = 11; ParticleSystem->CreationSize = VECTOR3D(0.2f,0.2f,0.1f); ParticleSystem->AlphaShowHide = true; break; #ifdef PANDORA case 101: // шлейф ракеты землян и пиратов ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.06f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 2.50f; ParticleSystem->Speed = 0.20f; ParticleSystem->SpeedVar = 0.30f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.15f; ParticleSystem->ParticlesPerSec = 150; break; case 102: // шлейф ракет пришельцев ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.08f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 2.00f; ParticleSystem->Speed = 0.20f; ParticleSystem->SpeedVar = 0.30f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 0.15f; ParticleSystem->ParticlesPerSec = 100; break; #else case 101: // шлейф ракеты землян и пиратов ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/trail1.tga"); ParticleSystem->Texture[1] = vw_FindTextureByName("DATA/GFX/trail2.tga"); ParticleSystem->Texture[2] = vw_FindTextureByName("DATA/GFX/trail3.tga"); ParticleSystem->Texture[3] = vw_FindTextureByName("DATA/GFX/trail4.tga"); ParticleSystem->Texture[4] = vw_FindTextureByName("DATA/GFX/trail5.tga"); ParticleSystem->TextureQuantity = 5; ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.06f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 2.50f; ParticleSystem->Speed = 0.20f; ParticleSystem->SpeedVar = 0.30f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 5.00f; ParticleSystem->LifeVar = 5.00f; ParticleSystem->ParticlesPerSec = 150; ParticleSystem->BlendType = 1; break; case 102: // шлейф ракет пришельцев ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/trail1.tga"); ParticleSystem->Texture[1] = vw_FindTextureByName("DATA/GFX/trail2.tga"); ParticleSystem->Texture[2] = vw_FindTextureByName("DATA/GFX/trail3.tga"); ParticleSystem->Texture[3] = vw_FindTextureByName("DATA/GFX/trail4.tga"); ParticleSystem->Texture[4] = vw_FindTextureByName("DATA/GFX/trail5.tga"); ParticleSystem->TextureQuantity = 5; ParticleSystem->ColorStart.r = 0.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.70f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 0.08f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 2.00f; ParticleSystem->Speed = 0.20f; ParticleSystem->SpeedVar = 0.30f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 5.00f; ParticleSystem->LifeVar = 5.00f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->BlendType = 1; break; #endif default: fprintf(stderr, "Error in SetProjectileGFX function call, wrong GFXNum.\n"); break; } }
//------------------------------------------------------------------------------------ // покупка-апгрейд корпуса //------------------------------------------------------------------------------------ void Workshop_Shipyard() { // затемнение при выводе int SizeI; RECT SrcRect, DstRect; // затемнение SetRect(&SrcRect,0,0,256,256 ); SetRect(&DstRect,Setup.iAspectRatioWidth/2-480,100-32,Setup.iAspectRatioWidth/2-32,450+32); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/back_spot2.tga"), true, 0.45f*MenuContentTransp); SetRect(&DstRect,Setup.iAspectRatioWidth/2+32,100-32,Setup.iAspectRatioWidth/2+480,450+32); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/back_spot2.tga"), true, 0.45f*MenuContentTransp); vw_End2DMode(); WorkshopDrawShip(WorkshopFighterGame, 3); WorkshopDrawShip(WorkshopNewFighter, 2); vw_Start2DMode(-1,1); // условия, при которых корабль купить можно bool CanBuy = false; if (GetWorkshopShipFullCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame) + Setup.Profile[CurrentProfile].Money >= GetWorkshopShipCost(CurrentWorkshopNewFighter)) CanBuy = true; // на новом корабле vw_DrawFont(Setup.iAspectRatioWidth/2-445, 600, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_Ships_Stock")); // вывод названия корабля vw_DrawFont(Setup.iAspectRatioWidth/2-448, 50+6, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, vw_GetText("7_shipfullname"), vw_GetText(GetWorkshopShipName(CurrentWorkshopNewFighter)), 1); if (DrawButton128_2(Setup.iAspectRatioWidth/2-197,50, vw_GetText("1_Info"), MenuContentTransp, false)) { SetCurrentDialogBox(6); DialogSpaceShip = WorkshopNewFighter; } // находим смещение, чтобы было красиво int SmSizeI = vw_FontSize(vw_GetText("4_Armor:")); int SmSizeI2 = vw_FontSize(vw_GetText("4_Weapons")); if (SmSizeI < SmSizeI2) SmSizeI = SmSizeI2; vw_DrawFont(Setup.iAspectRatioWidth/2-78-40-SmSizeI, 110, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, vw_GetText("4_Armor:")); vw_DrawFont(Setup.iAspectRatioWidth/2-78-vw_FontSize("%i", (int)WorkshopNewFighter->StrengthStart), 110, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%i", (int)WorkshopNewFighter->StrengthStart); vw_DrawFont(Setup.iAspectRatioWidth/2-78-40-SmSizeI, 130, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%s:", vw_GetText("4_Weapons")); vw_DrawFont(Setup.iAspectRatioWidth/2-78-vw_FontSize("%i", WorkshopNewFighter->WeaponQuantity), 130, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%i", WorkshopNewFighter->WeaponQuantity); // вывод стоимости корабля if (CanBuy) vw_DrawFont(Setup.iAspectRatioWidth/2-438, 420, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "%s: %i", vw_GetText("7_Ship_Hull_Cost"), GetWorkshopShipCost(CurrentWorkshopNewFighter)); else vw_DrawFont(Setup.iAspectRatioWidth/2-438, 420, 0, 0, 1.0f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("7_Ship_Hull_Cost"), GetWorkshopShipCost(CurrentWorkshopNewFighter)); // рамки SetRect(&SrcRect,0,0,400,35 ); SetRect(&DstRect,Setup.iAspectRatioWidth/2-457,100-11,Setup.iAspectRatioWidth/2-57,100+35-11); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel4.tga"), true, MenuContentTransp); SetRect(&SrcRect,0,0,400,173 ); SetRect(&DstRect,Setup.iAspectRatioWidth/2-457,450-13,Setup.iAspectRatioWidth/2-57,450+173-13); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel1.tga"), true, MenuContentTransp); if (DrawButton128_2(Setup.iAspectRatioWidth/2-395,482, vw_GetText("1_Prev"), MenuContentTransp, false)) { CurrentWorkshopNewFighter --; if (CurrentWorkshopNewFighter < 1) CurrentWorkshopNewFighter = 22; WorkshopCreateNewShip(); } if (DrawButton128_2(Setup.iAspectRatioWidth/2-247,482, vw_GetText("1_Next"), MenuContentTransp, false)) { CurrentWorkshopNewFighter ++; if (CurrentWorkshopNewFighter > 22) CurrentWorkshopNewFighter = 1; WorkshopCreateNewShip(); } if (DrawButton200_2(Setup.iAspectRatioWidth/2-357,533, vw_GetText("1_Buy_Ship"), MenuContentTransp, !CanBuy)) { BuyShip(); } // на корабле игрока vw_DrawFont(Setup.iAspectRatioWidth/2+445-vw_FontSize(vw_GetText("7_Player_Ship"))*1.5f, 600, 0, 0, 1.5f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("7_Player_Ship")); // вывод названия корабля vw_DrawFont(Setup.iAspectRatioWidth/2+64, 56, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, vw_GetText("7_shipfullname"), vw_GetText(GetWorkshopShipName(Setup.Profile[CurrentProfile].Ship)), Setup.Profile[CurrentProfile].ShipHullUpgrade); if (DrawButton128_2(Setup.iAspectRatioWidth/2+315, 50, vw_GetText("1_Info"), MenuContentTransp, false)) { SetCurrentDialogBox(6); DialogSpaceShip = WorkshopFighterGame; } int LinePos = 420; // вывод стомости модернизации // модернизация корпуса bool CanUpgrade = false; if (Setup.Profile[CurrentProfile].ShipHullUpgrade<4) CanUpgrade = true; if (CanUpgrade) { if (Setup.Profile[CurrentProfile].Money < GetWorkshopShipCost(Setup.Profile[CurrentProfile].Ship)) CanUpgrade = false; if (CanUpgrade) vw_DrawFont(Setup.iAspectRatioWidth/2+438-vw_FontSize("%s: %i", vw_GetText("7_Upgrade_Hull_Cost"), GetWorkshopShipCost(Setup.Profile[CurrentProfile].Ship)), LinePos, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "%s: %i", vw_GetText("7_Upgrade_Hull_Cost"), GetWorkshopShipCost(Setup.Profile[CurrentProfile].Ship)); else vw_DrawFont(Setup.iAspectRatioWidth/2+438-vw_FontSize("%s: %i", vw_GetText("7_Upgrade_Hull_Cost"), GetWorkshopShipCost(Setup.Profile[CurrentProfile].Ship)), LinePos, 0, 0, 1.0f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("7_Upgrade_Hull_Cost"), GetWorkshopShipCost(Setup.Profile[CurrentProfile].Ship)); LinePos -= 20; } // вывод стомости ремонта, если нужно bool NeedRepair = false; if (GetWorkshopShipRepairCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame) > 0) { SizeI = vw_FontSize("%s: %i", vw_GetText("7_Repair_Hull_Cost"), GetWorkshopShipRepairCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame)); vw_DrawFont(Setup.iAspectRatioWidth/2+438-SizeI, LinePos, 0, 0, 1.0f, 1.0f,0.0f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("7_Repair_Hull_Cost"), GetWorkshopShipRepairCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame)); LinePos -= 20; NeedRepair = true; // надпись Armor, красная vw_DrawFont(Setup.iAspectRatioWidth/2+74, 110, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, vw_GetText("4_Armor:")); SizeI = vw_FontSize("%i/%i", (int)WorkshopFighterGame->Strength, (int)WorkshopFighterGame->StrengthStart); vw_DrawFont(Setup.iAspectRatioWidth/2+74+14+SmSizeI, 110, 0, 0, 1.0f, 1.0f,0.0f,0.0f, CurrentAlert3*MenuContentTransp, "%i/%i", (int)WorkshopFighterGame->Strength, (int)WorkshopFighterGame->StrengthStart); } else { // надпись Armor, нормальная vw_DrawFont(Setup.iAspectRatioWidth/2+74, 110, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, vw_GetText("4_Armor:")); SizeI = vw_FontSize("%i/%i", (int)WorkshopFighterGame->Strength, (int)WorkshopFighterGame->StrengthStart); vw_DrawFont(Setup.iAspectRatioWidth/2+74+14+SmSizeI, 110, 0, 0,1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%i/%i", (int)WorkshopFighterGame->Strength, (int)WorkshopFighterGame->StrengthStart); } SizeI = SizeI - vw_FontSize("%i", WorkshopFighterGame->WeaponQuantity); vw_DrawFont(Setup.iAspectRatioWidth/2+74, 130, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%s:", vw_GetText("4_Weapons")); vw_DrawFont(Setup.iAspectRatioWidth/2+74+14+SmSizeI+SizeI, 130, 0, 0, 1.0f, 1.0f,1.0f,1.0f, 0.5f*MenuContentTransp, "%i", WorkshopFighterGame->WeaponQuantity); // вывод стоимости корабля (со всеми системами) SizeI = vw_FontSize("%s: %i", vw_GetText("7_Ship_Cost"), GetWorkshopShipFullCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame)); vw_DrawFont(Setup.iAspectRatioWidth/2+438-SizeI, LinePos, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "%s: %i", vw_GetText("7_Ship_Cost"), GetWorkshopShipFullCost(Setup.Profile[CurrentProfile].Ship, WorkshopFighterGame)); // рамки SetRect(&SrcRect,0,0,400,35 ); SetRect(&DstRect,Setup.iAspectRatioWidth/2+57,100-11,Setup.iAspectRatioWidth/2+457,100+35-11); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel4.tga"), true, MenuContentTransp); SetRect(&SrcRect,0,0,400,173 ); SetRect(&DstRect,Setup.iAspectRatioWidth/2+57,450-13,Setup.iAspectRatioWidth/2+457,450+173-13); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/workshop_panel1+.tga"), true, MenuContentTransp); if (DrawButton200_2(Setup.iAspectRatioWidth/2+153, 482, vw_GetText("1_Repair_Hull"), MenuContentTransp, !NeedRepair)) { RepairShip(); } if (DrawButton200_2(Setup.iAspectRatioWidth/2+153, 533, vw_GetText("1_Upgrade_Hull"), MenuContentTransp, !CanUpgrade)) { UpgradeShip(); } // вывод информации SizeI = (Setup.iAspectRatioWidth-vw_FontSize("%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money)*1.25f)/2; if (CanBuy) vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,1.0f,0.0f, MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money); else vw_DrawFont(SizeI, 630, 0, 0, 1.25f, 1.0f,0.5f,0.0f, CurrentAlert3*MenuContentTransp, "%s: %i", vw_GetText("3_Money"), Setup.Profile[CurrentProfile].Money); }
//----------------------------------------------------------------------------- // Создание графического эффекта //----------------------------------------------------------------------------- void SetExplosionGFX(eParticleSystem *ParticleSystem, int GFXNum) { ParticleSystem->Texture[0] = vw_FindTextureByName("DATA/GFX/flare1.tga"); switch(GFXNum) { case 0: // разлет снаряда ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.20f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.05f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 1.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 10; ParticleSystem->NeedStop = true; break; case 1: // малый взрыв, астероид ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.50f; ParticleSystem->SizeEnd = 0.05f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 2.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.005f); break; case 2: // средний взрыв, пришельцы ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 0.10f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 5.0f; ParticleSystem->SpeedVar = 1.5f*vw_Randf0; ParticleSystem->Life = 3.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->NeedStop = true; break; case 3: // средний взрыв, пришельцы ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 0.10f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.80f; ParticleSystem->SizeVar = 0.40f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 5.0f; ParticleSystem->SpeedVar = 1.5f*vw_Randf0; ParticleSystem->Life = 2.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 20; ParticleSystem->CreationType = 1; ParticleSystem->CreationSize = VECTOR3D(2.8f,2.8f,2.8f); ParticleSystem->NeedStop = true; break; case 4: // средний взрыв ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 0.10f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.50f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 2.3f; ParticleSystem->LifeVar = vw_Randf0; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.05f, 0.85f, 1.0f, 0.0f, 0.002f); break; case 5: // средний взрыв, земляне ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.05f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 3.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.003f); break; case 6: // средний взрыв, земляне ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.50f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 2.3f; ParticleSystem->LifeVar = vw_Randf0; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; break; case 7: // nuke ParticleSystem->ColorStart.r = 0.30f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 3.00f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.10f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 300; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(2.0f,0.3f,2.0f); ParticleSystem->DeadZone = 1.9f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -2.5f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.15f, 0.35f, 1.0f, 0.0f, 0.0001f); break; case 8: // torpedo ParticleSystem->ColorStart.r = 0.70f; ParticleSystem->ColorStart.g = 1.00f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(3.0f,0.3f,3.0f); ParticleSystem->DeadZone = 0.9f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -2.5f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.35f, 1.0f, 0.15f, 0.0f, 0.0005f); break; case 9: // nuke ParticleSystem->ColorStart.r = 0.30f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 2.00f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 100; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(3.0f,0.3f,3.0f); ParticleSystem->DeadZone = 0.9f; ParticleSystem->AlphaShowHide = true; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -2.5f; break; case 10: // missile, swamp ParticleSystem->ColorStart.r = 1.00f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 0.30f; ParticleSystem->ColorEnd.r = 1.00f; ParticleSystem->ColorEnd.g = 0.00f; ParticleSystem->ColorEnd.b = 0.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.10f; ParticleSystem->SizeEnd = 0.30f; ParticleSystem->Speed = 0.00f; ParticleSystem->SpeedOnCreation = -1.00f; ParticleSystem->Theta = 360.00f; ParticleSystem->Life = 1.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->CreationType = 2; ParticleSystem->CreationSize = VECTOR3D(3.0f,0.3f,3.0f); ParticleSystem->DeadZone = 0.9f; ParticleSystem->AlphaShowHide = false; ParticleSystem->IsAttractive = true; ParticleSystem->AttractiveValue = -2.5f; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 1.0f, 0.35f, 0.15f, 0.0f, 0.005f); break; case 11: // взрыв осколка босса, как средний взрыв, земляне ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 0.10f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 0.30f; ParticleSystem->SizeVar = 0.20f; ParticleSystem->SizeEnd = 0.05f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 3.0f; ParticleSystem->LifeVar = vw_Randf0/10.0f; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; ParticleSystem->Light = vw_CreatPointLight(VECTOR3D(0.0f,0.0f,0.0f), 0.05f, 0.85f, 1.0f, 0.0f, 0.001f); break; case 12: // взрыв осколка босса, как средний взрыв, земляне ParticleSystem->TimeLastUpdate = 1;// чтобы сделать один проход ParticleSystem->ColorStart.r = 0.10f; ParticleSystem->ColorStart.g = 0.70f; ParticleSystem->ColorStart.b = 1.00f; ParticleSystem->ColorEnd.r = 0.00f; ParticleSystem->ColorEnd.g = 1.00f; ParticleSystem->ColorEnd.b = 1.00f; ParticleSystem->AlphaStart = 1.00f; ParticleSystem->AlphaEnd = 0.00f; ParticleSystem->SizeStart = 1.00f; ParticleSystem->SizeVar = 0.50f; ParticleSystem->SizeEnd = 0.20f; ParticleSystem->Speed = 2.0f; ParticleSystem->SpeedVar = 2.0f*vw_Randf0; ParticleSystem->Life = 2.3f; ParticleSystem->LifeVar = vw_Randf0; ParticleSystem->Theta = 360.00f; ParticleSystem->ParticlesPerSec = 50; ParticleSystem->NeedStop = true; break; default: fprintf(stderr, "Error in SetExplosionGFX function call, wrong GFXNum.\n"); break; } }
//------------------------------------------------------------------------------------ // StarSystem draw function //------------------------------------------------------------------------------------ void StarSystemDraw(int DrawType) { if (!StarSystem_InitedAll) return; // current camera location VECTOR3D CurrentCameraLocation; vw_GetCameraLocation(&CurrentCameraLocation); vw_DepthTest(false, -1); if (StarSystem_Inited) { // SkyBox vw_PushMatrix(); vw_Translate(CurrentCameraLocation); vw_Rotate(StarSystem_BaseRotation.x, 1.0f, 0.0f, 0.0f); vw_Rotate(StarSystem_BaseRotation.y, 0.0f, 1.0f, 0.0f); vw_Rotate(StarSystem_BaseRotation.z, 0.0f, 0.0f, 1.0f); SkyBoxDraw(); vw_PopMatrix(); } // static space stars if (psSpaceStatic!=0) psSpaceStatic->Draw(); vw_DepthTest(true, RI_LESSEQUAL); // космические объекты // рисуем планеты и большие астероиды _до_ тайловой анимации CSpaceObject *tmp1 = StartSpaceObject; while (tmp1!=0) { CSpaceObject *tmp2 = tmp1->Next; // если это планета на заднем фоне if (tmp1->ObjectType == 14) { if (DrawType == 2) { vw_PushMatrix(); vw_Translate(VECTOR3D(CurrentCameraLocation.x*0.90f-GameCameraGetDeviation()*4.0f, GameCameraGetDeviation()*2.0f,0.0f)); } tmp1->Draw(false); if (DrawType == 2) vw_PopMatrix(); } else // если это большой астероид летящий на заднем фоне if (tmp1->ObjectType == 15 && (tmp1->ObjectCreationType>10 && tmp1->ObjectCreationType<20)) { if (DrawType == 2) { vw_PushMatrix(); vw_Translate(VECTOR3D(CurrentCameraLocation.x*0.70f-GameCameraGetDeviation()*4.0f, GameCameraGetDeviation()*2.0f,0.0f)); } tmp1->Draw(false); if (DrawType == 2) vw_PopMatrix(); } tmp1 = tmp2; } // очищаем буфер глубины, чтобы "3д подложка" не участвовала в проверке глубины vw_Clear(RI_DEPTH_BUFFER); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Прорисовка подложки с тайловой анимацией //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ { int VFV = RI_3f_XYZ | RI_4f_COLOR | RI_1_TEX; float *buff = 0; buff = new float[4*9]; if (buff == 0) return; float width_2, heigh_2, length_2; width_2 = 0.0f; heigh_2 = 110.0f; length_2 = 110.0f; float x,y,z; x = GamePoint.x; y = GamePoint.y; z = GamePoint.z; float StartTransparentLayer1 = 0.7f; float EndTransparentLayer1 = 0.7f; if (DrawType == 2) { width_2 = length_2 = 175.0f; heigh_2 = 0.0f; // чем ниже слой, тем меньше его двигаем при перемещении камеры (при стандартном аспект рейшен) x = GamePoint.x+GameCameraGetDeviation() + CurrentCameraLocation.x*0.8f; y = GamePoint.y-GameCameraGetDeviation()*0.5f; z = GamePoint.z+25.0f; StartTransparentLayer1 = StarsTileStartTransparentLayer1; EndTransparentLayer1 = StarsTileEndTransparentLayer1; } int k=0; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer1; buff[k++] = 1.0f; buff[k++] = 0.0f+StarsTile/3.0f; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer1; buff[k++] = 1.0f; buff[k++] = 1.0f+StarsTile/3.0f; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer1; buff[k++] = 0.0f; buff[k++] = 0.0f+StarsTile/3.0f; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer1; buff[k++] = 0.0f; buff[k++] = 1.0f+StarsTile/3.0f; if (DrawType == 1) { StarsTile -= 0.015f*(vw_GetTime() - StarsTileUpdateTime); StarsTileUpdateTime = vw_GetTime(); } else { StarsTile -= 0.035f*(vw_GetTime(1) - StarsTileUpdateTime); StarsTileUpdateTime = vw_GetTime(1); } if (StarsTile < -3.0f) StarsTile += 3.0f; eTexture *TileTexture = vw_FindTextureByName("DATA/SKYBOX/tile_back.tga"); vw_SetTexture(0, TileTexture); // по умолчанию всегда трилинейная фильтрация, если надо - ставим билинейную if (Setup.TextureFilteringMode == 1) vw_SetTextureFiltering(RI_TEXTURE_BILINEAR); vw_SetTextureBlend(true, RI_BLEND_SRCALPHA, RI_BLEND_ONE); vw_DepthTest(false, -1); if (DrawType == 1) { vw_PushMatrix(); vw_Rotate(-20.0f, 0.0f, 0.0f, 1.0f); vw_Rotate(-45.0f, 0.0f, 1.0f, 0.0f); vw_Rotate(30.0f, 1.0f, 0.0f, 0.0f); } vw_SendVertices(RI_TRIANGLE_STRIP, 4, VFV, buff, 9*sizeof(float)); // звезды рисуем отдельно, четкими (со своими текстурными координатами) k=0; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer1; buff[k++] = 3.0f; buff[k++] = 0.0f+StarsTile; buff[k++] = x + width_2; buff[k++] = y + heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer1; buff[k++] = 3.0f; buff[k++] = 3.0f+StarsTile; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z + length_2+length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = StartTransparentLayer1; buff[k++] = 0.0f; buff[k++] = 0.0f+StarsTile; buff[k++] = x - width_2; buff[k++] = y - heigh_2; buff[k++] = z - length_2/2; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = EndTransparentLayer1; buff[k++] = 0.0f; buff[k++] = 3.0f+StarsTile; vw_SetTexture(0, vw_FindTextureByName("DATA/SKYBOX/tile_stars.tga")); vw_SendVertices(RI_TRIANGLE_STRIP, 4, VFV, buff, 9*sizeof(float)); if (DrawType == 1) vw_PopMatrix(); vw_DepthTest(true, RI_LESSEQUAL); vw_SetTextureBlend(false, 0, 0); vw_BindTexture(0, 0); if (buff != 0){delete [] buff; buff = 0;} } // корректируем положение частиц "космической пыли", если в игре и камера движется if (DrawType == 2) { VECTOR3D TMPpsSpace; psSpace->GetLocation(&TMPpsSpace); psSpace->SetStartLocation(TMPpsSpace); psSpace->MoveSystemLocation(VECTOR3D(0,10,250)+GamePoint); } }
//----------------------------------------------------------------------------- // Прорисовываем все объекты //----------------------------------------------------------------------------- void DrawAllObject3D(int DrawType) { // ставим всегда меньше или равно! vw_DepthTest(true, RI_LESSEQUAL); bool ShadowMap = false; if (Setup.ShadowMap > 0) { switch (DrawType) { // меню case 1: ShadowMap_StartRenderToFBO(VECTOR3D(50,-5,-120), 120.0f, 500.0f); break; // игра case 2: ShadowMap_StartRenderToFBO(VECTOR3D(0,0,160), 600.0f, 800.0f); break; } DrawAllSpaceShip(true, 0); DrawAllWeapon(true, 0); DrawAllGroundObject(true, 0); DrawAllProjectile(true, 0); DrawAllExplosion(true); DrawAllSpaceObject(true, 0); ShadowMap_EndRenderToFBO(); // работаем с 3-м стейджем текстур (первые два у нас заняты) ShadowMap = true; ShadowMap_StartFinalRender(); } // космические объекты DrawAllSpaceObject(false, ShadowMap); // корабли DrawAllSpaceShip(false, ShadowMap); // оружие DrawAllWeapon(false, ShadowMap); // наземные объекты DrawAllGroundObject(false, ShadowMap); // снаряды DrawAllProjectile(false, ShadowMap); if (Setup.ShadowMap > 0) { ShadowMap_EndFinalRender(); } // взрывы #ifndef PANDORA DrawAllExplosion(false); #endif // эффекты - самые последние в прорисовке! vw_DrawAllParticleSystems(); // второй слой тайловой анимации "пыли" StarSystemDrawSecondLayer(DrawType); // эмуляция гаммы, фактически это простой пост эффект, всегда самый последний в прорисовке if( Setup.Brightness != 5 ) { // RI_2f_XY | RI_1_TEX float buff[4*4]; int k=0; buff[k++] = 0.0f; buff[k++] = 0.0f; buff[k++] = 1.0f; buff[k++] = 0.0f; buff[k++] = 0.0f; buff[k++] = Setup.fAspectRatioHeight; buff[k++] = 1.0f; buff[k++] = 1.0f; buff[k++] = Setup.fAspectRatioWidth; buff[k++] = 0.0f; buff[k++] = 0.0f; buff[k++] = 0.0f; buff[k++] = Setup.fAspectRatioWidth; buff[k++] = Setup.fAspectRatioHeight; buff[k++] = 0.0f; buff[k++] = 1.0f; eTexture *TileTexture = vw_FindTextureByName("DATA/MENU/whitepoint.tga"); vw_SetTexture(0, TileTexture); float BrightnessF = 1.0f + (Setup.Brightness - 5)/5.0f; if( BrightnessF > 1.0f ) { vw_SetTextureBlend(true, RI_BLEND_DESTCOLOR, RI_BLEND_ONE); vw_SetColor(BrightnessF-1.0f, BrightnessF-1.0f, BrightnessF-1.0f, 1.0f); } else { vw_SetTextureBlend(true, RI_BLEND_ZERO, RI_BLEND_SRCCOLOR); vw_SetColor(BrightnessF, BrightnessF, BrightnessF, 1.0f); } vw_Start2DMode(-1,1); vw_SendVertices(RI_TRIANGLE_STRIP, 4, RI_2f_XY | RI_1_TEX, buff, 4*sizeof(float)); vw_End2DMode(); vw_SetTextureBlend(false, 0, 0); vw_BindTexture(0, 0); } }
//------------------------------------------------------------------------------------ // StarSystem initialiation //------------------------------------------------------------------------------------ void StarSystemInit(int Num, VECTOR3D SetBaseRotation) { // SkyBox setup switch (Num) { case 1: SkyBoxCreate(0.0f, 0.0f, 0.0f, 100.0f, 100.0f, 100.0f); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_back6.tga"), 4); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_bottom4.tga"), 2); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_front5.tga"), 5); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_left2.tga"), 1); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_right1.tga"), 0); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/1/skybox_top3.tga"), 3); StarSystem_Inited = true; break; case 2: SkyBoxCreate(0.0f, 0.0f, 0.0f, 100.0f, 100.0f, 100.0f); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_back6.tga"), 4); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_bottom4.tga"), 2); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_front5.tga"), 5); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_left2.tga"), 1); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_right1.tga"), 0); SkyBoxSetTexture(vw_FindTextureByName("DATA/SKYBOX/2/skybox_top3.tga"), 3); StarSystem_Inited = true; break; default: fprintf(stderr, "Error in StarSystemInit function call, wrong Num.\n"); break; } // StarSystem setup StarSystem_InitedAll = true; StarSystem_BaseRotation = SetBaseRotation; // static space stars initialization if (psSpaceStatic != 0){delete psSpaceStatic; psSpaceStatic = 0;} psSpaceStatic = new CSpaceStars; if (psSpaceStatic == 0) return; }
void DifficultyMenu() { RECT SrcRect, DstRect; SetRect(&SrcRect,2,2,863-2,484-2); SetRect(&DstRect,Setup.iAspectRatioWidth/2-427,175-15,Setup.iAspectRatioWidth/2-427+863-4,175-15+484-4); vw_DrawTransparent(&DstRect, &SrcRect, vw_FindTextureByName("DATA/MENU/panel800_444_back.tga"), true, 0.9f*MenuContentTransp); int X1 = Setup.iAspectRatioWidth/2 - 372; int Y1 = 217; int Prir1 = 50; int Size; int SizeI; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Enemy_Weapon_Penalty")); bool ButOff = false; if (Setup.Profile[CurrentProfile].NPCWeaponPenalty == 1) ButOff = true; if (DrawButton128_2(X1+360, Y1-6, vw_GetText("1_Decrease"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCWeaponPenalty--; if (Setup.Profile[CurrentProfile].NPCWeaponPenalty < 1) Setup.Profile[CurrentProfile].NPCWeaponPenalty = 1; } ButOff = false; if (Setup.Profile[CurrentProfile].NPCWeaponPenalty == 3) ButOff = true; if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCWeaponPenalty++; if (Setup.Profile[CurrentProfile].NPCWeaponPenalty > 3) Setup.Profile[CurrentProfile].NPCWeaponPenalty = 3; } if (Setup.Profile[CurrentProfile].NPCWeaponPenalty == 1) { Size = vw_FontSize(vw_GetText("3_None")); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_None")); } else { Size = vw_FontSize("x%i", Setup.Profile[CurrentProfile].NPCWeaponPenalty); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "x%i", Setup.Profile[CurrentProfile].NPCWeaponPenalty); } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Enemy_Armor_Penalty")); ButOff = false; if (Setup.Profile[CurrentProfile].NPCArmorPenalty == 1) ButOff = true; if (DrawButton128_2(X1+360, Y1-6, vw_GetText("1_Decrease"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCArmorPenalty--; if (Setup.Profile[CurrentProfile].NPCArmorPenalty < 1) Setup.Profile[CurrentProfile].NPCArmorPenalty = 1; } ButOff = false; if (Setup.Profile[CurrentProfile].NPCArmorPenalty == 4) ButOff = true; if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCArmorPenalty++; if (Setup.Profile[CurrentProfile].NPCArmorPenalty > 4) Setup.Profile[CurrentProfile].NPCArmorPenalty = 4; } if (Setup.Profile[CurrentProfile].NPCArmorPenalty == 1) { Size = vw_FontSize(vw_GetText("3_None")); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_None")); } else { Size = vw_FontSize("x%i", Setup.Profile[CurrentProfile].NPCArmorPenalty); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "x%i", Setup.Profile[CurrentProfile].NPCArmorPenalty); } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Enemy_Targeting_Penalty")); ButOff = false; if (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty == 1) ButOff = true; if (DrawButton128_2(X1+360, Y1-6, vw_GetText("1_Decrease"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty--; if (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty < 1) Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty = 1; } ButOff = false; if (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty == 4) ButOff = true; if (DrawButton128_2(X1+616, Y1-6, vw_GetText("1_Increase"), MenuContentTransp, ButOff)) { Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty++; if (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty > 4) Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty = 4; } if (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty == 1) { Size = vw_FontSize(vw_GetText("3_None")); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_None")); } else { Size = vw_FontSize("x%i", Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty); SizeI = (110-Size)/2; vw_DrawFont(X1+498+SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, "x%i", Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty); } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Limited_Ammo")); if (DrawButton128_2(X1+360+128, Y1-6, vw_GetText(OnOff[Setup.Profile[CurrentProfile].LimitedAmmo]), MenuContentTransp, false)) { Setup.Profile[CurrentProfile].LimitedAmmo++; if (Setup.Profile[CurrentProfile].LimitedAmmo > 1) Setup.Profile[CurrentProfile].LimitedAmmo = 0; } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Destroyable_Weapon")); if (DrawButton128_2(X1+360+128, Y1-6, vw_GetText(OnOff[Setup.Profile[CurrentProfile].DestroyableWeapon]), MenuContentTransp, false)) { Setup.Profile[CurrentProfile].DestroyableWeapon++; if (Setup.Profile[CurrentProfile].DestroyableWeapon > 1) Setup.Profile[CurrentProfile].DestroyableWeapon = 0; } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_Weapon_Targeting_Mode")); if (DrawButton128_2(X1+360+128, Y1-6, vw_GetText(ArcadeSim[Setup.Profile[CurrentProfile].WeaponTargetingMode]), MenuContentTransp, false)) { Setup.Profile[CurrentProfile].WeaponTargetingMode++; if (Setup.Profile[CurrentProfile].WeaponTargetingMode > 1) Setup.Profile[CurrentProfile].WeaponTargetingMode = 0; } Y1 += Prir1; vw_DrawFont(X1, Y1, -340, 0, 1.0f, 1.0f,1.0f,1.0f, MenuContentTransp, vw_GetText("3_SpaceShip_Control_Mode")); if (DrawButton128_2(X1+360+128, Y1-6, vw_GetText(ArcadeSim[Setup.Profile[CurrentProfile].SpaceShipControlMode]), MenuContentTransp, false)) { Setup.Profile[CurrentProfile].SpaceShipControlMode++; if (Setup.Profile[CurrentProfile].SpaceShipControlMode > 1) Setup.Profile[CurrentProfile].SpaceShipControlMode = 0; } // считаем общую сложность Setup.Profile[CurrentProfile].Difficulty = 100-( (Setup.Profile[CurrentProfile].NPCWeaponPenalty-1)*6+ (Setup.Profile[CurrentProfile].NPCArmorPenalty-1)*6+ (Setup.Profile[CurrentProfile].NPCTargetingSpeedPenalty-1)*6+ Setup.Profile[CurrentProfile].LimitedAmmo*14+ Setup.Profile[CurrentProfile].DestroyableWeapon*11+ Setup.Profile[CurrentProfile].WeaponTargetingMode*12+ Setup.Profile[CurrentProfile].SpaceShipControlMode*15); Y1 += Prir1; Size = vw_FontSize("%s: %i%%", vw_GetText("3_Current_Profile_Difficulty"), Setup.Profile[CurrentProfile].Difficulty); SizeI = (Setup.iAspectRatioWidth-Size)/2; vw_DrawFont(SizeI, Y1, 0, 0, 1.0f, 1.0f,1.0f,0.0f, MenuContentTransp, "%s: %i%%", vw_GetText("3_Current_Profile_Difficulty"), Setup.Profile[CurrentProfile].Difficulty); int X = Setup.iAspectRatioWidth/2 - 192; int Y = 175+95*5; if (DrawButton384(X,Y, vw_GetText("1_BACK"), MenuContentTransp, &Button1Transp, &LastButton1UpdateTime)) { ComBuffer = PROFILE; } }