Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - YellowShadow

Pages: [1] 2
1
General discussions / Help with VC++ Express 2010
« on: August 17, 2010, 08:42:54 am »
Hey,

I'm using the latest SDK of SFML. I followed this guide http://ggammon.wordpress.com/2010/02/14/compiling-and-running-an-sfml-application-in-visual-studio-2010-rc/ and compiled SFML with VC++ Express 2010 but when I go in and create a project and link to the libraries the linker complains and says it can't find the files.

I setup the include and lib paths and I know the files are there.

Am I doing something wrong?

Thanks,
YellowShadow

2
Graphics / RenderWindow draws white sprites
« on: January 17, 2010, 05:10:11 pm »
Thanks! I'll check those out :)

3
Graphics / RenderWindow draws white sprites
« on: January 17, 2010, 05:19:19 am »
Yea, I'm gonna pick up a book or something and learn C++.

4
Graphics / RenderWindow draws white sprites
« on: January 17, 2010, 01:47:34 am »
How do I make member variables in a class?

5
Graphics / RenderWindow draws white sprites
« on: January 16, 2010, 09:34:21 pm »
How come when I'm drawing sprites on my RenderWindow they come up as white? I'm on Windows, and SFML 1.5.

Any ideas?

Here is some loading and drawing code:
Code: [Select]

void Board::LoadContent()
{
sf::Image boardImage;
boardImage.LoadFromFile("data/board.png");
boardTexture = sf::Sprite(boardImage);
tileSize = boardTexture.GetSize().x / BOARDSIZE;

sf::Image pieceSetImage;
pieceSetImage.LoadFromFile("data/jewels.png");
pieceSet.SetImage(pieceSetImage);
}

void Board::Draw()
{
renderWindow.Draw(boardTexture);
renderWindow.Draw(pieceSet);
}


If anyone could help me that would be great :)

6
General / [C++] Help with classes
« on: January 15, 2010, 06:41:00 am »
Right after the includes in the Board.h file.

7
General / [C++] Help with classes
« on: January 15, 2010, 03:47:18 am »
I tried that, but I got some new errors:

Quote

1>------ Build started: Project: TreasureHunt, Configuration: Debug Win32 ------
1>Compiling...
1>Board.cpp
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C2079: 'Board::highlighedPiece' uses undefined class 'Piece'
1>c:\dev\treasurehunt\treasurehunt\src\board.cpp(11) : warning C4482: nonstandard extension used: enum 'BoardState' used in qualified name
1>Main.cpp
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C2079: 'Board::highlighedPiece' uses undefined class 'Piece'
1>Piece.cpp
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C2079: 'Board::highlighedPiece' uses undefined class 'Piece'
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(27) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(37) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(40) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(43) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(46) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>Generating Code...
1>Build log was saved at "file://c:\Dev\TreasureHunt\TreasureHunt\Obj\Debug\BuildLog.htm"
1>TreasureHunt - 3 error(s), 6 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


How come it says Piece is undefined?

8
General / [C++] Help with classes
« on: January 15, 2010, 02:33:14 am »
I'm trying to write some classes for my game, but I keep running into some stupid errors.

Here is my Board.h file:
Code: [Select]

#ifndef BOARD_H
#define BOARD_H

#define PIECE_WIDTH 65
#define PIECE_HEIGHT 67
#define BOARDSIZE 8

#include <SFML/Graphics.hpp>
#include <list>

enum BoardState { INTERACTIVE, FALLING_JEWELS, SWAPPING_JEWELS };

class Board
{
public:
Board();
Board(sf::Randomizer rand);
~Board();

int TileSize() { return tileSize; }
int CurrentlyMovingPieces;
sf::Vector2f TopLeft;

protected:
int tileSize;
BoardState boardState;
bool isActive;
bool canSwap;

sf::Sprite pieceSet;
sf::Sprite pieceHighlight;
sf::Sprite selectionSprite;
sf::Sprite bonusBarSprite;

//Piece pieceMap[BOARDSIZE][BOARDSIZE];
int mouseTileX, mouseTileY;
//Piece highlighedPiece;
float hilightAlpha;
int currenltyMOvingJewels;
float delayDrop;

float swapAlpha;
//SwapInfo swappingInfo;
bool validateSwap;

bool needToDropJewels;

sf::Randomizer rand;

//std::list<Piece> pieceRemains;
//std::list<Piece> hintPieces;
float hintTimer;
float hintDelay;

int baseScore;
int bonusLevel;
int removedPieces;
float removedPieceCounter;
int nextLevelLimit;
int totalRemovedPieces;
bool aboutToChangeLevel;
int longestChain;

float bonusFlashAlpha;

float timeLeft;
float maxTimeLeft;
float timePerJewel;
float timeReductionSpeed;
float timeLeftCounter;
float noMovesAlpha;

bool populatingPieces;
bool populatePieceCounterX;
bool populatePieceCounterY;
int populatePieceCursorDir;
float delayPerPiece;
};

#endif


and here is my Piece.h file:
Code: [Select]

#ifndef PIECE_H
#define PIECE_H

#include <SFML/Graphics.hpp>
#include "Board.h"

enum Direction { NONE, UP, DOWN, LEFT, RIGHT };
enum Type { YELLOW = 0, BLUE, CYAN, GREEN };

class Piece
{
public:
Piece();
Piece(Board parent);
Piece(Board parent, int x, int y, Type type);

void StartMoving(Direction dir, int howManySlots);
void StartMoving(Direction dir);
void Die();

void Update(float elapsedTime);
void Draw(sf::RenderWindow &App, sf::Color color, sf::Sprite sprite);

private:
sf::Vector2f position;
Type pieceType;
Board parentBoard;

bool moving;
int movedSlots;
bool reportedMove;
Direction movingDir;
float movingCounter;
sf::Vector2f targetPosition;
sf::Vector2f startPosition;
sf::Vector2f moveDirVector;
float movingAccel;

bool isDying;
float deathCounter;
bool readyToGo;
};

#endif


If I uncomment the Piece highlightedPiece in the Board.h file, or add the line:
Code: [Select]
#include "Piece.h" to my Board.H file, I get a ton of compiler errors, I don't know how to fix.

Can anyone help me?

Here is the compiler log when I added
Code: [Select]
#include "Piece.h" and uncommented the Piece highlitedPiece line in my Board.h file:

Quote
1>------ Build started: Project: TreasureHunt, Configuration: Debug Win32 ------
1>Compiling...
1>Board.cpp
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(14) : error C2061: syntax error : identifier 'Board'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(14) : error C2535: 'Piece::Piece(void)' : member function already defined or declared
1>        c:\dev\treasurehunt\treasurehunt\src\piece.h(13) : see declaration of 'Piece::Piece'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(15) : error C2061: syntax error : identifier 'Board'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(15) : error C2535: 'Piece::Piece(void)' : member function already defined or declared
1>        c:\dev\treasurehunt\treasurehunt\src\piece.h(13) : see declaration of 'Piece::Piece'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C2146: syntax error : missing ';' before identifier 'parentBoard'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\treasurehunt\treasurehunt\src\board.cpp(10) : warning C4482: nonstandard extension used: enum 'BoardState' used in qualified name
1>Main.cpp
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(14) : error C2061: syntax error : identifier 'Board'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(14) : error C2535: 'Piece::Piece(void)' : member function already defined or declared
1>        c:\dev\treasurehunt\treasurehunt\src\piece.h(13) : see declaration of 'Piece::Piece'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(15) : error C2061: syntax error : identifier 'Board'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(15) : error C2535: 'Piece::Piece(void)' : member function already defined or declared
1>        c:\dev\treasurehunt\treasurehunt\src\piece.h(13) : see declaration of 'Piece::Piece'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C2146: syntax error : missing ';' before identifier 'parentBoard'
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\treasurehunt\treasurehunt\src\piece.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Piece.cpp
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C2146: syntax error : missing ';' before identifier 'highlighedPiece'
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\treasurehunt\treasurehunt\src\board.h(39) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(27) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(37) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(40) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(43) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>c:\dev\treasurehunt\treasurehunt\src\piece.cpp(46) : warning C4482: nonstandard extension used: enum 'Direction' used in qualified name
1>Generating Code...
1>Build log was saved at "file://c:\Dev\TreasureHunt\TreasureHunt\Obj\Debug\BuildLog.htm"
1>TreasureHunt - 17 error(s), 6 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


If anyone could help me that would be great!
Thanks :)

9
General discussions / Memory Leak?
« on: January 12, 2010, 12:07:45 am »
Okay, I'll try the SVN version of SFML. Thanks :)

10
General discussions / Memory Leak?
« on: January 11, 2010, 11:51:10 pm »
Quote from: "Laurent"
Some leaks have already been fixed after the latest release.


Should I check out SFML from SVN and compile that and use that with my project?

11
General discussions / Memory Leak?
« on: January 11, 2010, 10:39:55 pm »
I think there is a memory leak in the latest release of SFML. I'm using the CRT Debugging feature to check for memory leaks while debugging the application in Visual C++.

Here is my output:

Quote

'TreasureHunt.exe': Loaded 'C:\Dev\TreasureHunt\TreasureHunt\Build\Debug\TreasureHunt.exe', Symbols loaded.
'TreasureHunt.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'TreasureHunt.exe': Loaded 'C:\Dev\TreasureHunt\TreasureHunt\Build\Debug\sfml-window-d.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\opengl32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\user32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\glu32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\ole32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\winmm.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'TreasureHunt.exe': Loaded 'C:\Dev\TreasureHunt\TreasureHunt\Build\Debug\sfml-system-d.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll'
'TreasureHunt.exe': Loaded 'C:\Dev\TreasureHunt\TreasureHunt\Build\Debug\sfml-graphics-d.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\imm32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\msctf.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\lpk.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\usp10.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\atioglxx.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\version.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\ws2_32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\nsi.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\atiadlxx.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\wintrust.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\crypt32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\msasn1.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\userenv.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\secur32.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\imagehlp.dll'
Detected memory leaks!
Dumping objects ->
{145} normal block at 0x00116350, 20 bytes long.
 Data: <Pc  Pc  Pc      > 50 63 11 00 50 63 11 00 50 63 11 00 CD CD CD CD
{144} normal block at 0x00116238, 216 bytes long.
 Data: < u              > AC 75 03 10 01 00 00 00 01 00 00 00 00 00 00 00
{143} normal block at 0x001161F8, 4 bytes long.
 Data: <8b  > 38 62 11 00
Object dump complete.
'TreasureHunt.exe': Loaded 'C:\Windows\System32\dinput.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\hid.dll'
'TreasureHunt.exe': Loaded 'C:\Windows\System32\clbcatq.dll'
The program '[5672] TreasureHunt.exe: Native' has exited with code 0 (0x0).


and here is the code I'm using:
Code: [Select]

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

#include <SFML/Graphics.hpp>

int main()
{
_CrtDumpMemoryLeaks();

sf::RenderWindow App(sf::VideoMode(1024, 728, 32), "Treasure Hunt");

sf::Image Image;
if (!Image.LoadFromFile("data/background.png"))
return EXIT_FAILURE;

sf::Sprite Sprite(Image);

while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
}

float ElapsedTime = App.GetFrameTime();

App.Clear();
App.Draw(Sprite);
App.Display();
}

return EXIT_SUCCESS;
}


Just wanted to let you guys know. I don't know if it's in my application or in the actual SFML library, but hopefully a better developer than me can help me :)

12
General / Visual C++ Questions
« on: January 30, 2009, 05:36:00 pm »
I got it to work :) I think there was something wrong with my project file so I just started over and so far everything seems to work :)

Thanks guys!

13
General / Visual C++ Questions
« on: January 30, 2009, 08:11:55 am »
Bump.

I still need help on this.

14
General / Visual C++ Questions
« on: January 27, 2009, 12:56:08 am »
I think there may be some other problem that's not letting the loading happen. I commented out the image loading and App.Draw() line, and I still get a buffer overflow.

Code: [Select]

First-chance exception at 0x00431819 in Client.exe: 0xC0000005: Access violation reading location 0xcccccccc.
A buffer overrun has occurred in Client.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.


Am I doing something wrong? I can put up the actual project/solution if it's really needed to see if I'm setting up everything correctly.

15
General / Visual C++ Questions
« on: January 25, 2009, 11:57:03 pm »
Bump. I still need help with this.

Can anyone help?

Pages: [1] 2