Changeset 2553 for trunk/map

Show
Ignore:
Timestamp:
09/29/05 22:07:33 (5 years ago)
Author:
marius
Message:

sdl zeugs

Location:
trunk/map
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/map/configure

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r2354 r2553  
    2222 
    2323SRCDIRS="src" 
    24 LIBS="" 
    25 LIBLIBS="" 
    26 INCLUDES="-I \$(TOPDIR)/include/" 
     24LIBS=-lpthread 
     25LIBLIBS="-L/sw/lib/ -liwear_core -liwear_output -lSDL -lSDL_mixer" 
     26INCLUDES="-I/sw/include/ -I \$(TOPDIR)/include/" 
    2727 
    2828EXTRACLEANFILES="test doxygen.log libiw*" 
     
    4343MIN_GCC="3.3.0" 
    4444MIN_GPP="3.3.1" 
     45 
     46MIN_SDL_BASE="1.2.7" 
     47MIN_SDL_MIX="1.2.6" 
    4548 
    4649# 
     
    228231fi 
    229232 
     233##################################################################### 
     234# Perform SDL checks 
     235##################################################################### 
     236 
     237check_SDL $MIN_SDL_BASE 
     238if [ $BAIL == "yes" ] 
     239then 
     240    cleanup; exit 1 
     241fi 
     242 
    230243check_doxygen 
    231244 
  • trunk/map/include/pimp.h

    • Property cvs2svn:cvs-rev changed from 1.19 to 1.20
    r2459 r2553  
    5050namespace map{ 
    5151 
    52 class Directory { 
     52/*class Directory { 
     53 
    5354public: 
    5455    Directory(const char *name);//Konstruktor uebergebene Parameter ist der Pfad 
     
    5859    const string &operator()() const;//gibt den Namen der aktuellen Datei zurueck 
    5960    Directory& operator++();// Objekt zeigt anschliessend auf die naechste Datei/Verzeichnis 
     61 
    6062private: 
    6163    DIR* dir; 
    6264    string here; 
    6365}; 
    64  
     66*/ 
    6567class FileStatus { 
    6668 public: 
     
    7981 
    8082// number of instances of this module 
    81 //static int num_of_uids = 0; 
     83static int num_of_uids = 0; 
    8284     
    8385struct point_coords { /*{{{*/ 
     
    596598                *divers bulidings in the vicinity. 
    597599                */ 
    598                 PoI get_poi(int i); 
     600                PoI * get_poi(int i); 
    599601                 
    600602    }; 
     
    663665/** 
    664666 * $Log$ 
     667 * Revision 1.20  2005/09/29 20:07:33  marius 
     668 * sdl zeugs 
     669 * 
    665670 * Revision 1.19  2005/09/26 14:01:16  marius 
    666671 * updates bugfixes 
  • trunk/map/src/pimp.cpp

    • Property cvs2svn:cvs-rev changed from 1.17 to 1.18
    r2459 r2553  
    183183    // (4215,-2345)==(8,82481,53,08435) 
    184184     
    185 //    Pimp::Pimp() { /*{{{*/ 
    186 //      num_of_uids++; 
    187 //      uid = num_of_uids; 
    188 //      } /*}}}*/ 
    189          
    190 //    Pimp::~Pimp(void) { /*{{{*/ 
    191 //      num_of_uids--; 
    192 //    } /*}}}*/ 
     185    Pimp::Pimp() { /*{{{*/ 
     186                num_of_uids++; 
     187                uid = num_of_uids; 
     188        } /*}}}*/ 
     189         
     190    Pimp::~Pimp(void) { /*{{{*/ 
     191                num_of_uids--; 
     192    } /*}}}*/ 
    193193 
    194194void View::refresh_degree() 
     
    206206        double my_x=compass.current_pos_x(); 
    207207                double my_y=compass.current_pos_y(); 
    208                 double x=pimp.get_poi(i).x; 
    209                 double y=pimp.get_poi(i).y; 
     208                double x=pimp.get_poi(i)->x; 
     209                double y=pimp.get_poi(i)->y; 
    210210                double a=(my_x-x); 
    211211                double b=(my_y-y); 
     
    391391void Pimp::delOldfiles() 
    392392{ 
    393     Directory dir("./temp"); 
     393   /* Directory dir("./temp"); 
    394394    string name = dir();  
    395395    FileStatus file(name);  
     
    411411                exec_cmd(params[0], params); 
    412412                } 
    413         } 
     413        }*/ 
    414414} 
    415415/*=====================*/ 
     
    499499/*}}}*/ 
    500500 
     501PoI * Pimp::get_poi(int i) 
     502{ 
     503        return poi[i]; 
     504} 
     505 
     506double Compass::get_news() 
     507{ 
     508        return 90; 
     509} 
     510 
     511double Compass::current_pos_x() 
     512{ 
     513        return 10; 
     514} 
     515 
     516double Compass::current_pos_y() 
     517{ 
     518        return 10; 
     519} 
     520 
    501521} // namespace iwearmap 
    502522} // namespace iwear 
     
    504524/** 
    505525 * $Log$ 
     526 * Revision 1.18  2005/09/29 20:07:33  marius 
     527 * sdl zeugs 
     528 * 
    506529 * Revision 1.17  2005/09/26 14:01:16  marius 
    507530 * updates bugfixes 
  • trunk/map/src/test.cpp

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r2459 r2553  
    2828#include <unistd.h> 
    2929#include "iwear-iwearmap/pimp.h" 
    30   
     30#include "/usr/include/SDL/SDL.h"  
     31 
     32 
    3133using namespace std; 
    3234using namespace iwear; 
     
    4446            params[0] = "wget"; 
    4547            params[1] = "-O"; 
     48            //sprintf(params[2], "%s/%s", tempdir, filename) 
    4649            params[2] = filename; 
    4750     
     
    7275 
    7376int main() { /*{{{*/ 
    74  
    75     cout << "Testklasse f�itag" << endl; 
     77        MapTest * test = new MapTest(); 
     78         
     79        test->set_tempdir("~/temp"); 
     80        test->set_mapserver("http://www.siriusdd.de/cgi-bin/mapserver-4.2.3"); 
     81        test->set_mapserver_options("mode=map&map=/srv/www/htdocs/mapserver/hb.map&layers=uni1+uni2+uni3+uni4"); 
     82        test->get_tile(5800.0, 0.0, 6600.0, 800.0, 640, 480, "test.jpg"); 
     83         
     84        SDL_Surface * screen; 
     85         
     86        if (SDL_Init(SDL_INIT_VIDEO) == -1 ) 
     87        { 
     88                cout << "fehler"; 
     89                exit(-1); 
     90        } 
     91         
     92        screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE); 
     93        if (screen == NULL) 
     94        { 
     95                cout << "Fehler keine Graphik"; 
     96                exit(-1); 
     97        } 
     98         
     99        SDL_Surface * image; 
     100         
     101        image = SDL_LoadBMP("test.jpg"); 
     102        if (image == NULL) 
     103        { 
     104                cout << "Fehler kein Bild"; 
     105                exit(-1); 
     106        } 
     107         
     108        if (image->format->palette && screen->format->palette) 
     109        { 
     110                SDL_SetColors(screen, image->format->palette->colors, 0, image->format->palette->ncolors); 
     111        } 
     112         
     113        if (SDL_BlitSurface(image, NULL, screen, NULL) < 0) 
     114        { 
     115                cout << "Fehler blid Surface"; 
     116                exit(-1); 
     117        } 
     118         
     119        SDL_UpdateRect(screen, 0, 0, image->w, image->h); 
     120         
     121        SDL_FreeSurface(image); 
     122         
     123        SDL_Quit(); 
     124        exit(0); 
     125         
     126    /*cout << "Testklasse f�itag" << endl; 
    76127    cout << "Geben Sie einen Betrachtungswinkel ein, in dessen Richtung sie schauen." << endl; 
    77128    cout << "0 Grad ist Norden, 90 Grad ist Osten, 180 Grad ist S�nd 270 Grad ist Westen." << endl; 
     
    83134         cin >> a;        
    84135       } 
    85  
     136*/ 
    86137} /*}}}*/ 
    87138 
     
    89140/** 
    90141 * $Log$ 
     142 * Revision 1.6  2005/09/29 20:07:33  marius 
     143 * sdl zeugs 
     144 * 
    91145 * Revision 1.5  2005/09/26 14:01:16  marius 
    92146 * updates bugfixes