Skip to content

Instantly share code, notes, and snippets.

View stephan-vandenheuvel's full-sized avatar

Stephan van den Heuvel stephan-vandenheuvel

View GitHub Profile
class A
{
void Foo();
}
class B : public A
{
//intended to override A's Foo, but hides it, because A's Foo is non virtual
//including override here would allow the compiler to catch the error
virtual void Foo();
}
//GCC DEFAULT
void sprite_set(u8 id, u8 xpos, u8 ypos, u16 sprite_number) {
104: e52db004 push {fp} ; (str fp, [sp, #-4]!)
108: e28db000 add fp, sp, #0
10c: e24dd010 sub sp, sp, #16
110: e54b0004 strb r0, [fp, #-4]
114: e54b1008 strb r1, [fp, #-8]
118: e54b200c strb r2, [fp, #-12]
11c: e14b31b0 strh r3, [fp, #-16]
#ifndef _GCC_WRAP_STDINT_H
#if __STDC_HOSTED__
# include_next <stdint.h>
#else
# include "stdint-gcc.h"
#endif
#define _GCC_WRAP_STDINT_H
#endif
m_System_Collections_Generic_Dictionary_2_System_Collections_Generic_KeyValuePair_2_int_int_DungeonTile_get_Item_System_Collections_Generic_KeyValuePair_2_int_int:
0024bb70 e1a0c00d mov r12, sp
0024bb74 e92d4080 push {r7, lr}
0024bb78 e1a0700d mov r7, sp
0024bb7c e92d5d60 push {r5, r6, r8, r10, r11, r12, lr}
0024bb80 e24dd024 sub sp, sp, #0x24
0024bb84 e1a0b00d mov r11, sp
0024bb88 e1a0a000 mov r10, r0
0024bb8c e58b1010 str r1, [r11, #16]
0024bb90 e58b2014 str r2, [r11, #20]
struct MyPackeddata {
uint twoBitVal : 2;
unit fourBitVal : 4;
uint oneBitVal : 1;
uint oneBitVal : 1;
};
void foo(int j) {
static int x = j;
x++;
printf("%d\n", x);
}
int main() {
foo(5);
foo(1);
}
HandleCollisionEvent(RigidBody body) {
Entity* ePtr = body->GetEntity();
ProjectileComponent* pcPtr = ePtr->GetComponent<ProjectileComponent>();
if (pcPtr != null) {
//we have a Projectile Component and we can use it here
}
}