C++ :: How To Get TinyXML In SDL Based Framework To Render Map
Jan 10, 2015
To the topic: I've been following "SDL game development" book by Shaun Mitchell and (besides the many others in the past) I've encountered a problem in one of the chapters.
I'm in "creating and displaying tile maps". The chapter uses tintxml to load data outside the code, which is used to create a "map screen".
The problem is that the program work perfect except for not loading and/or rendering this "screen".
I know this is too vague of an explanation, but I wouldn't know what else to say.
I'm leaving the link to the repository with all the code: [URL]...
View 12 Replies
Mar 4, 2013
I need to render content of CRichEditCtrl on device context of some CWnd. This code works ok:
Code:
CDC *dc = wnd->GetDC();
CRect cr;
wnd->GetClientRect( &cr );
dc->Rectangle(cr);
cr.right *= 15;
cr.bottom *= 15;
[Code] ...
The problem is that I want to scale the output. I was trying to send message to my control before blitting:
SendMessage( EM_SETZOOM, numer, denom ).
It scaled the control itself, but the blitted context was still the same size as original content CRichEditCtrl (befeoe scaling). Is there any way to blit/render scaled content of CRichEditCtrl to any device context (screen/paper) ?
View 3 Replies
View Related
Mar 22, 2014
I am using TinyXML 2 for the data of my RPG game, I am almost done with the tilemap parsing system, but I just couldn't figure out how to extract csv data that I have in my XML file, like this:
<data encoding="csv">
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
[code]....
What I want to do is to extract this data using TinyXML 2 and to put the data into a 2D vector...how can I do that?
View 9 Replies
View Related
May 8, 2013
i am trying to create a firework display by reading in the fireworks off a .xml file, which will then iterate through and launch each firework.
I followed a tutorial on dinomage to find out how to use tinyxml, i learnt that i can store the attributes into char pointers but i dont know how to convert them to GLfloats to store them in my class variables.
I did try using atof but when i ran the program i got loads of errors which im guessing is because the pointer only stores the address which im passing to my variable.
Update
i have found out that tinyxml is not compatible with vs2010 but tinyxml 2 is, so i have changed my code but am still having trouble loading my attributes i have added error checking, and it prints out that the xml has loaded but then it wont load the root
updated code
my code: Firework.h
Code:
#ifndef FIREWORK_H
#define FIREWORK_H
#include <cstdlib>
#include <GLGL.h>
#include <string>
[Code].....
View 14 Replies
View Related
Mar 8, 2014
I'm new to C programming and I need to write a "small" expandable menu framework and I don't know where to start off.
This is my task: Create an expandable menu framework in C where you can add a infinite number of entries and Sub menus containing other Menu points or where the entries refer to a external function. So far I've created the structures I need
Code:
//Menu structure
struct menu {
char mtitel[MAX];
struct mpoint point;
struct menu *next, *prev;
[Code] .....
View 2 Replies
View Related
Apr 15, 2015
I'm a bit unsure on where to put cascading deletes in my models and how far they extend.
I've got four tables
TrafficLog
has a One to One with
TransactionHistory
Has a zero to Many with
OutgoingService
and
Exceptions
Now i'd like to put cascading deletes on, so that if i delete a record from TrafficLog it deletes from the other three.
So do i set up my model with cascade delete just on the primary like this
modelBuilder.Entity<TCC_ArchivedApplicationTrafficLog>()
.HasRequired(TCC_ArchivedTransactionHistory)
.WithRequiredDependent()
.WillCascadeOnDelete(true);
or do i need to enable it on the other three tables too?
View 3 Replies
View Related
Feb 23, 2014
I am trying to load a .bmp file located in the same folder as main.cpp etc. but I'm not sure what to input as the resource path so that it picks it up and, when I distribute it, I want it to be preferably cross platform and run smoothly.
I have tried using:
hello_world.bmp
SDL_Game/hello_world.bmp (SDL_Game is the name of the project)
but it will work if I use the full path. I don't want to do this though, because then it will not work on other computers and platforms.
This is the function I use to load media:
bool loadMedia() {
// Loading success flag
bool success = true;
// Load splash image
gHelloWorld = SDL_LoadBMP("hello_world.bmp");
[Code] ....
I am using XCode 5, SDL2.0.1, OSX 10.9 Mavericks and C++.
View 2 Replies
View Related
Nov 3, 2012
I developed a sample application in EF which has 3 tables
PersonDetails, BankDetails and FixedDepositDetails.
Please find the table structure below
create table PersonDetails
(PersonId int Primary Key,
PersonName varchar(30))
create table BankDetails
(BankId int Primary Key,
BankName varchar(100),
[Code] ....
But when I run the application I get an error as
The navigation property 'Bank_Id' is not a declared property on type 'FixedDepositDetails'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property.
If I am not wrong I think I have made some mistakes when creating the model.
View 1 Replies
View Related
Apr 10, 2013
I would like to try out a range based for loop. I am using gcc 4.6.3. According to the link below, gcc 4.6.3 should allow me to use a range based for loop.
[URL]
However when attempting to run the code below, my IDE (Eclipse) reports the following error:
"error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options:
int a[5] ={1,2,3,4,5};
for (int x : a) {
cout<<x;
}
If gcc 4.6.3 supports range based for loops why do I get this error?
View 1 Replies
View Related
Feb 13, 2013
I am working on my first RPG. Nothing fancy so far... I haven't developed a story or anything, just trying to get the gameplay hammered out. Anyway, I have a couple of NPCs and Items and I was wondering how I should program these interactive spots. I'm unsure whether I should loop the Room info or continue forward with if statements. With Items, I want to prevent the player trying to use the option to get the item again (after you pick up the item, the option is gone. Here are a couple examples of where I have the problem
else if(playerloc == 3)
{
cout << "There is a hooded figure in the corner. "
<< "The person waves you over.
";
[Code]....
What I want to do after the character interaction is complete is continue forward with the option to go south or east. I could return to the room menu, or continue by coding forward and allow the option to go east or south with more if-else-if chains..
In the next bit, I want to program the item to be picked up and then the treasure chest will be empty.
else if(playerloc == 5)
{
cout << "There is a treasure chest in the Northwest corner of this room.
"
[Code].....
View 1 Replies
View Related
Aug 7, 2014
I am new to C# and just want to understand if an entire Test Automation Framework can be built using only C#. I would not want any dependency on available commercial tools in the market for executing the Test Action steps. Though a few points that i see will need to be taken care of at the onset.
1. creating and maintaining Object repository in some form of file extension
2. preparing a GUI for capturing user Test Action Steps
3. retrieving the respective test objects from Object Repository and firing the respective Action commands on those objects
4. handling test data within the Automation Framework Solution folder.
I have been exploring a series of blogs and found that point # 2 and 4 are achievable. However points 1 & 3 above looks a big challenge.
View 4 Replies
View Related
Jul 10, 2012
Another fun question... Is it possible to make a type, based on a value ?
What I'm looking for is way to return the smallest (sizeof) unsigned integral type that will hold a certain value.
smallest_type<14>::type // unsigned char
smallest_type<127>::type // unsigned char
smallest_type<255>::type // unsigned char
smallest_type<256>::type // unsigned short
smallest_type<64000>::type // unsigned short
smallest_type<128000>::type // unsigned long
smallest_type<5000000000>::type // unsigned long long
View 3 Replies
View Related
Dec 9, 2013
I am trying to fscanf a file and need to read the variable name 'f9' and 'a2' for example in the sample below and get their corresponding values '8' and '2' and then in my C program set the variables f9 and a2 accordingly (which I can declare as variables). Is this possible?
I making a Sudoku Solver and am thinking I would store the puzzle solution in a 2D array with a1=0, a2=1, etc... where 0, 1 are the array indices... then just print the array as the solution.
Note: The a1, a2, a3, etc... is my own numbering of the indices where the letter corresponds to the row and the number corresponds to the column (starting from 1) which I use when feeding to the solver.
I have a file that has the following format (output of Z3 SMT solver):
sat
(model
(define-fun f9 () Int
8)
(define-fun a2 () Int
2)
(define-fun c5 () Int
6)
)
View 1 Replies
View Related
Oct 24, 2013
I'm currently creating a text-based RPG, to get myself back into learning C++ again. The problem seems to be with the if-else ladder of statements, the user selects which race they wish to play as, which as a result creates the appropriate object for that race.
This is the character selection option code:
std::cout << "Please select a race: Human [1], Elf [2], Dwarf [3] or Orc [4]
";
std::cout << "Race selection: ";
std::cin >> race_selection;
std::cin.ignore();
switch (race_selection) {
[Code] .....
The problem here is, regardless of which race I use using the above switch statement, the Human object always seems to be created, instead of the object for the desired race.
View 4 Replies
View Related