From 02f3ab2ac576c166ee7680392e79932ee330ccc3 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 26 Oct 2009 00:19:11 -0700 Subject: [PATCH] Fixed subtract_do --- abc.cpp | 82 ++++++++++++++++++------------------------------ abc.h | 1 + abc_codesynt.cpp | 2 +- abc_opcodes.cpp | 73 +++++++++++++++++++++++++++++------------- asobjects.cpp | 12 ++++--- flashdisplay.cpp | 23 +++++++++++--- flashdisplay.h | 7 +++++ flashevents.cpp | 10 ++++-- geometry.cpp | 14 ++++----- geometry.h | 10 +++--- swftypes.cpp | 6 ++-- swftypes.h | 4 +-- tags.cpp | 28 ++++++++--------- tags.h | 10 +++--- 14 files changed, 160 insertions(+), 122 deletions(-) diff --git a/abc.cpp b/abc.cpp index bdf2e9833d..fd5a812fa2 100644 --- a/abc.cpp +++ b/abc.cpp @@ -129,7 +129,7 @@ void ABCVm::registerClasses() Global.setVariableByQName("InteractiveObject","flash.display",new ASObject), Global.setVariableByQName("DisplayObjectContainer","flash.display",Class::getClass()); Global.setVariableByQName("Sprite","flash.display",Class::getClass()); - Global.setVariableByQName("Shape","flash.display",Class::getClass("Shape")); + Global.setVariableByQName("Shape","flash.display",Class::getClass()); Global.setVariableByQName("TextField","flash.text",new ASObject); Global.setVariableByQName("TextFormat","flash.text",new ASObject); @@ -148,6 +148,7 @@ void ABCVm::registerClasses() Global.setVariableByQName("Rectangle","flash.geom",new ASObject); Global.setVariableByQName("Matrix","flash.geom",Class::getClass("Matrix")); + Global.setVariableByQName("Point","flash.geom",Class::getClass("Point")); Global.setVariableByQName("EventDispatcher","flash.events",Class::getClass()); Global.setVariableByQName("Event","flash.events",Class::getClass()); @@ -871,8 +872,7 @@ void ABCContext::buildClassAndInjectBase(const string& s, IInterface* base,argum if(derived_class_tmp->class_index!=-1) { LOG(CALLS,"Building instance traits"); - for(int i=0;iclass_index].trait_count;i++) - buildTrait(obj,&instances[derived_class_tmp->class_index].traits[i]); + buildClassTraits(obj, derived_class_tmp->class_index); LOG(CALLS,"Calling Instance init on " << s); //args->incRef(); @@ -1283,6 +1283,12 @@ tiny_string ABCContext::getString(unsigned int s) const return ""; } +inline void ABCContext::buildClassTraits(ASObject* obj, int class_index) +{ + for(int i=0;iname,NULL); @@ -1317,68 +1323,42 @@ void ABCContext::buildTrait(ASObject* obj, const traits_info* t, IFunction* defe case traits_info::Getter: { LOG(CALLS,"Getter trait: " << ns << "::" << name << " #" << t->method); - IFunction* f=NULL; - /*//Hack, try to find this on the most derived variables - obj_var* var=obj->findObjVar(name,ns,false); - if(var && var->getter) //Ok, it seems that we have been overridden, set this in our map - { - LOG(CALLS,"HACK: overridden getter"); - f=static_cast(var->getter->clone()); - f->bind(obj->mostDerived); - } - - if(f==NULL)*/ - { - //syntetize method and create a new LLVM function object - method_info* m=&methods[t->method]; - f=new SyntheticFunction(m); - } + //syntetize method and create a new LLVM function object + method_info* m=&methods[t->method]; + IFunction* f=new SyntheticFunction(m); + obj->setGetterByQName(name,ns,f); + //We should inherit the setter from the hierarchy + obj_var* var=obj->Variables.findObjVar(name,ns,obj->max_level-1,false); + if(var && var->setter) //Ok, also set the inherited setter + obj->setSetterByQName(name,ns,var->setter); + LOG(CALLS,"End Getter trait: " << ns << "::" << name); break; } case traits_info::Setter: { LOG(CALLS,"Setter trait: " << ns << "::" << name << " #" << t->method); - IFunction* f=NULL; - /*//Hack, try to find this on the most derived variables - obj_var* var=obj->findObjVar(name,ns,false); - if(var && var->getter) //Ok, it seems that we have been overridden, set this in our map - { - LOG(CALLS,"HACK: overridden getter"); - f=static_cast(var->getter->clone()); - f->bind(obj->mostDerived); - } - - if(f==NULL)*/ - { - //syntetize method and create a new LLVM function object - method_info* m=&methods[t->method]; - f=new SyntheticFunction(m); - } + //syntetize method and create a new LLVM function object + method_info* m=&methods[t->method]; + IFunction* f=new SyntheticFunction(m); + obj->setSetterByQName(name,ns,f); + //We should inherit the setter from the hierarchy + obj_var* var=obj->Variables.findObjVar(name,ns,obj->max_level-1,false); + if(var && var->getter) //Ok, also set the inherited setter + obj->setGetterByQName(name,ns,var->getter); + LOG(CALLS,"End Setter trait: " << ns << "::" << name); break; } case traits_info::Method: { LOG(CALLS,"Method trait: " << ns << "::" << name << " #" << t->method); - IFunction* f=NULL; - /*//Hack, try to find this on the most derived variables - obj_var* var=obj->findObjVar(name,ns,false); - if(var && var->getter) //Ok, it seems that we have been overridden, set this in our map - { - LOG(CALLS,"HACK: overridden getter"); - f=static_cast(var->getter->clone()); - f->bind(obj->mostDerived); - } - - if(f==NULL)*/ - { - //syntetize method and create a new LLVM function object - method_info* m=&methods[t->method]; - f=new SyntheticFunction(m); - } + //syntetize method and create a new LLVM function object + method_info* m=&methods[t->method]; + IFunction* f=new SyntheticFunction(m); + obj->setVariableByQName(name,ns,f); LOG(CALLS,"End Method trait: " << ns << "::" << name); break; diff --git a/abc.h b/abc.h index 26348d9419..752f7c90ed 100644 --- a/abc.h +++ b/abc.h @@ -372,6 +372,7 @@ friend class method_info; tiny_string getString(unsigned int s) const; //Qname getQname(unsigned int m, call_context* th=NULL) const; void buildTrait(ASObject* obj, const traits_info* t, IFunction* deferred_initialization=NULL); + void buildClassTraits(ASObject* obj, int class_index); void buildClassAndInjectBase(const std::string& n, IInterface*, arguments* a); multiname* getMultiname(unsigned int m, call_context* th); static multiname* s_getMultiname(call_context*, ASObject*, int m); diff --git a/abc_codesynt.cpp b/abc_codesynt.cpp index bd328343e4..f1df8dd1c5 100644 --- a/abc_codesynt.cpp +++ b/abc_codesynt.cpp @@ -176,7 +176,7 @@ typed_opcode_handler ABCVm::opcode_table_number_t[]={ {"subtract",(void*)&ABCVm::subtract,ARGS_OBJ_OBJ}, {"subtract_oi",(void*)&ABCVm::subtract_oi,ARGS_OBJ_INT}, {"subtract_io",(void*)&ABCVm::subtract_io,ARGS_INT_OBJ}, - {"subtract_do",(void*)&ABCVm::subtract_io,ARGS_NUMBER_OBJ} + {"subtract_do",(void*)&ABCVm::subtract_do,ARGS_NUMBER_OBJ} }; typed_opcode_handler ABCVm::opcode_table_void[]={ diff --git a/abc_opcodes.cpp b/abc_opcodes.cpp index 663b7eebda..846eae3906 100644 --- a/abc_opcodes.cpp +++ b/abc_opcodes.cpp @@ -337,7 +337,6 @@ ASObject* ABCVm::getProperty(ASObject* obj, multiname* name) if(owner==NULL) { LOG(NOT_IMPLEMENTED,"Property not found " << *name); - //abort(); ret=new Undefined; } else @@ -469,7 +468,7 @@ number_t ABCVm::multiply_oi(ASObject* val2, intptr_t val1) double num1=val1; double num2=val2->toNumber(); val2->decRef(); - LOG(CALLS,"multiply " << num1 << '*' << num2); + LOG(CALLS,"multiply_oi " << num1 << '*' << num2); return num1*num2; } @@ -682,6 +681,12 @@ number_t ABCVm::subtract_oi(ASObject* val2, intptr_t val1) number_t ABCVm::subtract_do(number_t val2, ASObject* val1) { + if(val1->getObjectType()==T_UNDEFINED) + { + //HACK + LOG(NOT_IMPLEMENTED,"subtract: HACK"); + return 0; + } number_t num2=val2; number_t num1=val1->toNumber(); @@ -702,6 +707,13 @@ number_t ABCVm::subtract_io(intptr_t val2, ASObject* val1) number_t ABCVm::subtract(ASObject* val2, ASObject* val1) { + if(val1->getObjectType()==T_UNDEFINED || + val2->getObjectType()==T_UNDEFINED) + { + //HACK + LOG(NOT_IMPLEMENTED,"subtract: HACK"); + return 0; + } int num2=val2->toInt(); int num1=val1->toInt(); @@ -1302,17 +1314,11 @@ ASObject* ABCVm::lessEquals(ASObject* obj1, ASObject* obj2) void ABCVm::initProperty(call_context* th, int n) { - static int count=0; ASObject* value=th->runtime_stack_pop(); multiname* name=th->context->getMultiname(n,th); LOG(CALLS, "initProperty " << *name ); - if(name->name_s=="container") - count++; ASObject* obj=th->runtime_stack_pop(); -// if(count==2) -// abort(); - obj->setVariableByMultiname(*name,value); obj->decRef(); @@ -1327,16 +1333,23 @@ void ABCVm::callSuper(call_context* th, int n, int m) multiname* name=th->context->getMultiname(n,th); LOG(NOT_IMPLEMENTED,"callSuper " << *name << ' ' << m); - ASObject* receiver=th->runtime_stack_pop(); - abort(); - /*ASObject* obj; - if(receiver->super) - obj=receiver->super; - else - obj=receiver; + ASObject* obj=th->runtime_stack_pop(); + //HACK (nice) set the max level to the current actual prototype before looking up the member + assert(obj->actualPrototype); + int oldlevel=obj->max_level; + obj->max_level=obj->actualPrototype->max_level-1; + //Store the old prototype + Class_base* old_prototype=obj->actualPrototype; + + //Move the object protoype and level up + obj->actualPrototype=old_prototype->super; ASObject* owner; ASObject* o=obj->getVariableByMultiname(*name,owner); + + //Set back the original max_level + obj->max_level=oldlevel; + if(owner) { //If o is already a function call it, otherwise find the Call method @@ -1351,7 +1364,7 @@ void ABCVm::callSuper(call_context* th, int n, int m) LOG(NOT_IMPLEMENTED,"We got a Undefined function"); th->runtime_stack_push(new Undefined); } - else if(o->getObjectType()==T_DEFINABLE) +/* else if(o->getObjectType()==T_DEFINABLE) { LOG(CALLS,"We got a function not yet valid"); Definable* d=static_cast(o); @@ -1382,16 +1395,23 @@ void ABCVm::callSuper(call_context* th, int n, int m) // LOG(NOT_IMPLEMENTED,"No such function, returning Undefined"); // th->runtime_stack_push(new Undefined); //} - } + }*/ + else + abort(); } else { LOG(NOT_IMPLEMENTED,"Calling an undefined function"); th->runtime_stack_push(new Undefined); } - LOG(CALLS,"End of calling " << name); - receiver->decRef(); - delete[] args;*/ + LOG(CALLS,"End of calling " << *name); + + //Reset prototype to its previous value + assert(obj->actualPrototype==old_prototype->super); + obj->actualPrototype=old_prototype; + + obj->decRef(); + delete[] args; } void ABCVm::callSuperVoid(call_context* th, int n, int m) @@ -1475,13 +1495,22 @@ void ABCVm::callSuperVoid(call_context* th, int n, int m) void ABCVm::isTypelate(call_context* th) { - LOG(NOT_IMPLEMENTED,"isTypelate: returing true"); + LOG(NOT_IMPLEMENTED,"isTypelate"); ASObject* type=th->runtime_stack_pop(); ASObject* obj=th->runtime_stack_pop(); + if(obj->getObjectType()==T_UNDEFINED) + { + th->runtime_stack_push(new Boolean(false)); + cout << "false" << endl; + } + else + { + cout << "true" << endl; + th->runtime_stack_push(new Boolean(true)); + } // cout << "Name " << type->class_name << " type " << type->getObjectType() << endl; // cout << "Name " << obj->class_name << " type " << obj->getObjectType() << endl; // if(type->class_name==obj->class_name) - th->runtime_stack_push(new Boolean(true)); // else // th->runtime_stack_push(new Boolean(false)); } diff --git a/asobjects.cpp b/asobjects.cpp index 640f85bbb3..0a8cfefdc8 100644 --- a/asobjects.cpp +++ b/asobjects.cpp @@ -969,7 +969,10 @@ ASObject* SyntheticFunction::call(ASObject* obj, arguments* args) int i=0; if(args) { - for(i;isize();i++) + int args_len=min(args->size(),mi->numArgs()); + if(args_len>mi->numArgs()) + assert(mi->needsRest()); + for(i;ilocals[i+1]=args->at(i); cc->locals[i+1]->incRef(); @@ -983,10 +986,9 @@ ASObject* SyntheticFunction::call(ASObject* obj, arguments* args) if(mi->needsRest()) //TODO { - abort(); -/* ASArray* rest=new ASArray(); - rest->_constructor(rest,NULL); - cc->locals[mi->numArgs()+1]=rest;*/ + Array* rest=Class::getInstanceS(); + rest->_constructor(rest->obj,NULL); + cc->locals[mi->numArgs()+1]=rest->obj; /*llvm::Value* rest=Builder.CreateCall(ex->FindFunctionNamed("createRest")); constant = llvm::ConstantInt::get(int_type, param_count+1); t=Builder.CreateGEP(locals,constant); diff --git a/flashdisplay.cpp b/flashdisplay.cpp index 2ffafff5c5..d3f20b92b9 100644 --- a/flashdisplay.cpp +++ b/flashdisplay.cpp @@ -42,6 +42,7 @@ REGISTER_CLASS_NAME(DisplayObject); REGISTER_CLASS_NAME(DisplayObjectContainer); REGISTER_CLASS_NAME(Sprite); REGISTER_CLASS_NAME(Loader); +REGISTER_CLASS_NAME(Shape); void LoaderInfo::sinit(Class_base* c) { @@ -348,6 +349,7 @@ void MovieClip::sinit(Class_base* c) { assert(c->constructor==NULL); c->constructor=new Function(_constructor); + c->super=Class::getClass(); } MovieClip::MovieClip():_framesloaded(0),_totalframes(1),cur_frame(&dynamicDisplayList),initialized(false) @@ -568,9 +570,7 @@ void MovieClip::initialize() DisplayObject::DisplayObject():height(100),width(100),loaderInfo(NULL) { -/* setVariableByQName("Call","",new Function(_call)); - setGetterByQName("width","",new Function(_getWidth)); - setGetterByQName("height","",new Function(_getHeight));*/ +// setVariableByQName("Call","",new Function(_call)); } void DisplayObject::sinit(Class_base* c) @@ -590,7 +590,8 @@ ASFUNCTIONBODY(DisplayObject,_constructor) obj->setVariableByQName("loaderInfo","",th->loaderInfo->obj); } - //This should come from DisplayObject + obj->setGetterByQName("width","",new Function(_getWidth)); + obj->setGetterByQName("height","",new Function(_getHeight)); //setVariableByQName("getBounds","",new Function(getBounds)); //setVariableByQName("root","",this); //setVariableByQName("stage","",this); @@ -612,6 +613,7 @@ void DisplayObjectContainer::sinit(Class_base* c) { assert(c->constructor==NULL); c->constructor=new Function(_constructor); + c->super=Class::getClass(); } DisplayObjectContainer::DisplayObjectContainer() @@ -628,3 +630,16 @@ ASFUNCTIONBODY(DisplayObjectContainer,_getNumChildren) { return new Integer(0);; } + +void Shape::sinit(Class_base* c) +{ + assert(c->constructor==NULL); + c->constructor=new Function(_constructor); + c->super=Class::getClass(); +} + +ASFUNCTIONBODY(Shape,_constructor) +{ + DisplayObject::_constructor(obj,NULL); +} + diff --git a/flashdisplay.h b/flashdisplay.h index 91139cc2fc..cafe693c47 100644 --- a/flashdisplay.h +++ b/flashdisplay.h @@ -70,6 +70,13 @@ class DisplayObjectContainer: public DisplayObject ASFUNCTION(_getNumChildren); }; +class Shape: public DisplayObject +{ +public: + static void sinit(Class_base* c); + ASFUNCTION(_constructor); +}; + class LoaderInfo: public EventDispatcher { public: diff --git a/flashevents.cpp b/flashevents.cpp index 6179787903..14814fe33a 100644 --- a/flashevents.cpp +++ b/flashevents.cpp @@ -66,15 +66,19 @@ KeyboardEvent::KeyboardEvent():Event("keyboardEvent") MouseEvent::MouseEvent():Event("mouseEvent") { -/* setVariableByQName("MOUSE_DOWN","",new ASString("mouseDown")); - setVariableByQName("MOUSE_UP","",new ASString("mouseUp")); - setVariableByQName("CLICK","",new ASString("click"));*/ +// setVariableByQName("MOUSE_UP","",new ASString("mouseUp")); } void MouseEvent::sinit(Class_base* c) { // assert(c->constructor==NULL); // c->constructor=new Function(_constructor); + c->setVariableByQName("CLICK","",new ASString("click")); + c->setVariableByQName("DOUBLE_CLICK","",new ASString("doubleClick")); + c->setVariableByQName("MOUSE_DOWN","",new ASString("mouseDown")); + c->setVariableByQName("MOUSE_OUT","",new ASString("mouseOut")); + c->setVariableByQName("MOUSE_OVER","",new ASString("mouseOver")); + c->setVariableByQName("MOUSE_UP","",new ASString("mouseUp")); } IOErrorEvent::IOErrorEvent():Event("IOErrorEvent") diff --git a/geometry.cpp b/geometry.cpp index 3cec6a3c15..e67c4db88e 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -33,7 +33,7 @@ using namespace std; * * \param x Optional x translation * * \param y Optional y translation */ -void Shape::Render(int x, int y) const +void GeomShape::Render(int x, int y) const { if(outline.empty()) { @@ -138,7 +138,7 @@ bool FilterIterator::operator!=(FilterIterator& i) return i.it!=it; } -void Shape::dumpEdges() +void GeomShape::dumpEdges() { ofstream f("edges.dat"); @@ -147,7 +147,7 @@ void Shape::dumpEdges() f.close(); } -void Shape::dumpInterior() +void GeomShape::dumpInterior() { ofstream f("interior.dat"); @@ -163,7 +163,7 @@ void Shape::dumpInterior() f.close(); } -void Shape::SetStyles(FILLSTYLE* styles) +void GeomShape::SetStyles(FILLSTYLE* styles) { static FILLSTYLE* clearStyle=NULL; if(!clearStyle) @@ -182,7 +182,7 @@ void Shape::SetStyles(FILLSTYLE* styles) } } -void Shape::BuildFromEdges(FILLSTYLE* styles) +void GeomShape::BuildFromEdges(FILLSTYLE* styles) { style=NULL; if(outline.empty()) @@ -377,7 +377,7 @@ inline bool pointInTriangle(const Vector2& P,const Vector2& A,const Vector2& B,c return (u >= 0) && (v>= 0) && (u + v <= 1); } -void Shape::TessellateSimple() +void GeomShape::TessellateSimple() { vector P=outline; int i=0; @@ -440,7 +440,7 @@ void Shape::TessellateSimple() } //Shape are compared using the minimum vertex -bool Shape::operator<(const Shape& r) const +bool GeomShape::operator<(const GeomShape& r) const { Vector2 vl=*min_element(outline.begin(),outline.end()); Vector2 vr=*min_element(r.outline.begin(),r.outline.end()); diff --git a/geometry.h b/geometry.h index 863b79bc25..67e06059c7 100644 --- a/geometry.h +++ b/geometry.h @@ -26,7 +26,7 @@ class Path; class Vector2; -class Shape; +class GeomShape; class FilterIterator { @@ -80,7 +80,7 @@ struct arrayElem class Edge { - friend class Shape; + friend class GeomShape; public: Vector2 p1; Vector2 p2; @@ -135,7 +135,7 @@ class Edge } }; -class Shape +class GeomShape { friend class DefineTextTag; friend class DefineShape2Tag; @@ -149,7 +149,7 @@ friend class DefineShape3Tag; std::vector interior; std::vector > triangle_strips; std::vector outline; - std::vector sub_shapes; + std::vector sub_shapes; std::vector edges; bool closed; @@ -163,7 +163,7 @@ friend class DefineShape3Tag; void Render(int x=0, int y=0) const; void BuildFromEdges(FILLSTYLE* styles); - bool operator<(const Shape& r) const; + bool operator<(const GeomShape& r) const; }; diff --git a/swftypes.cpp b/swftypes.cpp index a27bda6633..57e8832591 100644 --- a/swftypes.cpp +++ b/swftypes.cpp @@ -370,7 +370,6 @@ void ASObject::setVariableByMultiname(const multiname& name, ASObject* o) intptr_t ASObject::getVariableByMultiname_i(const multiname& name, ASObject*& owner) { - abort(); ASObject* ret=getVariableByMultiname(name,owner); if(ret) return ret->toInt(); @@ -403,8 +402,9 @@ ASObject* ASObject::getVariableByMultiname(const multiname& name, ASObject*& own else { owner=this; - assert(obj->var); - return obj->var; + //assert(obj->var); + //HACK: for enabled on youtube + return (obj->var)?obj->var:new Undefined; } } else diff --git a/swftypes.h b/swftypes.h index 56d9ca82e9..d4ee10db6c 100644 --- a/swftypes.h +++ b/swftypes.h @@ -802,7 +802,7 @@ class FILLSTYLE friend class DefineTextTag; friend class DefineShape2Tag; friend class DefineShape3Tag; - friend class Shape; + friend class GeomShape; private: int version; UI8 FillStyleType; @@ -973,7 +973,7 @@ class TEXTRECORD TEXTRECORD(DefineTextTag* p):parent(p){} }; -class Shape; +class GeomShape; class SHAPE { diff --git a/tags.cpp b/tags.cpp index 3229eec6b9..999fc471c1 100644 --- a/tags.cpp +++ b/tags.cpp @@ -438,7 +438,7 @@ void DefineTextTag::Render() it2 = it->GlyphEntries.begin(); for(it2;it2!=(it->GlyphEntries.end());it2++) { - vector new_shapes; + vector new_shapes; font->genGlyphShape(new_shapes,it2->GlyphIndex); for(int i=0;i& shapes); +void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes); void DefineMorphShapeTag::Render() { - std::vector < Shape > shapes; + std::vector < GeomShape > shapes; SHAPERECORD* cur=&(EndEdges.ShapeRecords); FromShaperecordListToShapeVector(cur,shapes); @@ -600,7 +600,7 @@ void DefineMorphShapeTag::Render() glClearColor(1,1,1,0); glClear(GL_COLOR_BUFFER_BIT); - std::vector < Shape >::iterator it=shapes.begin(); + std::vector < GeomShape >::iterator it=shapes.begin(); for(it;it!=shapes.end();it++) it->Render(); @@ -653,7 +653,7 @@ void DefineShapeTag::Render() glPushMatrix(); // glMultMatrixf(matrix); - std::vector < Shape >::iterator it=cached.begin(); + std::vector < GeomShape >::iterator it=cached.begin(); for(it;it!=cached.end();it++) it->Render(); @@ -702,7 +702,7 @@ void DefineShape2Tag::Render() //Apply local transformation glPushMatrix(); - std::vector < Shape >::iterator it=cached.begin(); + std::vector < GeomShape >::iterator it=cached.begin(); for(it;it!=cached.end();it++) { if(it->color >= Shapes.FillStyles.FillStyleCount) @@ -757,7 +757,7 @@ void DefineShape4Tag::Render() glClearColor(1,1,1,0); glClear(GL_COLOR_BUFFER_BIT); - std::vector < Shape >::iterator it=cached.begin(); + std::vector < GeomShape >::iterator it=cached.begin(); for(it;it!=cached.end();it++) it->Render(); @@ -821,7 +821,7 @@ void DefineShape3Tag::Render() glClearColor(1,1,1,0); glClear(GL_COLOR_BUFFER_BIT); - std::vector < Shape >::iterator it=cached.begin(); + std::vector < GeomShape >::iterator it=cached.begin(); for(it;it!=cached.end();it++) { if(it->color >= Shapes.FillStyles.FillStyleCount) @@ -914,7 +914,7 @@ void FromShaperecordListToDump(SHAPERECORD* cur) * * \param cur SHAPERECORD list head * * \param shapes a vector to be populated with the shapes */ -void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes) +void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes) { int startX=0; int startY=0; @@ -986,7 +986,7 @@ void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes) { //cout << "Adding edge to new shape " << shapes.size() << endl; //cout << p1 << p2 << endl; - shapes.push_back(Shape()); + shapes.push_back(GeomShape()); shapes.back().outline.push_back(p1); shapes.back().outline.push_back(p2); shapes.back().color=color; @@ -1066,7 +1066,7 @@ void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes) //cout << "Adding edge to new shape" << endl; //cout << p1 << p2 << endl; //cout << p2 << p3 << endl; - shapes.push_back(Shape()); + shapes.push_back(GeomShape()); shapes.back().outline.push_back(p1); shapes.back().outline.push_back(p2); shapes.back().outline.push_back(p3); @@ -1150,7 +1150,7 @@ void FromShaperecordListToShapeVector(SHAPERECORD* cur, vector& shapes) sort(shapes.begin(),shapes.end()); } -void DefineFont3Tag::genGlyphShape(vector& s, int glyph) +void DefineFont3Tag::genGlyphShape(vector& s, int glyph) { SHAPE& shape=GlyphShapeTable[glyph]; SHAPERECORD* cur=&(shape.ShapeRecords); @@ -1196,7 +1196,7 @@ void DefineFont3Tag::genGlyphShape(vector& s, int glyph) s.back().graphic.stroked=false;*/ } -void DefineFont2Tag::genGlyphShape(vector& s, int glyph) +void DefineFont2Tag::genGlyphShape(vector& s, int glyph) { SHAPE& shape=GlyphShapeTable[glyph]; SHAPERECORD* cur=&(shape.ShapeRecords); @@ -1238,7 +1238,7 @@ void DefineFont2Tag::genGlyphShape(vector& s, int glyph) s.back().graphic.stroked=false;*/ } -void DefineFontTag::genGlyphShape(vector& s,int glyph) +void DefineFontTag::genGlyphShape(vector& s,int glyph) { SHAPE& shape=GlyphShapeTable[glyph]; SHAPERECORD* cur=&(shape.ShapeRecords); diff --git a/tags.h b/tags.h index ed7ec79d0b..b5297fe50a 100644 --- a/tags.h +++ b/tags.h @@ -85,7 +85,7 @@ class DisplayListTag: public Tag class DictionaryTag: public Tag { protected: - std::vector cached; + std::vector cached; public: DictionaryTag(RECORDHEADER h,std::istream& s):Tag(h,s){ } virtual TAGTYPE getType(){ return DICT_TAG; } @@ -382,7 +382,7 @@ class FontTag: public DictionaryTag, public ASFont UI16 FontID; public: FontTag(RECORDHEADER h,std::istream& s):DictionaryTag(h,s){} - virtual void genGlyphShape(std::vector& s, int glyph)=0; + virtual void genGlyphShape(std::vector& s, int glyph)=0; virtual TAGTYPE getType(){ return DICT_TAG; } }; @@ -396,7 +396,7 @@ class DefineFontTag: public FontTag public: DefineFontTag(RECORDHEADER h, std::istream& in); virtual int getId(){ return FontID; } - virtual void genGlyphShape(std::vector& s, int glyph); + virtual void genGlyphShape(std::vector& s, int glyph); }; class DefineFontInfoTag: public Tag @@ -436,7 +436,7 @@ class DefineFont2Tag: public FontTag public: DefineFont2Tag(RECORDHEADER h, std::istream& in); virtual int getId(){ return FontID; } - virtual void genGlyphShape(std::vector& s, int glyph); + virtual void genGlyphShape(std::vector& s, int glyph); }; class DefineFont3Tag: public DefineFont2Tag @@ -444,7 +444,7 @@ class DefineFont3Tag: public DefineFont2Tag public: DefineFont3Tag(RECORDHEADER h, std::istream& in):DefineFont2Tag(h,in){} virtual int getId(){ return FontID; } - virtual void genGlyphShape(std::vector& s, int glyph); + virtual void genGlyphShape(std::vector& s, int glyph); }; class DefineTextTag: public DictionaryTag, public IDisplayListElem