adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src main.cc,1.39.2.21,1.39.2.22 landm


From: Alexandre Courbot <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src main.cc,1.39.2.21,1.39.2.22 landmap.cc,1.18.2.11,1.18.2.12
Date: Thu, 04 Apr 2002 13:10:57 -0500

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv9239/src

Modified Files:
      Tag: Branch_road_to_0-4
        main.cc landmap.cc 
Log Message:
Updated map engine.


Index: main.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/main.cc,v
retrieving revision 1.39.2.21
retrieving revision 1.39.2.22
diff -C2 -r1.39.2.21 -r1.39.2.22
*** main.cc     3 Apr 2002 16:11:30 -0000       1.39.2.21
--- main.cc     4 Apr 2002 18:10:54 -0000       1.39.2.22
***************
*** 153,156 ****
--- 153,160 ----
          mchar->set_limits(16,12);
  
+         // Quick fix for the character size.
+         for (map_placeable::iterator it = mchar->begin(); it != mchar->end(); 
++it)
+             it->second.zsize += 5;
+ 
          // Adding map objects
          map_object_with_gfx * mobj;
***************
*** 298,350 ****
              {
                  mapsquare * sq = gc.lmap.get (i, j); 
!                 for (mapsquare::iterator it = sq->begin ();
!                      it != sq->end (); it++)
                  {
!                     if (it->x () == i && it->y () == j) 
!                         drawqueue.push_back (*it); 
                  }
!             }            
!         }
  
          drawqueue.sort();
-         //            sort (drawqueue.begin (), drawqueue.end (), boah); 
              
!             for (list <mapsquare_info>::iterator it = drawqueue.begin ();
!                  it != drawqueue.end (); it++)
              {
!                 switch ((*it).obj->type ()) 
!                 {
!                     case CHARACTER:
!                         ((map_character_with_gfx *)
!                          (*it).obj)->draw ((*it).x () * mapsquare_size + 
(*it).ox (),
!                                            (*it).y () * mapsquare_size + 
(*it).oy ());
! //                         ((map_character_with_gfx *)
! //                          (*it).obj)->draw_walkable ((*it).x () * 
mapsquare_size + (*it).ox (),
! //                                            (*it).y () * mapsquare_size + 
(*it).oy ());
! //                         ((map_character_with_gfx *)
! //                          (*it).obj)->draw_border ((*it).x () * 
mapsquare_size + (*it).ox (),
! //                                            (*it).y () * mapsquare_size + 
(*it).oy ());
!                         break; 
!                         
!                     case OBJECT:
!                         ((map_object_with_gfx *)
!                          (*it).obj)->draw ((*it).x () * mapsquare_size + 
(*it).ox (),
!                                             (*it).y () * mapsquare_size + 
(*it).oy () - (*it).z());
! //                         ((map_object_with_gfx *)
! //                          (*it).obj)->draw_walkable ((*it).x () * 
mapsquare_size + (*it).ox (),
! //                                             (*it).y () * mapsquare_size + 
(*it).oy ());                        
! //                         ((map_object_with_gfx *)
! //                          (*it).obj)->draw_border ((*it).x () * 
mapsquare_size + (*it).ox (),
! //                                             (*it).y () * mapsquare_size + 
(*it).oy ());                        
!                         break;
!                         
!                     default:
!                         break; 
!                 }
              }
! 
!             drawqueue.clear ();             
! 
! 
          if (gc.draw_grid)
          {
--- 302,360 ----
              {
                  mapsquare * sq = gc.lmap.get (i, j); 
!                 mapsquare::iterator it = sq->end();
!                 while (it != sq->begin())
                  {
!                     --it;
!                     if (!it->oy())
!                     {
!                         if (it->x () == i && it->y () == j) 
!                             drawqueue.push_back(*it);
!                     }
!                     else
!                     {
!                         if (it->x () == i && it->y () == j - 1) 
!                             drawqueue.push_back(*it);
!                     }
! 
                  }
!             }
! //                 }
! //                 for (mapsquare::iterator it = sq->begin ();
! //                      it != sq->end (); it++)
! //                 {
! //                     if (it->x () == i && it->y () == j) 
! //                         drawqueue.push_back (*it); 
! //                 }
! //             }            
! //         }
  
          drawqueue.sort();
              
!         for (list <mapsquare_info>::iterator it = drawqueue.begin ();
!              it != drawqueue.end (); it++)
!         {
!             switch ((*it).obj->type ()) 
              {
!                 case CHARACTER:
!                     ((map_character_with_gfx *)
!                      (*it).obj)->draw ((*it).x () * mapsquare_size + (*it).ox 
(),
!                                        (*it).y () * mapsquare_size + (*it).oy 
());
!                     break; 
!                     
!                 case OBJECT:
!                     ((map_object_with_gfx *)
!                      (*it).obj)->draw ((*it).x () * mapsquare_size + (*it).ox 
(),
!                                        (*it).y () * mapsquare_size + (*it).oy 
() - (*it).z());
!                     break;
!                     
!                 default:
!                     break; 
              }
!         }
!         
!         drawqueue.clear ();             
!         }
!         
!         
          if (gc.draw_grid)
          {
***************
*** 358,362 ****
          screen::show ();
          screen::clear (); 
- 
      }
      
--- 368,371 ----

Index: landmap.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/landmap.cc,v
retrieving revision 1.18.2.11
retrieving revision 1.18.2.12
diff -C2 -r1.18.2.11 -r1.18.2.12
*** landmap.cc  3 Apr 2002 16:03:20 -0000       1.18.2.11
--- landmap.cc  4 Apr 2002 18:10:54 -0000       1.18.2.12
***************
*** 37,40 ****
--- 37,45 ----
      if (oy() > mi.oy()) return false;
  
+     if (obj->type() == OBJECT) return true;
+     if (obj->type() == CHARACTER) return false;
+ //     if (z() + obj->current_state()->zsize < mi.z() + 
mi.obj->current_state()->zsize) return true;
+ //     if (z() + obj->current_state()->zsize > mi.z() + 
mi.obj->current_state()->zsize) return false;
+ 
  //     if ((y() * mapsquare_size) + oy() + mapsquare_size <=
  //         (mi.y() - (mi.obj->current_state()->area_height() - 1)) * 
mapsquare_size + mi.oy()) return true;
***************
*** 43,47 ****
  //         mapsquare_size + mi.y() * mapsquare_size + mi.oy()) return false;
  
- //     if (z() + obj->current_state()->zsize < mi.z() + 
mi.obj->current_state()->zsize) return true;
      // If the objects are at the same y position, we better
      // make an arbitrary test to make sure a moving object
--- 48,51 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]