\r
FLAGS = -std=c++11 -Iinclude -Iinclude/freetype2\r
\r
+MFLAGS64 = 64\r
all:\r
@rm -f out/*.o\r
@cd src; $(MAKE) $(MFLAGS)\r
@echo " CXX main.cpp"\r
- @g++ $(FLAGS) -o main main.cpp out/*.o $(LIBS)\r
+ @g++ $(FLAGS) -m32 -o main main.cpp out/*.o $(LIBS) -lSDL2main\r
+\r
+64:\r
+ @rm -f out64/*.o\r
+ @cd src; $(MAKE) $(MFLAGS64)\r
+ @echo " CXX main.cpp"\r
+ @g++ $(FLAGS) -m64 -o main main.cpp out64/*.o $(LIBS)\r
\r
win32:\r
@g++ $(FLAGS) -o main main.cpp src/*.cpp $(WIN_LIBS)\r
@-rm -f main\r
@echo " RM out/*.o"\r
@-rm -f out/*.o\r
+ @echo " RM out64/*.o"\r
+ @-rm -f out64/*.o\r
//template<class T>
//void getEntityLocation(std::vector<T*>&, unsigned int);
-
+
void addStructure(_TYPE t,float x,float y,World *outside,World *inside);
void addMob(int t,float x,float y);
void addNPC(float x,float y);
RAIN
} WEATHER;
-#define DAY_CYCLE 300
+#define DAY_CYCLE 3000
static WEATHER weather = SUNNY;
static vec2 star[100];
if(!worldInside){
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;
+ if(player->loc.x + player->width + SCREEN_WIDTH/2 > currentWorld->getTheWidth() * 0.5f)
+ offset.x = ((currentWorld->getTheWidth() * 0.5f) - SCREEN_WIDTH / 2);// + player->width / 2;
}
-
if(player->loc.y > SCREEN_HEIGHT/2)
offset.y = player->loc.y + player->height;
FLAGS = -std=c++11 -I../include -I../include/freetype2
OUT = `echo "" $$(ls -c $(wildcard *.cpp)) | sed s/.cpp/.o/g | sed 's/ / ..\/out\//g'`
+OUT64 = `echo "" $$(ls -c $(wildcard *.cpp)) | sed s/.cpp/.o/g | sed 's/ / ..\/out64\//g'`
../out/%.o:
@echo " CXX " $(shell echo $@ | sed 's/..\/out\///g' | sed 's/\.o/\.cpp/')
- @g++ $(FLAGS) -o $@ -c $(shell echo $@ | sed 's/..\/out\///g' | sed 's/\.o/\.cpp/') $(LIBS)
+ @g++ $(FLAGS) -m32 -o $@ -c $(shell echo $@ | sed 's/..\/out\///g' | sed 's/\.o/\.cpp/') $(LIBS) -lSDL2main
+
+../out64/%.o:
+ @echo " CXX " $(shell echo $@ | sed 's/..\/out64\///g' | sed 's/\.o/\.cpp/')
+ @g++ $(FLAGS) -m64 -o $@ -c $(shell echo $@ | sed 's/..\/out64\///g' | sed 's/\.o/\.cpp/') $(LIBS)
all: $(shell echo $(OUT))
+
+64: $(shell echo $(OUT64))
glGenTextures(1, &object); //turns "object" into a texture
glBindTexture(GL_TEXTURE_2D, object); //binds "object" to the top of the stack
+ glPixelStoref(GL_UNPACK_ALIGNMENT,1 );
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); //sets the "min" filter
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); //the the "max" filter of the stack
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); //Wrap the texture to the matrix
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); //Wrap the texutre to the matrix
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image->w, image->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels); //sets the texture to the image file loaded above
+ glTexImage2D( GL_TEXTURE_2D,
+ 0,
+ GL_RGBA,
+ image->w,
+ image->h,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ image->pixels); //sets the texture to the image file loaded above
SDL_FreeSurface(image); //Free surface
return object;
i++;
}
}*/
-
+
void World::addMob(int t,float x,float y){
mob.push_back(new Mob(t));
mob.back()->spawn(x,y);