Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "background.h" //included for Background Functions
- #include "SDL_Plotter.h"
- #include <fstream>
- #include <vector>
- /*void displayBackground(string fileName)
- {
- ifstream in;
- int colBound, rowBound;
- int R = 120; //red pigment
- int G = 120; //green pigment
- int B = 120; //blue pigment
- in.open (fileName.c_str());
- if (in.is_open())
- {
- in >> colBound >> rowBound;
- SDL_Plotter g(colBound, rowBound);
- vector< vector<colBound> > vec(colbound, vector<int>(colBound * 3));
- //Display Map to Monitor
- for(int col = 0; col < colBound; col++)
- {
- for(int row = 0; row < rowBound; row++)
- {
- //Read in Red, Green, and Blue values from text file
- in >> R >> G >> B;
- g.plotPixel( row , col , R , G , B);
- if( row < rowBound )
- {
- //Multiplying Column by Three
- col *= 3;
- vec[row][col] = R;
- vec[row][col + 1] = G;
- vec[row][col + 2] = B;
- //Undo the Multiplying Column by Three
- col /= 3;
- }
- }
- }
- }
- //Close Input File (MAP)
- in.close();
- }*/
- bool isBoundary(int r, int g, int b)
- {
- bool isBoundary = false;
- //Roof House
- if (r < 211 && r > 120 && g < 152 && g > 59 && b < 184 && b > 46)
- isBoundary = true;
- //Trees
- else if (r < 136 && r > 56 && g < 218 && g > 101 && b < 227 && b > 19)
- isBoundary = true;
- return isBoundary;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement