diff --git a/Game/gfx/bTheme.png b/Game/gfx/bTheme.png index 6dc321c..b581ac1 100644 Binary files a/Game/gfx/bTheme.png and b/Game/gfx/bTheme.png differ diff --git a/Game/gfx/bVsGameConfig.png b/Game/gfx/bVsGameConfig.png index f50a4ef..e582b6f 100755 Binary files a/Game/gfx/bVsGameConfig.png and b/Game/gfx/bVsGameConfig.png differ diff --git a/Makefile b/Makefile index 7b0c95b..56660a1 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,15 @@ #INST=/games/blockattack standard: - @echo "Removing old files (if they exists)" - @rm -f source/code/*.o - @rm -f ./Game/blockattack - @rm -f ./Game/starter - @rm -f ./Game/runme.sh - @echo "Done deleting files" +# @echo "Removing old files (if they exists)" +# @rm -f source/code/*.o +# @rm -f ./Game/blockattack +# @rm -f ./Game/starter +# @rm -f ./Game/runme.sh +# @echo "Done deleting files" @echo "Now compiling..." @make -C source/code -f block.make - @rm -f source/code/*.o + #@rm -f source/code/*.o @echo "Everything has been compiled!" clean: diff --git a/source/AUTH b/source/AUTH index 6518e7e..a96643a 100644 --- a/source/AUTH +++ b/source/AUTH @@ -28,12 +28,12 @@ bRetry.png Poul Sander bSave.png qubodup bSelectPuzzle.png qubodup bSkip.png Poul Sander -bTheme.png Poul Sander +bTheme.png Poul Sander (based on qubodup's buttons) +bVsGameConfig.png Poul Sander (based on qubodup's buttons) bTimeTrial.png qubodup bVsGame.png qubodup bStageClear.png qubodup bTwoPlayers.png qubodup - blockAttack.ico Poul Sander changeButtonsBack1.png Poul Sander iDraw.png Poul Sander diff --git a/source/assets/gfx/buttons/buttons.svg b/source/assets/gfx/buttons/buttons.svg index 396996b..a2984e8 100644 --- a/source/assets/gfx/buttons/buttons.svg +++ b/source/assets/gfx/buttons/buttons.svg @@ -6391,4 +6391,81 @@ x="159.19141" id="tspan4434" sodipodi:role="line">Configure + + + + + + + Versus + + + + + + + + Theme + diff --git a/source/code/NetworkThing.hpp b/source/code/NetworkThing.hpp index 88e8f30..2acf313 100644 --- a/source/code/NetworkThing.hpp +++ b/source/code/NetworkThing.hpp @@ -370,7 +370,8 @@ public: break; case ENET_EVENT_TYPE_DISCONNECT: - printf ("%s disconected.\n", event.peer -> data); + //printf ("%s disconected.\n", event.peer -> data); + cout << event.peer -> data << " disconnected." << endl; /* Reset the peer's client information. */ diff --git a/source/code/block.make b/source/code/block.make index 73a3f8b..48df625 100644 --- a/source/code/block.make +++ b/source/code/block.make @@ -1,9 +1,26 @@ -GAMEDIR=../../Game/ +#ifndef GAMEDIR + GAMEDIR=../../Game/ +#endif + +#ifndef BINARY BINARY=$(GAMEDIR)blockattack -CC=gcc -CPP=g++ -BASE_CFLAGS=-c $(shell sdl-config --cflags) -BASE_LIBS=$(shell sdl-config --libs) -lSDL_image -lSDL_mixer +#endif + +#ifndef CC + CC=gcc +#endif + +#ifndef CPP + CPP=g++ +#endif + +#ifndef BASE_CFLAGS + BASE_CFLAGS=-c $(shell sdl-config --cflags) +#endif + +#ifndef BASE_LIBS + BASE_LIBS=$(shell sdl-config --libs) -lSDL_image -lSDL_mixer -lSDL_ttf +#endif #For developement only ifndef DEBUG @@ -74,6 +91,13 @@ common.o: common.h common.cc uploadReplay.o: uploadReplay.cc uploadReplay.h $(CPP) $(BASE_CFLAGS) uploadReplay.cc +#MenuSystem.o: MenuSystem.cc MenuSystem.h +# $(CPP) $(BASE_CFLAGS) MenuSystem.cc + +#ttfont.o: ttfont.h ttfont.cc +# $(CPP) $(BASE_CFLAGS) ttfont.cc + + run: $(BINARY) clean: diff --git a/source/code/listFiles.h b/source/code/listFiles.h index 8859845..f60b8af 100644 --- a/source/code/listFiles.h +++ b/source/code/listFiles.h @@ -26,6 +26,7 @@ Copyright (C) 2005 Poul Sander //listFiles.h - List files in a given directory, 10 files at a time, at most 250 files #include #include +#include #if defined(_WIN32) #include #elif defined(__unix__) diff --git a/source/code/main.cpp b/source/code/main.cpp index d1e5664..b2d493e 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -69,6 +69,7 @@ Copyright (C) 2008 Poul Sander #include "ttfont.h" //To use True Type Fonts in SDL //#include "config.h" #include +//#include "MenuSystem.h" //if SHAREDIR is not used we look in current directory #ifndef SHAREDIR @@ -80,8 +81,6 @@ Copyright (C) 2008 Poul Sander //enet things #if NETWORK #include "enet/enet.h" -//#include "enet/list.h" -//#include "enet/protocol.h" #endif //enet things end @@ -388,7 +387,7 @@ void loadTheme(string themeName) #endif } -/*TTF_Font * TTF_OpenFont2(char* path, int ptsize) { +TTF_Font * TTF_OpenFont2(char* path, int ptsize) { char * tmp; TTF_Font * ret=NULL; @@ -407,7 +406,7 @@ void loadTheme(string themeName) cout << "failed to load font: " << TTF_GetError() << endl; free(tmp); return ret; -}*/ +} Mix_Music * Mix_LoadMUS2(char* path) { @@ -558,6 +557,8 @@ int InitImages() && (bSkip = IMG_Load2((char*)"gfx/bSkip.png")) && (bNext = IMG_Load2((char*)"gfx/bNext.png")) && (bRetry = IMG_Load2((char*)"gfx/bRetry.png")) + //&& (menuMarked = IMG_Load2((char*)"gfx/menu/marked.png")) + //&& (menuUnmarked = IMG_Load2((char*)"gfx/menu/unmarked.png")) //end new in 1.4.0 && (mouse = IMG_Load2((char*)"gfx/mouse.png")) )) @@ -590,6 +591,8 @@ int InitImages() CONVERTA(bSkip); CONVERTA(bRetry); CONVERTA(bNext); + //CONVERTA(menuMarked); + //CONVERTA(menuUnmarked); #if NETWORK CONVERTA(bNetwork); CONVERTA(bHost); @@ -679,9 +682,9 @@ int InitImages() fSmallFont = SFont_InitFont(iSmallFont); //And the ttf font: -// TTF_Font *ttFont1 = TTF_OpenFont2("fonts/FreeSerif.ttf", 24); -// TTF_SetFontStyle(ttFont1,TTF_STYLE_BOLD); -// ttfont = TTFont(ttFont1); + /*TTF_Font *ttFont1 = TTF_OpenFont2((char*)"fonts/FreeSerif.ttf", 24); + TTF_SetFontStyle(ttFont1,TTF_STYLE_BOLD); + ttfont = TTFont(ttFont1);*/ //Loads the sound if sound present if (!NoSound) @@ -886,6 +889,28 @@ void DrawIMG(SDL_Surface *img, SDL_Surface * target, int x, int y, int w, int h, SDL_BlitSurface(img, &dest2, target, &dest); } +//Menu +/*void PrintHi() +{ + cout << "Hi" <= Ticks + 1000) { if (Frames > 999) Frames=999; - sprintf(FPS, "%i fps", Frames); + sprintf(FPS, "%lu fps", Frames); Frames = 0; Ticks = SDL_GetTicks(); } @@ -3048,7 +3073,7 @@ int main(int argc, char *argv[]) tempA = getMyDocumentsPath()+"\\My Games\\blockattack\\screenshots"; CreateDirectory(tempA.c_str(),NULL);//system(tempA.c_str()); #endif - bool highPriority = false; //if true the game will take most resources, but increase framerate. + highPriority = false; //if true the game will take most resources, but increase framerate. bFullscreen = false; if (argc > 1) { @@ -3382,6 +3407,7 @@ int main(int argc, char *argv[]) cout << "Images loaded" << endl; + //InitMenues(); BlockGame theGame = BlockGame(50,100); //creates game objects BlockGame theGame2 = BlockGame(xsize-500,100); @@ -3733,8 +3759,9 @@ int main(int argc, char *argv[]) /*This is the test place, place function to test here*/ //theGame.CreateGreyGarbage(); - char mitNavn[30]; - SelectThemeDialogbox(300,400,mitNavn); + //char mitNavn[30]; + //SelectThemeDialogbox(300,400,mitNavn); + // MainMenu(); } //F11 } if ( event.key.keysym.sym == SDLK_F12 ) { diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index 39a7750..5fb3329 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp @@ -161,6 +161,9 @@ SDL_Surface *bTheme; SDL_Surface *bSkip; SDL_Surface *bRetry; SDL_Surface *bNext; + +//SDL_Surface *menuMarked; +//SDL_Surface *menuUnmarked; //end new in 1.4.0 SDL_Surface *mouse; //The mouse cursor @@ -210,6 +213,7 @@ bool bFullscreen; //true if game is running fullscreen bool puzzleLoaded; //true if the puzzle levels have been loaded bool drawBalls; //if true balls are drawed to the screen, this might lower framerate too much bool standardBackground; +bool highPriority; //new in 1.3.2 bool editorMode = false; diff --git a/source/code/ttfont.cc b/source/code/ttfont.cc index 482f433..608c1d2 100644 --- a/source/code/ttfont.cc +++ b/source/code/ttfont.cc @@ -26,6 +26,10 @@ Copyright (C) 2008 Poul Sander #include "ttfont.h" +//extern SDL_Surface *tmp; + +//#define CONVERTA(n) tmp = SDL_DisplayFormatAlpha(n); SDL_FreeSurface(n); n = tmp + TTFont::TTFont() { font = NULL; diff --git a/source/code/uploadReplay.h b/source/code/uploadReplay.h index 16ede86..20ad861 100644 --- a/source/code/uploadReplay.h +++ b/source/code/uploadReplay.h @@ -1,3 +1,29 @@ +/* +Block Attack - Rise of the Blocks, SDL game, besed on Nintendo's Tetris Attack +Copyright (C) 2008 Poul Sander + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Poul Sander + R�vehjvej 36, V. 1111 + 2800 Kgs. Lyngby + DENMARK + blockattack@poulsander.com + http://blockattack.sf.net +*/ + // // File: uploadReplay.h // Author: poul