From 0e50f3c18c68e4c42546a52147e10cac1202b96f Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 29 Oct 2015 09:17:43 -0400 Subject: [PATCH] Made background painting dynamic, and made new tree backdrops --- assets/antree.png | Bin 26111 -> 0 bytes include/ui.h | 1 + include/world.h | 2 +- main.cpp | 107 +++++++++++++++++++++++----------------------- src/gameplay.cpp | 7 +-- src/ui.cpp | 2 + src/world.cpp | 4 +- 7 files changed, 60 insertions(+), 63 deletions(-) delete mode 100644 assets/antree.png diff --git a/assets/antree.png b/assets/antree.png deleted file mode 100644 index 2cb54adb19279b69cf585f88b4e211a38ded28b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26111 zcmeFXhgVa3*EJeIL~bV89P(tArlR5}P8q&G#1^xg?buR#z( zM+qT7fJi5VBsX}@d7k%s$G!It_=Xw7fo90gZ_hQ?TyxExsHZyWSFhZ<0ssK6YCL|V z4**bv0st4JE?p$Pvp(6SLi};jMpOL}@uwvKkZax4OZ?kq_s1q)001T3`5zKMMiwLS zO$u)fZB>fpD=bu$w`U*q@Dtx+buu*eR&jH2v2*n%{u2OD@wBt{wtKIwaZtf2Pe-QYCz#jzuAn*r)KM4Fm z;Qt>1PqmCtE-oazR~Sqt$3I>qb_!|!${T7=2A z!2W023@sxIxj~Dg8i)IB!e#{N7o=TdeTN-aecE37b)Hhvf_vDNg6Wn49{O2tY@d=) z{e78nx*G0_Up(GHKe_k&bW4ue9lS~>@%9Zex}mDKFs3^U#Tle4{rcfyA&F;`a!t*3 z;7AXeW39rI_OS0#&@T5#DrMc^&et{s{NrK|-n@zm(+~v}g2mmAzNTU5M8ojFb(w_j zc^9*9H$PYE^32&>eEQe$g(Q+5+J28GYdOAXgVylF)I$aie57LN$wdyG=;SIU`p$oD zQ~tK*N92T7Zhw(oA+#1U()Q!dS=*}<%84tDX@|5hQP6Xq>51r?n0Ib7b$7O9yubpV zkTq)o=}#J(itNg)%$C?iLT%P`?~+9dB*5(y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-IryqifTxcWItTs*aqd5#9?fYX9l&; z{bK2mj;A}HmD+f_4u5WjyU#NAnWozYGhy<5p>zB&lS_AE7IS4c} zR~HPE(C`~-Ytb-4wNNRfpDrFpX7=FTfvKqnH*qk}01*%EVmw=Ma zJAz7!b7pkdO^-1UbfcC1W%Zp`dY!j3RZ7{u1>U@(p{~}ys^Y|berTC%#1}O4eEw7C zGr@d?20!Hl_U*)$}cQ zMK&7pDhYNK(TsvLzbwm7_wG)&Qm#MrL9&l>;K6BI_@)sfN;o#XQyTF#jw=65I2Ng# zGUjjlAy((;$XGDZn4wWR0(53l%q%^!ua{{3aB==?Jn7-oEqsrR>AivL*fMvYMI(z~ z?C9Pwk-Dw1mM^c+g;*7YGc;L)`lMfizJ}l2UVnC~2?eTHgwmjK2MwRK!zffnRN4N( RE!&VAe#n#HQH4L6_75U3O8)== diff --git a/include/ui.h b/include/ui.h index 739aba0..79ca9a7 100644 --- a/include/ui.h +++ b/include/ui.h @@ -16,6 +16,7 @@ namespace ui { // Functions are kept in a namespace simply extern vec2 mouse; extern bool debug; + extern bool posFlag; extern bool dialogBoxExists; extern unsigned int fontSize; diff --git a/include/world.h b/include/world.h index ab161c0..30df9cc 100644 --- a/include/world.h +++ b/include/world.h @@ -71,7 +71,7 @@ public: // drawn and handled by the world. void addHole(unsigned int start,unsigned int end); // Create a hole in the world - int getStart(void); + int getTheWidth(void); }; float worldGetYBase(World *w); diff --git a/main.cpp b/main.cpp index faa2be4..c52528a 100644 --- a/main.cpp +++ b/main.cpp @@ -49,7 +49,7 @@ SDL_GLContext mainGLContext = NULL; * */ -static GLuint bgImage, bgMtn, bgTreesFirst; +static GLuint bgImage, bgMtn, bgTreesFront, bgTreesMid, bgTreesFar; /* * gameRunning @@ -336,7 +336,7 @@ int main(int argc, char *argv[]){ glGetShaderiv(fragShader, GL_COMPILE_STATUS, &bufferln); - if(bufferln == GL_TRUE){ + if(bufferln == GL_FALSE){ std::cout << "Error compiling shader" << std::endl; } @@ -382,7 +382,9 @@ int main(int argc, char *argv[]){ bgImage= Texture::loadTexture("assets/bg.png"); bgMtn= Texture::loadTexture("assets/bgFarMountain.png"); - bgTreesFirst = Texture::loadTexture("assets/antree.png"); + bgTreesFront = Texture::loadTexture("assets/bgFrontTree.png"); + bgTreesMid = Texture::loadTexture("assets/bgMidTree.png"); + bgTreesFar = Texture::loadTexture("assets/bgFarTree.png"); /* * Load sprites used in the inventory menu. See src/inventory.cpp @@ -541,8 +543,8 @@ void render(){ * If the camera will go off of the left or right of the screen we want to lock it so we can't * see past the world render */ - if(player->loc.x - SCREEN_WIDTH/2 < SCREEN_WIDTH*-1.5)offset.x = ((SCREEN_WIDTH*-1.5) + SCREEN_WIDTH/2) + player->width/2; - if(player->loc.x + SCREEN_WIDTH/2 > SCREEN_WIDTH*1.5)offset.x = ((SCREEN_WIDTH*1.5) - SCREEN_WIDTH/2) + player->width/2; + if(player->loc.x - SCREEN_WIDTH/2 < currentWorld->getTheWidth()*-0.5f)offset.x = ((currentWorld->getTheWidth()*-0.5f) + SCREEN_WIDTH/2) + player->width/2; + if(player->loc.x + SCREEN_WIDTH/2 > currentWorld->getTheWidth()*0.5f)offset.x = ((currentWorld->getTheWidth()*0.5f) - SCREEN_WIDTH/2) + player->width/2; glMatrixMode(GL_PROJECTION); //set the matrix mode as projection so we can set the ortho size and the camera settings later on glPushMatrix(); //push the matrix to the top of the matrix stack glLoadIdentity(); //replace the entire matrix stack with the updated GL_PROJECTION mode @@ -576,75 +578,58 @@ void render(){ glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,bgImage); - glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i(-SCREEN_WIDTH*2,0); - glTexCoord2i(1,1);glVertex2i( SCREEN_WIDTH*2,0); - glTexCoord2i(1,0);glVertex2i( SCREEN_WIDTH*2,SCREEN_HEIGHT); - glTexCoord2i(0,0);glVertex2i(-SCREEN_WIDTH*2,SCREEN_HEIGHT); + glTexCoord2i(0,1);glVertex2i(-SCREEN_WIDTH*2+offset.x,0); + glTexCoord2i(1,1);glVertex2i( SCREEN_WIDTH*2+offset.x,0); + glTexCoord2i(1,0);glVertex2i( SCREEN_WIDTH*2+offset.x,SCREEN_HEIGHT); + glTexCoord2i(0,0);glVertex2i(-SCREEN_WIDTH*2+offset.x,SCREEN_HEIGHT); glEnd(); int base = 40 - (int)worldGetYBase(currentWorld); glBindTexture(GL_TEXTURE_2D, bgMtn); - - glColor4ub(150,150,150,220); glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i(-1920+offset.x*.85,base); - glTexCoord2i(1,1);glVertex2i( offset.x*.85,base); - glTexCoord2i(1,0);glVertex2i( offset.x*.85,base+1080); - glTexCoord2i(0,0);glVertex2i(-1920+offset.x*.85,base+1080); - glEnd(); glColor4ub(150,150,150,220); - glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i( offset.x*.85,base); - glTexCoord2i(1,1);glVertex2i(1920+offset.x*.85,base); - glTexCoord2i(1,0);glVertex2i(1920+offset.x*.85,base+1080); - glTexCoord2i(0,0);glVertex2i( offset.x*.85,base+1080); + for(int i = 0; i <= currentWorld->getTheWidth()/1920; i++){ + glTexCoord2i(0,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.85,base); + glTexCoord2i(1,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.85,base); + glTexCoord2i(1,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.85,base+1080); + glTexCoord2i(0,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.85,base+1080); + } glEnd(); - glBindTexture(GL_TEXTURE_2D, bgTreesFirst); - glPushMatrix(); - glColor4ub(100,100,100,240); + glBindTexture(GL_TEXTURE_2D, bgTreesFar); glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i(-1920+offset.x*.6,base); - glTexCoord2i(1,1);glVertex2i( offset.x*.6,base); - glTexCoord2i(1,0);glVertex2i( offset.x*.6,base+1080); - glTexCoord2i(0,0);glVertex2i(-1920+offset.x*.6,base+1080); - glEnd(); - glColor4ub(100,100,100,240); - glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i( offset.x*.6,base); - glTexCoord2i(1,1);glVertex2i(1920+offset.x*.6,base); - glTexCoord2i(1,0);glVertex2i(1920+offset.x*.6,base+1080); - glTexCoord2i(0,0);glVertex2i( offset.x*.6,base+1080); + for(int i = 0; i <= currentWorld->getTheWidth()/1920; i++){ + glTexCoord2i(0,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.6,base); + glTexCoord2i(1,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.6,base); + glTexCoord2i(1,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.6,base+1080); + glTexCoord2i(0,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.6,base+1080); + } glEnd(); - glPopMatrix(); - glColor4ub(150,150,150,250); + glBindTexture(GL_TEXTURE_2D, bgTreesMid); glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i(-1920+offset.x*.4,base); - glTexCoord2i(1,1);glVertex2i( offset.x*.4,base); - glTexCoord2i(1,0);glVertex2i( offset.x*.4,base+1080); - glTexCoord2i(0,0);glVertex2i(-1920+offset.x*.4,base+1080); - glEnd(); - glColor4ub(150,150,150,250); - glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i( offset.x*.4,base); - glTexCoord2i(1,1);glVertex2i(1920+offset.x*.4,base); - glTexCoord2i(1,0);glVertex2i(1920+offset.x*.4,base+1080); - glTexCoord2i(0,0);glVertex2i( offset.x*.4,base+1080); + for(int i = 0; i <= currentWorld->getTheWidth()/1920; i++){ + glTexCoord2i(0,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.4,base); + glTexCoord2i(1,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.4,base); + glTexCoord2i(1,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.4,base+1080); + glTexCoord2i(0,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.4,base+1080); + } glEnd(); - glColor4ub(255,255,255,255); + glBindTexture(GL_TEXTURE_2D, bgTreesFront); glBegin(GL_QUADS); - glTexCoord2i(0,1);glVertex2i(-960+offset.x*.25,base); - glTexCoord2i(1,1);glVertex2i( 960+offset.x*.25,base); - glTexCoord2i(1,0);glVertex2i( 960+offset.x*.25,base+1080); - glTexCoord2i(0,0);glVertex2i(-960+offset.x*.25,base+1080); + glColor4ub(255,255,255,255); + for(int i = 0; i <= currentWorld->getTheWidth()/1920; i++){ + glTexCoord2i(0,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.25,base); + glTexCoord2i(1,1);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.25,base); + glTexCoord2i(1,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * (i+1))+offset.x*.25,base+1080); + glTexCoord2i(0,0);glVertex2i((currentWorld->getTheWidth()*-0.5f)+(1920 * i)+offset.x*.25,base+1080); + } glEnd(); glDisable(GL_TEXTURE_2D); @@ -685,6 +670,20 @@ void render(){ debugY, // The player's y coordinate player->qh.current.size() // Active quest count ); + if(ui::posFlag){ + glBegin(GL_LINES); + glColor3ub(255,0,0); + glVertex2i(0,0); + glVertex2i(0,SCREEN_HEIGHT); + + glColor3ub(255,255,255); + glVertex2i(player->loc.x + player->width/2,0); + glVertex2i(player->loc.x + player->width/2,SCREEN_HEIGHT); + + glVertex2i(-SCREEN_WIDTH/2+offset.x,player->loc.y); + glVertex2i(SCREEN_WIDTH/2+offset.x, player->loc.y); + glEnd(); + } } diff --git a/src/gameplay.cpp b/src/gameplay.cpp index 9e0cc99..964794f 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -35,12 +35,7 @@ void initEverything(void){ */ World *test=new World(); - test->generate(SCREEN_WIDTH); - - /* - * Add two layers, a platform, and a hole to the world. - */ - + test->generate(SCREEN_WIDTH * 2); test->addLayer(400); test->addPlatform(150,100,100,10); diff --git a/src/ui.cpp b/src/ui.cpp index e6d18d2..e0ebc50 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -19,6 +19,7 @@ static char *dialogBoxText; namespace ui { vec2 mouse; bool debug=false; + bool posFlag=false; bool dialogBoxExists=false; unsigned int fontSize; @@ -247,6 +248,7 @@ namespace ui { if(SDL_KEY==SDLK_LCTRL)player->speed = .5; } if(SDL_KEY==SDLK_F3)debug^=true; + if(SDL_KEY==SDLK_b & SDL_KEY==SDLK_F3)posFlag^=true; break; /* KEYUP diff --git a/src/world.cpp b/src/world.cpp index 97ec5ac..c04c88a 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -581,8 +581,8 @@ void World::addHole(unsigned int start,unsigned int end){ } } -int World::getStart(void){ - return -x_start; +int World::getTheWidth(void){ + return x_start*-2; } IndoorWorld::IndoorWorld(void){ -- 2.39.5