
Advertisement
shawk08033

Content Count
17 
Joined

Last visited
Posts posted by shawk08033


MapSprite[x] = UsedSprite[n] will always be setting MapSprite[x] to point to UsedSprite[0] or UsedSprite[1]. UsedSprite[0]'s last update was 192,320. UsedSprite[1]'s last update was 256, 384.
You can see stepbystep what is happening by changing "spritelog << n << "Loading into " << x << " at " << i*64 << "," << y*64 << std::endl;" to
"for (int t = 0; t < x; t++) spritelog << n << "Currently in " << t << " is " << MapSprite[t]>X << "," << MapSprite[t]>Y << std::endl;"
Minor quibble: You probably shouldn't call Load() from a ctor, but should use an Init() or such. Very bad practice to do disk I/O in a constructor.
So the output it gives me when I do that is:
Sprites are loaded1Currently in 0 is 0,00Currently in 0 is 128,00Currently in 1 is 64,00Currently in 0 is 192,00Currently in 1 is 64,00Currently in 2 is 192,01Currently in 0 is 192,01Currently in 1 is 256,01Currently in 2 is 192,01Currently in 3 is 192,01Currently in 0 is 192,01Currently in 1 is 0,641Currently in 2 is 192,01Currently in 3 is 192,01Currently in 4 is 0,640Currently in 0 is 64,640Currently in 1 is 0,640Currently in 2 is 64,640Currently in 3 is 64,640Currently in 4 is 0,640Currently in 5 is 0,640Currently in 0 is 128,640Currently in 1 is 0,640Currently in 2 is 128,640Currently in 3 is 128,640Currently in 4 is 0,640Currently in 5 is 0,640Currently in 6 is 128,640Currently in 0 is 192,640Currently in 1 is 0,640Currently in 2 is 192,640Currently in 3 is 192,640Currently in 4 is 0,640Currently in 5 is 0,640Currently in 6 is 192,640Currently in 7 is 192,641Currently in 0 is 192,641Currently in 1 is 256,641Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 256,641Currently in 5 is 256,641Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 0 is 192,641Currently in 1 is 0,1281Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 0,1281Currently in 5 is 0,1281Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 9 is 0,1281Currently in 0 is 192,641Currently in 1 is 64,1281Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 64,1281Currently in 5 is 64,1281Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 9 is 64,1281Currently in 10 is 64,1281Currently in 0 is 192,641Currently in 1 is 128,1281Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 128,1281Currently in 5 is 128,1281Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 9 is 128,1281Currently in 10 is 128,1281Currently in 11 is 128,1281Currently in 0 is 192,641Currently in 1 is 192,1281Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 192,1281Currently in 5 is 192,1281Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 9 is 192,1281Currently in 10 is 192,1281Currently in 11 is 192,1281Currently in 12 is 192,1281Currently in 0 is 192,641Currently in 1 is 256,1281Currently in 2 is 192,641Currently in 3 is 192,641Currently in 4 is 256,1281Currently in 5 is 256,1281Currently in 6 is 192,641Currently in 7 is 192,641Currently in 8 is 192,641Currently in 9 is 256,1281Currently in 10 is 256,1281Currently in 11 is 256,1281Currently in 12 is 256,1281Currently in 13 is 256,1280Currently in 0 is 0,1920Currently in 1 is 256,1280Currently in 2 is 0,1920Currently in 3 is 0,1920Currently in 4 is 256,1280Currently in 5 is 256,1280Currently in 6 is 0,1920Currently in 7 is 0,1920Currently in 8 is 0,1920Currently in 9 is 256,1280Currently in 10 is 256,1280Currently in 11 is 256,1280Currently in 12 is 256,1280Currently in 13 is 256,1280Currently in 14 is 256,1280Currently in 0 is 64,1920Currently in 1 is 256,1280Currently in 2 is 64,1920Currently in 3 is 64,1920Currently in 4 is 256,1280Currently in 5 is 256,1280Currently in 6 is 64,1920Currently in 7 is 64,1920Currently in 8 is 64,1920Currently in 9 is 256,1280Currently in 10 is 256,1280Currently in 11 is 256,1280Currently in 12 is 256,1280Currently in 13 is 256,1280Currently in 14 is 256,1280Currently in 15 is 64,1920Currently in 0 is 128,1920Currently in 1 is 256,1280Currently in 2 is 128,1920Currently in 3 is 128,1920Currently in 4 is 256,1280Currently in 5 is 256,1280Currently in 6 is 128,1920Currently in 7 is 128,1920Currently in 8 is 128,1920Currently in 9 is 256,1280Currently in 10 is 256,1280Currently in 11 is 256,1280Currently in 12 is 256,1280Currently in 13 is 256,1280Currently in 14 is 256,1280Currently in 15 is 128,1920Currently in 16 is 128,1920Currently in 0 is 192,1920Currently in 1 is 256,1280Currently in 2 is 192,1920Currently in 3 is 192,1920Currently in 4 is 256,1280Currently in 5 is 256,1280Currently in 6 is 192,1920Currently in 7 is 192,1920Currently in 8 is 192,1920Currently in 9 is 256,1280Currently in 10 is 256,1280Currently in 11 is 256,1280Currently in 12 is 256,1280Currently in 13 is 256,1280Currently in 14 is 256,1280Currently in 15 is 192,1920Currently in 16 is 192,1920Currently in 17 is 192,1920Currently in 0 is 256,1920Currently in 1 is 256,1280Currently in 2 is 256,1920Currently in 3 is 256,1920Currently in 4 is 256,1280Currently in 5 is 256,1280Currently in 6 is 256,1920Currently in 7 is 256,1920Currently in 8 is 256,1920Currently in 9 is 256,1280Currently in 10 is 256,1280Currently in 11 is 256,1280Currently in 12 is 256,1280Currently in 13 is 256,1280Currently in 14 is 256,1280Currently in 15 is 256,1920Currently in 16 is 256,1920Currently in 17 is 256,1920Currently in 18 is 256,192what does this mean?1 
Hi I have a class call map.
#include "Map.h" #include <fstream> #include <ostream> #include <istream> Log spritelog("spritedebug.txt", false); Map::Map() { Load(); spritelog << "Sprites are loaded" << std::endl; } void Map::Load() { ifstream resources("resources.txt"); std::string str; int i = 0; while (std::getline(resources, str)) { UsedSprites[i] = new Sprite(0, 0, str); i++; } resources.close(); delete resources; str = ""; ifstream maptext("map.txt"); i = 0; int y = 0; int x = 0; while(std::getline(maptext, str)) { stringstream stream(str); string c = ""; while(std::getline(stream,c, ',')) { int n = atoi(c.c_str()); MapSprite[x] = UsedSprites[n]; MapSprite[x]>X = i*64; MapSprite[x]>Y = y*64; spritelog << n << "Loading into " << x << " at " << i*64 << "," << y*64 << std::endl; i++; x++; } y++; i = 0; } maptext.close(); spritelog << "Loading " << x << " Sprites Into Map at " << y << " lines" << std::endl; delete UsedSprites; delete maptext; } void Map::Render() { for(int i = 0; i < 34; i++) { MapSprite[i]>Render(); spritelog << "Rended: " << i << "X: " << MapSprite[i]>X << " Y: " << MapSprite[i]>Y << std::endl; } }
When I load this text file:
0,1,0,0,11,0,0,0,11,1,1,1,10,0,0,0,01,1,1,1,11,0,0,0,11,1,1,1,10 = green 1= greySee attachments for debug info and screen shot.[attachment=19569:helpc++.PNG][attachment=19570:spritedebug.txt]When is the x and y not the same as what I set it in Load() to what it renders at.0 
I have been told about how hard mmo are but right I am just trying to make a demo because I have a friend who owns a marketing firm whos interested in the game. Right now i am just creating simple code structure so I can show off the concept.
0 
I don't consider myself a beginner, I have over 3 years of c++, c# and game programming behind me but I have not programmed a game with optimized graphics.
0 
Is Direct x portable to mac??
0 
I currently starting to make a mmorpg in c++ using opengl. How could I optimized it to run the best it can on integrated graphics but also take full advantage of top of line graphics card like a GTX 660 or higher.Would it been done directly in the way I code opengl or would it been done by changing the quality of the texture images??
0 
I have a player class like in c++ class i need a player class like witch or warrior
[source lang="cpp"]#ifndef PLAYER_H
#define PLAYER_H
#include "gameobject.h"
#include "gameobject_component.h"
#include <QString>
class Player : public GameObject
{
public:
Player(QString name, int maxlevel, PlayerClass classtype);
Player(QString name, int level, int xp, int maxlevel, PlayerClass classtype);
void Update();
void Checklevel();
void Attack();
virtual ~Player();
bool isactive;
int Level;
int Maxlevel;
int Xp;
float Money;
QString Name;
float Mana;
float Maxmana;
float Health;
float Maxhealth;
float Speed;
float Strenght;
float Intelect;
float Hitrate;
GameObject backpack[30];
GameObject_Component Componets[100];
protected:
private:
};
#endif // PLAYER_H
[/source]0 
What is the best way to represent player classes for an rpg game in c++0 
Is there any open source cross platform rendering/graphics engine for qt2 
Is there any open source cross platform 3d rendering/graphics for qt.0 
Its a 3d game so i want to use opengl0 
I want to use qt because of it network classes and its portability.1 
I'm a very good programmer and have programmed many other games including android and xna game so I'm not worried that my project to big i just need to how to get started.2 
I am starting making a mmorpg game using qt and c++ does if anyone can point my in the right direction such as books, tutorials, website anything to help me get started.2

Advertisement
Opengl qt
in General and Gameplay Programming
Posted
I am trying to display a 64x64 in opengl. The texture loads but I cant get it to display in a square and on the top left corner of the screen. Heres my code for the GLWidget in qt