blockattack-1.4.1+ds1.orig/0000750000175000017500000000000011536117101014044 5ustar pabspabsblockattack-1.4.1+ds1.orig/changelog1410000600000175000017500000000013711277747111016156 0ustar pabspabsNew in version 1.4.1: Uses PhysFS for file layer apstraction... at least partial Theme support blockattack-1.4.1+ds1.orig/blockattack32.xpm0000640000175000017500000001211510445102013017214 0ustar pabspabs/* XPM */ static char * blockattack32_xpm[] = { "32 32 185 2", " c None", ". c #646415", "+ c #95952C", "@ c #96962E", "# c #A4A449", "$ c #8D8D1F", "% c #8E8E1F", "& c #8E8E21", "* c #CBCB89", "= c #B6B61E", "- c #8E8E20", "; c #84B55F", "> c #36A036", ", c #37A037", "' c #6FBD6F", ") c #A0A01E", "! c #E6E61E", "~ c #7AAC55", "{ c #1F8D1F", "] c #1F8C1F", "^ c #2F942F", "/ c #A1DBA1", "( c #8C8C1F", "_ c #C2C21E", ": c #FCFC1F", "< c #9C9C1E", "[ c #1F8E1F", "} c #1EAC1E", "| c #2B922B", "1 c #97D797", "2 c #C0C01E", "3 c #D9D91E", "4 c #F2F21F", "5 c #FFFF1F", "6 c #E5E51E", "7 c #D7D71E", "8 c #A7A71E", "9 c #1EAB1E", "0 c #1BF31B", "a c #1E981E", "b c #91911F", "c c #D0D01E", "d c #FEFE1F", "e c #F6F61F", "f c #B2B21E", "g c #1CE41C", "h c #1BFF1B", "i c #1CCA1C", "j c #CECE1E", "k c #FDFD1F", "l c #A8A81E", "m c #1EB01E", "n c #1BFE1B", "o c #1BF81B", "p c #1E9B1E", "q c #DCDC1E", "r c #F5F51E", "s c #B4B41E", "t c #1F901F", "u c #1CE81C", "v c #1CD01C", "w c #94941E", "x c #F2F21E", "y c #BBBB1E", "z c #95951F", "A c #D8D81E", "B c #D5D51E", "C c #1DB61D", "D c #1BF91B", "E c #1E9F1E", "F c #A2A21E", "G c #A5A51E", "H c #8F8F1F", "I c #7AB255", "J c #1BEC1B", "K c #1CD61C", "L c #5F5F14", "M c #74D24C", "N c #1BFA1B", "O c #1EA41E", "P c #660909", "Q c #702410", "R c #663E10", "S c #664010", "T c #734713", "U c #9C4526", "V c #9E6245", "W c #5FE44D", "X c #1CDA1C", "Y c #640808", "Z c #900C0C", "` c #A2A16B", " . c #1BFC1B", ".. c #1EA81E", "+. c #660808", "@. c #990D0D", "#. c #B61010", "$. c #C91313", "%. c #C61313", "&. c #AE1010", "*. c #940C0C", "=. c #900B0B", "-. c #A09562", ";. c #1CDD1C", ">. c #BA1111", ",. c #F41A1A", "'. c #FF1B1B", "). c #FE1B1B", "!. c #E91818", "~. c #A60F0F", "{. c #A18063", "]. c #1E9E1E", "^. c #1E9D1E", "/. c #96D696", "(. c #BD1212", "_. c #FC1B1B", ":. c #F51A1A", "<. c #A50E0E", "[. c #A17A62", "}. c #1D851D", "|. c #288E29", "1. c #4D7F81", "2. c #303097", "3. c #5656AB", "4. c #9C0D0D", "5. c #F71A1A", "6. c #E31717", "7. c #910C0C", "8. c #AF6F69", "9. c #0B2C18", "0. c #142B4A", "a. c #142C4C", "b. c #142C4E", "c. c #193662", "d. c #1E228D", "e. c #1F1F8D", "f. c #262690", "g. c #C01212", "h. c #A40E0E", "i. c #C87878", "j. c #1E1E8A", "k. c #1D1DBF", "l. c #1B1BF8", "m. c #1D1DC4", "n. c #252590", "o. c #8F0C0C", "p. c #D41515", "q. c #B41111", "r. c #1C1CD0", "s. c #1B1BFF", "t. c #1C1CD5", "u. c #D31515", "v. c #B21010", "w. c #BA1212", "x. c #FA1A1A", "y. c #A00E0E", "z. c #970C0C", "A. c #F21919", "B. c #DA1616", "C. c #B01010", "D. c #F91A1A", "E. c #ED1818", "F. c #AA0F0F", "G. c #E71818", "H. c #FD1B1B", "I. c #D81616", "J. c #920C0C", "K. c #B31111", "L. c #B11010", "M. c #9E0E0E", "N. c #1C1CC9", "O. c #1B1BFE", "P. c #1C1CCE", "Q. c #590707", "R. c #900D0D", "S. c #C66060", "T. c #1F1F90", "U. c #1E1E9D", "V. c #1F1F91", "W. c #460505", "X. c #4A0606", "Y. c #5C0808", "Z. c #121258", "`. c #151565", " + c #1A1A73", " ", " ", " . + @ @ @ @ @ @ @ @ @ # ", " . $ $ $ $ $ % $ $ $ $ & * ", " . $ $ $ $ $ = $ $ $ $ - ; > > > > > > > > > , ' ", " . $ $ $ $ ) ! % $ $ $ - ~ { { { ] { { { { { { ^ / ", " . $ ( ( ( _ : < ( ( ( - ~ { { [ } { { { { { { | 1 ", " . % 2 3 3 4 5 6 3 7 8 - ~ { { 9 0 a { { { { { | 1 ", " . $ b c d 5 5 5 e f $ - ~ { [ g h i ] { { { { | 1 ", " . $ $ % j 5 5 k l $ $ - ~ { m n h o p { { { { | 1 ", " . $ $ $ q d r 5 s $ $ - ~ t u h h h v { { { { | 1 ", " . $ $ w x y z A B ( $ - ~ C n h h h D E { { { | 1 ", " . $ $ F G $ $ % = H $ - I J h h h h h K { { { | 1 ", " L $ $ $ $ $ $ $ $ $ $ & M n h h h h h N O { { | 1 ", " P Q R S S S S S S S S S T U V W h h h h h X [ { | 1 ", " Y Z Z Z Z Z Z Z Z Z Z Z Z Z Z ` h h h h h ...{ | 1 ", " +.Z Z Z Z @.#.$.%.&.*.Z Z Z =.-. . . . . . .;.[ | 1 ", " +.Z Z Z >.,.'.'.'.).!.~.Z Z =.{.].].].].].].^.[ | /. ", " +.Z Z (._.'.'.'.'.'.'.:.<.Z =.[.}.}.}.}.}.}.}.}.|.1.2.3. ", " +.Z 4.5.'.'.'.'.'.'.'.'.6.7.=.8.9.0.a.b.b.b.b.b.c.d.e.f. ", " +.Z g.'.'.'.'.'.'.'.'.'._.h.=.i. j.k.l.l.l.l.l.l.l.m.n. ", " +.o.p.'.'.'.'.'.'.'.'.'.'.q.=.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.o.u.'.'.'.'.'.'.'.'.'.'.v.=.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.Z w.'.'.'.'.'.'.'.'.'.x.y.=.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.Z z.A.'.'.'.'.'.'.'.'.B.Z =.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.Z Z C.D.'.'.'.'.'.'.E.4.Z =.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.Z Z Z F.G.H.'.'.x.I.4.Z Z =.i. j.r.s.s.s.s.s.s.s.t.n. ", " +.Z Z Z Z J.h.K.L.M.Z Z Z Z =.i. j.N.O.O.O.O.O.O.O.P.n. ", " Q.o.Z Z Z Z Z Z Z Z Z Z Z Z R.S. j.T.U.U.U.U.U.U.U.V.n. ", " W.X.X.X.X.X.X.X.X.X.X.X.X.Y. Z.`.`.`.`.`.`.`.`.`. + ", " ", " "}; blockattack-1.4.1+ds1.orig/README0000640000175000017500000000143211277746760014752 0ustar pabspabsThanks for downloading Block Attack - Rise Of the Blocks 1.4.1 for Linux and other Platforms Version 1.4.1 Theme support and now uses Phys FS for loading files... this is The game can be compiled by typing make. "scons install" is unfortunatly broken (if you know why then tell me). If your operating system does not have libenet libaries and you don't want to compile them yourself then change the line "#define NETOWRK=1" to "#define NETOWRK=0" in source/code/block.make Dependencies: On Ubunut the required packages are to run are: libsdl1.2debian-all, libsdl-image1.2, libsdl-mixer1.2, libphysfs1 and libenet To compile: build-essential, libsdl1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev, libphysfs-dev and libenet-dev http://blockattack.sf.net Poul Sander poul@poulsander.com blockattack-1.4.1+ds1.orig/man/0000750000175000017500000000000011536117101014617 5ustar pabspabsblockattack-1.4.1+ds1.orig/man/blockattack.sgml0000640000175000017500000000624611111344143017773 0ustar pabspabs manpage.1'. You may view the manual page with: `docbook-to-man manpage.sgml | nroff -man | less'. A typical entry in a Makefile or Makefile.am is: manpage.1: manpage.sgml docbook-to-man $< > $@ The docbook-to-man binary is found in the docbook-to-man package. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include docbook-to-man in your Build-Depends control field. --> Goneri"> Le Bouder"> mai 19, 2006"> 6"> goneri@rulezlan.org"> BLOCKATTACK"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2006 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; Rise of the Blocks DESCRIPTION This manual page documents briefly the &dhpackage;. This manual page was written for the &debian; distribution because the original program does not have a manual page. . OPTIONS These programs don't have specific option. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
blockattack-1.4.1+ds1.orig/man/README0000640000175000017500000000012611111344143015474 0ustar pabspabsto regenerate the manpage: docbook-to-man blockattack.sgml|gzip -9 > blockattack.6.gz blockattack-1.4.1+ds1.orig/man/SConscript0000640000175000017500000000024711111344143016632 0ustar pabspabs#-------------# # Import Vars # #-------------# Import('*') env.Install ('$destdir/$mandir/man6/','blockattack.6.gz') env.Alias('install', '$destdir/$mandir/man6/') blockattack-1.4.1+ds1.orig/source/0000750000175000017500000000000011536117101015344 5ustar pabspabsblockattack-1.4.1+ds1.orig/source/code/0000750000175000017500000000000011536117101016256 5ustar pabspabsblockattack-1.4.1+ds1.orig/source/code/common.cc0000640000175000017500000001705611165743143020100 0ustar pabspabs/* 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 */ #include "common.h" #include //Function to convert numbers to string string itoa(int num) { stringstream converter; converter << num; return converter.str(); } string double2str(double num) { stringstream converter; converter << num; return converter.str(); } /** * str2double parses a string and returns a double with the value of the string. * if the string is not a double then 0.0 is returned instead of throing an error * in that way this function will always return a useable value. */ double str2double(string str2parse) { try{ stringstream converter(str2parse); double val = 0.0; converter >> val; return val; }catch(ios_base::failure f) { return 0.0; } } /** * str2int parses a string and returns an int with the value of the string. * if the string is not an int then 0 is returned instead of throing an error * in that way this function will always return a useable value. */ int str2int(string str2parse) { try{ stringstream converter(str2parse); int val = 0; converter >> val; return val; }catch(ios_base::failure f) { return 0; } } #ifdef WIN32 //Returns path to "my Documents" in windows: string getMyDocumentsPath() { TCHAR pszPath[MAX_PATH]; //if (SUCCEEDED(SHGetSpecialFolderPath(NULL, pszPath, CSIDL_PERSONAL, FALSE))) { if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, pszPath))) { // pszPath is now the path that you want #if DEBUG cout << "MyDocuments Located: " << pszPath << endl; #endif string theResult= pszPath; return theResult; } else { cout << "Warning: My Documents not found!" << endl; string theResult =""; return theResult; } } #endif /** * Returns the path to where all settings must be saved. * On unix-like systems this is the home-folder under: ~/.gamesaves/GAMENAME * In Windows it is My Documents/My Games * Consider changing this for Vista that has a special save games folder */ string getPathToSaveFiles() { #ifdef __unix__ return (string)getenv("HOME")+(string)"/.gamesaves/"+GAMENAME; #elif WIN32 return getMyDocumentsPath()+(string)"/My Games/"+GAMENAME; #else return "."; #endif } /** * Takes a number of milliseconds and returns the value in commonTime format. */ commonTime TimeHandler::ms2ct(unsigned int milliseconds) { commonTime ct; ct.days = 0; unsigned int time = milliseconds; ct.hours = time/(1000*60*60); time = time % (1000*60*60); ct.minutes = time/(1000*60); time = time % (1000*60); ct.seconds = time/1000; return ct; } commonTime TimeHandler::getTime(string name) { commonTime ct; ct.days = Config::getInstance()->getInt(name+"Days"); ct.hours = Config::getInstance()->getInt(name+"Hours"); ct.minutes = Config::getInstance()->getInt(name+"Minutes"); ct.seconds = Config::getInstance()->getInt(name+"Seconds"); return ct; } /** * Returns the total runtime with toAdd added but without writing it to config file. * Used for stats */ commonTime TimeHandler::peekTime(string name, commonTime toAdd) { commonTime ct = getTime(name); ct.seconds +=toAdd.seconds; ct.minutes +=ct.seconds/60; ct.seconds = ct.seconds%60; ct.minutes += toAdd.minutes; ct.hours += ct.minutes/60; ct.minutes = ct.minutes%60; ct.hours += toAdd.hours; ct.days += ct.hours/24; ct.hours = ct.hours%24; ct.days += toAdd.days; return ct; } /** * Same as peekTotalTime but writes the time to the config file. * Should only be called only once! when the program shuts down */ commonTime TimeHandler::addTime(string name, commonTime toAdd) { commonTime ct = peekTime(name,toAdd); Config::getInstance()->setInt(name+"Days",ct.days); Config::getInstance()->setInt(name+"Hours",ct.hours); Config::getInstance()->setInt(name+"Minutes",ct.minutes); Config::getInstance()->setInt(name+"Seconds",ct.seconds); return ct; } Config* Config::instance = 0; Config::Config() { configMap.clear(); load(); } void Config::load() { string filename = getPathToSaveFiles()+"/configFile"; ifstream inFile(filename.c_str()); string key; string previuskey; char value[MAX_VAR_LENGTH]; if(inFile) { while(!inFile.eof()) { inFile >> key; if(key==previuskey) //the last entry will be read 2 times if a linebreak is missing in the end continue; previuskey = key; inFile.get(); //Read the space between the key and the content inFile.getline(value,MAX_VAR_LENGTH); #if DEBUG cout << "Config "<< "read: " << key << " with:\"" << value << "\"" << endl; #endif configMap[key] = (string)value; } inFile.close(); } } Config* Config::getInstance() { if(Config::instance==0) { Config::instance = new Config(); } return Config::instance; } void Config::save() { string filename = getPathToSaveFiles()+"/configFile"; ofstream outFile(filename.c_str(),ios::trunc); if(outFile) { map::iterator iter; for(iter = configMap.begin(); iter != configMap.end(); iter++) { outFile << iter->first << " " << iter->second << endl; } outFile << "\n"; //The last entry in the file will be read double if a linebreak is missing //This is checked on load too in case a user changes it himself. } outFile.close(); } bool Config::exists(string varName) { //Using that find returns an iterator to the end of the map if not found return configMap.find(varName) != configMap.end(); } void Config::setDefault(string varName,string content) { if(exists(varName)) return; //Already exists do not change setString(varName,content); } void Config::setString(string varName, string content) { configMap[varName] = content; } void Config::setInt(string varName, int content) { configMap[varName] = itoa(content); } void Config::setValue(string varName,double content) { configMap[varName] = double2str(content); } string Config::getString(string varName) { if(exists(varName)) { return configMap[varName]; } else return ""; } int Config::getInt(string varName) { if(exists(varName)) { return str2int(configMap[varName]); } else return 0; } double Config::getValue(string varName) { if(exists(varName)) { return str2double(configMap[varName]); } else return 0.0; } blockattack-1.4.1+ds1.orig/source/code/MenuSystem.cc0000640000175000017500000001276011111344142020701 0ustar pabspabs/* 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 */ #include "MenuSystem.h" #include "common.h" extern SDL_Surface *mouse; extern SDL_Surface *backgroundImage; extern bool highPriority; int mousex; int mousey; /*Draws a image from on a given Surface. Takes source image, destination surface and coordinates*/ inline void DrawIMG(SDL_Surface *img, SDL_Surface *target, int x, int y) { SDL_Rect dest; dest.x = x; dest.y = y; SDL_BlitSurface(img, NULL, target, &dest); } SDL_Surface* ButtonGfx::marked; SDL_Surface* ButtonGfx::unmarked; int ButtonGfx::xsize; int ButtonGfx::ysize; TTFont* ButtonGfx::ttf; void ButtonGfx::setSurfaces(SDL_Surface **marked,SDL_Surface **unmarked) { ButtonGfx::marked = *marked; ButtonGfx::unmarked = *unmarked; xsize=(*marked)->w; ysize=(*marked)->h; } Button::Button() { label = ""; marked = false; surfaceMarked = SDL_ConvertSurface(ButtonGfx::marked, ButtonGfx::marked->format, SDL_SWSURFACE); surfaceUnmarked = SDL_ConvertSurface(ButtonGfx::unmarked, ButtonGfx::unmarked->format, SDL_SWSURFACE); } Button::~Button() { SDL_FreeSurface(surfaceMarked); SDL_FreeSurface(surfaceUnmarked); } Button::Button(const Button& b) { label = b.label; marked = b.marked; surfaceMarked = SDL_ConvertSurface(ButtonGfx::marked, ButtonGfx::marked->format, SDL_SWSURFACE); surfaceUnmarked = SDL_ConvertSurface(ButtonGfx::unmarked, ButtonGfx::unmarked->format, SDL_SWSURFACE); } void Button::setLabel(string text) { label = text; } void Button::setAction(void (*action2run)()) { action = action2run; } bool Button::isClicked(int x,int y) { if ( x >= this->x && y >= this->y && x<= this->x+ButtonGfx::xsize && y <= this->y + ButtonGfx::ysize) return true; else return false; } void Button::doAction() { action(); } void Button::drawTo(SDL_Surface *surface) { #if DEBUG cout << "Painting button: " << label << endl; #endif if (marked) DrawIMG(surfaceMarked,surface,x,y); else DrawIMG(surfaceUnmarked,surface,x,y); //int stringx = x + (ButtonGfx::xsize)/2 - ButtonGfx::ttf->getTextWidth(label)/2; //int stringy = y + (ButtonGfx::ysize)/2 - ButtonGfx::ttf->getTextHeight()/2; //ButtonGfx::ttf->writeText(label,surface,stringx,stringy); } void Menu::drawSelf() { DrawIMG(backgroundImage,screen,0,0); vector