GLuint fragShader;
GLuint shaderProgram;
GLuint colorIndex;
++GLuint mouseTex;
Mix_Chunk *crickets;
*/
ui::initFonts();
-- ui::setFontFace("ttf/Perfect DOS VGA 437.ttf"); // as in gamedev/ttf/<font>
++ ui::setFontFace("ttf/VCR_OSD_MONO_1.001.ttf"); // as in gamedev/ttf/<font>
/*
* Initialize the random number generator. At the moment, initRand is a macro pointing to libc's
*/
invUI = Texture::loadTexture("assets/invUI.png" );
++ mouseTex = Texture::loadTexture("assets/mouse.png");
initInventorySprites();
*/
glColor3ub(255,255,255);
--
-- glBegin(GL_TRIANGLES);
-- glVertex2i(ui::mouse.x ,ui::mouse.y );
-- glVertex2i(ui::mouse.x+HLINE*3.5,ui::mouse.y );
-- glVertex2i(ui::mouse.x ,ui::mouse.y-HLINE*3.5);
++ glEnable(GL_TEXTURE_2D);
++ glBindTexture(GL_TEXTURE_2D, mouseTex);
++ glBegin(GL_QUADS);
++ glTexCoord2f(0,0);glVertex2i(ui::mouse.x ,ui::mouse.y );
++ glTexCoord2f(1,0);glVertex2i(ui::mouse.x+HLINE*5 ,ui::mouse.y );
++ glTexCoord2f(1,1);glVertex2i(ui::mouse.x+HLINE*5 ,ui::mouse.y-HLINE*5 );
++ glTexCoord2f(0,1);glVertex2i(ui::mouse.x ,ui::mouse.y-HLINE*5 );
glEnd();
++ glDisable(GL_TEXTURE_2D);
/**************************
**** END RENDERING ****
* Make the NPC 'wander' about the world if they're allowed to do so.
* Entity->canMove is modified when a player interacts with an NPC so
* that the NPC doesn't move when it talks to the player.
- *
- */
+ */
++/*<<<<<<< HEAD
+ if(n->canMove) n->wander((rand() % 120 + 30));
+
+ if(!player->inv->usingi) n->hit = false;
+ if(player->inv->usingi && !n->hit && player->inv->detectCollision(vec2{n->loc.x, n->loc.y},vec2{n->loc.x+n->width,n->loc.y+n->height})){
++=======*/
+ if(n->canMove)
+ n->wander((rand() % 120 + 30));
+
+ /*if(!player->inv->usingi) n->hit = false;
+
+ if(player->inv->usingi && !n->hit && player->inv->detectCollision((vec2){n->loc.x, n->loc.y},(vec2){n->loc.x+n->width,n->loc.y+n->height})){
++>>>>>>> 7ab072caaaec09720ad79cfed5738e89bc60c44f
n->health -= 25;
n->hit = true;
for(int r = 0; r < (rand()%5);r++)
extern float VOLUME_MUSIC;
XMLDocument xml;
+XMLElement *scr;
+XMLElement *vol;
-
-void readConfig(void){
- XMLElement *scr;
- XMLElement *vol;
+void readConfig(){
xml.LoadFile("config/settings.xml");
scr = xml.FirstChildElement("screen");
SCREEN_WIDTH = scr->UnsignedAttribute("width");
}
-void updateConfig(void){
- XMLElement *vol = xml.FirstChildElement("volume")->FirstChildElement("master")->ToElement();
- vol->SetAttribute("volume",VOLUME_MASTER);
-
+void updateConfig(){
+ vol->FirstChildElement("master")->SetAttribute("volume",VOLUME_MASTER);
+ vol->FirstChildElement("music")->SetAttribute("volume",VOLUME_MUSIC);
-
++
+ Mix_Volume(0,VOLUME_MASTER);
+ Mix_VolumeMusic(VOLUME_MUSIC);
+
+}
+
+void saveConfig(){
xml.SaveFile("config/settings.xml", false);
- }
+ }