Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 30 Jun 2011
Offline Last Active Jul 26 2012 10:54 PM

Topics I've Started

Loading swf files

21 July 2012 - 01:24 PM

Hello everyone,

An artist I am currently working with is having some trouble creating sprite sheets from .swf animations that she's recieving from another company. She is managing but I would like to help improve her work flow and create a tool. However, I am not familiar with .swf files and how to load them. I was hoping to find something I could use for a C# WinForm application. I did some research earlier and found "AxInterop.ShockwaveFlashObjects.dll" and "Interop.ShockwaveFlashObjects.dll". But I don't think I have the correct dll versions, it's always breaking on me, returning FileNotFoundException when I try using them.

The idea of the tool is to load in a .swf from a local file that I feed it from a dialog. Parse the information within the animation and start populating the new sprite sheet with the frames. After that animation is loaded and on the sheet the user can load another local .swf file. Once the sprite sheet is complete, then the user can save out the .png(or whatever format necessary) and at the same time create a .json file of all the animation data held within that sprite sheet for easy loading in the game engine. There are several tools that accomplish creating a spritesheet from .swf, but I have yet to come across a tool that does this for multiple animations/characters. The tools I've run into only create a sprite sheet for a single animation/character.

Overall, I just need to figure out how to load these .swf files so that I may get each frame's data.

Any help would be greatly appreciated, thank you.

Attaching/Parsing Scripts Functionality

02 February 2012 - 08:28 PM

Hello everyone,

Recently I have started a project of making tools for a game project of mine. One of those tools is a level/object editor. I want to be able to add a new script to extend the behaviors of an object that is created within my tool. What I'm thinking is there needs to be a template for that object class. In that object template it will call the script that was added and parse through it, adding behaviors to that current object. The scripts would be in C#, similar to Unity. I'm new to this so I was hoping someone might be able to point me in the right direction for this type of functionality. Such as, examples with similar functionality or some websites/books. A few moments ago I found an open source project called CodeWorker, which is a code parser and source code generator. I'm reading through it right now to make sure it's something I can use. My tools are WinForms with XNA. Thank you for the help. Posted Image

Problem with rendering a texture.

07 October 2011 - 11:42 AM

Good morning everyone,

Working on a side project of mine using OpenGL and ran into a problem with rendering a texture on the model I'm trying to animate. The model always shows up as completely black. I've bind the texture I'm trying to use to a quad and it rendered without a problem. This means that I'm loading/binding the texture correctly. I have also disabled lighting, and checked the texture coordinates I'm using which look fine. At the very least if the texture coordinates were wrong I should see something other than black. I have also checked glGetError and I'm not getting any errors. If anyone could point me in the right direction that would be great. Thank you.


establishProjectionMatrix(width, height);
glClearColor(1.0f, 1.0f, 0.0f, 1.0f);

glEnableClientState( GL_VERTEX_ARRAY );
//glEnableClientState( GL_NORMAL_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

mainCLight = new CLight(LSPOT);
mainCLight->setDiffuse(1.0f, 1.0f, 1.0f, 1.0f);
mainCLight->setPosition(0, 50, 0);


//Setup Scene
establishProjectionMatrix(windowWidth, windowHeight);

//TODO: remove
GLuint err = glGetError();


//Update the scene from mouse control
glTranslatef(translate.x, translate.y, zoom);
glRotatef(rotateX, 1.0f, 0.0f, 0.0f);
glRotatef(rotateY, 0.0f, 1.0f, 0.0f);
//Draw all lights in the scene
for(int i = 0; i < (int)CLight::lights.size(); i++)
	CLight* test = CLight::lights[i];
//Draw grid with no texture

//Draw the model we're animating
model.DrawModel(bRenderSkin, bRenderPoints, bRenderJoints);

//Draw Controls
glColor3f(1.0f, 1.0f, 1.0f);
setOrtho(windowWidth, windowHeight);


CModel Render()
//Draw Quad TODO: remove later

glBindTexture(GL_TEXTURE_2D, texHandle);

glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner  
glTexCoord2f(0, 0);
glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner  
glTexCoord2f(1, 0);
glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner  
glTexCoord2f(0, 1);
glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner  
glTexCoord2f(1, 1);
glEnd( );

//Draw Model

glVertexPointer( 3, GL_FLOAT, 0, &m_vMeshes[i]->GetVertices()[0] ); //NOTE: Remember the [0] at the end when using vectors
//glNormalPointer(GL_FLOAT, 0, &m_vMeshes[i]->GetNormals()[0]);
glTexCoordPointer(2, GL_FLOAT, 0, &m_vMeshes[i]->GetTexCoords()[0]);


glBindTexture(GL_TEXTURE_2D, texHandle);

glDrawElements( GL_TRIANGLES, (GLsizei)m_vMeshes[i]->GetIndices().size(), GL_UNSIGNED_INT, &m_vMeshes[i]->GetIndices()[0] );

Access Violation with glDrawElements

30 September 2011 - 10:38 AM

Good morning everyone,

Recently I've been working on a project using OpenGL and right now I've been trying to draw a model using arrays. I've looked around for postings with a similar problem to mine but nothing I've found has seemed to work or doesn't apply to my situation. I keep getting an Access Violation when I hit glDrawElements within my CModel class's draw(). The first time the draw code runs it doesn't hit that access violation so I'm wondering if I forgot to enable or disable something after that code runs. If anyone can shed some light on this it would help me a lot. Thank you.

In my Init() I use
glEnableClientState( GL_NORMAL_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

Here is the draw code for CModel
for(int i = m_vMeshes.size() - 1; i >= 0; --i)
		//Make sure texture is loaded, get handle
		std::string szTex; 
		int texHandle;

		//If the mesh has a texture
		if(m_vMeshes[i]->m_vTextureNames.size() != 0)
			szTex = "data/Textures/" + m_vMeshes[i]->m_vTextureNames[0];
			texHandle = CTextureManager::GetInstance()->GetTextureHandle(szTex.c_str()); //TODO: Move elsewhere

			//Bind Texture
			if(texHandle != -1)
				glBindTexture(GL_TEXTURE_2D, texHandle);

		//TODO: Add Translate code here based on input
			glNormalPointer(GL_FLOAT, 0, &m_vMeshes[i]->GetNormals()[0]); 
			glTexCoordPointer(2, GL_FLOAT, 0, &m_vMeshes[i]->GetTexCoords()[0]); 
			glVertexPointer( 3, GL_FLOAT, 0, &m_vMeshes[i]->GetVertices()[0] );
				glDrawElements( GL_TRIANGLES, (GLsizei)m_vMeshes[i]->GetIndices().size(), GL_UNSIGNED_INT, &m_vMeshes[i]->GetIndices()[0] );

		//Draw Points 
			for(unsigned int j = 0; j <  m_vMeshes[i]->GetVertices().size(); j++) 
				glVertex3f(m_vMeshes[i]->GetVertices()[j].v[0], m_vMeshes[i]->GetVertices()[j].v[1], m_vMeshes[i]->GetVertices()[j].v[2]); 

Memory Pool Manager Problem

30 June 2011 - 11:51 AM

Hello everyone,

Recently I have been asked to write up a memory manager, something I've never done. They gave me the header file that had no virtual functions and I couldn't make any changes to. The source file had a const int called POOLSIZE and a char array called pool which was the size of POOLSIZE. I couldn't add anymore static or global variables and any information I needed to save had to be within the pool. The main they sent allocated size of a long and 255 bytes for a string. What bothers me is they also said the numbers should be close to 65530 before allocating memory and 65483 after the memory was allocated. That's 47 byte difference for 259 bytes that was actually requested. POOLSIZE is also set to equal 65536 within the source so the first 6 bytes were used for something. Am I missing something here or is there some sort of trick I'm unaware of? Maybe, I'm just reading to much into this. Anyways, if you have any ideas on the subject I'm very interested in what everyone here thinks. And if anyone could point me in the right direction to solve this problem that would be great. Thank you.

P.S: Allocations are variable size and couldn't use functions that dynamically allocated memory during the program's execution.