MCPcopy Create free account
hub / github.com/Farama-Foundation/ViZDoom / updateBuffersShapes

Method updateBuffersShapes

src/lib_python/ViZDoomGamePython.cpp:272–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270 }
271
272 void DoomGamePython::updateBuffersShapes(){
273 int channels = this->getScreenChannels();
274 int width = this->getScreenWidth();
275 int height = this->getScreenHeight();
276
277 switch(this->getScreenFormat()){
278 case CRCGCB:
279 case CBCGCR:
280 this->colorShape.resize(3);
281 this->colorShape[0] = channels;
282 this->colorShape[1] = height;
283 this->colorShape[2] = width;
284 break;
285
286 case GRAY8:
287 case DOOM_256_COLORS8:
288 this->colorShape.resize(2);
289 this->colorShape[0] = height;
290 this->colorShape[1] = width;
291 break;
292
293 default:
294 this->colorShape.resize(3);
295 this->colorShape[0] = height;
296 this->colorShape[1] = width;
297 this->colorShape[2] = channels;
298 }
299
300 this->grayShape[0] = height;
301 this->grayShape[1] = width;
302
303 this->audioShape[0] = this->getAudioSamplesPerTic() * this->getAudioBufferSize();
304 this->audioShape[1] = 2;
305 }
306
307
308 template<class T> pyb::list DoomGamePython::vectorToPyList(const std::vector<T>& vector){

Callers 1

getStateMethod · 0.95

Calls 7

getScreenChannelsMethod · 0.45
getScreenWidthMethod · 0.45
getScreenHeightMethod · 0.45
getScreenFormatMethod · 0.45
resizeMethod · 0.45
getAudioSamplesPerTicMethod · 0.45
getAudioBufferSizeMethod · 0.45

Tested by

no test coverage detected