Search found 8 matches

by WilsonHuang
October 10th, 2019, 1:59 am
Forum: Everything
Topic: Question about scaling sprites
Replies: 10
Views: 61

Re: Question about scaling sprites

scale = .9f; for (int dy = 0; dy < (int)ceil(.9f); dy++) { for (int dx = 0; dx < (int)ceil(.9f); dx++) Does this help? Basically, you are only iterating from 0 to 1 ( ceil( .9f ) = 1.f ). Your code works for scaling up because the ratio for the sprite pixel to screen pixel is 2:1 or something like ...
by WilsonHuang
October 10th, 2019, 12:48 am
Forum: Everything
Topic: Question about scaling sprites
Replies: 10
Views: 61

Re: Question about scaling sprites

AleksiyCODE wrote:
October 9th, 2019, 7:17 pm
Well, i made a quick (shitty) animated sprite tester for my friend, and there is simple scaling built in (arrow keys change animation playback speed and size)
https://gitlab.com/AleksiyCODE/st
you may be able to get some ideas from there (but the code is shit)
Thanks, I'll give it a look!
by WilsonHuang
October 8th, 2019, 5:05 am
Forum: Everything
Topic: Question about scaling sprites
Replies: 10
Views: 61

Question about scaling sprites

After learning Intermediate Tutorial 12 [Animated Sprite Character]. I want to add the scaling effect to the sprite, which you can enlarge or shrink sprites. My code seems okay when enlarge the sprites. However, I have invisible cover when I shrink the sprites. How do I fix it? Here is my code: #inc...
by WilsonHuang
June 25th, 2019, 2:55 am
Forum: Everything
Topic: Beginning C++ Tutorial 14
Replies: 9
Views: 585

Re: Beginning C++ Tutorial 14

Hi, DrewAmu, please check the Solution Configuration is switched to "Debug".
If the solution configuration is release mode. The assertion check will be skipped

UPDATED:
Be sure your value of x in PutPixel is between 0 and 799, y is between 0 to 599
未命名.png
(67.98 KiB) Not downloaded yet
by WilsonHuang
June 19th, 2019, 1:52 am
Forum: Everything
Topic: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem
Replies: 7
Views: 475

Re: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem

By the way, these have been the most difficult for me to find as well, especially if it isn't my code, but the clue is the "stack corruption" as this will always have you looking for out of bounds access either through C array or pointer arithmetic. Thank you for giving me tips to understand the er...
by WilsonHuang
June 17th, 2019, 6:02 am
Forum: Everything
Topic: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem
Replies: 7
Views: 475

Re: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem

I think I found the bug. The bug is happened in my second post "List[MAX] = {};". My value of Max variable is 50. The index range is from 0~49. I try to access the value at index 50, which is out of range, and cause the program crashed. But why the exception message is "Stack around the variable 'db...
by WilsonHuang
June 17th, 2019, 12:07 am
Forum: Everything
Topic: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem
Replies: 7
Views: 475

Re: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem

What steps have you taken to debug the executable? Hi, chili, here is the steps I've taken to debug (using breakpoint): 1. Add a datum to the array, and see if the datum store in the array. (Yes, it store in the array) 2. Add a another datum to the array, and see if the datum store in the next posi...
by WilsonHuang
June 16th, 2019, 1:44 am
Forum: Everything
Topic: Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem
Replies: 7
Views: 475

Intermediate C++ Game Programming Tutorial 4 File IO Homework Problem

Hi, everybody. I'm new here, and this is my first post. First, thanks to Chili making these great game programming tutorials. Let us know the idea of game programming, and had a chance to make our own game. I'm now at Intermediate C++ Game Programming Tutorial 4 File IO Homework part. My program wil...