Changeset View
Changeset View
Standalone View
Standalone View
kstars/skycomponents/deepstarcomponent.cpp
Context not available. | |||||
15 | * * | 15 | * * | ||
---|---|---|---|---|---|
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #ifdef _WIN32 | | |||
19 | #include <windows.h> | | |||
20 | #endif | | |||
21 | #include "deepstarcomponent.h" | 18 | #include "deepstarcomponent.h" | ||
22 | 19 | | |||
23 | #include <QPixmap> | 20 | #include "binfilehelper.h" | ||
24 | #include <QRectF> | 21 | #include "byteorder.h" | ||
25 | #include <QFontMetricsF> | | |||
26 | #include <QtConcurrent> | | |||
27 | | ||||
28 | //NOTE Added this for QT_FSEEK, should we be including another file? | | |||
29 | #include <qplatformdefs.h> | | |||
30 | | ||||
31 | #include "Options.h" | | |||
32 | #include "kstarsdata.h" | 22 | #include "kstarsdata.h" | ||
23 | #include "Options.h" | ||||
33 | #ifndef KSTARS_LITE | 24 | #ifndef KSTARS_LITE | ||
34 | #include "skymap.h" | 25 | #include "skymap.h" | ||
35 | #endif | 26 | #endif | ||
36 | #include "skyobjects/starobject.h" | | |||
37 | #include "skymesh.h" | 27 | #include "skymesh.h" | ||
38 | #include "binfilehelper.h" | 28 | #include "skyobjects/starobject.h" | ||
29 | #include "skypainter.h" | ||||
39 | #include "starblockfactory.h" | 30 | #include "starblockfactory.h" | ||
40 | #include "starcomponent.h" | 31 | #include "starcomponent.h" | ||
41 | #include "projections/projector.h" | 32 | #include "projections/projector.h" | ||
42 | 33 | | |||
43 | #include "skypainter.h" | 34 | #include <QPixmap> | ||
35 | #include <QRectF> | ||||
36 | #include <QFontMetricsF> | ||||
37 | #include <QtConcurrent> | ||||
44 | 38 | | |||
45 | #include "byteorder.h" | 39 | //NOTE Added this for QT_FSEEK, should we be including another file? | ||
40 | #include <qplatformdefs.h> | ||||
41 | | ||||
42 | #ifdef _WIN32 | ||||
43 | #include <windows.h> | ||||
44 | #endif | ||||
46 | 45 | | |||
47 | DeepStarComponent::DeepStarComponent(SkyComposite *parent, QString fileName, float trigMag, bool staticstars) | 46 | DeepStarComponent::DeepStarComponent(SkyComposite *parent, QString fileName, float trigMag, bool staticstars) | ||
48 | : ListComponent(parent), m_reindexNum(J2000), triggerMag(trigMag), m_FaintMagnitude(-5.0), staticStars(staticstars), | 47 | : ListComponent(parent), m_reindexNum(J2000), triggerMag(trigMag), m_FaintMagnitude(-5.0), staticStars(staticstars), | ||
Context not available. | |||||
87 | qint16 faintmag; | 86 | qint16 faintmag; | ||
88 | quint8 htm_level; | 87 | quint8 htm_level; | ||
89 | quint16 t_MSpT; | 88 | quint16 t_MSpT; | ||
89 | int ret = 0; | ||||
90 | 90 | | |||
91 | fread(&faintmag, 2, 1, dataFile); | 91 | ret = fread(&faintmag, 2, 1, dataFile); | ||
92 | if (starReader.getByteSwap()) | 92 | if (starReader.getByteSwap()) | ||
93 | faintmag = bswap_16(faintmag); | 93 | faintmag = bswap_16(faintmag); | ||
94 | fread(&htm_level, 1, 1, dataFile); | 94 | ret = fread(&htm_level, 1, 1, dataFile); | ||
95 | fread(&t_MSpT, 2, 1, dataFile); // Unused | 95 | ret = fread(&t_MSpT, 2, 1, dataFile); // Unused | ||
96 | if (starReader.getByteSwap()) | 96 | if (starReader.getByteSwap()) | ||
97 | faintmag = bswap_16(faintmag); | 97 | faintmag = bswap_16(faintmag); | ||
98 | 98 | | |||
Context not available. | |||||
444 | { | 444 | { | ||
445 | qint16 faintmag; | 445 | qint16 faintmag; | ||
446 | quint8 htm_level; | 446 | quint8 htm_level; | ||
447 | fread(&faintmag, 2, 1, starReader.getFileHandle()); | 447 | int ret = 0; | ||
448 | | ||||
449 | ret = fread(&faintmag, 2, 1, starReader.getFileHandle()); | ||||
448 | if (starReader.getByteSwap()) | 450 | if (starReader.getByteSwap()) | ||
449 | faintmag = bswap_16(faintmag); | 451 | faintmag = bswap_16(faintmag); | ||
450 | if (starReader.guessRecordSize() == 16) | 452 | if (starReader.guessRecordSize() == 16) | ||
451 | m_FaintMagnitude = faintmag / 1000.0; | 453 | m_FaintMagnitude = faintmag / 1000.0; | ||
452 | else | 454 | else | ||
453 | m_FaintMagnitude = faintmag / 100.0; | 455 | m_FaintMagnitude = faintmag / 100.0; | ||
454 | fread(&htm_level, 1, 1, starReader.getFileHandle()); | 456 | ret = fread(&htm_level, 1, 1, starReader.getFileHandle()); | ||
455 | qDebug() << "Processing " << dataFileName << ", HTMesh Level" << htm_level; | 457 | qDebug() << "Processing " << dataFileName << ", HTMesh Level" << htm_level; | ||
456 | m_skyMesh = SkyMesh::Instance(htm_level); | 458 | m_skyMesh = SkyMesh::Instance(htm_level); | ||
457 | if (!m_skyMesh) | 459 | if (!m_skyMesh) | ||
Context not available. | |||||
464 | } | 466 | } | ||
465 | } | 467 | } | ||
466 | meshLevel = htm_level; | 468 | meshLevel = htm_level; | ||
467 | fread(&MSpT, 2, 1, starReader.getFileHandle()); | 469 | ret = fread(&MSpT, 2, 1, starReader.getFileHandle()); | ||
468 | if (starReader.getByteSwap()) | 470 | if (starReader.getByteSwap()) | ||
469 | MSpT = bswap_16(MSpT); | 471 | MSpT = bswap_16(MSpT); | ||
470 | fileOpened = true; | 472 | fileOpened = true; | ||
Context not available. |