ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.128 by root, Wed Jul 5 03:01:01 2006 UTC vs.
Revision 1.129 by root, Wed Jul 12 17:20:04 2006 UTC

463 463
464 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 464 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
465 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 465 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
466} 466}
467 467
468int
469in_destruct ()
470 CODE:
471 RETVAL = PL_main_cv == Nullcv;
472 OUTPUT:
473 RETVAL
474
468NV floor (NV x) 475NV floor (NV x)
469 476
470NV ceil (NV x) 477NV ceil (NV x)
471 478
472void 479void
624#endif 631#endif
625 632
626void 633void
627add_font (char *file) 634add_font (char *file)
628 CODE: 635 CODE:
629 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ 636 FcConfigAppFontAddFile (0, (const FcChar8 *)file);
630 637
631void 638void
632load_image_inline (SV *image_) 639load_image_inline (SV *image_)
633 ALIAS: 640 ALIAS:
634 load_image_file = 1 641 load_image_file = 1
676 683
677 surface2 = SDL_ConvertSurface (surface, &fmt, SDL_SWSURFACE); 684 surface2 = SDL_ConvertSurface (surface, &fmt, SDL_SWSURFACE);
678 685
679 assert (surface2->pitch == surface2->w * 4); 686 assert (surface2->pitch == surface2->w * 4);
680 687
688 SDL_LockSurface (surface2);
681 EXTEND (SP, 5); 689 EXTEND (SP, 6);
682 PUSHs (sv_2mortal (newSViv (surface2->w))); 690 PUSHs (sv_2mortal (newSViv (surface2->w)));
683 PUSHs (sv_2mortal (newSViv (surface2->h))); 691 PUSHs (sv_2mortal (newSViv (surface2->h)));
684 SDL_LockSurface (surface2);
685 PUSHs (sv_2mortal (newSVpvn (surface2->pixels, surface2->h * surface2->pitch))); 692 PUSHs (sv_2mortal (newSVpvn (surface2->pixels, surface2->h * surface2->pitch)));
686 SDL_UnlockSurface (surface2);
687 PUSHs (sv_2mortal (newSViv (surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA) ? GL_RGBA : GL_RGB))); 693 PUSHs (sv_2mortal (newSViv (surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA) ? GL_RGBA : GL_RGB)));
688 PUSHs (sv_2mortal (newSViv (GL_RGBA))); 694 PUSHs (sv_2mortal (newSViv (GL_RGBA)));
689 PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE))); 695 PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE)));
696 SDL_UnlockSurface (surface2);
690 697
691 SDL_FreeSurface (surface); 698 SDL_FreeSurface (surface);
692 SDL_FreeSurface (surface2); 699 SDL_FreeSurface (surface2);
693} 700}
694 701
764 default_font = self; 771 default_font = self;
765 772
766MODULE = CFClient PACKAGE = CFClient::Layout 773MODULE = CFClient PACKAGE = CFClient::Layout
767 774
768void 775void
769clear_font_cache () 776reset_glyph_cache ()
770 CODE: 777 CODE:
771 tc_clear (); 778 tc_clear ();
772 779
773CFClient::Layout 780CFClient::Layout
774new (SV *class) 781new (SV *class)
872 if (run && shape_attr_p (run)) 879 if (run && shape_attr_p (run))
873 { 880 {
874 PangoRectangle extents; 881 PangoRectangle extents;
875 pango_layout_iter_get_run_extents (iter, 0, &extents); 882 pango_layout_iter_get_run_extents (iter, 0, &extents);
876 883
884 EXTEND (SP, 2);
877 PUSHs (sv_2mortal (newSViv (PANGO_PIXELS (extents.x)))); 885 PUSHs (sv_2mortal (newSViv (PANGO_PIXELS (extents.x))));
878 PUSHs (sv_2mortal (newSViv (PANGO_PIXELS (extents.y)))); 886 PUSHs (sv_2mortal (newSViv (PANGO_PIXELS (extents.y))));
879 } 887 }
880 } 888 }
881 while (pango_layout_iter_next_run (iter)); 889 while (pango_layout_iter_next_run (iter));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines