~ubuntu-branches/debian/sid/astromenace/sid

« back to all changes in this revision

Viewing changes to AstroMenaceSource/Object3D/GroundObject/GroundObject.cpp

  • Committer: Package Import Robot
  • Author(s): Boris Pek, 1
  • Date: 2013-12-19 15:37:09 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131219153709-vs62lyk7ts7o3rf5
Tags: 1.3.2+repack-2
Add patch debian/patches/fix_work_on_intel_videocards.patch:
Mesa developers have enabled GL_ARB_texture_storage for all drivers [1], so
i915 and i965 drivers now claim the support of this OpenGL extension, but
texture storage feature does not actually work there.
.
[1] http://lists.freedesktop.org/archives/mesa-dev/2013-June/041188.html
.
This patch is just workaround to make the game work on intel videocards with
new Mesa. But real problem should be fixed in Mesa.
(Closes: #718680)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/************************************************************************************
2
2
 
3
3
        AstroMenace (Hardcore 3D space shooter with spaceship upgrade possibilities)
4
 
        Copyright © 2006-2012 Michael Kurinnoy, Viewizard
 
4
        Copyright © 2006-2013 Michael Kurinnoy, Viewizard
5
5
 
6
6
 
7
7
        AstroMenace is free software: you can redistribute it and/or modify
324
324
                        }
325
325
 
326
326
                        // находим угол, на который нужно повернуть
327
 
                        float NeedRotate = TargetHorizObjectCurrentAngle;
 
327
                        float NeedRotateCalculation = TargetHorizObjectCurrentAngle;
328
328
 
329
329
                        if (TargetHorizObjectNeedAngle>TargetHorizObjectCurrentAngle)
330
330
                        {
331
 
                                NeedRotate += 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
332
 
                                if (NeedRotate > TargetHorizObjectNeedAngle) NeedRotate = TargetHorizObjectNeedAngle;
 
331
                                NeedRotateCalculation += 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
 
332
                                if (NeedRotateCalculation > TargetHorizObjectNeedAngle) NeedRotateCalculation = TargetHorizObjectNeedAngle;
333
333
                        }
334
334
                        else
335
335
                        {
336
 
                                NeedRotate -= 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
337
 
                                if (NeedRotate < TargetHorizObjectNeedAngle) NeedRotate = TargetHorizObjectNeedAngle;
 
336
                                NeedRotateCalculation -= 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
 
337
                                if (NeedRotateCalculation < TargetHorizObjectNeedAngle) NeedRotateCalculation = TargetHorizObjectNeedAngle;
338
338
                        }
339
339
 
340
340
                        // устанавливаем текущий поворот
341
 
                        TargetHorizObjectCurrentAngle = NeedRotate;
 
341
                        TargetHorizObjectCurrentAngle = NeedRotateCalculation;
342
342
 
343
343
                        // поворачиваем все объекты
344
344
                        for (int i=0; i<TargetHorizObjectQuantity; i++)
349
349
                                RotatePointInv(&tmp, DrawObjectList[TargetHorizObject[i]].Rotation^(-1.0f));
350
350
 
351
351
                                SetObjectRotation(VECTOR3D(DrawObjectList[TargetHorizObject[i]].Rotation.x,
352
 
                                        -NeedRotate,
 
352
                                        -NeedRotateCalculation,
353
353
                                        DrawObjectList[TargetHorizObject[i]].Rotation.z), TargetHorizObject[i]);
354
354
 
355
355
                                RotatePoint(&tmp, DrawObjectList[TargetHorizObject[i]].Rotation);
370
370
                {
371
371
 
372
372
                        // находим угол, на который нужно повернуть
373
 
                        float NeedRotate = TargetVertObjectCurrentAngle;
 
373
                        float NeedRotateCalculation = TargetVertObjectCurrentAngle;
374
374
                        if (TargetVertObjectNeedAngle>TargetVertObjectCurrentAngle)
375
375
                        {
376
 
                                NeedRotate += 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
377
 
                                if (NeedRotate > TargetVertObjectNeedAngle) NeedRotate = TargetVertObjectNeedAngle;
378
 
                                if (NeedRotate > TargetVertObjectMaxAngle) NeedRotate = TargetVertObjectMaxAngle;
 
376
                                NeedRotateCalculation += 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
 
377
                                if (NeedRotateCalculation > TargetVertObjectNeedAngle) NeedRotateCalculation = TargetVertObjectNeedAngle;
 
378
                                if (NeedRotateCalculation > TargetVertObjectMaxAngle) NeedRotateCalculation = TargetVertObjectMaxAngle;
379
379
                        }
380
380
                        else
381
381
                        {
382
 
                                NeedRotate -= 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
383
 
                                if (NeedRotate < TargetVertObjectNeedAngle) NeedRotate = TargetVertObjectNeedAngle;
384
 
                                if (NeedRotate < TargetVertObjectMinAngle) NeedRotate = TargetVertObjectMinAngle;
 
382
                                NeedRotateCalculation -= 80.0f*TimeDelta/GameNPCTargetingSpeedPenalty;
 
383
                                if (NeedRotateCalculation < TargetVertObjectNeedAngle) NeedRotateCalculation = TargetVertObjectNeedAngle;
 
384
                                if (NeedRotateCalculation < TargetVertObjectMinAngle) NeedRotateCalculation = TargetVertObjectMinAngle;
385
385
                        }
386
386
 
387
387
                        // устанавливаем текущий поворот
388
 
                        TargetVertObjectCurrentAngle = NeedRotate;
 
388
                        TargetVertObjectCurrentAngle = NeedRotateCalculation;
389
389
 
390
390
                        // поворачиваем все объекты
391
391
                        for (int i=0; i<TargetVertObjectQuantity; i++)
395
395
 
396
396
                                RotatePointInv(&tmp, DrawObjectList[TargetVertObject[i]].Rotation^(-1.0f));
397
397
 
398
 
                                SetObjectRotation(VECTOR3D(-NeedRotate,
 
398
                                SetObjectRotation(VECTOR3D(-NeedRotateCalculation,
399
399
                                        DrawObjectList[TargetVertObject[i]].Rotation.y,
400
400
                                        DrawObjectList[TargetVertObject[i]].Rotation.z), TargetVertObject[i]);
401
401