Mercurial > fife-parpg
comparison engine/core/controller/enginesettings.cpp @ 650:51bbda7676f0
* Fixed some more integer definitions
* All vars containing bits per pixel should now be uint16_t
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 14 Oct 2010 15:32:09 +0000 |
parents | 855ad500f991 |
children | e3140f01749d |
comparison
equal
deleted
inserted
replaced
649:b9c132cb6ea4 | 650:51bbda7676f0 |
---|---|
90 for(unsigned int i = 0; modes[i]; ++i) | 90 for(unsigned int i = 0; modes[i]; ++i) |
91 result.push_back(std::pair<uint16_t, uint16_t>(modes[i]->w, modes[i]->h)); | 91 result.push_back(std::pair<uint16_t, uint16_t>(modes[i]->w, modes[i]->h)); |
92 return result; | 92 return result; |
93 } | 93 } |
94 | 94 |
95 void EngineSettings::setBitsPerPixel(uint8_t bitsperpixel) { | 95 void EngineSettings::setBitsPerPixel(uint16_t bitsperpixel) { |
96 std::vector<uint8_t> pv = getPossibleBitsPerPixel(); | 96 std::vector<uint16_t> pv = getPossibleBitsPerPixel(); |
97 std::vector<uint8_t>::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); | 97 std::vector<uint16_t>::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); |
98 if (i != pv.end()) { | 98 if (i != pv.end()) { |
99 m_bitsperpixel = bitsperpixel; | 99 m_bitsperpixel = bitsperpixel; |
100 return; | 100 return; |
101 } | 101 } |
102 throw NotSupported("Given bits per pixel value is not supported"); | 102 throw NotSupported("Given bits per pixel value is not supported"); |
103 } | 103 } |
104 | 104 |
105 std::vector<uint8_t> EngineSettings::getPossibleBitsPerPixel() const { | 105 std::vector<uint16_t> EngineSettings::getPossibleBitsPerPixel() const { |
106 std::vector<uint8_t> tmp; | 106 std::vector<uint16_t> tmp; |
107 tmp.push_back(0); | 107 tmp.push_back(0); |
108 tmp.push_back(16); | 108 tmp.push_back(16); |
109 tmp.push_back(24); | 109 tmp.push_back(24); |
110 tmp.push_back(32); | 110 tmp.push_back(32); |
111 return tmp; | 111 return tmp; |