C/C++ :: Game Mesh Not Loading

Sep 5, 2014

I have this game that I have to make modifications to, it compiles without errors but when I run the game it breaks. Im not very experienced with c++ but im assuming theres an error because it cant find or load the mesh, when it runs, visual studio breaks at the mesh.cpp line 638

View 14 Replies


ADVERTISEMENT

C++ :: Loading File Crashing Multiplayer Game?

Sep 4, 2014

I've been making a multilayer game for a while and have a config that the game loads for the IP and stuff. I just recently put all the loading stuff into a function just so its easier to go through the code, but now the game isn't really working. It works fine on my computer connecting to the server myself, but when someone else tries to do it it seems like the game is working like it says the IP and everything from the config. When it tries to connect it either doesn't work or crashes just saying the program stopped working. Here is the code... I don't know if this is what is causing it to not work or something else.

string LoadConfig(int &loadPort, bool &fullscreen) {
string file;
string loadIP;
vector<string> fileLines;
fstream config("config.txt");
if (config.good()) {

[Code] ....

View 3 Replies View Related

C++ :: Mesh Array Of Double Boost

Jul 11, 2012

I wanna create mesh Array using boost elements, that will be do the same that code below, but can accept numbers of double. Any boost array that give me needed functionality. It will be great that advised element has the same argument list. I mean

// [base,stride,bound)
// [0,2,4)

Or may be there are any opportunity modify this boost::multi_array_types::index_range in order do make it accept double...

1>------ Build started: Project: HP_A.1_d_, Configuration: Debug Win32 ------
1> Main.cpp
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(15): warning C4244: 'argument' : conversion from 'double' to '__w64 int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(15): warning C4244: 'argument' : conversion from 'double' to '__w64 int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(18): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(20): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(20): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1> HP_A.1_d_.vcxproj -> C:all myс++HA level 9SolutionLevel 9DebugHP_A.1_d_.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Code:
#include <boostmulti_array.hpp>
#include <iostream>
typedef boost::multi_array_types::index_range range;

[Code]....

View 1 Replies View Related

C/C++ :: Unable To Calculate Normal Vertex For Terrain Mesh

Apr 17, 2014

Okay I'm trying to calculate vertex normals for my terrain mesh. Obviously it's not working, but I can't work out why. Either its the way I calculate the normals, or the way I assign the final normal.

line 416 is where the normals are assigned to each point in my mesh. line 735 is the function for normals

class Normal3d {
private:
double x;
double y;
double z;
public:
Normal3d(double nx, double ny, double nz) : x(nx), y(ny), z(nz) {
}
Normal3d() {};

[Code]...

View 6 Replies View Related

C++ :: Game Design Practice For Accessing Container Of Game Objects

Dec 21, 2014

I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.

The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.

How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?

View 4 Replies View Related

C++ :: Program For Calculating Total Price Of Game Station And Game

Sep 13, 2014

I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.

View 7 Replies View Related

C++ :: Loading Menu For Files

Jun 11, 2014

I would like to make a program that automatically launches and loads a file when a file of that file type is double clicked within windows. As said I am unsure where to look for some information as to how to do that, and so turn to you all. Is there a simple way of doing such a thing without using any external libraries, if so, a simple tutorial or link to a reference for this; if there is no way of doing this without externals what would be a small and simple to use library for this?

View 2 Replies View Related

C :: Library For Loading Images In PNG?

Jan 29, 2015

What's the best performance library for loading images in PNG?

View 5 Replies View Related

C++ :: Loading A Vector From A File?

May 21, 2014

Alright i have my program and it loads the vector fine and even puts the vector into a txt file but when it comes to lloading it again im not sure if it works or not

#include <iostream>
#include <string>
#include <fstream>

[Code]....

View 2 Replies View Related

C/C++ :: Loading 2D Array From A File?

Sep 10, 2014

The program is supposed to read in a text file, load it into an array and assign a character to each number in the array (so for this I'm thinking I'll be creating 2 arrays, an int array with the numbers read in from the file, and a char array with the characters assigned to the numbers). It will then print these two arrays. It's then supposed to go through the initial int array and search for any numbers whose values differ from their neighboring values by more than one, if such a value is found, it's supposed to give the number the value of the average of it's neighboring values. It's supposed to make all these corrections and then assign characters to these corrected numbers and print out both arrays.

How to load the array from the file. My textbook seems to do a good job of covering arrays and files, but it doesn't really bring them together and talk about building arrays from files. Here is what the file looks like, the first number is the size of the array.

10
7 6 9 4 5 4 3 2 1 0
6 5 5 5 6 5 4 3 2 1
6 5 6 6 7 6 8 4 3 2
1 5 6 7 7 7 6 5 4 3
5 5 6 7 6 7 7 6 5 9
5 6 7 6 5 6 6 5 4 3
5 6 7 9 5 5 6 5 4 3
5 5 6 7 6 6 7 6 5 4
5 9 5 6 7 6 5 0 3 2
5 5 5 5 6 5 4 3 2 7

And here is the code I have so far:

#include <iostream>
#include <fstream>
using namespace std;

[Code]....

When I attempt to compile this (I'm working on a Linux system), I'm getting several errors:

prog1.cpp: In function ?int main()?:
prog1.cpp:37: error: expected unqualified-id before ?[? token
prog1.cpp:39: error: ?numArray? was not declared in this scope
prog1.cpp:39: error: expected primary-expression before ?]? token

View 14 Replies View Related

C++ :: Loading Data From File To RAM?

Mar 29, 2013

What is the most efficient (fastest) way to load data from a file on HDD to RAM? (which would allow to only load a limited section of that file - eg. load only half of the file etc.)

View 3 Replies View Related

C/C++ :: Loading File With Fscanf?

Apr 21, 2015

I am trying to copy the stats from the save file "lol.txt" to main. I posted what the contents of the file below, but for some reason the I get for output jiberish and I cannot seem to figure out why.

#define _CRT_SECURE_NO_WARNINGS
#define MAX_NAME 31
#include <stdio.h>
int main(void){
char sName[MAX_NAME];

[Code] .....

View 5 Replies View Related

Visual C++ :: Loading Bitmap In Particular Way?

May 25, 2013

I have a function that essentially takes a screen shot and saves a pointer to it as a structure. I would like to use the same structure for bitmaps that I load from files.

Code:
typedef struct _BITMAPCAPTURE {
HBITMAP hbm;
LPDWORD pixels;
INT width;
INT height;
} BITMAPCAPTURE;
BOOL CaptureScreen(BITMAPCAPTURE* bmpCapture) {

[code].....

The handle to the bitmap, as well as the width and height are all easy enough to get but I'm unsure of how to get the pixels.

View 2 Replies View Related

C# :: Not Loading Dynamic Array (128,8) Correctly

Feb 14, 2013

Code:
public void dam_data_setup() {
// fill list
damgtype.Add( den1);
damgtype.Add( den2);
damgtype.Add( da1);
damgtype.Add( da2);
damgtype.Add( db1);
damgtype.Add( db2);

[Code] .....

This is a genetics program and is to parse the source array and write all possible combinations to a new array. All sections but dilute work correctly. For some reason the dilute's Boolean is not testing true when it should. This is causing data corruption.

View 3 Replies View Related

C :: Loading Text File To Array

Jul 19, 2013

I'm having troubles with loading my text file into my array.

Code:

int main(int argc,char* argv[]) {
if(argc!=3) {
printf("
Insufficient arguments

[code]...

I'm also suppose to return the size of the input at the end.

View 3 Replies View Related

C++ :: Loading Polymorphic Data From A File

Jun 11, 2014

What is the best / most efficient way to load polymorphic data from a file? I thought you could have an enumeration and for each item to load from a file you could have an integer at the start specifying the type of data, but I think there must be a better way I'm just not sure what.

Example of what I mean:

//The syntax isn't really that important for explanation
class base;
class a: base, b: base;
enum polymorphicType {
A,
B
};

and in the loading code you would have (this is the bit I think could be improved):

polymorphicType t;
File >> t;
if(t == A) {
newObject = new A;
} else if(t == B) {
newObject = new B;
}

I think there is probably a more efficient/better way of doing this I am just unaware of it.

View 4 Replies View Related

C++ :: Produce Loading Bar With Percent Progress Below?

Aug 10, 2014

#include<conio.h>
#include<windows.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include <stdio.h>

void loading();
void gotoxy(int x, int y);
int color(int x);
void gotoxy(int x, int y);

[Code] ....

How to produce a loading bar with percent progress below.

View 1 Replies View Related

C++ :: Saving Object To File And Then Loading It

Jan 29, 2013

Why my code is not working?

Interface
class Person{
private:
char name[80];
short age;
public:
void get_data();

[Code] .....

This is a simple example from and old Lafore C++ book, with a few tweaks by me. The point is simple. Save object person to a *.dat file, exit the program, then start up program again, open up *.dat file, and load contents.

The first problem is the compiler is printing a bunch of Asian characters to the file (is this normal?)

The second problem is, it's not loading the object as it should, giving me a bunch of gibberish.

View 9 Replies View Related

C++ :: File Input Stream Not Loading?

May 9, 2014

#include <cstdlib>
#include <stdio.h>
#include <string>

[Code]....

I'm trying to load a file input stream to load all the character content into a variable (say from a .java file for example), but for some reason whenever I type in the name of the file I want to stream I get the report: RUN FAILED (exit value 1, total time 2s)

View 7 Replies View Related

C++ ::  Loading File With Multiple Lines

May 17, 2014

I'm trying to load a file that look like this:

IP:123.123.123.123
Port:12345

I can't figure out how to load multiple lines. I tried using , but I can't get it to work. Is there a better way of doing it than I am right now? This is my code.

char message[100];
int messageCount = 0;
for(unsigned int i = 0; i < file.size(); ++i) {
message[i] = file[i];

[Code] ....

View 1 Replies View Related

C++ :: How To Display A Loading Bar With Percent Progress

Aug 12, 2014

#include<conio.h>
#include<windows.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include <stdio.h>
void loading();
void gotoxy(int x, int y);
int color(int x);

[Code] ....

How to produce a loading bar with percent progress.

View 6 Replies View Related

C/C++ :: Loading Int Data From File To 2D Array

Apr 28, 2014

Heres what I am suppose to do, So it doesnt seem hard to understand my messy code!

1. Gotta load the file "FactoryData.txt"
2. Load all values in my 2D array (array[5][3])
3. Print out the array to ensure that the copying went by well.

Heres my problem:

1. The for loops is REALLY off in my eyes. From my knowledge (correct me if im wrong), its suppose to be for(r=0;r<5;r++) not <=. BUT somehow im getting the results I want (in terms of formatting). HERE IS MY OUTPUT

Quote
300 450 500 510
510 600 750 627
627 100 420 530
530 621 730 200
200 50 58 100
100 83 4 5
Press Enter to return to Quincy...

View 8 Replies View Related

C/C++ :: Creating And Loading Array Of Cards?

Oct 6, 2014

I am working on a program that is supposed to eventually be able to evaluate bridge hands, but one of the first things I need to do is create and load an array. The program is supposed to read in hands from a file (each line in the file is a hand of 13 cards), evaluate these hands based on a list of rules, and display the results.

Here is the file that will be used for the program:

2C QD TC AD 6C 3D TD 3H 5H 7H AS JH KH
3C 4C 2D AC QC 7S 7C TD 9C 4D KS 8D 6C
2C 3C KC JC 4C 8C 7C QC AC 5C 9C 6C TC
5H 3S 4D KC 9S 3D 4S 8H JC TC 8S 2S 4C
2S 5D 6S 8S 9D 3C 2H TH
2H 6D %S 8S 7S 4D 3H 4S KS QH JH 5C 9S
2C QD TC AD 6C 3D TD 3C 5H 7H AS JH KD QS
2C QD TC AD 6C 3D TD 2C 5D 7H AS JH KD
2H 6D TS 8Z 7S 4D 3H 4S KS QD JH 5C 9S

I've gone through and wrote out what the program is supposed to do and what I think is needed and what steps to take to accomplish this, but am getting stuck on the array. If you can't tell I'm extremely new to this and am still learning. I'm not sure how to create and load an array like this since it seems to me there'd be two elements per index, a suit and a value.

Also, the instructions mention that I will need a data structure to hold the cards in an ordered manner. I'm really confused on this as well, if I'm using an array, how does the data structure come into play?

Can the data structure be used in place of the array?

Here is the code I have so far, but keep in mind that at the moment all it actually does is open the file (The "File is open" message will be taken out as the code progresses, I just threw that in there to make sure the file was actually being opened):

//#include <program3.h>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main() {
char handsArray[];
ifstream bridgeFile;

[code]....

The input should be sorted by suit and the rank within the suit and be displayed in teh following format:

Clubs 10 6 2
Diamonds A Q 10 3
Hearts K J 7 5 3
Spades A
Points = 16

View 3 Replies View Related

C# :: Loading And Saving From Textfile DataGridView

Jul 11, 2014

i have a gataGidView that already has colomns inside, i want to know how i could possibly load data from a text file into it and then save data once the form is closing, im also having trouble with the separators ( winForm visual S...)

Ive already tried planning it but my way doesn't seem to work, heres my logic :

file load

if (file exists)
{
read file/load data
}

[Code]....

View 5 Replies View Related

C# :: Dataset Loading Most Recent Records?

May 16, 2014

what I need to do is load a dataset with the most recent record for each item in the database table. Each item has an ID, location ID and date along with some numeric data. the item ID, location ID, and date is referenced in each record of the table. So each item will have multiple records with different dates that could be anything. To make things worse there may be the same item in multiple locations. and each locations items most recent record needs to loaded in to the dateset and then displayed in a data grid. At a later time there will be a location sort as well so only items in a particular location or group of locations will be loaded. More question on the data grid to come.

View 3 Replies View Related

C# :: Progress Bar Percentage Disappears When Loading

Mar 1, 2014

Why does my progressbar percentage text disapear when progressbar starts loading?? Am I missing out anything?

int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) /
(double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);
using (Graphics gr = progressBar1.CreateGraphics()) {
gr.DrawString(percent.ToString() + "%",
SystemFonts.DefaultFont,

[Code] ....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved