Archived

This topic is now archived and is closed to further replies.

Kranar

End of file not expected

Recommended Posts

This is what I have, and when I try and compile it, I get the following error on the line: #include "Tile.h" This is Tile.cpp
#include "Tile.h"

Tile::Tile(void) {
	currentFrame = 0;
	timer = 0;
	alpha = 255;
};

Tile::~Tile(void) {
	for(int x = 0; x < int(bitmap.size()); x++) {
		destroy_bitmap(bitmap[x]);
	}
}

void Tile::Show(int x, int y, int alpha) {
	if(bitmap.size() > 0) {
		Manager.Draw(bitmap[currentFrame], x, y);
	}
}

void Tile::addFrame(char* path) {
	BITMAP *t = load_pcx(path, NULL);
	if(t != NULL) {
		resX = t->w; resY = t->h;
		bitmap.push_back(t);
	}
}

void Tile::addFrame(BITMAP *t) {
	BITMAP *x = create_bitmap(t->w, t->h);
	draw_sprite(x, t, 0, 0);
	if(t != NULL) {
		resX = x->w; resY = x->h;
		bitmap.push_back(x);
	}
}

int Tile::getFrames() {
	return int(bitmap.size());
}

int Tile::getCurrentFrame() {
	return currentFrame;
}
This is externals.h
#include <allegro.h>
#include <winalleg.h>
#include <string>
#include <vector>
#include "System.h"
#include "TileMap.h"
#include "Tile.h"

using namespace std;

extern class System Manager;
And finally this is Tile.h
   
#pragma once
#include "externals.h"

class Tile {
public:
	Tile(void);
	~Tile(void);
	void Show(int x, int y, int alpha = -1);
	void addFrame(char* path);
	void addFrame(BITMAP *t);
	int getFrames();
	int getCurrentFrame();
private:
	int				resX, resY;
	vector<BITMAP*>	bitmap;
	int				currentFrame;
	int				timer;
	int				alpha;
};
I am using MSVC++ .NET if that means anything. Every other class compiles fine, just my Tile class won't compile because of this end of file not expected error. [edited by - Kranar on October 21, 2003 6:18:30 PM]

Share this post


Link to post
Share on other sites