MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / RemapNFS2CarColours

Function RemapNFS2CarColours

src/Loaders/track_utils.cpp:462–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460 }
461
462 bmpread_t RemapNFS2CarColours(bmpread_t bmpAttr){
463 glm::vec3 carColour(29, 47, 82);
464 glm::vec3 deltaColour(255/carColour.x, 255/carColour.y, 255/carColour.z);
465
466 bmpread_t remapped = bmpAttr;
467 for (uint16_t y = 0; y < bmpAttr.height; y++) {
468 for (uint16_t x = 0; x < bmpAttr.width; x++) {
469 uint8_t r = bmpAttr.data[x+y*bmpAttr.width];
470 uint8_t g = bmpAttr.data[x+y*bmpAttr.width+1];
471 uint8_t b = bmpAttr.data[x+y*bmpAttr.width+2];
472
473 if(r == g){
474 if(g == b){
475 remapped.data[x+y*bmpAttr.width] *= deltaColour.x;
476 remapped.data[x+y*bmpAttr.width+1] *= deltaColour.y;
477 remapped.data[x+y*bmpAttr.width+2] *= deltaColour.z;
478 }
479 }
480 }
481 }
482
483 return remapped;
484 }
485
486 bool LoadCAN(std::string can_path, std::vector<SHARED::CANPT> &cameraAnimations) {
487 ifstream can(can_path, ios::in | ios::binary);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected